<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.dolibarr.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Delcroip</id>
	<title>Dolibarr ERP CRM Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.dolibarr.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Delcroip"/>
	<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php/Special:Contributions/Delcroip"/>
	<updated>2026-11-11T06:11:40Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=52142</id>
		<title>Module Timesheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=52142"/>
		<updated>2021-10-10T10:18:53Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: update change log an doc link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:timesheet]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
&amp;lt;seo metak=&amp;quot;timesheet, Dolibarr, interface, project, task, report, approval&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Informations=&lt;br /&gt;
[[File:Warning.png]] This module is an external module. It provide another view of the native feature to enter timesheet available in [[Module Projects]] among other features&lt;br /&gt;
&lt;br /&gt;
[https://dolibarr-timesheet.readthedocs.io/en/latest/ Documentation: https://dolibarr-timesheet.readthedocs.io/en/latest/]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=timesheet&lt;br /&gt;
|editor=delcroip&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=timesheet}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=projects&lt;br /&gt;
|minversion=3.5.0&lt;br /&gt;
|maxversion=6.0&lt;br /&gt;
|note=Latest Module version: 2.0.1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=Features=&lt;br /&gt;
&lt;br /&gt;
 - Timesheet interface for all the user task per week&lt;br /&gt;
 - Generate report on user and on project per month&lt;br /&gt;
 - favourties to show only some project/task by a simple click on a start icon next to the task name&lt;br /&gt;
 - Approval of the timesheets per the N+1&lt;br /&gt;
 - Approval of the timesheets per project manager&lt;br /&gt;
 - Generate project invoice from timesheet data&lt;br /&gt;
&lt;br /&gt;
 [[File:timesheet_timeentry.jpg]]&lt;br /&gt;
&lt;br /&gt;
=Change logs=&lt;br /&gt;
 https://github.com/delcroip/dolibarr_project_timesheet/blob/master/htdocs/timesheet/ChangeLog.md&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=FAQ_Migrate_my_Mysql_database_to_PostgreSQL&amp;diff=40734</id>
		<title>FAQ Migrate my Mysql database to PostgreSQL</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=FAQ_Migrate_my_Mysql_database_to_PostgreSQL&amp;diff=40734"/>
		<updated>2019-01-15T10:41:12Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:FAQ EN]]&lt;br /&gt;
&lt;br /&gt;
= Prerequisite=&lt;br /&gt;
Your Dolibarr version must be at least version 3.2.0.&lt;br /&gt;
If not, first upgrade your Dolibarr keeping MySq. Once upgrade is ok, you must clean database from old tables by running following request on your Mysql database:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE llx_c_methode_commande_fournisseur;&lt;br /&gt;
DROP TABLE llx_c_source;&lt;br /&gt;
DROP TABLE llx_cond_reglement;&lt;br /&gt;
DROP TABLE llx_expedition_methode;&lt;br /&gt;
DROP TABLE llx_product_fournisseur;&lt;br /&gt;
ALTER TABLE llx_product_fournisseur_price DROP COLUMN fk_product_fournisseur;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Process=&lt;br /&gt;
&lt;br /&gt;
===Export Mysql===&lt;br /&gt;
* Go onto page &#039;&#039;&#039;Setup - Tools - Backup&#039;&#039;&#039;. &lt;br /&gt;
* Choose export method &amp;quot;&#039;&#039;&#039;MySql dump&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
* Choose export compatibility &amp;quot;&#039;&#039;&#039;POSTGRESQL&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
* Uncheck &amp;quot;&#039;&#039;&#039;Structure&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
* Check &amp;quot;&#039;&#039;&#039;Name columns&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
* Uncheck &amp;quot;&#039;&#039;&#039;Use extended INSERT&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
* Choose &amp;quot;&#039;&#039;&#039;No LOCK command around INSERT&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
* Into &#039;&#039;&#039;Compression&#039;&#039;&#039; area, choose &amp;quot;&#039;&#039;&#039;Compress None&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
* Then click on &amp;quot;&#039;&#039;&#039;Build backup&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
* Go into directory of your Dolibarr data files (directory is defined into &amp;quot;&#039;&#039;&#039;Setup - System information - Dolibarr - All parameters&#039;&#039;&#039;&amp;quot; on line &amp;quot;&#039;&#039;&#039;Root directory for data files&#039;&#039;&#039;&amp;quot;). Go into subdirectory &#039;&#039;&#039;admin/backup&#039;&#039;&#039;. You will find the dump of database you just build with previous step. Copy this file into /tmp directory.&lt;br /&gt;
&lt;br /&gt;
===Create a PostGreSQL database===&lt;br /&gt;
* Rename your &#039;&#039;&#039;conf.php&#039;&#039;&#039; file of Dolibarr into conf.php.mysql (file should be into &#039;&#039;&#039;/etc/dolibarr&#039;&#039;&#039; or &#039;&#039;&#039;htdocs/conf&#039;&#039;&#039;)&lt;br /&gt;
* Create an empty file &#039;&#039;&#039;conf.php&#039;&#039;&#039; to replace the renamed one, with read and write permission for everybody.&lt;br /&gt;
* Run Dolibarr. Because the conf.php file is empty, the install process will be suggested instead of logon page. Choose first installation and provide all informations of your postgresql database as data source. Run process until the end. About administrator account asked at end, choose same than the one existing into your MySql sessions.&lt;br /&gt;
* Connect. You are now into an empty new instance of Dolibarr without old data. &lt;br /&gt;
* Enable all modules that were enabled into old database (enable is enough to create modules specific tables, that&#039;s all what we want: having same structure than old database).&lt;br /&gt;
* If you added &amp;quot;complementary fields&amp;quot; for some element, you must also defined them into this new instance (again, to have same fields into database than previous instance).&lt;br /&gt;
* We will load old data at next step.&lt;br /&gt;
Note: If you experience problem, you can go back to your Mysql database by restoring files renamed previsously into its original name &#039;&#039;&#039;conf.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Import dump file ===&lt;br /&gt;
* Modify postgresql configuration to accept syntax from mysql file by setting the directive escape_string_warning to off into file &#039;&#039;&#039;postgresql.conf&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
escape_string_warning = off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Restart postgresql.&lt;br /&gt;
* Disable all constraint checks to allow import. For this, connect to database and run the procedure provided by Dolibarr installation:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
psql -h name_or_ip_of_postgresql_server -d name_database_postgresql -U login_database_mysql&lt;br /&gt;
&amp;gt; select dol_util_triggerall(false);&lt;br /&gt;
CTRL+D&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Modify the generated export dump file to set escape characters with correct value for postgres:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /tmp&lt;br /&gt;
sed -e &amp;quot;s/\\\&#039;/\&#039;\&#039;/g&amp;quot; mysqldump_mydatabase_version_date.sql &amp;gt; mysqldump_readyforpgsql.sql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* After conversion of file, import it into your empty postgresql database:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql -h name_or_ip_of_postgresql_server -d name_database_postgresql -U login_database_mysql -f mysqldump_readyforpgsql.sql &amp;gt;resimport.log 2&amp;gt;&amp;amp;1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Take a look at output log file resimport.log. If target structure was correctly matching mysql structure (no less tables nor fields), you should get no error.&lt;br /&gt;
If you have error, please report them onto dolibarr forum.&lt;br /&gt;
Note that you can run this import several time if you fixed error manually to your structure. It is safe because all dolibarr tables are protected by a &amp;quot;unique key&amp;quot;. So if you do so, you will just get &amp;quot;duplicate record&amp;quot; errors, that you can ignore. Take care only on others.&lt;br /&gt;
* Once import is finished, you must enable constraint check and update all sequences to match imported data.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
psql -h name_or_ip_of_postgresql_server -d name_database_postgresql -U login_database_mysql&lt;br /&gt;
&amp;gt; select dol_util_triggerall(true);&lt;br /&gt;
&amp;gt; select dol_util_rebuild_sequences();&lt;br /&gt;
CTRL+D&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
You can also restore the postgresql.conf file to its initial value.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
escape_string_warning = on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Modify your Dolibarr setup file===&lt;br /&gt;
* Open with a file editor, the file conf/conf.php that you can find into your Dolibarr root installation.&lt;br /&gt;
* Modify lines to make program files to point to the new database&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
$dolibarr_main_db_host=&#039;name_or_ip_of_postgresql_server&#039;;&lt;br /&gt;
$dolibarr_main_db_port=&#039;port_of_postgresql_server&#039;;&lt;br /&gt;
$dolibarr_main_db_name=&#039;name_database_postgresql&#039;;&lt;br /&gt;
$dolibarr_main_db_user=&#039;login_database_postgresql&#039;;&lt;br /&gt;
$dolibarr_main_db_pass=&#039;password_database_postgresql&#039;;&lt;br /&gt;
$dolibarr_main_db_type=&#039;pgsql&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test===&lt;br /&gt;
You should now have an application 100% working with all its data.&lt;br /&gt;
Old MySql database can be closed.&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=FAQ_Migrate_my_Mysql_database_to_PostgreSQL&amp;diff=40718</id>
		<title>FAQ Migrate my Mysql database to PostgreSQL</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=FAQ_Migrate_my_Mysql_database_to_PostgreSQL&amp;diff=40718"/>
		<updated>2019-01-14T20:09:42Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:FAQ EN]]&lt;br /&gt;
&lt;br /&gt;
= Prerequisite=&lt;br /&gt;
Your Dolibarr version must be at least version 3.2.0.&lt;br /&gt;
If not, first upgrade your Dolibarr keeping MySq. Once upgrade is ok, you must clean database from old tables by running following request on your Mysql database:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
DROP TABLE llx_c_methode_commande_fournisseur;&lt;br /&gt;
DROP TABLE llx_c_source;&lt;br /&gt;
DROP TABLE llx_cond_reglement;&lt;br /&gt;
DROP TABLE llx_expedition_methode;&lt;br /&gt;
DROP TABLE llx_product_fournisseur;&lt;br /&gt;
ALTER TABLE llx_product_fournisseur_price DROP COLUMN fk_product_fournisseur;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Process=&lt;br /&gt;
&lt;br /&gt;
===Export Mysql===&lt;br /&gt;
* Go onto page &#039;&#039;&#039;Setup - Tools - Backup&#039;&#039;&#039;. &lt;br /&gt;
* Choose export method &amp;quot;&#039;&#039;&#039;MySql dump&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
* Choose export compatibility &amp;quot;&#039;&#039;&#039;POSTGRESQL&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
* Uncheck &amp;quot;&#039;&#039;&#039;Structure&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
* Check &amp;quot;&#039;&#039;&#039;Name columns&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
* Uncheck &amp;quot;&#039;&#039;&#039;Use extended INSERT&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
* Choose &amp;quot;&#039;&#039;&#039;No LOCK command around INSERT&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
* Into &#039;&#039;&#039;Compression&#039;&#039;&#039; area, choose &amp;quot;&#039;&#039;&#039;Compress None&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
* Then click on &amp;quot;&#039;&#039;&#039;Build backup&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
* Go into directory of your Dolibarr data files (directory is defined into &amp;quot;&#039;&#039;&#039;Setup - System information - Dolibarr - All parameters&#039;&#039;&#039;&amp;quot; on line &amp;quot;&#039;&#039;&#039;Root directory for data files&#039;&#039;&#039;&amp;quot;). Go into subdirectory &#039;&#039;&#039;admin/backup&#039;&#039;&#039;. You will find the dump of database you just build with previous step. Copy this file into /tmp directory.&lt;br /&gt;
&lt;br /&gt;
===Create a PostGreSQL database===&lt;br /&gt;
* Rename your &#039;&#039;&#039;conf.php&#039;&#039;&#039; file of Dolibarr into conf.php.mysql (file should be into &#039;&#039;&#039;/etc/dolibarr&#039;&#039;&#039; or &#039;&#039;&#039;htdocs/conf&#039;&#039;&#039;)&lt;br /&gt;
* Create an empty file &#039;&#039;&#039;conf.php&#039;&#039;&#039; to replace the renamed one, with read and write permission for everybody.&lt;br /&gt;
* Run Dolibarr. Because the conf.php file is empty, the install process will be suggested instead of logon page. Choose first installation and provide all informations of your postgresql database as data source. Run process until the end. About administrator account asked at end, choose same than the one existing into your MySql sessions.&lt;br /&gt;
* Connect. You are now into an empty new instance of Dolibarr without old data. &lt;br /&gt;
* Enable all modules that were enabled into old database (enable is enough to create modules specific tables, that&#039;s all what we want: having same structure than old database).&lt;br /&gt;
* If you added &amp;quot;complementary fields&amp;quot; for some element, you must also defined them into this new instance (again, to have same fields into database than previous instance).&lt;br /&gt;
* We will load old data at next step.&lt;br /&gt;
Note: If you experience problem, you can go back to your Mysql database by restoring files renamed previsously into its original name &#039;&#039;&#039;conf.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Import dump file ===&lt;br /&gt;
* Modify postgresql configuration to accept syntax from mysql file by setting the directive escape_string_warning to off into file &#039;&#039;&#039;postgresql.conf&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
escape_string_warning = off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Restart postgresql.&lt;br /&gt;
* Disable all constraint checks to allow import. For this, connect to database and run the procedure provided by Dolibarr installation:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
psql -h name_or_ip_of_postgresql_server -d name_database_postgresql -U login_database_mysql&lt;br /&gt;
&amp;gt; select dol_util_triggerall(false);&lt;br /&gt;
CTRL+D&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Modify the generated export dump file to set escape characters with correct value for postgres:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /tmp&lt;br /&gt;
sed -e &amp;quot;s/\\\&#039;/\&#039;\&#039;/g&amp;quot; mysqldump_mydatabase_version_date.sql &amp;gt; mysqldump_readyforpgsql.sql&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* After conversion of file, import it into your empty postgresql database:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql -h name_or_ip_of_postgresql_server -d name_database_postgresql -U login_database_mysql -f mysqldump_readyforpgsql.sql &amp;gt;resimport.log 2&amp;gt;&amp;amp;1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Take a look at output log file resimport.log. If target structure was correctly matching mysql structure (no less tables nor fields), you should get no error.&lt;br /&gt;
If you have error, please report them onto dolibarr forum.&lt;br /&gt;
Note that you can run this import several time if you fixed error manually to your structure. It is safe because all dolibarr tables are protected by a &amp;quot;unique key&amp;quot;. So if you do so, you will just get &amp;quot;duplicate record&amp;quot; errors, that you can ignore. Take care only on others.&lt;br /&gt;
* Once import is finished, you must enable constraint check and update all sequences to match imported data.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
psql -h name_or_ip_of_postgresql_server -d name_database_postgresql -U login_database_mysql&lt;br /&gt;
&amp;gt; select dol_util_triggerall(true);&lt;br /&gt;
&amp;gt; select dol_util_rebuild_sequences();&lt;br /&gt;
CTRL+D&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
You can also restore the postgresql.conf file to its initial value.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
escape_string_warning = on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Modify your Dolibarr setup file===&lt;br /&gt;
* Open with a file editor, the file conf/conf.php that you can find into your Dolibarr root installation.&lt;br /&gt;
* Modify lines to make program files to point to the new database&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
$dolibarr_main_db_host=&#039;name_or_ip_of_postgresql_server&#039;;&lt;br /&gt;
$dolibarr_main_db_port=&#039;port_of_postgresql_server&#039;;&lt;br /&gt;
$dolibarr_main_db_name=&#039;name_database_postgresql&#039;;&lt;br /&gt;
$dolibarr_main_db_user=&#039;login_database_postgresql&#039;;&lt;br /&gt;
$dolibarr_main_db_pass=&#039;password_database_postgresql&#039;;&lt;br /&gt;
$dolibarr_main_db_type=&#039;pgsql&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test===&lt;br /&gt;
You should now have an application 100% working with all its data.&lt;br /&gt;
Old MySql database can be closed.&lt;br /&gt;
&lt;br /&gt;
=Other solution: pgloader=&lt;br /&gt;
In a single line of code the database can be migrated (tables are call dolibarr)&lt;br /&gt;
https://github.com/dimitri/pgloader&lt;br /&gt;
==Prerequisite==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt-get install pgloader&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
 pgloader mysql://USER:PASSWORD@IP_MYSQL:3306/dolibarr postgresql:///dolibarr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=List_of_modules_id&amp;diff=40253</id>
		<title>List of modules id</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=List_of_modules_id&amp;diff=40253"/>
		<updated>2018-11-04T20:26:54Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: /* ID &amp;gt; 500000 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Core]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocDevEs}}&lt;br /&gt;
{{TemplateDocDevFr}}&lt;br /&gt;
&lt;br /&gt;
{{Flag en}} This page list all reserved modules numbers / ID. If you build or want to build your own modules (like this [[:Category:Complementary_modules|complementary module]]), you should take an ID range here. &lt;br /&gt;
&lt;br /&gt;
{{Flag fr}} Cette page recense tous les numéros / ID réservés de modules. Si vous avez réalisé ou voulez réaliser vos propres modules (comme les [[:Category:Modules complémentaires|modules complémentaires suivant]]), vous devriez prendre une plage d&#039;ID ici.&lt;br /&gt;
&lt;br /&gt;
{{Flag sp}} Esta página contiene un listado de todos los id reservados para los módulos. Si ha creado o quiere realizar sus propios módulos, (como estos [[:Category:Módulos_complementarios|módulos complementarios]]), deberá reservarse un rango de ID aquí.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= ID 0 - 99999 =&lt;br /&gt;
{{Flag en}} Reserved for Dolibarr&#039;s internal modules.&lt;br /&gt;
&lt;br /&gt;
{{Flag fr}} Réservé aux modules internes de Dolibarr.&lt;br /&gt;
&lt;br /&gt;
{{Flag sp}} Reservado a los módulos internos de Dolibarr.&lt;br /&gt;
&lt;br /&gt;
= ID 100000 - 499999 =&lt;br /&gt;
{{Flag en}} Reserved area for editors in need for an ID range. You can edit this page to add your own range (limited to 1000 values per editor)&lt;br /&gt;
&lt;br /&gt;
{{Flag fr}} Zone réservé aux éditeurs qui ont besoin d&#039;une plage d&#039;ID spécifiques. Vous pouvez modifier cette page pour réserver votre plage (limité à 1000 valeurs par éditeur)&lt;br /&gt;
&lt;br /&gt;
{{Flag sp}} Área reservada para los partners que necesiten un rango de ID. Puede modificar esta página para reservar su rango (limitado a 1000 valores por editor)&lt;br /&gt;
&lt;br /&gt;
* ID 100000 - 100999: OpenThink (http://www.openthink.be)&lt;br /&gt;
* ID 101000 - 101999: NLTechno (https://www.nltechno.com)&lt;br /&gt;
* ID 102000 - 102999: Tiaris (http://www.tiaris.fr)&lt;br /&gt;
* ID 103000 - 103999: Open-concept.pro (http://www.open-concept.pro)&lt;br /&gt;
* ID 104000 - 104999: ATM Consulting (http://www.atm-consulting.fr)&lt;br /&gt;
* ID 105000 - 105999: GPC.solutions&lt;br /&gt;
* ID 106000 - 106999: PHPASSO&lt;br /&gt;
* ID 107000 - 107999: TecLib (http://www.teclib.com) / Auguria (http://www.auguria.net)&lt;br /&gt;
* ID 108000 - 108999: ETHICWEB&lt;br /&gt;
* ID 109000 - 109999: Aplose (http://www.aplose.fr)&lt;br /&gt;
* ID 110000 - 110999: Librethic (https://librethic.io)&lt;br /&gt;
* ID 111000 - 111999: Asset IT (www.assetit.ch)&lt;br /&gt;
* ID 112000 - 112999: Aarboard AG (www.aarboard.ch)&lt;br /&gt;
* ID 113000 - 113999: Asilib - Alexandre Spangaro&lt;br /&gt;
* ID 114000 - 114999: Iceleaf OÜ&lt;br /&gt;
* ID 115000 - 115999: 2A2C Conseil - Cyril ZEKSER&lt;br /&gt;
* ID 116000 - 116999: Wolftec GmbH&lt;br /&gt;
* ID 117000 - 117999: Oscim (http://www.oscim.fr)&lt;br /&gt;
* ID 118000 - 118999: Oarces Web (dev.oarces.com)&lt;br /&gt;
* ID 119000 - 119999: Manuel Berrocal - Absolacom&lt;br /&gt;
* ID 120000 - 120999: Régis Houssin (http://www.inodbox.com)&lt;br /&gt;
* ID 121000 - 121999: Oscss - Shop &lt;br /&gt;
* ID 122000 - 122999: MrSof - la Nation du Web&lt;br /&gt;
* ID 123000 - 123999: Bruno Généré (webiseasy.org)&lt;br /&gt;
* ID 124000 - 124999: backbone internet service (www.backbone.co.at)&lt;br /&gt;
* ID 125000 - 125999: ProgSI (www.progsi.ma)&lt;br /&gt;
* ID 126000 - 126999: Catalanet&lt;br /&gt;
* ID 127000 - 127999: Virgilio Filho pt-BR Brasil (@dolibarr.br)&lt;br /&gt;
* ID 128000 - 128999: Nicolas Frappé France (www.sospc.info)&lt;br /&gt;
* ID 129000 - 129999: Adeo-Informatique&lt;br /&gt;
* ID 130000 - 130999: Technicks ICT (http://www.technicks.eu)&lt;br /&gt;
* ID 131000 - 131999: Joan Louis (itaca.fr)&lt;br /&gt;
* ID 132000 - 132999: Jean-Marie Arsac (https://azimut.fr)&lt;br /&gt;
* ID 133000 - 133999: Oriel Systems Ltd, UK. (www.orielsystems.com)&lt;br /&gt;
* ID 135000 - 135999: Net-Logic (http://netlogic.fr)&lt;br /&gt;
* ID 140000 - 140999: Altairis&lt;br /&gt;
* ID 150000 - 150999: Jeffinfo &lt;br /&gt;
* ID 160000 - 160999: Charles-François BENKE (http://www.patas-monkey.com)&lt;br /&gt;
* ID 162000 - 162999: Jacques Rébiscoul&lt;br /&gt;
* ID 163000 - 163999: Open-DSI (https://www.open-dsi.fr)&lt;br /&gt;
* ID 170000 - 170999: TRIDENT CONSULTING LTD (www.tridentdxb.com)&lt;br /&gt;
* ID 171000 - 171999: LVSInformatique (www.lvsinformatique.com)&lt;br /&gt;
* ID 180000 - 180999: Triangle Ingénierie&lt;br /&gt;
* ID 190000 - 190999: Diciannove (http://19.coop)&lt;br /&gt;
* ID 199000 - 199999: RFMS&lt;br /&gt;
* ID 200000 - 200999: Noxiome&lt;br /&gt;
* ID 201000 - 201999: Sasa Ostrouska (saxa)&lt;br /&gt;
* ID 202000 - 202999: Z-Application&lt;br /&gt;
* ID 203000 - 203099: Elidee - elidee.com&lt;br /&gt;
* ID 203100 - 203999: Garcia MICHEL (soamichel.fr)&lt;br /&gt;
* ID 204000 - 204999: Ari Elbaz elarifr - accedinfo.com&lt;br /&gt;
* ID 205000 - 205999: Kreiz IT&lt;br /&gt;
* ID 206000 - 206999: GBINFO (www.gbinfo.fr)&lt;br /&gt;
* ID 300000 - 300999: AtooNet (http://www.atoo-net.com)&lt;br /&gt;
* ID 400000 - 400999: 2byte.es (http://www.2byte.es)&lt;br /&gt;
* ID 401000 - 401999: B&amp;amp;D Informática&lt;br /&gt;
* ID 402000 - 402999: Marcos García de La Fuente (marcosgdf)&lt;br /&gt;
* ID 403000 - 403999: Sergibyte (http://www.sergibyte.com)&lt;br /&gt;
* ID 404000 - 404999: Aikhan&lt;br /&gt;
* ID 405000 - 405999: AIME (http://www.aime.mx)&lt;br /&gt;
* ID 409000 - 409999: LliureTIC (www.lliuretic.cat)&lt;br /&gt;
* ID 420000 - 420099: BBS Concept&lt;br /&gt;
* ID 420100 - 420199: LeMousticProduction (www.lemousticproduction.info) -&amp;lt; module DoliRH&lt;br /&gt;
* ID 420200 - 421199: VatCheck (www.abnc.be)&lt;br /&gt;
* ID 422200 - 422999: Artaban (http://artaban.fr)&lt;br /&gt;
* ID 423000 - 423050: cyberesprit&lt;br /&gt;
* ID 423051 - 423099: R.Bossard&lt;br /&gt;
* ID 424000 - 424999: A3sys - Mon-Dolibarr (http://www.mon-dolibarr.fr)&lt;br /&gt;
* ID 425000 - 425999: Sébastien SERRE Thivinfo (www.thivinfo.com)&lt;br /&gt;
* ID 426000 - 426099: Arkesis-Solution&lt;br /&gt;
* ID 426100 - 426149: GetLandy (www.getlandy.com)&lt;br /&gt;
* ID 426150 - 426649: OOB Software	&lt;br /&gt;
* ID 426650 - 426849: Soft-Task Serviços e Sistemas (www.soft-task.com.br)&lt;br /&gt;
* ID 426850 - 427000: Bruno Caldas (https://github.com/BCaldas)&lt;br /&gt;
* ID 427001 - 427999: Kevin GUERRIER (alias xcl.saian)&lt;br /&gt;
* ID 428000 - 428099: af83&lt;br /&gt;
* ID 429000 - 429999: induslab&lt;br /&gt;
* ID 430000 - 430099: Mixity sprl (www.mixity.be)&lt;br /&gt;
* ID 430100 - 430199: sgiraud&lt;br /&gt;
* ID 430200 - 430299: Merlion TI (www.merlion-si.com.br)&lt;br /&gt;
* ID 430300 - 431299: Libre Expert (www.libre-expert.com)&lt;br /&gt;
* ID 431300 - 431399: ptibogxiv (www.ptibogxiv.net)&lt;br /&gt;
* ID 431400 - 431499: Befox (www.befox.fr)&lt;br /&gt;
* ID 431500 - 431599: rue Béjo (www.ruebejo.fr)&lt;br /&gt;
* ID 431600 - 431699: Avizzeo (www.avizzeo.com)&lt;br /&gt;
* ID 431700 - 432199: Multisistemas (www.multisistemas.com.sv)&lt;br /&gt;
* ID 432200 - 432399: Burbuja - Chile (www.burbuja.cl)&lt;br /&gt;
* ID 432400 - 433399: INOVEA CONSEIL (https://www.inovea-conseil.com)&lt;br /&gt;
* ID 433400 - 434399: Rachid HRICH - Maroc (HricH ServiceS.)&lt;br /&gt;
* ID 434400 - 435399: Lance Bleakley - LanceIT (www.lanceit.net)&lt;br /&gt;
* ID 436400 - 437399: Mohamed AHERDANE - Morocco - IT Consultant ( www.wave.ma )&lt;br /&gt;
* ID 438400 - 439399: Tetras Libre - France - Développement logiciels libres (www.tetras-libre.fr)&lt;br /&gt;
* ID 439400 - 440399: Dolibarr-pro - France - Développement Dolibarr (www.dolibarr-pro.com)&lt;br /&gt;
* ID 440400 - 441399: Quidlab Co., Ltd - Thailand - ( www.quidlab.com )&lt;br /&gt;
* ID 441400 - 442399: Ide@log - France - (https://www.idealog-info.net) - Laurent Leblanc&lt;br /&gt;
* ID 442400 - 443399: Valerio Bianchi (www.valeriobianchi.com)&lt;br /&gt;
* ID 443400 - 444399: delassalle - France - (www.delassalle.fr) - Joseph Delassalle&lt;br /&gt;
* ID 444400 - 445399: Webartis - Maroc - (www.webartis.net) - François Dry&lt;br /&gt;
* ID 445400 - 445499: SCOP Au-delà des nuages - France&lt;br /&gt;
* ID 446000 - 446999: iouston (http://www.iouston.com) - France - Julien Marchand&lt;br /&gt;
* ID 447000 - 447999: rSanjoSEO - Rafael San José Tovar (www.rsanjoseo.com) - Spain&lt;br /&gt;
* ID 448000 - 448999: Code 42 (www.code42.fr)&lt;br /&gt;
* ID 449000 - 449999: TakePOS (www.takepos.com)&lt;br /&gt;
* ID 450000 - 450999: Pierre ARDOIN&lt;br /&gt;
* ID 451000 - 451999: Éditeur depordi.fr&lt;br /&gt;
* ID 452000 - 452999: Dylan NAKONG&lt;br /&gt;
* ID 453000 - 453999: Menahd Ouchenir - France - menahd-ouchenir.com&lt;br /&gt;
* ID 454000 - 454999: Withheld - Canada&lt;br /&gt;
* ID 455000 - 455999: Gaëtan MAISON - Info Libre @ Dom - France (www.infolibreadom.com)&lt;br /&gt;
* ID 456000 - 456999: Laurent LEBLEU - B.L.C. - Blue Line Company - Lille - France (www.bluelinecompany.fr/dolibarr)&lt;br /&gt;
&lt;br /&gt;
= ID &amp;gt; 500000 =&lt;br /&gt;
*861000 - 861999: Patrick Delcroix&lt;br /&gt;
&lt;br /&gt;
{{Flag en}} If you don&#039;t already have reserved ids and need some, please don&#039;t use hazardous number and use a number higher than 500000, but it is better to ask a wiki account, and reserve your own range by editing the  100000 - 499999 range (1000 ids maximum per partner).&lt;br /&gt;
&lt;br /&gt;
{{Flag fr}} Si vous n&#039;avez pas de numéros réservés et en avez besoin, n&#039;utilisez pas de chiffres au hasard et utilisez une valeur supérieure à 500000, toutefois, il est préférable d&#039;obtenir un compte wiki, et  réserver vous-même votre plage en ajoutant votre entrée dans la zone 100000 - 499999 (pas plus de 1000 numéros par partenaire).&lt;br /&gt;
&lt;br /&gt;
{{Flag sp}} Si no dispone de número reservado y necesita, no use cifras redondeadas y usa un valor superior a 500000. Si tiene una cuenta wiki, puede reservarse usted mismo sus id añadiendo su entrada en la zona 100000 - 499999 (no más de 1000 id por partner).&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Generic_website_infrastructure_setup&amp;diff=40202</id>
		<title>Generic website infrastructure setup</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Generic_website_infrastructure_setup&amp;diff=40202"/>
		<updated>2018-10-21T12:24:05Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TemplateDocDevEn}}&lt;br /&gt;
This pages aims to provide links toward other reliable sources, to understand the different topics it&#039;s important to understand the principle that internet use.&lt;br /&gt;
&lt;br /&gt;
1. Internet is an IP network, meaning that to reach every server an IP is required&lt;br /&gt;
&lt;br /&gt;
2. When a name is used to reach a server, this name need to be translated to an IP by a Domain name server (DNS)&lt;br /&gt;
&lt;br /&gt;
3. Your network use a private range of IP address therefore can&#039;t be reached from internet without a specific configuration&lt;br /&gt;
&lt;br /&gt;
=Domain, Domain name server (DNS) and DynDNS=&lt;br /&gt;
Wikipedia[https://fr.wikipedia.org/wiki/Domain_Name_System]:&lt;br /&gt;
A DNS is important when you want to reach your server from internet because you don&#039;t want to learn your IP by heart, you&#039;d rather buy a domain like mycompany.org and use it to reach your server. When you type &amp;quot;www.mydomain.com&amp;quot; in a browser, your computer will call the default DNS; if this DNS doesn&#039;t know the IP attached to mycompany.org it will check with other DNS until it gets the answer, sometime www.mycompany.org can refers to another domain like datacenter1.mycompany.org. In this the case, the DNS will look for the IP attached to datacenter1.mycompany.org.   &lt;br /&gt;
&lt;br /&gt;
When you own a domain, you also own all the sub-domain like www.mycompany.org, erp.mycompany.org, yyy.xxx.mycompany.org ...; you can map this domain and its sub.domain to either an IP or another domain, usually with the company that sold you the domain. Here the main type that you will have to configure on the domain vendor portal:&lt;br /&gt;
# &amp;quot;CNAME&amp;quot; record: used to map to another domain &lt;br /&gt;
# &amp;quot;A&amp;quot; record: use to map an IP v4&lt;br /&gt;
# &amp;quot;AAAA&amp;quot; record: use to map an IP v6&lt;br /&gt;
# In case you don&#039;t own a fixed IP, you can use a  Dynamic DNS[https://en.wikipedia.org/wiki/Dynamic_DNS] service: there is a daemon running on your network that will keep updating your IP in the DNS (usually the internet modem/gateway have this function). Often you will have to configure a dynamic DNS username and password on your domain vendor portal. &lt;br /&gt;
&lt;br /&gt;
Here the example for OVH: https://docs.ovh.com/gb/en/domains/web_hosting_how_to_edit_my_dns_zone/&lt;br /&gt;
&lt;br /&gt;
=Port Forwarding, DMZ and Reverse Proxy=&lt;br /&gt;
Once your Domain/subdomain refers to your IP address, Internet requests will arrive to your internet gateway, but you&#039;ll need to setup port forwarding[https://en.wikipedia.org/wiki/Port_forwarding] in order to forward those requests toward your web server.&lt;br /&gt;
&lt;br /&gt;
The default internet port are 80 for http and 443 for https, once the portforwarding is configured for those port (80 &amp;amp; 443), it&#039;ll affect all the web traffics coming on this port. A simple port forwarding will work if you have a single web server (could host several websites) but if you have multiple web servers you may have to forward your traffic to a reverse proxy[https://en.wikipedia.org/wiki/Reverse_proxy] that will be able to redirect the traffic based on the domain/subdomain or/and url. &lt;br /&gt;
&lt;br /&gt;
If you want to be sure that internet traffic can&#039;t reach the other device on your network (LAN), you can place the reverse proxy in a DMZ[https://en.wikipedia.org/wiki/DMZ_(computing)] with firewall rules that allow only the traffic from internet to the reverse proxy and from the reverse proxy to specific IP on your local LAN (ie. your servers) but the firewall will block all other traffic coming from internet. For such setup there is an open source security appliance called pfSense that is able to do the firewall and the reverse proxy (with the module called HAProxy), pfSense can be installed on an old PC or deployed on a virtual machine.&lt;br /&gt;
&lt;br /&gt;
=Virtual host=&lt;br /&gt;
Virtual host [https://en.wikipedia.org/wiki/Virtual_hosting] is a method which aims to define with a configuration file of the web server (e.g Apache) a domain/Url called by the user&#039;s browser to access to your application; for example a virtual host configuration can be setup for:&lt;br /&gt;
# www.mycompnay.org, the configuration file will define where to look for the pages like /usr/share/mangento/myshop ;&lt;br /&gt;
# cloud.mycompany.org, the configuration file can define a reverse proxy to redirect the traffic to http://localhost:8888 in order to show the nextcloud pages;&lt;br /&gt;
# dolibarr.mycompany.og, the configuration file could be the one to access your Dolibarr [https://github.com/Dolibarr/dolibarr/blob/develop/build/debian/apache/dolibarr.conf].&lt;br /&gt;
&lt;br /&gt;
=SSL encryption=&lt;br /&gt;
The SSL encryption enable the encrypt the traffic between the user web browser and the server so even if someone is able to intercept the traffic he won&#039;t be able to see you passwords, website content ... the SSL encryption is configured at the virtual host level&lt;br /&gt;
# &#039;&#039;&#039;Certificat generation with Openssl (selfsigned)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 3650 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also add -nodes if you don&#039;t want to protect your private key with a passphrase, otherwise it will prompt you for &amp;quot;at least a 4 character&amp;quot; password. The days parameter (3650) you can replace with any number to affect expiration date. It will then prompt you for things like &amp;quot;Country Name&amp;quot; but you can just hit enter and accept defaults.&lt;br /&gt;
&lt;br /&gt;
Add -subj &#039;/CN=localhost&#039; to suppress questions about the contents of the certificate (replace localhost with your desired domain)&lt;br /&gt;
&lt;br /&gt;
Self-signed certs are not validated with any third party unless you import them to the browsers previously. If you need more security, you should use a certificate signed by a trusted CA like let&#039;s encrypt (free), globalsign, Norton ...&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Certificat generation with Let&#039;s encrypt&#039;&#039;&#039;&lt;br /&gt;
As mentionned above self signed certificate will generate an error on browser unless the the certificate in &amp;quot;imported&amp;quot; on the computer, if not done by the systeml admin it gives an unprofessional experience for the user ( most browser message will say something like site dangerous/unsecure)&lt;br /&gt;
&lt;br /&gt;
Let&#039;s encrypt is a free trusted certificate authority (aka CA) for most of the browsers meaning if let&#039;s encrypt says that your certificates are valide then most of the browser will trust your certicifacts and instead of a warning they will show a green lock on the address bar = the website is secure.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Configuration of the virtual host&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Let&#039;s encrypt certificate renewal&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Advanced setup=&lt;br /&gt;
# &#039;&#039;&#039;virtualisation&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;LXC container&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Docker&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;pfSense&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Generic_website_infrastructure_setup&amp;diff=40201</id>
		<title>Generic website infrastructure setup</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Generic_website_infrastructure_setup&amp;diff=40201"/>
		<updated>2018-10-21T12:16:14Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TemplateDocDevEn}}&lt;br /&gt;
This pages aims to provide links toward other reliable sources, to understand the different topics it&#039;s important to understand the principle that internet use.&lt;br /&gt;
&lt;br /&gt;
1. Internet is an IP network, meaning that to reach every server an IP is required&lt;br /&gt;
&lt;br /&gt;
2. When a name is used to reach a server, this name need to be translated to an IP by a Domain name server (DNS)&lt;br /&gt;
&lt;br /&gt;
3. Your network use a private range of IP address therefore can&#039;t be reached from internet without a specific configuration&lt;br /&gt;
&lt;br /&gt;
=Domain, Domain name server (DNS) and DynDNS=&lt;br /&gt;
Wikipedia[https://fr.wikipedia.org/wiki/Domain_Name_System]:&lt;br /&gt;
A DNS is important when you want to reach your server from internet because you don&#039;t want to learn your IP by heart, you&#039;d rather buy a domain like mycompany.org and use it to reach your server. When you type &amp;quot;www.mydomain.com&amp;quot; in a browser, your computer will call the default DNS; if this DNS doesn&#039;t know the IP attached to mycompany.org it will check with other DNS until it gets the answer, sometime www.mycompany.org can refers to another domain like datacenter1.mycompany.org. In this the case, the DNS will look for the IP attached to datacenter1.mycompany.org.   &lt;br /&gt;
&lt;br /&gt;
When you own a domain, you also own all the sub-domain like www.mycompany.org, erp.mycompany.org, yyy.xxx.mycompany.org ...; you can map this domain and its sub.domain to either an IP or another domain, usually with the company that sold you the domain. Here the main type that you will have to configure on the domain vendor portal:&lt;br /&gt;
# &amp;quot;CNAME&amp;quot; record: used to map to another domain &lt;br /&gt;
# &amp;quot;A&amp;quot; record: use to map an IP v4&lt;br /&gt;
# &amp;quot;AAAA&amp;quot; record: use to map an IP v6&lt;br /&gt;
# In case you don&#039;t own a fixed IP, you can use a  Dynamic DNS[https://en.wikipedia.org/wiki/Dynamic_DNS] service: there is a daemon running on your network that will keep updating your IP in the DNS (usually the internet modem/gateway have this function). Often you will have to configure a dynamic DNS username and password on your domain vendor portal. &lt;br /&gt;
&lt;br /&gt;
Here the example for OVH: https://docs.ovh.com/gb/en/domains/web_hosting_how_to_edit_my_dns_zone/&lt;br /&gt;
&lt;br /&gt;
=Port Forwarding, DMZ and Reverse Proxy=&lt;br /&gt;
Once your Domain/subdomain refers to your IP address, Internet requests will arrive to your internet gateway, but you&#039;ll need to setup port forwarding[https://en.wikipedia.org/wiki/Port_forwarding] in order to forward those requests toward your web server.&lt;br /&gt;
&lt;br /&gt;
The default internet port are 80 for http and 443 for https, once the portforwarding is configured for those port (80 &amp;amp; 443), it&#039;ll affect all the web traffics coming on this port. A simple port forwarding will work if you have a single web server (could host several websites) but if you have multiple web servers you may have to forward your traffic to a reverse proxy[https://en.wikipedia.org/wiki/Reverse_proxy] that will be able to redirect the traffic based on the domain/subdomain or/and url. &lt;br /&gt;
&lt;br /&gt;
If you want to be sure that internet traffic can&#039;t reach the other device on your network (LAN), you can place the reverse proxy in a DMZ[https://en.wikipedia.org/wiki/DMZ_(computing)] with firewall rules that allow only the traffic from internet to the reverse proxy and from the reverse proxy to specific IP on your local LAN (ie. your servers) but the firewall will block all other traffic coming from internet. For such setup there is an open source security appliance called pfSense that is able to do the firewall and the reverse proxy (with the module called HAProxy), pfSense can be installed on an old PC or deployed on a virtual machine.&lt;br /&gt;
&lt;br /&gt;
=Virtual host=&lt;br /&gt;
Virtual host [https://en.wikipedia.org/wiki/Virtual_hosting] is a method which aims to define with a configuration file of the web server (e.g Apache) a domain/Url called by the user&#039;s browser to access to your application; for example a virtual host configuration can be setup for:&lt;br /&gt;
# www.mycompnay.org, the configuration file will define where to look for the pages like /usr/share/mangento/myshop ;&lt;br /&gt;
# cloud.mycompany.org, the configuration file can define a reverse proxy to redirect the traffic to http://localhost:8888 in order to show the nextcloud pages;&lt;br /&gt;
# dolibarr.mycompany.og, the configuration file could be the one to access your Dolibarr [https://github.com/Dolibarr/dolibarr/blob/develop/build/debian/apache/dolibarr.conf].&lt;br /&gt;
&lt;br /&gt;
=SSL encryption=&lt;br /&gt;
The SSL encryption enable the encrypt the traffic between the user web browser and the server so even if someone is able to intercept the traffic he won&#039;t be able to see you passwords, website content ... the SSL encryption is configured at the virtual host level&lt;br /&gt;
# &#039;&#039;&#039;Certificat generation with Openssl (selfsigned)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 3650 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also add -nodes if you don&#039;t want to protect your private key with a passphrase, otherwise it will prompt you for &amp;quot;at least a 4 character&amp;quot; password. The days parameter (3650) you can replace with any number to affect expiration date. It will then prompt you for things like &amp;quot;Country Name&amp;quot; but you can just hit enter and accept defaults.&lt;br /&gt;
&lt;br /&gt;
Add -subj &#039;/CN=localhost&#039; to suppress questions about the contents of the certificate (replace localhost with your desired domain)&lt;br /&gt;
&lt;br /&gt;
Self-signed certs are not validated with any third party unless you import them to the browsers previously. If you need more security, you should use a certificate signed by a trusted CA like let&#039;s encrypt (free), globalsign, Norton ...&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Certificat generation with Let&#039;s encrypt&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Configuration of the virtual host&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Let&#039;s encrypt certificate renewal&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Advanced setup=&lt;br /&gt;
# &#039;&#039;&#039;virtualisation&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;LXC container&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Docker&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;pfSense&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Generic_website_infrastructure_setup&amp;diff=40005</id>
		<title>Generic website infrastructure setup</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Generic_website_infrastructure_setup&amp;diff=40005"/>
		<updated>2018-10-09T18:47:42Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This pages aims to provide links toward other reliable sources, to understand the different topics it&#039;s important to understand the principle that internet use.&lt;br /&gt;
&lt;br /&gt;
1. Internet is an IP network, meaning that to reach every server an IP is required&lt;br /&gt;
&lt;br /&gt;
2. When a name is used to reach a server, this name need to be translated to an IP by a Domain name server (DNS)&lt;br /&gt;
&lt;br /&gt;
3. Your network use a private range of IP address therefore can&#039;t be reached from internet without a specific configuration&lt;br /&gt;
&lt;br /&gt;
=Domain, Domain name server (DNS) and DynDNS=&lt;br /&gt;
Wikipedia[https://fr.wikipedia.org/wiki/Domain_Name_System]:&lt;br /&gt;
A DNS is important when you want to reach your server from internet because you don&#039;t want to learn your IP by heart, you&#039;d rather buy a domain like mycompany.org and use it to reach your server. When you type &amp;quot;www.mydomain.com&amp;quot; in a browser, your computer will call the default DNS; if this DNS doesn&#039;t know the IP attached to mycompany.org it will check with other DNS until it gets the answer, sometime www.mycompany.org can refers to another domain like datacenter1.mycompany.org, if it the case the DNS will look for the IP attached to datacenter1.mycompany.org.   &lt;br /&gt;
&lt;br /&gt;
When you own a domain, you also own all the sub-domain like www.mycompany.org, erp.mycompany.org, yyy.xxx.mycompany.org ...; you can map this domain and its sub.domain to either an IP or another domain usually with the company that sold you the domain, here the main type that you will have to configure on the domain vendor portal:&lt;br /&gt;
# &amp;quot;CNAME&amp;quot; record: used to map to another domain &lt;br /&gt;
# &amp;quot;A&amp;quot; record: use to map an IP v4&lt;br /&gt;
# &amp;quot;AAAA&amp;quot; record: use to map an IP v6&lt;br /&gt;
# In case you don&#039;t own a fixed IP you can use a  Dynamic DNS[https://en.wikipedia.org/wiki/Dynamic_DNS] service: there is a daemon runing on your network that will keep updating your IP in the DNS (usually the internet modem/gateway have this funciton). Often you will have to configure a dynamic DNS username and password on your domain vendor portal. &lt;br /&gt;
&lt;br /&gt;
Here the example for OVH: https://docs.ovh.com/gb/en/domains/web_hosting_how_to_edit_my_dns_zone/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Port Forwarding, DMZ and Reverse Proxy=&lt;br /&gt;
Once your Domain/subdomain refers to your IP address, Internet requests will arrive to your internet gateway but you&#039;ll need to setup port forwarding[https://en.wikipedia.org/wiki/Port_forwarding] in order to forward those requests toward your web server.&lt;br /&gt;
&lt;br /&gt;
The default internet port are 80 for http and 443 for https, once the portforwarding is configured for those port (80 &amp;amp; 443) it&#039;ll affect all the web traffics coming on this port. A simple port forwarding will work if you have a single web server (could host serveral websites) but if you have multiple web servers you may have to forward your traffic to a reverse proxy[https://en.wikipedia.org/wiki/Reverse_proxy] that will be able to redirect the traffic based on the domain/subdomain or/and url. &lt;br /&gt;
&lt;br /&gt;
If you want to be sure that internet traffic can&#039;t reach the other device on your network (LAN), you can place the reverse proxy in a DMZ[https://en.wikipedia.org/wiki/DMZ_(computing)] with firewall rules that allow only the traffic from internet to the reverse proxy and from the reverse proxy to specific IP on your local LAN (ie. your servers) but the firewall will block all other traffic coming from internet. For such setup there is an open source security appliance called pfSense that is able to do the firewall and the reverse proxy (with the module called HAProxy), pfSense can be installed on an old Pc or deployed on a virtual machine.&lt;br /&gt;
&lt;br /&gt;
=Virtual host=&lt;br /&gt;
Virtual host [https://en.wikipedia.org/wiki/Virtual_hosting] is a configuration file that aim to define a configuration of the web server (e.g Apache) based on the domain/Url called by the user&#039;s browser; for instance a virtual host configuration can be setup for&lt;br /&gt;
# www.mycompnay.org, the configuration file will define where to look for the pages like /usr/share/mangento/myshop&lt;br /&gt;
# cloud.mycompany.org, the configuration file can define a reverse proxy to redirect the traffic to http://localhost:8888 in order to show the nextcloud pages&lt;br /&gt;
# dolibarr.mycompny.og, the configuration file could be the one of Dolibarr [https://github.com/Dolibarr/dolibarr/blob/develop/build/debian/apache/dolibarr.conf]&lt;br /&gt;
&lt;br /&gt;
=SSL encryption=&lt;br /&gt;
The SSL encryption enable the encrypt the traffic between the user web browser and the server so even if someone is able to intercept the traffic he won&#039;t be able to see you passwords, website content ... the SSL encryption is configured at the virtual host level&lt;br /&gt;
# Certificat generation with Openssl (selfsigned)&lt;br /&gt;
# Certificat generation with Let&#039;s encrypt&lt;br /&gt;
# Configuration of the virtual host&lt;br /&gt;
# Let&#039;s encrypt certificate renewal &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Advanced setup=&lt;br /&gt;
# virtualisation&lt;br /&gt;
# LXC container&lt;br /&gt;
# Docker&lt;br /&gt;
# pfSense&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Generic_website_infrastructure_setup&amp;diff=40004</id>
		<title>Generic website infrastructure setup</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Generic_website_infrastructure_setup&amp;diff=40004"/>
		<updated>2018-10-09T18:45:08Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This pages aims to provide links toward other reliable sources, to understand the different topics it&#039;s important to understand the principle that internet use.&lt;br /&gt;
&lt;br /&gt;
1. Internet is an IP network, meaning that to reach every server an IP is required&lt;br /&gt;
&lt;br /&gt;
2. When a name is used to reach a server, this name need to be translated to an IP by a Domain name server (DNS)&lt;br /&gt;
&lt;br /&gt;
3. Your network use a private range of IP address therefore can&#039;t be reached from internet without a specific configuration&lt;br /&gt;
&lt;br /&gt;
=Domain, Domain name server (DNS) and DynDNS=&lt;br /&gt;
Wikipedia[https://fr.wikipedia.org/wiki/Domain_Name_System]:&lt;br /&gt;
A DNS is important when you want to reach your server from internet because you don&#039;t want to learn your IP by heart, you&#039;d rather buy a domain like mycompany.org and use it to reach your server. When you type &amp;quot;www.mydomain.com&amp;quot; in a browser, your computer will call the default DNS; if this DNS doesn&#039;t know the IP attached to mycompany.org it will check with other DNS until it gets the answer, sometime www.mycompany.org can refers to another domain like datacenter1.mycompany.org, if it the case the DNS will look for the IP attached to datacenter1.mycompany.org.   &lt;br /&gt;
&lt;br /&gt;
When you own a domain, you also own all the sub-domain like www.mycompany.org, erp.mycompany.org, yyy.xxx.mycompany.org ...; you can map this domain and its sub.domain to either an IP or another domain usually with the company that sold you the domain, here the main type that you will have to configure on the domain vendor portal:&lt;br /&gt;
# &amp;quot;CNAME&amp;quot; record: used to map to another domain &lt;br /&gt;
# &amp;quot;A&amp;quot; record: use to map an IP v4&lt;br /&gt;
# &amp;quot;AAAA&amp;quot; record: use to map an IP v6&lt;br /&gt;
# In case you don&#039;t own a fixed IP you can use a  Dynamic DNS[https://en.wikipedia.org/wiki/Dynamic_DNS] service: there is a daemon runing on your network that will keep updating your IP in the DNS (usually the internet modem/gateway have this funciton). Often you will have to configure a dynamic DNS username and password on your domain vendor portal. &lt;br /&gt;
&lt;br /&gt;
Here the example for OVH: https://docs.ovh.com/gb/en/domains/web_hosting_how_to_edit_my_dns_zone/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Port Forwarding, DMZ and Reverse Proxy=&lt;br /&gt;
Once your Domain/subdomain refers to your IP address, Internet requests will arrive to your internet gateway but you&#039;ll need to setup port forwarding[https://en.wikipedia.org/wiki/Port_forwarding] in order to forward those requests toward your web server.&lt;br /&gt;
&lt;br /&gt;
The default internet port are 80 for http and 443 for https, once the portforwarding is configured for those port (80 &amp;amp; 443) it&#039;ll affect all the web traffics coming on this port. A simple port forwarding will work if you have a single web server (could host serveral websites) but if you have multiple web servers you may have to forward your traffic to a reverse proxy[https://en.wikipedia.org/wiki/Reverse_proxy] that will be able to redirect the traffic based on the domain/subdomain or/and url. &lt;br /&gt;
&lt;br /&gt;
If you want to be sure that internet traffic can reach the other device on your network (LAN), you can place the reverse proxy in a DMZ[https://en.wikipedia.org/wiki/DMZ_(computing)] with firewall rule that allow only the traffic from internet to the reverse proxy and from the reverse proxy to the local LAN (ie. your servers) but the firewall will block all other traffic coming from internet. For such setup there is an open source security appliance called pfSense that is able to do the firewall and the reverse proxy (with the module called HAProxy), pfSense can be installed on an old Pc or deployed on a virtual machine&lt;br /&gt;
&lt;br /&gt;
=Virtual host=&lt;br /&gt;
Virtual host [https://en.wikipedia.org/wiki/Virtual_hosting] is a configuration file that aim to define a configuration of the web server (e.g Apache) based on the domain/Url called by the user&#039;s browser; for instance a virtual host configuration can be setup for&lt;br /&gt;
# www.mycompnay.org, the configuration file will define where to look for the pages like /usr/share/mangento/myshop&lt;br /&gt;
# cloud.mycompany.org, the configuration file can define a reverse proxy to redirect the traffic to http://localhost:8888 in order to show the nextcloud pages&lt;br /&gt;
# dolibarr.mycompny.og, the configuration file could be the one of Dolibarr [https://github.com/Dolibarr/dolibarr/blob/develop/build/debian/apache/dolibarr.conf]&lt;br /&gt;
&lt;br /&gt;
=SSL encryption=&lt;br /&gt;
The SSL encryption enable the encrypt the traffic between the user web browser and the server so even if someone is able to intercept the traffic he won&#039;t be able to see you passwords, website content ... the SSL encryption is configured at the virtual host level&lt;br /&gt;
# Certificat generation with Openssl (selfsigned)&lt;br /&gt;
# Certificat generation with Let&#039;s encrypt&lt;br /&gt;
# Configuration of the virtual host&lt;br /&gt;
# Let&#039;s encrypt certificate renewal &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Advanced setup=&lt;br /&gt;
# virtualisation&lt;br /&gt;
# LXC container&lt;br /&gt;
# Docker&lt;br /&gt;
# pfSense&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Generic_website_infrastructure_setup&amp;diff=39984</id>
		<title>Generic website infrastructure setup</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Generic_website_infrastructure_setup&amp;diff=39984"/>
		<updated>2018-10-08T18:52:52Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This pages aims to provide links toward other reliable sources, to understand the different topics it&#039;s important to understand the principle that internet use.&lt;br /&gt;
&lt;br /&gt;
1. Internet is an IP network, meaning that to reach every server an IP is required&lt;br /&gt;
&lt;br /&gt;
2. When a name is used to reach a server, this name need to be translated to an IP by a Domain name server (DNS)&lt;br /&gt;
&lt;br /&gt;
3. Your network use a private range of IP address therefore can&#039;t be reached from internet without a specific configuration&lt;br /&gt;
&lt;br /&gt;
=Domain, Domain name server (DNS) and DynDNS=&lt;br /&gt;
Wikipedia[https://fr.wikipedia.org/wiki/Domain_Name_System]&lt;br /&gt;
A DNS is important when you want to reach your server from internet because you don&#039;t want to learn your IP by heart, you&#039;d rather buy a domain like mycompany.org and use it to reach your server&lt;br /&gt;
&lt;br /&gt;
1. When you own a domain you also own all the sub-domaine like www.mycompany.org, erp.mycompany.org, yyy.xxx.mycompany.org ...; you can map this domian and its sub.domain to either an IP, another domain usually with the company that sold you the domain ( there is other type of DNS record but we won&#039;t mention them here)&lt;br /&gt;
&lt;br /&gt;
2.in order to link you domain to an IP, you&#039;ll need an A DNS record for a V4 IP address or an AAA DNS record for a IP V6 address; in case you don&#039;t own a fixed IP you can use a  Dynamic DNS[https://en.wikipedia.org/wiki/Dynamic_DNS] service: there is a daemon runing on your network that will keep updating your IP in the DNS ( usually the internet modem/gateway have this funciton)&lt;br /&gt;
&lt;br /&gt;
3. in order to link your domain to another domain, you will need to setup a NAME DNS record (e.g. to the domain with an A record)&lt;br /&gt;
&lt;br /&gt;
=Port Forwarding, DMZ and Reverse Proxy=&lt;br /&gt;
Once your Domain refers to your IP address, Internet messages will arrive to your internet gateway but you&#039;ll need to setup port forwarding[https://en.wikipedia.org/wiki/Port_forwarding] in order to forward those message toward your web server.&lt;br /&gt;
&lt;br /&gt;
the default internet port are 80 for http and 443 for https, once the PF is configured it&#039;ll affect all the traffics coming on this port, if you have multiple web server you may have to forward your traffic to a reverse proxy[https://en.wikipedia.org/wiki/Reverse_proxy] that will be able to redirect the traffic based on the url. &lt;br /&gt;
&lt;br /&gt;
If you want to avoid having internet traffic on your lan you can place the reverse proxy in a DMZ[https://en.wikipedia.org/wiki/DMZ_(computing)] with firewall rule that allow only the traffic from internet to the reverse proxy and from the reserse proxy to the local lan (ie. your servers). For such setup there is an open source called pfSense solution that is able to do the firewall and the reverse proxy (with the module called HAProxy)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Virtual host=&lt;br /&gt;
your public IP can &lt;br /&gt;
&lt;br /&gt;
=SSL encryption=&lt;br /&gt;
=Let&#039;s encrypt / ACME=&lt;br /&gt;
=DMZ and port forwarding=&lt;br /&gt;
=Reverse proxy and SSL offloading=&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Cr%C3%A9er_un_mod%C3%A8le_de_document_PDF&amp;diff=39237</id>
		<title>Créer un modèle de document PDF</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Cr%C3%A9er_un_mod%C3%A8le_de_document_PDF&amp;diff=39237"/>
		<updated>2018-08-16T08:01:30Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: /* Créer le nouveau modèle */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TemplateDocDev}}&lt;br /&gt;
Ce document décrit comment créer son propre modèle de génération de document PDF afin de personnaliser ses documents (propales, factures, etc...)&lt;br /&gt;
Il se base sur les propositions commerciales comme exemple mais s&#039;applique à tout type de document.&lt;br /&gt;
&lt;br /&gt;
Pour savoir comment générer un modèle de document ODT, voir la page [[Créer un modèle de document ODT]].&lt;br /&gt;
Créer un modèle PDF requiert des connaissances en programmation PHP mais pas la création de modèles ODT. &lt;br /&gt;
&lt;br /&gt;
= Prérequis =&lt;br /&gt;
* Dolibarr: 3.0+&lt;br /&gt;
* Connaissance en PHP&lt;br /&gt;
&lt;br /&gt;
= Trouver le modèle existant le plus proche =&lt;br /&gt;
Dans Dolibarr, tester les modèles existants en allant dans la configuration du module puis en consultant l&#039;aperçu en cliquant le picto &amp;quot;Aperçu&amp;quot; en fin de ligne du modèle. Consulter chacun des modèles disponibles.&lt;br /&gt;
&lt;br /&gt;
Parmi ceux existant, noter le modèle le plus proche de vos besoins. Dans cet exemple, c&#039;est le modèle azur (correspondant au fichier pdf_propale_azur.modules.php).&lt;br /&gt;
&lt;br /&gt;
Pour info, tous les modèles sont dans &#039;&#039;&#039;htdocs/core/modules&#039;&#039;&#039; puis le sous-répertoire propale pour les propositions commerciales, facture pour les factures, commandes pour les commandes, etc...&lt;br /&gt;
&lt;br /&gt;
= Créer le nouveau modèle =&lt;br /&gt;
Par sécurité, on conservera les modèles d&#039;origine. Pour l&#039;exemple, on part du principe qu&#039;on crée un nouveau module de proposition commerciale qu&#039;on nommera &#039;masocietebleu&#039; et qui s&#039;inspire du module &#039;azur&#039;:&lt;br /&gt;
* Copier-coller pdf_propale_azur.modules.php&lt;br /&gt;
* Renommer la copie en pdf_propale_masocietebleu.modules.php&lt;br /&gt;
* L&#039;éditer et faire les modifs suivantes dans le code:&lt;br /&gt;
# Renommer &#039;Class pdf_propale_azur { &#039;    en &#039;Class pdf_propale_masocietebleu { &#039; &lt;br /&gt;
# Pour les anciennes versions de dolibarr (dans les nouvelles __construct($db) n&#039;a pas besoin d&#039;être renommé,)Renommer &#039;Function pdf_propale_azur($db=0)&#039; en &#039;Function pdf_propale_masocietebleu($db=0)&#039;&lt;br /&gt;
# Renommer la variable $this-&amp;gt;name pour refléter le nouveau nom. Par exemple pour le modèle &#039;azur&#039;, changer la ligne &#039;$this-&amp;gt;name = &amp;quot;azur&amp;quot;;&#039; en &#039;$this-&amp;gt;name = &amp;quot;masocietebleu&amp;quot;;&#039;.&lt;br /&gt;
# Sauvegarder : le modèle &#039;masocietebleu&#039; est disponible dans la liste des modèles de propales de Dolibarr&lt;br /&gt;
* Tester ce modèle (Voir chapitre précédent) avant d&#039;aller plus loin...&lt;br /&gt;
* Ajouter dans la table llx_document_model le nouveau modéle que vous venez de créer&lt;br /&gt;
&lt;br /&gt;
= Personnaliser votre nouveau modèle =&lt;br /&gt;
Personnaliser le modèle créé.&lt;br /&gt;
Toujours dans pdf_propale_masocietebleu.modules.php, chercher la fonction &#039;Function _pagehead(&amp;amp;$pdf, $fac)&#039;. C&#039;est elle qui gère l&#039;affichage de l&#039;entête.  &lt;br /&gt;
&lt;br /&gt;
== Librairie de manipulation de PDF ==&lt;br /&gt;
La librairie utilisée pour la création de documents en PDF se nomme TCPDF et peut être trouvée dans htdocs/includes/tcpdf/tcpdf.class.php. C&#039;est également dans cette classe que l&#039;on trouve les nombreuses méthodes utilisées pour générer les différents éléments des documents.&lt;br /&gt;
&lt;br /&gt;
Les modèles eux-même instancient la classe FPDF et utilisent ensuite ses méthodes, combinées avec les données d&#039;une facture, d&#039;une commande ou d&#039;autres types de données.&lt;br /&gt;
&lt;br /&gt;
On retrouve généralement les appels suivants dans les scripts de création de documents:&lt;br /&gt;
* $pdf-&amp;gt;SetFont() - &#039;&#039;Désigne la fonte à utiliser pour le texte qui suivra&#039;&#039;&lt;br /&gt;
* $pdf-&amp;gt;SetXY() - &#039;&#039;Désigne le point de départ pour dessiner le prochain texte en coordonnées X,Y qui sont exprimées en millimètres de la page&#039;&#039;&lt;br /&gt;
* $pdf-&amp;gt;MultiCell() - &#039;&#039;Dessine une boîte pouvant contenir du texte, et dont on doit d&#039;abord donner la largeur et la hauteur - très utilisée&#039;&#039;&lt;br /&gt;
* $pdf-&amp;gt;GetY() - &#039;&#039;Renvoie la position courante en Y&#039;&#039;&lt;br /&gt;
* $pdf-&amp;gt;SetDrawColor() - &#039;&#039;Désigne la couleur à utiliser pour le prochain texte à écrire - généralement noir (0,0,0) ou blanc (255,255,255)&#039;&#039;&lt;br /&gt;
* $pdf-&amp;gt;Rect() - &#039;&#039;Dessine un rectangle dont le coin supérieur gauche est au point indiqué par les deux premiers paramètres et le coin inférieur droit utilise les deux derniers paramètres en mode relatif aux deux premiers&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Structure des scripts ==&lt;br /&gt;
Les scripts de génération des documents PDF, au moment du développement de la version 2.2, disposent des méthodes suivantes (prenant pour exemple le modèle &amp;quot;crabe&amp;quot;) au sein de la classe du nom du modèle:&lt;br /&gt;
* pdf_crabe() - &#039;&#039;Constructeur de l&#039;objet pdf&#039;&#039;&lt;br /&gt;
* write_pdf_file() - &#039;&#039;Méthode générale pour la génération du fichier. Cette méthode appelle toute les suivantes après avoir initialisé quelques variables&#039;&#039;&lt;br /&gt;
* _pagehead() - &#039;&#039;Méthode de dessin de l&#039;en-tête du document, incluant généralement le logo, le titre du document (et la date) ainsi que les cadres de l&#039;émetteur et du destinataire du document&#039;&#039;&lt;br /&gt;
* _tableau() - &#039;&#039;Méthode de dessin du tableau de détails (produits, services, etc)&#039;&#039;&lt;br /&gt;
* _tableau_info() - &#039;&#039;Méthode de dessin du tableau reprenant une liste d&#039;informations sur la facture&#039;&#039;&lt;br /&gt;
* _tableau_tot() - &#039;&#039;Méthode de dessin du tableau des totaux&#039;&#039;&lt;br /&gt;
* _tableau_versement() - &#039;&#039;Méthode de dessin du tableau des règles de versement&#039;&#039;&lt;br /&gt;
* _pagefoot() - &#039;&#039;Méthode de dessin du pied de page&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Example de personnalisation ==     &lt;br /&gt;
=== Insertion d&#039;un logo ===&lt;br /&gt;
* Ajouter l&#039;instruction:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$pdf-&amp;gt;Image(&#039;\www\htdocs\dolibarr\document\societe\logo.jpg&#039;, 10, 5, 60.00);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Avec dans l&#039;exemple: 10=abscisse, 5=ordonnée, 60=largeur logo&lt;br /&gt;
* Si le logo se trouve par dessous ou dessus du text existant, supprimer le texte existant en commentant le code qui affiche l&#039;information ou en modifiant sa position.&lt;br /&gt;
&lt;br /&gt;
=== Insertion d&#039;une signature ou autre en bas de page facture ===&lt;br /&gt;
* ouvrir le modèle à modifier crabe ou oursin (dans htdocs/core/modules/facture/)&lt;br /&gt;
* insérer (pour ma part ligne 618 juste avant // Show payment mode CHQ)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$pdf-&amp;gt;Image(&#039;http://localhost/dolibarr/doc/images/signature.jpg&#039;,120,250,74);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
l&#039;image (largeur 74mm) est affichée colonne de droite juste avant le pied de page.&lt;br /&gt;
* copier l&#039;image dans le répertoire. il semble qu&#039;une image png avec transparence pose problème.&lt;br /&gt;
* générer le pdf, la signature apparaît.&lt;br /&gt;
&lt;br /&gt;
=== Insertion de texte ===&lt;br /&gt;
Principales fonctions utilisées&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$pdf-&amp;gt;setX(float a); // fixe la position x courante&lt;br /&gt;
$pdf-&amp;gt;setY(float b); // fixe la position y courante&lt;br /&gt;
$pdf-&amp;gt;setXY(float a,float b); // fixe les positions x et y courantes&lt;br /&gt;
$pdf-&amp;gt;SetTextColor(0,0,200); // fixe la couleur du texte&lt;br /&gt;
$pdf-&amp;gt;SetFont(&#039;Arial&#039;,&#039;B&#039;,14); // fixe la police, le type ( &#039;B&#039; pour gras, &#039;I&#039; pour italique, &#039;&#039; pour normal,...)&lt;br /&gt;
$pdf-&amp;gt;MultiCell(60, 8, &#039;Mon texte&amp;quot;, 0, &#039;L&#039;); // imprime &#039;Mon texte&#039; avec saut de ligne&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Rappel: l&#039;origine des fonctions setXY est le coin supérieur gauche de la page&lt;br /&gt;
&lt;br /&gt;
== Pour plus d&#039;infos ==&lt;br /&gt;
&lt;br /&gt;
* http://www.fpdf.org/?lang=fr&lt;br /&gt;
* Liste des méthodes: tcpdf.org/doc/code/classTCPDF.html&lt;br /&gt;
* Modèle facture poid [http://www.dolistore.com/lang-fr/crm-gestion-relation-client/208-Facture-avec-poids.html]. Module proposant un modéle de facture crabe avec une colonne poids en plus&lt;br /&gt;
&lt;br /&gt;
= Activer son modèle dans Dolibarr =&lt;br /&gt;
Dans la fonction d&#039;initialisation du module ajoutez votre modèle:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
sql=array(&amp;quot;INSERT INTO &amp;quot;.MAIN_DB_PREFIX.&amp;quot;document_model (nom, type, entity) VALUES(&amp;quot;.$MODELNAME.&amp;quot;,&amp;quot;.$MODEL_TARGET_MODULE.&amp;quot;,&amp;quot;.$conf-&amp;gt;entity.&amp;quot; )&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
avant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt; return $this-&amp;gt;_init($sql,$option);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Puis&lt;br /&gt;
&lt;br /&gt;
Dans Accueil =&amp;gt; Configuration =&amp;gt; Modules =&amp;gt;&lt;br /&gt;
* activer votre module qui doit apparaitre&lt;br /&gt;
* éventuellement le mettre en modèle proposé par défaut.&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Cr%C3%A9er_un_mod%C3%A8le_de_document_PDF&amp;diff=39236</id>
		<title>Créer un modèle de document PDF</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Cr%C3%A9er_un_mod%C3%A8le_de_document_PDF&amp;diff=39236"/>
		<updated>2018-08-16T08:00:53Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: /* Créer le nouveau modèle */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TemplateDocDev}}&lt;br /&gt;
Ce document décrit comment créer son propre modèle de génération de document PDF afin de personnaliser ses documents (propales, factures, etc...)&lt;br /&gt;
Il se base sur les propositions commerciales comme exemple mais s&#039;applique à tout type de document.&lt;br /&gt;
&lt;br /&gt;
Pour savoir comment générer un modèle de document ODT, voir la page [[Créer un modèle de document ODT]].&lt;br /&gt;
Créer un modèle PDF requiert des connaissances en programmation PHP mais pas la création de modèles ODT. &lt;br /&gt;
&lt;br /&gt;
= Prérequis =&lt;br /&gt;
* Dolibarr: 3.0+&lt;br /&gt;
* Connaissance en PHP&lt;br /&gt;
&lt;br /&gt;
= Trouver le modèle existant le plus proche =&lt;br /&gt;
Dans Dolibarr, tester les modèles existants en allant dans la configuration du module puis en consultant l&#039;aperçu en cliquant le picto &amp;quot;Aperçu&amp;quot; en fin de ligne du modèle. Consulter chacun des modèles disponibles.&lt;br /&gt;
&lt;br /&gt;
Parmi ceux existant, noter le modèle le plus proche de vos besoins. Dans cet exemple, c&#039;est le modèle azur (correspondant au fichier pdf_propale_azur.modules.php).&lt;br /&gt;
&lt;br /&gt;
Pour info, tous les modèles sont dans &#039;&#039;&#039;htdocs/core/modules&#039;&#039;&#039; puis le sous-répertoire propale pour les propositions commerciales, facture pour les factures, commandes pour les commandes, etc...&lt;br /&gt;
&lt;br /&gt;
= Créer le nouveau modèle =&lt;br /&gt;
Par sécurité, on conservera les modèles d&#039;origine. Pour l&#039;exemple, on part du principe qu&#039;on crée un nouveau module de proposition commerciale qu&#039;on nommera &#039;masocietebleu&#039; et qui s&#039;inspire du module &#039;azur&#039;:&lt;br /&gt;
* Copier-coller pdf_propale_azur.modules.php&lt;br /&gt;
* Renommer la copie en pdf_propale_masocietebleu.modules.php&lt;br /&gt;
* L&#039;éditer et faire les modifs suivantes dans le code:&lt;br /&gt;
# Pour les anciennes versions de dolibarr (dans les nouvelles __construct($db) n&#039;a pas besoin d&#039;être renomé ), Renommer &#039;Class pdf_propale_azur { &#039;    en &#039;Class pdf_propale_masocietebleu { &#039; &lt;br /&gt;
# Renommer &#039;Function pdf_propale_azur($db=0)&#039; en &#039;Function pdf_propale_masocietebleu($db=0)&#039;&lt;br /&gt;
# Renommer la variable $this-&amp;gt;name pour refléter le nouveau nom. Par exemple pour le modèle &#039;azur&#039;, changer la ligne &#039;$this-&amp;gt;name = &amp;quot;azur&amp;quot;;&#039; en &#039;$this-&amp;gt;name = &amp;quot;masocietebleu&amp;quot;;&#039;.&lt;br /&gt;
# Sauvegarder : le modèle &#039;masocietebleu&#039; est disponible dans la liste des modèles de propales de Dolibarr&lt;br /&gt;
* Tester ce modèle (Voir chapitre précédent) avant d&#039;aller plus loin...&lt;br /&gt;
* Ajouter dans la table llx_document_model le nouveau modéle que vous venez de créer&lt;br /&gt;
&lt;br /&gt;
= Personnaliser votre nouveau modèle =&lt;br /&gt;
Personnaliser le modèle créé.&lt;br /&gt;
Toujours dans pdf_propale_masocietebleu.modules.php, chercher la fonction &#039;Function _pagehead(&amp;amp;$pdf, $fac)&#039;. C&#039;est elle qui gère l&#039;affichage de l&#039;entête.  &lt;br /&gt;
&lt;br /&gt;
== Librairie de manipulation de PDF ==&lt;br /&gt;
La librairie utilisée pour la création de documents en PDF se nomme TCPDF et peut être trouvée dans htdocs/includes/tcpdf/tcpdf.class.php. C&#039;est également dans cette classe que l&#039;on trouve les nombreuses méthodes utilisées pour générer les différents éléments des documents.&lt;br /&gt;
&lt;br /&gt;
Les modèles eux-même instancient la classe FPDF et utilisent ensuite ses méthodes, combinées avec les données d&#039;une facture, d&#039;une commande ou d&#039;autres types de données.&lt;br /&gt;
&lt;br /&gt;
On retrouve généralement les appels suivants dans les scripts de création de documents:&lt;br /&gt;
* $pdf-&amp;gt;SetFont() - &#039;&#039;Désigne la fonte à utiliser pour le texte qui suivra&#039;&#039;&lt;br /&gt;
* $pdf-&amp;gt;SetXY() - &#039;&#039;Désigne le point de départ pour dessiner le prochain texte en coordonnées X,Y qui sont exprimées en millimètres de la page&#039;&#039;&lt;br /&gt;
* $pdf-&amp;gt;MultiCell() - &#039;&#039;Dessine une boîte pouvant contenir du texte, et dont on doit d&#039;abord donner la largeur et la hauteur - très utilisée&#039;&#039;&lt;br /&gt;
* $pdf-&amp;gt;GetY() - &#039;&#039;Renvoie la position courante en Y&#039;&#039;&lt;br /&gt;
* $pdf-&amp;gt;SetDrawColor() - &#039;&#039;Désigne la couleur à utiliser pour le prochain texte à écrire - généralement noir (0,0,0) ou blanc (255,255,255)&#039;&#039;&lt;br /&gt;
* $pdf-&amp;gt;Rect() - &#039;&#039;Dessine un rectangle dont le coin supérieur gauche est au point indiqué par les deux premiers paramètres et le coin inférieur droit utilise les deux derniers paramètres en mode relatif aux deux premiers&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Structure des scripts ==&lt;br /&gt;
Les scripts de génération des documents PDF, au moment du développement de la version 2.2, disposent des méthodes suivantes (prenant pour exemple le modèle &amp;quot;crabe&amp;quot;) au sein de la classe du nom du modèle:&lt;br /&gt;
* pdf_crabe() - &#039;&#039;Constructeur de l&#039;objet pdf&#039;&#039;&lt;br /&gt;
* write_pdf_file() - &#039;&#039;Méthode générale pour la génération du fichier. Cette méthode appelle toute les suivantes après avoir initialisé quelques variables&#039;&#039;&lt;br /&gt;
* _pagehead() - &#039;&#039;Méthode de dessin de l&#039;en-tête du document, incluant généralement le logo, le titre du document (et la date) ainsi que les cadres de l&#039;émetteur et du destinataire du document&#039;&#039;&lt;br /&gt;
* _tableau() - &#039;&#039;Méthode de dessin du tableau de détails (produits, services, etc)&#039;&#039;&lt;br /&gt;
* _tableau_info() - &#039;&#039;Méthode de dessin du tableau reprenant une liste d&#039;informations sur la facture&#039;&#039;&lt;br /&gt;
* _tableau_tot() - &#039;&#039;Méthode de dessin du tableau des totaux&#039;&#039;&lt;br /&gt;
* _tableau_versement() - &#039;&#039;Méthode de dessin du tableau des règles de versement&#039;&#039;&lt;br /&gt;
* _pagefoot() - &#039;&#039;Méthode de dessin du pied de page&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Example de personnalisation ==     &lt;br /&gt;
=== Insertion d&#039;un logo ===&lt;br /&gt;
* Ajouter l&#039;instruction:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$pdf-&amp;gt;Image(&#039;\www\htdocs\dolibarr\document\societe\logo.jpg&#039;, 10, 5, 60.00);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Avec dans l&#039;exemple: 10=abscisse, 5=ordonnée, 60=largeur logo&lt;br /&gt;
* Si le logo se trouve par dessous ou dessus du text existant, supprimer le texte existant en commentant le code qui affiche l&#039;information ou en modifiant sa position.&lt;br /&gt;
&lt;br /&gt;
=== Insertion d&#039;une signature ou autre en bas de page facture ===&lt;br /&gt;
* ouvrir le modèle à modifier crabe ou oursin (dans htdocs/core/modules/facture/)&lt;br /&gt;
* insérer (pour ma part ligne 618 juste avant // Show payment mode CHQ)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$pdf-&amp;gt;Image(&#039;http://localhost/dolibarr/doc/images/signature.jpg&#039;,120,250,74);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
l&#039;image (largeur 74mm) est affichée colonne de droite juste avant le pied de page.&lt;br /&gt;
* copier l&#039;image dans le répertoire. il semble qu&#039;une image png avec transparence pose problème.&lt;br /&gt;
* générer le pdf, la signature apparaît.&lt;br /&gt;
&lt;br /&gt;
=== Insertion de texte ===&lt;br /&gt;
Principales fonctions utilisées&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$pdf-&amp;gt;setX(float a); // fixe la position x courante&lt;br /&gt;
$pdf-&amp;gt;setY(float b); // fixe la position y courante&lt;br /&gt;
$pdf-&amp;gt;setXY(float a,float b); // fixe les positions x et y courantes&lt;br /&gt;
$pdf-&amp;gt;SetTextColor(0,0,200); // fixe la couleur du texte&lt;br /&gt;
$pdf-&amp;gt;SetFont(&#039;Arial&#039;,&#039;B&#039;,14); // fixe la police, le type ( &#039;B&#039; pour gras, &#039;I&#039; pour italique, &#039;&#039; pour normal,...)&lt;br /&gt;
$pdf-&amp;gt;MultiCell(60, 8, &#039;Mon texte&amp;quot;, 0, &#039;L&#039;); // imprime &#039;Mon texte&#039; avec saut de ligne&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Rappel: l&#039;origine des fonctions setXY est le coin supérieur gauche de la page&lt;br /&gt;
&lt;br /&gt;
== Pour plus d&#039;infos ==&lt;br /&gt;
&lt;br /&gt;
* http://www.fpdf.org/?lang=fr&lt;br /&gt;
* Liste des méthodes: tcpdf.org/doc/code/classTCPDF.html&lt;br /&gt;
* Modèle facture poid [http://www.dolistore.com/lang-fr/crm-gestion-relation-client/208-Facture-avec-poids.html]. Module proposant un modéle de facture crabe avec une colonne poids en plus&lt;br /&gt;
&lt;br /&gt;
= Activer son modèle dans Dolibarr =&lt;br /&gt;
Dans la fonction d&#039;initialisation du module ajoutez votre modèle:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
sql=array(&amp;quot;INSERT INTO &amp;quot;.MAIN_DB_PREFIX.&amp;quot;document_model (nom, type, entity) VALUES(&amp;quot;.$MODELNAME.&amp;quot;,&amp;quot;.$MODEL_TARGET_MODULE.&amp;quot;,&amp;quot;.$conf-&amp;gt;entity.&amp;quot; )&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
avant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt; return $this-&amp;gt;_init($sql,$option);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Puis&lt;br /&gt;
&lt;br /&gt;
Dans Accueil =&amp;gt; Configuration =&amp;gt; Modules =&amp;gt;&lt;br /&gt;
* activer votre module qui doit apparaitre&lt;br /&gt;
* éventuellement le mettre en modèle proposé par défaut.&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_development&amp;diff=38540</id>
		<title>Module development</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_development&amp;diff=38540"/>
		<updated>2018-05-19T12:30:33Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Core]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
&lt;br /&gt;
To create a new module/addon for Dolibarr, there is several steps. This tutorial will describe you each of them to build a module to extend Dolibarr features, like one or several of the following :&lt;br /&gt;
* Add new tables in database&lt;br /&gt;
* Add your own menu entries&lt;br /&gt;
* Add new screens to edit new tables&lt;br /&gt;
* Add or remove tabs on object view (invoice, product, order, event, ...)&lt;br /&gt;
* Add predefined exports for the internal export tool&lt;br /&gt;
* Add new information boxes in the home page&lt;br /&gt;
* Add new substitutions variables&lt;br /&gt;
* Define new permissions&lt;br /&gt;
* Execute code automatically triggered by a particular Dolibarr action&lt;br /&gt;
* Insert your code inside Dolibarr hooks positions&lt;br /&gt;
* Add your numbering module&lt;br /&gt;
* Add a new document template&lt;br /&gt;
* Add a new skin&lt;br /&gt;
etc...&lt;br /&gt;
All those operations are possible with version 3.2 or more of Dolibarr.&lt;br /&gt;
&lt;br /&gt;
Following chapters presents how to do all of this manually with an easy way. For experienced developers, a method to do this using MDA generation is also on the work. See last chapter for this.&lt;br /&gt;
&lt;br /&gt;
=Module creation witht the module builder=&lt;br /&gt;
From Dolibarr 7.0.0 it is possible create the main pages of yout module with the module builder, to activate it you must set the MAIN_FEATURES_LEVEL to 2 ( Setup / Other )  and then clic on the bug near the print button (top right)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Example of Template External Module=&lt;br /&gt;
A good model to start development of external module can be found here : [https://github.com/Dolibarr/dolibarr/tree/develop/htdocs/modulebuilder/template GitHub Dolibarr Module Modèle]&lt;br /&gt;
&lt;br /&gt;
=Create your module =&lt;br /&gt;
== Create a Module descriptor for your Module (required) ==&lt;br /&gt;
&#039;&#039;&#039;When it is required&#039;&#039;&#039;: Required as soon as an addon is developed, whatever its goal is (except for adding a skin).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Since Dolibarr 6.0, you should use the ModuleBuilder module provided as standard module&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Create your module descriptor ===&lt;br /&gt;
The first step is to create a file descriptor for the module. &lt;br /&gt;
* Create directory &#039;&#039;&#039;/htdocs/&#039;&#039;mymodule&#039;&#039;/core/modules&#039;&#039;&#039;. Then copy the file modMyModule.class.php from the directory dev/skeletons into this directory &#039;&#039;&#039;htdocs/&#039;&#039;mymodule&#039;&#039;/core/modules&#039;&#039;&#039;. Change the name of the file modMyModule.class.php to the name corresponding to the purpose of your module. Name of the file must start with initial &#039;mod&#039; and end with .class.php (for example if you want to give the name &#039;NewName&#039; to this file, then the name should be &#039;modNewName.class.php&#039;).&lt;br /&gt;
Next modify the contents of this file as follows:&lt;br /&gt;
* Replace all &amp;quot;modMyModule&amp;quot; with a value which corresponds to the purpose of your module. This value must always start with &#039;mod&#039; and contain only alpha characters (again, if the name given to the file was &#039;NewName&#039;, then replace all &amp;quot;modMyModule&amp;quot; with &amp;quot;modNewName&amp;quot;).&lt;br /&gt;
* Change the number in: $this-&amp;gt;numero = 100000 by a number that designates your module id. To avoid conflicts with other modules, you can consult the page that lists already reserved id numbers: [[List of modules id|List of modules id]].&lt;br /&gt;
* Modify any other variables defined in the constructor (see comment in the code skeleton for their meaning). &lt;br /&gt;
Your file descriptor for your module is ready. See next step to activate it.&lt;br /&gt;
&lt;br /&gt;
=== Test your descriptor ===&lt;br /&gt;
&lt;br /&gt;
Launch Dolibarr and go to page &#039;&#039;&#039;Setup-&amp;gt;module&#039;&#039;&#039;? &lt;br /&gt;
If you set the property version in the module description you should see a new line with your new module and the possibility to activate it or not. If you set the property version to &amp;quot;develop&amp;quot; or &amp;quot;experiental&amp;quot;, to see your module, you must first go into &#039;&#039;&#039;Setup-Others&#039;&#039;&#039; and set MAIN_FEATURES_LEVEL to 1 to see &amp;quot;experimental&amp;quot; modules or 2 to see &amp;quot;development&amp;quot; modules.&lt;br /&gt;
&lt;br /&gt;
== Tree of path for new module files (required) ==&lt;br /&gt;
This is how your files must be organized when building a new module (the zip file must also match this rule).&lt;br /&gt;
Note: Only second line is mandatory.&lt;br /&gt;
&lt;br /&gt;
{{TemplateModuleTreeSimple}}&lt;br /&gt;
&lt;br /&gt;
== Create your SQL tables and the PHP DAO class (optional) ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: If your module needs to manage data of its own&lt;br /&gt;
&lt;br /&gt;
=== Create your .sql file ===&lt;br /&gt;
If your module is designed to manage data of its own, which are not available in the standard version of Dolibarr, it is necessary to define SQL tables to store the data.&lt;br /&gt;
&lt;br /&gt;
Scripts for creating tables and load data for your own module must be placed in a directory: Create a subdirectory called &amp;quot;sql&amp;quot; into directory of your module (eg htdocs/mymodule/sql) to put the sql scripts that you will create. &lt;br /&gt;
&lt;br /&gt;
Then check into your descriptor file, into function &#039;&#039;&#039;init&#039;&#039;&#039; that the line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;_load_tables(&#039;/mymodule/sql/&#039;);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is not commented.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Rules to follow:&#039;&#039;&lt;br /&gt;
* Add the files about creating tables commands on the principle of a file &#039;&#039;&#039;llx_matable.sql&#039;&#039;&#039; per table, with a possibly file &#039;&#039;&#039;llx_matable.key.sql&#039;&#039;&#039; (see existing files in &#039;&#039;&#039;install/mysql/tables&#039;&#039;&#039; for examples).&lt;br /&gt;
&lt;br /&gt;
* To manage data, you must create a file called &#039;&#039;&#039;data.sql&#039;&#039;&#039; inside directory &#039;&#039;&#039;/mymodule/sql/&#039;&#039;&#039; that contains SQL command to add/edit/delete data.&lt;br /&gt;
* Don&#039;t use the double quote for strings (eg &#039;chaine&#039; not &amp;quot;chaine&amp;quot;) because the double quote have a specific meaning in PostGreSQL&lt;br /&gt;
Example of content of a file data.sql&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
 delete from llx_const where name=&#039;MYMODULE_IT_WORKS&#039; and entity=&#039;__ENTITY__&#039;;&lt;br /&gt;
 insert into llx_const (name, value, type, note, visible, entity) values (&#039;MYMODULE_IT_WORKS&#039;,&#039;1&#039;,&#039;chaine&#039;,&#039;A constant vor my module&#039;,1,&#039;__ENTITY__&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Files must be operational for the database mysql. Rem: The files of other databases are not maintained. They will be read and converted on the fly by the driver of the other database.&lt;br /&gt;
&lt;br /&gt;
=== Test your .sql files ===&lt;br /&gt;
&lt;br /&gt;
Once the files ready, you can return to Dolibarr to disable the module, drop those tables in database and reactivate the module. The tables should be recreated by the activation of the module. If this is not the case, check your scripts by passing them by hand, or check the Dolibarr logs.&lt;br /&gt;
&lt;br /&gt;
=== Generate the PHP DAO class ===&lt;br /&gt;
Once you have created your tables into the database, move to the dev/skeletons directory and run the script&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;php build_class_from_table.php tablename modulename&amp;lt;/source&amp;gt;&lt;br /&gt;
Note: If the command does not work, try to use php-cli php instead.&lt;br /&gt;
&lt;br /&gt;
This will generate a file &#039;&#039;&#039;out.tablename.class.php&#039;&#039;&#039; that contains the class to manage table tablename. &lt;br /&gt;
In this class, you can find the CRUD methods (Create / Read / Update / Delete) already working to do an insert, a fetch (select), an update, a delete of a row in table.&lt;br /&gt;
Remove just the &amp;quot;out&amp;quot; from the file name and put the file in a subdirectory of &#039;&#039;&#039;htdocs&#039;&#039;&#039; specific to your module (in htdocs/mymodule for example).&lt;br /&gt;
&lt;br /&gt;
A file &#039;&#039;&#039;out.tablename_script.php&#039;&#039;&#039; has been generated and contains a sample code to use the class for each of the 4 CRUD methods.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Since Dolibarr 6.0, the file dev/skeletons/build_class_from_table.php is no more provided. To build a class from a table you should use the ModuleBuilder modules provided as standard module.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== The tab management (optional) ==&lt;br /&gt;
&lt;br /&gt;
=== Add or remove your own tabs on object sheets ===&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: To add a tab on an object (invoices, orders, proposals, member ...)&lt;br /&gt;
&lt;br /&gt;
To do this go into the file descriptor of module previously created and edit the $this-&amp;gt;tabs array:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
	// Array to add new pages in new tabs or remove existing one&lt;br /&gt;
	$this-&amp;gt;tabs = array(&#039;objecttype:+tabname1:Title1:mylangfile@mymodule:$user-&amp;gt;rights-&amp;gt;mymodule-&amp;gt;read:/mymodule/mypagetab1.php?id=__ID__&#039;    // To add a new tab identified by code tabname1&lt;br /&gt;
                            &#039;objecttype:+tabname2:Title2:mylangfile@mymodule:$user-&amp;gt;rights-&amp;gt;mymodule-&amp;gt;read:/mymodule/mypagetab2.php?id=__ID__&#039;,   // To add a new tab identified by code tabname2&lt;br /&gt;
                            &#039;objecttype:-tabname&#039;);                                                     // To remove an existing tab identified by code tabname&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The table should contain a list of strings, each string representing a new tab. &lt;br /&gt;
The format of the string consisting of 5 parts separated by &amp;quot;:&amp;quot;&lt;br /&gt;
* Part 1: The element type (objecttype) where the tab should appear is a value from the following:&lt;br /&gt;
{{TemplateModuleTabs}}&lt;br /&gt;
* Part 2: A code to identify tab to add (start with +) or to remove (start with -)&lt;br /&gt;
* Part 3: The title of the tab. This can be a hard read or better code translation in a file lang.&lt;br /&gt;
* Part 4: The name of the file &amp;quot;*.lang&amp;quot; which contains correspondence between the code translation and language to display. If this name is followed with @mymodule, Dolibarr will search translation file &amp;quot;*.lang&amp;quot; within the module, so htdocs/mymodule/langs/code_CODE/mylangfile.lang, otherwise Dolibarr will look for file htdocs/langs/code_CODE/mylangfile.lang &lt;br /&gt;
* Part 5: A condition to test if tab must be visible. Put 1 to be always visible.&lt;br /&gt;
* Part 6: The url of the page to display when you click on the tab. The __ID__ string will be replaced automatically by the Id of the element concerned.&lt;br /&gt;
&lt;br /&gt;
To feed the contents of the tab with data from the database, see the next chapter.&lt;br /&gt;
&lt;br /&gt;
=== Show tabs navigation into your own pages ===&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: To show all standard tabs of an object (produit, tiers, etc.) on your page.&lt;br /&gt;
&lt;br /&gt;
You must follow these steps :&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Include files you need into your file&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For each object type, there are two files to include with line&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;require_once($url_fichier) ;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is example of files to include (DOL_DOCUMENT_ROOT is often dolibarr/htdocs/) :&lt;br /&gt;
* Object thirdparty (thirdparty) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/societe/class/societe.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/core/lib/company.lib.php&lt;br /&gt;
* Object product (product) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/product/class/product.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/core/lib/product.lib.php&lt;br /&gt;
* Object invoice (invoice) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/compta/facture/class/facture.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/core/lib/invoice.lib.php&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Create and load the object to show into your tab&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create instance of object of the correct class and load object from database by using the fetch method of object en providing to this method the id you get from url (ie : /mytab.php?id=1).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example :&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$id=GETPOST(&#039;id&#039;,&#039;int&#039;);&lt;br /&gt;
$ref=GETPOST(&#039;ref&#039;,&#039;alpha&#039;);&lt;br /&gt;
$product = new Product($db) ;&lt;br /&gt;
$result = $product-&amp;gt;fetch($id,$ref) ; // Test $result to check the database read is ok&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Get list of all tabs to show for your object type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use fonction XXX_prepare_head($obj), where XXX is name of object. This will return an array with all definition of tab entries to show. Parameter to put into this method is the instance of object you want tabs.&lt;br /&gt;
&lt;br /&gt;
The resulting array has the following structure&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$head        // Array of tabs&lt;br /&gt;
$head[$h]    // Element to describe one tab.&lt;br /&gt;
$head[$h][0] // Url of page to show when you click on tab&lt;br /&gt;
$head[$h][1] // Title of tab&lt;br /&gt;
$head[$h][2] // Code name to identify the tab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example :&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$head = product_prepare_head($product, $user) ; // parameter $user is present for some function anly&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. show tabs into your page&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use function dol_fiche_head() to show all tabs defined into array $head returned by XX_prepare_head().&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
dol_fiche_head($links, $active=&#039;0&#039;, $title=&#039;&#039;, $notab=0, $picto=&#039;&#039;)&lt;br /&gt;
//$links  // Tableau des onglets, appelé $head plus haut.&lt;br /&gt;
//$active // Onglet actif (mettre le nom de l&#039;onglet défini dans votre fichier de module, ou un nom contenu dans $head[$h][2]). Cet onglet sera mis en surbrillance&lt;br /&gt;
//$title  // Title to show (shown into a special tab that you can&#039;t click)&lt;br /&gt;
//$notab&lt;br /&gt;
//$picto  // Name of image to show into title. Possible values are:&lt;br /&gt;
//            product&lt;br /&gt;
//            service&lt;br /&gt;
//            company&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function will show required tabs and open an html element &#039;&#039;&amp;lt; div class=&amp;quot;&amp;quot; &amp;gt;&#039;&#039; that correspond to the area under the tabs. To close area of a tab, just use &#039;&#039;&amp;lt; /div &amp;gt;&#039;&#039; into your PHP page.&lt;br /&gt;
&lt;br /&gt;
== Create or modify PHP screens (optional) ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: If the purpose of your module is to add features that require new or modified screens.&lt;br /&gt;
&lt;br /&gt;
=== Create a new PHP screen ===&lt;br /&gt;
You must then create your PHP pages that will show/edit data from tables using the skeleton templates provided as an example in the directory &#039;&#039;&#039;modulebuilder/myobject_page.php&#039;&#039;&#039; (For the development of a script from the command line, see [[Script development]]).&lt;br /&gt;
&lt;br /&gt;
To create a new user screen, create a subdirectory of &#039;&#039;&#039;htdocs&#039;&#039;&#039; (if not already done) for your module (in &#039;&#039;&#039;htdocs/mymodule&#039;&#039;&#039; for example) to store the pages you will create.&lt;br /&gt;
&lt;br /&gt;
Copy, into that directory, the file &#039;&#039;&#039;myobject_page.phpp&#039;&#039;&#039; that will serve as a starting point for your page file.&lt;br /&gt;
Edit the file to have a correct relative path to the main.inc.php file. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Load Dolibarr environment&lt;br /&gt;
$res=0;&lt;br /&gt;
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)&lt;br /&gt;
if (! $res &amp;amp;&amp;amp; ! empty($_SERVER[&amp;quot;CONTEXT_DOCUMENT_ROOT&amp;quot;])) $res=@include($_SERVER[&amp;quot;CONTEXT_DOCUMENT_ROOT&amp;quot;].&amp;quot;/main.inc.php&amp;quot;);&lt;br /&gt;
// Try main.inc.php into web root detected using web root caluclated from SCRIPT_FILENAME&lt;br /&gt;
$tmp=empty($_SERVER[&#039;SCRIPT_FILENAME&#039;])?&#039;&#039;:$_SERVER[&#039;SCRIPT_FILENAME&#039;];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1;&lt;br /&gt;
while($i &amp;gt; 0 &amp;amp;&amp;amp; $j &amp;gt; 0 &amp;amp;&amp;amp; isset($tmp[$i]) &amp;amp;&amp;amp; isset($tmp2[$j]) &amp;amp;&amp;amp; $tmp[$i]==$tmp2[$j]) { $i--; $j--; }&lt;br /&gt;
if (! $res &amp;amp;&amp;amp; $i &amp;gt; 0 &amp;amp;&amp;amp; file_exists(substr($tmp, 0, ($i+1)).&amp;quot;/main.inc.php&amp;quot;)) $res=@include(substr($tmp, 0, ($i+1)).&amp;quot;/main.inc.php&amp;quot;);&lt;br /&gt;
if (! $res &amp;amp;&amp;amp; $i &amp;gt; 0 &amp;amp;&amp;amp; file_exists(dirname(substr($tmp, 0, ($i+1))).&amp;quot;/main.inc.php&amp;quot;)) $res=@include(dirname(substr($tmp, 0, ($i+1))).&amp;quot;/main.inc.php&amp;quot;);&lt;br /&gt;
// Try main.inc.php using relative path&lt;br /&gt;
if (! $res &amp;amp;&amp;amp; file_exists(&amp;quot;../main.inc.php&amp;quot;)) $res=@include(&amp;quot;../main.inc.php&amp;quot;);&lt;br /&gt;
if (! $res &amp;amp;&amp;amp; file_exists(&amp;quot;../../main.inc.php&amp;quot;)) $res=@include(&amp;quot;../../main.inc.php&amp;quot;);&lt;br /&gt;
if (! $res &amp;amp;&amp;amp; file_exists(&amp;quot;../../../main.inc.php&amp;quot;)) $res=@include(&amp;quot;../../../main.inc.php&amp;quot;);&lt;br /&gt;
if (! $res) die(&amp;quot;Include of main fails&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note that you may add more &amp;quot;../&amp;quot; depending on the depth of the file relative to your module directory tree.&lt;br /&gt;
The modules developed for all version of Dolibarr after the 3.2 should be able to be moved in a different folder than &amp;quot;htdocs&amp;quot;, like &amp;quot;htdocs/custom&amp;quot;, without having to modify the source code of the module, that&#039;s why we make several includes, so this rule must be applied by all modules.&lt;br /&gt;
&lt;br /&gt;
It&#039;s in the main.inc.php file that is loaded technical environment variables and permissions. The following variables are objects positioned in this file:&lt;br /&gt;
&lt;br /&gt;
* $user    Objet that contains the characteristics of the user + his permissions.&lt;br /&gt;
* $conf    Objet that contains Dolibarr configuration.&lt;br /&gt;
* $db      Objet that contains an opened connection handler to the database.&lt;br /&gt;
* $langs   Objet that contains the user&#039;s language.&lt;br /&gt;
&lt;br /&gt;
Then enter your code to display the page.&lt;br /&gt;
&lt;br /&gt;
* To include a class or library dedicated to the module is done using a Dolibarr function (and not using directly include_once):&lt;br /&gt;
&#039;&#039;Example :&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
dol_include_once(&#039;/mymodule/class/myclass.class.php&#039;, &#039;MyClass&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To include classes provided with Dolibarr, use the following syntax:&lt;br /&gt;
&#039;&#039;Example :&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
require_once DOL_DOCUMENT_ROOT.&#039;/core/class/doli.class.php&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add some fields into existing forms ===&lt;br /&gt;
You may want to provide a module that add more fields into forms (input and view) of some elements. &lt;br /&gt;
&lt;br /&gt;
A heavy solution (but not so bad) may be to replace all pages used to create element (this means disable the &amp;quot;New element&amp;quot; menu entry and adding yours, and disable tab that show element to replace with a tab that is your own full page (copied/pasted from original) to do same than original page but modified to add your fields and stored added data into your own table). Go to menu [[#Define your entries in menu (optional)]] and [[#The tab management (optional)]] if this solution suits you (this solution is more powerfull since you can change everything you want into page). &lt;br /&gt;
&lt;br /&gt;
We will describe here another solution, that works only to &amp;quot;add fields&amp;quot; at end of existing fields, using the element &amp;quot;category&amp;quot; as an example but you can convert this tutorial for invoice, proposal ...&lt;br /&gt;
* First thing is to add a table, owned by your module, to store value of new fields. This table will have only one column called &amp;quot;rowid&amp;quot; (will contains same value than field rowid of element table) + one column for each new field you want to add. Then create a class with CRUD (Create/Read/Update/Delete) methods for this new table. For this two tasks, go back to previous chapter [[#Create your SQL tables and the PHP DAO class]].&lt;br /&gt;
* Next step is to add a hook into your module to add the new fields into the form. See chapter [[Hooks_system#Implement_the_Hook]] for generic documentation to use hooks.&lt;br /&gt;
If you follow this tutorial, to be able to add fields into category forms, you must do:&lt;br /&gt;
{{ToComplete}}&lt;br /&gt;
&lt;br /&gt;
=== Replace parts of screen that are templated (version 3.3+) ===&lt;br /&gt;
Some parts of Dolibarr screen are isolated into native PHP template files.&lt;br /&gt;
You can develop a module to overwrite such templates with yours.&lt;br /&gt;
{{ToComplete}}&lt;br /&gt;
&lt;br /&gt;
=== Add/replace part of fields supported by hooks ===&lt;br /&gt;
See chapter [[Hooks_system#Implement_the_Hook]] to know how to use Dolibarr existing hooks to add/replace code at Dolibarr hooks place.&lt;br /&gt;
&lt;br /&gt;
=== Database access ===&lt;br /&gt;
If you need to edit some data in database inside you own table, use the PHP class generated before.&lt;br /&gt;
&lt;br /&gt;
If you to make access to tables with no dedicated PHP class available, this is always possible (for example if you want to get a list of records with a particular join or filter). In this case, this is a code samples to follow:&lt;br /&gt;
&lt;br /&gt;
To make an insert, update or delete:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$db-&amp;gt;begin();   // Start transaction&lt;br /&gt;
$db-&amp;gt;query(&amp;quot;My SQL request insert, update or delete&amp;quot;);&lt;br /&gt;
$db-&amp;gt;commit();       // Validate transaction&lt;br /&gt;
or $db-&amp;gt;rollback()  // Cancel transaction&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To read:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$resql=$db-&amp;gt;query(&amp;quot;My select request&amp;quot;);&lt;br /&gt;
if ($resql)&lt;br /&gt;
{&lt;br /&gt;
	$num = $db-&amp;gt;num_rows($resql);&lt;br /&gt;
	$i = 0;&lt;br /&gt;
	if ($num)&lt;br /&gt;
	{&lt;br /&gt;
		while ($i &amp;lt; $num)&lt;br /&gt;
		{&lt;br /&gt;
			$obj = $db-&amp;gt;fetch_object($resql);&lt;br /&gt;
			if ($obj)&lt;br /&gt;
			{&lt;br /&gt;
				// You can use here results&lt;br /&gt;
				print $obj-&amp;gt;field1;&lt;br /&gt;
				print $obj-&amp;gt;field2;&lt;br /&gt;
			}&lt;br /&gt;
			$i++;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Define style of your pages ===&lt;br /&gt;
To have the look of your own pages to match the Dolibarr theme, it is necessary to use the Dolibarr CSS styles.&lt;br /&gt;
&lt;br /&gt;
You can use for example:&lt;br /&gt;
&lt;br /&gt;
* class=&amp;quot;&#039;&#039;&#039;liste_titre&#039;&#039;&#039;&amp;quot; on tags &#039;&#039;tr&#039;&#039; and &#039;&#039;td&#039;&#039; for the head row of a table.&lt;br /&gt;
* class=&amp;quot;&#039;&#039;&#039;pair&#039;&#039;&#039;&amp;quot; or class=&amp;quot;&#039;&#039;&#039;impair&#039;&#039;&#039;&amp;quot; on tags &#039;&#039;tr&#039;&#039; and &#039;&#039;td&#039;&#039; of other rows of a table.&lt;br /&gt;
* class=&amp;quot;&#039;&#039;&#039;flat&#039;&#039;&#039;&amp;quot; on all input fields (&#039;&#039;input, select, textarea&#039;&#039;...).&lt;br /&gt;
* class=&amp;quot;&#039;&#039;&#039;button&#039;&#039;&#039;&amp;quot; on HTML fields with type &#039;&#039;input type=&amp;quot;submit&amp;quot;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Use the Dolibarr date picker ===&lt;br /&gt;
If you want to use the Dolibarr date selector (with its calendar popup) into your pages, use the following line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 $form=new Form($db);&lt;br /&gt;
 $form-&amp;gt;select_date(&#039;&#039;,&#039;mykey&#039;,0,0,0,&amp;quot;myform&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The string mykey will identify the date selector in the form. You must use different values if you use several date selectors in same page.&lt;br /&gt;
The string myform is the name of the FORM in which the selector is included (value found in the form name=&amp;quot;myform&amp;quot; in HTML page).&lt;br /&gt;
This means a date selector must be included necessarily into an html FORM.&lt;br /&gt;
&lt;br /&gt;
To get value after the POST of your form, the command is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$mydate = dol_mktime(12, 0 , 0, $_POST[&#039;mykeymonth&#039;], $_POST[&#039;mykeyday&#039;], $_POST[&#039;mykeyyear&#039;]);&lt;br /&gt;
print strftime(&#039;%A %d %B %Y&#039;, $mydate);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add your own setup page (optional) ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: If your module needs parameters, which are to be provided by the user, for proper setting up of the module.&lt;br /&gt;
&lt;br /&gt;
=== Create your page to edit parameters ===&lt;br /&gt;
If your module needs several parameters to be setup, you must create a page to edit options (these options will be saved in the [[Table llx_const|table &#039;&#039;&#039;llx_const&#039;&#039;&#039;]]).&lt;br /&gt;
Create a page named &#039;&#039;&#039;mymodule_setuppage.php&#039;&#039;&#039; that shows a form for possible options to update them into the above mentioned table.&lt;br /&gt;
It is necessary to take an example from a page of the directory &#039;&#039;&#039;/admin&#039;&#039;&#039; that will show you the way to read/save your parameters.&lt;br /&gt;
Put this PHP page into the directory &#039;&#039;&#039;/admin&#039;&#039;&#039; of your module (e.g. mymodule/admin/mymodule_setuppage.php).&lt;br /&gt;
&lt;br /&gt;
=== Modify the descriptor file of your module ===&lt;br /&gt;
Then, within the descriptor file of your module, modify the variable &#039;&#039;&#039;config_page_url&#039;&#039;&#039; to set name of this PHP page.&lt;br /&gt;
If the page is in the directory &#039;&#039;&#039;admin/&#039;&#039;&#039;, then the path is not required, e.g. like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;config_page_url = array(&amp;quot;mymodule_setuppage.php&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If the page is in the directory &#039;&#039;&#039;mymodule/admin/&#039;&#039;&#039;, then like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;config_page_url = array(&amp;quot;mymodule_setuppage.php@mymodule&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Test your page ===&lt;br /&gt;
Go into page &#039;&#039;&#039;Home-&amp;gt;Setup-&amp;gt;Modules&#039;&#039;&#039;, you should see a picture at the end of the line of your module to reach your setup page. Click on it, you should be able to view/edit parameters from your page.&lt;br /&gt;
&lt;br /&gt;
== Define your entries in menu (optional) ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: If you have created PHP pages, it is necessary that those pages can be reached from menu entries in Dolibarr menu.&lt;br /&gt;
&lt;br /&gt;
=== Define your menu entries ===&lt;br /&gt;
For this, you must define into the module descriptor, the array this-&amp;gt;menu that declare all menus added by your module.&lt;br /&gt;
This array contains entries that will appear once your module is activated.&lt;br /&gt;
The example module descriptor file &#039;&#039;&#039;modMyModule.class.php&#039;&#039;&#039; contains an example to declare a top menu and also its left menu entries.&lt;br /&gt;
&lt;br /&gt;
This is the example of code to declare your own menu entries in a module descriptor file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Main menu entries&lt;br /&gt;
$this-&amp;gt;menu = array();			// List of menus to add&lt;br /&gt;
$r=0;&lt;br /&gt;
&lt;br /&gt;
// Add here entries to declare new menus&lt;br /&gt;
// Example to declare the Top Menu entry:&lt;br /&gt;
$this-&amp;gt;menu[$r]=array(	&#039;fk_menu&#039;=&amp;gt;0,			// Put 0 if this is a top menu&lt;br /&gt;
			&#039;type&#039;=&amp;gt;&#039;top&#039;,			// This is a Top menu entry&lt;br /&gt;
			&#039;titre&#039;=&amp;gt;&#039;MyModule top menu&#039;,&lt;br /&gt;
			&#039;mainmenu&#039;=&amp;gt;&#039;mymodule&#039;,&lt;br /&gt;
			&#039;leftmenu&#039;=&amp;gt;&#039;mymodule&#039;,&lt;br /&gt;
			&#039;url&#039;=&amp;gt;&#039;/mymodule/pagetop.php&#039;,&lt;br /&gt;
			&#039;langs&#039;=&amp;gt;&#039;mylangfile&#039;,	// Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.&lt;br /&gt;
			&#039;position&#039;=&amp;gt;100,&lt;br /&gt;
			&#039;enabled&#039;=&amp;gt;&#039;1&#039;,			// Define condition to show or hide menu entry. Use &#039;$conf-&amp;gt;mymodule-&amp;gt;enabled&#039; if entry must be visible if module is enabled.&lt;br /&gt;
			&#039;perms&#039;=&amp;gt;&#039;1&#039;,			// Use &#039;perms&#039;=&amp;gt;&#039;$user-&amp;gt;rights-&amp;gt;mymodule-&amp;gt;level1-&amp;gt;level2&#039; if you want your menu with a permission rules&lt;br /&gt;
			&#039;target&#039;=&amp;gt;&#039;&#039;,&lt;br /&gt;
			&#039;user&#039;=&amp;gt;2);				// 0=Menu for internal users, 1=external users, 2=both&lt;br /&gt;
$r++;&lt;br /&gt;
&lt;br /&gt;
// Example to declare a Left Menu entry:&lt;br /&gt;
$this-&amp;gt;menu[$r]=array(	&#039;fk_menu&#039;=&amp;gt;&#039;fk_mainmenu=xxx&#039;,		    // Use &#039;fk_mainmenu=xxx&#039; or &#039;fk_mainmenu=xxx,fk_leftmenu=yyy&#039; where xxx is mainmenucode and yyy is a leftmenucode of parent menu&lt;br /&gt;
			&#039;type&#039;=&amp;gt;&#039;left&#039;,			        // This is a Left menu entry&lt;br /&gt;
			&#039;titre&#039;=&amp;gt;&#039;MyModule left menu 1&#039;,&lt;br /&gt;
			&#039;mainmenu&#039;=&amp;gt;&#039;xxx&#039;,&lt;br /&gt;
                        &#039;leftmenu&#039;=&amp;gt;&#039;yyy&#039;,&lt;br /&gt;
			&#039;url&#039;=&amp;gt;&#039;/mymodule/pagelevel1.php&#039;,&lt;br /&gt;
			&#039;langs&#039;=&amp;gt;&#039;mylangfile&#039;,	// Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.&lt;br /&gt;
			&#039;position&#039;=&amp;gt;100,&lt;br /&gt;
			&#039;enabled&#039;=&amp;gt;&#039;1&#039;,			// Define condition to show or hide menu entry. Use &#039;$conf-&amp;gt;mymodule-&amp;gt;enabled&#039; if entry must be visible if module is enabled.&lt;br /&gt;
			&#039;perms&#039;=&amp;gt;&#039;1&#039;,			// Use &#039;perms&#039;=&amp;gt;&#039;$user-&amp;gt;rights-&amp;gt;mymodule-&amp;gt;level1-&amp;gt;level2&#039; if you want your menu with a permission rules&lt;br /&gt;
			&#039;target&#039;=&amp;gt;&#039;&#039;,&lt;br /&gt;
			&#039;user&#039;=&amp;gt;2);				// 0=Menu for internal users,1=external users, 2=both&lt;br /&gt;
$r++;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To show menu or not depending on a permission, modify property &#039;&#039;&#039;perms&#039;&#039;&#039; in array. See chapter on permissions later to see how to add permissions.&lt;br /&gt;
&lt;br /&gt;
=== Test your menu entries ===&lt;br /&gt;
Disable and reenable your module under Dolibarr module setup page, menus entries must appear (if property &#039;enabled&#039; is declaration array is ok).&lt;br /&gt;
&lt;br /&gt;
== Add your own permissions (optional) ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: If you want to add new permissions.&lt;br /&gt;
&lt;br /&gt;
The way to define permissions that will manage your module is done inside the module descriptor created previously.&lt;br /&gt;
Modify line &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;rights_class = &#039;mymodule&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
with correct value for mymodule.&lt;br /&gt;
&lt;br /&gt;
Then you must fill the array $this-&amp;gt;rights with as many entries than different permissions you need to manage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;rights[$r][0] = 10001;&lt;br /&gt;
$this-&amp;gt;rights[$r][1] = &#039;Label by default of permission&#039;;&lt;br /&gt;
$this-&amp;gt;rights[$r][3] = 1;&lt;br /&gt;
$this-&amp;gt;rights[$r][4] = &#039;action&#039;;&lt;br /&gt;
$this-&amp;gt;rights[$r][5] = &#039;subaction&#039;;&lt;br /&gt;
$r++;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Into $this-&amp;gt;rights[$r][0], put a permission id not already used (See into menu &#039;&#039;&#039;System info&#039;&#039;&#039; on a working installation of Dolibarr to know list of id already used by standard modules.&lt;br /&gt;
Into $this-&amp;gt;rights[$r][3], put 1 if this permission must be granted automatically by default to any new created user.&lt;br /&gt;
Into $this-&amp;gt;rights[$r][1], put a label by default for permission (This label will be used if no translation can be found into the file &#039;&#039;&#039;admin.lang&#039;&#039;&#039;).&lt;br /&gt;
Into $this-&amp;gt;rights[$r][4] and $this-&amp;gt;rights[$r][5], put an action and subaction string without spaces. You will be able to test if a user has the permission in your PHP source code with the sequence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
if ($user-&amp;gt;rights-&amp;gt;mymodule-&amp;gt;action-&amp;gt;subaction) ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Define you own box (optional) ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: If your module need to provide one or several new boxes to show on home page.&lt;br /&gt;
&lt;br /&gt;
=== Define your box ===&lt;br /&gt;
For this, modify the array $this-&amp;gt;boxes into the module descriptor file.&lt;br /&gt;
All you have to do is to add 2 lines for each box file you will create into directory &#039;&#039;&#039;htdocs/mymodule/core/boxes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;boxes[0][&#039;file&#039;]=&#039;mybox0.php@mymodule&#039;&lt;br /&gt;
$this-&amp;gt;boxes[0][&#039;note&#039;]=&#039;My box 0&#039;&lt;br /&gt;
 ...&lt;br /&gt;
$this-&amp;gt;boxes[n][&#039;file&#039;]=&#039;myboxn.php@mymodule&#039;&lt;br /&gt;
$this-&amp;gt;boxes[n][&#039;note&#039;]=&#039;My box n&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then create files &#039;&#039;&#039;htdocs/mymodule/core/boxes/mybox0.php&#039;&#039;&#039;, &#039;&#039;&#039;htdocs/mymodule/core/boxes/mybox1.php&#039;&#039;&#039;... by copying an example from an existing box file (found into directory &#039;&#039;&#039;htdocs/core/boxes&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
=== Test if your box is detected by Dolibarr ===&lt;br /&gt;
Disable and enabled module.&lt;br /&gt;
&lt;br /&gt;
Go into menu &#039;&#039;&#039;Home - Setup - Boxes&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Your boxes must appear in the list of boxes you can activated. Activate the box and go on home page to see if the box is showing correctly.&lt;br /&gt;
&lt;br /&gt;
== Define your own export (optional) ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: If your module provide new predefined database export profiles (for its own tables or for already existing tables of another module).&lt;br /&gt;
&lt;br /&gt;
=== Define export ===&lt;br /&gt;
For this uncomment and modify arrays $this-&amp;gt;export_xxx in your module descriptor file.&lt;br /&gt;
&lt;br /&gt;
=== Test your export ===&lt;br /&gt;
Go into menu Tools -&amp;gt; Export. Your export will appear in the list of available predefined exports (if your module is enabled).&lt;br /&gt;
Choose it, you must see list of all possible fields defined in the export arrays.&lt;br /&gt;
Choose on field and try to build an export file. If ok, try again with all fields.&lt;br /&gt;
&lt;br /&gt;
== Define your CSS styles (optional) ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: If in your PHP pages, you use class styles that are not defined inside Dolibarr themes CSS (not recommanded).&lt;br /&gt;
&lt;br /&gt;
=== Create and declare your style sheet ===&lt;br /&gt;
Create a style sheet CSS named &#039;&#039;&#039;mymodule.css&#039;&#039;&#039; or &#039;&#039;&#039;mymodule.css.php&#039;&#039;&#039; and put it into directory &#039;&#039;&#039;htdocs/mymodule&#039;&#039;&#039;. You can have only one CSS file per module.&lt;br /&gt;
Remember it&#039;s better to use existing styles already available by default into Dolibarr (The CSS file used by Dolibarr is file &#039;&#039;&#039;themes/mytheme/&#039;&#039;themename&#039;&#039;.css.php&#039;&#039;&#039;. Create your own CSS file only if you need absolutely to add not already existing styles.&lt;br /&gt;
&lt;br /&gt;
Once your style sheet is ready, declare it into your module descriptor file by modifying the property &#039;&#039;&#039;$this-&amp;gt;modules_parts&#039;&#039;&#039;.&lt;br /&gt;
Value to put here must be a relative URL to your CSS file.&lt;br /&gt;
For example&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;module_parts = array(&#039;css&#039; =&amp;gt; array(&#039;/mymodule/css/mymodule.css.php&#039;));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Test your style sheet ===&lt;br /&gt;
Disable and enable your module.&lt;br /&gt;
&lt;br /&gt;
Go on home page (index.php). Show the HTML source of the page.&lt;br /&gt;
&lt;br /&gt;
You should see into the HTML header, a line that declare your style sheet.&lt;br /&gt;
&lt;br /&gt;
== Add your Javascript functions (optional) ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: If in your PHP pages, you use javascript functions not available in Dolibarr (in file lib_head.js)&lt;br /&gt;
&lt;br /&gt;
If you need to use your own javascript functions inside your PHP pages, it is necessary to have your functions, defined into your  javascript file &#039;&#039;&#039;htdocs/mymodule/js/mymodule.js&#039;&#039;&#039;, included into the HTML HEAD section.&lt;br /&gt;
To ask Dolibarr that forge this header to include your own javascript file, you must just provide it to the llxHeader() function called by your page.&lt;br /&gt;
&lt;br /&gt;
Example for page /htdocs/mymodule/mypage.php :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$morejs=array(&amp;quot;/mymodule/js/mymodule.js&amp;quot;);&lt;br /&gt;
llxHeader(&#039;&#039;,&#039;Titre&#039;,&#039;&#039;,&#039;&#039;,&#039;&#039;,&#039;&#039;,$morejs,&#039;&#039;,0,0); &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Run your own code on any Dolibarr event (optional) ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: If you want to execute your own code once a common Dolibarr event has occurred (example: I want to update a table in my module when an invoice is created into Dolibarr), you must create a &#039;&#039;&#039;triggers&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
See also [[Interfaces_Dolibarr_toward_foreign_systems]]&lt;br /&gt;
and [[Interfaces_from_foreign_systems_toward_Dolibarr]]&lt;br /&gt;
&lt;br /&gt;
== Insert your code inside Dolibarr hooks positions (optional) ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: When you want to add code or replace Dolibarr code into another situation than a business event (See previous chapter for adding code during a business event).&lt;br /&gt;
&lt;br /&gt;
See page [[Hooks_system]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Add your own numbering rules ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: When you need a new rule for generated ref of elements that is not covered by existing rules.&lt;br /&gt;
&lt;br /&gt;
See page [[Create numbering module]].&lt;br /&gt;
&lt;br /&gt;
== Add your document template (optional) ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: When you want to personalized your own generated PDF or ODT documents.&lt;br /&gt;
&lt;br /&gt;
Note: To add this feature you don&#039;t need to create a module descriptor.&lt;br /&gt;
&lt;br /&gt;
Documentation to add your own template is available on page [[Create_a_PDF_document_template]] or [[Create_an_ODT_document_template]].&lt;br /&gt;
&lt;br /&gt;
== Add your skin (optional) ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: When you want to personalized your colors/fonts/images.&lt;br /&gt;
&lt;br /&gt;
Note: To add this feature you don&#039;t need to create a module descriptor.&lt;br /&gt;
&lt;br /&gt;
To add your own skin, read page [[Skins]].&lt;br /&gt;
&lt;br /&gt;
=Some coding rules and predefined functions =&lt;br /&gt;
The coding rules to be followed are defined in the [[Developer documentation]], under section &amp;quot;General Information - Language and standards development&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
A lot of predefined features for developers are also available and described into page [[Developer documentation]] under section &amp;quot;Technical components of Dolibarr&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=Using MDA =&lt;br /&gt;
A method to generate a functional module from a UML model has been developed. More information on the page [[UML2Dolibarr - Build a module using MDA]].&lt;br /&gt;
&lt;br /&gt;
=Create a package to distribute and install your module =&lt;br /&gt;
This process must be used to generate a package to submit it on the http://www.dolistore.com market place.&lt;br /&gt;
But you can use it to have a package easy to distribute on your on network.&lt;br /&gt;
&lt;br /&gt;
* Go into the directory &#039;&#039;&#039;/build&#039;&#039;&#039; and copy the file &#039;&#039;&#039;makepack-dolibarrmodules.conf&#039;&#039;&#039; into &#039;&#039;&#039;makepack-mymodule.conf&#039;&#039;&#039;. Warning, this directory may not be provided in some packages of stable versions. If so, it can be retrieved from the snapshot available for download on the Dolibarr website in area &amp;quot;Development version&amp;quot; (taken in this case the whole build directory which is autonomous and independent directory).&lt;br /&gt;
&lt;br /&gt;
Edit this file to add list of file names for all new files you created for your module (module descriptor, new sql tables files, php page, images, etc...)&lt;br /&gt;
&lt;br /&gt;
* Run the script via Perl (need the Perl version 5.0 or later):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
perl makepack-dolibarrmodule.pl&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The script asks you the name of your module, its major and minor version. A file &#039;&#039;&#039;mymodule.zip &#039;&#039;&#039; will then be manufactured containing your module ready to be deployed.&lt;br /&gt;
&lt;br /&gt;
* The person who receives your module must then place the file in the root directory of a Dolibarr installation and perform the command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar -xvf mymodule.zip&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If you want your module to be public, you can submit it (the zip file) on Dolibarr market place web site: {{LinkToPluginDownload}} (you must create an account first and be logged to use the link &amp;quot;Submit a module/product&amp;quot;).&lt;br /&gt;
** If your module was build correctly, file will be validated later.&lt;br /&gt;
** If quality is enough and license permits it, code might be added inside main Dolibarr sources (except if you disagree for that).&lt;br /&gt;
&lt;br /&gt;
= Enabling/activation condition of external module on DoliStore =&lt;br /&gt;
&lt;br /&gt;
See [[Module_Dolistore_Validation_Rules|Validation Rules]]&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Cr%C3%A9er_un_mod%C3%A8le_de_document_PDF&amp;diff=38516</id>
		<title>Créer un modèle de document PDF</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Cr%C3%A9er_un_mod%C3%A8le_de_document_PDF&amp;diff=38516"/>
		<updated>2018-05-06T09:50:38Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: /* Activer son modèle dans Dolibarr */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TemplateDocDev}}&lt;br /&gt;
Ce document décrit comment créer son propre modèle de génération de document PDF afin de personnaliser ses documents (propales, factures, etc...)&lt;br /&gt;
Il se base sur les propositions commerciales comme exemple mais s&#039;applique à tout type de document.&lt;br /&gt;
&lt;br /&gt;
Pour savoir comment générer un modèle de document ODT, voir la page [[Créer un modèle de document ODT]].&lt;br /&gt;
Créer un modèle PDF requiert des connaissances en programmation PHP mais pas la création de modèles ODT. &lt;br /&gt;
&lt;br /&gt;
= Prérequis =&lt;br /&gt;
* Dolibarr: 3.0+&lt;br /&gt;
* Connaissance en PHP&lt;br /&gt;
&lt;br /&gt;
= Trouver le modèle existant le plus proche =&lt;br /&gt;
Dans Dolibarr, tester les modèles existants en allant dans la configuration du module puis en consultant l&#039;aperçu en cliquant le picto &amp;quot;Aperçu&amp;quot; en fin de ligne du modèle. Consulter chacun des modèles disponibles.&lt;br /&gt;
&lt;br /&gt;
Parmi ceux existant, noter le modèle le plus proche de vos besoins. Dans cet exemple, c&#039;est le modèle azur (correspondant au fichier pdf_propale_azur.modules.php).&lt;br /&gt;
&lt;br /&gt;
Pour info, tous les modèles sont dans &#039;&#039;&#039;htdocs/core/modules&#039;&#039;&#039; puis le sous-répertoire propale pour les propositions commerciales, facture pour les factures, commandes pour les commandes, etc...&lt;br /&gt;
&lt;br /&gt;
= Créer le nouveau modèle =&lt;br /&gt;
Par sécurité, on conservera les modèles d&#039;origine. Pour l&#039;exemple, on part du principe qu&#039;on crée un nouveau module de proposition commerciale qu&#039;on nommera &#039;masocietebleu&#039; et qui s&#039;inspire du module &#039;azur&#039;:&lt;br /&gt;
* Copier-coller pdf_propale_azur.modules.php&lt;br /&gt;
* Renommer la copie en pdf_propale_masocietebleu.modules.php&lt;br /&gt;
* L&#039;éditer et faire les modifs suivantes dans le code:&lt;br /&gt;
# Renommer &#039;Class pdf_propale_azur { &#039;    en &#039;Class pdf_propale_masocietebleu { &#039;&lt;br /&gt;
# Renommer &#039;Function pdf_propale_azur($db=0)&#039; en &#039;Function pdf_propale_masocietebleu($db=0)&#039;&lt;br /&gt;
# Renommer la variable $this-&amp;gt;name pour refléter le nouveau nom. Par exemple pour le modèle &#039;azur&#039;, changer la ligne &#039;$this-&amp;gt;name = &amp;quot;azur&amp;quot;;&#039; en &#039;$this-&amp;gt;name = &amp;quot;masocietebleu&amp;quot;;&#039;.&lt;br /&gt;
# Sauvegarder : le modèle &#039;masocietebleu&#039; est disponible dans la liste des modèles de propales de Dolibarr&lt;br /&gt;
* Tester ce modèle (Voir chapitre précédent) avant d&#039;aller plus loin...&lt;br /&gt;
* Ajouter dans la table llx_document_model le nouveau modéle que vous venez de créer&lt;br /&gt;
&lt;br /&gt;
= Personnaliser votre nouveau modèle =&lt;br /&gt;
Personnaliser le modèle créé.&lt;br /&gt;
Toujours dans pdf_propale_masocietebleu.modules.php, chercher la fonction &#039;Function _pagehead(&amp;amp;$pdf, $fac)&#039;. C&#039;est elle qui gère l&#039;affichage de l&#039;entête.  &lt;br /&gt;
&lt;br /&gt;
== Librairie de manipulation de PDF ==&lt;br /&gt;
La librairie utilisée pour la création de documents en PDF se nomme TCPDF et peut être trouvée dans htdocs/includes/tcpdf/tcpdf.class.php. C&#039;est également dans cette classe que l&#039;on trouve les nombreuses méthodes utilisées pour générer les différents éléments des documents.&lt;br /&gt;
&lt;br /&gt;
Les modèles eux-même instancient la classe FPDF et utilisent ensuite ses méthodes, combinées avec les données d&#039;une facture, d&#039;une commande ou d&#039;autres types de données.&lt;br /&gt;
&lt;br /&gt;
On retrouve généralement les appels suivants dans les scripts de création de documents:&lt;br /&gt;
* $pdf-&amp;gt;SetFont() - &#039;&#039;Désigne la fonte à utiliser pour le texte qui suivra&#039;&#039;&lt;br /&gt;
* $pdf-&amp;gt;SetXY() - &#039;&#039;Désigne le point de départ pour dessiner le prochain texte en coordonnées X,Y qui sont exprimées en millimètres de la page&#039;&#039;&lt;br /&gt;
* $pdf-&amp;gt;MultiCell() - &#039;&#039;Dessine une boîte pouvant contenir du texte, et dont on doit d&#039;abord donner la largeur et la hauteur - très utilisée&#039;&#039;&lt;br /&gt;
* $pdf-&amp;gt;GetY() - &#039;&#039;Renvoie la position courante en Y&#039;&#039;&lt;br /&gt;
* $pdf-&amp;gt;SetDrawColor() - &#039;&#039;Désigne la couleur à utiliser pour le prochain texte à écrire - généralement noir (0,0,0) ou blanc (255,255,255)&#039;&#039;&lt;br /&gt;
* $pdf-&amp;gt;Rect() - &#039;&#039;Dessine un rectangle dont le coin supérieur gauche est au point indiqué par les deux premiers paramètres et le coin inférieur droit utilise les deux derniers paramètres en mode relatif aux deux premiers&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Structure des scripts ==&lt;br /&gt;
Les scripts de génération des documents PDF, au moment du développement de la version 2.2, disposent des méthodes suivantes (prenant pour exemple le modèle &amp;quot;crabe&amp;quot;) au sein de la classe du nom du modèle:&lt;br /&gt;
* pdf_crabe() - &#039;&#039;Constructeur de l&#039;objet pdf&#039;&#039;&lt;br /&gt;
* write_pdf_file() - &#039;&#039;Méthode générale pour la génération du fichier. Cette méthode appelle toute les suivantes après avoir initialisé quelques variables&#039;&#039;&lt;br /&gt;
* _pagehead() - &#039;&#039;Méthode de dessin de l&#039;en-tête du document, incluant généralement le logo, le titre du document (et la date) ainsi que les cadres de l&#039;émetteur et du destinataire du document&#039;&#039;&lt;br /&gt;
* _tableau() - &#039;&#039;Méthode de dessin du tableau de détails (produits, services, etc)&#039;&#039;&lt;br /&gt;
* _tableau_info() - &#039;&#039;Méthode de dessin du tableau reprenant une liste d&#039;informations sur la facture&#039;&#039;&lt;br /&gt;
* _tableau_tot() - &#039;&#039;Méthode de dessin du tableau des totaux&#039;&#039;&lt;br /&gt;
* _tableau_versement() - &#039;&#039;Méthode de dessin du tableau des règles de versement&#039;&#039;&lt;br /&gt;
* _pagefoot() - &#039;&#039;Méthode de dessin du pied de page&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Example de personnalisation ==     &lt;br /&gt;
=== Insertion d&#039;un logo ===&lt;br /&gt;
* Ajouter l&#039;instruction:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$pdf-&amp;gt;Image(&#039;\www\htdocs\dolibarr\document\societe\logo.jpg&#039;, 10, 5, 60.00);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Avec dans l&#039;exemple: 10=abscisse, 5=ordonnée, 60=largeur logo&lt;br /&gt;
* Si le logo se trouve par dessous ou dessus du text existant, supprimer le texte existant en commentant le code qui affiche l&#039;information ou en modifiant sa position.&lt;br /&gt;
&lt;br /&gt;
=== Insertion d&#039;une signature ou autre en bas de page facture ===&lt;br /&gt;
* ouvrir le modèle à modifier crabe ou oursin (dans htdocs/core/modules/facture/)&lt;br /&gt;
* insérer (pour ma part ligne 618 juste avant // Show payment mode CHQ)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$pdf-&amp;gt;Image(&#039;http://localhost/dolibarr/doc/images/signature.jpg&#039;,120,250,74);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
l&#039;image (largeur 74mm) est affichée colonne de droite juste avant le pied de page.&lt;br /&gt;
* copier l&#039;image dans le répertoire. il semble qu&#039;une image png avec transparence pose problème.&lt;br /&gt;
* générer le pdf, la signature apparaît.&lt;br /&gt;
&lt;br /&gt;
=== Insertion de texte ===&lt;br /&gt;
Principales fonctions utilisées&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$pdf-&amp;gt;setX(float a); // fixe la position x courante&lt;br /&gt;
$pdf-&amp;gt;setY(float b); // fixe la position y courante&lt;br /&gt;
$pdf-&amp;gt;setXY(float a,float b); // fixe les positions x et y courantes&lt;br /&gt;
$pdf-&amp;gt;SetTextColor(0,0,200); // fixe la couleur du texte&lt;br /&gt;
$pdf-&amp;gt;SetFont(&#039;Arial&#039;,&#039;B&#039;,14); // fixe la police, le type ( &#039;B&#039; pour gras, &#039;I&#039; pour italique, &#039;&#039; pour normal,...)&lt;br /&gt;
$pdf-&amp;gt;MultiCell(60, 8, &#039;Mon texte&amp;quot;, 0, &#039;L&#039;); // imprime &#039;Mon texte&#039; avec saut de ligne&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Rappel: l&#039;origine des fonctions setXY est le coin supérieur gauche de la page&lt;br /&gt;
&lt;br /&gt;
== Pour plus d&#039;infos ==&lt;br /&gt;
&lt;br /&gt;
* http://www.fpdf.org/?lang=fr&lt;br /&gt;
* Liste des méthodes: tcpdf.org/doc/code/classTCPDF.html&lt;br /&gt;
* Modèle facture poid [http://www.dolistore.com/lang-fr/crm-gestion-relation-client/208-Facture-avec-poids.html]. Module proposant un modéle de facture crabe avec une colonne poids en plus&lt;br /&gt;
&lt;br /&gt;
= Activer son modèle dans Dolibarr =&lt;br /&gt;
Dans la fonction d&#039;initialisation du module ajoutez votre modèle:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
sql=array(&amp;quot;INSERT INTO &amp;quot;.MAIN_DB_PREFIX.&amp;quot;document_model (nom, type, entity) VALUES(&amp;quot;.$MODELNAME.&amp;quot;,&amp;quot;.$MODEL_TARGET_MODULE.&amp;quot;,&amp;quot;.$conf-&amp;gt;entity.&amp;quot; )&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
avant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt; return $this-&amp;gt;_init($sql,$option);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Puis&lt;br /&gt;
&lt;br /&gt;
Dans Accueil =&amp;gt; Configuration =&amp;gt; Modules =&amp;gt;&lt;br /&gt;
* activer votre module qui doit apparaitre&lt;br /&gt;
* éventuellement le mettre en modèle proposé par défaut.&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Cr%C3%A9er_un_mod%C3%A8le_de_document_PDF&amp;diff=38515</id>
		<title>Créer un modèle de document PDF</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Cr%C3%A9er_un_mod%C3%A8le_de_document_PDF&amp;diff=38515"/>
		<updated>2018-05-06T09:49:32Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: /* Activer son modèle dans Dolibarr */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TemplateDocDev}}&lt;br /&gt;
Ce document décrit comment créer son propre modèle de génération de document PDF afin de personnaliser ses documents (propales, factures, etc...)&lt;br /&gt;
Il se base sur les propositions commerciales comme exemple mais s&#039;applique à tout type de document.&lt;br /&gt;
&lt;br /&gt;
Pour savoir comment générer un modèle de document ODT, voir la page [[Créer un modèle de document ODT]].&lt;br /&gt;
Créer un modèle PDF requiert des connaissances en programmation PHP mais pas la création de modèles ODT. &lt;br /&gt;
&lt;br /&gt;
= Prérequis =&lt;br /&gt;
* Dolibarr: 3.0+&lt;br /&gt;
* Connaissance en PHP&lt;br /&gt;
&lt;br /&gt;
= Trouver le modèle existant le plus proche =&lt;br /&gt;
Dans Dolibarr, tester les modèles existants en allant dans la configuration du module puis en consultant l&#039;aperçu en cliquant le picto &amp;quot;Aperçu&amp;quot; en fin de ligne du modèle. Consulter chacun des modèles disponibles.&lt;br /&gt;
&lt;br /&gt;
Parmi ceux existant, noter le modèle le plus proche de vos besoins. Dans cet exemple, c&#039;est le modèle azur (correspondant au fichier pdf_propale_azur.modules.php).&lt;br /&gt;
&lt;br /&gt;
Pour info, tous les modèles sont dans &#039;&#039;&#039;htdocs/core/modules&#039;&#039;&#039; puis le sous-répertoire propale pour les propositions commerciales, facture pour les factures, commandes pour les commandes, etc...&lt;br /&gt;
&lt;br /&gt;
= Créer le nouveau modèle =&lt;br /&gt;
Par sécurité, on conservera les modèles d&#039;origine. Pour l&#039;exemple, on part du principe qu&#039;on crée un nouveau module de proposition commerciale qu&#039;on nommera &#039;masocietebleu&#039; et qui s&#039;inspire du module &#039;azur&#039;:&lt;br /&gt;
* Copier-coller pdf_propale_azur.modules.php&lt;br /&gt;
* Renommer la copie en pdf_propale_masocietebleu.modules.php&lt;br /&gt;
* L&#039;éditer et faire les modifs suivantes dans le code:&lt;br /&gt;
# Renommer &#039;Class pdf_propale_azur { &#039;    en &#039;Class pdf_propale_masocietebleu { &#039;&lt;br /&gt;
# Renommer &#039;Function pdf_propale_azur($db=0)&#039; en &#039;Function pdf_propale_masocietebleu($db=0)&#039;&lt;br /&gt;
# Renommer la variable $this-&amp;gt;name pour refléter le nouveau nom. Par exemple pour le modèle &#039;azur&#039;, changer la ligne &#039;$this-&amp;gt;name = &amp;quot;azur&amp;quot;;&#039; en &#039;$this-&amp;gt;name = &amp;quot;masocietebleu&amp;quot;;&#039;.&lt;br /&gt;
# Sauvegarder : le modèle &#039;masocietebleu&#039; est disponible dans la liste des modèles de propales de Dolibarr&lt;br /&gt;
* Tester ce modèle (Voir chapitre précédent) avant d&#039;aller plus loin...&lt;br /&gt;
* Ajouter dans la table llx_document_model le nouveau modéle que vous venez de créer&lt;br /&gt;
&lt;br /&gt;
= Personnaliser votre nouveau modèle =&lt;br /&gt;
Personnaliser le modèle créé.&lt;br /&gt;
Toujours dans pdf_propale_masocietebleu.modules.php, chercher la fonction &#039;Function _pagehead(&amp;amp;$pdf, $fac)&#039;. C&#039;est elle qui gère l&#039;affichage de l&#039;entête.  &lt;br /&gt;
&lt;br /&gt;
== Librairie de manipulation de PDF ==&lt;br /&gt;
La librairie utilisée pour la création de documents en PDF se nomme TCPDF et peut être trouvée dans htdocs/includes/tcpdf/tcpdf.class.php. C&#039;est également dans cette classe que l&#039;on trouve les nombreuses méthodes utilisées pour générer les différents éléments des documents.&lt;br /&gt;
&lt;br /&gt;
Les modèles eux-même instancient la classe FPDF et utilisent ensuite ses méthodes, combinées avec les données d&#039;une facture, d&#039;une commande ou d&#039;autres types de données.&lt;br /&gt;
&lt;br /&gt;
On retrouve généralement les appels suivants dans les scripts de création de documents:&lt;br /&gt;
* $pdf-&amp;gt;SetFont() - &#039;&#039;Désigne la fonte à utiliser pour le texte qui suivra&#039;&#039;&lt;br /&gt;
* $pdf-&amp;gt;SetXY() - &#039;&#039;Désigne le point de départ pour dessiner le prochain texte en coordonnées X,Y qui sont exprimées en millimètres de la page&#039;&#039;&lt;br /&gt;
* $pdf-&amp;gt;MultiCell() - &#039;&#039;Dessine une boîte pouvant contenir du texte, et dont on doit d&#039;abord donner la largeur et la hauteur - très utilisée&#039;&#039;&lt;br /&gt;
* $pdf-&amp;gt;GetY() - &#039;&#039;Renvoie la position courante en Y&#039;&#039;&lt;br /&gt;
* $pdf-&amp;gt;SetDrawColor() - &#039;&#039;Désigne la couleur à utiliser pour le prochain texte à écrire - généralement noir (0,0,0) ou blanc (255,255,255)&#039;&#039;&lt;br /&gt;
* $pdf-&amp;gt;Rect() - &#039;&#039;Dessine un rectangle dont le coin supérieur gauche est au point indiqué par les deux premiers paramètres et le coin inférieur droit utilise les deux derniers paramètres en mode relatif aux deux premiers&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Structure des scripts ==&lt;br /&gt;
Les scripts de génération des documents PDF, au moment du développement de la version 2.2, disposent des méthodes suivantes (prenant pour exemple le modèle &amp;quot;crabe&amp;quot;) au sein de la classe du nom du modèle:&lt;br /&gt;
* pdf_crabe() - &#039;&#039;Constructeur de l&#039;objet pdf&#039;&#039;&lt;br /&gt;
* write_pdf_file() - &#039;&#039;Méthode générale pour la génération du fichier. Cette méthode appelle toute les suivantes après avoir initialisé quelques variables&#039;&#039;&lt;br /&gt;
* _pagehead() - &#039;&#039;Méthode de dessin de l&#039;en-tête du document, incluant généralement le logo, le titre du document (et la date) ainsi que les cadres de l&#039;émetteur et du destinataire du document&#039;&#039;&lt;br /&gt;
* _tableau() - &#039;&#039;Méthode de dessin du tableau de détails (produits, services, etc)&#039;&#039;&lt;br /&gt;
* _tableau_info() - &#039;&#039;Méthode de dessin du tableau reprenant une liste d&#039;informations sur la facture&#039;&#039;&lt;br /&gt;
* _tableau_tot() - &#039;&#039;Méthode de dessin du tableau des totaux&#039;&#039;&lt;br /&gt;
* _tableau_versement() - &#039;&#039;Méthode de dessin du tableau des règles de versement&#039;&#039;&lt;br /&gt;
* _pagefoot() - &#039;&#039;Méthode de dessin du pied de page&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Example de personnalisation ==     &lt;br /&gt;
=== Insertion d&#039;un logo ===&lt;br /&gt;
* Ajouter l&#039;instruction:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$pdf-&amp;gt;Image(&#039;\www\htdocs\dolibarr\document\societe\logo.jpg&#039;, 10, 5, 60.00);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Avec dans l&#039;exemple: 10=abscisse, 5=ordonnée, 60=largeur logo&lt;br /&gt;
* Si le logo se trouve par dessous ou dessus du text existant, supprimer le texte existant en commentant le code qui affiche l&#039;information ou en modifiant sa position.&lt;br /&gt;
&lt;br /&gt;
=== Insertion d&#039;une signature ou autre en bas de page facture ===&lt;br /&gt;
* ouvrir le modèle à modifier crabe ou oursin (dans htdocs/core/modules/facture/)&lt;br /&gt;
* insérer (pour ma part ligne 618 juste avant // Show payment mode CHQ)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$pdf-&amp;gt;Image(&#039;http://localhost/dolibarr/doc/images/signature.jpg&#039;,120,250,74);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
l&#039;image (largeur 74mm) est affichée colonne de droite juste avant le pied de page.&lt;br /&gt;
* copier l&#039;image dans le répertoire. il semble qu&#039;une image png avec transparence pose problème.&lt;br /&gt;
* générer le pdf, la signature apparaît.&lt;br /&gt;
&lt;br /&gt;
=== Insertion de texte ===&lt;br /&gt;
Principales fonctions utilisées&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$pdf-&amp;gt;setX(float a); // fixe la position x courante&lt;br /&gt;
$pdf-&amp;gt;setY(float b); // fixe la position y courante&lt;br /&gt;
$pdf-&amp;gt;setXY(float a,float b); // fixe les positions x et y courantes&lt;br /&gt;
$pdf-&amp;gt;SetTextColor(0,0,200); // fixe la couleur du texte&lt;br /&gt;
$pdf-&amp;gt;SetFont(&#039;Arial&#039;,&#039;B&#039;,14); // fixe la police, le type ( &#039;B&#039; pour gras, &#039;I&#039; pour italique, &#039;&#039; pour normal,...)&lt;br /&gt;
$pdf-&amp;gt;MultiCell(60, 8, &#039;Mon texte&amp;quot;, 0, &#039;L&#039;); // imprime &#039;Mon texte&#039; avec saut de ligne&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Rappel: l&#039;origine des fonctions setXY est le coin supérieur gauche de la page&lt;br /&gt;
&lt;br /&gt;
== Pour plus d&#039;infos ==&lt;br /&gt;
&lt;br /&gt;
* http://www.fpdf.org/?lang=fr&lt;br /&gt;
* Liste des méthodes: tcpdf.org/doc/code/classTCPDF.html&lt;br /&gt;
* Modèle facture poid [http://www.dolistore.com/lang-fr/crm-gestion-relation-client/208-Facture-avec-poids.html]. Module proposant un modéle de facture crabe avec une colonne poids en plus&lt;br /&gt;
&lt;br /&gt;
= Activer son modèle dans Dolibarr =&lt;br /&gt;
Dans la fonction d&#039;initialisation du module ajoutez votre modèle:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
sql=array(&amp;quot;INSERT INTO &amp;quot;.MAIN_DB_PREFIX.&amp;quot;document_model (nom, type, entity) VALUES(&amp;quot;.$MODELNAME.&amp;quot;,&amp;quot;.$MODEL_TARGET_MODULE.&amp;quot;,&amp;quot;.$conf-&amp;gt;entity.&amp;quot; )&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
avant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; return $this-&amp;gt;_init($sql,$option);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Puis&lt;br /&gt;
&lt;br /&gt;
Dans Accueil =&amp;gt; Configuration =&amp;gt; Modules =&amp;gt;&lt;br /&gt;
* activer votre module qui doit apparaitre&lt;br /&gt;
* éventuellement le mettre en modèle proposé par défaut.&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_development&amp;diff=38322</id>
		<title>Module development</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_development&amp;diff=38322"/>
		<updated>2018-02-12T12:24:02Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: /* Create your .sql file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Core]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
&lt;br /&gt;
To create a new module/addon for Dolibarr, there is several steps. This tutorial will describe you each of them to build a module to extend Dolibarr features, like one or several of the following :&lt;br /&gt;
* Add new tables in database&lt;br /&gt;
* Add your own menu entries&lt;br /&gt;
* Add new screens to edit new tables&lt;br /&gt;
* Add or remove tabs on object view (invoice, product, order, event, ...)&lt;br /&gt;
* Add predefined exports for the internal export tool&lt;br /&gt;
* Add new information boxes in the home page&lt;br /&gt;
* Add new substitutions variables&lt;br /&gt;
* Define new permissions&lt;br /&gt;
* Execute code automatically triggered by a particular Dolibarr action&lt;br /&gt;
* Insert your code inside Dolibarr hooks positions&lt;br /&gt;
* Add your numbering module&lt;br /&gt;
* Add a new document template&lt;br /&gt;
* Add a new skin&lt;br /&gt;
etc...&lt;br /&gt;
All those operations are possible with version 3.2 or more of Dolibarr.&lt;br /&gt;
&lt;br /&gt;
Following chapters presents how to do all of this manually with an easy way. For experienced developers, a method to do this using MDA generation is also on the work. See last chapter for this.&lt;br /&gt;
&lt;br /&gt;
=Example of Template External Module=&lt;br /&gt;
A good model to start development of external module can be found here : [https://github.com/Dolibarr/dolibarr/tree/develop/htdocs/modulebuilder/template GitHub Dolibarr Module Modèle]&lt;br /&gt;
&lt;br /&gt;
=Create your module =&lt;br /&gt;
== Create a Module descriptor for your Module (required) ==&lt;br /&gt;
&#039;&#039;&#039;When it is required&#039;&#039;&#039;: Required as soon as an addon is developed, whatever its goal is (except for adding a skin).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Since Dolibarr 6.0, you should use the ModuleBuilder module provided as standard module&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Create your module descriptor ===&lt;br /&gt;
The first step is to create a file descriptor for the module. &lt;br /&gt;
* Create directory &#039;&#039;&#039;/htdocs/&#039;&#039;mymodule&#039;&#039;/core/modules&#039;&#039;&#039;. Then copy the file modMyModule.class.php from the directory dev/skeletons into this directory &#039;&#039;&#039;htdocs/&#039;&#039;mymodule&#039;&#039;/core/modules&#039;&#039;&#039;. Change the name of the file modMyModule.class.php to the name corresponding to the purpose of your module. Name of the file must start with initial &#039;mod&#039; and end with .class.php (for example if you want to give the name &#039;NewName&#039; to this file, then the name should be &#039;modNewName.class.php&#039;).&lt;br /&gt;
Next modify the contents of this file as follows:&lt;br /&gt;
* Replace all &amp;quot;modMyModule&amp;quot; with a value which corresponds to the purpose of your module. This value must always start with &#039;mod&#039; and contain only alpha characters (again, if the name given to the file was &#039;NewName&#039;, then replace all &amp;quot;modMyModule&amp;quot; with &amp;quot;modNewName&amp;quot;).&lt;br /&gt;
* Change the number in: $this-&amp;gt;numero = 100000 by a number that designates your module id. To avoid conflicts with other modules, you can consult the page that lists already reserved id numbers: [[List of modules id|List of modules id]].&lt;br /&gt;
* Modify any other variables defined in the constructor (see comment in the code skeleton for their meaning). &lt;br /&gt;
Your file descriptor for your module is ready. See next step to activate it.&lt;br /&gt;
&lt;br /&gt;
=== Test your descriptor ===&lt;br /&gt;
&lt;br /&gt;
Launch Dolibarr and go to page &#039;&#039;&#039;Setup-&amp;gt;module&#039;&#039;&#039;? &lt;br /&gt;
If you set the property version in the module description you should see a new line with your new module and the possibility to activate it or not. If you set the property version to &amp;quot;develop&amp;quot; or &amp;quot;experiental&amp;quot;, to see your module, you must first go into &#039;&#039;&#039;Setup-Others&#039;&#039;&#039; and set MAIN_FEATURES_LEVEL to 1 to see &amp;quot;experimental&amp;quot; modules or 2 to see &amp;quot;development&amp;quot; modules.&lt;br /&gt;
&lt;br /&gt;
== Tree of path for new module files (required) ==&lt;br /&gt;
This is how your files must be organized when building a new module (the zip file must also match this rule).&lt;br /&gt;
Note: Only second line is mandatory.&lt;br /&gt;
&lt;br /&gt;
{{TemplateModuleTreeSimple}}&lt;br /&gt;
&lt;br /&gt;
== Create your SQL tables and the PHP DAO class (optional) ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: If your module needs to manage data of its own&lt;br /&gt;
&lt;br /&gt;
=== Create your .sql file ===&lt;br /&gt;
If your module is designed to manage data of its own, which are not available in the standard version of Dolibarr, it is necessary to define SQL tables to store the data.&lt;br /&gt;
&lt;br /&gt;
Scripts for creating tables and load data for your own module must be placed in a directory: Create a subdirectory called &amp;quot;sql&amp;quot; into directory of your module (eg htdocs/mymodule/sql) to put the sql scripts that you will create. &lt;br /&gt;
&lt;br /&gt;
Then check into your descriptor file, into function &#039;&#039;&#039;init&#039;&#039;&#039; that the line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;_load_tables(&#039;/mymodule/sql/&#039;);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is not commented.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Rules to follow:&#039;&#039;&lt;br /&gt;
* Add the files about creating tables commands on the principle of a file &#039;&#039;&#039;llx_matable.sql&#039;&#039;&#039; per table, with a possibly file &#039;&#039;&#039;llx_matable.key.sql&#039;&#039;&#039; (see existing files in &#039;&#039;&#039;install/mysql/tables&#039;&#039;&#039; for examples).&lt;br /&gt;
&lt;br /&gt;
* To manage data, you must create a file called &#039;&#039;&#039;data.sql&#039;&#039;&#039; inside directory &#039;&#039;&#039;/mymodule/sql/&#039;&#039;&#039; that contains SQL command to add/edit/delete data.&lt;br /&gt;
* Don&#039;t use the double quote for strings (eg &#039;chaine&#039; not &amp;quot;chaine&amp;quot;) because the double quote have a specific meaning in PostGreSQL&lt;br /&gt;
Example of content of a file data.sql&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
 delete from llx_const where name=&#039;MYMODULE_IT_WORKS&#039; and entity=&#039;__ENTITY__&#039;;&lt;br /&gt;
 insert into llx_const (name, value, type, note, visible, entity) values (&#039;MYMODULE_IT_WORKS&#039;,&#039;1&#039;,&#039;chaine&#039;,&#039;A constant vor my module&#039;,1,&#039;__ENTITY__&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Files must be operational for the database mysql. Rem: The files of other databases are not maintained. They will be read and converted on the fly by the driver of the other database.&lt;br /&gt;
&lt;br /&gt;
=== Test your .sql files ===&lt;br /&gt;
&lt;br /&gt;
Once the files ready, you can return to Dolibarr to disable the module, drop those tables in database and reactivate the module. The tables should be recreated by the activation of the module. If this is not the case, check your scripts by passing them by hand, or check the Dolibarr logs.&lt;br /&gt;
&lt;br /&gt;
=== Generate the PHP DAO class ===&lt;br /&gt;
Once you have created your tables into the database, move to the dev/skeletons directory and run the script&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;php build_class_from_table.php tablename modulename&amp;lt;/source&amp;gt;&lt;br /&gt;
Note: If the command does not work, try to use php-cli php instead.&lt;br /&gt;
&lt;br /&gt;
This will generate a file &#039;&#039;&#039;out.tablename.class.php&#039;&#039;&#039; that contains the class to manage table tablename. &lt;br /&gt;
In this class, you can find the CRUD methods (Create / Read / Update / Delete) already working to do an insert, a fetch (select), an update, a delete of a row in table.&lt;br /&gt;
Remove just the &amp;quot;out&amp;quot; from the file name and put the file in a subdirectory of &#039;&#039;&#039;htdocs&#039;&#039;&#039; specific to your module (in htdocs/mymodule for example).&lt;br /&gt;
&lt;br /&gt;
A file &#039;&#039;&#039;out.tablename_script.php&#039;&#039;&#039; has been generated and contains a sample code to use the class for each of the 4 CRUD methods.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Since Dolibarr 6.0, the file dev/skeletons/build_class_from_table.php is no more provided. To build a class from a table you should use the ModuleBuilder modules provided as standard module.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== The tab management (optional) ==&lt;br /&gt;
&lt;br /&gt;
=== Add or remove your own tabs on object sheets ===&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: To add a tab on an object (invoices, orders, proposals, member ...)&lt;br /&gt;
&lt;br /&gt;
To do this go into the file descriptor of module previously created and edit the $this-&amp;gt;tabs array:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
	// Array to add new pages in new tabs or remove existing one&lt;br /&gt;
	$this-&amp;gt;tabs = array(&#039;objecttype:+tabname1:Title1:mylangfile@mymodule:$user-&amp;gt;rights-&amp;gt;mymodule-&amp;gt;read:/mymodule/mypagetab1.php?id=__ID__&#039;    // To add a new tab identified by code tabname1&lt;br /&gt;
                            &#039;objecttype:+tabname2:Title2:mylangfile@mymodule:$user-&amp;gt;rights-&amp;gt;mymodule-&amp;gt;read:/mymodule/mypagetab2.php?id=__ID__&#039;,   // To add a new tab identified by code tabname2&lt;br /&gt;
                            &#039;objecttype:-tabname&#039;);                                                     // To remove an existing tab identified by code tabname&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The table should contain a list of strings, each string representing a new tab. &lt;br /&gt;
The format of the string consisting of 5 parts separated by &amp;quot;:&amp;quot;&lt;br /&gt;
* Part 1: The element type (objecttype) where the tab should appear is a value from the following:&lt;br /&gt;
{{TemplateModuleTabs}}&lt;br /&gt;
* Part 2: A code to identify tab to add (start with +) or to remove (start with -)&lt;br /&gt;
* Part 3: The title of the tab. This can be a hard read or better code translation in a file lang.&lt;br /&gt;
* Part 4: The name of the file &amp;quot;*.lang&amp;quot; which contains correspondence between the code translation and language to display. If this name is followed with @mymodule, Dolibarr will search translation file &amp;quot;*.lang&amp;quot; within the module, so htdocs/mymodule/langs/code_CODE/mylangfile.lang, otherwise Dolibarr will look for file htdocs/langs/code_CODE/mylangfile.lang &lt;br /&gt;
* Part 5: A condition to test if tab must be visible. Put 1 to be always visible.&lt;br /&gt;
* Part 6: The url of the page to display when you click on the tab. The __ID__ string will be replaced automatically by the Id of the element concerned.&lt;br /&gt;
&lt;br /&gt;
To feed the contents of the tab with data from the database, see the next chapter.&lt;br /&gt;
&lt;br /&gt;
=== Show tabs navigation into your own pages ===&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: To show all standard tabs of an object (produit, tiers, etc.) on your page.&lt;br /&gt;
&lt;br /&gt;
You must follow these steps :&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Include files you need into your file&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For each object type, there are two files to include with line&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;require_once($url_fichier) ;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is example of files to include (DOL_DOCUMENT_ROOT is often dolibarr/htdocs/) :&lt;br /&gt;
* Object thirdparty (thirdparty) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/societe/class/societe.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/core/lib/company.lib.php&lt;br /&gt;
* Object product (product) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/product/class/product.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/core/lib/product.lib.php&lt;br /&gt;
* Object invoice (invoice) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/compta/facture/class/facture.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/core/lib/invoice.lib.php&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Create and load the object to show into your tab&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create instance of object of the correct class and load object from database by using the fetch method of object en providing to this method the id you get from url (ie : /mytab.php?id=1).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example :&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$id=GETPOST(&#039;id&#039;,&#039;int&#039;);&lt;br /&gt;
$ref=GETPOST(&#039;ref&#039;,&#039;alpha&#039;);&lt;br /&gt;
$product = new Product($db) ;&lt;br /&gt;
$result = $product-&amp;gt;fetch($id,$ref) ; // Test $result to check the database read is ok&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Get list of all tabs to show for your object type&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use fonction XXX_prepare_head($obj), where XXX is name of object. This will return an array with all definition of tab entries to show. Parameter to put into this method is the instance of object you want tabs.&lt;br /&gt;
&lt;br /&gt;
The resulting array has the following structure&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$head        // Array of tabs&lt;br /&gt;
$head[$h]    // Element to describe one tab.&lt;br /&gt;
$head[$h][0] // Url of page to show when you click on tab&lt;br /&gt;
$head[$h][1] // Title of tab&lt;br /&gt;
$head[$h][2] // Code name to identify the tab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example :&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$head = product_prepare_head($product, $user) ; // parameter $user is present for some function anly&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. show tabs into your page&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use function dol_fiche_head() to show all tabs defined into array $head returned by XX_prepare_head().&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
dol_fiche_head($links, $active=&#039;0&#039;, $title=&#039;&#039;, $notab=0, $picto=&#039;&#039;)&lt;br /&gt;
//$links  // Tableau des onglets, appelé $head plus haut.&lt;br /&gt;
//$active // Onglet actif (mettre le nom de l&#039;onglet défini dans votre fichier de module, ou un nom contenu dans $head[$h][2]). Cet onglet sera mis en surbrillance&lt;br /&gt;
//$title  // Title to show (shown into a special tab that you can&#039;t click)&lt;br /&gt;
//$notab&lt;br /&gt;
//$picto  // Name of image to show into title. Possible values are:&lt;br /&gt;
//            product&lt;br /&gt;
//            service&lt;br /&gt;
//            company&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function will show required tabs and open an html element &#039;&#039;&amp;lt; div class=&amp;quot;&amp;quot; &amp;gt;&#039;&#039; that correspond to the area under the tabs. To close area of a tab, just use &#039;&#039;&amp;lt; /div &amp;gt;&#039;&#039; into your PHP page.&lt;br /&gt;
&lt;br /&gt;
== Create or modify PHP screens (optional) ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: If the purpose of your module is to add features that require new or modified screens.&lt;br /&gt;
&lt;br /&gt;
=== Create a new PHP screen ===&lt;br /&gt;
You must then create your PHP pages that will show/edit data from tables using the skeleton templates provided as an example in the directory &#039;&#039;&#039;modulebuilder/myobject_page.php&#039;&#039;&#039; (For the development of a script from the command line, see [[Script development]]).&lt;br /&gt;
&lt;br /&gt;
To create a new user screen, create a subdirectory of &#039;&#039;&#039;htdocs&#039;&#039;&#039; (if not already done) for your module (in &#039;&#039;&#039;htdocs/mymodule&#039;&#039;&#039; for example) to store the pages you will create.&lt;br /&gt;
&lt;br /&gt;
Copy, into that directory, the file &#039;&#039;&#039;myobject_page.phpp&#039;&#039;&#039; that will serve as a starting point for your page file.&lt;br /&gt;
Edit the file to have a correct relative path to the main.inc.php file. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Load Dolibarr environment&lt;br /&gt;
$res=0;&lt;br /&gt;
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)&lt;br /&gt;
if (! $res &amp;amp;&amp;amp; ! empty($_SERVER[&amp;quot;CONTEXT_DOCUMENT_ROOT&amp;quot;])) $res=@include($_SERVER[&amp;quot;CONTEXT_DOCUMENT_ROOT&amp;quot;].&amp;quot;/main.inc.php&amp;quot;);&lt;br /&gt;
// Try main.inc.php into web root detected using web root caluclated from SCRIPT_FILENAME&lt;br /&gt;
$tmp=empty($_SERVER[&#039;SCRIPT_FILENAME&#039;])?&#039;&#039;:$_SERVER[&#039;SCRIPT_FILENAME&#039;];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1;&lt;br /&gt;
while($i &amp;gt; 0 &amp;amp;&amp;amp; $j &amp;gt; 0 &amp;amp;&amp;amp; isset($tmp[$i]) &amp;amp;&amp;amp; isset($tmp2[$j]) &amp;amp;&amp;amp; $tmp[$i]==$tmp2[$j]) { $i--; $j--; }&lt;br /&gt;
if (! $res &amp;amp;&amp;amp; $i &amp;gt; 0 &amp;amp;&amp;amp; file_exists(substr($tmp, 0, ($i+1)).&amp;quot;/main.inc.php&amp;quot;)) $res=@include(substr($tmp, 0, ($i+1)).&amp;quot;/main.inc.php&amp;quot;);&lt;br /&gt;
if (! $res &amp;amp;&amp;amp; $i &amp;gt; 0 &amp;amp;&amp;amp; file_exists(dirname(substr($tmp, 0, ($i+1))).&amp;quot;/main.inc.php&amp;quot;)) $res=@include(dirname(substr($tmp, 0, ($i+1))).&amp;quot;/main.inc.php&amp;quot;);&lt;br /&gt;
// Try main.inc.php using relative path&lt;br /&gt;
if (! $res &amp;amp;&amp;amp; file_exists(&amp;quot;../main.inc.php&amp;quot;)) $res=@include(&amp;quot;../main.inc.php&amp;quot;);&lt;br /&gt;
if (! $res &amp;amp;&amp;amp; file_exists(&amp;quot;../../main.inc.php&amp;quot;)) $res=@include(&amp;quot;../../main.inc.php&amp;quot;);&lt;br /&gt;
if (! $res &amp;amp;&amp;amp; file_exists(&amp;quot;../../../main.inc.php&amp;quot;)) $res=@include(&amp;quot;../../../main.inc.php&amp;quot;);&lt;br /&gt;
if (! $res) die(&amp;quot;Include of main fails&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note that you may add more &amp;quot;../&amp;quot; depending on the depth of the file relative to your module directory tree.&lt;br /&gt;
The modules developed for all version of Dolibarr after the 3.2 should be able to be moved in a different folder than &amp;quot;htdocs&amp;quot;, like &amp;quot;htdocs/custom&amp;quot;, without having to modify the source code of the module, that&#039;s why we make several includes, so this rule must be applied by all modules.&lt;br /&gt;
&lt;br /&gt;
It&#039;s in the main.inc.php file that is loaded technical environment variables and permissions. The following variables are objects positioned in this file:&lt;br /&gt;
&lt;br /&gt;
* $user    Objet that contains the characteristics of the user + his permissions.&lt;br /&gt;
* $conf    Objet that contains Dolibarr configuration.&lt;br /&gt;
* $db      Objet that contains an opened connection handler to the database.&lt;br /&gt;
* $langs   Objet that contains the user&#039;s language.&lt;br /&gt;
&lt;br /&gt;
Then enter your code to display the page.&lt;br /&gt;
&lt;br /&gt;
* To include a class or library dedicated to the module is done using a Dolibarr function (and not using directly include_once):&lt;br /&gt;
&#039;&#039;Example :&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
dol_include_once(&#039;/mymodule/class/myclass.class.php&#039;, &#039;MyClass&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To include classes provided with Dolibarr, use the following syntax:&lt;br /&gt;
&#039;&#039;Example :&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
require_once DOL_DOCUMENT_ROOT.&#039;/core/class/doli.class.php&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add some fields into existing forms ===&lt;br /&gt;
You may want to provide a module that add more fields into forms (input and view) of some elements. &lt;br /&gt;
&lt;br /&gt;
A heavy solution (but not so bad) may be to replace all pages used to create element (this means disable the &amp;quot;New element&amp;quot; menu entry and adding yours, and disable tab that show element to replace with a tab that is your own full page (copied/pasted from original) to do same than original page but modified to add your fields and stored added data into your own table). Go to menu [[#Define your entries in menu (optional)]] and [[#The tab management (optional)]] if this solution suits you (this solution is more powerfull since you can change everything you want into page). &lt;br /&gt;
&lt;br /&gt;
We will describe here another solution, that works only to &amp;quot;add fields&amp;quot; at end of existing fields, using the element &amp;quot;category&amp;quot; as an example but you can convert this tutorial for invoice, proposal ...&lt;br /&gt;
* First thing is to add a table, owned by your module, to store value of new fields. This table will have only one column called &amp;quot;rowid&amp;quot; (will contains same value than field rowid of element table) + one column for each new field you want to add. Then create a class with CRUD (Create/Read/Update/Delete) methods for this new table. For this two tasks, go back to previous chapter [[#Create your SQL tables and the PHP DAO class]].&lt;br /&gt;
* Next step is to add a hook into your module to add the new fields into the form. See chapter [[Hooks_system#Implement_the_Hook]] for generic documentation to use hooks.&lt;br /&gt;
If you follow this tutorial, to be able to add fields into category forms, you must do:&lt;br /&gt;
{{ToComplete}}&lt;br /&gt;
&lt;br /&gt;
=== Replace parts of screen that are templated (version 3.3+) ===&lt;br /&gt;
Some parts of Dolibarr screen are isolated into native PHP template files.&lt;br /&gt;
You can develop a module to overwrite such templates with yours.&lt;br /&gt;
{{ToComplete}}&lt;br /&gt;
&lt;br /&gt;
=== Add/replace part of fields supported by hooks ===&lt;br /&gt;
See chapter [[Hooks_system#Implement_the_Hook]] to know how to use Dolibarr existing hooks to add/replace code at Dolibarr hooks place.&lt;br /&gt;
&lt;br /&gt;
=== Database access ===&lt;br /&gt;
If you need to edit some data in database inside you own table, use the PHP class generated before.&lt;br /&gt;
&lt;br /&gt;
If you to make access to tables with no dedicated PHP class available, this is always possible (for example if you want to get a list of records with a particular join or filter). In this case, this is a code samples to follow:&lt;br /&gt;
&lt;br /&gt;
To make an insert, update or delete:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$db-&amp;gt;begin();   // Start transaction&lt;br /&gt;
$db-&amp;gt;query(&amp;quot;My SQL request insert, update or delete&amp;quot;);&lt;br /&gt;
$db-&amp;gt;commit();       // Validate transaction&lt;br /&gt;
or $db-&amp;gt;rollback()  // Cancel transaction&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To read:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$resql=$db-&amp;gt;query(&amp;quot;My select request&amp;quot;);&lt;br /&gt;
if ($resql)&lt;br /&gt;
{&lt;br /&gt;
	$num = $db-&amp;gt;num_rows($resql);&lt;br /&gt;
	$i = 0;&lt;br /&gt;
	if ($num)&lt;br /&gt;
	{&lt;br /&gt;
		while ($i &amp;lt; $num)&lt;br /&gt;
		{&lt;br /&gt;
			$obj = $db-&amp;gt;fetch_object($resql);&lt;br /&gt;
			if ($obj)&lt;br /&gt;
			{&lt;br /&gt;
				// You can use here results&lt;br /&gt;
				print $obj-&amp;gt;field1;&lt;br /&gt;
				print $obj-&amp;gt;field2;&lt;br /&gt;
			}&lt;br /&gt;
			$i++;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Define style of your pages ===&lt;br /&gt;
To have the look of your own pages to match the Dolibarr theme, it is necessary to use the Dolibarr CSS styles.&lt;br /&gt;
&lt;br /&gt;
You can use for example:&lt;br /&gt;
&lt;br /&gt;
* class=&amp;quot;&#039;&#039;&#039;liste_titre&#039;&#039;&#039;&amp;quot; on tags &#039;&#039;tr&#039;&#039; and &#039;&#039;td&#039;&#039; for the head row of a table.&lt;br /&gt;
* class=&amp;quot;&#039;&#039;&#039;pair&#039;&#039;&#039;&amp;quot; or class=&amp;quot;&#039;&#039;&#039;impair&#039;&#039;&#039;&amp;quot; on tags &#039;&#039;tr&#039;&#039; and &#039;&#039;td&#039;&#039; of other rows of a table.&lt;br /&gt;
* class=&amp;quot;&#039;&#039;&#039;flat&#039;&#039;&#039;&amp;quot; on all input fields (&#039;&#039;input, select, textarea&#039;&#039;...).&lt;br /&gt;
* class=&amp;quot;&#039;&#039;&#039;button&#039;&#039;&#039;&amp;quot; on HTML fields with type &#039;&#039;input type=&amp;quot;submit&amp;quot;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Use the Dolibarr date picker ===&lt;br /&gt;
If you want to use the Dolibarr date selector (with its calendar popup) into your pages, use the following line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
 $form=new Form($db);&lt;br /&gt;
 $form-&amp;gt;select_date(&#039;&#039;,&#039;mykey&#039;,0,0,0,&amp;quot;myform&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The string mykey will identify the date selector in the form. You must use different values if you use several date selectors in same page.&lt;br /&gt;
The string myform is the name of the FORM in which the selector is included (value found in the form name=&amp;quot;myform&amp;quot; in HTML page).&lt;br /&gt;
This means a date selector must be included necessarily into an html FORM.&lt;br /&gt;
&lt;br /&gt;
To get value after the POST of your form, the command is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$mydate = dol_mktime(12, 0 , 0, $_POST[&#039;mykeymonth&#039;], $_POST[&#039;mykeyday&#039;], $_POST[&#039;mykeyyear&#039;]);&lt;br /&gt;
print strftime(&#039;%A %d %B %Y&#039;, $mydate);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add your own setup page (optional) ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: If your module needs parameters, which are to be provided by the user, for proper setting up of the module.&lt;br /&gt;
&lt;br /&gt;
=== Create your page to edit parameters ===&lt;br /&gt;
If your module needs several parameters to be setup, you must create a page to edit options (these options will be saved in the [[Table llx_const|table &#039;&#039;&#039;llx_const&#039;&#039;&#039;]]).&lt;br /&gt;
Create a page named &#039;&#039;&#039;mymodule_setuppage.php&#039;&#039;&#039; that shows a form for possible options to update them into the above mentioned table.&lt;br /&gt;
It is necessary to take an example from a page of the directory &#039;&#039;&#039;/admin&#039;&#039;&#039; that will show you the way to read/save your parameters.&lt;br /&gt;
Put this PHP page into the directory &#039;&#039;&#039;/admin&#039;&#039;&#039; of your module (e.g. mymodule/admin/mymodule_setuppage.php).&lt;br /&gt;
&lt;br /&gt;
=== Modify the descriptor file of your module ===&lt;br /&gt;
Then, within the descriptor file of your module, modify the variable &#039;&#039;&#039;config_page_url&#039;&#039;&#039; to set name of this PHP page.&lt;br /&gt;
If the page is in the directory &#039;&#039;&#039;admin/&#039;&#039;&#039;, then the path is not required, e.g. like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;config_page_url = array(&amp;quot;mymodule_setuppage.php&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If the page is in the directory &#039;&#039;&#039;mymodule/admin/&#039;&#039;&#039;, then like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;config_page_url = array(&amp;quot;mymodule_setuppage.php@mymodule&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Test your page ===&lt;br /&gt;
Go into page &#039;&#039;&#039;Home-&amp;gt;Setup-&amp;gt;Modules&#039;&#039;&#039;, you should see a picture at the end of the line of your module to reach your setup page. Click on it, you should be able to view/edit parameters from your page.&lt;br /&gt;
&lt;br /&gt;
== Define your entries in menu (optional) ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: If you have created PHP pages, it is necessary that those pages can be reached from menu entries in Dolibarr menu.&lt;br /&gt;
&lt;br /&gt;
=== Define your menu entries ===&lt;br /&gt;
For this, you must define into the module descriptor, the array this-&amp;gt;menu that declare all menus added by your module.&lt;br /&gt;
This array contains entries that will appear once your module is activated.&lt;br /&gt;
The example module descriptor file &#039;&#039;&#039;modMyModule.class.php&#039;&#039;&#039; contains an example to declare a top menu and also its left menu entries.&lt;br /&gt;
&lt;br /&gt;
This is the example of code to declare your own menu entries in a module descriptor file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Main menu entries&lt;br /&gt;
$this-&amp;gt;menu = array();			// List of menus to add&lt;br /&gt;
$r=0;&lt;br /&gt;
&lt;br /&gt;
// Add here entries to declare new menus&lt;br /&gt;
// Example to declare the Top Menu entry:&lt;br /&gt;
$this-&amp;gt;menu[$r]=array(	&#039;fk_menu&#039;=&amp;gt;0,			// Put 0 if this is a top menu&lt;br /&gt;
			&#039;type&#039;=&amp;gt;&#039;top&#039;,			// This is a Top menu entry&lt;br /&gt;
			&#039;titre&#039;=&amp;gt;&#039;MyModule top menu&#039;,&lt;br /&gt;
			&#039;mainmenu&#039;=&amp;gt;&#039;mymodule&#039;,&lt;br /&gt;
			&#039;leftmenu&#039;=&amp;gt;&#039;mymodule&#039;,&lt;br /&gt;
			&#039;url&#039;=&amp;gt;&#039;/mymodule/pagetop.php&#039;,&lt;br /&gt;
			&#039;langs&#039;=&amp;gt;&#039;mylangfile&#039;,	// Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.&lt;br /&gt;
			&#039;position&#039;=&amp;gt;100,&lt;br /&gt;
			&#039;enabled&#039;=&amp;gt;&#039;1&#039;,			// Define condition to show or hide menu entry. Use &#039;$conf-&amp;gt;mymodule-&amp;gt;enabled&#039; if entry must be visible if module is enabled.&lt;br /&gt;
			&#039;perms&#039;=&amp;gt;&#039;1&#039;,			// Use &#039;perms&#039;=&amp;gt;&#039;$user-&amp;gt;rights-&amp;gt;mymodule-&amp;gt;level1-&amp;gt;level2&#039; if you want your menu with a permission rules&lt;br /&gt;
			&#039;target&#039;=&amp;gt;&#039;&#039;,&lt;br /&gt;
			&#039;user&#039;=&amp;gt;2);				// 0=Menu for internal users, 1=external users, 2=both&lt;br /&gt;
$r++;&lt;br /&gt;
&lt;br /&gt;
// Example to declare a Left Menu entry:&lt;br /&gt;
$this-&amp;gt;menu[$r]=array(	&#039;fk_menu&#039;=&amp;gt;&#039;fk_mainmenu=xxx&#039;,		    // Use &#039;fk_mainmenu=xxx&#039; or &#039;fk_mainmenu=xxx,fk_leftmenu=yyy&#039; where xxx is mainmenucode and yyy is a leftmenucode of parent menu&lt;br /&gt;
			&#039;type&#039;=&amp;gt;&#039;left&#039;,			        // This is a Left menu entry&lt;br /&gt;
			&#039;titre&#039;=&amp;gt;&#039;MyModule left menu 1&#039;,&lt;br /&gt;
			&#039;mainmenu&#039;=&amp;gt;&#039;xxx&#039;,&lt;br /&gt;
                        &#039;leftmenu&#039;=&amp;gt;&#039;yyy&#039;,&lt;br /&gt;
			&#039;url&#039;=&amp;gt;&#039;/mymodule/pagelevel1.php&#039;,&lt;br /&gt;
			&#039;langs&#039;=&amp;gt;&#039;mylangfile&#039;,	// Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.&lt;br /&gt;
			&#039;position&#039;=&amp;gt;100,&lt;br /&gt;
			&#039;enabled&#039;=&amp;gt;&#039;1&#039;,			// Define condition to show or hide menu entry. Use &#039;$conf-&amp;gt;mymodule-&amp;gt;enabled&#039; if entry must be visible if module is enabled.&lt;br /&gt;
			&#039;perms&#039;=&amp;gt;&#039;1&#039;,			// Use &#039;perms&#039;=&amp;gt;&#039;$user-&amp;gt;rights-&amp;gt;mymodule-&amp;gt;level1-&amp;gt;level2&#039; if you want your menu with a permission rules&lt;br /&gt;
			&#039;target&#039;=&amp;gt;&#039;&#039;,&lt;br /&gt;
			&#039;user&#039;=&amp;gt;2);				// 0=Menu for internal users,1=external users, 2=both&lt;br /&gt;
$r++;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To show menu or not depending on a permission, modify property &#039;&#039;&#039;perms&#039;&#039;&#039; in array. See chapter on permissions later to see how to add permissions.&lt;br /&gt;
&lt;br /&gt;
=== Test your menu entries ===&lt;br /&gt;
Disable and reenable your module under Dolibarr module setup page, menus entries must appear (if property &#039;enabled&#039; is declaration array is ok).&lt;br /&gt;
&lt;br /&gt;
== Add your own permissions (optional) ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: If you want to add new permissions.&lt;br /&gt;
&lt;br /&gt;
The way to define permissions that will manage your module is done inside the module descriptor created previously.&lt;br /&gt;
Modify line &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;rights_class = &#039;mymodule&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
with correct value for mymodule.&lt;br /&gt;
&lt;br /&gt;
Then you must fill the array $this-&amp;gt;rights with as many entries than different permissions you need to manage.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;rights[$r][0] = 10001;&lt;br /&gt;
$this-&amp;gt;rights[$r][1] = &#039;Label by default of permission&#039;;&lt;br /&gt;
$this-&amp;gt;rights[$r][3] = 1;&lt;br /&gt;
$this-&amp;gt;rights[$r][4] = &#039;action&#039;;&lt;br /&gt;
$this-&amp;gt;rights[$r][5] = &#039;subaction&#039;;&lt;br /&gt;
$r++;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Into $this-&amp;gt;rights[$r][0], put a permission id not already used (See into menu &#039;&#039;&#039;System info&#039;&#039;&#039; on a working installation of Dolibarr to know list of id already used by standard modules.&lt;br /&gt;
Into $this-&amp;gt;rights[$r][3], put 1 if this permission must be granted automatically by default to any new created user.&lt;br /&gt;
Into $this-&amp;gt;rights[$r][1], put a label by default for permission (This label will be used if no translation can be found into the file &#039;&#039;&#039;admin.lang&#039;&#039;&#039;).&lt;br /&gt;
Into $this-&amp;gt;rights[$r][4] and $this-&amp;gt;rights[$r][5], put an action and subaction string without spaces. You will be able to test if a user has the permission in your PHP source code with the sequence:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
if ($user-&amp;gt;rights-&amp;gt;mymodule-&amp;gt;action-&amp;gt;subaction) ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Define you own box (optional) ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: If your module need to provide one or several new boxes to show on home page.&lt;br /&gt;
&lt;br /&gt;
=== Define your box ===&lt;br /&gt;
For this, modify the array $this-&amp;gt;boxes into the module descriptor file.&lt;br /&gt;
All you have to do is to add 2 lines for each box file you will create into directory &#039;&#039;&#039;htdocs/mymodule/core/boxes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;boxes[0][&#039;file&#039;]=&#039;mybox0.php@mymodule&#039;&lt;br /&gt;
$this-&amp;gt;boxes[0][&#039;note&#039;]=&#039;My box 0&#039;&lt;br /&gt;
 ...&lt;br /&gt;
$this-&amp;gt;boxes[n][&#039;file&#039;]=&#039;myboxn.php@mymodule&#039;&lt;br /&gt;
$this-&amp;gt;boxes[n][&#039;note&#039;]=&#039;My box n&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then create files &#039;&#039;&#039;htdocs/mymodule/core/boxes/mybox0.php&#039;&#039;&#039;, &#039;&#039;&#039;htdocs/mymodule/core/boxes/mybox1.php&#039;&#039;&#039;... by copying an example from an existing box file (found into directory &#039;&#039;&#039;htdocs/core/boxes&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
=== Test if your box is detected by Dolibarr ===&lt;br /&gt;
Disable and enabled module.&lt;br /&gt;
&lt;br /&gt;
Go into menu &#039;&#039;&#039;Home - Setup - Boxes&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Your boxes must appear in the list of boxes you can activated. Activate the box and go on home page to see if the box is showing correctly.&lt;br /&gt;
&lt;br /&gt;
== Define your own export (optional) ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: If your module provide new predefined database export profiles (for its own tables or for already existing tables of another module).&lt;br /&gt;
&lt;br /&gt;
=== Define export ===&lt;br /&gt;
For this uncomment and modify arrays $this-&amp;gt;export_xxx in your module descriptor file.&lt;br /&gt;
&lt;br /&gt;
=== Test your export ===&lt;br /&gt;
Go into menu Tools -&amp;gt; Export. Your export will appear in the list of available predefined exports (if your module is enabled).&lt;br /&gt;
Choose it, you must see list of all possible fields defined in the export arrays.&lt;br /&gt;
Choose on field and try to build an export file. If ok, try again with all fields.&lt;br /&gt;
&lt;br /&gt;
== Define your CSS styles (optional) ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: If in your PHP pages, you use class styles that are not defined inside Dolibarr themes CSS (not recommanded).&lt;br /&gt;
&lt;br /&gt;
=== Create and declare your style sheet ===&lt;br /&gt;
Create a style sheet CSS named &#039;&#039;&#039;mymodule.css&#039;&#039;&#039; or &#039;&#039;&#039;mymodule.css.php&#039;&#039;&#039; and put it into directory &#039;&#039;&#039;htdocs/mymodule&#039;&#039;&#039;. You can have only one CSS file per module.&lt;br /&gt;
Remember it&#039;s better to use existing styles already available by default into Dolibarr (The CSS file used by Dolibarr is file &#039;&#039;&#039;themes/mytheme/&#039;&#039;themename&#039;&#039;.css.php&#039;&#039;&#039;. Create your own CSS file only if you need absolutely to add not already existing styles.&lt;br /&gt;
&lt;br /&gt;
Once your style sheet is ready, declare it into your module descriptor file by modifying the property &#039;&#039;&#039;$this-&amp;gt;modules_parts&#039;&#039;&#039;.&lt;br /&gt;
Value to put here must be a relative URL to your CSS file.&lt;br /&gt;
For example&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;module_parts = array(&#039;css&#039; =&amp;gt; array(&#039;/mymodule/css/mymodule.css.php&#039;));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Test your style sheet ===&lt;br /&gt;
Disable and enable your module.&lt;br /&gt;
&lt;br /&gt;
Go on home page (index.php). Show the HTML source of the page.&lt;br /&gt;
&lt;br /&gt;
You should see into the HTML header, a line that declare your style sheet.&lt;br /&gt;
&lt;br /&gt;
== Add your Javascript functions (optional) ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: If in your PHP pages, you use javascript functions not available in Dolibarr (in file lib_head.js)&lt;br /&gt;
&lt;br /&gt;
If you need to use your own javascript functions inside your PHP pages, it is necessary to have your functions, defined into your  javascript file &#039;&#039;&#039;htdocs/mymodule/js/mymodule.js&#039;&#039;&#039;, included into the HTML HEAD section.&lt;br /&gt;
To ask Dolibarr that forge this header to include your own javascript file, you must just provide it to the llxHeader() function called by your page.&lt;br /&gt;
&lt;br /&gt;
Example for page /htdocs/mymodule/mypage.php :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$morejs=array(&amp;quot;/mymodule/js/mymodule.js&amp;quot;);&lt;br /&gt;
llxHeader(&#039;&#039;,&#039;Titre&#039;,&#039;&#039;,&#039;&#039;,&#039;&#039;,&#039;&#039;,$morejs,&#039;&#039;,0,0); &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Run your own code on any Dolibarr event (optional) ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: If you want to execute your own code once a common Dolibarr event has occurred (example: I want to update a table in my module when an invoice is created into Dolibarr), you must create a &#039;&#039;&#039;triggers&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
See also [[Interfaces_Dolibarr_toward_foreign_systems]]&lt;br /&gt;
and [[Interfaces_from_foreign_systems_toward_Dolibarr]]&lt;br /&gt;
&lt;br /&gt;
== Insert your code inside Dolibarr hooks positions (optional) ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: When you want to add code or replace Dolibarr code into another situation than a business event (See previous chapter for adding code during a business event).&lt;br /&gt;
&lt;br /&gt;
See page [[Hooks_system]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Add your own numbering rules ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: When you need a new rule for generated ref of elements that is not covered by existing rules.&lt;br /&gt;
&lt;br /&gt;
See page [[Create numbering module]].&lt;br /&gt;
&lt;br /&gt;
== Add your document template (optional) ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: When you want to personalized your own generated PDF or ODT documents.&lt;br /&gt;
&lt;br /&gt;
Note: To add this feature you don&#039;t need to create a module descriptor.&lt;br /&gt;
&lt;br /&gt;
Documentation to add your own template is available on page [[Create_a_PDF_document_template]] or [[Create_an_ODT_document_template]].&lt;br /&gt;
&lt;br /&gt;
== Add your skin (optional) ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: When you want to personalized your colors/fonts/images.&lt;br /&gt;
&lt;br /&gt;
Note: To add this feature you don&#039;t need to create a module descriptor.&lt;br /&gt;
&lt;br /&gt;
To add your own skin, read page [[Skins]].&lt;br /&gt;
&lt;br /&gt;
=Some coding rules and predefined functions =&lt;br /&gt;
The coding rules to be followed are defined in the [[Developer documentation]], under section &amp;quot;General Information - Language and standards development&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
A lot of predefined features for developers are also available and described into page [[Developer documentation]] under section &amp;quot;Technical components of Dolibarr&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=Using MDA =&lt;br /&gt;
A method to generate a functional module from a UML model has been developed. More information on the page [[UML2Dolibarr - Build a module using MDA]].&lt;br /&gt;
&lt;br /&gt;
=Create a package to distribute and install your module =&lt;br /&gt;
This process must be used to generate a package to submit it on the http://www.dolistore.com market place.&lt;br /&gt;
But you can use it to have a package easy to distribute on your on network.&lt;br /&gt;
&lt;br /&gt;
* Go into the directory &#039;&#039;&#039;/build&#039;&#039;&#039; and copy the file &#039;&#039;&#039;makepack-dolibarrmodules.conf&#039;&#039;&#039; into &#039;&#039;&#039;makepack-mymodule.conf&#039;&#039;&#039;. Warning, this directory may not be provided in some packages of stable versions. If so, it can be retrieved from the snapshot available for download on the Dolibarr website in area &amp;quot;Development version&amp;quot; (taken in this case the whole build directory which is autonomous and independent directory).&lt;br /&gt;
&lt;br /&gt;
Edit this file to add list of file names for all new files you created for your module (module descriptor, new sql tables files, php page, images, etc...)&lt;br /&gt;
&lt;br /&gt;
* Run the script via Perl (need the Perl version 5.0 or later):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
perl makepack-dolibarrmodule.pl&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The script asks you the name of your module, its major and minor version. A file &#039;&#039;&#039;mymodule.zip &#039;&#039;&#039; will then be manufactured containing your module ready to be deployed.&lt;br /&gt;
&lt;br /&gt;
* The person who receives your module must then place the file in the root directory of a Dolibarr installation and perform the command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar -xvf mymodule.zip&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If you want your module to be public, you can submit it (the zip file) on Dolibarr market place web site: {{LinkToPluginDownload}} (you must create an account first and be logged to use the link &amp;quot;Submit a module/product&amp;quot;).&lt;br /&gt;
** If your module was build correctly, file will be validated later.&lt;br /&gt;
** If quality is enough and license permits it, code might be added inside main Dolibarr sources (except if you disagree for that).&lt;br /&gt;
&lt;br /&gt;
= Enabling/activation condition of external module on DoliStore =&lt;br /&gt;
&lt;br /&gt;
See [[Module_Dolistore_Validation_Rules|Validation Rules]]&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=D%C3%A9veloppement_module&amp;diff=38321</id>
		<title>Développement module</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=D%C3%A9veloppement_module&amp;diff=38321"/>
		<updated>2018-02-12T12:20:41Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: /* Créer vos fichiers .sql */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Noyau]]&lt;br /&gt;
{{TemplateDocDev}}&lt;br /&gt;
Pour créer un nouveau module, il existe plusieurs étapes. Ce didacticiel a pour but de vous décrire chacune d&#039;elle afin d&#039;ajouter un module permettant d&#039;étendre les possibilités de Dolibarr, comme par exemple ajouter une ou plusieurs des fonctionnalités suivantes:&lt;br /&gt;
* Ajouter de nouvelles tables en base&lt;br /&gt;
* Ajouter vos propres entrées dans les menus&lt;br /&gt;
* Ajouter des écrans de saisie/consultation de nouvelle tables&lt;br /&gt;
* Ajouter ou supprimer des onglets sur les pages de vues/édition des objets (facture, produit, commande, événement, ...)&lt;br /&gt;
* Ajouter des exports prédéfinis pour la fonction export&lt;br /&gt;
* Ajouter de nouvelles boites pour la home page&lt;br /&gt;
* Ajouter des variables de substitutions&lt;br /&gt;
* Définir de nouvelles permissions&lt;br /&gt;
* Déclencher du code automatiquement sur une action Dolibarr particulière&lt;br /&gt;
* Insérer votre code aux emplacement hooks de Dolibarr&lt;br /&gt;
* Ajouter un module de numérotation&lt;br /&gt;
* Ajouter un modèle de document&lt;br /&gt;
* Ajouter un nouveau thème&lt;br /&gt;
etc...&lt;br /&gt;
Toutes ces opérations ne sont possibles qu&#039;avec la version 3.2 ou plus de Dolibarr.&lt;br /&gt;
&lt;br /&gt;
Les chapitres suivants vous présentent comment réaliser tout cela en manuel de manière simple. Pour les développeurs très expérimentés, une méthode par génération MDA est en cours de mise au point. Voir le dernier chapitre pour cela.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= [[File:Art.png]] Exemple de modèle de module externe=&lt;br /&gt;
&lt;br /&gt;
Un bon modéle/squelette de module externe Dolibarr est disponible ici : [https://github.com/Dolibarr/dolibarr/tree/develop/htdocs/modulebuilder/template GitHub Dolibarr Module Modèle]&lt;br /&gt;
&lt;br /&gt;
= [[File:Art.png]] Créer un module =&lt;br /&gt;
Les sous chapitres suivant décrivent les actions à faire pour créer un module Dolibarr. Les premiers chapitres sont obligatoires quelle que soit la vocation du module, les suivants dépendront de ce que doit faire le module.&lt;br /&gt;
&lt;br /&gt;
== Créer un descripteur de Module (obligatoire) ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Obligatoire dès qu&#039;une extension est développée, quelle que soit sa vocation (sauf pour l&#039;ajout de thème ou de modèle de document).&lt;br /&gt;
&lt;br /&gt;
=== Créer votre descripteur ===&lt;br /&gt;
La première étape est donc de créer un fichier de description du module (descripteur). Pour cela:&lt;br /&gt;
* Créer le répertoire &#039;&#039;&#039;/htdocs/&#039;&#039;monmodule&#039;&#039;/core/modules&#039;&#039;&#039;. Puis, aller dans le répertoire &#039;&#039;&#039;dev/skeletons&#039;&#039;&#039; et recopier le fichier modMyModule.class.php dans ce répertoire &#039;&#039;&#039;htdocs/&#039;&#039;monmodule&#039;&#039;/core/modules&#039;&#039;&#039;.&lt;br /&gt;
* Renommez le fichier mod&#039;&#039;&#039;MyModule&#039;&#039;&#039;.class.php en modifiant seulement la partie &#039;&#039;&#039;MyModule&#039;&#039;&#039; (le fichier doit commencer par mod)&lt;br /&gt;
Ensuite, modifier le contenu de ce fichier afin de remplacer:&lt;br /&gt;
* les &#039;&#039;modMyModule&#039;&#039; en une valeur qui corresponde à la vocation de votre module. Cette valeur doit toujours commencer par &#039;&#039;&#039;&#039;mod&#039;&#039;&#039;&#039; et ne contenir que des &#039;&#039;&#039;caractères alphabétiques&#039;&#039;&#039;.&lt;br /&gt;
* $this-&amp;gt;numero = &#039;&#039;100000&#039;&#039; par un numéro de module libre. Pour éviter tout conflit, vous pouvez consulter la page suivante pour retrouver les numéros déjà alloués: [[List of modules id|Liste des id de modules]].&lt;br /&gt;
* Modifier éventuellement les autres variables définies dans le constructeurs (Voir le commentaire dans le code du squelette pour leur signification).&lt;br /&gt;
&lt;br /&gt;
Le descripteur de votre module est alors en place.&lt;br /&gt;
&lt;br /&gt;
=== Tester votre descripteur ===&lt;br /&gt;
&lt;br /&gt;
Lancer Dolibarr et aller sur la page &#039;&#039;&#039;Configuration-&amp;gt;module&#039;&#039;&#039;, vous devez voir apparaître une nouvelle ligne avec votre nouveau module et la possibilité de l&#039;activer ou non (parcourez tous les onglets de chaque catégories de modules jusqu&#039;à le retrouver).&lt;br /&gt;
C&#039;est la valeur de $this-&amp;gt;special qui détermine dans quel onglet se trouve votre module.&lt;br /&gt;
&lt;br /&gt;
== Arborescence d&#039;un nouveau module ==&lt;br /&gt;
Voici l&#039;arborescence à respecter pour l&#039;organisation des fichiers d&#039;un module.&lt;br /&gt;
&lt;br /&gt;
Rem: Seule la deuxième ligne est obligatoire.&lt;br /&gt;
{{TemplateModuleTreeSimple}}&lt;br /&gt;
&lt;br /&gt;
Un modèle de module a été crée par un contributeur Dolibarr, il est accessible ici : [https://github.com/rdoursenaud/dolibarr-module-template]&lt;br /&gt;
&lt;br /&gt;
== Créer vos tables SQL et les classes PHP DAO (optionnel) ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Si votre module a besoin de gérer des données qui lui sont propres&lt;br /&gt;
&lt;br /&gt;
=== Créer vos fichiers .sql ===&lt;br /&gt;
Si votre module a vocation à gérer des données bien à lui, qui n&#039;existent pas en base dans la version standard de Dolibarr, il est nécessaire de définir des tables SQL pour stocker ces données.&lt;br /&gt;
&lt;br /&gt;
Créer un sous-répertoire &#039;&#039;&#039;sql&#039;&#039;&#039; dans le répertoire de votre module (par exemple &#039;&#039;&#039;htdocs/monmodule/sql&#039;&#039;&#039;) afin d&#039;y placer les scripts sql que vous allez créer.&lt;br /&gt;
&lt;br /&gt;
Ensuite, vérifiez dans votre fichier descripteur de module, dans la fonction &#039;&#039;&#039;init&#039;&#039;&#039; que la ligne&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;_load_tables(&#039;/mymodule/sql/&#039;);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
n&#039;est pas commentée.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Règles à respecter:&#039;&#039;&lt;br /&gt;
* Ajouter les fichiers d&#039;ordre de création de vos tables sur le principe d&#039;un fichier &#039;&#039;&#039;llx_matable.sql&#039;&#039;&#039; par table accompagné éventuellement du fichier &#039;&#039;&#039;llx_matable.key.sql&#039;&#039;&#039; (voir les fichiers existants dans &#039;&#039;&#039;install/mysql/tables&#039;&#039;&#039; pour exemple).&lt;br /&gt;
* Pour ce qui est des commandes pour ajouter/manipuler des données, elles doivent toutes se trouver dans un fichier nommé &#039;&#039;&#039;data.sql&#039;&#039;&#039; situé dans le même répertoire &#039;&#039;&#039;/monmodule/sql/&#039;&#039;&#039;.&lt;br /&gt;
* N&#039;utilisez pas &amp;quot;chaine&amp;quot; mais &#039;chaine&#039; car les guillemets doubles (&amp;quot;) ont une signification particulière en PostGreSQL&lt;br /&gt;
Exemple de contenu de fichier data.sql&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
 delete from llx_const where name=&#039;MONMODULE_IT_WORKS&#039; and entity=&#039;__ENTITY__&#039;;&lt;br /&gt;
 insert into llx_const (name, value, type, note, visible, entity) values (&#039;MONMODULE_IT_WORKS&#039;,&#039;1&#039;,&#039;chaine&#039;,&#039;A constant for my module&#039;,1,&#039;__ENTITY__&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Les ordres SQL des fichiers doivent être opérationnels pour la base de données &#039;&#039;&#039;mysql&#039;&#039;&#039;.&lt;br /&gt;
Rem: Les fichiers des autres bases ne sont pas à maintenir. Ils sont lus et convertit à la volée par le driver de la base de données.&lt;br /&gt;
&lt;br /&gt;
=== Tester vos fichier .sql ===&lt;br /&gt;
&lt;br /&gt;
Une fois les fichiers prêts, vous pouvez retourner sous Dolibarr puis désactiver le module, dropper les tables en base et réactiver le module.&lt;br /&gt;
Les tables doivent alors être recréées par l&#039;activation du module.&lt;br /&gt;
Si tel n&#039;est pas le cas, vérifiez vos scripts en les passant à la main, ou consultez les logs Dolibarr.&lt;br /&gt;
&lt;br /&gt;
=== Générer la classe PHP DAO d&#039;accès aux tables ===&lt;br /&gt;
&lt;br /&gt;
Une fois votre ou vos tables créées en base, aller dans le répertoire &#039;&#039;&#039;dev/skeletons&#039;&#039;&#039;, copiez le fichier &#039;&#039;&#039;build_class_from_table.php&#039;&#039;&#039; dans le répertoire sql/ de votre module, et lancez le script&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;php build_class_from_table.php nomtable&amp;lt;/source&amp;gt;&lt;br /&gt;
Remarque: Si la commande ne fonctionne pas, essayer d&#039;utiliser php-cli plutot que php.&lt;br /&gt;
&lt;br /&gt;
Ceci génèrera un fichier &#039;&#039;&#039;out.nomtable.class.php&#039;&#039;&#039; qui contient la classe de gestion de la table nomtable.&lt;br /&gt;
Dans cette classe, se trouve des méthodes CRUD (Create/Read/Update/Delete) déjà opérationnelles pour faire un insert, un fetch (select), un update, un delete d&#039;une ligne de la table.&lt;br /&gt;
Supprimer juste le &amp;quot;out&amp;quot; du nom de fichier et placer votre fichier dans le sous-répertoire de &#039;&#039;&#039;htdocs&#039;&#039;&#039; propre à votre module (Dans &#039;&#039;&#039;htdocs/monmodule&#039;&#039;&#039; par exemple).&lt;br /&gt;
&lt;br /&gt;
Un fichier &#039;&#039;&#039;out.nomtable_script.php&#039;&#039;&#039; a également été généré et contient un exemple de code pour utiliser la classe pour chacune des 4 méthodes CRUD.&lt;br /&gt;
&lt;br /&gt;
== Affichage des onglets (optionnel) ==&lt;br /&gt;
&lt;br /&gt;
=== Ajouter ou supprimer des onglets sur les fiches objets ===&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039; : Pour ajouter votre propre onglet parmi les onglets standard d&#039;une fiche entité (facture, commande, proposition commercial, adhérent...)&lt;br /&gt;
&lt;br /&gt;
Pour cela, aller dans le fichier descripteur de module précédemment créé et modifier le tableau $this-&amp;gt;tabs:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
	// Array to add new pages in new tabs or remove existing one&lt;br /&gt;
	$this-&amp;gt;tabs = array(&#039;objecttype:+tabname1:Title1:mylangfile@monmodule:$user-&amp;gt;rights-&amp;gt;monmodule-&amp;gt;read:/monmodule/mapagetab1.php?id=__ID__&#039;    // To add a new tab identified by code tabname1&lt;br /&gt;
                            &#039;objecttype:+tabname2:Title2:mylangfile@monmodule:$user-&amp;gt;rights-&amp;gt;monmodule-&amp;gt;read:/monmodule/mapagetab2.php?id=__ID__&#039;,   // To add a new tab identified by code tabname2&lt;br /&gt;
                            &#039;objecttype:-tabname&#039;);                                                     // To remove an existing tab identified by code tabname&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Le tableau doit contenir une liste de chaîne, chaque chaîne représentant un nouvel onglet.&lt;br /&gt;
Le format de la chaîne étant composé de 6 parties séparées par &amp;quot;:&amp;quot;&lt;br /&gt;
* Partie 1: Le type d&#039;élément (objecttype) dans lequel doit apparaître l&#039;onglet qui est une valeur parmi celle-ci:&lt;br /&gt;
{{TemplateModuleTabs-fr}}&lt;br /&gt;
* Partie 2: Nom de code pour l&#039;onglet à ajouter (commence par +) ou à enlever (commence par -)&lt;br /&gt;
* Partie 3: Le titre de l&#039;onglet. Cela peut être un libellé en dur ou mieux un code traduction présent dans un fichier lang.&lt;br /&gt;
* Partie 4: Le nom du fichier .lang (sans l&#039;extension .lang) qui contient la correspondance entre le code traduction et le libellé à afficher. Si ce com est suivi de @monmodule, Dolibarr cherche le fichier dans le répertoire lang propre au module, c&#039;est à dire htdocs/monmodule/langs/code_CODE/monmodule.lang, sinon Dolibarr cherche le fichier traduction dans htdocs/langs/code_CODE/mylangfile.lang&lt;br /&gt;
* Partie 5: Une condition à tester pour savoir si l&#039;onglet doit être visible ou pas. Mettre &#039;1&#039; pour qu&#039;il soit toujours visible.&lt;br /&gt;
* Partie 6: L&#039;url de la page à afficher quand on clique sur l&#039;onglet. La chaine __ID__ sera remplacée automatiquement par l&#039;Id de l&#039;entité concernée.&lt;br /&gt;
&lt;br /&gt;
Pour que la déclaration soit effective, il faut désactiver et réactiver le module.&lt;br /&gt;
&lt;br /&gt;
Pour alimenter le contenu de l&#039;onglet avec des données issues de la base, voir le chapitre suivant.&lt;br /&gt;
&lt;br /&gt;
=== Ajouter les onglets standard d&#039;un objet sur sa propre page ===&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039; : Pour afficher les onglets standard d&#039;une fiche entité (produit, tiers, etc.) sur votre propre page onglet d&#039;une entité.&lt;br /&gt;
&lt;br /&gt;
Il faut appliquer la procédure suivante :&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Inclure les fichiers définissant les fonctions utiles dans vos fichiers&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Pour chaque fiche entité, il y a deux fichiers à inclure avec l&#039;instruction&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;require_once($url_fichier) ;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voici quelques examples de fichiers à inclure (DOL_DOCUMENT_ROOT correspond au dossier dolibarr/htdocs/) :&lt;br /&gt;
* Entité tiers (thirdparty) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/societe/class/societe.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/core/lib/company.lib.php&lt;br /&gt;
* Entité produit (product) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/product/class/product.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/core/lib/product.lib.php&lt;br /&gt;
* Entité facture (invoice) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/compta/facture/facture.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/core/lib/invoice.lib.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Créer et charger l&#039;objet à afficher dans votre onglet&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Créer l&#039;objet de la classe voulue, et récupérer les données de l&#039;objet à partir de la base de données. Pour cela il faut utiliser les fonctions fetch() de la classe correspondante, en passant en paramètre l&#039;identifiant de l&#039;objet que vous récupérez depuis l&#039;url (ex : /mononglet.php?id=1).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exemple :&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$id=GETPOST(&#039;id&#039;,&#039;int&#039;);&lt;br /&gt;
$ref=GETPOST(&#039;ref&#039;,&#039;alpha&#039;);&lt;br /&gt;
$product = new Product($db) ;&lt;br /&gt;
$result = $product-&amp;gt;fetch($id, $ref) ; //Tester $result pour vérifier que l&#039;accès à la base s&#039;est bien passée&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Récupérer la liste des onglets correspondants à l&#039;entité choisie&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Utiliser la fonction XXX_prepare_head($obj), ou XXX est le nom de l&#039;entité, permettant de créer un tableau contenant les définitions des onglets à afficher. Le paramètre à passer est l&#039;objet pour lequel vous voulez afficher les onglets.&lt;br /&gt;
&lt;br /&gt;
Le tableau retourné est composé de la façon suivante :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$head        // Tableau des onglets&lt;br /&gt;
$head[$h]    // Élément décrivant un onglet. Il y aura autant de $h que d&#039;onglets à afficher&lt;br /&gt;
$head[$h][0] // Url de la page affichée quand on clique sur l&#039;onglet&lt;br /&gt;
$head[$h][1] // Titre de l’onglet&lt;br /&gt;
$head[$h][2] // Code de l&#039;onglet, à utiliser pour choisir quel onglet sera &#039;actif&#039; (voir paragraphe suivant)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exemple :&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$head = product_prepare_head($product, $user) ; //le paramètre $user n&#039;est pas présent sur certaines fonctions&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Afficher les onglets sur votre page onglet&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Utiliser la fonction dol_fiche_head() qui affiche les onglets contenus dans le tableau $head retourné par XX_prepare_head().&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
dol_fiche_head($links, $active=&#039;0&#039;, $title=&#039;&#039;, $notab=0, $picto=&#039;&#039;)&lt;br /&gt;
//$links  // Tableau des onglets, appelé $head plus haut.&lt;br /&gt;
//$active // Onglet actif (mettre le nom de l&#039;onglet défini dans votre fichier de module, ou un nom contenu dans $head[$h][2]). Cet onglet sera mis en surbrillance&lt;br /&gt;
//$title  // ?&lt;br /&gt;
//$notab  // Mettre ce paramètre à 1 permet de ne pas afficher de zone bleue en dessous des onglets.&lt;br /&gt;
//$picto  // Nom de l&#039;image à utiliser au début de la barre des onglet. Les choix suivant sont possibles :&lt;br /&gt;
//            product&lt;br /&gt;
//            service&lt;br /&gt;
//            company&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cette fonction affiche les onglets voulus et ouvre un élément &#039;&#039;&amp;lt; div class=&amp;quot;&amp;quot; &amp;gt;&#039;&#039; qui correspond à la zone bleue sous les onglets (si paramètre $notab = 0). Pour fermer la zone bleue, il suffit de fermer l&#039;élément &#039;&#039;&amp;lt; /div &amp;gt;&#039;&#039; dans le code PHP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Remarque&#039;&#039;:&lt;br /&gt;
Pour plus de détail, se référer à la [http://www.dolibarr.fr/doxygen/ documentation Doxygen] ou directement au code de Dolibarr.&lt;br /&gt;
&lt;br /&gt;
== Créer vos pages écran PHP (optionnel) ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Si l&#039;objet de votre module est d&#039;ajouter des fonctionnalités qui nécessitent de nouveaux écrans.&lt;br /&gt;
&lt;br /&gt;
=== Créer une page écran PHP brute ===&lt;br /&gt;
Vous pouvez ensuite créer vos pages PHP, qui se basent sur les données de vos tables, en utilisant les squelettes fournis comme exemple dans le répertoire &#039;&#039;&#039;modulebuilder&#039;&#039;&#039; (Pour le développement d&#039;un script en ligne de commande, voir [[Développement de scripts]]).&lt;br /&gt;
&lt;br /&gt;
Pour créer une nouvelle page écran utilisateur, créer un sous-répertoire de &#039;&#039;&#039;htdocs&#039;&#039;&#039; (si non déjà fait) propre à votre module (Dans &#039;&#039;&#039;htdocs/monmodule&#039;&#039;&#039; par exemple) afin d&#039;y placer les pages que vous aller créer.&lt;br /&gt;
&lt;br /&gt;
Y recopier le fichier &#039;&#039;&#039;myobject_page.php&#039;&#039;&#039; qui va servir de point de départ.&lt;br /&gt;
Modifier le fichier afin que le main.inc.php soit trouvés&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Load Dolibarr environment&lt;br /&gt;
$res=0;&lt;br /&gt;
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)&lt;br /&gt;
if (! $res &amp;amp;&amp;amp; ! empty($_SERVER[&amp;quot;CONTEXT_DOCUMENT_ROOT&amp;quot;])) $res=@include($_SERVER[&amp;quot;CONTEXT_DOCUMENT_ROOT&amp;quot;].&amp;quot;/main.inc.php&amp;quot;);&lt;br /&gt;
// Try main.inc.php into web root detected using web root caluclated from SCRIPT_FILENAME&lt;br /&gt;
$tmp=empty($_SERVER[&#039;SCRIPT_FILENAME&#039;])?&#039;&#039;:$_SERVER[&#039;SCRIPT_FILENAME&#039;];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1;&lt;br /&gt;
while($i &amp;gt; 0 &amp;amp;&amp;amp; $j &amp;gt; 0 &amp;amp;&amp;amp; isset($tmp[$i]) &amp;amp;&amp;amp; isset($tmp2[$j]) &amp;amp;&amp;amp; $tmp[$i]==$tmp2[$j]) { $i--; $j--; }&lt;br /&gt;
if (! $res &amp;amp;&amp;amp; $i &amp;gt; 0 &amp;amp;&amp;amp; file_exists(substr($tmp, 0, ($i+1)).&amp;quot;/main.inc.php&amp;quot;)) $res=@include(substr($tmp, 0, ($i+1)).&amp;quot;/main.inc.php&amp;quot;);&lt;br /&gt;
if (! $res &amp;amp;&amp;amp; $i &amp;gt; 0 &amp;amp;&amp;amp; file_exists(dirname(substr($tmp, 0, ($i+1))).&amp;quot;/main.inc.php&amp;quot;)) $res=@include(dirname(substr($tmp, 0, ($i+1))).&amp;quot;/main.inc.php&amp;quot;);&lt;br /&gt;
// Try main.inc.php using relative path&lt;br /&gt;
if (! $res &amp;amp;&amp;amp; file_exists(&amp;quot;../main.inc.php&amp;quot;)) $res=@include(&amp;quot;../main.inc.php&amp;quot;);&lt;br /&gt;
if (! $res &amp;amp;&amp;amp; file_exists(&amp;quot;../../main.inc.php&amp;quot;)) $res=@include(&amp;quot;../../main.inc.php&amp;quot;);&lt;br /&gt;
if (! $res &amp;amp;&amp;amp; file_exists(&amp;quot;../../../main.inc.php&amp;quot;)) $res=@include(&amp;quot;../../../main.inc.php&amp;quot;);&lt;br /&gt;
if (! $res) die(&amp;quot;Include of main fails&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Notez qu&#039;il est possible que vous deviez ajouter plus de &amp;quot;../&amp;quot; dans les chemin, en fonction de la profondeur de vos fichiers par rapport au répertoire de votre module.&lt;br /&gt;
&lt;br /&gt;
Pour tous les modules développés après la version 3.2 de Dolibarr, il convient de pouvoir placer un répertoire de module soit dans &#039;&#039;&#039;htdocs&#039;&#039;&#039; soit dans un sous répertoire comme &#039;&#039;&#039;htdocs/custom&#039;&#039;&#039; sans avoir à modifier le code source du module, c&#039;est pour cela que cette règle doit obligatoirement être appliquée.&lt;br /&gt;
&lt;br /&gt;
C&#039;est dans le main qu&#039;est chargé l&#039;environnement technique ainsi que les habilitations. Les variables objets suivantes sont alors positionnées:&lt;br /&gt;
&lt;br /&gt;
* $user    L&#039;objet qui contient les caractéristiques de l&#039;utilisateur + ses droits.&lt;br /&gt;
* $conf    L&#039;objet qui contient la configuration de Dolibarr.&lt;br /&gt;
* $db      L&#039;objet qui contient le handler de connexion ouvert à la base de données.&lt;br /&gt;
* $langs   L&#039;objet qui contient la langue de l&#039;utilisateur.&lt;br /&gt;
&lt;br /&gt;
* L&#039;inclusion d&#039;une classe ou librairie dédiée au module, sans savoir d&#039;où le fichier sera appelé, se fait en utilisant une fonction de Dolibarr (et non en utilisant directement le include_once)&lt;br /&gt;
&#039;&#039;Exemple :&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
dol_include_once(&#039;/monmodule/class/maclasse.class.php&#039;, &#039;MaClasse&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* L&#039;appel des classes fournies en standard avec Dolibarr se fera par contre par le require_once directe avec la syntaxe suivante:&lt;br /&gt;
&#039;&#039;Exemple :&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
require_once DOL_DOCUMENT_ROOT.&#039;/core/class/doli.class.php&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
La raison est que si le dol_include_once est pratique car il scanne chaque répertoire de chemin alternatifs pour trouver le fichier, il est aussi moins performant car génère des accès et recherches disque à chaque appel (en effet, PHP intègre un cache des fichiers lus mais n&#039;intègre pas un cache des fichiers &amp;quot;non trouvés&amp;quot;. Et comme un fichier donné n&#039;est que dans une seule arborescence, il y a toujours une arborescence alternative où il ne se trouve pas et qui génère des accès superflus au disque dur, pénalisant en terme de performance. Comme pour les fichiers internes à Dolibarr, on connait toujours le chemin exacte, le require_once avec ce chemin direct doit être préféré).&lt;br /&gt;
&lt;br /&gt;
=== Remplacer les parties d&#039;écrans templatés (version 3.3+) ===&lt;br /&gt;
Certaines portion d&#039;écran de Dolibarr sont isolés dans des fichiers templates.&lt;br /&gt;
Vous pouvez développer un module pour remplacer un ou plusieurs de ces templates par les vôtres.&lt;br /&gt;
{{ToComplete}}&lt;br /&gt;
&lt;br /&gt;
=== Accès à la base ===&lt;br /&gt;
Si vous avez besoin de réaliser des modifications en base dans votre propre table ajoutée, utilisez la classe générée plus haut qui contient les méthodes pour cela.&lt;br /&gt;
&lt;br /&gt;
Si toutefois vous voulez faire des accès dans des tables sans objet PHP dédié, ceci reste possible (par exemple pour récupérer une liste d&#039;enregistrement). Dans ce cas, pensez à suivre ces exemples:&lt;br /&gt;
&lt;br /&gt;
Pour un insert, update ou delete:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$db-&amp;gt;begin();   // Debut transaction&lt;br /&gt;
$db-&amp;gt;query(&amp;quot;Ma requete insert, update ou delete&amp;quot;);&lt;br /&gt;
$db-&amp;gt;commit();       // Valide&lt;br /&gt;
ou $db-&amp;gt;rollback()  // Annule&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pour une lecture:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$resql=$db-&amp;gt;query(&amp;quot;Ma requete select&amp;quot;);&lt;br /&gt;
if ($resql)&lt;br /&gt;
{&lt;br /&gt;
	$num = $db-&amp;gt;num_rows($resql);&lt;br /&gt;
	$i = 0;&lt;br /&gt;
	if ($num)&lt;br /&gt;
	{&lt;br /&gt;
		while ($i &amp;lt; $num)&lt;br /&gt;
		{&lt;br /&gt;
			$obj = $db-&amp;gt;fetch_object($resql);&lt;br /&gt;
			if ($obj)&lt;br /&gt;
			{&lt;br /&gt;
				// You can use here results&lt;br /&gt;
				print $obj-&amp;gt;field1;&lt;br /&gt;
				print $obj-&amp;gt;field2;&lt;br /&gt;
			}&lt;br /&gt;
			$i++;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Définition du style ===&lt;br /&gt;
Pour que le look de la page soit aligné avec le thème Dolibarr, il est nécessaire d&#039;utiliser les styles des CSS de Dolibarr.&lt;br /&gt;
&lt;br /&gt;
Par exemple:&lt;br /&gt;
&lt;br /&gt;
* class=&amp;quot;&#039;&#039;&#039;liste_titre&#039;&#039;&#039;&amp;quot; sur les balises &#039;&#039;tr&#039;&#039; et &#039;&#039;td&#039;&#039; pour une ligne de titre de tableau.&lt;br /&gt;
* class=&amp;quot;&#039;&#039;&#039;pair&#039;&#039;&#039;&amp;quot; ou class=&amp;quot;&#039;&#039;&#039;impair&#039;&#039;&#039;&amp;quot; sur les balises &#039;&#039;tr&#039;&#039; et &#039;&#039;td&#039;&#039; des lignes de données de tableau.&lt;br /&gt;
* class=&amp;quot;&#039;&#039;&#039;flat&#039;&#039;&#039;&amp;quot; sur tous les champs de saisie (&#039;&#039;input, select, textarea&#039;&#039;...).&lt;br /&gt;
* class=&amp;quot;&#039;&#039;&#039;button&#039;&#039;&#039;&amp;quot; sur les objets de type &#039;&#039;input type=&amp;quot;submit&amp;quot;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Utiliser le sélecteur de date de Dolibarr ===&lt;br /&gt;
Si vous le désirez, vous pouvez profiter du sélecteur de date dans des écrans Dolibarr. Pour cela, utilisez la ligne suivante:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$form=new Form($db);&lt;br /&gt;
$form-&amp;gt;select_date(&#039;&#039;,&#039;mykey&#039;,0,0,0,&amp;quot;myform&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
La chaine mykey identifie la zone date. Il faut y mettre une valeur différente s&#039;il y a plusieurs zones.&lt;br /&gt;
La chaine myform est le nom de la zone FORM (dans form name=&amp;quot;myform&amp;quot; de la page HTML).&lt;br /&gt;
L&#039;affichage d&#039;un sélecteur de date doit donc être intégrée dans une zone FORM Html.&lt;br /&gt;
&lt;br /&gt;
Pour récupérer la valeur, à l&#039;issu du POST, la commande est:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$mydate = dol_mktime(12, 0 , 0, $_POST[&#039;mykeymonth&#039;], $_POST[&#039;mykeyday&#039;], $_POST[&#039;mykeyyear&#039;]);&lt;br /&gt;
print strftime(&#039;%A %d %B %Y&#039;, $mydate);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Définir votre page de configuration (optionnel)  ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Si votre module offre plusieurs options paramétrables.&lt;br /&gt;
&lt;br /&gt;
=== Créer votre page d&#039;édition de configuration ===&lt;br /&gt;
Si votre module offre plusieurs options paramétrables, il est nécessaire de créer une page PHP pour éditer les options (qui sont stockées dans la [[Table llx_const|table &#039;&#039;&#039;llx_const&#039;&#039;&#039;]]).&lt;br /&gt;
Créer une page PHP nommée &#039;&#039;&#039;monmodule_setupapage.php&#039;&#039;&#039; qui affiche les options possibles et les met à jour.&lt;br /&gt;
Il est nécessaire de prendre exemple sur une page dans &#039;&#039;&#039;/admin&#039;&#039;&#039; qui vous montre la méthode pour lire ou sauvegarder en base votre option.&lt;br /&gt;
Placer cette page de configuration dans le répertoire &#039;&#039;&#039;/admin&#039;&#039;&#039; également.&lt;br /&gt;
Ensuite dans le descripteur de module, modifier la variable pour indiquer le nom de cette page PHP (sans le chemin qui n&#039;est pas nécessaire, la page étant forcément dans le rep admin).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;config_page_url = array(&amp;quot;monmodule_setupapage.php&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tester votre page ===&lt;br /&gt;
Allez sur la page &#039;&#039;&#039;Configuration-&amp;gt;module&#039;&#039;&#039;, vous devez voir apparaître une icône qui permet d&#039;accéder à la page de configuration et vous devez être capable de modifier ces options et les voir conservées en base.&lt;br /&gt;
&lt;br /&gt;
== Définir vos entrées de menu (optionnel) ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Si vous avez créé des pages PHP, il est nécessaire que ces écrans soient accessibles depuis le menu Dolibarr.&lt;br /&gt;
&lt;br /&gt;
=== Définissez vos entrées menus ===&lt;br /&gt;
Pour cela, il vous faut définir dans le fichier descripteur de module, le tableau this-&amp;gt;menu qui déclare les menus.&lt;br /&gt;
Ce tableau contient toutes les entrées qui apparaîtront dans les menus une fois le module activé.&lt;br /&gt;
Le fichier de descripteur de module exemple &#039;&#039;&#039;modMonModule.class.php&#039;&#039;&#039; possède un exemple de déclaration de menu haut ainsi que de ses entrées menu gauche associées.&lt;br /&gt;
&lt;br /&gt;
Voici un exemple de déclaration d&#039;entrées de menu dans le fichier descripteur:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Main menu entries&lt;br /&gt;
$this-&amp;gt;menu = array();			// List of menus to add&lt;br /&gt;
$r=0;&lt;br /&gt;
&lt;br /&gt;
// Add here entries to declare new menus&lt;br /&gt;
// Example to declare the Top Menu entry:&lt;br /&gt;
$this-&amp;gt;menu[$r]=array(	&#039;fk_menu&#039;=&amp;gt;0,			// Put 0 if this is a top menu&lt;br /&gt;
			&#039;type&#039;=&amp;gt;&#039;top&#039;,			// This is a Top menu entry&lt;br /&gt;
			&#039;titre&#039;=&amp;gt;&#039;MonModule top menu&#039;,&lt;br /&gt;
			&#039;mainmenu&#039;=&amp;gt;&#039;monmodule&#039;,&lt;br /&gt;
			&#039;leftmenu&#039;=&amp;gt;&#039;monmodule&#039;,&lt;br /&gt;
			&#039;url&#039;=&amp;gt;&#039;/monmodule/pagetop.php&#039;,&lt;br /&gt;
			&#039;langs&#039;=&amp;gt;&#039;mylangfile&#039;,	// Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.&lt;br /&gt;
			&#039;position&#039;=&amp;gt;100,&lt;br /&gt;
			&#039;enabled&#039;=&amp;gt;&#039;1&#039;,			// Define condition to show or hide menu entry. Use &#039;$conf-&amp;gt;monmodule-&amp;gt;enabled&#039; if entry must be visible if module is enabled.&lt;br /&gt;
			&#039;perms&#039;=&amp;gt;&#039;1&#039;,			// Use &#039;perms&#039;=&amp;gt;&#039;$user-&amp;gt;rights-&amp;gt;monmodule-&amp;gt;level1-&amp;gt;level2&#039; if you want your menu with a permission rules&lt;br /&gt;
			&#039;target&#039;=&amp;gt;&#039;&#039;,&lt;br /&gt;
			&#039;user&#039;=&amp;gt;2);				// 0=Menu for internal users, 1=external users, 2=both&lt;br /&gt;
$r++;&lt;br /&gt;
&lt;br /&gt;
// Example to declare a Left Menu entry:&lt;br /&gt;
$this-&amp;gt;menu[$r]=array(	&#039;fk_menu&#039;=&amp;gt;&#039;fk_mainmenu=xxx&#039;,	// Use &#039;fk_mainmenu=xxx&#039; or &#039;fk_mainmenu=xxx,fk_leftmenu=yyy&#039; where xxx is mainmenucode and yyy is a leftmenucode of parent menu&lt;br /&gt;
			&#039;type&#039;=&amp;gt;&#039;left&#039;,			// This is a Left menu entry&lt;br /&gt;
			&#039;titre&#039;=&amp;gt;&#039;MonModule left menu 1&#039;,&lt;br /&gt;
			&#039;mainmenu&#039;=&amp;gt;&#039;xxx&#039;,&lt;br /&gt;
                        &#039;leftmenu&#039;=&amp;gt;&#039;yyy&#039;,&lt;br /&gt;
			&#039;url&#039;=&amp;gt;&#039;/monmodule/pagelevel1.php&#039;,&lt;br /&gt;
			&#039;langs&#039;=&amp;gt;&#039;mylangfile&#039;,	// Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.&lt;br /&gt;
			&#039;position&#039;=&amp;gt;100,&lt;br /&gt;
			&#039;enabled&#039;=&amp;gt;&#039;1&#039;,			// Define condition to show or hide menu entry. Use &#039;$conf-&amp;gt;monmodule-&amp;gt;enabled&#039; if entry must be visible if module is enabled.&lt;br /&gt;
			&#039;perms&#039;=&amp;gt;&#039;1&#039;,			// Use &#039;perms&#039;=&amp;gt;&#039;$user-&amp;gt;rights-&amp;gt;monmodule-&amp;gt;level1-&amp;gt;level2&#039; if you want your menu with a permission rules&lt;br /&gt;
			&#039;target&#039;=&amp;gt;&#039;&#039;,&lt;br /&gt;
			&#039;user&#039;=&amp;gt;2);				// 0=Menu for internal users,1=external users, 2=both&lt;br /&gt;
$r++;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pour conditionner l&#039;accès au menu selon des permission, modifier la propriété &#039;&#039;&#039;perms&#039;&#039;&#039; du tableau. Voir le chapitre sur les permissions un peu plus loin pour savoir comment ajouter des permissions.&lt;br /&gt;
&lt;br /&gt;
=== Tester vos entrées menus ===&lt;br /&gt;
Désactiver et réactiver votre module sous Dolibarr, les entrées menus doivent alors apparaître (si la condition dans &#039;enabled&#039; est vraie).&lt;br /&gt;
&lt;br /&gt;
== Définir vos propres permissions (optionnel) ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Si vous voulez ajouter de nouvelles permissions.&lt;br /&gt;
&lt;br /&gt;
La définition des permissions que gérera votre module se fait dans le fichier descripteur créé dans la première étape.&lt;br /&gt;
Modifier la ligne &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;rights_class = &#039;monmodule&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
pour y mettre la bonne valeur de monmodule.&lt;br /&gt;
&lt;br /&gt;
Ensuite remplissez le tableau $this-&amp;gt;rights avec autant d&#039;entrées que de permissions différentes à gérer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;rights[$r][0] = 10001;&lt;br /&gt;
$this-&amp;gt;rights[$r][1] = &#039;Libelle par défaut de ma permission&#039;;&lt;br /&gt;
$this-&amp;gt;rights[$r][3] = 1;&lt;br /&gt;
$this-&amp;gt;rights[$r][4] = &#039;action&#039;;&lt;br /&gt;
$this-&amp;gt;rights[$r][5] = &#039;sousaction&#039;;&lt;br /&gt;
$r++;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dans $this-&amp;gt;rights[$r][0], mettre un id de permission non déjà pris (Voir dans le menu &#039;&#039;&#039;Infos Système&#039;&#039;&#039; sur une installation de Dolibarr opérationnelle pour connaitre les id déjà utilisés.&lt;br /&gt;
Dans $this-&amp;gt;rights[$r][3], mettre 1 si cette permission est attribué d&#039;office par défaut quand un utilisateur est créé.&lt;br /&gt;
Dans $this-&amp;gt;rights[$r][1], mettre un libellé par défaut (il sera affiché si aucune traduction n&#039;est trouvé pour votre permission dans le fichier &#039;&#039;&#039;admin.lang&#039;&#039;&#039;).&lt;br /&gt;
Dans $this-&amp;gt;rights[$r][4] et $this-&amp;gt;rights[$r][5], mettre une chaîne action et sousaction sans espaces. Vous pourrez alors tester dans le code PHP si un utilisateurs a bien les droits par la séquence suivante:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
if ($user-&amp;gt;rights-&amp;gt;monmodule-&amp;gt;action-&amp;gt;sousaction) ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Définir vos propres box (optionnel) ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Si votre module amène avec lui une ou plusieurs Boxes.&lt;br /&gt;
&lt;br /&gt;
=== Définissez vos box ===&lt;br /&gt;
Pour cela, modifiez les tableaux $this-&amp;gt;boxes du fichier descripteur de module.&lt;br /&gt;
Il suffit d&#039;ajouter 2 lignes par fichier box que vous allez créer dans le répertoire &#039;&#039;&#039;htdocs/monmodule/core/boxes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exemple:&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;boxes[0][&#039;file&#039;]=&#039;mabox0.php@monmodule&#039;&lt;br /&gt;
$this-&amp;gt;boxes[0][&#039;note&#039;]=&#039;Ma box 0&#039;&lt;br /&gt;
 ...&lt;br /&gt;
$this-&amp;gt;boxes[n][&#039;file&#039;]=&#039;maboxn.php@monmodule&#039;&lt;br /&gt;
$this-&amp;gt;boxes[n][&#039;note&#039;]=&#039;Ma box n&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensuite créer les fichiers &#039;&#039;&#039;htdocs/monmodule/core/boxes/mabox0.php&#039;&#039;&#039;, &#039;&#039;&#039;htdocs/monmodule/core/boxes/mabox1.php&#039;&#039;&#039;... en prenant exemple sur des box existantes (exemple dans le répertoire &#039;&#039;&#039;htdocs/core/boxes&#039;&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
=== Tester la présence de vos box dans Dolibarr ===&lt;br /&gt;
Désactiver et réactiver le module.&lt;br /&gt;
&lt;br /&gt;
Aller dans le menu &#039;&#039;&#039;Accueil - Configuration - Boite&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Vos box doivent apparaître dans la liste des box activables. Activer les puis aller sur la page d&#039;accueil et vérifier qu&#039;elles s&#039;affichent correctement.&lt;br /&gt;
&lt;br /&gt;
== Définir vos propres exports (optionnel) ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Si votre module amène avec lui des exports prédéfini de données (pour ces propres tables ou des tables déjà existante d&#039;un autre module de Dolibarr).&lt;br /&gt;
&lt;br /&gt;
=== Définissez l&#039;export ===&lt;br /&gt;
Pour cela, décommenter et modifier les tableaux $this-&amp;gt;export_xxx du votre fichier descripteur de module.&lt;br /&gt;
&lt;br /&gt;
=== Tester votre export ===&lt;br /&gt;
Aller dans le menu outils -&amp;gt; export de Dolibarr. Votre export doit apparaitre dans la liste des exports prédéfinis disponible (si votre module est bien activé).&lt;br /&gt;
Le choisir, vous devez alors voir les champs possible définis dans le tableau à l&#039;étape précédente.&lt;br /&gt;
Choisir quelques champs et tenter une génération du fichier export.&lt;br /&gt;
&lt;br /&gt;
== Définir vos styles CSS (optionnel) ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Si dans vos écrans PHP, vous utiliser des classes de styles qui ne sont pas celle des thèmes de Dolibarr (non recommandé).&lt;br /&gt;
&lt;br /&gt;
Cette fonctionnalité est décrite mais pas encore opérationnel en 2.4&lt;br /&gt;
&lt;br /&gt;
=== Créer et déclarer votre feuille de style ===&lt;br /&gt;
Créer un fichier de style css nommé &#039;&#039;&#039;monmodule.css&#039;&#039;&#039; ou &#039;&#039;&#039;monmodule.css.php&#039;&#039;&#039; et le placer dans le répertoire &#039;&#039;&#039;&#039;&#039;monmodule&#039;&#039;&#039;&#039;&#039; dans &#039;&#039;&#039;htdocs&#039;&#039;&#039;. Il ne peut y avoir qu&#039;un fichier css propre à chaque module.&lt;br /&gt;
Rappelons qu&#039;il vaut mieux utiliser les styles déjà existant de Dolibarr (le fichier css utilisé par Dolibarr étant le fichier &#039;&#039;&#039;themes/nomtheme/&#039;&#039;nomtheme&#039;&#039;.css.php&#039;&#039;&#039;). Ne créer un fichier css propre à votre module que si vous devez absolument gérer des styles non déjà existants.&lt;br /&gt;
Une fois votre feuille de style prête, déclarer la dans votre fichier descripteur de module en modifiant la propriété &#039;&#039;&#039;$this-&amp;gt;module_parts&#039;&#039;&#039;.&lt;br /&gt;
La valeur à renseigner ici doit être le chemin relatif de l&#039;URL de votre fichier css.&lt;br /&gt;
Par exemple&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;module_parts = array(&#039;css&#039; =&amp;gt; array(&#039;/monmodule/css/monmodule.css.php&#039;));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tester votre feuille de style ===&lt;br /&gt;
Désactiver et réactiver votre module.&lt;br /&gt;
&lt;br /&gt;
Appelez la page d&#039;accueil de Dolibarr. Afficher la source de la page HTML.&lt;br /&gt;
&lt;br /&gt;
Vous devriez voir dans l&#039;entête HTML, une ligne déclarant votre feuille de style.&lt;br /&gt;
&lt;br /&gt;
== Définir vos fonctions Javascript (optionnel) ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Si dans vos écrans PHP, vous utiliser des fonctions javascript non dispo en standard (fichier lib_head.js)&lt;br /&gt;
&lt;br /&gt;
Si dans vos écrans PHP, vous utilisez des fonctions javascript, il est nécessaire de faire en sorte que vos fonctions déclarées dans un fichier javascript &#039;&#039;&#039;htdocs/monmodule/js/monmodule.js&#039;&#039;&#039; soit chargées dans l&#039;entête head html.&lt;br /&gt;
Pour demander à Dolibarr qui gère la génération de la section header d&#039;inclure un de vos fichiers javascript, il est nécessaire de fournir en paramètre de la fonction llxHeader() appelée au début de votre page, d&#039;inclure le paramètre qui contient l&#039;URL vers le js à inclure.&lt;br /&gt;
&lt;br /&gt;
Exemple pour la page /htdocs/monmodule/mapage.php :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
require(&#039;../main.inc.php&#039;);&lt;br /&gt;
$morejs=array(&amp;quot;/monmodule/js/monmodule.js&amp;quot;);&lt;br /&gt;
llxHeader(&#039;&#039;,&#039;Titre&#039;,&#039;&#039;,&#039;&#039;,&#039;&#039;,&#039;&#039;,$morejs,&#039;&#039;,0,0); &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Déclencher du code sur un évènement Dolibarr (optionnel) ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Si vous voulez que des actions particulières s&#039;exécutent suite au déclenchement d&#039;actions standards de Dolibarr (exemple: je veux mettre à jour une table de mon module quand une facture se crée dans Dolibarr), il vous faut créer un fichier de &#039;&#039;&#039;triggers&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Voir aussi [[Interfaces_Dolibarr_vers_exterieur|Interfaces de Dolibarr vers l&#039;exterieur]]&lt;br /&gt;
et [[Interfaces_Exterieur_vers_Dolibarr|Interfaces exterieures vers Dolibarr]]&lt;br /&gt;
&lt;br /&gt;
== Insérer votre code aux emplacement hooks de Dolibarr (optionnel) ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Quand vous voulez modifier ou ajouter du code autrement que lors d&#039;un événement métier (voir le chapitre précédent pour cela).&lt;br /&gt;
&lt;br /&gt;
Voir la page [[Système de Hooks]].&lt;br /&gt;
&lt;br /&gt;
== Ajouter un module de numérotation (optionnel) ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Lorsque vous voulez ajouter une règle de numérotation non couverte par les modules par défaut.&lt;br /&gt;
&lt;br /&gt;
Voir la page [[Créer un module de numérotation]].&lt;br /&gt;
&lt;br /&gt;
== Ajouter un nouveau modèle de document (optionnel) ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Lorsque vous voulez ajouter un nouveau modèle de document.&lt;br /&gt;
&lt;br /&gt;
La documentation au sujet de la génération de documents depuis des modèles est disponible sur la page [[Créer un modèle de document PDF]] ou [[Créer un modèle de document ODT]].&lt;br /&gt;
&lt;br /&gt;
== Ajouter un thème (optionnel) ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Lorsque vous voulez une interface aux couleurs personnalisées à votre cas.&lt;br /&gt;
&lt;br /&gt;
Voir la page [[Themes]].&lt;br /&gt;
&lt;br /&gt;
= [[File:Art.png]] Quelques règles de codage et fonctions pour développeurs =&lt;br /&gt;
Les règles de codage à suivre sont définis dans la [[Documentation Développeur|Documentation développeur]], rubrique &amp;quot;Informations Générales - Langage et normes de développement&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
De nombreuses fonctions prédéfinies pour les développeurs sont disponibles et décrites sur la page [[Documentation Développeur|Documentation développeur]] sous la section &amp;quot;Les couches techniques de Dolibarr&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= [[File:Art.png]] Utilisation du MDA =&lt;br /&gt;
Une méthode pour générer un module fonctionnel depuis l&#039;UML est en cours de mise au point. Plus d&#039;informations sur la page [[UML2Dolibarr - Générer un module par MDA]].&lt;br /&gt;
&lt;br /&gt;
= [[File:Art.png]] Créer un package pour livrer et installer votre module =&lt;br /&gt;
Cette procédure doit être utilisé pour fabriquer un package afin de le soumettre sur la place de marché http://www.dolistore.com.&lt;br /&gt;
Mais vous pouvez aussi l&#039;utiliser pour distribuer facillement votre module via votre propre réseau de distribution.&lt;br /&gt;
&lt;br /&gt;
* Aller dans le répertoire &#039;&#039;&#039;/build&#039;&#039;&#039; et recopier le fichier &#039;&#039;&#039;makepack-dolibarrmodules.conf&#039;&#039;&#039; en &#039;&#039;&#039;makepack-monmodule.conf&#039;&#039;&#039;. Attention, ce répertoire peut ne pas être fourni dans les packages de versions stables. Si c&#039;est le cas, il peut être récupéré dans le snapshot disponible en téléchargement sur le site web Dolibarr dans la rubrique Version de développement (prendre dans ce cas tout le répertoire build qui est un répertoire autonome et indépendant de la version).&lt;br /&gt;
Saisissez dans ce fichier la liste des noms des nouveaux fichiers que vous avez créé pour votre module (descripteur de module, nouveaux fichiers sql de tables, page php, images, etc...)&lt;br /&gt;
&lt;br /&gt;
* Lancer le script via Perl (besoin de la version Perl 5.0 ou +):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
perl makepack-dolibarrmodule.pl&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Le script vous demande le nom de votre module, sa version majeure et mineure.&lt;br /&gt;
Un fichier &#039;&#039;&#039;monmodule.zip&#039;&#039;&#039; va alors être fabriqué contenant votre module prêt pour être déployé.&lt;br /&gt;
&lt;br /&gt;
* La personne qui reçoit votre module doit alors placer le fichier dans son répertoire racine d&#039;installation de Dolibarr et réaliser la commande:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar -xvf monmodule.zip&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Si vous désirez que votre module profite à tous, vous pouvez le soumettre (le fichier zip) sur la place de marché des modules complémentaires: {{LinkToPluginDownload}} (vous devez avoir créer un compte auparavant et utiliser le lien &amp;quot;Soumettre un module/produit&amp;quot;).&lt;br /&gt;
** Si votre module a été fabriqué correctement, le fichier sera validé rapidement.&lt;br /&gt;
** Si la qualité est suffisante, que la licence le permet et que la fonctionnalité du module s&#039;avère être d&#039;un intérêt général, le code pourra être ajouté au code source de Dolibarr (sauf si vous ne le désirez pas).&lt;br /&gt;
&lt;br /&gt;
= [[File:Art.png]] Validation/activation du module externe sur Dolistore =&lt;br /&gt;
&lt;br /&gt;
Voir [[Module_Dolistore_Validation_Regles|Règles de Validation]]&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=D%C3%A9veloppement_module&amp;diff=38320</id>
		<title>Développement module</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=D%C3%A9veloppement_module&amp;diff=38320"/>
		<updated>2018-02-12T12:20:12Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: /* Créer vos fichiers .sql */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Noyau]]&lt;br /&gt;
{{TemplateDocDev}}&lt;br /&gt;
Pour créer un nouveau module, il existe plusieurs étapes. Ce didacticiel a pour but de vous décrire chacune d&#039;elle afin d&#039;ajouter un module permettant d&#039;étendre les possibilités de Dolibarr, comme par exemple ajouter une ou plusieurs des fonctionnalités suivantes:&lt;br /&gt;
* Ajouter de nouvelles tables en base&lt;br /&gt;
* Ajouter vos propres entrées dans les menus&lt;br /&gt;
* Ajouter des écrans de saisie/consultation de nouvelle tables&lt;br /&gt;
* Ajouter ou supprimer des onglets sur les pages de vues/édition des objets (facture, produit, commande, événement, ...)&lt;br /&gt;
* Ajouter des exports prédéfinis pour la fonction export&lt;br /&gt;
* Ajouter de nouvelles boites pour la home page&lt;br /&gt;
* Ajouter des variables de substitutions&lt;br /&gt;
* Définir de nouvelles permissions&lt;br /&gt;
* Déclencher du code automatiquement sur une action Dolibarr particulière&lt;br /&gt;
* Insérer votre code aux emplacement hooks de Dolibarr&lt;br /&gt;
* Ajouter un module de numérotation&lt;br /&gt;
* Ajouter un modèle de document&lt;br /&gt;
* Ajouter un nouveau thème&lt;br /&gt;
etc...&lt;br /&gt;
Toutes ces opérations ne sont possibles qu&#039;avec la version 3.2 ou plus de Dolibarr.&lt;br /&gt;
&lt;br /&gt;
Les chapitres suivants vous présentent comment réaliser tout cela en manuel de manière simple. Pour les développeurs très expérimentés, une méthode par génération MDA est en cours de mise au point. Voir le dernier chapitre pour cela.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= [[File:Art.png]] Exemple de modèle de module externe=&lt;br /&gt;
&lt;br /&gt;
Un bon modéle/squelette de module externe Dolibarr est disponible ici : [https://github.com/Dolibarr/dolibarr/tree/develop/htdocs/modulebuilder/template GitHub Dolibarr Module Modèle]&lt;br /&gt;
&lt;br /&gt;
= [[File:Art.png]] Créer un module =&lt;br /&gt;
Les sous chapitres suivant décrivent les actions à faire pour créer un module Dolibarr. Les premiers chapitres sont obligatoires quelle que soit la vocation du module, les suivants dépendront de ce que doit faire le module.&lt;br /&gt;
&lt;br /&gt;
== Créer un descripteur de Module (obligatoire) ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Obligatoire dès qu&#039;une extension est développée, quelle que soit sa vocation (sauf pour l&#039;ajout de thème ou de modèle de document).&lt;br /&gt;
&lt;br /&gt;
=== Créer votre descripteur ===&lt;br /&gt;
La première étape est donc de créer un fichier de description du module (descripteur). Pour cela:&lt;br /&gt;
* Créer le répertoire &#039;&#039;&#039;/htdocs/&#039;&#039;monmodule&#039;&#039;/core/modules&#039;&#039;&#039;. Puis, aller dans le répertoire &#039;&#039;&#039;dev/skeletons&#039;&#039;&#039; et recopier le fichier modMyModule.class.php dans ce répertoire &#039;&#039;&#039;htdocs/&#039;&#039;monmodule&#039;&#039;/core/modules&#039;&#039;&#039;.&lt;br /&gt;
* Renommez le fichier mod&#039;&#039;&#039;MyModule&#039;&#039;&#039;.class.php en modifiant seulement la partie &#039;&#039;&#039;MyModule&#039;&#039;&#039; (le fichier doit commencer par mod)&lt;br /&gt;
Ensuite, modifier le contenu de ce fichier afin de remplacer:&lt;br /&gt;
* les &#039;&#039;modMyModule&#039;&#039; en une valeur qui corresponde à la vocation de votre module. Cette valeur doit toujours commencer par &#039;&#039;&#039;&#039;mod&#039;&#039;&#039;&#039; et ne contenir que des &#039;&#039;&#039;caractères alphabétiques&#039;&#039;&#039;.&lt;br /&gt;
* $this-&amp;gt;numero = &#039;&#039;100000&#039;&#039; par un numéro de module libre. Pour éviter tout conflit, vous pouvez consulter la page suivante pour retrouver les numéros déjà alloués: [[List of modules id|Liste des id de modules]].&lt;br /&gt;
* Modifier éventuellement les autres variables définies dans le constructeurs (Voir le commentaire dans le code du squelette pour leur signification).&lt;br /&gt;
&lt;br /&gt;
Le descripteur de votre module est alors en place.&lt;br /&gt;
&lt;br /&gt;
=== Tester votre descripteur ===&lt;br /&gt;
&lt;br /&gt;
Lancer Dolibarr et aller sur la page &#039;&#039;&#039;Configuration-&amp;gt;module&#039;&#039;&#039;, vous devez voir apparaître une nouvelle ligne avec votre nouveau module et la possibilité de l&#039;activer ou non (parcourez tous les onglets de chaque catégories de modules jusqu&#039;à le retrouver).&lt;br /&gt;
C&#039;est la valeur de $this-&amp;gt;special qui détermine dans quel onglet se trouve votre module.&lt;br /&gt;
&lt;br /&gt;
== Arborescence d&#039;un nouveau module ==&lt;br /&gt;
Voici l&#039;arborescence à respecter pour l&#039;organisation des fichiers d&#039;un module.&lt;br /&gt;
&lt;br /&gt;
Rem: Seule la deuxième ligne est obligatoire.&lt;br /&gt;
{{TemplateModuleTreeSimple}}&lt;br /&gt;
&lt;br /&gt;
Un modèle de module a été crée par un contributeur Dolibarr, il est accessible ici : [https://github.com/rdoursenaud/dolibarr-module-template]&lt;br /&gt;
&lt;br /&gt;
== Créer vos tables SQL et les classes PHP DAO (optionnel) ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Si votre module a besoin de gérer des données qui lui sont propres&lt;br /&gt;
&lt;br /&gt;
=== Créer vos fichiers .sql ===&lt;br /&gt;
Si votre module a vocation à gérer des données bien à lui, qui n&#039;existent pas en base dans la version standard de Dolibarr, il est nécessaire de définir des tables SQL pour stocker ces données.&lt;br /&gt;
&lt;br /&gt;
Créer un sous-répertoire &#039;&#039;&#039;sql&#039;&#039;&#039; dans le répertoire de votre module (par exemple &#039;&#039;&#039;htdocs/monmodule/sql&#039;&#039;&#039;) afin d&#039;y placer les scripts sql que vous allez créer.&lt;br /&gt;
&lt;br /&gt;
Ensuite, vérifiez dans votre fichier descripteur de module, dans la fonction &#039;&#039;&#039;init&#039;&#039;&#039; que la ligne&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;_load_tables(&#039;/mymodule/sql/&#039;);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
n&#039;est pas commentée.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Règles à respecter:&#039;&#039;&lt;br /&gt;
* Ajouter les fichiers d&#039;ordre de création de vos tables sur le principe d&#039;un fichier &#039;&#039;&#039;llx_matable.sql&#039;&#039;&#039; par table accompagné éventuellement du fichier &#039;&#039;&#039;llx_matable.key.sql&#039;&#039;&#039; (voir les fichiers existants dans &#039;&#039;&#039;install/mysql/tables&#039;&#039;&#039; pour exemple).&lt;br /&gt;
* Pour ce qui est des commandes pour ajouter/manipuler des données, elles doivent toutes se trouver dans un fichier nommé &#039;&#039;&#039;data.sql&#039;&#039;&#039; situé dans le même répertoire &#039;&#039;&#039;/monmodule/sql/&#039;&#039;&#039;.&lt;br /&gt;
* N&#039;utilisez pas &amp;quot;chaine&amp;quot; mais &#039;chaine&#039; car les guillemets doubles (&amp;quot;) ont une sinification particulière en PostGreSQL&lt;br /&gt;
Exemple de contenu de fichier data.sql&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
 delete from llx_const where name=&#039;MONMODULE_IT_WORKS&#039; and entity=&#039;__ENTITY__&#039;;&lt;br /&gt;
 insert into llx_const (name, value, type, note, visible, entity) values (&#039;MONMODULE_IT_WORKS&#039;,&#039;1&#039;,&#039;chaine&#039;,&#039;A constant for my module&#039;,1,&#039;__ENTITY__&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Les ordres SQL des fichiers doivent être opérationnels pour la base de données &#039;&#039;&#039;mysql&#039;&#039;&#039;.&lt;br /&gt;
Rem: Les fichiers des autres bases ne sont pas à maintenir. Ils sont lus et convertit à la volée par le driver de la base de données.&lt;br /&gt;
&lt;br /&gt;
=== Tester vos fichier .sql ===&lt;br /&gt;
&lt;br /&gt;
Une fois les fichiers prêts, vous pouvez retourner sous Dolibarr puis désactiver le module, dropper les tables en base et réactiver le module.&lt;br /&gt;
Les tables doivent alors être recréées par l&#039;activation du module.&lt;br /&gt;
Si tel n&#039;est pas le cas, vérifiez vos scripts en les passant à la main, ou consultez les logs Dolibarr.&lt;br /&gt;
&lt;br /&gt;
=== Générer la classe PHP DAO d&#039;accès aux tables ===&lt;br /&gt;
&lt;br /&gt;
Une fois votre ou vos tables créées en base, aller dans le répertoire &#039;&#039;&#039;dev/skeletons&#039;&#039;&#039;, copiez le fichier &#039;&#039;&#039;build_class_from_table.php&#039;&#039;&#039; dans le répertoire sql/ de votre module, et lancez le script&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;php build_class_from_table.php nomtable&amp;lt;/source&amp;gt;&lt;br /&gt;
Remarque: Si la commande ne fonctionne pas, essayer d&#039;utiliser php-cli plutot que php.&lt;br /&gt;
&lt;br /&gt;
Ceci génèrera un fichier &#039;&#039;&#039;out.nomtable.class.php&#039;&#039;&#039; qui contient la classe de gestion de la table nomtable.&lt;br /&gt;
Dans cette classe, se trouve des méthodes CRUD (Create/Read/Update/Delete) déjà opérationnelles pour faire un insert, un fetch (select), un update, un delete d&#039;une ligne de la table.&lt;br /&gt;
Supprimer juste le &amp;quot;out&amp;quot; du nom de fichier et placer votre fichier dans le sous-répertoire de &#039;&#039;&#039;htdocs&#039;&#039;&#039; propre à votre module (Dans &#039;&#039;&#039;htdocs/monmodule&#039;&#039;&#039; par exemple).&lt;br /&gt;
&lt;br /&gt;
Un fichier &#039;&#039;&#039;out.nomtable_script.php&#039;&#039;&#039; a également été généré et contient un exemple de code pour utiliser la classe pour chacune des 4 méthodes CRUD.&lt;br /&gt;
&lt;br /&gt;
== Affichage des onglets (optionnel) ==&lt;br /&gt;
&lt;br /&gt;
=== Ajouter ou supprimer des onglets sur les fiches objets ===&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039; : Pour ajouter votre propre onglet parmi les onglets standard d&#039;une fiche entité (facture, commande, proposition commercial, adhérent...)&lt;br /&gt;
&lt;br /&gt;
Pour cela, aller dans le fichier descripteur de module précédemment créé et modifier le tableau $this-&amp;gt;tabs:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
	// Array to add new pages in new tabs or remove existing one&lt;br /&gt;
	$this-&amp;gt;tabs = array(&#039;objecttype:+tabname1:Title1:mylangfile@monmodule:$user-&amp;gt;rights-&amp;gt;monmodule-&amp;gt;read:/monmodule/mapagetab1.php?id=__ID__&#039;    // To add a new tab identified by code tabname1&lt;br /&gt;
                            &#039;objecttype:+tabname2:Title2:mylangfile@monmodule:$user-&amp;gt;rights-&amp;gt;monmodule-&amp;gt;read:/monmodule/mapagetab2.php?id=__ID__&#039;,   // To add a new tab identified by code tabname2&lt;br /&gt;
                            &#039;objecttype:-tabname&#039;);                                                     // To remove an existing tab identified by code tabname&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Le tableau doit contenir une liste de chaîne, chaque chaîne représentant un nouvel onglet.&lt;br /&gt;
Le format de la chaîne étant composé de 6 parties séparées par &amp;quot;:&amp;quot;&lt;br /&gt;
* Partie 1: Le type d&#039;élément (objecttype) dans lequel doit apparaître l&#039;onglet qui est une valeur parmi celle-ci:&lt;br /&gt;
{{TemplateModuleTabs-fr}}&lt;br /&gt;
* Partie 2: Nom de code pour l&#039;onglet à ajouter (commence par +) ou à enlever (commence par -)&lt;br /&gt;
* Partie 3: Le titre de l&#039;onglet. Cela peut être un libellé en dur ou mieux un code traduction présent dans un fichier lang.&lt;br /&gt;
* Partie 4: Le nom du fichier .lang (sans l&#039;extension .lang) qui contient la correspondance entre le code traduction et le libellé à afficher. Si ce com est suivi de @monmodule, Dolibarr cherche le fichier dans le répertoire lang propre au module, c&#039;est à dire htdocs/monmodule/langs/code_CODE/monmodule.lang, sinon Dolibarr cherche le fichier traduction dans htdocs/langs/code_CODE/mylangfile.lang&lt;br /&gt;
* Partie 5: Une condition à tester pour savoir si l&#039;onglet doit être visible ou pas. Mettre &#039;1&#039; pour qu&#039;il soit toujours visible.&lt;br /&gt;
* Partie 6: L&#039;url de la page à afficher quand on clique sur l&#039;onglet. La chaine __ID__ sera remplacée automatiquement par l&#039;Id de l&#039;entité concernée.&lt;br /&gt;
&lt;br /&gt;
Pour que la déclaration soit effective, il faut désactiver et réactiver le module.&lt;br /&gt;
&lt;br /&gt;
Pour alimenter le contenu de l&#039;onglet avec des données issues de la base, voir le chapitre suivant.&lt;br /&gt;
&lt;br /&gt;
=== Ajouter les onglets standard d&#039;un objet sur sa propre page ===&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039; : Pour afficher les onglets standard d&#039;une fiche entité (produit, tiers, etc.) sur votre propre page onglet d&#039;une entité.&lt;br /&gt;
&lt;br /&gt;
Il faut appliquer la procédure suivante :&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Inclure les fichiers définissant les fonctions utiles dans vos fichiers&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Pour chaque fiche entité, il y a deux fichiers à inclure avec l&#039;instruction&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;require_once($url_fichier) ;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voici quelques examples de fichiers à inclure (DOL_DOCUMENT_ROOT correspond au dossier dolibarr/htdocs/) :&lt;br /&gt;
* Entité tiers (thirdparty) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/societe/class/societe.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/core/lib/company.lib.php&lt;br /&gt;
* Entité produit (product) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/product/class/product.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/core/lib/product.lib.php&lt;br /&gt;
* Entité facture (invoice) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/compta/facture/facture.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/core/lib/invoice.lib.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Créer et charger l&#039;objet à afficher dans votre onglet&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Créer l&#039;objet de la classe voulue, et récupérer les données de l&#039;objet à partir de la base de données. Pour cela il faut utiliser les fonctions fetch() de la classe correspondante, en passant en paramètre l&#039;identifiant de l&#039;objet que vous récupérez depuis l&#039;url (ex : /mononglet.php?id=1).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exemple :&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$id=GETPOST(&#039;id&#039;,&#039;int&#039;);&lt;br /&gt;
$ref=GETPOST(&#039;ref&#039;,&#039;alpha&#039;);&lt;br /&gt;
$product = new Product($db) ;&lt;br /&gt;
$result = $product-&amp;gt;fetch($id, $ref) ; //Tester $result pour vérifier que l&#039;accès à la base s&#039;est bien passée&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Récupérer la liste des onglets correspondants à l&#039;entité choisie&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Utiliser la fonction XXX_prepare_head($obj), ou XXX est le nom de l&#039;entité, permettant de créer un tableau contenant les définitions des onglets à afficher. Le paramètre à passer est l&#039;objet pour lequel vous voulez afficher les onglets.&lt;br /&gt;
&lt;br /&gt;
Le tableau retourné est composé de la façon suivante :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$head        // Tableau des onglets&lt;br /&gt;
$head[$h]    // Élément décrivant un onglet. Il y aura autant de $h que d&#039;onglets à afficher&lt;br /&gt;
$head[$h][0] // Url de la page affichée quand on clique sur l&#039;onglet&lt;br /&gt;
$head[$h][1] // Titre de l’onglet&lt;br /&gt;
$head[$h][2] // Code de l&#039;onglet, à utiliser pour choisir quel onglet sera &#039;actif&#039; (voir paragraphe suivant)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exemple :&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$head = product_prepare_head($product, $user) ; //le paramètre $user n&#039;est pas présent sur certaines fonctions&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Afficher les onglets sur votre page onglet&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Utiliser la fonction dol_fiche_head() qui affiche les onglets contenus dans le tableau $head retourné par XX_prepare_head().&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
dol_fiche_head($links, $active=&#039;0&#039;, $title=&#039;&#039;, $notab=0, $picto=&#039;&#039;)&lt;br /&gt;
//$links  // Tableau des onglets, appelé $head plus haut.&lt;br /&gt;
//$active // Onglet actif (mettre le nom de l&#039;onglet défini dans votre fichier de module, ou un nom contenu dans $head[$h][2]). Cet onglet sera mis en surbrillance&lt;br /&gt;
//$title  // ?&lt;br /&gt;
//$notab  // Mettre ce paramètre à 1 permet de ne pas afficher de zone bleue en dessous des onglets.&lt;br /&gt;
//$picto  // Nom de l&#039;image à utiliser au début de la barre des onglet. Les choix suivant sont possibles :&lt;br /&gt;
//            product&lt;br /&gt;
//            service&lt;br /&gt;
//            company&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cette fonction affiche les onglets voulus et ouvre un élément &#039;&#039;&amp;lt; div class=&amp;quot;&amp;quot; &amp;gt;&#039;&#039; qui correspond à la zone bleue sous les onglets (si paramètre $notab = 0). Pour fermer la zone bleue, il suffit de fermer l&#039;élément &#039;&#039;&amp;lt; /div &amp;gt;&#039;&#039; dans le code PHP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Remarque&#039;&#039;:&lt;br /&gt;
Pour plus de détail, se référer à la [http://www.dolibarr.fr/doxygen/ documentation Doxygen] ou directement au code de Dolibarr.&lt;br /&gt;
&lt;br /&gt;
== Créer vos pages écran PHP (optionnel) ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Si l&#039;objet de votre module est d&#039;ajouter des fonctionnalités qui nécessitent de nouveaux écrans.&lt;br /&gt;
&lt;br /&gt;
=== Créer une page écran PHP brute ===&lt;br /&gt;
Vous pouvez ensuite créer vos pages PHP, qui se basent sur les données de vos tables, en utilisant les squelettes fournis comme exemple dans le répertoire &#039;&#039;&#039;modulebuilder&#039;&#039;&#039; (Pour le développement d&#039;un script en ligne de commande, voir [[Développement de scripts]]).&lt;br /&gt;
&lt;br /&gt;
Pour créer une nouvelle page écran utilisateur, créer un sous-répertoire de &#039;&#039;&#039;htdocs&#039;&#039;&#039; (si non déjà fait) propre à votre module (Dans &#039;&#039;&#039;htdocs/monmodule&#039;&#039;&#039; par exemple) afin d&#039;y placer les pages que vous aller créer.&lt;br /&gt;
&lt;br /&gt;
Y recopier le fichier &#039;&#039;&#039;myobject_page.php&#039;&#039;&#039; qui va servir de point de départ.&lt;br /&gt;
Modifier le fichier afin que le main.inc.php soit trouvés&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Load Dolibarr environment&lt;br /&gt;
$res=0;&lt;br /&gt;
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)&lt;br /&gt;
if (! $res &amp;amp;&amp;amp; ! empty($_SERVER[&amp;quot;CONTEXT_DOCUMENT_ROOT&amp;quot;])) $res=@include($_SERVER[&amp;quot;CONTEXT_DOCUMENT_ROOT&amp;quot;].&amp;quot;/main.inc.php&amp;quot;);&lt;br /&gt;
// Try main.inc.php into web root detected using web root caluclated from SCRIPT_FILENAME&lt;br /&gt;
$tmp=empty($_SERVER[&#039;SCRIPT_FILENAME&#039;])?&#039;&#039;:$_SERVER[&#039;SCRIPT_FILENAME&#039;];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1;&lt;br /&gt;
while($i &amp;gt; 0 &amp;amp;&amp;amp; $j &amp;gt; 0 &amp;amp;&amp;amp; isset($tmp[$i]) &amp;amp;&amp;amp; isset($tmp2[$j]) &amp;amp;&amp;amp; $tmp[$i]==$tmp2[$j]) { $i--; $j--; }&lt;br /&gt;
if (! $res &amp;amp;&amp;amp; $i &amp;gt; 0 &amp;amp;&amp;amp; file_exists(substr($tmp, 0, ($i+1)).&amp;quot;/main.inc.php&amp;quot;)) $res=@include(substr($tmp, 0, ($i+1)).&amp;quot;/main.inc.php&amp;quot;);&lt;br /&gt;
if (! $res &amp;amp;&amp;amp; $i &amp;gt; 0 &amp;amp;&amp;amp; file_exists(dirname(substr($tmp, 0, ($i+1))).&amp;quot;/main.inc.php&amp;quot;)) $res=@include(dirname(substr($tmp, 0, ($i+1))).&amp;quot;/main.inc.php&amp;quot;);&lt;br /&gt;
// Try main.inc.php using relative path&lt;br /&gt;
if (! $res &amp;amp;&amp;amp; file_exists(&amp;quot;../main.inc.php&amp;quot;)) $res=@include(&amp;quot;../main.inc.php&amp;quot;);&lt;br /&gt;
if (! $res &amp;amp;&amp;amp; file_exists(&amp;quot;../../main.inc.php&amp;quot;)) $res=@include(&amp;quot;../../main.inc.php&amp;quot;);&lt;br /&gt;
if (! $res &amp;amp;&amp;amp; file_exists(&amp;quot;../../../main.inc.php&amp;quot;)) $res=@include(&amp;quot;../../../main.inc.php&amp;quot;);&lt;br /&gt;
if (! $res) die(&amp;quot;Include of main fails&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Notez qu&#039;il est possible que vous deviez ajouter plus de &amp;quot;../&amp;quot; dans les chemin, en fonction de la profondeur de vos fichiers par rapport au répertoire de votre module.&lt;br /&gt;
&lt;br /&gt;
Pour tous les modules développés après la version 3.2 de Dolibarr, il convient de pouvoir placer un répertoire de module soit dans &#039;&#039;&#039;htdocs&#039;&#039;&#039; soit dans un sous répertoire comme &#039;&#039;&#039;htdocs/custom&#039;&#039;&#039; sans avoir à modifier le code source du module, c&#039;est pour cela que cette règle doit obligatoirement être appliquée.&lt;br /&gt;
&lt;br /&gt;
C&#039;est dans le main qu&#039;est chargé l&#039;environnement technique ainsi que les habilitations. Les variables objets suivantes sont alors positionnées:&lt;br /&gt;
&lt;br /&gt;
* $user    L&#039;objet qui contient les caractéristiques de l&#039;utilisateur + ses droits.&lt;br /&gt;
* $conf    L&#039;objet qui contient la configuration de Dolibarr.&lt;br /&gt;
* $db      L&#039;objet qui contient le handler de connexion ouvert à la base de données.&lt;br /&gt;
* $langs   L&#039;objet qui contient la langue de l&#039;utilisateur.&lt;br /&gt;
&lt;br /&gt;
* L&#039;inclusion d&#039;une classe ou librairie dédiée au module, sans savoir d&#039;où le fichier sera appelé, se fait en utilisant une fonction de Dolibarr (et non en utilisant directement le include_once)&lt;br /&gt;
&#039;&#039;Exemple :&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
dol_include_once(&#039;/monmodule/class/maclasse.class.php&#039;, &#039;MaClasse&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* L&#039;appel des classes fournies en standard avec Dolibarr se fera par contre par le require_once directe avec la syntaxe suivante:&lt;br /&gt;
&#039;&#039;Exemple :&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
require_once DOL_DOCUMENT_ROOT.&#039;/core/class/doli.class.php&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
La raison est que si le dol_include_once est pratique car il scanne chaque répertoire de chemin alternatifs pour trouver le fichier, il est aussi moins performant car génère des accès et recherches disque à chaque appel (en effet, PHP intègre un cache des fichiers lus mais n&#039;intègre pas un cache des fichiers &amp;quot;non trouvés&amp;quot;. Et comme un fichier donné n&#039;est que dans une seule arborescence, il y a toujours une arborescence alternative où il ne se trouve pas et qui génère des accès superflus au disque dur, pénalisant en terme de performance. Comme pour les fichiers internes à Dolibarr, on connait toujours le chemin exacte, le require_once avec ce chemin direct doit être préféré).&lt;br /&gt;
&lt;br /&gt;
=== Remplacer les parties d&#039;écrans templatés (version 3.3+) ===&lt;br /&gt;
Certaines portion d&#039;écran de Dolibarr sont isolés dans des fichiers templates.&lt;br /&gt;
Vous pouvez développer un module pour remplacer un ou plusieurs de ces templates par les vôtres.&lt;br /&gt;
{{ToComplete}}&lt;br /&gt;
&lt;br /&gt;
=== Accès à la base ===&lt;br /&gt;
Si vous avez besoin de réaliser des modifications en base dans votre propre table ajoutée, utilisez la classe générée plus haut qui contient les méthodes pour cela.&lt;br /&gt;
&lt;br /&gt;
Si toutefois vous voulez faire des accès dans des tables sans objet PHP dédié, ceci reste possible (par exemple pour récupérer une liste d&#039;enregistrement). Dans ce cas, pensez à suivre ces exemples:&lt;br /&gt;
&lt;br /&gt;
Pour un insert, update ou delete:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$db-&amp;gt;begin();   // Debut transaction&lt;br /&gt;
$db-&amp;gt;query(&amp;quot;Ma requete insert, update ou delete&amp;quot;);&lt;br /&gt;
$db-&amp;gt;commit();       // Valide&lt;br /&gt;
ou $db-&amp;gt;rollback()  // Annule&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pour une lecture:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$resql=$db-&amp;gt;query(&amp;quot;Ma requete select&amp;quot;);&lt;br /&gt;
if ($resql)&lt;br /&gt;
{&lt;br /&gt;
	$num = $db-&amp;gt;num_rows($resql);&lt;br /&gt;
	$i = 0;&lt;br /&gt;
	if ($num)&lt;br /&gt;
	{&lt;br /&gt;
		while ($i &amp;lt; $num)&lt;br /&gt;
		{&lt;br /&gt;
			$obj = $db-&amp;gt;fetch_object($resql);&lt;br /&gt;
			if ($obj)&lt;br /&gt;
			{&lt;br /&gt;
				// You can use here results&lt;br /&gt;
				print $obj-&amp;gt;field1;&lt;br /&gt;
				print $obj-&amp;gt;field2;&lt;br /&gt;
			}&lt;br /&gt;
			$i++;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Définition du style ===&lt;br /&gt;
Pour que le look de la page soit aligné avec le thème Dolibarr, il est nécessaire d&#039;utiliser les styles des CSS de Dolibarr.&lt;br /&gt;
&lt;br /&gt;
Par exemple:&lt;br /&gt;
&lt;br /&gt;
* class=&amp;quot;&#039;&#039;&#039;liste_titre&#039;&#039;&#039;&amp;quot; sur les balises &#039;&#039;tr&#039;&#039; et &#039;&#039;td&#039;&#039; pour une ligne de titre de tableau.&lt;br /&gt;
* class=&amp;quot;&#039;&#039;&#039;pair&#039;&#039;&#039;&amp;quot; ou class=&amp;quot;&#039;&#039;&#039;impair&#039;&#039;&#039;&amp;quot; sur les balises &#039;&#039;tr&#039;&#039; et &#039;&#039;td&#039;&#039; des lignes de données de tableau.&lt;br /&gt;
* class=&amp;quot;&#039;&#039;&#039;flat&#039;&#039;&#039;&amp;quot; sur tous les champs de saisie (&#039;&#039;input, select, textarea&#039;&#039;...).&lt;br /&gt;
* class=&amp;quot;&#039;&#039;&#039;button&#039;&#039;&#039;&amp;quot; sur les objets de type &#039;&#039;input type=&amp;quot;submit&amp;quot;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Utiliser le sélecteur de date de Dolibarr ===&lt;br /&gt;
Si vous le désirez, vous pouvez profiter du sélecteur de date dans des écrans Dolibarr. Pour cela, utilisez la ligne suivante:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$form=new Form($db);&lt;br /&gt;
$form-&amp;gt;select_date(&#039;&#039;,&#039;mykey&#039;,0,0,0,&amp;quot;myform&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
La chaine mykey identifie la zone date. Il faut y mettre une valeur différente s&#039;il y a plusieurs zones.&lt;br /&gt;
La chaine myform est le nom de la zone FORM (dans form name=&amp;quot;myform&amp;quot; de la page HTML).&lt;br /&gt;
L&#039;affichage d&#039;un sélecteur de date doit donc être intégrée dans une zone FORM Html.&lt;br /&gt;
&lt;br /&gt;
Pour récupérer la valeur, à l&#039;issu du POST, la commande est:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$mydate = dol_mktime(12, 0 , 0, $_POST[&#039;mykeymonth&#039;], $_POST[&#039;mykeyday&#039;], $_POST[&#039;mykeyyear&#039;]);&lt;br /&gt;
print strftime(&#039;%A %d %B %Y&#039;, $mydate);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Définir votre page de configuration (optionnel)  ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Si votre module offre plusieurs options paramétrables.&lt;br /&gt;
&lt;br /&gt;
=== Créer votre page d&#039;édition de configuration ===&lt;br /&gt;
Si votre module offre plusieurs options paramétrables, il est nécessaire de créer une page PHP pour éditer les options (qui sont stockées dans la [[Table llx_const|table &#039;&#039;&#039;llx_const&#039;&#039;&#039;]]).&lt;br /&gt;
Créer une page PHP nommée &#039;&#039;&#039;monmodule_setupapage.php&#039;&#039;&#039; qui affiche les options possibles et les met à jour.&lt;br /&gt;
Il est nécessaire de prendre exemple sur une page dans &#039;&#039;&#039;/admin&#039;&#039;&#039; qui vous montre la méthode pour lire ou sauvegarder en base votre option.&lt;br /&gt;
Placer cette page de configuration dans le répertoire &#039;&#039;&#039;/admin&#039;&#039;&#039; également.&lt;br /&gt;
Ensuite dans le descripteur de module, modifier la variable pour indiquer le nom de cette page PHP (sans le chemin qui n&#039;est pas nécessaire, la page étant forcément dans le rep admin).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;config_page_url = array(&amp;quot;monmodule_setupapage.php&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tester votre page ===&lt;br /&gt;
Allez sur la page &#039;&#039;&#039;Configuration-&amp;gt;module&#039;&#039;&#039;, vous devez voir apparaître une icône qui permet d&#039;accéder à la page de configuration et vous devez être capable de modifier ces options et les voir conservées en base.&lt;br /&gt;
&lt;br /&gt;
== Définir vos entrées de menu (optionnel) ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Si vous avez créé des pages PHP, il est nécessaire que ces écrans soient accessibles depuis le menu Dolibarr.&lt;br /&gt;
&lt;br /&gt;
=== Définissez vos entrées menus ===&lt;br /&gt;
Pour cela, il vous faut définir dans le fichier descripteur de module, le tableau this-&amp;gt;menu qui déclare les menus.&lt;br /&gt;
Ce tableau contient toutes les entrées qui apparaîtront dans les menus une fois le module activé.&lt;br /&gt;
Le fichier de descripteur de module exemple &#039;&#039;&#039;modMonModule.class.php&#039;&#039;&#039; possède un exemple de déclaration de menu haut ainsi que de ses entrées menu gauche associées.&lt;br /&gt;
&lt;br /&gt;
Voici un exemple de déclaration d&#039;entrées de menu dans le fichier descripteur:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Main menu entries&lt;br /&gt;
$this-&amp;gt;menu = array();			// List of menus to add&lt;br /&gt;
$r=0;&lt;br /&gt;
&lt;br /&gt;
// Add here entries to declare new menus&lt;br /&gt;
// Example to declare the Top Menu entry:&lt;br /&gt;
$this-&amp;gt;menu[$r]=array(	&#039;fk_menu&#039;=&amp;gt;0,			// Put 0 if this is a top menu&lt;br /&gt;
			&#039;type&#039;=&amp;gt;&#039;top&#039;,			// This is a Top menu entry&lt;br /&gt;
			&#039;titre&#039;=&amp;gt;&#039;MonModule top menu&#039;,&lt;br /&gt;
			&#039;mainmenu&#039;=&amp;gt;&#039;monmodule&#039;,&lt;br /&gt;
			&#039;leftmenu&#039;=&amp;gt;&#039;monmodule&#039;,&lt;br /&gt;
			&#039;url&#039;=&amp;gt;&#039;/monmodule/pagetop.php&#039;,&lt;br /&gt;
			&#039;langs&#039;=&amp;gt;&#039;mylangfile&#039;,	// Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.&lt;br /&gt;
			&#039;position&#039;=&amp;gt;100,&lt;br /&gt;
			&#039;enabled&#039;=&amp;gt;&#039;1&#039;,			// Define condition to show or hide menu entry. Use &#039;$conf-&amp;gt;monmodule-&amp;gt;enabled&#039; if entry must be visible if module is enabled.&lt;br /&gt;
			&#039;perms&#039;=&amp;gt;&#039;1&#039;,			// Use &#039;perms&#039;=&amp;gt;&#039;$user-&amp;gt;rights-&amp;gt;monmodule-&amp;gt;level1-&amp;gt;level2&#039; if you want your menu with a permission rules&lt;br /&gt;
			&#039;target&#039;=&amp;gt;&#039;&#039;,&lt;br /&gt;
			&#039;user&#039;=&amp;gt;2);				// 0=Menu for internal users, 1=external users, 2=both&lt;br /&gt;
$r++;&lt;br /&gt;
&lt;br /&gt;
// Example to declare a Left Menu entry:&lt;br /&gt;
$this-&amp;gt;menu[$r]=array(	&#039;fk_menu&#039;=&amp;gt;&#039;fk_mainmenu=xxx&#039;,	// Use &#039;fk_mainmenu=xxx&#039; or &#039;fk_mainmenu=xxx,fk_leftmenu=yyy&#039; where xxx is mainmenucode and yyy is a leftmenucode of parent menu&lt;br /&gt;
			&#039;type&#039;=&amp;gt;&#039;left&#039;,			// This is a Left menu entry&lt;br /&gt;
			&#039;titre&#039;=&amp;gt;&#039;MonModule left menu 1&#039;,&lt;br /&gt;
			&#039;mainmenu&#039;=&amp;gt;&#039;xxx&#039;,&lt;br /&gt;
                        &#039;leftmenu&#039;=&amp;gt;&#039;yyy&#039;,&lt;br /&gt;
			&#039;url&#039;=&amp;gt;&#039;/monmodule/pagelevel1.php&#039;,&lt;br /&gt;
			&#039;langs&#039;=&amp;gt;&#039;mylangfile&#039;,	// Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.&lt;br /&gt;
			&#039;position&#039;=&amp;gt;100,&lt;br /&gt;
			&#039;enabled&#039;=&amp;gt;&#039;1&#039;,			// Define condition to show or hide menu entry. Use &#039;$conf-&amp;gt;monmodule-&amp;gt;enabled&#039; if entry must be visible if module is enabled.&lt;br /&gt;
			&#039;perms&#039;=&amp;gt;&#039;1&#039;,			// Use &#039;perms&#039;=&amp;gt;&#039;$user-&amp;gt;rights-&amp;gt;monmodule-&amp;gt;level1-&amp;gt;level2&#039; if you want your menu with a permission rules&lt;br /&gt;
			&#039;target&#039;=&amp;gt;&#039;&#039;,&lt;br /&gt;
			&#039;user&#039;=&amp;gt;2);				// 0=Menu for internal users,1=external users, 2=both&lt;br /&gt;
$r++;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pour conditionner l&#039;accès au menu selon des permission, modifier la propriété &#039;&#039;&#039;perms&#039;&#039;&#039; du tableau. Voir le chapitre sur les permissions un peu plus loin pour savoir comment ajouter des permissions.&lt;br /&gt;
&lt;br /&gt;
=== Tester vos entrées menus ===&lt;br /&gt;
Désactiver et réactiver votre module sous Dolibarr, les entrées menus doivent alors apparaître (si la condition dans &#039;enabled&#039; est vraie).&lt;br /&gt;
&lt;br /&gt;
== Définir vos propres permissions (optionnel) ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Si vous voulez ajouter de nouvelles permissions.&lt;br /&gt;
&lt;br /&gt;
La définition des permissions que gérera votre module se fait dans le fichier descripteur créé dans la première étape.&lt;br /&gt;
Modifier la ligne &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;rights_class = &#039;monmodule&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
pour y mettre la bonne valeur de monmodule.&lt;br /&gt;
&lt;br /&gt;
Ensuite remplissez le tableau $this-&amp;gt;rights avec autant d&#039;entrées que de permissions différentes à gérer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;rights[$r][0] = 10001;&lt;br /&gt;
$this-&amp;gt;rights[$r][1] = &#039;Libelle par défaut de ma permission&#039;;&lt;br /&gt;
$this-&amp;gt;rights[$r][3] = 1;&lt;br /&gt;
$this-&amp;gt;rights[$r][4] = &#039;action&#039;;&lt;br /&gt;
$this-&amp;gt;rights[$r][5] = &#039;sousaction&#039;;&lt;br /&gt;
$r++;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dans $this-&amp;gt;rights[$r][0], mettre un id de permission non déjà pris (Voir dans le menu &#039;&#039;&#039;Infos Système&#039;&#039;&#039; sur une installation de Dolibarr opérationnelle pour connaitre les id déjà utilisés.&lt;br /&gt;
Dans $this-&amp;gt;rights[$r][3], mettre 1 si cette permission est attribué d&#039;office par défaut quand un utilisateur est créé.&lt;br /&gt;
Dans $this-&amp;gt;rights[$r][1], mettre un libellé par défaut (il sera affiché si aucune traduction n&#039;est trouvé pour votre permission dans le fichier &#039;&#039;&#039;admin.lang&#039;&#039;&#039;).&lt;br /&gt;
Dans $this-&amp;gt;rights[$r][4] et $this-&amp;gt;rights[$r][5], mettre une chaîne action et sousaction sans espaces. Vous pourrez alors tester dans le code PHP si un utilisateurs a bien les droits par la séquence suivante:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
if ($user-&amp;gt;rights-&amp;gt;monmodule-&amp;gt;action-&amp;gt;sousaction) ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Définir vos propres box (optionnel) ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Si votre module amène avec lui une ou plusieurs Boxes.&lt;br /&gt;
&lt;br /&gt;
=== Définissez vos box ===&lt;br /&gt;
Pour cela, modifiez les tableaux $this-&amp;gt;boxes du fichier descripteur de module.&lt;br /&gt;
Il suffit d&#039;ajouter 2 lignes par fichier box que vous allez créer dans le répertoire &#039;&#039;&#039;htdocs/monmodule/core/boxes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Exemple:&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;boxes[0][&#039;file&#039;]=&#039;mabox0.php@monmodule&#039;&lt;br /&gt;
$this-&amp;gt;boxes[0][&#039;note&#039;]=&#039;Ma box 0&#039;&lt;br /&gt;
 ...&lt;br /&gt;
$this-&amp;gt;boxes[n][&#039;file&#039;]=&#039;maboxn.php@monmodule&#039;&lt;br /&gt;
$this-&amp;gt;boxes[n][&#039;note&#039;]=&#039;Ma box n&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensuite créer les fichiers &#039;&#039;&#039;htdocs/monmodule/core/boxes/mabox0.php&#039;&#039;&#039;, &#039;&#039;&#039;htdocs/monmodule/core/boxes/mabox1.php&#039;&#039;&#039;... en prenant exemple sur des box existantes (exemple dans le répertoire &#039;&#039;&#039;htdocs/core/boxes&#039;&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
=== Tester la présence de vos box dans Dolibarr ===&lt;br /&gt;
Désactiver et réactiver le module.&lt;br /&gt;
&lt;br /&gt;
Aller dans le menu &#039;&#039;&#039;Accueil - Configuration - Boite&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Vos box doivent apparaître dans la liste des box activables. Activer les puis aller sur la page d&#039;accueil et vérifier qu&#039;elles s&#039;affichent correctement.&lt;br /&gt;
&lt;br /&gt;
== Définir vos propres exports (optionnel) ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Si votre module amène avec lui des exports prédéfini de données (pour ces propres tables ou des tables déjà existante d&#039;un autre module de Dolibarr).&lt;br /&gt;
&lt;br /&gt;
=== Définissez l&#039;export ===&lt;br /&gt;
Pour cela, décommenter et modifier les tableaux $this-&amp;gt;export_xxx du votre fichier descripteur de module.&lt;br /&gt;
&lt;br /&gt;
=== Tester votre export ===&lt;br /&gt;
Aller dans le menu outils -&amp;gt; export de Dolibarr. Votre export doit apparaitre dans la liste des exports prédéfinis disponible (si votre module est bien activé).&lt;br /&gt;
Le choisir, vous devez alors voir les champs possible définis dans le tableau à l&#039;étape précédente.&lt;br /&gt;
Choisir quelques champs et tenter une génération du fichier export.&lt;br /&gt;
&lt;br /&gt;
== Définir vos styles CSS (optionnel) ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Si dans vos écrans PHP, vous utiliser des classes de styles qui ne sont pas celle des thèmes de Dolibarr (non recommandé).&lt;br /&gt;
&lt;br /&gt;
Cette fonctionnalité est décrite mais pas encore opérationnel en 2.4&lt;br /&gt;
&lt;br /&gt;
=== Créer et déclarer votre feuille de style ===&lt;br /&gt;
Créer un fichier de style css nommé &#039;&#039;&#039;monmodule.css&#039;&#039;&#039; ou &#039;&#039;&#039;monmodule.css.php&#039;&#039;&#039; et le placer dans le répertoire &#039;&#039;&#039;&#039;&#039;monmodule&#039;&#039;&#039;&#039;&#039; dans &#039;&#039;&#039;htdocs&#039;&#039;&#039;. Il ne peut y avoir qu&#039;un fichier css propre à chaque module.&lt;br /&gt;
Rappelons qu&#039;il vaut mieux utiliser les styles déjà existant de Dolibarr (le fichier css utilisé par Dolibarr étant le fichier &#039;&#039;&#039;themes/nomtheme/&#039;&#039;nomtheme&#039;&#039;.css.php&#039;&#039;&#039;). Ne créer un fichier css propre à votre module que si vous devez absolument gérer des styles non déjà existants.&lt;br /&gt;
Une fois votre feuille de style prête, déclarer la dans votre fichier descripteur de module en modifiant la propriété &#039;&#039;&#039;$this-&amp;gt;module_parts&#039;&#039;&#039;.&lt;br /&gt;
La valeur à renseigner ici doit être le chemin relatif de l&#039;URL de votre fichier css.&lt;br /&gt;
Par exemple&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;module_parts = array(&#039;css&#039; =&amp;gt; array(&#039;/monmodule/css/monmodule.css.php&#039;));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tester votre feuille de style ===&lt;br /&gt;
Désactiver et réactiver votre module.&lt;br /&gt;
&lt;br /&gt;
Appelez la page d&#039;accueil de Dolibarr. Afficher la source de la page HTML.&lt;br /&gt;
&lt;br /&gt;
Vous devriez voir dans l&#039;entête HTML, une ligne déclarant votre feuille de style.&lt;br /&gt;
&lt;br /&gt;
== Définir vos fonctions Javascript (optionnel) ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Si dans vos écrans PHP, vous utiliser des fonctions javascript non dispo en standard (fichier lib_head.js)&lt;br /&gt;
&lt;br /&gt;
Si dans vos écrans PHP, vous utilisez des fonctions javascript, il est nécessaire de faire en sorte que vos fonctions déclarées dans un fichier javascript &#039;&#039;&#039;htdocs/monmodule/js/monmodule.js&#039;&#039;&#039; soit chargées dans l&#039;entête head html.&lt;br /&gt;
Pour demander à Dolibarr qui gère la génération de la section header d&#039;inclure un de vos fichiers javascript, il est nécessaire de fournir en paramètre de la fonction llxHeader() appelée au début de votre page, d&#039;inclure le paramètre qui contient l&#039;URL vers le js à inclure.&lt;br /&gt;
&lt;br /&gt;
Exemple pour la page /htdocs/monmodule/mapage.php :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
require(&#039;../main.inc.php&#039;);&lt;br /&gt;
$morejs=array(&amp;quot;/monmodule/js/monmodule.js&amp;quot;);&lt;br /&gt;
llxHeader(&#039;&#039;,&#039;Titre&#039;,&#039;&#039;,&#039;&#039;,&#039;&#039;,&#039;&#039;,$morejs,&#039;&#039;,0,0); &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Déclencher du code sur un évènement Dolibarr (optionnel) ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Si vous voulez que des actions particulières s&#039;exécutent suite au déclenchement d&#039;actions standards de Dolibarr (exemple: je veux mettre à jour une table de mon module quand une facture se crée dans Dolibarr), il vous faut créer un fichier de &#039;&#039;&#039;triggers&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Voir aussi [[Interfaces_Dolibarr_vers_exterieur|Interfaces de Dolibarr vers l&#039;exterieur]]&lt;br /&gt;
et [[Interfaces_Exterieur_vers_Dolibarr|Interfaces exterieures vers Dolibarr]]&lt;br /&gt;
&lt;br /&gt;
== Insérer votre code aux emplacement hooks de Dolibarr (optionnel) ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Quand vous voulez modifier ou ajouter du code autrement que lors d&#039;un événement métier (voir le chapitre précédent pour cela).&lt;br /&gt;
&lt;br /&gt;
Voir la page [[Système de Hooks]].&lt;br /&gt;
&lt;br /&gt;
== Ajouter un module de numérotation (optionnel) ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Lorsque vous voulez ajouter une règle de numérotation non couverte par les modules par défaut.&lt;br /&gt;
&lt;br /&gt;
Voir la page [[Créer un module de numérotation]].&lt;br /&gt;
&lt;br /&gt;
== Ajouter un nouveau modèle de document (optionnel) ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Lorsque vous voulez ajouter un nouveau modèle de document.&lt;br /&gt;
&lt;br /&gt;
La documentation au sujet de la génération de documents depuis des modèles est disponible sur la page [[Créer un modèle de document PDF]] ou [[Créer un modèle de document ODT]].&lt;br /&gt;
&lt;br /&gt;
== Ajouter un thème (optionnel) ==&lt;br /&gt;
&#039;&#039;&#039;Quand&#039;&#039;&#039;: Lorsque vous voulez une interface aux couleurs personnalisées à votre cas.&lt;br /&gt;
&lt;br /&gt;
Voir la page [[Themes]].&lt;br /&gt;
&lt;br /&gt;
= [[File:Art.png]] Quelques règles de codage et fonctions pour développeurs =&lt;br /&gt;
Les règles de codage à suivre sont définis dans la [[Documentation Développeur|Documentation développeur]], rubrique &amp;quot;Informations Générales - Langage et normes de développement&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
De nombreuses fonctions prédéfinies pour les développeurs sont disponibles et décrites sur la page [[Documentation Développeur|Documentation développeur]] sous la section &amp;quot;Les couches techniques de Dolibarr&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= [[File:Art.png]] Utilisation du MDA =&lt;br /&gt;
Une méthode pour générer un module fonctionnel depuis l&#039;UML est en cours de mise au point. Plus d&#039;informations sur la page [[UML2Dolibarr - Générer un module par MDA]].&lt;br /&gt;
&lt;br /&gt;
= [[File:Art.png]] Créer un package pour livrer et installer votre module =&lt;br /&gt;
Cette procédure doit être utilisé pour fabriquer un package afin de le soumettre sur la place de marché http://www.dolistore.com.&lt;br /&gt;
Mais vous pouvez aussi l&#039;utiliser pour distribuer facillement votre module via votre propre réseau de distribution.&lt;br /&gt;
&lt;br /&gt;
* Aller dans le répertoire &#039;&#039;&#039;/build&#039;&#039;&#039; et recopier le fichier &#039;&#039;&#039;makepack-dolibarrmodules.conf&#039;&#039;&#039; en &#039;&#039;&#039;makepack-monmodule.conf&#039;&#039;&#039;. Attention, ce répertoire peut ne pas être fourni dans les packages de versions stables. Si c&#039;est le cas, il peut être récupéré dans le snapshot disponible en téléchargement sur le site web Dolibarr dans la rubrique Version de développement (prendre dans ce cas tout le répertoire build qui est un répertoire autonome et indépendant de la version).&lt;br /&gt;
Saisissez dans ce fichier la liste des noms des nouveaux fichiers que vous avez créé pour votre module (descripteur de module, nouveaux fichiers sql de tables, page php, images, etc...)&lt;br /&gt;
&lt;br /&gt;
* Lancer le script via Perl (besoin de la version Perl 5.0 ou +):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
perl makepack-dolibarrmodule.pl&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Le script vous demande le nom de votre module, sa version majeure et mineure.&lt;br /&gt;
Un fichier &#039;&#039;&#039;monmodule.zip&#039;&#039;&#039; va alors être fabriqué contenant votre module prêt pour être déployé.&lt;br /&gt;
&lt;br /&gt;
* La personne qui reçoit votre module doit alors placer le fichier dans son répertoire racine d&#039;installation de Dolibarr et réaliser la commande:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar -xvf monmodule.zip&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Si vous désirez que votre module profite à tous, vous pouvez le soumettre (le fichier zip) sur la place de marché des modules complémentaires: {{LinkToPluginDownload}} (vous devez avoir créer un compte auparavant et utiliser le lien &amp;quot;Soumettre un module/produit&amp;quot;).&lt;br /&gt;
** Si votre module a été fabriqué correctement, le fichier sera validé rapidement.&lt;br /&gt;
** Si la qualité est suffisante, que la licence le permet et que la fonctionnalité du module s&#039;avère être d&#039;un intérêt général, le code pourra être ajouté au code source de Dolibarr (sauf si vous ne le désirez pas).&lt;br /&gt;
&lt;br /&gt;
= [[File:Art.png]] Validation/activation du module externe sur Dolistore =&lt;br /&gt;
&lt;br /&gt;
Voir [[Module_Dolistore_Validation_Regles|Règles de Validation]]&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=37578</id>
		<title>Module Timesheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=37578"/>
		<updated>2017-08-14T08:39:04Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: /* Manual */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:timesheet]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
&amp;lt;keywords content=&amp;quot;timesheet, Dolibarr,  interface, project, task, report, approval&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=timesheet&lt;br /&gt;
|editor=delcroip&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=timesheet}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=projects&lt;br /&gt;
|minversion=3.5.0&lt;br /&gt;
|maxversion=6.0&lt;br /&gt;
|note=Latest Module version: 2.0.1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Manual =&lt;br /&gt;
[https://wiki.dolibarr.org/upload/b/bd/Module_timesheet.pdf Timesheet 1.5.1 manual]&lt;br /&gt;
&lt;br /&gt;
[https://wiki.dolibarr.org/upload/4/45/Module_timesheet_2.0.pdf Timesheet 2.0.1 manual]&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
&lt;br /&gt;
 - Timesheet interface for all the user task per week&lt;br /&gt;
 - Generate report on user and on project per month&lt;br /&gt;
 - favourties to show only some project/task by a simple click on a start icon next to the task name&lt;br /&gt;
 - Approval of the timesheets per the N+1&lt;br /&gt;
 - Approval of the timesheets per project manager&lt;br /&gt;
 - Generate project invoice from timesheet data&lt;br /&gt;
&lt;br /&gt;
 [[File:timesheet_timeentry.jpg]]&lt;br /&gt;
&lt;br /&gt;
= Change logs = &lt;br /&gt;
2.0.1 Change log from 2.0&lt;br /&gt;
 * Project approval corrected (for non admin no approval was shown)&lt;br /&gt;
 * PHP warning removed&lt;br /&gt;
 * Home timesheet box correted (was not showing the # of timesheet to approve)&lt;br /&gt;
&lt;br /&gt;
2.0 Change log from 1.5.1&lt;br /&gt;
 * Week on two month are spliced to enable monthly approval&lt;br /&gt;
 * Chained approval for team &amp;amp; project.&lt;br /&gt;
 * Create invoice with ad-hoc and already defined service based on time saved.&lt;br /&gt;
 * Report always shows time in day and hours&lt;br /&gt;
 * Layout change for the setup page&lt;br /&gt;
 * Layout change for the favorite handling&lt;br /&gt;
 * Email are sent to user when a timesheet is rejected by the team leader&lt;br /&gt;
 * Note on task are shown as info when hoovering over the task line&lt;br /&gt;
 * Searchbox are available instead of dropdown list (use other core module setup).&lt;br /&gt;
 * More translation (ES, DE, IT, FR, US , mostly automated)&lt;br /&gt;
 * Note editing available for each tasks (also in the approval flow)&lt;br /&gt;
&lt;br /&gt;
Change log from 1.5&lt;br /&gt;
 * Support dolibarr 4.0.1&lt;br /&gt;
 * Hidden option to join file to timesheets via the setting TIMESHEET_ADD_DOCS&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4.3:&lt;br /&gt;
 * Timesheet approval by N+1,&lt;br /&gt;
 * Reminder (email) for to be approved timesheet possible through dolibarr planned tasks&lt;br /&gt;
 * admin wiew for the Approval (change a approval status outside the normal approval flow)&lt;br /&gt;
 * Home box with the pending timesheet to be approved&lt;br /&gt;
 * Blocking some weekdays (e.g week ends)&lt;br /&gt;
 * Holiday showed in the timesheet&lt;br /&gt;
 * Holiday time can be included in the timesheet totals&lt;br /&gt;
 * Typo correction for French.&lt;br /&gt;
 * Posibility to add a note&lt;br /&gt;
 * Compatible with dolibarr 3.9.2&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4.1:&lt;br /&gt;
&lt;br /&gt;
 * Correction of the Spanish language (thanks to vinclar)&lt;br /&gt;
 * Possible to deactivate the dolibarr Ajax for the dropdown list for the setup page (in case of issue to add whitelist)&lt;br /&gt;
 * Keep the whitlistmode after submit / go to date / next / previsous week&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4:&lt;br /&gt;
 * Bugfix for the tasktime date in the project page&lt;br /&gt;
 * Link to have the different whitelist behaviour (black list, and none)&lt;br /&gt;
 * Spanish language (google trad)&lt;br /&gt;
 * Typo correction for French&lt;br /&gt;
 * Support the print mode for timesheet &amp;amp; the report&lt;br /&gt;
 * Show the project open to everyone on the new whitelist page&lt;br /&gt;
&lt;br /&gt;
Change log from 1.3.7:&lt;br /&gt;
 * layout improvement: timesheet, setup page, reports&lt;br /&gt;
 * whitelist to show only some project/task&lt;br /&gt;
 * taslk column customisation&lt;br /&gt;
 * new task column: company, parent task&lt;br /&gt;
 * new report option: report all, export friendly layout&lt;br /&gt;
 * user report available for the N-2, N-3&lt;br /&gt;
 &lt;br /&gt;
Change log from 1.3.6:&lt;br /&gt;
 * compatible avec dolibarr 3.7&lt;br /&gt;
 * Change log from 1.3.3:&lt;br /&gt;
 * Works with PHP&amp;lt;=5.3&lt;br /&gt;
 * Possibility to remove the 0:00&lt;br /&gt;
 * Color code for already filled tasktime / new tasktime and error&lt;br /&gt;
 * Bux fixes in the report&lt;br /&gt;
 * Better date dialog&lt;br /&gt;
 * N+1 is able to check the user report of his N&#039;s&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=37577</id>
		<title>Module Timesheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=37577"/>
		<updated>2017-08-14T08:38:44Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: /* Informations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:timesheet]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
&amp;lt;keywords content=&amp;quot;timesheet, Dolibarr,  interface, project, task, report, approval&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=timesheet&lt;br /&gt;
|editor=delcroip&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=timesheet}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=projects&lt;br /&gt;
|minversion=3.5.0&lt;br /&gt;
|maxversion=6.0&lt;br /&gt;
|note=Latest Module version: 2.0.1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Manual =&lt;br /&gt;
[https://wiki.dolibarr.org/upload/b/bd/Module_timesheet.pdf Timesheet 1.5 manual]&lt;br /&gt;
&lt;br /&gt;
[https://wiki.dolibarr.org/upload/4/45/Module_timesheet_2.0.pdf Timesheet 2.0.1 manual]&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
&lt;br /&gt;
 - Timesheet interface for all the user task per week&lt;br /&gt;
 - Generate report on user and on project per month&lt;br /&gt;
 - favourties to show only some project/task by a simple click on a start icon next to the task name&lt;br /&gt;
 - Approval of the timesheets per the N+1&lt;br /&gt;
 - Approval of the timesheets per project manager&lt;br /&gt;
 - Generate project invoice from timesheet data&lt;br /&gt;
&lt;br /&gt;
 [[File:timesheet_timeentry.jpg]]&lt;br /&gt;
&lt;br /&gt;
= Change logs = &lt;br /&gt;
2.0.1 Change log from 2.0&lt;br /&gt;
 * Project approval corrected (for non admin no approval was shown)&lt;br /&gt;
 * PHP warning removed&lt;br /&gt;
 * Home timesheet box correted (was not showing the # of timesheet to approve)&lt;br /&gt;
&lt;br /&gt;
2.0 Change log from 1.5.1&lt;br /&gt;
 * Week on two month are spliced to enable monthly approval&lt;br /&gt;
 * Chained approval for team &amp;amp; project.&lt;br /&gt;
 * Create invoice with ad-hoc and already defined service based on time saved.&lt;br /&gt;
 * Report always shows time in day and hours&lt;br /&gt;
 * Layout change for the setup page&lt;br /&gt;
 * Layout change for the favorite handling&lt;br /&gt;
 * Email are sent to user when a timesheet is rejected by the team leader&lt;br /&gt;
 * Note on task are shown as info when hoovering over the task line&lt;br /&gt;
 * Searchbox are available instead of dropdown list (use other core module setup).&lt;br /&gt;
 * More translation (ES, DE, IT, FR, US , mostly automated)&lt;br /&gt;
 * Note editing available for each tasks (also in the approval flow)&lt;br /&gt;
&lt;br /&gt;
Change log from 1.5&lt;br /&gt;
 * Support dolibarr 4.0.1&lt;br /&gt;
 * Hidden option to join file to timesheets via the setting TIMESHEET_ADD_DOCS&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4.3:&lt;br /&gt;
 * Timesheet approval by N+1,&lt;br /&gt;
 * Reminder (email) for to be approved timesheet possible through dolibarr planned tasks&lt;br /&gt;
 * admin wiew for the Approval (change a approval status outside the normal approval flow)&lt;br /&gt;
 * Home box with the pending timesheet to be approved&lt;br /&gt;
 * Blocking some weekdays (e.g week ends)&lt;br /&gt;
 * Holiday showed in the timesheet&lt;br /&gt;
 * Holiday time can be included in the timesheet totals&lt;br /&gt;
 * Typo correction for French.&lt;br /&gt;
 * Posibility to add a note&lt;br /&gt;
 * Compatible with dolibarr 3.9.2&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4.1:&lt;br /&gt;
&lt;br /&gt;
 * Correction of the Spanish language (thanks to vinclar)&lt;br /&gt;
 * Possible to deactivate the dolibarr Ajax for the dropdown list for the setup page (in case of issue to add whitelist)&lt;br /&gt;
 * Keep the whitlistmode after submit / go to date / next / previsous week&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4:&lt;br /&gt;
 * Bugfix for the tasktime date in the project page&lt;br /&gt;
 * Link to have the different whitelist behaviour (black list, and none)&lt;br /&gt;
 * Spanish language (google trad)&lt;br /&gt;
 * Typo correction for French&lt;br /&gt;
 * Support the print mode for timesheet &amp;amp; the report&lt;br /&gt;
 * Show the project open to everyone on the new whitelist page&lt;br /&gt;
&lt;br /&gt;
Change log from 1.3.7:&lt;br /&gt;
 * layout improvement: timesheet, setup page, reports&lt;br /&gt;
 * whitelist to show only some project/task&lt;br /&gt;
 * taslk column customisation&lt;br /&gt;
 * new task column: company, parent task&lt;br /&gt;
 * new report option: report all, export friendly layout&lt;br /&gt;
 * user report available for the N-2, N-3&lt;br /&gt;
 &lt;br /&gt;
Change log from 1.3.6:&lt;br /&gt;
 * compatible avec dolibarr 3.7&lt;br /&gt;
 * Change log from 1.3.3:&lt;br /&gt;
 * Works with PHP&amp;lt;=5.3&lt;br /&gt;
 * Possibility to remove the 0:00&lt;br /&gt;
 * Color code for already filled tasktime / new tasktime and error&lt;br /&gt;
 * Bux fixes in the report&lt;br /&gt;
 * Better date dialog&lt;br /&gt;
 * N+1 is able to check the user report of his N&#039;s&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=37576</id>
		<title>Module Timesheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=37576"/>
		<updated>2017-08-14T08:38:13Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: /* Features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:timesheet]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
&amp;lt;keywords content=&amp;quot;timesheet, Dolibarr,  interface, project, task, report, approval&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=timesheet&lt;br /&gt;
|editor=delcroip&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=timesheet}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=projects&lt;br /&gt;
|minversion=3.5.0&lt;br /&gt;
|maxversion=4.0.4&lt;br /&gt;
|note=Latest Module version: 1.5.1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Manual =&lt;br /&gt;
[https://wiki.dolibarr.org/upload/b/bd/Module_timesheet.pdf Timesheet 1.5 manual]&lt;br /&gt;
&lt;br /&gt;
[https://wiki.dolibarr.org/upload/4/45/Module_timesheet_2.0.pdf Timesheet 2.0.1 manual]&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
&lt;br /&gt;
 - Timesheet interface for all the user task per week&lt;br /&gt;
 - Generate report on user and on project per month&lt;br /&gt;
 - favourties to show only some project/task by a simple click on a start icon next to the task name&lt;br /&gt;
 - Approval of the timesheets per the N+1&lt;br /&gt;
 - Approval of the timesheets per project manager&lt;br /&gt;
 - Generate project invoice from timesheet data&lt;br /&gt;
&lt;br /&gt;
 [[File:timesheet_timeentry.jpg]]&lt;br /&gt;
&lt;br /&gt;
= Change logs = &lt;br /&gt;
2.0.1 Change log from 2.0&lt;br /&gt;
 * Project approval corrected (for non admin no approval was shown)&lt;br /&gt;
 * PHP warning removed&lt;br /&gt;
 * Home timesheet box correted (was not showing the # of timesheet to approve)&lt;br /&gt;
&lt;br /&gt;
2.0 Change log from 1.5.1&lt;br /&gt;
 * Week on two month are spliced to enable monthly approval&lt;br /&gt;
 * Chained approval for team &amp;amp; project.&lt;br /&gt;
 * Create invoice with ad-hoc and already defined service based on time saved.&lt;br /&gt;
 * Report always shows time in day and hours&lt;br /&gt;
 * Layout change for the setup page&lt;br /&gt;
 * Layout change for the favorite handling&lt;br /&gt;
 * Email are sent to user when a timesheet is rejected by the team leader&lt;br /&gt;
 * Note on task are shown as info when hoovering over the task line&lt;br /&gt;
 * Searchbox are available instead of dropdown list (use other core module setup).&lt;br /&gt;
 * More translation (ES, DE, IT, FR, US , mostly automated)&lt;br /&gt;
 * Note editing available for each tasks (also in the approval flow)&lt;br /&gt;
&lt;br /&gt;
Change log from 1.5&lt;br /&gt;
 * Support dolibarr 4.0.1&lt;br /&gt;
 * Hidden option to join file to timesheets via the setting TIMESHEET_ADD_DOCS&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4.3:&lt;br /&gt;
 * Timesheet approval by N+1,&lt;br /&gt;
 * Reminder (email) for to be approved timesheet possible through dolibarr planned tasks&lt;br /&gt;
 * admin wiew for the Approval (change a approval status outside the normal approval flow)&lt;br /&gt;
 * Home box with the pending timesheet to be approved&lt;br /&gt;
 * Blocking some weekdays (e.g week ends)&lt;br /&gt;
 * Holiday showed in the timesheet&lt;br /&gt;
 * Holiday time can be included in the timesheet totals&lt;br /&gt;
 * Typo correction for French.&lt;br /&gt;
 * Posibility to add a note&lt;br /&gt;
 * Compatible with dolibarr 3.9.2&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4.1:&lt;br /&gt;
&lt;br /&gt;
 * Correction of the Spanish language (thanks to vinclar)&lt;br /&gt;
 * Possible to deactivate the dolibarr Ajax for the dropdown list for the setup page (in case of issue to add whitelist)&lt;br /&gt;
 * Keep the whitlistmode after submit / go to date / next / previsous week&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4:&lt;br /&gt;
 * Bugfix for the tasktime date in the project page&lt;br /&gt;
 * Link to have the different whitelist behaviour (black list, and none)&lt;br /&gt;
 * Spanish language (google trad)&lt;br /&gt;
 * Typo correction for French&lt;br /&gt;
 * Support the print mode for timesheet &amp;amp; the report&lt;br /&gt;
 * Show the project open to everyone on the new whitelist page&lt;br /&gt;
&lt;br /&gt;
Change log from 1.3.7:&lt;br /&gt;
 * layout improvement: timesheet, setup page, reports&lt;br /&gt;
 * whitelist to show only some project/task&lt;br /&gt;
 * taslk column customisation&lt;br /&gt;
 * new task column: company, parent task&lt;br /&gt;
 * new report option: report all, export friendly layout&lt;br /&gt;
 * user report available for the N-2, N-3&lt;br /&gt;
 &lt;br /&gt;
Change log from 1.3.6:&lt;br /&gt;
 * compatible avec dolibarr 3.7&lt;br /&gt;
 * Change log from 1.3.3:&lt;br /&gt;
 * Works with PHP&amp;lt;=5.3&lt;br /&gt;
 * Possibility to remove the 0:00&lt;br /&gt;
 * Color code for already filled tasktime / new tasktime and error&lt;br /&gt;
 * Bux fixes in the report&lt;br /&gt;
 * Better date dialog&lt;br /&gt;
 * N+1 is able to check the user report of his N&#039;s&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=37575</id>
		<title>Module Timesheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=37575"/>
		<updated>2017-08-14T08:36:17Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: /* Manual */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:timesheet]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
&amp;lt;keywords content=&amp;quot;timesheet, Dolibarr,  interface, project, task, report, approval&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=timesheet&lt;br /&gt;
|editor=delcroip&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=timesheet}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=projects&lt;br /&gt;
|minversion=3.5.0&lt;br /&gt;
|maxversion=4.0.4&lt;br /&gt;
|note=Latest Module version: 1.5.1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Manual =&lt;br /&gt;
[https://wiki.dolibarr.org/upload/b/bd/Module_timesheet.pdf Timesheet 1.5 manual]&lt;br /&gt;
&lt;br /&gt;
[https://wiki.dolibarr.org/upload/4/45/Module_timesheet_2.0.pdf Timesheet 2.0.1 manual]&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
&lt;br /&gt;
 - Timesheet interface for all the user task per week&lt;br /&gt;
 - Generate report on user and on project per month&lt;br /&gt;
 - whitelist to show only some project/task (if no whitelist define all task are showed)&lt;br /&gt;
 - Approval of the timesheets per the N+1&lt;br /&gt;
&lt;br /&gt;
 [[File:timesheet_timeentry.jpg]]&lt;br /&gt;
&lt;br /&gt;
= Change logs = &lt;br /&gt;
2.0.1 Change log from 2.0&lt;br /&gt;
 * Project approval corrected (for non admin no approval was shown)&lt;br /&gt;
 * PHP warning removed&lt;br /&gt;
 * Home timesheet box correted (was not showing the # of timesheet to approve)&lt;br /&gt;
&lt;br /&gt;
2.0 Change log from 1.5.1&lt;br /&gt;
 * Week on two month are spliced to enable monthly approval&lt;br /&gt;
 * Chained approval for team &amp;amp; project.&lt;br /&gt;
 * Create invoice with ad-hoc and already defined service based on time saved.&lt;br /&gt;
 * Report always shows time in day and hours&lt;br /&gt;
 * Layout change for the setup page&lt;br /&gt;
 * Layout change for the favorite handling&lt;br /&gt;
 * Email are sent to user when a timesheet is rejected by the team leader&lt;br /&gt;
 * Note on task are shown as info when hoovering over the task line&lt;br /&gt;
 * Searchbox are available instead of dropdown list (use other core module setup).&lt;br /&gt;
 * More translation (ES, DE, IT, FR, US , mostly automated)&lt;br /&gt;
 * Note editing available for each tasks (also in the approval flow)&lt;br /&gt;
&lt;br /&gt;
Change log from 1.5&lt;br /&gt;
 * Support dolibarr 4.0.1&lt;br /&gt;
 * Hidden option to join file to timesheets via the setting TIMESHEET_ADD_DOCS&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4.3:&lt;br /&gt;
 * Timesheet approval by N+1,&lt;br /&gt;
 * Reminder (email) for to be approved timesheet possible through dolibarr planned tasks&lt;br /&gt;
 * admin wiew for the Approval (change a approval status outside the normal approval flow)&lt;br /&gt;
 * Home box with the pending timesheet to be approved&lt;br /&gt;
 * Blocking some weekdays (e.g week ends)&lt;br /&gt;
 * Holiday showed in the timesheet&lt;br /&gt;
 * Holiday time can be included in the timesheet totals&lt;br /&gt;
 * Typo correction for French.&lt;br /&gt;
 * Posibility to add a note&lt;br /&gt;
 * Compatible with dolibarr 3.9.2&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4.1:&lt;br /&gt;
&lt;br /&gt;
 * Correction of the Spanish language (thanks to vinclar)&lt;br /&gt;
 * Possible to deactivate the dolibarr Ajax for the dropdown list for the setup page (in case of issue to add whitelist)&lt;br /&gt;
 * Keep the whitlistmode after submit / go to date / next / previsous week&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4:&lt;br /&gt;
 * Bugfix for the tasktime date in the project page&lt;br /&gt;
 * Link to have the different whitelist behaviour (black list, and none)&lt;br /&gt;
 * Spanish language (google trad)&lt;br /&gt;
 * Typo correction for French&lt;br /&gt;
 * Support the print mode for timesheet &amp;amp; the report&lt;br /&gt;
 * Show the project open to everyone on the new whitelist page&lt;br /&gt;
&lt;br /&gt;
Change log from 1.3.7:&lt;br /&gt;
 * layout improvement: timesheet, setup page, reports&lt;br /&gt;
 * whitelist to show only some project/task&lt;br /&gt;
 * taslk column customisation&lt;br /&gt;
 * new task column: company, parent task&lt;br /&gt;
 * new report option: report all, export friendly layout&lt;br /&gt;
 * user report available for the N-2, N-3&lt;br /&gt;
 &lt;br /&gt;
Change log from 1.3.6:&lt;br /&gt;
 * compatible avec dolibarr 3.7&lt;br /&gt;
 * Change log from 1.3.3:&lt;br /&gt;
 * Works with PHP&amp;lt;=5.3&lt;br /&gt;
 * Possibility to remove the 0:00&lt;br /&gt;
 * Color code for already filled tasktime / new tasktime and error&lt;br /&gt;
 * Bux fixes in the report&lt;br /&gt;
 * Better date dialog&lt;br /&gt;
 * N+1 is able to check the user report of his N&#039;s&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=37574</id>
		<title>Module Timesheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=37574"/>
		<updated>2017-08-14T08:35:58Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: /* Manual */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:timesheet]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
&amp;lt;keywords content=&amp;quot;timesheet, Dolibarr,  interface, project, task, report, approval&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=timesheet&lt;br /&gt;
|editor=delcroip&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=timesheet}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=projects&lt;br /&gt;
|minversion=3.5.0&lt;br /&gt;
|maxversion=4.0.4&lt;br /&gt;
|note=Latest Module version: 1.5.1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Manual =&lt;br /&gt;
[https://wiki.dolibarr.org/upload/b/bd/Module_timesheet.pdf Timesheet 1.5 manual]&lt;br /&gt;
[https://wiki.dolibarr.org/upload/4/45/Module_timesheet_2.0.pdf Timesheet 2.0.1 manual]&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
&lt;br /&gt;
 - Timesheet interface for all the user task per week&lt;br /&gt;
 - Generate report on user and on project per month&lt;br /&gt;
 - whitelist to show only some project/task (if no whitelist define all task are showed)&lt;br /&gt;
 - Approval of the timesheets per the N+1&lt;br /&gt;
&lt;br /&gt;
 [[File:timesheet_timeentry.jpg]]&lt;br /&gt;
&lt;br /&gt;
= Change logs = &lt;br /&gt;
2.0.1 Change log from 2.0&lt;br /&gt;
 * Project approval corrected (for non admin no approval was shown)&lt;br /&gt;
 * PHP warning removed&lt;br /&gt;
 * Home timesheet box correted (was not showing the # of timesheet to approve)&lt;br /&gt;
&lt;br /&gt;
2.0 Change log from 1.5.1&lt;br /&gt;
 * Week on two month are spliced to enable monthly approval&lt;br /&gt;
 * Chained approval for team &amp;amp; project.&lt;br /&gt;
 * Create invoice with ad-hoc and already defined service based on time saved.&lt;br /&gt;
 * Report always shows time in day and hours&lt;br /&gt;
 * Layout change for the setup page&lt;br /&gt;
 * Layout change for the favorite handling&lt;br /&gt;
 * Email are sent to user when a timesheet is rejected by the team leader&lt;br /&gt;
 * Note on task are shown as info when hoovering over the task line&lt;br /&gt;
 * Searchbox are available instead of dropdown list (use other core module setup).&lt;br /&gt;
 * More translation (ES, DE, IT, FR, US , mostly automated)&lt;br /&gt;
 * Note editing available for each tasks (also in the approval flow)&lt;br /&gt;
&lt;br /&gt;
Change log from 1.5&lt;br /&gt;
 * Support dolibarr 4.0.1&lt;br /&gt;
 * Hidden option to join file to timesheets via the setting TIMESHEET_ADD_DOCS&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4.3:&lt;br /&gt;
 * Timesheet approval by N+1,&lt;br /&gt;
 * Reminder (email) for to be approved timesheet possible through dolibarr planned tasks&lt;br /&gt;
 * admin wiew for the Approval (change a approval status outside the normal approval flow)&lt;br /&gt;
 * Home box with the pending timesheet to be approved&lt;br /&gt;
 * Blocking some weekdays (e.g week ends)&lt;br /&gt;
 * Holiday showed in the timesheet&lt;br /&gt;
 * Holiday time can be included in the timesheet totals&lt;br /&gt;
 * Typo correction for French.&lt;br /&gt;
 * Posibility to add a note&lt;br /&gt;
 * Compatible with dolibarr 3.9.2&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4.1:&lt;br /&gt;
&lt;br /&gt;
 * Correction of the Spanish language (thanks to vinclar)&lt;br /&gt;
 * Possible to deactivate the dolibarr Ajax for the dropdown list for the setup page (in case of issue to add whitelist)&lt;br /&gt;
 * Keep the whitlistmode after submit / go to date / next / previsous week&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4:&lt;br /&gt;
 * Bugfix for the tasktime date in the project page&lt;br /&gt;
 * Link to have the different whitelist behaviour (black list, and none)&lt;br /&gt;
 * Spanish language (google trad)&lt;br /&gt;
 * Typo correction for French&lt;br /&gt;
 * Support the print mode for timesheet &amp;amp; the report&lt;br /&gt;
 * Show the project open to everyone on the new whitelist page&lt;br /&gt;
&lt;br /&gt;
Change log from 1.3.7:&lt;br /&gt;
 * layout improvement: timesheet, setup page, reports&lt;br /&gt;
 * whitelist to show only some project/task&lt;br /&gt;
 * taslk column customisation&lt;br /&gt;
 * new task column: company, parent task&lt;br /&gt;
 * new report option: report all, export friendly layout&lt;br /&gt;
 * user report available for the N-2, N-3&lt;br /&gt;
 &lt;br /&gt;
Change log from 1.3.6:&lt;br /&gt;
 * compatible avec dolibarr 3.7&lt;br /&gt;
 * Change log from 1.3.3:&lt;br /&gt;
 * Works with PHP&amp;lt;=5.3&lt;br /&gt;
 * Possibility to remove the 0:00&lt;br /&gt;
 * Color code for already filled tasktime / new tasktime and error&lt;br /&gt;
 * Bux fixes in the report&lt;br /&gt;
 * Better date dialog&lt;br /&gt;
 * N+1 is able to check the user report of his N&#039;s&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=37572</id>
		<title>Module Timesheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=37572"/>
		<updated>2017-08-14T08:32:46Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: /* Change logs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:timesheet]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
&amp;lt;keywords content=&amp;quot;timesheet, Dolibarr,  interface, project, task, report, approval&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=timesheet&lt;br /&gt;
|editor=delcroip&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=timesheet}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=projects&lt;br /&gt;
|minversion=3.5.0&lt;br /&gt;
|maxversion=4.0.4&lt;br /&gt;
|note=Latest Module version: 1.5.1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Manual =&lt;br /&gt;
[https://wiki.dolibarr.org/upload/b/bd/Module_timesheet.pdf manual]&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
&lt;br /&gt;
 - Timesheet interface for all the user task per week&lt;br /&gt;
 - Generate report on user and on project per month&lt;br /&gt;
 - whitelist to show only some project/task (if no whitelist define all task are showed)&lt;br /&gt;
 - Approval of the timesheets per the N+1&lt;br /&gt;
&lt;br /&gt;
 [[File:timesheet_timeentry.jpg]]&lt;br /&gt;
&lt;br /&gt;
= Change logs = &lt;br /&gt;
2.0.1 Change log from 2.0&lt;br /&gt;
 * Project approval corrected (for non admin no approval was shown)&lt;br /&gt;
 * PHP warning removed&lt;br /&gt;
 * Home timesheet box correted (was not showing the # of timesheet to approve)&lt;br /&gt;
&lt;br /&gt;
2.0 Change log from 1.5.1&lt;br /&gt;
 * Week on two month are spliced to enable monthly approval&lt;br /&gt;
 * Chained approval for team &amp;amp; project.&lt;br /&gt;
 * Create invoice with ad-hoc and already defined service based on time saved.&lt;br /&gt;
 * Report always shows time in day and hours&lt;br /&gt;
 * Layout change for the setup page&lt;br /&gt;
 * Layout change for the favorite handling&lt;br /&gt;
 * Email are sent to user when a timesheet is rejected by the team leader&lt;br /&gt;
 * Note on task are shown as info when hoovering over the task line&lt;br /&gt;
 * Searchbox are available instead of dropdown list (use other core module setup).&lt;br /&gt;
 * More translation (ES, DE, IT, FR, US , mostly automated)&lt;br /&gt;
 * Note editing available for each tasks (also in the approval flow)&lt;br /&gt;
&lt;br /&gt;
Change log from 1.5&lt;br /&gt;
 * Support dolibarr 4.0.1&lt;br /&gt;
 * Hidden option to join file to timesheets via the setting TIMESHEET_ADD_DOCS&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4.3:&lt;br /&gt;
 * Timesheet approval by N+1,&lt;br /&gt;
 * Reminder (email) for to be approved timesheet possible through dolibarr planned tasks&lt;br /&gt;
 * admin wiew for the Approval (change a approval status outside the normal approval flow)&lt;br /&gt;
 * Home box with the pending timesheet to be approved&lt;br /&gt;
 * Blocking some weekdays (e.g week ends)&lt;br /&gt;
 * Holiday showed in the timesheet&lt;br /&gt;
 * Holiday time can be included in the timesheet totals&lt;br /&gt;
 * Typo correction for French.&lt;br /&gt;
 * Posibility to add a note&lt;br /&gt;
 * Compatible with dolibarr 3.9.2&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4.1:&lt;br /&gt;
&lt;br /&gt;
 * Correction of the Spanish language (thanks to vinclar)&lt;br /&gt;
 * Possible to deactivate the dolibarr Ajax for the dropdown list for the setup page (in case of issue to add whitelist)&lt;br /&gt;
 * Keep the whitlistmode after submit / go to date / next / previsous week&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4:&lt;br /&gt;
 * Bugfix for the tasktime date in the project page&lt;br /&gt;
 * Link to have the different whitelist behaviour (black list, and none)&lt;br /&gt;
 * Spanish language (google trad)&lt;br /&gt;
 * Typo correction for French&lt;br /&gt;
 * Support the print mode for timesheet &amp;amp; the report&lt;br /&gt;
 * Show the project open to everyone on the new whitelist page&lt;br /&gt;
&lt;br /&gt;
Change log from 1.3.7:&lt;br /&gt;
 * layout improvement: timesheet, setup page, reports&lt;br /&gt;
 * whitelist to show only some project/task&lt;br /&gt;
 * taslk column customisation&lt;br /&gt;
 * new task column: company, parent task&lt;br /&gt;
 * new report option: report all, export friendly layout&lt;br /&gt;
 * user report available for the N-2, N-3&lt;br /&gt;
 &lt;br /&gt;
Change log from 1.3.6:&lt;br /&gt;
 * compatible avec dolibarr 3.7&lt;br /&gt;
 * Change log from 1.3.3:&lt;br /&gt;
 * Works with PHP&amp;lt;=5.3&lt;br /&gt;
 * Possibility to remove the 0:00&lt;br /&gt;
 * Color code for already filled tasktime / new tasktime and error&lt;br /&gt;
 * Bux fixes in the report&lt;br /&gt;
 * Better date dialog&lt;br /&gt;
 * N+1 is able to check the user report of his N&#039;s&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Installation_-_Mise_%C3%A0_jour&amp;diff=37040</id>
		<title>Installation - Mise à jour</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Installation_-_Mise_%C3%A0_jour&amp;diff=37040"/>
		<updated>2017-04-04T12:11:28Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: /* Procédure de mise à jour */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Admin]]&lt;br /&gt;
{{TemplateDocUtil}}&lt;br /&gt;
&lt;br /&gt;
Les procédures suivantes décrivent comment installer ou mettre à jour Dolibarr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Procédure d&#039;installation =&lt;br /&gt;
Ce chapitre décrit les différentes méthodes possibles (des plus simples, aux manuels) pour une première installation. Voir plus loin pour la mises à jour.&lt;br /&gt;
&lt;br /&gt;
== Sur votre poste/serveur dédié ==&lt;br /&gt;
=== [[File:Logo_windows.png]] Avec DoliWamp (package Windows .exe) ===&lt;br /&gt;
- &#039;&#039;&#039;Prérequis&#039;&#039;&#039;: Windows&lt;br /&gt;
&lt;br /&gt;
- &#039;&#039;&#039;Niveau&#039;&#039;&#039;: Débutant&lt;br /&gt;
&lt;br /&gt;
Si vous maitrisez l&#039;installation d&#039;un serveur Web Apache, de PHP et Mysql, le chapitre suivant est plus approprié. &lt;br /&gt;
Pour les moins expérimentés qui sont sous Windows, il existe une distribution Dolibarr nommée &#039;&#039;&#039;DoliWamp&#039;&#039;&#039; qui permet de faire une installation Dolibarr sous Windows avec tous ses prérequis (Apache, Mysql, PHP) sans connaissance informatiques. Voici comment l&#039;installer:&lt;br /&gt;
 &lt;br /&gt;
* Récupérez la version de Dolibarr pour Windows.&lt;br /&gt;
Pour cela, voir la page de [http://www.nltechno.com/pages/dolibarrwinbin.php téléchargement de DoliWamp chez NLTechno].&lt;br /&gt;
&lt;br /&gt;
* Lancer le .exe téléchargé et suivez les instructions.&lt;br /&gt;
&lt;br /&gt;
=== [[File:Logo_ubuntu.png]] Avec DoliDeb (package Debian / Ubuntu .deb) ===&lt;br /&gt;
- &#039;&#039;&#039;Prerequis&#039;&#039;&#039;: Linux Debian, Ubuntu, ...&lt;br /&gt;
&lt;br /&gt;
- &#039;&#039;&#039;Niveau&#039;&#039;&#039;: Débutant&lt;br /&gt;
&lt;br /&gt;
Cette procédure fonctionne uniquement pour les utilisateurs Linux Debian, Ubuntu et dérivés et est recommandée pour ceux qui n&#039;ont pas de connaissances informatiques particulières. Si vous êtes un administrateur expérimenté d&#039;Apache, PHP et Mysql, le chapitre &#039;&#039;&#039;Avec Dolibarr (package standard tgz)&#039;&#039;&#039; sera peut-être plus approprié. Dans le cas contraire, vous pouvez utilisez DoliDeb. DoliDeb est un package de Dolibarr spécialisé pour la distribution Debian ou Ubuntu. Ce package vous permet d&#039;installer Dolibarr sous Ubuntu ou Debian (ou dérivé) avec tous ces prérequis (Apache, Mysql, PHP) s&#039;ils ne sont pas déjà installés et ce sans connaissances techniques particulières.&lt;br /&gt;
&lt;br /&gt;
* La procédure pour installer DoliDeb est décrite sur la page [[Dolibarr pour Ubuntu ou Debian]].&lt;br /&gt;
&lt;br /&gt;
=== [[File:Logo_rpm.png|40px]] Avec DoliRpm (package Fedora, Redhat, Mandriva, Mageia or OpenSuse .rpm) ===&lt;br /&gt;
- &#039;&#039;&#039;Prerequis&#039;&#039;&#039;: Linux Fedora, Redhat, Mandriva, Mageia or OpenSuse (may also work for any rpm linux distribution)&lt;br /&gt;
&lt;br /&gt;
- &#039;&#039;&#039;Niveau&#039;&#039;&#039;: Débutant&lt;br /&gt;
&lt;br /&gt;
Cette procédure fonctionne uniquement pour les utilisateurs Linux d&#039;une distribution gérant les packages rpm et est recommandée pour ceux qui n&#039;ont pas de connaissances informatiques particulières. Si vous êtes un administrateur expérimenté d&#039;Apache, PHP et Mysql, le chapitre suivant &#039;&#039;&#039;Avec Dolibarr (package standard tgz)&#039;&#039;&#039; sera peut-être plus approprié. Dans le cas contraire, vous pouvez utilisez DoliRpm. DoliRpm est un package de Dolibarr spécialisé pour la distribution Fedora, Redhat, Mandriva, Mageia ou OpenSuse. Ce package vous permet d&#039;installer Dolibarr sous ces OS avec tous ces prérequis (Apache, Mysql, PHP) s&#039;ils ne sont pas déjà installés et ce sans connaissances techniques particulières.&lt;br /&gt;
&lt;br /&gt;
* La procédure pour installer DoliRpm est décrite sur la page [[Dolibarr pour Redhat ou Fedora (package rpm)]] ou [[Dolibarr pour Mandriva ou Mageia (package rpm)]] ou [[Dolibarr pour OpenSuse (package rpm)]].&lt;br /&gt;
&lt;br /&gt;
=== [[File:Gnu.png]] Avec Dolibarr (package standard .tgz ou sources Git) ===&lt;br /&gt;
- &#039;&#039;&#039;Prérequis&#039;&#039;&#039;: Apache, PHP et un serveur de base de données (MySQL ou PostgreSQL) sont présents et opérationnels, et le login/mot de passe d&#039;accès (à une nouvelle base ou au serveur) est connu.&lt;br /&gt;
&lt;br /&gt;
- &#039;&#039;&#039;Niveau&#039;&#039;&#039;: Un peu de connaissances informatiques en administration Web.&lt;br /&gt;
&lt;br /&gt;
Cette procédure décrit l&#039;installation manuelle (recommandée) sur un système GNU/Linux (Debian, Mandriva, ...) mais elle est valable avec d&#039;autres systèmes comme Windows moyennant une adaptation des chemins à ceux de votre OS.&lt;br /&gt;
Elle est applicable pour toute version de Dolibarr &amp;gt;= 2.0.0&lt;br /&gt;
&lt;br /&gt;
* Vérifiez que vous avez bien Apache, PHP {{PHPMinVersion}} et un serveur de base de données (MySQL {{MySqlMinVersion}} ou PostgreSQL) d&#039;installés (consulter pour cela la liste des packages installés sur votre machine grâce au gestionnaire de mise à jour de package de votre distribution).&lt;br /&gt;
&lt;br /&gt;
* Vérifiez que l&#039;utilisateur root ou admin principal pour le serveur de base de donnée est connu et fonctionne correctement. Si cet utilisateur root ou admin est inconnu car pas encore défini, lisez le chapitre qui suit. Sinon vous pouvez passez au point suivant:&lt;br /&gt;
&lt;br /&gt;
Pour les utilisateurs Linux utilisant MySql ou MariaDB, si vous venez juste d&#039;installer la base de donnée MySQL, le login administrateur est &#039;&#039;&#039;root&#039;&#039;&#039;. Vous devez exécuter la commande suivante pour initialiser le mot de passe:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql    &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Une fois dans l&#039;interface Mysql, taper la commande de modification du mote de passe de root:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
grant all privileges on *.* to root@&#039;localhost&#039; identified by &#039;newrootpass&#039; with grant option;      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Puis entrée et pour quitter \q&lt;br /&gt;
&lt;br /&gt;
Pour vérifier que l&#039;accès avec ce couple user/mot de passe fonctionne, lancer la commande&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql -u root -p&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Et taper votre mot de passe &#039;&#039;newrootpass&#039;&#039; suivi de \q pour quitter la sessions si la connexion a réussie.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pour les utilisateurs Linux utilisant Postgresql, si vous venez juste d&#039;installer la base de donnée PostgreSQL, vous devez d&#039;abord créer un utilisateur administrateur et son mot de passe. Pour cela, ajouter la ligne suivante dans le fichier &#039;&#039;&#039;/etc/postgresql/x.x/main/pg_hba.conf&#039;&#039;&#039; (remplacer x.x avec votre version de postgres)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
local   all         dolibarrowner    md5        &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
De plus, mettez en commentaire la ligne&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
#local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
qui impose que le compte système utilisé pour accéder à la base (ce sera le compte sous lequel tourne l&#039;application web), ait le même nom que le compte dans la base (ce n&#039;est jamais le cas).&lt;br /&gt;
&lt;br /&gt;
Ensuite, lancer la commande sous un shell root&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -s -u postgres&lt;br /&gt;
createuser dolibarrowner&lt;br /&gt;
psql -d template1 -c &amp;quot;alter user dolibarrowner with password &#039;dolibarrownerpass&#039;&amp;quot;&lt;br /&gt;
exit&lt;br /&gt;
sudo /etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Vous pouvez tester la connexion pour l&#039;utilisateur crée avec la commande&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql -h localhost -d postgres -U dolibarrowner -W&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Et entrez le mot de passe &#039;&#039;dolibarrownerpass&#039;&#039; et \q pour quitter la session si la connexion est ok.&lt;br /&gt;
&lt;br /&gt;
* Placez-vous dans le répertoire dans lequel installer Dolibarr (le répertoire racine défini pour votre serveur web)&lt;br /&gt;
# Pour Debian et les familles Ubuntu, il s&#039;agit en général de: /var/www&lt;br /&gt;
# Pour Mandriva, RedHat, Fedora: /var/www/html&lt;br /&gt;
# Pour Suse: /srv/www/htdocs&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ cd /var/www&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Récupérez l&#039;application&lt;br /&gt;
&lt;br /&gt;
- Si vous partez du fichier dolibarr.tgz, récupérez le fichier et décompressez l&#039;archive de l&#039;application&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ wget http://www.dolibarr.org/files/dolibarr.tgz&lt;br /&gt;
$ tar xvfz dolibarr.tgz&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Renommez le répertoire dolibarr-x.y.z en dolibarr afin d&#039;avoir un nom de répertoire indépendant de la version (où x.y.z correspond à la version source)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ mv dolibarr-x.y.z dolibarr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- Si vous partez des sources Git, récupérer les sources par&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ git clone -b develop http://github.com/Dolibarr/dolibarr.git dolibarr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Il est possible de remplacer HEAD par X.y pour récupérer la dernière version stable de la branche x.y.&lt;br /&gt;
&lt;br /&gt;
* Modifiez les permissions et propriétaires du répertoire &#039;dolibarr&#039; pour être sur que tous les fichiers soient en lecture pour l&#039;utilisateur sur lequel tourne le serveur (on supposera qu&#039;il s&#039;agit de l&#039;utilisateur &#039;www-data&#039; pour debian ou ubuntu, &#039;apache&#039; pour redhat, mandriva, fedora)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ chmod -R 755 /var/www/dolibarr&lt;br /&gt;
$ chown -R www-data.www-data /var/www/dolibarr&lt;br /&gt;
or&lt;br /&gt;
$ chmod -R 755 /var/www/html/dolibarr&lt;br /&gt;
$ chown -R apache.apache /var/www/html/dolibarr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* En tant que root, créez, dans le répertoire dolibarr/htdocs/conf, un fichier de configuration vide, et attribuez-lui comme propriétaire du fichier, l&#039;utilisateur du serveur web (exemple www-data sur debian, nobody sur une vieille RedHat, apache sur une autre version ...). Ceci est requis car le serveur web a besoin d&#039;écrire dans ce fichier lors de l&#039;installation.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ cd dolibarr ; touch htdocs/conf/conf.php ; chown www-data htdocs/conf/conf.php&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Sur Fedora, comme SELinux est activé en général, il est aussi conseillé de lancer les commandes pour rendre le répertoire &#039;dolibarr&#039; accepté par l&#039;environnement SELinux (an absence de commande, vous devriez recevoir des nombreuses alertes d&#039;anomalies) :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ semanage fcontext -a -t httpd_sys_rw_content_t &#039;/var/www/html/dolibarr(/.*)?&#039;&lt;br /&gt;
$ restorecon -R -v &#039;/var/www/html/dolibarr&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Toujours en root, créez le répertoire qui servira aux documents générés ou stockés par Dolibarr (factures pdf, images, ...), et attribuez lui comme propriétaire, l&#039;utilisateur du serveur web (exemple www-data sur Debian, nobody sur une vieille RedHat, Apache sur une Mandriva ou une RedHat récente, ...). Le serveur web doit avoir les droits en écriture dans ce répertoire.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ mkdir documents ; chown www-data documents&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Pointez votre navigateur sur la page principale&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
http://127.0.0.1/dolibarr/htdocs/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Suivez les instructions de l&#039;installation&lt;br /&gt;
&lt;br /&gt;
* Pour des raisons de sécurité nous vous conseillons, une fois l&#039;installation terminée, de créer un fichier install.lock dans le répertoire d&#039;installation, que seul root doit avoir le droit d&#039;effacer. Ceci va vérouiller la procédure d&#039;installation qui ne pourra plus être appelée par erreur (Il faudra le supprimer pour les mises à jour).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ touch /var/www/dolibarr/install.lock; chmod go-w /var/www/dolibarr;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sur un hébergement mutualisé (à accès restreint) ==&lt;br /&gt;
Il n&#039;est pas possible de présenter une solution générique à ce cas car la procédures dépend de l&#039;hébergeur.&lt;br /&gt;
La plupart du temps, la procédure générique suivante fonctionnera:&lt;br /&gt;
&lt;br /&gt;
Voici toutefois quelques documents/procédures spécifiques à certains hébergeurs:&lt;br /&gt;
* Hébergement FREE mutualisé: [[File:Installation Dolibarr Free-20100526.odt]]&lt;br /&gt;
* Hébergement OVH oneclick: OVH propose une version de Dolibarr parfois plus ancienne que la version stable courante mais installable depuis son interface d&#039;administration dans sa solution &amp;quot;OneClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Procédure générique:&lt;br /&gt;
&lt;br /&gt;
- &#039;&#039;&#039;Prerequis&#039;&#039;&#039;: &lt;br /&gt;
Un serveur web Apache, PHP et une base de donnée (MySQL ou PostgreSQL) tourne correctement et le compte login/mot de passe (de la nouvelle base de donnée ou d&#039;administration du serveur) est connu (sinon les demander à l&#039;hébergeur).&lt;br /&gt;
&lt;br /&gt;
- &#039;&#039;&#039;Niveau&#039;&#039;&#039;: Utilisateurs avec quelques notions d&#039;administration Web and base de donnée. Maitrise d&#039;un outil de transfert de fichier (FTP, SFTP, ...) pour uploader les fichiers sur le serveur.&lt;br /&gt;
&lt;br /&gt;
* Vérifiez que vous avez un serveur Web Apache, PHP et une base de donnée (MySQL ou PostGreSQL) qui fonctionne correctement.&lt;br /&gt;
[[File:warning.png]] Attention, la page de code du serveur PHP et de la base de donnée doivent être identique.&lt;br /&gt;
&lt;br /&gt;
* Vérifiez que vous avez un compte root ou administrateur avec login/mot de passe connu et que ces comptes fonctionnent. Si inconnu, demandez les à votre hébergeur.&lt;br /&gt;
&lt;br /&gt;
* Récupérer l&#039;archive de la dernière version stable de Dolibarr et décompressez la localement..&lt;br /&gt;
&lt;br /&gt;
* Uploadez tout le contenu du répertoire dans le répertoire racine de votre site web, par exemple par FTP en mode binaire.&lt;br /&gt;
&lt;br /&gt;
* Créez un répertoire nommé &amp;quot;documents&amp;quot;, dans cette racine, qui servira à sauver tous les documents générés et stockés par Dolibarr (factures PDF, images uploadées, ...). Le serveur web doit avoir les permissions d&#039;écrire dedans. Vous pouvez attribuer ces permission avec un client FTP.&lt;br /&gt;
&lt;br /&gt;
* Maintenant appeler la page principale index.php de dolibarr avec votre navigateur.&lt;br /&gt;
&lt;br /&gt;
* Suivez les instructions pas à pas du processus d&#039;installation.&lt;br /&gt;
&lt;br /&gt;
* Pour des raisons de sécurité, il est recommandé, une fois l&#039;installation terminée, de créer un fichier install.lock dans le répertoire de Dolibarr. Ceci vérrouillera l&#039;appel au processus d&#039;installation (il vous faudra supprimer ce fichier pour permettre les mise à jour). Si ceci n&#039;est pas fait, Dolibarr vous affichera un warning lorsque vous êtes loggués comme administrateur.&lt;br /&gt;
&lt;br /&gt;
== Sur un hébergeur SaaS ou Cloud ==&lt;br /&gt;
Dolibarr est aussi disponible en version &amp;quot;pré-installée&amp;quot; chez de nombreux hébergeurs payants, fournissant des instances hébergées &amp;quot;prêtes à l&#039;emploi&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Voir la page [[Solutions de Cloud]].&lt;br /&gt;
&lt;br /&gt;
Dolibarr peut aussi être installé manuellement sur toute plateforme Cloud (gratuite ou payante) qui supporte le PHP et Mysql.&lt;br /&gt;
&lt;br /&gt;
Voir la page [[Solutions de Cloud]].&lt;br /&gt;
&lt;br /&gt;
= Procédure de mise à jour =&lt;br /&gt;
Ce chapitre décrit le processus pour mettre à niveau une installation existante de Dolibarr d&#039;une ancienne version vers une autre. Le processus est le même quel que soit la version depuis laquelle vous venez et la version vers laquelle vous allez, mais sera différent selon la distribution ou système d&#039;exploitation utilisé pour votre première installation. Il est recommandé d&#039;utiliser le même type de distribution pour la mise à jour que celle utilisée pour la première installation.&lt;br /&gt;
&lt;br /&gt;
== Sauvegarde ==&lt;br /&gt;
&lt;br /&gt;
Avant de faire une mise à jour, il est recommendé de faire un sauvegarde de la base de donnée mais aussi des documents, de cette façon même en cas de catastrophe vous ne perdrez pas vos preciseuses données&lt;br /&gt;
https://wiki.dolibarr.org/index.php/Sauvegardes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[File:Logo_windows.png]] Avec DoliWamp (package Windows .exe) ==&lt;br /&gt;
&lt;br /&gt;
Si vous aviez installé la version de Dolibarr spécifique nommé DoliWamp (qui embarque le serveur Web, PHP et Mysql), la procédure à suivre est celle-ci (Dans tout autre cas, utilisez une des procédures des chapitres suivant):&lt;br /&gt;
&lt;br /&gt;
* Télécharger la nouvelle version de DoliWamp.&lt;br /&gt;
&lt;br /&gt;
* Lancer le .exe et laissez vous guider dans toutes les étapes de migration en cliquant suivant,suivant,... à chaque fois sans rien changer aux valeurs proposées par défaut.&lt;br /&gt;
&lt;br /&gt;
* Au premier accès de Dolibarr, l&#039;application détectera que vous avez une base en version ancienne. Choisissez le menu proposé pour migrer à la version supérieure. Si vous avez fait un saut de plusieurs version, garder le choix proposer de migrer d&#039;une seule version, à la fin le menu vous sera reproposé pour migrer à la suivante et ainsi de suite jusqu&#039;à atteindre la version qui a été installé (par si vous avez installer Dolibarr 3.5 par dessus votre version courante qui était Dolibarr 3.2, choisissez le menu de migration pour passer de 3.2 à 3.3, puis 3.3 à 3.4 puis 3.4 à 3.5).&lt;br /&gt;
&lt;br /&gt;
== [[File:Logo_ubuntu.png]] Avec DoliDeb (package Debian / Ubuntu .deb) ==&lt;br /&gt;
Si vous aviez installé Dolibarr via un packagage Debian-Ubuntu, sa mise a jour se fait simplement de la même manière qu&#039;une première installation. Il suffit d&#039;installer le nouveau package .deb.&lt;br /&gt;
Par exemple en suivant la procédure [[Dolibarr pour Ubuntu ou Debian]].&lt;br /&gt;
&lt;br /&gt;
* Au premier accès de Dolibarr, l&#039;application détectera que vous avez une base en version ancienne. Choisissez le menu proposé pour migrer à la version supérieure. Si vous avez fait un saut de plusieurs version, garder le choix proposer de migrer d&#039;une seule version, à la fin le menu vous sera reproposé pour migrer à la suivante et ainsi de suite jusqu&#039;à atteindre la version qui a été installé (par si vous avez installer Dolibarr 3.5 par dessus votre version courante qui était Dolibarr 3.2, choisissez le menu de migration pour passer de 3.2 à 3.3, puis 3.3 à 3.4 puis 3.4 à 3.5).&lt;br /&gt;
&lt;br /&gt;
== [[File:Logo_rpm.png|40px]] Avec DoliRpm (package Fedora, Redhat, Mandriva, Mageia ou OpenSuse .rpm) ==&lt;br /&gt;
Si vous aviez installé Dolibarr via un packagage rpm, sa mise a jour se fait simplement de la même manière qu&#039;une première installation. Il suffit d&#039;installer le nouveau package .rpm.&lt;br /&gt;
&lt;br /&gt;
* Au premier accès de Dolibarr, l&#039;application détectera que vous avez une base en version ancienne. Choisissez le menu proposé pour migrer à la version supérieure. Si vous avez fait un saut de plusieurs version, garder le choix proposer de migrer d&#039;une seule version, à la fin le menu vous sera reproposé pour migrer à la suivante et ainsi de suite jusqu&#039;à atteindre la version qui a été installé (par si vous avez installer Dolibarr 3.5 par dessus votre version courante qui était Dolibarr 3.2, choisissez le menu de migration pour passer de 3.2 à 3.3, puis 3.3 à 3.4 puis 3.4 à 3.5).&lt;br /&gt;
&lt;br /&gt;
== [[File:Gnu.png]] Avec Dolibarr (package standard .tgz) ==&lt;br /&gt;
&lt;br /&gt;
Cette procédure décrit la mise à jour de Dolibarr depuis une ancienne version vers une plus récente par la méthode manuelle, avec la distribution standard.&lt;br /&gt;
&lt;br /&gt;
* Placez-vous dans le répertoire dans lequel a été installé Dolibarr (le répertoire racine de votre serveur web, par exemple /var/www sous Debian)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ cd /var/www&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Récupérez l&#039;archive de la nouvelle version&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ wget http://www.dolibarr.org/files/dolibarr.tgz&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Décompressez l&#039;archive&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ tar xvfz dolibarr.tgz&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Recopiez les nouveaux fichiers (qui ont été décompressés dans le répertoire dolibarr-x.y.z) vers  le répertoire où vous avez votre ancienne version de Dolibarr. Ceci a pour effet de remplacer les anciens fichiers par les nouveaux tout en conservant les fichiers qui vous sont spécifiques (comme le fichier conf.php ou encore vos modules complémentaires non officiels installés).&lt;br /&gt;
* Si vous deplacez ou renommez également le dossier de votre ancienne version de Dolibarr, pensez à modifier les chemins dans le fichier /conf/conf.php (sinon vous risquez un fatal error: Cannot redeclare versiontostring)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ cp -r dolibarr-x.y.z/* dolibarr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Vous pouvez alors supprimer le répertoire des fichiers sources&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ rm -fr dolibarr-x.y.z&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Lancer Dolibarr dans votre navigateur habituel. Ceci fera apparaître l&#039;assistant de migration: L&#039;application détectera que vous avez une base en version ancienne. Choisissez le menu proposé pour migrer à la version supérieure. Si vous avez fait un saut de plusieurs version, garder le choix proposer de migrer d&#039;une seule version, à la fin le menu vous sera reproposé pour migrer à la suivante et ainsi de suite jusqu&#039;à atteindre la version qui a été installé (par si vous avez installer Dolibarr 3.5 par dessus votre version courante qui était Dolibarr 3.2, choisissez le menu de migration pour passer de 3.2 à 3.3, puis 3.3 à 3.4 puis 3.4 à 3.5).&lt;br /&gt;
&lt;br /&gt;
ou &lt;br /&gt;
&lt;br /&gt;
Lancer les 2 étapes de migration en ligne de commande:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ cd htdocs/install&lt;br /&gt;
$ php upgrade.php oldx.oldy.oldz x.y.z &amp;gt; output.html&lt;br /&gt;
$ php upgrade2.php oldx.oldy.oldz x.y.z &amp;gt; output2.html&lt;br /&gt;
$ php step5.php oldx.oldy.oldz x.y.z &amp;gt; output3.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note: z doit être &amp;quot;0&amp;quot; car seul les versions majeures ont un script de migration à exécuter.&lt;br /&gt;
&lt;br /&gt;
Le code retour sera 0 en cas de succès, 1 en cas d&#039;erreur (voir alors le fichier sortie output.html ou output2.html)&lt;br /&gt;
&lt;br /&gt;
Note: Si vous avez un message signalant que le processus de mise à jour est vérrouillé par un fichier install.lock, supprimer ce fichier (il est stocké dans le répertoire racine ou &amp;quot;documents&amp;quot; de Dolibarr) puis rafraichissez la page.&lt;br /&gt;
&lt;br /&gt;
* Pour des raisons de sécurité nous vous conseillons, une fois la mise à jour terminée, de verrouiller le répertoire d&#039;installation en créant un fichier install.lock dans le répertoire de donnée de Dolibarr. Dans le cas contraire, Dolibarr vous avertira d&#039;un message dans l&#039;interface une fois loggé&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ echo &amp;gt; documents/install.lock&lt;br /&gt;
$ chmod 444 documents/install.lock&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Sauvegarde =&lt;br /&gt;
&lt;br /&gt;
Avant de faire une mise à jour, il est recommendé de faire un sauvegarde de la base de donnée mais aussi des documents, de cette façon même en case de catastrophe vous ne perdrez pas vos preciseuses données&lt;br /&gt;
https://wiki.dolibarr.org/index.php/Sauvegardes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[File:Logo_windows.png]] Avec DoliWamp (package Windows .exe) ==&lt;br /&gt;
&lt;br /&gt;
Si vous aviez installé la version de Dolibarr spécifique nommé DoliWamp (qui embarque le serveur Web, PHP et Mysql), la procédure à suivre est celle-ci (Dans tout autre cas, utilisez une des procédures des chapitres suivant):&lt;br /&gt;
&lt;br /&gt;
* Télécharger la nouvelle version de DoliWamp.&lt;br /&gt;
&lt;br /&gt;
* Lancer le .exe et laissez vous guider dans toutes les étapes de migration en cliquant suivant,suivant,... à chaque fois sans rien changer aux valeurs proposées par défaut.&lt;br /&gt;
&lt;br /&gt;
* Au premier accès de Dolibarr, l&#039;application détectera que vous avez une base en version ancienne. Choisissez le menu proposé pour migrer à la version supérieure. Si vous avez fait un saut de plusieurs version, garder le choix proposer de migrer d&#039;une seule version, à la fin le menu vous sera reproposé pour migrer à la suivante et ainsi de suite jusqu&#039;à atteindre la version qui a été installé (par si vous avez installer Dolibarr 3.5 par dessus votre version courante qui était Dolibarr 3.2, choisissez le menu de migration pour passer de 3.2 à 3.3, puis 3.3 à 3.4 puis 3.4 à 3.5).&lt;br /&gt;
&lt;br /&gt;
== [[File:Logo_ubuntu.png]] Avec DoliDeb (package Debian / Ubuntu .deb) ==&lt;br /&gt;
Si vous aviez installé Dolibarr via un packagage Debian-Ubuntu, sa mise a jour se fait simplement de la même manière qu&#039;une première installation. Il suffit d&#039;installer le nouveau package .deb.&lt;br /&gt;
Par exemple en suivant la procédure [[Dolibarr pour Ubuntu ou Debian]].&lt;br /&gt;
&lt;br /&gt;
* Au premier accès de Dolibarr, l&#039;application détectera que vous avez une base en version ancienne. Choisissez le menu proposé pour migrer à la version supérieure. Si vous avez fait un saut de plusieurs version, garder le choix proposer de migrer d&#039;une seule version, à la fin le menu vous sera reproposé pour migrer à la suivante et ainsi de suite jusqu&#039;à atteindre la version qui a été installé (par si vous avez installer Dolibarr 3.5 par dessus votre version courante qui était Dolibarr 3.2, choisissez le menu de migration pour passer de 3.2 à 3.3, puis 3.3 à 3.4 puis 3.4 à 3.5).&lt;br /&gt;
&lt;br /&gt;
== [[File:Logo_rpm.png|40px]] Avec DoliRpm (package Fedora, Redhat, Mandriva, Mageia ou OpenSuse .rpm) ==&lt;br /&gt;
Si vous aviez installé Dolibarr via un packagage rpm, sa mise a jour se fait simplement de la même manière qu&#039;une première installation. Il suffit d&#039;installer le nouveau package .rpm.&lt;br /&gt;
&lt;br /&gt;
* Au premier accès de Dolibarr, l&#039;application détectera que vous avez une base en version ancienne. Choisissez le menu proposé pour migrer à la version supérieure. Si vous avez fait un saut de plusieurs version, garder le choix proposer de migrer d&#039;une seule version, à la fin le menu vous sera reproposé pour migrer à la suivante et ainsi de suite jusqu&#039;à atteindre la version qui a été installé (par si vous avez installer Dolibarr 3.5 par dessus votre version courante qui était Dolibarr 3.2, choisissez le menu de migration pour passer de 3.2 à 3.3, puis 3.3 à 3.4 puis 3.4 à 3.5).&lt;br /&gt;
&lt;br /&gt;
== [[File:Gnu.png]] Avec Dolibarr (package standard .tgz) ==&lt;br /&gt;
&lt;br /&gt;
Cette procédure décrit la mise à jour de Dolibarr depuis une ancienne version vers une plus récente par la méthode manuelle, avec la distribution standard.&lt;br /&gt;
&lt;br /&gt;
* Placez-vous dans le répertoire dans lequel a été installé Dolibarr (le répertoire racine de votre serveur web, par exemple /var/www sous Debian)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ cd /var/www&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Récupérez l&#039;archive de la nouvelle version&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ wget http://www.dolibarr.org/files/dolibarr.tgz&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Décompressez l&#039;archive&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ tar xvfz dolibarr.tgz&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Recopiez les nouveaux fichiers (qui ont été décompressés dans le répertoire dolibarr-x.y.z) vers  le répertoire où vous avez votre ancienne version de Dolibarr. Ceci a pour effet de remplacer les anciens fichiers par les nouveaux tout en conservant les fichiers qui vous sont spécifiques (comme le fichier conf.php ou encore vos modules complémentaires non officiels installés).&lt;br /&gt;
* Si vous deplacez ou renommez également le dossier de votre ancienne version de Dolibarr, pensez à modifier les chemins dans le fichier /conf/conf.php (sinon vous risquez un fatal error: Cannot redeclare versiontostring)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ cp -r dolibarr-x.y.z/* dolibarr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Vous pouvez alors supprimer le répertoire des fichiers sources&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ rm -fr dolibarr-x.y.z&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Lancer Dolibarr dans votre navigateur habituel. Ceci fera apparaître l&#039;assistant de migration: L&#039;application détectera que vous avez une base en version ancienne. Choisissez le menu proposé pour migrer à la version supérieure. Si vous avez fait un saut de plusieurs version, garder le choix proposer de migrer d&#039;une seule version, à la fin le menu vous sera reproposé pour migrer à la suivante et ainsi de suite jusqu&#039;à atteindre la version qui a été installé (par si vous avez installer Dolibarr 3.5 par dessus votre version courante qui était Dolibarr 3.2, choisissez le menu de migration pour passer de 3.2 à 3.3, puis 3.3 à 3.4 puis 3.4 à 3.5).&lt;br /&gt;
&lt;br /&gt;
ou &lt;br /&gt;
&lt;br /&gt;
Lancer les 2 étapes de migration en ligne de commande:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ cd htdocs/install&lt;br /&gt;
$ php upgrade.php oldx.oldy.oldz x.y.z &amp;gt; output.html&lt;br /&gt;
$ php upgrade2.php oldx.oldy.oldz x.y.z &amp;gt; output2.html&lt;br /&gt;
$ php step5.php oldx.oldy.oldz x.y.z &amp;gt; output3.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note: z doit être &amp;quot;0&amp;quot; car seul les versions majeures ont un script de migration à exécuter.&lt;br /&gt;
&lt;br /&gt;
Le code retour sera 0 en cas de succès, 1 en cas d&#039;erreur (voir alors le fichier sortie output.html ou output2.html)&lt;br /&gt;
&lt;br /&gt;
Note: Si vous avez un message signalant que le processus de mise à jour est vérrouillé par un fichier install.lock, supprimer ce fichier (il est stocké dans le répertoire racine ou &amp;quot;documents&amp;quot; de Dolibarr) puis rafraichissez la page.&lt;br /&gt;
&lt;br /&gt;
* Pour des raisons de sécurité nous vous conseillons, une fois la mise à jour terminée, de verrouiller le répertoire d&#039;installation en créant un fichier install.lock dans le répertoire de donnée de Dolibarr. Dans le cas contraire, Dolibarr vous avertira d&#039;un message dans l&#039;interface une fois loggé&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ echo &amp;gt; documents/install.lock&lt;br /&gt;
$ chmod 444 documents/install.lock&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configurer une connexion LDAP =&lt;br /&gt;
Si vous désirez utiliser LDAP: Voir [[Installer et configurer OpenLDAP]].&lt;br /&gt;
&lt;br /&gt;
= Importer des données externes =&lt;br /&gt;
Pour cette opération, consulter la page [[Imports_de_masse]].&lt;br /&gt;
&lt;br /&gt;
= Configuration - Paramétrage =&lt;br /&gt;
Voir la page [[Premiers_paramétrages|Configuration/Paramétrage]].&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Installation_-_Mise_%C3%A0_jour&amp;diff=37039</id>
		<title>Installation - Mise à jour</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Installation_-_Mise_%C3%A0_jour&amp;diff=37039"/>
		<updated>2017-04-04T12:09:25Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: /* Procédure de mise à jour */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Admin]]&lt;br /&gt;
{{TemplateDocUtil}}&lt;br /&gt;
&lt;br /&gt;
Les procédures suivantes décrivent comment installer ou mettre à jour Dolibarr.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Procédure d&#039;installation =&lt;br /&gt;
Ce chapitre décrit les différentes méthodes possibles (des plus simples, aux manuels) pour une première installation. Voir plus loin pour la mises à jour.&lt;br /&gt;
&lt;br /&gt;
== Sur votre poste/serveur dédié ==&lt;br /&gt;
=== [[File:Logo_windows.png]] Avec DoliWamp (package Windows .exe) ===&lt;br /&gt;
- &#039;&#039;&#039;Prérequis&#039;&#039;&#039;: Windows&lt;br /&gt;
&lt;br /&gt;
- &#039;&#039;&#039;Niveau&#039;&#039;&#039;: Débutant&lt;br /&gt;
&lt;br /&gt;
Si vous maitrisez l&#039;installation d&#039;un serveur Web Apache, de PHP et Mysql, le chapitre suivant est plus approprié. &lt;br /&gt;
Pour les moins expérimentés qui sont sous Windows, il existe une distribution Dolibarr nommée &#039;&#039;&#039;DoliWamp&#039;&#039;&#039; qui permet de faire une installation Dolibarr sous Windows avec tous ses prérequis (Apache, Mysql, PHP) sans connaissance informatiques. Voici comment l&#039;installer:&lt;br /&gt;
 &lt;br /&gt;
* Récupérez la version de Dolibarr pour Windows.&lt;br /&gt;
Pour cela, voir la page de [http://www.nltechno.com/pages/dolibarrwinbin.php téléchargement de DoliWamp chez NLTechno].&lt;br /&gt;
&lt;br /&gt;
* Lancer le .exe téléchargé et suivez les instructions.&lt;br /&gt;
&lt;br /&gt;
=== [[File:Logo_ubuntu.png]] Avec DoliDeb (package Debian / Ubuntu .deb) ===&lt;br /&gt;
- &#039;&#039;&#039;Prerequis&#039;&#039;&#039;: Linux Debian, Ubuntu, ...&lt;br /&gt;
&lt;br /&gt;
- &#039;&#039;&#039;Niveau&#039;&#039;&#039;: Débutant&lt;br /&gt;
&lt;br /&gt;
Cette procédure fonctionne uniquement pour les utilisateurs Linux Debian, Ubuntu et dérivés et est recommandée pour ceux qui n&#039;ont pas de connaissances informatiques particulières. Si vous êtes un administrateur expérimenté d&#039;Apache, PHP et Mysql, le chapitre &#039;&#039;&#039;Avec Dolibarr (package standard tgz)&#039;&#039;&#039; sera peut-être plus approprié. Dans le cas contraire, vous pouvez utilisez DoliDeb. DoliDeb est un package de Dolibarr spécialisé pour la distribution Debian ou Ubuntu. Ce package vous permet d&#039;installer Dolibarr sous Ubuntu ou Debian (ou dérivé) avec tous ces prérequis (Apache, Mysql, PHP) s&#039;ils ne sont pas déjà installés et ce sans connaissances techniques particulières.&lt;br /&gt;
&lt;br /&gt;
* La procédure pour installer DoliDeb est décrite sur la page [[Dolibarr pour Ubuntu ou Debian]].&lt;br /&gt;
&lt;br /&gt;
=== [[File:Logo_rpm.png|40px]] Avec DoliRpm (package Fedora, Redhat, Mandriva, Mageia or OpenSuse .rpm) ===&lt;br /&gt;
- &#039;&#039;&#039;Prerequis&#039;&#039;&#039;: Linux Fedora, Redhat, Mandriva, Mageia or OpenSuse (may also work for any rpm linux distribution)&lt;br /&gt;
&lt;br /&gt;
- &#039;&#039;&#039;Niveau&#039;&#039;&#039;: Débutant&lt;br /&gt;
&lt;br /&gt;
Cette procédure fonctionne uniquement pour les utilisateurs Linux d&#039;une distribution gérant les packages rpm et est recommandée pour ceux qui n&#039;ont pas de connaissances informatiques particulières. Si vous êtes un administrateur expérimenté d&#039;Apache, PHP et Mysql, le chapitre suivant &#039;&#039;&#039;Avec Dolibarr (package standard tgz)&#039;&#039;&#039; sera peut-être plus approprié. Dans le cas contraire, vous pouvez utilisez DoliRpm. DoliRpm est un package de Dolibarr spécialisé pour la distribution Fedora, Redhat, Mandriva, Mageia ou OpenSuse. Ce package vous permet d&#039;installer Dolibarr sous ces OS avec tous ces prérequis (Apache, Mysql, PHP) s&#039;ils ne sont pas déjà installés et ce sans connaissances techniques particulières.&lt;br /&gt;
&lt;br /&gt;
* La procédure pour installer DoliRpm est décrite sur la page [[Dolibarr pour Redhat ou Fedora (package rpm)]] ou [[Dolibarr pour Mandriva ou Mageia (package rpm)]] ou [[Dolibarr pour OpenSuse (package rpm)]].&lt;br /&gt;
&lt;br /&gt;
=== [[File:Gnu.png]] Avec Dolibarr (package standard .tgz ou sources Git) ===&lt;br /&gt;
- &#039;&#039;&#039;Prérequis&#039;&#039;&#039;: Apache, PHP et un serveur de base de données (MySQL ou PostgreSQL) sont présents et opérationnels, et le login/mot de passe d&#039;accès (à une nouvelle base ou au serveur) est connu.&lt;br /&gt;
&lt;br /&gt;
- &#039;&#039;&#039;Niveau&#039;&#039;&#039;: Un peu de connaissances informatiques en administration Web.&lt;br /&gt;
&lt;br /&gt;
Cette procédure décrit l&#039;installation manuelle (recommandée) sur un système GNU/Linux (Debian, Mandriva, ...) mais elle est valable avec d&#039;autres systèmes comme Windows moyennant une adaptation des chemins à ceux de votre OS.&lt;br /&gt;
Elle est applicable pour toute version de Dolibarr &amp;gt;= 2.0.0&lt;br /&gt;
&lt;br /&gt;
* Vérifiez que vous avez bien Apache, PHP {{PHPMinVersion}} et un serveur de base de données (MySQL {{MySqlMinVersion}} ou PostgreSQL) d&#039;installés (consulter pour cela la liste des packages installés sur votre machine grâce au gestionnaire de mise à jour de package de votre distribution).&lt;br /&gt;
&lt;br /&gt;
* Vérifiez que l&#039;utilisateur root ou admin principal pour le serveur de base de donnée est connu et fonctionne correctement. Si cet utilisateur root ou admin est inconnu car pas encore défini, lisez le chapitre qui suit. Sinon vous pouvez passez au point suivant:&lt;br /&gt;
&lt;br /&gt;
Pour les utilisateurs Linux utilisant MySql ou MariaDB, si vous venez juste d&#039;installer la base de donnée MySQL, le login administrateur est &#039;&#039;&#039;root&#039;&#039;&#039;. Vous devez exécuter la commande suivante pour initialiser le mot de passe:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql    &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Une fois dans l&#039;interface Mysql, taper la commande de modification du mote de passe de root:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
grant all privileges on *.* to root@&#039;localhost&#039; identified by &#039;newrootpass&#039; with grant option;      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Puis entrée et pour quitter \q&lt;br /&gt;
&lt;br /&gt;
Pour vérifier que l&#039;accès avec ce couple user/mot de passe fonctionne, lancer la commande&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mysql -u root -p&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Et taper votre mot de passe &#039;&#039;newrootpass&#039;&#039; suivi de \q pour quitter la sessions si la connexion a réussie.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pour les utilisateurs Linux utilisant Postgresql, si vous venez juste d&#039;installer la base de donnée PostgreSQL, vous devez d&#039;abord créer un utilisateur administrateur et son mot de passe. Pour cela, ajouter la ligne suivante dans le fichier &#039;&#039;&#039;/etc/postgresql/x.x/main/pg_hba.conf&#039;&#039;&#039; (remplacer x.x avec votre version de postgres)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
local   all         dolibarrowner    md5        &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
De plus, mettez en commentaire la ligne&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
#local   all         all                               ident&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
qui impose que le compte système utilisé pour accéder à la base (ce sera le compte sous lequel tourne l&#039;application web), ait le même nom que le compte dans la base (ce n&#039;est jamais le cas).&lt;br /&gt;
&lt;br /&gt;
Ensuite, lancer la commande sous un shell root&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo -s -u postgres&lt;br /&gt;
createuser dolibarrowner&lt;br /&gt;
psql -d template1 -c &amp;quot;alter user dolibarrowner with password &#039;dolibarrownerpass&#039;&amp;quot;&lt;br /&gt;
exit&lt;br /&gt;
sudo /etc/init.d/postgresql restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Vous pouvez tester la connexion pour l&#039;utilisateur crée avec la commande&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
psql -h localhost -d postgres -U dolibarrowner -W&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Et entrez le mot de passe &#039;&#039;dolibarrownerpass&#039;&#039; et \q pour quitter la session si la connexion est ok.&lt;br /&gt;
&lt;br /&gt;
* Placez-vous dans le répertoire dans lequel installer Dolibarr (le répertoire racine défini pour votre serveur web)&lt;br /&gt;
# Pour Debian et les familles Ubuntu, il s&#039;agit en général de: /var/www&lt;br /&gt;
# Pour Mandriva, RedHat, Fedora: /var/www/html&lt;br /&gt;
# Pour Suse: /srv/www/htdocs&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ cd /var/www&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Récupérez l&#039;application&lt;br /&gt;
&lt;br /&gt;
- Si vous partez du fichier dolibarr.tgz, récupérez le fichier et décompressez l&#039;archive de l&#039;application&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ wget http://www.dolibarr.org/files/dolibarr.tgz&lt;br /&gt;
$ tar xvfz dolibarr.tgz&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Renommez le répertoire dolibarr-x.y.z en dolibarr afin d&#039;avoir un nom de répertoire indépendant de la version (où x.y.z correspond à la version source)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ mv dolibarr-x.y.z dolibarr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- Si vous partez des sources Git, récupérer les sources par&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ git clone -b develop http://github.com/Dolibarr/dolibarr.git dolibarr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Il est possible de remplacer HEAD par X.y pour récupérer la dernière version stable de la branche x.y.&lt;br /&gt;
&lt;br /&gt;
* Modifiez les permissions et propriétaires du répertoire &#039;dolibarr&#039; pour être sur que tous les fichiers soient en lecture pour l&#039;utilisateur sur lequel tourne le serveur (on supposera qu&#039;il s&#039;agit de l&#039;utilisateur &#039;www-data&#039; pour debian ou ubuntu, &#039;apache&#039; pour redhat, mandriva, fedora)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ chmod -R 755 /var/www/dolibarr&lt;br /&gt;
$ chown -R www-data.www-data /var/www/dolibarr&lt;br /&gt;
or&lt;br /&gt;
$ chmod -R 755 /var/www/html/dolibarr&lt;br /&gt;
$ chown -R apache.apache /var/www/html/dolibarr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* En tant que root, créez, dans le répertoire dolibarr/htdocs/conf, un fichier de configuration vide, et attribuez-lui comme propriétaire du fichier, l&#039;utilisateur du serveur web (exemple www-data sur debian, nobody sur une vieille RedHat, apache sur une autre version ...). Ceci est requis car le serveur web a besoin d&#039;écrire dans ce fichier lors de l&#039;installation.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ cd dolibarr ; touch htdocs/conf/conf.php ; chown www-data htdocs/conf/conf.php&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Sur Fedora, comme SELinux est activé en général, il est aussi conseillé de lancer les commandes pour rendre le répertoire &#039;dolibarr&#039; accepté par l&#039;environnement SELinux (an absence de commande, vous devriez recevoir des nombreuses alertes d&#039;anomalies) :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ semanage fcontext -a -t httpd_sys_rw_content_t &#039;/var/www/html/dolibarr(/.*)?&#039;&lt;br /&gt;
$ restorecon -R -v &#039;/var/www/html/dolibarr&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Toujours en root, créez le répertoire qui servira aux documents générés ou stockés par Dolibarr (factures pdf, images, ...), et attribuez lui comme propriétaire, l&#039;utilisateur du serveur web (exemple www-data sur Debian, nobody sur une vieille RedHat, Apache sur une Mandriva ou une RedHat récente, ...). Le serveur web doit avoir les droits en écriture dans ce répertoire.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ mkdir documents ; chown www-data documents&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Pointez votre navigateur sur la page principale&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
http://127.0.0.1/dolibarr/htdocs/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Suivez les instructions de l&#039;installation&lt;br /&gt;
&lt;br /&gt;
* Pour des raisons de sécurité nous vous conseillons, une fois l&#039;installation terminée, de créer un fichier install.lock dans le répertoire d&#039;installation, que seul root doit avoir le droit d&#039;effacer. Ceci va vérouiller la procédure d&#039;installation qui ne pourra plus être appelée par erreur (Il faudra le supprimer pour les mises à jour).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ touch /var/www/dolibarr/install.lock; chmod go-w /var/www/dolibarr;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sur un hébergement mutualisé (à accès restreint) ==&lt;br /&gt;
Il n&#039;est pas possible de présenter une solution générique à ce cas car la procédures dépend de l&#039;hébergeur.&lt;br /&gt;
La plupart du temps, la procédure générique suivante fonctionnera:&lt;br /&gt;
&lt;br /&gt;
Voici toutefois quelques documents/procédures spécifiques à certains hébergeurs:&lt;br /&gt;
* Hébergement FREE mutualisé: [[File:Installation Dolibarr Free-20100526.odt]]&lt;br /&gt;
* Hébergement OVH oneclick: OVH propose une version de Dolibarr parfois plus ancienne que la version stable courante mais installable depuis son interface d&#039;administration dans sa solution &amp;quot;OneClick&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Procédure générique:&lt;br /&gt;
&lt;br /&gt;
- &#039;&#039;&#039;Prerequis&#039;&#039;&#039;: &lt;br /&gt;
Un serveur web Apache, PHP et une base de donnée (MySQL ou PostgreSQL) tourne correctement et le compte login/mot de passe (de la nouvelle base de donnée ou d&#039;administration du serveur) est connu (sinon les demander à l&#039;hébergeur).&lt;br /&gt;
&lt;br /&gt;
- &#039;&#039;&#039;Niveau&#039;&#039;&#039;: Utilisateurs avec quelques notions d&#039;administration Web and base de donnée. Maitrise d&#039;un outil de transfert de fichier (FTP, SFTP, ...) pour uploader les fichiers sur le serveur.&lt;br /&gt;
&lt;br /&gt;
* Vérifiez que vous avez un serveur Web Apache, PHP et une base de donnée (MySQL ou PostGreSQL) qui fonctionne correctement.&lt;br /&gt;
[[File:warning.png]] Attention, la page de code du serveur PHP et de la base de donnée doivent être identique.&lt;br /&gt;
&lt;br /&gt;
* Vérifiez que vous avez un compte root ou administrateur avec login/mot de passe connu et que ces comptes fonctionnent. Si inconnu, demandez les à votre hébergeur.&lt;br /&gt;
&lt;br /&gt;
* Récupérer l&#039;archive de la dernière version stable de Dolibarr et décompressez la localement..&lt;br /&gt;
&lt;br /&gt;
* Uploadez tout le contenu du répertoire dans le répertoire racine de votre site web, par exemple par FTP en mode binaire.&lt;br /&gt;
&lt;br /&gt;
* Créez un répertoire nommé &amp;quot;documents&amp;quot;, dans cette racine, qui servira à sauver tous les documents générés et stockés par Dolibarr (factures PDF, images uploadées, ...). Le serveur web doit avoir les permissions d&#039;écrire dedans. Vous pouvez attribuer ces permission avec un client FTP.&lt;br /&gt;
&lt;br /&gt;
* Maintenant appeler la page principale index.php de dolibarr avec votre navigateur.&lt;br /&gt;
&lt;br /&gt;
* Suivez les instructions pas à pas du processus d&#039;installation.&lt;br /&gt;
&lt;br /&gt;
* Pour des raisons de sécurité, il est recommandé, une fois l&#039;installation terminée, de créer un fichier install.lock dans le répertoire de Dolibarr. Ceci vérrouillera l&#039;appel au processus d&#039;installation (il vous faudra supprimer ce fichier pour permettre les mise à jour). Si ceci n&#039;est pas fait, Dolibarr vous affichera un warning lorsque vous êtes loggués comme administrateur.&lt;br /&gt;
&lt;br /&gt;
== Sur un hébergeur SaaS ou Cloud ==&lt;br /&gt;
Dolibarr est aussi disponible en version &amp;quot;pré-installée&amp;quot; chez de nombreux hébergeurs payants, fournissant des instances hébergées &amp;quot;prêtes à l&#039;emploi&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Voir la page [[Solutions de Cloud]].&lt;br /&gt;
&lt;br /&gt;
Dolibarr peut aussi être installé manuellement sur toute plateforme Cloud (gratuite ou payante) qui supporte le PHP et Mysql.&lt;br /&gt;
&lt;br /&gt;
Voir la page [[Solutions de Cloud]].&lt;br /&gt;
&lt;br /&gt;
= Procédure de mise à jour =&lt;br /&gt;
Ce chapitre décrit le processus pour mettre à niveau une installation existante de Dolibarr d&#039;une ancienne version vers une autre. Le processus est le même quel que soit la version depuis laquelle vous venez et la version vers laquelle vous allez, mais sera différent selon la distribution ou système d&#039;exploitation utilisé pour votre première installation. Il est recommandé d&#039;utiliser le même type de distribution pour la mise à jour que celle utilisée pour la première installation.&lt;br /&gt;
&lt;br /&gt;
= Sauvegarde =&lt;br /&gt;
&lt;br /&gt;
Avant de faire une mise à jour, il est recommendé de faire un sauvegarde de la base de donnée mais aussi des documents, de cette façon même en case de catastrophe vous ne perdrez pas vos preciseuses données&lt;br /&gt;
https://wiki.dolibarr.org/index.php/Sauvegardes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== [[File:Logo_windows.png]] Avec DoliWamp (package Windows .exe) ==&lt;br /&gt;
&lt;br /&gt;
Si vous aviez installé la version de Dolibarr spécifique nommé DoliWamp (qui embarque le serveur Web, PHP et Mysql), la procédure à suivre est celle-ci (Dans tout autre cas, utilisez une des procédures des chapitres suivant):&lt;br /&gt;
&lt;br /&gt;
* Télécharger la nouvelle version de DoliWamp.&lt;br /&gt;
&lt;br /&gt;
* Lancer le .exe et laissez vous guider dans toutes les étapes de migration en cliquant suivant,suivant,... à chaque fois sans rien changer aux valeurs proposées par défaut.&lt;br /&gt;
&lt;br /&gt;
* Au premier accès de Dolibarr, l&#039;application détectera que vous avez une base en version ancienne. Choisissez le menu proposé pour migrer à la version supérieure. Si vous avez fait un saut de plusieurs version, garder le choix proposer de migrer d&#039;une seule version, à la fin le menu vous sera reproposé pour migrer à la suivante et ainsi de suite jusqu&#039;à atteindre la version qui a été installé (par si vous avez installer Dolibarr 3.5 par dessus votre version courante qui était Dolibarr 3.2, choisissez le menu de migration pour passer de 3.2 à 3.3, puis 3.3 à 3.4 puis 3.4 à 3.5).&lt;br /&gt;
&lt;br /&gt;
== [[File:Logo_ubuntu.png]] Avec DoliDeb (package Debian / Ubuntu .deb) ==&lt;br /&gt;
Si vous aviez installé Dolibarr via un packagage Debian-Ubuntu, sa mise a jour se fait simplement de la même manière qu&#039;une première installation. Il suffit d&#039;installer le nouveau package .deb.&lt;br /&gt;
Par exemple en suivant la procédure [[Dolibarr pour Ubuntu ou Debian]].&lt;br /&gt;
&lt;br /&gt;
* Au premier accès de Dolibarr, l&#039;application détectera que vous avez une base en version ancienne. Choisissez le menu proposé pour migrer à la version supérieure. Si vous avez fait un saut de plusieurs version, garder le choix proposer de migrer d&#039;une seule version, à la fin le menu vous sera reproposé pour migrer à la suivante et ainsi de suite jusqu&#039;à atteindre la version qui a été installé (par si vous avez installer Dolibarr 3.5 par dessus votre version courante qui était Dolibarr 3.2, choisissez le menu de migration pour passer de 3.2 à 3.3, puis 3.3 à 3.4 puis 3.4 à 3.5).&lt;br /&gt;
&lt;br /&gt;
== [[File:Logo_rpm.png|40px]] Avec DoliRpm (package Fedora, Redhat, Mandriva, Mageia ou OpenSuse .rpm) ==&lt;br /&gt;
Si vous aviez installé Dolibarr via un packagage rpm, sa mise a jour se fait simplement de la même manière qu&#039;une première installation. Il suffit d&#039;installer le nouveau package .rpm.&lt;br /&gt;
&lt;br /&gt;
* Au premier accès de Dolibarr, l&#039;application détectera que vous avez une base en version ancienne. Choisissez le menu proposé pour migrer à la version supérieure. Si vous avez fait un saut de plusieurs version, garder le choix proposer de migrer d&#039;une seule version, à la fin le menu vous sera reproposé pour migrer à la suivante et ainsi de suite jusqu&#039;à atteindre la version qui a été installé (par si vous avez installer Dolibarr 3.5 par dessus votre version courante qui était Dolibarr 3.2, choisissez le menu de migration pour passer de 3.2 à 3.3, puis 3.3 à 3.4 puis 3.4 à 3.5).&lt;br /&gt;
&lt;br /&gt;
== [[File:Gnu.png]] Avec Dolibarr (package standard .tgz) ==&lt;br /&gt;
&lt;br /&gt;
Cette procédure décrit la mise à jour de Dolibarr depuis une ancienne version vers une plus récente par la méthode manuelle, avec la distribution standard.&lt;br /&gt;
&lt;br /&gt;
* Placez-vous dans le répertoire dans lequel a été installé Dolibarr (le répertoire racine de votre serveur web, par exemple /var/www sous Debian)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ cd /var/www&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Récupérez l&#039;archive de la nouvelle version&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ wget http://www.dolibarr.org/files/dolibarr.tgz&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Décompressez l&#039;archive&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ tar xvfz dolibarr.tgz&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Recopiez les nouveaux fichiers (qui ont été décompressés dans le répertoire dolibarr-x.y.z) vers  le répertoire où vous avez votre ancienne version de Dolibarr. Ceci a pour effet de remplacer les anciens fichiers par les nouveaux tout en conservant les fichiers qui vous sont spécifiques (comme le fichier conf.php ou encore vos modules complémentaires non officiels installés).&lt;br /&gt;
* Si vous deplacez ou renommez également le dossier de votre ancienne version de Dolibarr, pensez à modifier les chemins dans le fichier /conf/conf.php (sinon vous risquez un fatal error: Cannot redeclare versiontostring)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ cp -r dolibarr-x.y.z/* dolibarr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Vous pouvez alors supprimer le répertoire des fichiers sources&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ rm -fr dolibarr-x.y.z&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Lancer Dolibarr dans votre navigateur habituel. Ceci fera apparaître l&#039;assistant de migration: L&#039;application détectera que vous avez une base en version ancienne. Choisissez le menu proposé pour migrer à la version supérieure. Si vous avez fait un saut de plusieurs version, garder le choix proposer de migrer d&#039;une seule version, à la fin le menu vous sera reproposé pour migrer à la suivante et ainsi de suite jusqu&#039;à atteindre la version qui a été installé (par si vous avez installer Dolibarr 3.5 par dessus votre version courante qui était Dolibarr 3.2, choisissez le menu de migration pour passer de 3.2 à 3.3, puis 3.3 à 3.4 puis 3.4 à 3.5).&lt;br /&gt;
&lt;br /&gt;
ou &lt;br /&gt;
&lt;br /&gt;
Lancer les 2 étapes de migration en ligne de commande:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ cd htdocs/install&lt;br /&gt;
$ php upgrade.php oldx.oldy.oldz x.y.z &amp;gt; output.html&lt;br /&gt;
$ php upgrade2.php oldx.oldy.oldz x.y.z &amp;gt; output2.html&lt;br /&gt;
$ php step5.php oldx.oldy.oldz x.y.z &amp;gt; output3.html&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note: z doit être &amp;quot;0&amp;quot; car seul les versions majeures ont un script de migration à exécuter.&lt;br /&gt;
&lt;br /&gt;
Le code retour sera 0 en cas de succès, 1 en cas d&#039;erreur (voir alors le fichier sortie output.html ou output2.html)&lt;br /&gt;
&lt;br /&gt;
Note: Si vous avez un message signalant que le processus de mise à jour est vérrouillé par un fichier install.lock, supprimer ce fichier (il est stocké dans le répertoire racine ou &amp;quot;documents&amp;quot; de Dolibarr) puis rafraichissez la page.&lt;br /&gt;
&lt;br /&gt;
* Pour des raisons de sécurité nous vous conseillons, une fois la mise à jour terminée, de verrouiller le répertoire d&#039;installation en créant un fichier install.lock dans le répertoire de donnée de Dolibarr. Dans le cas contraire, Dolibarr vous avertira d&#039;un message dans l&#039;interface une fois loggé&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ echo &amp;gt; documents/install.lock&lt;br /&gt;
$ chmod 444 documents/install.lock&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configurer une connexion LDAP =&lt;br /&gt;
Si vous désirez utiliser LDAP: Voir [[Installer et configurer OpenLDAP]].&lt;br /&gt;
&lt;br /&gt;
= Importer des données externes =&lt;br /&gt;
Pour cette opération, consulter la page [[Imports_de_masse]].&lt;br /&gt;
&lt;br /&gt;
= Configuration - Paramétrage =&lt;br /&gt;
Voir la page [[Premiers_paramétrages|Configuration/Paramétrage]].&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=36903</id>
		<title>Module Timesheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=36903"/>
		<updated>2017-03-08T15:38:36Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:timesheet]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
&amp;lt;keywords content=&amp;quot;timesheet, Dolibarr,  interface, project, task, report, approval&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=timesheet&lt;br /&gt;
|editor=delcroip&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=timesheet}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=projects&lt;br /&gt;
|minversion=3.5.0&lt;br /&gt;
|maxversion=4.0.4&lt;br /&gt;
|note=Latest Module version: 1.5.1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Manual =&lt;br /&gt;
[https://wiki.dolibarr.org/upload/b/bd/Module_timesheet.pdf manual]&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
&lt;br /&gt;
 - Timesheet interface for all the user task per week&lt;br /&gt;
 - Generate report on user and on project per month&lt;br /&gt;
 - whitelist to show only some project/task (if no whitelist define all task are showed)&lt;br /&gt;
 - Approval of the timesheets per the N+1&lt;br /&gt;
&lt;br /&gt;
 [[File:timesheet_timeentry.jpg]]&lt;br /&gt;
&lt;br /&gt;
= Change logs = &lt;br /&gt;
&lt;br /&gt;
Change log from 1.5&lt;br /&gt;
 * Support dolibarr 4.0.1&lt;br /&gt;
 * Hidden option to join file to timesheets via the setting TIMESHEET_ADD_DOCS&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4.3:&lt;br /&gt;
 * Timesheet approval by N+1,&lt;br /&gt;
 * Reminder (email) for to be approved timesheet possible through dolibarr planned tasks&lt;br /&gt;
 * admin wiew for the Approval (change a approval status outside the normal approval flow)&lt;br /&gt;
 * Home box with the pending timesheet to be approved&lt;br /&gt;
 * Blocking some weekdays (e.g week ends)&lt;br /&gt;
 * Holiday showed in the timesheet&lt;br /&gt;
 * Holiday time can be included in the timesheet totals&lt;br /&gt;
 * Typo correction for French.&lt;br /&gt;
 * Posibility to add a note&lt;br /&gt;
 * Compatible with dolibarr 3.9.2&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4.1:&lt;br /&gt;
&lt;br /&gt;
 * Correction of the Spanish language (thanks to vinclar)&lt;br /&gt;
 * Possible to deactivate the dolibarr Ajax for the dropdown list for the setup page (in case of issue to add whitelist)&lt;br /&gt;
 * Keep the whitlistmode after submit / go to date / next / previsous week&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4:&lt;br /&gt;
 * Bugfix for the tasktime date in the project page&lt;br /&gt;
 * Link to have the different whitelist behaviour (black list, and none)&lt;br /&gt;
 * Spanish language (google trad)&lt;br /&gt;
 * Typo correction for French&lt;br /&gt;
 * Support the print mode for timesheet &amp;amp; the report&lt;br /&gt;
 * Show the project open to everyone on the new whitelist page&lt;br /&gt;
&lt;br /&gt;
Change log from 1.3.7:&lt;br /&gt;
 * layout improvement: timesheet, setup page, reports&lt;br /&gt;
 * whitelist to show only some project/task&lt;br /&gt;
 * taslk column customisation&lt;br /&gt;
 * new task column: company, parent task&lt;br /&gt;
 * new report option: report all, export friendly layout&lt;br /&gt;
 * user report available for the N-2, N-3&lt;br /&gt;
 &lt;br /&gt;
Change log from 1.3.6:&lt;br /&gt;
 * compatible avec dolibarr 3.7&lt;br /&gt;
 * Change log from 1.3.3:&lt;br /&gt;
 * Works with PHP&amp;lt;=5.3&lt;br /&gt;
 * Possibility to remove the 0:00&lt;br /&gt;
 * Color code for already filled tasktime / new tasktime and error&lt;br /&gt;
 * Bux fixes in the report&lt;br /&gt;
 * Better date dialog&lt;br /&gt;
 * N+1 is able to check the user report of his N&#039;s&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=36902</id>
		<title>Module Timesheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=36902"/>
		<updated>2017-03-08T15:37:58Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: /* Informations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:timesheet]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
&amp;lt;keywords content=&amp;quot;timesheet, Dolibarr,  interface, project, task, report, approval&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=timesheet&lt;br /&gt;
|editor=delcroip&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=timesheet}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=projects&lt;br /&gt;
|minversion=3.5.0&lt;br /&gt;
|maxversion=4.0.4&lt;br /&gt;
|note=Latest Module version: 1.5.1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
&lt;br /&gt;
 - Timesheet interface for all the user task per week&lt;br /&gt;
 - Generate report on user and on project per month&lt;br /&gt;
 - whitelist to show only some project/task (if no whitelist define all task are showed)&lt;br /&gt;
 - Approval of the timesheets per the N+1&lt;br /&gt;
&lt;br /&gt;
 [[File:timesheet_timeentry.jpg]]&lt;br /&gt;
&lt;br /&gt;
= Change logs = &lt;br /&gt;
&lt;br /&gt;
Change log from 1.5&lt;br /&gt;
 * Support dolibarr 4.0.1&lt;br /&gt;
 * Hidden option to join file to timesheets via the setting TIMESHEET_ADD_DOCS&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4.3:&lt;br /&gt;
 * Timesheet approval by N+1,&lt;br /&gt;
 * Reminder (email) for to be approved timesheet possible through dolibarr planned tasks&lt;br /&gt;
 * admin wiew for the Approval (change a approval status outside the normal approval flow)&lt;br /&gt;
 * Home box with the pending timesheet to be approved&lt;br /&gt;
 * Blocking some weekdays (e.g week ends)&lt;br /&gt;
 * Holiday showed in the timesheet&lt;br /&gt;
 * Holiday time can be included in the timesheet totals&lt;br /&gt;
 * Typo correction for French.&lt;br /&gt;
 * Posibility to add a note&lt;br /&gt;
 * Compatible with dolibarr 3.9.2&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4.1:&lt;br /&gt;
&lt;br /&gt;
 * Correction of the Spanish language (thanks to vinclar)&lt;br /&gt;
 * Possible to deactivate the dolibarr Ajax for the dropdown list for the setup page (in case of issue to add whitelist)&lt;br /&gt;
 * Keep the whitlistmode after submit / go to date / next / previsous week&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4:&lt;br /&gt;
 * Bugfix for the tasktime date in the project page&lt;br /&gt;
 * Link to have the different whitelist behaviour (black list, and none)&lt;br /&gt;
 * Spanish language (google trad)&lt;br /&gt;
 * Typo correction for French&lt;br /&gt;
 * Support the print mode for timesheet &amp;amp; the report&lt;br /&gt;
 * Show the project open to everyone on the new whitelist page&lt;br /&gt;
&lt;br /&gt;
Change log from 1.3.7:&lt;br /&gt;
 * layout improvement: timesheet, setup page, reports&lt;br /&gt;
 * whitelist to show only some project/task&lt;br /&gt;
 * taslk column customisation&lt;br /&gt;
 * new task column: company, parent task&lt;br /&gt;
 * new report option: report all, export friendly layout&lt;br /&gt;
 * user report available for the N-2, N-3&lt;br /&gt;
 &lt;br /&gt;
Change log from 1.3.6:&lt;br /&gt;
 * compatible avec dolibarr 3.7&lt;br /&gt;
 * Change log from 1.3.3:&lt;br /&gt;
 * Works with PHP&amp;lt;=5.3&lt;br /&gt;
 * Possibility to remove the 0:00&lt;br /&gt;
 * Color code for already filled tasktime / new tasktime and error&lt;br /&gt;
 * Bux fixes in the report&lt;br /&gt;
 * Better date dialog&lt;br /&gt;
 * N+1 is able to check the user report of his N&#039;s&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=36901</id>
		<title>Module Timesheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=36901"/>
		<updated>2017-03-08T15:37:26Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: /* Informations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:timesheet]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
&amp;lt;keywords content=&amp;quot;timesheet, Dolibarr,  interface, project, task, report, approval&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=timesheet&lt;br /&gt;
|editor=delcroip&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=timesheet}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=projects&lt;br /&gt;
|minversion=3.5.0&lt;br /&gt;
|maxversion=4.0.4&lt;br /&gt;
|note=Latest Module version: 1.5.1&lt;br /&gt;
|manual=[https://wiki.dolibarr.org/upload/b/bd/Module_timesheet.pdf manual]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
&lt;br /&gt;
 - Timesheet interface for all the user task per week&lt;br /&gt;
 - Generate report on user and on project per month&lt;br /&gt;
 - whitelist to show only some project/task (if no whitelist define all task are showed)&lt;br /&gt;
 - Approval of the timesheets per the N+1&lt;br /&gt;
&lt;br /&gt;
 [[File:timesheet_timeentry.jpg]]&lt;br /&gt;
&lt;br /&gt;
= Change logs = &lt;br /&gt;
&lt;br /&gt;
Change log from 1.5&lt;br /&gt;
 * Support dolibarr 4.0.1&lt;br /&gt;
 * Hidden option to join file to timesheets via the setting TIMESHEET_ADD_DOCS&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4.3:&lt;br /&gt;
 * Timesheet approval by N+1,&lt;br /&gt;
 * Reminder (email) for to be approved timesheet possible through dolibarr planned tasks&lt;br /&gt;
 * admin wiew for the Approval (change a approval status outside the normal approval flow)&lt;br /&gt;
 * Home box with the pending timesheet to be approved&lt;br /&gt;
 * Blocking some weekdays (e.g week ends)&lt;br /&gt;
 * Holiday showed in the timesheet&lt;br /&gt;
 * Holiday time can be included in the timesheet totals&lt;br /&gt;
 * Typo correction for French.&lt;br /&gt;
 * Posibility to add a note&lt;br /&gt;
 * Compatible with dolibarr 3.9.2&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4.1:&lt;br /&gt;
&lt;br /&gt;
 * Correction of the Spanish language (thanks to vinclar)&lt;br /&gt;
 * Possible to deactivate the dolibarr Ajax for the dropdown list for the setup page (in case of issue to add whitelist)&lt;br /&gt;
 * Keep the whitlistmode after submit / go to date / next / previsous week&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4:&lt;br /&gt;
 * Bugfix for the tasktime date in the project page&lt;br /&gt;
 * Link to have the different whitelist behaviour (black list, and none)&lt;br /&gt;
 * Spanish language (google trad)&lt;br /&gt;
 * Typo correction for French&lt;br /&gt;
 * Support the print mode for timesheet &amp;amp; the report&lt;br /&gt;
 * Show the project open to everyone on the new whitelist page&lt;br /&gt;
&lt;br /&gt;
Change log from 1.3.7:&lt;br /&gt;
 * layout improvement: timesheet, setup page, reports&lt;br /&gt;
 * whitelist to show only some project/task&lt;br /&gt;
 * taslk column customisation&lt;br /&gt;
 * new task column: company, parent task&lt;br /&gt;
 * new report option: report all, export friendly layout&lt;br /&gt;
 * user report available for the N-2, N-3&lt;br /&gt;
 &lt;br /&gt;
Change log from 1.3.6:&lt;br /&gt;
 * compatible avec dolibarr 3.7&lt;br /&gt;
 * Change log from 1.3.3:&lt;br /&gt;
 * Works with PHP&amp;lt;=5.3&lt;br /&gt;
 * Possibility to remove the 0:00&lt;br /&gt;
 * Color code for already filled tasktime / new tasktime and error&lt;br /&gt;
 * Bux fixes in the report&lt;br /&gt;
 * Better date dialog&lt;br /&gt;
 * N+1 is able to check the user report of his N&#039;s&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=36899</id>
		<title>Module Timesheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=36899"/>
		<updated>2017-03-08T15:32:43Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: /* Informations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:timesheet]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
&amp;lt;keywords content=&amp;quot;timesheet, Dolibarr,  interface, project, task, report, approval&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=timesheet&lt;br /&gt;
|editor=delcroip&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=timesheet}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=projects&lt;br /&gt;
|minversion=3.5.0&lt;br /&gt;
|maxversion=4.0.4&lt;br /&gt;
|note=Latest Module version: 1.5.1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
&lt;br /&gt;
 - Timesheet interface for all the user task per week&lt;br /&gt;
 - Generate report on user and on project per month&lt;br /&gt;
 - whitelist to show only some project/task (if no whitelist define all task are showed)&lt;br /&gt;
 - Approval of the timesheets per the N+1&lt;br /&gt;
&lt;br /&gt;
 [[File:timesheet_timeentry.jpg]]&lt;br /&gt;
&lt;br /&gt;
= Change logs = &lt;br /&gt;
&lt;br /&gt;
Change log from 1.5&lt;br /&gt;
 * Support dolibarr 4.0.1&lt;br /&gt;
 * Hidden option to join file to timesheets via the setting TIMESHEET_ADD_DOCS&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4.3:&lt;br /&gt;
 * Timesheet approval by N+1,&lt;br /&gt;
 * Reminder (email) for to be approved timesheet possible through dolibarr planned tasks&lt;br /&gt;
 * admin wiew for the Approval (change a approval status outside the normal approval flow)&lt;br /&gt;
 * Home box with the pending timesheet to be approved&lt;br /&gt;
 * Blocking some weekdays (e.g week ends)&lt;br /&gt;
 * Holiday showed in the timesheet&lt;br /&gt;
 * Holiday time can be included in the timesheet totals&lt;br /&gt;
 * Typo correction for French.&lt;br /&gt;
 * Posibility to add a note&lt;br /&gt;
 * Compatible with dolibarr 3.9.2&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4.1:&lt;br /&gt;
&lt;br /&gt;
 * Correction of the Spanish language (thanks to vinclar)&lt;br /&gt;
 * Possible to deactivate the dolibarr Ajax for the dropdown list for the setup page (in case of issue to add whitelist)&lt;br /&gt;
 * Keep the whitlistmode after submit / go to date / next / previsous week&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4:&lt;br /&gt;
 * Bugfix for the tasktime date in the project page&lt;br /&gt;
 * Link to have the different whitelist behaviour (black list, and none)&lt;br /&gt;
 * Spanish language (google trad)&lt;br /&gt;
 * Typo correction for French&lt;br /&gt;
 * Support the print mode for timesheet &amp;amp; the report&lt;br /&gt;
 * Show the project open to everyone on the new whitelist page&lt;br /&gt;
&lt;br /&gt;
Change log from 1.3.7:&lt;br /&gt;
 * layout improvement: timesheet, setup page, reports&lt;br /&gt;
 * whitelist to show only some project/task&lt;br /&gt;
 * taslk column customisation&lt;br /&gt;
 * new task column: company, parent task&lt;br /&gt;
 * new report option: report all, export friendly layout&lt;br /&gt;
 * user report available for the N-2, N-3&lt;br /&gt;
 &lt;br /&gt;
Change log from 1.3.6:&lt;br /&gt;
 * compatible avec dolibarr 3.7&lt;br /&gt;
 * Change log from 1.3.3:&lt;br /&gt;
 * Works with PHP&amp;lt;=5.3&lt;br /&gt;
 * Possibility to remove the 0:00&lt;br /&gt;
 * Color code for already filled tasktime / new tasktime and error&lt;br /&gt;
 * Bux fixes in the report&lt;br /&gt;
 * Better date dialog&lt;br /&gt;
 * N+1 is able to check the user report of his N&#039;s&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=36211</id>
		<title>Module Timesheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=36211"/>
		<updated>2016-09-28T15:06:09Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:timesheet]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
&amp;lt;keywords content=&amp;quot;timesheet, Dolibarr,  interface, project, task, report, approval&amp;quot; /&amp;gt;&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=timesheet&lt;br /&gt;
|editor=delcroip&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=timesheet}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=projects&lt;br /&gt;
|minversion=3.5.0&lt;br /&gt;
|maxversion=4.0.1&lt;br /&gt;
|note=Latest Module version: 1.5.1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
&lt;br /&gt;
 - Timesheet interface for all the user task per week&lt;br /&gt;
 - Generate report on user and on project per month&lt;br /&gt;
 - whitelist to show only some project/task (if no whitelist define all task are showed)&lt;br /&gt;
 - Approval of the timesheets per the N+1&lt;br /&gt;
&lt;br /&gt;
 [[File:timesheet_timeentry.jpg]]&lt;br /&gt;
&lt;br /&gt;
= Change logs = &lt;br /&gt;
&lt;br /&gt;
Change log from 1.5&lt;br /&gt;
 * Support dolibarr 4.0.1&lt;br /&gt;
 * Hidden option to join file to timesheets via the setting TIMESHEET_ADD_DOCS&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4.3:&lt;br /&gt;
 * Timesheet approval by N+1,&lt;br /&gt;
 * Reminder (email) for to be approved timesheet possible through dolibarr planned tasks&lt;br /&gt;
 * admin wiew for the Approval (change a approval status outside the normal approval flow)&lt;br /&gt;
 * Home box with the pending timesheet to be approved&lt;br /&gt;
 * Blocking some weekdays (e.g week ends)&lt;br /&gt;
 * Holiday showed in the timesheet&lt;br /&gt;
 * Holiday time can be included in the timesheet totals&lt;br /&gt;
 * Typo correction for French.&lt;br /&gt;
 * Posibility to add a note&lt;br /&gt;
 * Compatible with dolibarr 3.9.2&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4.1:&lt;br /&gt;
&lt;br /&gt;
 * Correction of the Spanish language (thanks to vinclar)&lt;br /&gt;
 * Possible to deactivate the dolibarr Ajax for the dropdown list for the setup page (in case of issue to add whitelist)&lt;br /&gt;
 * Keep the whitlistmode after submit / go to date / next / previsous week&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4:&lt;br /&gt;
 * Bugfix for the tasktime date in the project page&lt;br /&gt;
 * Link to have the different whitelist behaviour (black list, and none)&lt;br /&gt;
 * Spanish language (google trad)&lt;br /&gt;
 * Typo correction for French&lt;br /&gt;
 * Support the print mode for timesheet &amp;amp; the report&lt;br /&gt;
 * Show the project open to everyone on the new whitelist page&lt;br /&gt;
&lt;br /&gt;
Change log from 1.3.7:&lt;br /&gt;
 * layout improvement: timesheet, setup page, reports&lt;br /&gt;
 * whitelist to show only some project/task&lt;br /&gt;
 * taslk column customisation&lt;br /&gt;
 * new task column: company, parent task&lt;br /&gt;
 * new report option: report all, export friendly layout&lt;br /&gt;
 * user report available for the N-2, N-3&lt;br /&gt;
 &lt;br /&gt;
Change log from 1.3.6:&lt;br /&gt;
 * compatible avec dolibarr 3.7&lt;br /&gt;
 * Change log from 1.3.3:&lt;br /&gt;
 * Works with PHP&amp;lt;=5.3&lt;br /&gt;
 * Possibility to remove the 0:00&lt;br /&gt;
 * Color code for already filled tasktime / new tasktime and error&lt;br /&gt;
 * Bux fixes in the report&lt;br /&gt;
 * Better date dialog&lt;br /&gt;
 * N+1 is able to check the user report of his N&#039;s&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=36210</id>
		<title>Module Timesheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=36210"/>
		<updated>2016-09-28T15:05:45Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:timesheet]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
&amp;lt;keywords content=&amp;quot;timesheet, Dolibarr,  interface, project, task, report, approval&amp;quot; /&amp;gt;&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=timesheet&lt;br /&gt;
|editor=delcroip&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=timesheet}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=projects&lt;br /&gt;
|minversion=3.5.0&lt;br /&gt;
|maxversion=4.0.1&lt;br /&gt;
|note=Latest Module version: 1.5.1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
&lt;br /&gt;
- Timesheet interface for all the user task per week&lt;br /&gt;
- Generate report on user and on project per month&lt;br /&gt;
- whitelist to show only some project/task (if no whitelist define all task are showed)&lt;br /&gt;
- Approval of the timesheets per the N+1&lt;br /&gt;
&lt;br /&gt;
 [[File:timesheet_timeentry.jpg]]&lt;br /&gt;
&lt;br /&gt;
= Change logs = &lt;br /&gt;
&lt;br /&gt;
Change log from 1.5&lt;br /&gt;
 * Support dolibarr 4.0.1&lt;br /&gt;
 * Hidden option to join file to timesheets via the setting TIMESHEET_ADD_DOCS&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4.3:&lt;br /&gt;
 * Timesheet approval by N+1,&lt;br /&gt;
 * Reminder (email) for to be approved timesheet possible through dolibarr planned tasks&lt;br /&gt;
 * admin wiew for the Approval (change a approval status outside the normal approval flow)&lt;br /&gt;
 * Home box with the pending timesheet to be approved&lt;br /&gt;
 * Blocking some weekdays (e.g week ends)&lt;br /&gt;
 * Holiday showed in the timesheet&lt;br /&gt;
 * Holiday time can be included in the timesheet totals&lt;br /&gt;
 * Typo correction for French.&lt;br /&gt;
 * Posibility to add a note&lt;br /&gt;
 * Compatible with dolibarr 3.9.2&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4.1:&lt;br /&gt;
&lt;br /&gt;
 * Correction of the Spanish language (thanks to vinclar)&lt;br /&gt;
 * Possible to deactivate the dolibarr Ajax for the dropdown list for the setup page (in case of issue to add whitelist)&lt;br /&gt;
 * Keep the whitlistmode after submit / go to date / next / previsous week&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4:&lt;br /&gt;
 * Bugfix for the tasktime date in the project page&lt;br /&gt;
 * Link to have the different whitelist behaviour (black list, and none)&lt;br /&gt;
 * Spanish language (google trad)&lt;br /&gt;
 * Typo correction for French&lt;br /&gt;
 * Support the print mode for timesheet &amp;amp; the report&lt;br /&gt;
 * Show the project open to everyone on the new whitelist page&lt;br /&gt;
&lt;br /&gt;
Change log from 1.3.7:&lt;br /&gt;
 * layout improvement: timesheet, setup page, reports&lt;br /&gt;
 * whitelist to show only some project/task&lt;br /&gt;
 * taslk column customisation&lt;br /&gt;
 * new task column: company, parent task&lt;br /&gt;
 * new report option: report all, export friendly layout&lt;br /&gt;
 * user report available for the N-2, N-3&lt;br /&gt;
 &lt;br /&gt;
Change log from 1.3.6:&lt;br /&gt;
 * compatible avec dolibarr 3.7&lt;br /&gt;
 * Change log from 1.3.3:&lt;br /&gt;
 * Works with PHP&amp;lt;=5.3&lt;br /&gt;
 * Possibility to remove the 0:00&lt;br /&gt;
 * Color code for already filled tasktime / new tasktime and error&lt;br /&gt;
 * Bux fixes in the report&lt;br /&gt;
 * Better date dialog&lt;br /&gt;
 * N+1 is able to check the user report of his N&#039;s&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=36209</id>
		<title>Module Timesheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=36209"/>
		<updated>2016-09-28T15:02:57Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:timesheet]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
&amp;lt;keywords content=&amp;quot;timesheet, Dolibarr,  interface, project, task, report, approval&amp;quot; /&amp;gt;&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=timesheet&lt;br /&gt;
|editor=delcroip&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=timesheet}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=projects&lt;br /&gt;
|minversion=3.5.0&lt;br /&gt;
|maxversion=4.0.1&lt;br /&gt;
|note=Latest Module version: 1.5.1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
&lt;br /&gt;
- Timesheet interface for all the user task per week&lt;br /&gt;
- Generate report on user and on project per month&lt;br /&gt;
- whitelist to show only some project/task (if no whitelist define all task are showed)&lt;br /&gt;
- Approval of the timesheets per the N+1&lt;br /&gt;
&lt;br /&gt;
 [[File:timesheet_timeentry.jpg]]&lt;br /&gt;
&lt;br /&gt;
Change log from 1.5&lt;br /&gt;
- Support dolibarr 4.0.1&lt;br /&gt;
- Hidden option to join file to timesheets via the setting TIMESHEET_ADD_DOCS&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4.3:&lt;br /&gt;
- Timesheet approval by N+1,&lt;br /&gt;
- Reminder (email) for to be approved timesheet possible through dolibarr planned tasks&lt;br /&gt;
- admin wiew for the Approval (change a approval status outside the normal approval flow)&lt;br /&gt;
- Home box with the pending timesheet to be approved&lt;br /&gt;
- Blocking some weekdays (e.g week ends)&lt;br /&gt;
- Holiday showed in the timesheet&lt;br /&gt;
- Holiday time can be included in the timesheet totals&lt;br /&gt;
- Typo correction for French.&lt;br /&gt;
- Posibility to add a note&lt;br /&gt;
- Compatible with dolibarr 3.9.2&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4.1:&lt;br /&gt;
&lt;br /&gt;
- Correction of the Spanish language (thanks to vinclar)&lt;br /&gt;
- Possible to deactivate the dolibarr Ajax for the dropdown list for the setup page (in case of issue to add whitelist)&lt;br /&gt;
- Keep the whitlistmode after submit / go to date / next / previsous week&lt;br /&gt;
&lt;br /&gt;
Change log from 1.4:&lt;br /&gt;
- Bugfix for the tasktime date in the project page&lt;br /&gt;
- Link to have the different whitelist behaviour (black list, and none)&lt;br /&gt;
- Spanish language (google trad)&lt;br /&gt;
- Typo correction for French&lt;br /&gt;
- Support the print mode for timesheet &amp;amp; the report&lt;br /&gt;
- Show the project open to everyone on the new whitelist page&lt;br /&gt;
&lt;br /&gt;
Change log from 1.3.7:&lt;br /&gt;
- layout improvement: timesheet, setup page, reports&lt;br /&gt;
- whitelist to show only some project/task&lt;br /&gt;
- taslk column customisation&lt;br /&gt;
- new task column: company, parent task&lt;br /&gt;
- new report option: report all, export friendly layout&lt;br /&gt;
- user report available for the N-2, N-3&lt;br /&gt;
&lt;br /&gt;
Change log from 1.3.6:&lt;br /&gt;
- compatible avec dolibarr 3.7&lt;br /&gt;
- Change log from 1.3.3:&lt;br /&gt;
- Works with PHP&amp;lt;=5.3&lt;br /&gt;
- Possibility to remove the 0:00&lt;br /&gt;
- Color code for already filled tasktime / new tasktime and error&lt;br /&gt;
- Bux fixes in the report&lt;br /&gt;
- Better date dialog&lt;br /&gt;
- N+1 is able to check the user report of his N&#039;s&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=File:Timesheet_timeentry.jpg&amp;diff=36208</id>
		<title>File:Timesheet timeentry.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=File:Timesheet_timeentry.jpg&amp;diff=36208"/>
		<updated>2016-09-28T14:50:41Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: screenshot of module timesheet:
user display of an empty timesheet&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;screenshot of module timesheet:&lt;br /&gt;
user display of an empty timesheet&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=36207</id>
		<title>Module Timesheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=36207"/>
		<updated>2016-09-28T14:48:58Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:timesheet]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
&amp;lt;keywords content=&amp;quot;timesheet, Dolibarr,  interface, project, task, report, approval&amp;quot; /&amp;gt;&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=timesheet&lt;br /&gt;
|editor=delcroip&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=timesheet}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=projects&lt;br /&gt;
|minversion=3.5.0&lt;br /&gt;
|maxversion=4.0.1&lt;br /&gt;
|note=Latest Module version: 1.5.1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
&lt;br /&gt;
- Timesheet interface for all the user task per week&lt;br /&gt;
- Generate report on user and on project per month&lt;br /&gt;
- whitelist to show only some project/task (if no whitelist define all task are showed)&lt;br /&gt;
- Approval of the timesheets per the N+1&lt;br /&gt;
&lt;br /&gt;
 [[File:timesheet_timeentry.jpg]]&lt;br /&gt;
&lt;br /&gt;
Change log from 1.5&lt;br /&gt;
&lt;br /&gt;
Support dolibarr 4.0.1&lt;br /&gt;
hidden option to join file to timesheets via the setting TIMESHEET_ADD_DOCS&lt;br /&gt;
Change log from 1.4.3:&lt;br /&gt;
&lt;br /&gt;
Timesheet approval by N+1,&lt;br /&gt;
Reminder (email) for to be approved timesheet possible through dolibarr planned tasks&lt;br /&gt;
admin wiew for the Approval (change a approval status outside the normal approval flow)&lt;br /&gt;
Home box with the pending timesheet to be approved&lt;br /&gt;
Blocking some weekdays (e.g week ends)&lt;br /&gt;
Holiday showed in the timesheet&lt;br /&gt;
Holiday time can be included in the timesheet totals&lt;br /&gt;
Typo correction for French.&lt;br /&gt;
Posibility to add a note&lt;br /&gt;
Compatible with dolibarr 3.9.2&lt;br /&gt;
Change log from 1.4.1:&lt;br /&gt;
&lt;br /&gt;
correction of the Spanish language (thanks to vinclar)&lt;br /&gt;
possible to deactivate the dolibarr Ajax for the dropdown list for the setup page (in case of issue to add whitelist)&lt;br /&gt;
keep the whitlistmode after submit / go to date / next / previsous week&lt;br /&gt;
Change log from 1.4:&lt;br /&gt;
&lt;br /&gt;
bugfix for the tasktime date in the project page&lt;br /&gt;
link to have the different whitelist behaviour (black list, and none)&lt;br /&gt;
Spanish language (google trad)&lt;br /&gt;
typo correction for French&lt;br /&gt;
support the print mode for timesheet &amp;amp; the report&lt;br /&gt;
show the project open to everyone on the new whitelist page&lt;br /&gt;
Change log from 1.3.7:&lt;br /&gt;
&lt;br /&gt;
layout improvement: timesheet, setup page, reports&lt;br /&gt;
whitelist to show only some project/task&lt;br /&gt;
taslk column customisation&lt;br /&gt;
new task column: company, parent task&lt;br /&gt;
new report option: report all, export friendly layout&lt;br /&gt;
user report available for the N-2, N-3&lt;br /&gt;
Change log from 1.3.6:&lt;br /&gt;
&lt;br /&gt;
compatible avec dolibarr 3.7&lt;br /&gt;
Change log from 1.3.3:&lt;br /&gt;
&lt;br /&gt;
Works with PHP&amp;lt;=5.3&lt;br /&gt;
Possibility to remove the 0:00&lt;br /&gt;
Color code for already filled tasktime / new tasktime and error&lt;br /&gt;
Bux fixes in the report&lt;br /&gt;
Better date dialog&lt;br /&gt;
N+1 is able to check the user report of his N&#039;s&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=36204</id>
		<title>Module Timesheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Timesheet&amp;diff=36204"/>
		<updated>2016-09-27T21:08:07Z</updated>

		<summary type="html">&lt;p&gt;Delcroip: Creation of the timesheet page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:timesheet]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
&amp;lt;keywords content=&amp;quot;timesheet, Dolibarr,  interface, project, task, report, approval&amp;quot; /&amp;gt;&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=timesheet&lt;br /&gt;
|editor=delcroip&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=timesheet}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=projects&lt;br /&gt;
|minversion=3.5.0&lt;br /&gt;
|maxversion=4.0.1&lt;br /&gt;
|note=&lt;br /&gt;
}}&lt;br /&gt;
= Features =&lt;br /&gt;
this module enable user to enter their time per week for all their tasks&lt;/div&gt;</summary>
		<author><name>Delcroip</name></author>
	</entry>
</feed>