<?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=Aikhan</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=Aikhan"/>
	<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php/Special:Contributions/Aikhan"/>
	<updated>2026-10-22T06:14:33Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_development&amp;diff=38079</id>
		<title>Module development</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_development&amp;diff=38079"/>
		<updated>2017-12-29T06:00:51Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Generate the PHP DAO class */&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;
&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;dev/skeletons&#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;skeletons_page.php&#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;
$res=0;&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;);			// to work if your module directory is into dolibarr root htdocs directory&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;);		// to work if your module directory is into a subdir of root htdocs directory&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;
require(&#039;../main.inc.php&#039;);&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>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Sales_Orders_(developer)&amp;diff=37314</id>
		<title>Module Sales Orders (developer)</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Sales_Orders_(developer)&amp;diff=37314"/>
		<updated>2017-05-17T04:12:40Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Feature */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Orders]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateModEN Developer}}&lt;br /&gt;
{{BasculeDevUserEn|&lt;br /&gt;
name=Order|&lt;br /&gt;
num=25|&lt;br /&gt;
devdoc=This page|&lt;br /&gt;
userdoc=[[Module Customers Orders]]|}}&lt;br /&gt;
&lt;br /&gt;
= Feature =&lt;br /&gt;
{{ToTranslate}}&lt;br /&gt;
&lt;br /&gt;
Customer orders module allows you to manage the following entities in Dolibarr:&lt;br /&gt;
* Customer orders&lt;br /&gt;
* Lines of customer order&lt;br /&gt;
Supplier orders are managed by the &#039;&#039;&#039;[[Module Suppliers (developer)]]&#039;&#039;&#039; module.&lt;br /&gt;
&lt;br /&gt;
= Entity Order =&lt;br /&gt;
{{TemplateDocDevEntityEn|&lt;br /&gt;
class=htdocs/commande/class/commande.class.php}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Business rules&#039;&#039;&#039;:&lt;br /&gt;
* A command/order has several command/order lines&lt;br /&gt;
* It is possible to attach 1 to n contacts for an order&lt;br /&gt;
* To complete...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Life Cycle&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
* An order can be created in draft mode (Causes trigger ORDER_CREATE)&lt;br /&gt;
* An order can be changed (Causes trigger ORDER_UPDATE)&lt;br /&gt;
* An order can be validated (Causes trigger ORDER_VALIDATE)&lt;br /&gt;
&lt;br /&gt;
= Permissions =&lt;br /&gt;
*-&amp;gt;commande-&amp;gt;lire&lt;br /&gt;
*-&amp;gt;commande-&amp;gt;creer&lt;br /&gt;
*-&amp;gt;commande-&amp;gt;valider&lt;br /&gt;
*-&amp;gt;commande-&amp;gt;envoyer&lt;br /&gt;
*-&amp;gt;commande-&amp;gt;cloturer&lt;br /&gt;
*-&amp;gt;commande-&amp;gt;annuler&lt;br /&gt;
*-&amp;gt;commande-&amp;gt;supprimer&lt;br /&gt;
*-&amp;gt;commande-&amp;gt;export&lt;br /&gt;
&lt;br /&gt;
= Tables SQL =&lt;br /&gt;
* [[Table llx commande|llx_commande]] table principales des commandes clients&lt;br /&gt;
* [[Table llx commandedet|llx_commandedet]] détails des commandes clients&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Sales_Orders_(developer)&amp;diff=37313</id>
		<title>Module Sales Orders (developer)</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Sales_Orders_(developer)&amp;diff=37313"/>
		<updated>2017-05-17T04:11:07Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Feature */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Orders]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateModEN Developer}}&lt;br /&gt;
{{BasculeDevUserEn|&lt;br /&gt;
name=Order|&lt;br /&gt;
num=25|&lt;br /&gt;
devdoc=This page|&lt;br /&gt;
userdoc=[[Module Customers Orders]]|}}&lt;br /&gt;
&lt;br /&gt;
= Feature =&lt;br /&gt;
{{ToTranslate}}&lt;br /&gt;
&lt;br /&gt;
Customer orders module allows you to manage the following entities in Dolibarr:&lt;br /&gt;
* Customer orders&lt;br /&gt;
* Lines of customer order&lt;br /&gt;
Supplier orders are managed by the &#039;&#039;&#039;[[Media:Module Suppliers (developer)]]&#039;&#039;&#039; module.&lt;br /&gt;
&lt;br /&gt;
= Entity Order =&lt;br /&gt;
{{TemplateDocDevEntityEn|&lt;br /&gt;
class=htdocs/commande/class/commande.class.php}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Business rules&#039;&#039;&#039;:&lt;br /&gt;
* A command/order has several command/order lines&lt;br /&gt;
* It is possible to attach 1 to n contacts for an order&lt;br /&gt;
* To complete...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Life Cycle&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
* An order can be created in draft mode (Causes trigger ORDER_CREATE)&lt;br /&gt;
* An order can be changed (Causes trigger ORDER_UPDATE)&lt;br /&gt;
* An order can be validated (Causes trigger ORDER_VALIDATE)&lt;br /&gt;
&lt;br /&gt;
= Permissions =&lt;br /&gt;
*-&amp;gt;commande-&amp;gt;lire&lt;br /&gt;
*-&amp;gt;commande-&amp;gt;creer&lt;br /&gt;
*-&amp;gt;commande-&amp;gt;valider&lt;br /&gt;
*-&amp;gt;commande-&amp;gt;envoyer&lt;br /&gt;
*-&amp;gt;commande-&amp;gt;cloturer&lt;br /&gt;
*-&amp;gt;commande-&amp;gt;annuler&lt;br /&gt;
*-&amp;gt;commande-&amp;gt;supprimer&lt;br /&gt;
*-&amp;gt;commande-&amp;gt;export&lt;br /&gt;
&lt;br /&gt;
= Tables SQL =&lt;br /&gt;
* [[Table llx commande|llx_commande]] table principales des commandes clients&lt;br /&gt;
* [[Table llx commandedet|llx_commandedet]] détails des commandes clients&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Sales_Orders_(developer)&amp;diff=37312</id>
		<title>Module Sales Orders (developer)</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Sales_Orders_(developer)&amp;diff=37312"/>
		<updated>2017-05-17T04:02:22Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Feature */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Orders]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateModEN Developer}}&lt;br /&gt;
{{BasculeDevUserEn|&lt;br /&gt;
name=Order|&lt;br /&gt;
num=25|&lt;br /&gt;
devdoc=This page|&lt;br /&gt;
userdoc=[[Module Customers Orders]]|}}&lt;br /&gt;
&lt;br /&gt;
= Feature =&lt;br /&gt;
{{ToTranslate}}&lt;br /&gt;
&lt;br /&gt;
Customer orders module allows you to manage the following entities in Dolibarr:&lt;br /&gt;
* Customer orders&lt;br /&gt;
* order lines&lt;br /&gt;
Supplier orders are managed by the &#039;&#039;&#039;supplier&#039;&#039;&#039; module.&lt;br /&gt;
&lt;br /&gt;
= Entity Order =&lt;br /&gt;
{{TemplateDocDevEntityEn|&lt;br /&gt;
class=htdocs/commande/class/commande.class.php}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Business rules&#039;&#039;&#039;:&lt;br /&gt;
* A command/order has several command/order lines&lt;br /&gt;
* It is possible to attach 1 to n contacts for an order&lt;br /&gt;
* To complete...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Life Cycle&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
* An order can be created in draft mode (Causes trigger ORDER_CREATE)&lt;br /&gt;
* An order can be changed (Causes trigger ORDER_UPDATE)&lt;br /&gt;
* An order can be validated (Causes trigger ORDER_VALIDATE)&lt;br /&gt;
&lt;br /&gt;
= Permissions =&lt;br /&gt;
*-&amp;gt;commande-&amp;gt;lire&lt;br /&gt;
*-&amp;gt;commande-&amp;gt;creer&lt;br /&gt;
*-&amp;gt;commande-&amp;gt;valider&lt;br /&gt;
*-&amp;gt;commande-&amp;gt;envoyer&lt;br /&gt;
*-&amp;gt;commande-&amp;gt;cloturer&lt;br /&gt;
*-&amp;gt;commande-&amp;gt;annuler&lt;br /&gt;
*-&amp;gt;commande-&amp;gt;supprimer&lt;br /&gt;
*-&amp;gt;commande-&amp;gt;export&lt;br /&gt;
&lt;br /&gt;
= Tables SQL =&lt;br /&gt;
* [[Table llx commande|llx_commande]] table principales des commandes clients&lt;br /&gt;
* [[Table llx commandedet|llx_commandedet]] détails des commandes clients&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=General_information_on_usage&amp;diff=36894</id>
		<title>General information on usage</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=General_information_on_usage&amp;diff=36894"/>
		<updated>2017-03-04T07:12:24Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TemplateDocUser}}&lt;br /&gt;
= Starting the application: =&lt;br /&gt;
To begin, launch the application, either by clicking on the icon installed on your desktop by the installation package or by typing appropriate URL in your web browser (The URL can be of the form http://localhost/dolibarr/ for local installation but can be different in the case of a manual installation, in that case it will depend on the configuration of your Web server).&lt;br /&gt;
&lt;br /&gt;
After launching application, you should see the login page with at least 2 fields:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Login&#039;&#039;&#039;: the login of user to connect. If this is a first usage, it is the user entered at last step of the installation (eg admin)&lt;br /&gt;
* &#039;&#039;&#039;Password&#039;&#039;&#039;: the password of user to connect. If this is a first usage, it is the password entered at last step of the installation (eg changeme)&lt;br /&gt;
[[File: identification.jpg | 360px |center]]&lt;br /&gt;
&lt;br /&gt;
= Homepage =&lt;br /&gt;
Once logged in, you see the home page. It contains menu bars (one horizontal bar and one vertical bar) and more informations in the center:&lt;br /&gt;
&lt;br /&gt;
*A box reminding your login account and the date of last access.&lt;br /&gt;
*A box of statistics related to all activated modules.&lt;br /&gt;
*A box showing &#039;tasks&#039; table (table containing informations of tasks to be done and tasks behind schedule). A weather sums it up.&lt;br /&gt;
*In the lower part, there may be other information boxes. The list depends upon boxes activated via the menu &#039;&#039;&#039;Home-&amp;gt;Setup-&amp;gt;Boxes&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Using the menus =&lt;br /&gt;
Each menu in the horizontal bar is related to one module. When a module is activated its associated menu appears in the horizontal menu bar. The menu entry of a module does not appear in the menus until the module has been activated. To activate a module, see page [[First_setup]].&lt;br /&gt;
&lt;br /&gt;
To use a module, click the menu associated with the module, a menu appears in the vertical bar to perform various tasks related to that module.&lt;br /&gt;
&lt;br /&gt;
For example, to list the products in stock (function provided by the Products and Stock modules), click on the menu Products / Services:&lt;br /&gt;
&lt;br /&gt;
[[File:liste_produits.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Once a top menu has been selected a left menu appears with various tasks related to the activated module.&lt;br /&gt;
&lt;br /&gt;
For example, menu you can see once top menu Products / Services has been selected:&lt;br /&gt;
&lt;br /&gt;
[[File:menuproduits.jpg|200px]]&lt;br /&gt;
&lt;br /&gt;
Note that the organization of the menus depends on the choice of menu manager configured in &#039;&#039;&#039;Home-&amp;gt;Setup-&amp;gt;Menus&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Objects =&lt;br /&gt;
Objects are the generic terms to speak about records managed by the application. It can be for example: a customer, a supplier, an invoice, an order, a proposal, an agenda event, a user, ...&lt;br /&gt;
&lt;br /&gt;
Each object is managed by a Dolibarr module. Depending on the module you enabled or not, some objects may or may not appear in the application.&lt;br /&gt;
Dolibarr policy is to use a common way of working for each managed modules or objects.&lt;br /&gt;
So, for each object, you will find a menu entry to Create (menu is called &amp;quot;New Object&amp;quot;) and a menu entry to list all objects (menu is called &amp;quot;List&amp;quot;).&lt;br /&gt;
Then clicking on an object found in a list, you can read all properties of the object arranged in several tabs. A button &amp;quot;Modify&amp;quot; is visible to the allowed user to edit the object.&lt;br /&gt;
&lt;br /&gt;
For example, this is a view of left menu to manage third-parties, and card of a selected third-party (click to enlarge):&lt;br /&gt;
&lt;br /&gt;
[[Image:Screenshot thirdparty.png|480px]]&lt;br /&gt;
&lt;br /&gt;
Also, in the list view (clicking menu &amp;quot;List&amp;quot; in the vertical menus), a status symbol/signage will appear in the last column of list of objects. The symbol/signage varies according to object&#039;s status within the workflow.&lt;br /&gt;
Symbol/signage of status depends on object and its options defined in the module setup dedicated to object management.&lt;br /&gt;
Current definition and symbol/signage of status are (with default theme &amp;quot;eldy&amp;quot;) :&lt;br /&gt;
* [[Image:statut0.png]] Draft Status - Object is not yet validated (White color, no action can be taken on object)&lt;br /&gt;
* [[Image:statut1.png]] Validated Status - Object is validated and some actions are now expected on the object (Yellow color).&lt;br /&gt;
* [[Image:statut3.png]] More advanced status than Validated - Some actions have been taken on the object, but still some action(s) are expected on it (Color is partially yellow)&lt;br /&gt;
* [[Image:statut4.png]] Processed, Active or Enabled Status - No particular action is expected for the object any more, although some event may still occur (Green color, means everything is ok currently)&lt;br /&gt;
* [[Image:statut5.png]] Cancelled Status - No specific action can occur for this object (White color with Cross, white means &amp;quot;no action can be taken&amp;quot; and the cross means &amp;quot;anymore&amp;quot;)&lt;br /&gt;
* [[Image:statut8.png]] Error Status - This status means that there is a critical problem to fix for the object (red color means error)&lt;br /&gt;
Note that with other themes, meaning of status will not differ, but color code may change (for example a theme may decide that good color for cancel symbol is &amp;quot;orange&amp;quot; and not &amp;quot;white crossed&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
Each feature is provided by a module. All modules are documented in the module documentation. For a complete list of modules and their documentation, see the following pages:&lt;br /&gt;
&lt;br /&gt;
*The list of standard modules is defined in page [[:Category:List_of_Modules]]&lt;br /&gt;
*The list of external modules (add-ons not provided by default) is set in the complementary modules page [[:Category:Complementary_modules]]&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=General_information_on_usage&amp;diff=36893</id>
		<title>General information on usage</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=General_information_on_usage&amp;diff=36893"/>
		<updated>2017-03-04T07:04:27Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TemplateDocUser}}&lt;br /&gt;
= Starting the application: =&lt;br /&gt;
To begin, launch the application, either by clicking on the icon installed on your desktop by the installation package or by typing appropriate URL in your web browser (The URL can be of the form http://localhost/dolibarr/ for local installation but can be different in the case of a manual installation, in that case it will depend on the configuration of your Web server).&lt;br /&gt;
&lt;br /&gt;
After launching application, you should see the login page with at least 2 fields:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Login&#039;&#039;&#039;: the login of user to connect. If this is a first usage, it is the user entered at last step of the installation (eg admin)&lt;br /&gt;
* &#039;&#039;&#039;Password&#039;&#039;&#039;: the password of user to connect. If this is a first usage, it is the password entered at last step of the installation (eg changeme)&lt;br /&gt;
[[File: identification.jpg | 360px |center]]&lt;br /&gt;
&lt;br /&gt;
= Homepage =&lt;br /&gt;
Once logged in, you see the home page. It contains menu bars (one horizontal bar and one vertical bar) and more informations in the center:&lt;br /&gt;
&lt;br /&gt;
*A box reminding your login account and the date of last access.&lt;br /&gt;
*A box of statistics related to all activated modules.&lt;br /&gt;
*A box showing &#039;tasks&#039; table (table containing informations of tasks to be done and tasks behind schedule). A weather sums it up.&lt;br /&gt;
*In the lower part, there may be other information boxes. The list depends upon boxes activated via the menu &#039;&#039;&#039;Home-&amp;gt;Setup-&amp;gt;Boxes&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Using the menus =&lt;br /&gt;
Each menu in the horizontal bar is related to one module. When a module is activated its associated menu appears in the horizontal menu bar. The menu entry of a module does not appear in the menus until the module has been activated. To activate a module, see page [[First_setup]].&lt;br /&gt;
&lt;br /&gt;
To use a module, click the menu associated with the module, a menu appears in the vertical bar to perform various tasks related to that module.&lt;br /&gt;
&lt;br /&gt;
For example, to list the products in stock (function provided by the Products and Stock modules), click on the menu Products / Services:&lt;br /&gt;
&lt;br /&gt;
[[File:liste_produits.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Once a top menu has been selected a left menu appears with various tasks related to the activated module.&lt;br /&gt;
&lt;br /&gt;
For example, menu you can see once top menu Products / Services has been selected:&lt;br /&gt;
&lt;br /&gt;
[[File:menuproduits.jpg|200px]]&lt;br /&gt;
&lt;br /&gt;
Note that the organization of the menus depends on the choice of menu manager configured in &#039;&#039;&#039;Home-&amp;gt;Setup-&amp;gt;Menus&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Objects =&lt;br /&gt;
Objects are the generic terms to speak about records managed by the application. It can be for example: a customer, a supplier, an invoice, an order, a proposal, an agenda event, a user, ...&lt;br /&gt;
&lt;br /&gt;
Each object is managed by a Dolibarr module. Depending on the module you enabled or not, some objects may or may not appear in the application.&lt;br /&gt;
Dolibarr policy is to use a common way of working for each managed modules or objects.&lt;br /&gt;
So, for each object, you will find a menu entry to Create (menu is called &amp;quot;New Object&amp;quot;) and a menu entry to list all objects (menu is called &amp;quot;List&amp;quot;).&lt;br /&gt;
Then clicking on an object found in a list, you can read all properties of the object arranged in several tabs. A button &amp;quot;Modify&amp;quot; is visible to the allowed user to edit the object.&lt;br /&gt;
&lt;br /&gt;
For example, this is a view of left menu to manage third-parties, and card of a selected third-party (click to enlarge):&lt;br /&gt;
&lt;br /&gt;
[[Image:Screenshot thirdparty.png|480px]]&lt;br /&gt;
&lt;br /&gt;
Also, in the list view (clicking menu &amp;quot;List&amp;quot; in the vertical menus), a status symbol/signage will appear in the last column of list of objects. The symbol/signage varies according to object&#039;s status within the workflow.&lt;br /&gt;
Symbol/signage of status depends on object and its options defined in the module setup dedicated to object management.&lt;br /&gt;
Current definition and symbol/signage of status are (with default theme &amp;quot;eldy&amp;quot;) :&lt;br /&gt;
* [[Image:statut0.png]] Draft Status - Object is not yet validated (White color, no action can be taken on object)&lt;br /&gt;
* [[Image:statut1.png]] Validated Status - Some actions are now expected on the object (Yellow color).&lt;br /&gt;
* [[Image:statut3.png]] More advanced status than Validated - Some actions have been taken on the object, but still some action(s) are expected on it (Color is partially yellow)&lt;br /&gt;
* [[Image:statut4.png]] Processed, Active or Enabled - No particular action is expected for the object any more, although some event may still occur (Green color, means everything is ok currently)&lt;br /&gt;
* [[Image:statut5.png]] Cancelled Status - No more action is expected on the object. No specific event can occur for this object (White color with Cross, white means &amp;quot;no action can be taken&amp;quot; and the cross means &amp;quot;anymore&amp;quot;)&lt;br /&gt;
* [[Image:statut8.png]] Error - There is a problem. This status means that there is a critical problem to fix for the object (red color means error)&lt;br /&gt;
Note that with other themes, meaning of status will not differ, but color code may change (for example a theme may decide that good color for cancel symbol is &amp;quot;orange&amp;quot; and not &amp;quot;white crossed&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
Each feature is provided by a module. All modules are documented in the module documentation. For a complete list of modules and their documentation, see the following pages:&lt;br /&gt;
&lt;br /&gt;
*The list of standard modules is defined in page [[:Category:List_of_Modules]]&lt;br /&gt;
*The list of external modules (add-ons not provided by default) is set in the complementary modules page [[:Category:Complementary_modules]]&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=General_information_on_usage&amp;diff=36892</id>
		<title>General information on usage</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=General_information_on_usage&amp;diff=36892"/>
		<updated>2017-03-04T06:41:38Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TemplateDocUser}}&lt;br /&gt;
= Starting the application: =&lt;br /&gt;
To begin, launch the application, either by clicking on the icon installed on your desktop by the installation package or by typing appropriate URL in your web browser (The URL can be of the form http://localhost/dolibarr/ for local installation but can be different in the case of a manual installation, in that case it will depend on the configuration of your Web server).&lt;br /&gt;
&lt;br /&gt;
After launching application, you should see the login page with at least 2 fields:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Login&#039;&#039;&#039;: the login of user to connect. If this is a first usage, it is the user entered at last step of the installation (eg admin)&lt;br /&gt;
* &#039;&#039;&#039;Password&#039;&#039;&#039;: the password of user to connect. If this is a first usage, it is the password entered at last step of the installation (eg changeme)&lt;br /&gt;
[[File: identification.jpg | 360px |center]]&lt;br /&gt;
&lt;br /&gt;
= Homepage =&lt;br /&gt;
Once logged in, you see the home page. It contains menu bars (one horizontal bar and one vertical bar) and more informations in the center:&lt;br /&gt;
&lt;br /&gt;
*A box reminding your login account and the date of last access.&lt;br /&gt;
*A box of statistics related to all activated modules.&lt;br /&gt;
*A box showing &#039;tasks&#039; table (table containing informations of tasks to be done and tasks behind schedule). A weather sums it up.&lt;br /&gt;
*In the lower part, there may be other information boxes. The list depends upon boxes activated via the menu &#039;&#039;&#039;Home-&amp;gt;Setup-&amp;gt;Boxes&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Using the menus =&lt;br /&gt;
Each menu in the horizontal bar is related to one module. When a module is activated its associated menu appears in the horizontal menu bar. The menu entry of a module does not appear in the menus until the module has been activated. To activate a module, see page [[First_setup]].&lt;br /&gt;
&lt;br /&gt;
To use a module, click the menu associated with the module, a menu appears in the vertical bar to perform various tasks related to that module.&lt;br /&gt;
&lt;br /&gt;
For example, to list the products in stock (function provided by the Products and Stock modules), click on the menu Products / Services:&lt;br /&gt;
&lt;br /&gt;
[[File:liste_produits.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Once a top menu has been selected a left menu appears with various tasks related to the activated module.&lt;br /&gt;
&lt;br /&gt;
For example, menu you can see once top menu Products / Services has been selected:&lt;br /&gt;
&lt;br /&gt;
[[File:menuproduits.jpg|200px]]&lt;br /&gt;
&lt;br /&gt;
Note that the organization of the menus depends on the choice of menu manager configured in &#039;&#039;&#039;Home-&amp;gt;Setup-&amp;gt;Menus&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Objects =&lt;br /&gt;
Objects are the generic terms to speak about records managed by the application. It can be for example: a customer, a supplier, an invoice, an order, a proposal, an agenda event, a user, ...&lt;br /&gt;
&lt;br /&gt;
Each object is managed by a Dolibarr module. Depending on the module you enabled or not, some objects may or may not appear in the application.&lt;br /&gt;
Dolibarr policy is to use a common way of working for each managed modules or objects.&lt;br /&gt;
So, for each object, you will find a menu entry to Create (menu is called &amp;quot;New Object&amp;quot;) and a menu entry to list all objects (menu is called &amp;quot;List&amp;quot;).&lt;br /&gt;
Then clicking on an object found in a list, you can read all properties of the object arranged in several tabs. A button &amp;quot;Modify&amp;quot; is visible to the allowed user to edit the object.&lt;br /&gt;
&lt;br /&gt;
For example, this is a view of left menu to manage third-parties, and card of a selected third-party (click to enlarge):&lt;br /&gt;
&lt;br /&gt;
[[Image:Screenshot thirdparty.png|480px]]&lt;br /&gt;
&lt;br /&gt;
Also, in the list view (clicking menu &amp;quot;List&amp;quot; in the vertical menus), a status symbol/signage will appear in the last column of list of objects. The symbol/signage varies according to object&#039;s status within the workflow.&lt;br /&gt;
Symbol/signage of status depends on object and its options defined in the module setup dedicated to object management.&lt;br /&gt;
Current definition and symbol/signage of status are (with default theme &amp;quot;eldy&amp;quot;) :&lt;br /&gt;
* [[Image:statut0.png]] Draft - Status when object is not yet validated (white color means &amp;quot;don&#039;t take care of me&amp;quot; yet)&lt;br /&gt;
* [[Image:statut1.png]] Validated - Some actions are expected for the object (that&#039;s why color is yellow).&lt;br /&gt;
* [[Image:statut3.png]] It is a more advanced status than Validated, some actions have been taken on the object, but some action(s) are still expected on it (that&#039;s why color is partially yellow)&lt;br /&gt;
* [[Image:statut4.png]] Processed or Active or Enabled - No particular action is expected for the object anymore, even if some event may still occur (green color means everything is ok currently)&lt;br /&gt;
* [[Image:statut5.png]] Cancelled - No more action is expected on the object. No specific event can occur for this object (white color means &amp;quot;don&#039;t take care of me&amp;quot; and the cross means &amp;quot;anymore&amp;quot;)&lt;br /&gt;
* [[Image:statut8.png]] Error - There is a problem. This status means that there is a critical problem to fix for the object (red color means error)&lt;br /&gt;
Note that with other themes, meaning of status will not differ, but color code may change (for example a theme may decide that good color for cancel symbol is &amp;quot;orange&amp;quot; and not &amp;quot;white crossed&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
Each feature is provided by a module. All modules are documented in the module documentation. For a complete list of modules and their documentation, see the following pages:&lt;br /&gt;
&lt;br /&gt;
*The list of standard modules is defined in page [[:Category:List_of_Modules]]&lt;br /&gt;
*The list of external modules (add-ons not provided by default) is set in the complementary modules page [[:Category:Complementary_modules]]&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=General_information_on_usage&amp;diff=36891</id>
		<title>General information on usage</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=General_information_on_usage&amp;diff=36891"/>
		<updated>2017-03-04T06:39:52Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TemplateDocUser}}&lt;br /&gt;
= Starting the application: =&lt;br /&gt;
To begin, launch the application, either by clicking on the icon installed on your desktop by the installation package or by typing appropriate URL in your web browser (The URL can be of the form http://localhost/dolibarr/ for local installation but can be different in the case of a manual installation, in that case it will depend on the configuration of your Web server).&lt;br /&gt;
&lt;br /&gt;
After launching application, you should see the login page with at least 2 fields:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Login&#039;&#039;&#039;: the login of user to connect. If this is a first usage, it is the user entered at last step of the installation (eg admin)&lt;br /&gt;
* &#039;&#039;&#039;Password&#039;&#039;&#039;: the password of user to connect. If this is a first usage, it is the password entered at last step of the installation (eg changeme)&lt;br /&gt;
[[File: identification.jpg | 360px |center]]&lt;br /&gt;
&lt;br /&gt;
= Homepage =&lt;br /&gt;
Once logged in, you see the home page. It contains menu bars (one horizontal bar and one vertical bar) and more informations in the center:&lt;br /&gt;
&lt;br /&gt;
*A box reminding your login account and the date of last access.&lt;br /&gt;
*A box of statistics related to all activated modules.&lt;br /&gt;
*A box showing &#039;tasks&#039; table (table containing informations of tasks to be done and tasks behind schedule). A weather sums it up.&lt;br /&gt;
*In the lower part, there may be other information boxes. The list depends upon boxes activated via the menu &#039;&#039;&#039;Home-&amp;gt;Setup-&amp;gt;Boxes&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Using the menus =&lt;br /&gt;
Each menu in the horizontal bar is related to one module. When a module is activated its associated menu appears in the horizontal menu bar. The menu entry of a module does not appear in the menus until the module has been activated. To activate a module, see page [[First_setup]].&lt;br /&gt;
&lt;br /&gt;
To use a module, click the menu associated with the module, a menu appears in the vertical bar to perform various tasks related to that module.&lt;br /&gt;
&lt;br /&gt;
For example, to list the products in stock (function provided by the Products and Stock modules), click on the menu Products / Services:&lt;br /&gt;
&lt;br /&gt;
[[File:liste_produits.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Once a top menu has been selected a left menu appears with various tasks related to the activated module.&lt;br /&gt;
&lt;br /&gt;
For example, menu you can see once top menu Products / Services has been selected:&lt;br /&gt;
&lt;br /&gt;
[[File:menuproduits.jpg|200px]]&lt;br /&gt;
&lt;br /&gt;
Note that the organization of the menus depends on the choice of menu manager configured in &#039;&#039;&#039;Home-&amp;gt;Setup-&amp;gt;Menus&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Objects =&lt;br /&gt;
Objects are the generic terms to speak about records managed by the application. It can be for example: a customer, a supplier, an invoice, an order, a proposal, an agenda event, a user, ...&lt;br /&gt;
&lt;br /&gt;
Each object is managed by a Dolibarr module. Depending on the module you enabled or not, some objects may or may not appear in the application.&lt;br /&gt;
Dolibarr policy is to use a common way of working for each managed modules or objects.&lt;br /&gt;
So, for each object, you will find a menu entry to Create (menu is called &amp;quot;New Object&amp;quot;) and a menu entry to list all objects (menu is called &amp;quot;List&amp;quot;).&lt;br /&gt;
Then clicking on an object found in a list, you can read all properties of the object arranged in several tabs. A button &amp;quot;Modify&amp;quot; is visible to the allowed user to edit the object.&lt;br /&gt;
&lt;br /&gt;
For example, this is a view of left menu to manage third-parties, and card of a selected third-party (click to enlarge):&lt;br /&gt;
&lt;br /&gt;
[[Image:Screenshot thirdparty.png|480px]]&lt;br /&gt;
&lt;br /&gt;
Also, in the list view (clicking menu &amp;quot;List&amp;quot; in the vertical menus), a status symbol/signage will appear in the last column of list of objects. The symbol/signage varies according to object&#039;s status within the workflow.&lt;br /&gt;
Symbol/signage of status depends on object and its options defined in the module setup dedicated to object management.&lt;br /&gt;
Current definition and symbol/signage of status are (with default theme &amp;quot;eldy&amp;quot;) :&lt;br /&gt;
* [[Image:statut0.png]] Draft - Status when object is not yet validated (white color means &amp;quot;don&#039;t take care of me&amp;quot; yet)&lt;br /&gt;
* [[Image:statut1.png]] Validated - Some actions are expected for the object (that&#039;s why color is yellow).&lt;br /&gt;
* [[Image:statut3.png]] It is a more advanced status than Validated, some actions have been taken on the object, but some action(s) are still expected on it (that&#039;s why color is partially yellow)&lt;br /&gt;
* [[Image:statut4.png]] Processed or Active or Enabled - No particular action is expected for the object anymore, even if some event may still occur (green color means everything is ok currently)&lt;br /&gt;
* [[Image:statut5.png]] Cancelled - No more action is expected on the object. No specific event can occur for this object (white color means &amp;quot;don&#039;t take care of me&amp;quot; and the cross means &amp;quot;anymore&amp;quot;)&lt;br /&gt;
* [[Image:statut8.png]] Error - There is a problem. This status means that there is a critical problem to fix for the object (red color means error)&lt;br /&gt;
Note that with other themes, meaning of status will not differ, but color code may be change (for example a theme may decide that good color for cancel symbol is &amp;quot;orange&amp;quot; and not &amp;quot;white crossed&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
Each feature is provided by a module. All modules are documented in the module documentation. For a complete list of modules and their documentation, see the following pages:&lt;br /&gt;
&lt;br /&gt;
*The list of standard modules is defined in page [[:Category:List_of_Modules]]&lt;br /&gt;
*The list of external modules (add-ons not provided by default) is set in the complementary modules page [[:Category:Complementary_modules]]&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=General_information_on_usage&amp;diff=36890</id>
		<title>General information on usage</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=General_information_on_usage&amp;diff=36890"/>
		<updated>2017-03-04T06:38:04Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TemplateDocUser}}&lt;br /&gt;
= Starting the application: =&lt;br /&gt;
To begin, launch the application, either by clicking on the icon installed on your desktop by the installation package or by typing appropriate URL in your web browser (The URL can be of the form http://localhost/dolibarr/ for local installation but can be different in the case of a manual installation, in that case it will depend on the configuration of your Web server).&lt;br /&gt;
&lt;br /&gt;
After launching application, you should see the login page with at least 2 fields:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Login&#039;&#039;&#039;: the login of user to connect. If this is a first usage, it is the user entered at last step of the installation (eg admin)&lt;br /&gt;
* &#039;&#039;&#039;Password&#039;&#039;&#039;: the password of user to connect. If this is a first usage, it is the password entered at last step of the installation (eg changeme)&lt;br /&gt;
[[File: identification.jpg | 360px |center]]&lt;br /&gt;
&lt;br /&gt;
= Homepage =&lt;br /&gt;
Once logged in, you see the home page. It contains menu bars (one horizontal bar and one vertical bar) and more informations in the center:&lt;br /&gt;
&lt;br /&gt;
*A box reminding your login account and the date of last access.&lt;br /&gt;
*A box of statistics related to all activated modules.&lt;br /&gt;
*A box showing &#039;tasks&#039; table (table containing informations of tasks to be done and tasks behind schedule). A weather sums it up.&lt;br /&gt;
*In the lower part, there may be other information boxes. The list depends upon boxes activated via the menu &#039;&#039;&#039;Home-&amp;gt;Setup-&amp;gt;Boxes&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Using the menus =&lt;br /&gt;
Each menu in the horizontal bar is related to one module. When a module is activated its associated menu appears in the horizontal menu bar. The menu entry of a module does not appear in the menus until the module has been activated. To activate a module, see page [[First_setup]].&lt;br /&gt;
&lt;br /&gt;
To use a module, click the menu associated with the module, a menu appears in the vertical bar to perform various tasks related to that module.&lt;br /&gt;
&lt;br /&gt;
For example, to list the products in stock (function provided by the Products and Stock modules), click on the menu Products / Services:&lt;br /&gt;
&lt;br /&gt;
[[File:liste_produits.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Once a top menu has been selected a left menu appears with various tasks related to the activated module.&lt;br /&gt;
&lt;br /&gt;
For example, menu you can see once top menu Products / Services has been selected:&lt;br /&gt;
&lt;br /&gt;
[[File:menuproduits.jpg|200px]]&lt;br /&gt;
&lt;br /&gt;
Note that the organization of the menus depends on the choice of menu manager configured in &#039;&#039;&#039;Home-&amp;gt;Setup-&amp;gt;Menus&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Objects =&lt;br /&gt;
Objects are the generic terms to speak about records managed by the application. It can be for example: a customer, a supplier, an invoice, an order, a proposal, an agenda event, a user, ...&lt;br /&gt;
&lt;br /&gt;
Each object is managed by a Dolibarr module. Depending on the module you enabled or not, some objects may or may not appear in the application.&lt;br /&gt;
Dolibarr policy is to use a common way of working for each managed modules or objects.&lt;br /&gt;
So, for each object, you will find a menu entry to Create (menu is called &amp;quot;New Object&amp;quot;) and a menu entry to list all objects (menu is called &amp;quot;List&amp;quot;).&lt;br /&gt;
Then clicking on an object found in a list, you can read all properties of the object arranged in several tabs. A button &amp;quot;Modify&amp;quot; is visible to the allowed user to edit the object.&lt;br /&gt;
&lt;br /&gt;
For example, this is a view of left menu to manage third-parties, and card of a selected third-party (click to enlarge):&lt;br /&gt;
&lt;br /&gt;
[[Image:Screenshot thirdparty.png|480px]]&lt;br /&gt;
&lt;br /&gt;
Also, in the list view (clicking menu &amp;quot;List&amp;quot; in the vertical menus), a status symbol/signage will appear in the last column of list of objects. The symbol/signage varies according to object&#039;s status within the workflow.&lt;br /&gt;
Symbol/signage of status depends on object and its options defined in the module setup dedicated to object management.&lt;br /&gt;
Current definition and symbol/signage of status are (with default theme &amp;quot;eldy&amp;quot;) :&lt;br /&gt;
* [[Image:statut0.png]] Draft - Status when object is not yet validated (white color means &amp;quot;don&#039;t take care of me&amp;quot; yet)&lt;br /&gt;
* [[Image:statut1.png]] Validated - Some actions are expected for the object (that&#039;s why color is yellow).&lt;br /&gt;
* [[Image:statut3.png]] It is a more advanced status than Validated, some actions have been taken on the object, but some action(s) still is expected for it (that&#039;s why color is partially yellow)&lt;br /&gt;
* [[Image:statut4.png]] Processed or Active or Enabled - No particular action is expected for the object anymore, even if some event may still occur (green color means everything is ok currently)&lt;br /&gt;
* [[Image:statut5.png]] Cancelled - No more action is expected on the object. No specific event can occur for this object (white color means &amp;quot;don&#039;t take care of me&amp;quot; and the cross means &amp;quot;anymore&amp;quot;)&lt;br /&gt;
* [[Image:statut8.png]] Error - There is a problem. This status means that there is a critical problem to fix for the object (red color means error)&lt;br /&gt;
Note that with other themes, meaning of status will not differ, but color code may be change (for example a theme may decide that good color for cancel symbol is &amp;quot;orange&amp;quot; and not &amp;quot;white crossed&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
Each feature is provided by a module. All modules are documented in the module documentation. For a complete list of modules and their documentation, see the following pages:&lt;br /&gt;
&lt;br /&gt;
*The list of standard modules is defined in page [[:Category:List_of_Modules]]&lt;br /&gt;
*The list of external modules (add-ons not provided by default) is set in the complementary modules page [[:Category:Complementary_modules]]&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=General_information_on_usage&amp;diff=36889</id>
		<title>General information on usage</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=General_information_on_usage&amp;diff=36889"/>
		<updated>2017-03-04T06:34:39Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TemplateDocUser}}&lt;br /&gt;
= Starting the application: =&lt;br /&gt;
To begin, launch the application, either by clicking on the icon installed on your desktop by the installation package or by typing appropriate URL in your web browser (The URL can be of the form http://localhost/dolibarr/ for local installation but can be different in the case of a manual installation, in that case it will depend on the configuration of your Web server).&lt;br /&gt;
&lt;br /&gt;
After launching application, you should see the login page with at least 2 fields:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Login&#039;&#039;&#039;: the login of user to connect. If this is a first usage, it is the user entered at last step of the installation (eg admin)&lt;br /&gt;
* &#039;&#039;&#039;Password&#039;&#039;&#039;: the password of user to connect. If this is a first usage, it is the password entered at last step of the installation (eg changeme)&lt;br /&gt;
[[File: identification.jpg | 360px |center]]&lt;br /&gt;
&lt;br /&gt;
= Homepage =&lt;br /&gt;
Once logged in, you see the home page. It contains menu bars (one horizontal bar and one vertical bar) and more informations in the center:&lt;br /&gt;
&lt;br /&gt;
*A box reminding your login account and the date of last access.&lt;br /&gt;
*A box of statistics related to all activated modules.&lt;br /&gt;
*A box showing &#039;tasks&#039; table (table containing informations of tasks to be done and tasks behind schedule). A weather sums it up.&lt;br /&gt;
*In the lower part, there may be other information boxes. The list depends upon boxes activated via the menu &#039;&#039;&#039;Home-&amp;gt;Setup-&amp;gt;Boxes&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Using the menus =&lt;br /&gt;
Each menu in the horizontal bar is related to one module. When a module is activated its associated menu appears in the horizontal menu bar. The menu entry of a module does not appear in the menus until the module has been activated. To activate a module, see page [[First_setup]].&lt;br /&gt;
&lt;br /&gt;
To use a module, click the menu associated with the module, a menu appears in the vertical bar to perform various tasks related to that module.&lt;br /&gt;
&lt;br /&gt;
For example, to list the products in stock (function provided by the Products and Stock modules), click on the menu Products / Services:&lt;br /&gt;
&lt;br /&gt;
[[File:liste_produits.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Once a top menu has been selected a left menu appears with various tasks related to the activated module.&lt;br /&gt;
&lt;br /&gt;
For example, menu you can see once top menu Products / Services has been selected:&lt;br /&gt;
&lt;br /&gt;
[[File:menuproduits.jpg|200px]]&lt;br /&gt;
&lt;br /&gt;
Note that the organization of the menus depends on the choice of menu manager configured in &#039;&#039;&#039;Home-&amp;gt;Setup-&amp;gt;Menus&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Objects =&lt;br /&gt;
Objects are the generic terms to speak about records managed by the application. It can be for example: a customer, a supplier, an invoice, an order, a proposal, an agenda event, a user, ...&lt;br /&gt;
&lt;br /&gt;
Each object is managed by a Dolibarr module. Depending on the module you enabled or not, some objects may or may not appear in the application.&lt;br /&gt;
Dolibarr policy is to use a common way of working for each managed modules or objects.&lt;br /&gt;
So, for each object, you will find a menu entry to Create (menu is called &amp;quot;New Object&amp;quot;) and a menu entry to list all objects (menu is called &amp;quot;List&amp;quot;).&lt;br /&gt;
Then clicking on an object found in a list, you can read all properties of the object arranged in several tabs. A button &amp;quot;Modify&amp;quot; is visible to the allowed user to edit the object.&lt;br /&gt;
&lt;br /&gt;
For example, this is a view of left menu to manage third-parties, and card of a selected third-party (click to enlarge):&lt;br /&gt;
&lt;br /&gt;
[[Image:Screenshot thirdparty.png|480px]]&lt;br /&gt;
&lt;br /&gt;
Also, in the list view (clicking menu &amp;quot;List&amp;quot; in the vertical menus), a status symbol/signage will appear in the last column of list of objects. The symbol/signage varies according to object&#039;s status within the workflow.&lt;br /&gt;
Symbol/signage of status depends on object and its options defined in the module setup dedicated to object management.&lt;br /&gt;
Current definition and symbol/signage of status are (with default theme &amp;quot;eldy&amp;quot;) :&lt;br /&gt;
* [[Image:statut0.png]] Draft - Status when object is not yet validated (white color means &amp;quot;don&#039;t take care of me&amp;quot; yet)&lt;br /&gt;
* [[Image:statut1.png]] Validated - Some actions are expected for the object (that&#039;s why color is yellow).&lt;br /&gt;
* [[Image:statut3.png]] It is a more advanced status than Validated, but action still is expected for object (that&#039;s why color is partially yellow)&lt;br /&gt;
* [[Image:statut4.png]] Processed or Active or Enabled - No particular action is expected for the object anymore, even if some event may still occur (green color means everything is ok currently)&lt;br /&gt;
* [[Image:statut5.png]] Cancelled - No more action is expected on the object. No specific event can occur for this object (white color means &amp;quot;don&#039;t take care of me&amp;quot; and the cross means &amp;quot;anymore&amp;quot;)&lt;br /&gt;
* [[Image:statut8.png]] Error - There is a problem. This status means that there is a critical problem to fix for the object (red color means error)&lt;br /&gt;
Note that with other themes, meaning of status will not differ, but color code may be change (for example a theme may decide that good color for cancel symbol is &amp;quot;orange&amp;quot; and not &amp;quot;white crossed&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
Each feature is provided by a module. All modules are documented in the module documentation. For a complete list of modules and their documentation, see the following pages:&lt;br /&gt;
&lt;br /&gt;
*The list of standard modules is defined in page [[:Category:List_of_Modules]]&lt;br /&gt;
*The list of external modules (add-ons not provided by default) is set in the complementary modules page [[:Category:Complementary_modules]]&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=General_information_on_usage&amp;diff=36888</id>
		<title>General information on usage</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=General_information_on_usage&amp;diff=36888"/>
		<updated>2017-03-04T06:29:15Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TemplateDocUser}}&lt;br /&gt;
= Starting the application: =&lt;br /&gt;
To begin, launch the application, either by clicking on the icon installed on your desktop by the installation package or by typing appropriate URL in your web browser (The URL can be of the form http://localhost/dolibarr/ for local installation but can be different in the case of a manual installation, in that case it will depend on the configuration of your Web server).&lt;br /&gt;
&lt;br /&gt;
After launching application, you should see the login page with at least 2 fields:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Login&#039;&#039;&#039;: the login of user to connect. If this is a first usage, it is the user entered at last step of the installation (eg admin)&lt;br /&gt;
* &#039;&#039;&#039;Password&#039;&#039;&#039;: the password of user to connect. If this is a first usage, it is the password entered at last step of the installation (eg changeme)&lt;br /&gt;
[[File: identification.jpg | 360px |center]]&lt;br /&gt;
&lt;br /&gt;
= Homepage =&lt;br /&gt;
Once logged in, you see the home page. It contains menu bars (one horizontal bar and one vertical bar) and more informations in the center:&lt;br /&gt;
&lt;br /&gt;
*A box reminding your login account and the date of last access.&lt;br /&gt;
*A box of statistics related to all activated modules.&lt;br /&gt;
*A box showing &#039;tasks&#039; table (table containing informations of tasks to be done and tasks behind schedule). A weather sums it up.&lt;br /&gt;
*In the lower part, there may be other information boxes. The list depends upon boxes activated via the menu &#039;&#039;&#039;Home-&amp;gt;Setup-&amp;gt;Boxes&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Using the menus =&lt;br /&gt;
Each menu in the horizontal bar is related to one module. When a module is activated its associated menu appears in the horizontal menu bar. The menu entry of a module does not appear in the menus until the module has been activated. To activate a module, see page [[First_setup]].&lt;br /&gt;
&lt;br /&gt;
To use a module, click the menu associated with the module, a menu appears in the vertical bar to perform various tasks related to that module.&lt;br /&gt;
&lt;br /&gt;
For example, to list the products in stock (function provided by the Products and Stock modules), click on the menu Products / Services:&lt;br /&gt;
&lt;br /&gt;
[[File:liste_produits.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Once a top menu has been selected a left menu appears with various tasks related to the activated module.&lt;br /&gt;
&lt;br /&gt;
For example, menu you can see once top menu Products / Services has been selected:&lt;br /&gt;
&lt;br /&gt;
[[File:menuproduits.jpg|200px]]&lt;br /&gt;
&lt;br /&gt;
Note that the organization of the menus depends on the choice of menu manager configured in &#039;&#039;&#039;Home-&amp;gt;Setup-&amp;gt;Menus&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Objects =&lt;br /&gt;
Objects are the generic terms to speak about records managed by the application. It can be for example: a customer, a supplier, an invoice, an order, a proposal, an agenda event, a user, ...&lt;br /&gt;
&lt;br /&gt;
Each object is managed by a Dolibarr module. Depending on the module you enabled or not, some objects may or may not appear in the application.&lt;br /&gt;
Dolibarr policy is to use a common way of working for each managed modules or objects.&lt;br /&gt;
So, for each object, you will find a menu entry to Create (menu is called &amp;quot;New Object&amp;quot;) and a menu entry to list all objects (menu is called &amp;quot;List&amp;quot;).&lt;br /&gt;
Then clicking on an object found in a list, you can read all properties of the object arranged in several tabs. A button &amp;quot;Modify&amp;quot; is visible to the allowed user to edit the object.&lt;br /&gt;
&lt;br /&gt;
For example, this is a view of left menu to manage third-parties, and card of a selected third-party (click to enlarge):&lt;br /&gt;
&lt;br /&gt;
[[Image:Screenshot thirdparty.png|480px]]&lt;br /&gt;
&lt;br /&gt;
Also, in the list view (clicking menu &amp;quot;List&amp;quot; in the vertical menus), a status symbol/signage will appear in the last column of list of objects. The symbol/signage varies according to object&#039;s status within the workflow.&lt;br /&gt;
Symbol/signage of status depends on object and its options defined in the module setup dedicated to object management.&lt;br /&gt;
Current definition and symbol/signage of status are (with default theme &amp;quot;eldy&amp;quot;) :&lt;br /&gt;
* [[Image:statut0.png]] Draft - Status when object is not yet validated (white color means &amp;quot;don&#039;t take care of me&amp;quot; yet)&lt;br /&gt;
* [[Image:statut1.png]] Validated - Some actions are expected for the object (that&#039;s why color is yellow).&lt;br /&gt;
* [[Image:statut3.png]] It is a more advanced status than Validated, but object still needs action to be done on it (that&#039;s why color is partially yellow)&lt;br /&gt;
* [[Image:statut4.png]] Processed or Active or Enabled - No particular action is expected for the object, even if some event can still occur (green color means everything is ok currently)&lt;br /&gt;
* [[Image:statut5.png]] Cancelled - No more action is expected on the object. No specific event can occur for this object (white color means &amp;quot;don&#039;t take care of me&amp;quot; and the cross means &amp;quot;anymore&amp;quot;)&lt;br /&gt;
* [[Image:statut8.png]] Error - There is a problem. This status means that there is a critical problem to fix for the object (red color means error)&lt;br /&gt;
Note that with other themes, meaning of status will not differ, but color code may be change (for example a theme may decide that good color for cancel symbol is &amp;quot;orange&amp;quot; and not &amp;quot;white crossed&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
Each feature is provided by a module. All modules are documented in the module documentation. For a complete list of modules and their documentation, see the following pages:&lt;br /&gt;
&lt;br /&gt;
*The list of standard modules is defined in page [[:Category:List_of_Modules]]&lt;br /&gt;
*The list of external modules (add-ons not provided by default) is set in the complementary modules page [[:Category:Complementary_modules]]&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=General_information_on_usage&amp;diff=36887</id>
		<title>General information on usage</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=General_information_on_usage&amp;diff=36887"/>
		<updated>2017-03-04T06:25:13Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TemplateDocUser}}&lt;br /&gt;
= Starting the application: =&lt;br /&gt;
To begin, launch the application, either by clicking on the icon installed on your desktop by the installation package or by typing appropriate URL in your web browser (The URL can be of the form http://localhost/dolibarr/ for local installation but can be different in the case of a manual installation, in that case it will depend on the configuration of your Web server).&lt;br /&gt;
&lt;br /&gt;
After launching application, you should see the login page with at least 2 fields:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Login&#039;&#039;&#039;: the login of user to connect. If this is a first usage, it is the user entered at last step of the installation (eg admin)&lt;br /&gt;
* &#039;&#039;&#039;Password&#039;&#039;&#039;: the password of user to connect. If this is a first usage, it is the password entered at last step of the installation (eg changeme)&lt;br /&gt;
[[File: identification.jpg | 360px |center]]&lt;br /&gt;
&lt;br /&gt;
= Homepage =&lt;br /&gt;
Once logged in, you see the home page. It contains menu bars (one horizontal bar and one vertical bar) and more informations in the center:&lt;br /&gt;
&lt;br /&gt;
*A box reminding your login account and the date of last access.&lt;br /&gt;
*A box of statistics related to all activated modules.&lt;br /&gt;
*A box showing &#039;tasks&#039; table (table containing informations of tasks to be done and tasks behind schedule). A weather sums it up.&lt;br /&gt;
*In the lower part, there may be other information boxes. The list depends upon boxes activated via the menu &#039;&#039;&#039;Home-&amp;gt;Setup-&amp;gt;Boxes&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Using the menus =&lt;br /&gt;
Each menu in the horizontal bar is related to one module. When a module is activated its associated menu appears in the horizontal menu bar. The menu entry of a module does not appear in the menus until the module has been activated. To activate a module, see page [[First_setup]].&lt;br /&gt;
&lt;br /&gt;
To use a module, click the menu associated with the module, a menu appears in the vertical bar to perform various tasks related to that module.&lt;br /&gt;
&lt;br /&gt;
For example, to list the products in stock (function provided by the Products and Stock modules), click on the menu Products / Services:&lt;br /&gt;
&lt;br /&gt;
[[File:liste_produits.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Once a top menu has been selected a left menu appears with various tasks related to the activated module.&lt;br /&gt;
&lt;br /&gt;
For example, menu you can see once top menu Products / Services has been selected:&lt;br /&gt;
&lt;br /&gt;
[[File:menuproduits.jpg|200px]]&lt;br /&gt;
&lt;br /&gt;
Note that the organization of the menus depends on the choice of menu manager configured in &#039;&#039;&#039;Home-&amp;gt;Setup-&amp;gt;Menus&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Objects =&lt;br /&gt;
Objects are the generic terms to speak about records managed by the application. It can be for example: a customer, a supplier, an invoice, an order, a proposal, an agenda event, a user, ...&lt;br /&gt;
&lt;br /&gt;
Each object is managed by a Dolibarr module. Depending on the module you enabled or not, some objects may or may not appear in the application.&lt;br /&gt;
Dolibarr policy is to use a common way of working for each managed modules or objects.&lt;br /&gt;
So, for each object, you will find a menu entry to Create (menu is called &amp;quot;New Object&amp;quot;) and a menu entry to list all objects (menu is called &amp;quot;List&amp;quot;).&lt;br /&gt;
Then clicking on an object found in a list, you can read all properties of the object arranged in several tabs. A button &amp;quot;Modify&amp;quot; is visible to the allowed user to edit the object.&lt;br /&gt;
&lt;br /&gt;
For example, this is a view of left menu to manage third-parties, and card of a selected third-party (click to enlarge):&lt;br /&gt;
&lt;br /&gt;
[[Image:Screenshot thirdparty.png|480px]]&lt;br /&gt;
&lt;br /&gt;
Also, in the list view (clicking menu &amp;quot;List&amp;quot; in the vertical menus), a status symbol/signage will appear in the last column of list of objects. The symbol/signage varies according to object&#039;s status within the workflow.&lt;br /&gt;
Symbol/signage of status depends on the object and its options defined in the module setup dedicated to object management.&lt;br /&gt;
Current definition and symbol/signage of status are (with default theme &amp;quot;eldy&amp;quot;) :&lt;br /&gt;
* [[Image:statut0.png]] Draft - Status when object is not yet validated (white color means &amp;quot;don&#039;t take care of me&amp;quot; yet)&lt;br /&gt;
* [[Image:statut1.png]] Validated - Some actions are expected for the object (that&#039;s why color is yellow).&lt;br /&gt;
* [[Image:statut3.png]] It is a more advanced status than Validated, but object still needs action to be done on it (that&#039;s why color is partially yellow)&lt;br /&gt;
* [[Image:statut4.png]] Processed or Active or Enabled - No particular action is expected for the object, even if some event can still occur (green color means everything is ok currently)&lt;br /&gt;
* [[Image:statut5.png]] Cancelled - No more action is expected on the object. No specific event can occur for this object (white color means &amp;quot;don&#039;t take care of me&amp;quot; and the cross means &amp;quot;anymore&amp;quot;)&lt;br /&gt;
* [[Image:statut8.png]] Error - There is a problem. This status means that there is a critical problem to fix for the object (red color means error)&lt;br /&gt;
Note that with other themes, meaning of status will not differ, but color code may be change (for example a theme may decide that good color for cancel symbol is &amp;quot;orange&amp;quot; and not &amp;quot;white crossed&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
Each feature is provided by a module. All modules are documented in the module documentation. For a complete list of modules and their documentation, see the following pages:&lt;br /&gt;
&lt;br /&gt;
*The list of standard modules is defined in page [[:Category:List_of_Modules]]&lt;br /&gt;
*The list of external modules (add-ons not provided by default) is set in the complementary modules page [[:Category:Complementary_modules]]&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=General_information_on_usage&amp;diff=36886</id>
		<title>General information on usage</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=General_information_on_usage&amp;diff=36886"/>
		<updated>2017-03-04T06:22:40Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TemplateDocUser}}&lt;br /&gt;
= Starting the application: =&lt;br /&gt;
To begin, launch the application, either by clicking on the icon installed on your desktop by the installation package or by typing appropriate URL in your web browser (The URL can be of the form http://localhost/dolibarr/ for local installation but can be different in the case of a manual installation, in that case it will depend on the configuration of your Web server).&lt;br /&gt;
&lt;br /&gt;
After launching application, you should see the login page with at least 2 fields:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Login&#039;&#039;&#039;: the login of user to connect. If this is a first usage, it is the user entered at last step of the installation (eg admin)&lt;br /&gt;
* &#039;&#039;&#039;Password&#039;&#039;&#039;: the password of user to connect. If this is a first usage, it is the password entered at last step of the installation (eg changeme)&lt;br /&gt;
[[File: identification.jpg | 360px |center]]&lt;br /&gt;
&lt;br /&gt;
= Homepage =&lt;br /&gt;
Once logged in, you see the home page. It contains menu bars (one horizontal bar and one vertical bar) and more informations in the center:&lt;br /&gt;
&lt;br /&gt;
*A box reminding your login account and the date of last access.&lt;br /&gt;
*A box of statistics related to all activated modules.&lt;br /&gt;
*A box showing &#039;tasks&#039; table (table containing informations of tasks to be done and tasks behind schedule). A weather sums it up.&lt;br /&gt;
*In the lower part, there may be other information boxes. The list depends upon boxes activated via the menu &#039;&#039;&#039;Home-&amp;gt;Setup-&amp;gt;Boxes&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Using the menus =&lt;br /&gt;
Each menu in the horizontal bar is related to one module. When a module is activated its associated menu appears in the horizontal menu bar. The menu entry of a module does not appear in the menus until the module has been activated. To activate a module, see page [[First_setup]].&lt;br /&gt;
&lt;br /&gt;
To use a module, click the menu associated with the module, a menu appears in the vertical bar to perform various tasks related to that module.&lt;br /&gt;
&lt;br /&gt;
For example, to list the products in stock (function provided by the Products and Stock modules), click on the menu Products / Services:&lt;br /&gt;
&lt;br /&gt;
[[File:liste_produits.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Once a top menu has been selected a left menu appears with various tasks related to the activated module.&lt;br /&gt;
&lt;br /&gt;
For example, menu you can see once top menu Products / Services has been selected:&lt;br /&gt;
&lt;br /&gt;
[[File:menuproduits.jpg|200px]]&lt;br /&gt;
&lt;br /&gt;
Note that the organization of the menus depends on the choice of menu manager configured in &#039;&#039;&#039;Home-&amp;gt;Setup-&amp;gt;Menus&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Objects =&lt;br /&gt;
Objects are the generic terms to speak about records managed by the application. It can be for example: a customer, a supplier, an invoice, an order, a proposal, an agenda event, a user, ...&lt;br /&gt;
&lt;br /&gt;
Each object is managed by a Dolibarr module. Depending on the module you enabled or not, some objects may or may not appear in the application.&lt;br /&gt;
Dolibarr policy is to use a common way of working for each managed modules or objects.&lt;br /&gt;
So, for each object, you will find a menu entry to Create (menu is called &amp;quot;New Object&amp;quot;) and a menu entry to list all objects (menu is called &amp;quot;List&amp;quot;).&lt;br /&gt;
Then clicking on an object found in a list, you can read all properties of the object arranged in several tabs. A button &amp;quot;Modify&amp;quot; is visible to the allowed user to edit the object.&lt;br /&gt;
&lt;br /&gt;
For example, this is a view of left menu to manage third-parties, and card of a selected third-party (click to enlarge):&lt;br /&gt;
&lt;br /&gt;
[[Image:Screenshot thirdparty.png|480px]]&lt;br /&gt;
&lt;br /&gt;
Also, in the list view (clicking menu &amp;quot;List&amp;quot; in the vertical menus), a status symbol/signage will appear in the last column of the list of objects. The symbol/signage varies according to object&#039;s status within it&#039;s workflow.&lt;br /&gt;
Symbol/signage of status depends on the object and its options defined in the module setup dedicated to object management.&lt;br /&gt;
Current definition and symbol/signage of status are (with default theme &amp;quot;eldy&amp;quot;) :&lt;br /&gt;
* [[Image:statut0.png]] Draft - Status when object is not yet validated (white color means &amp;quot;don&#039;t take care of me&amp;quot; yet)&lt;br /&gt;
* [[Image:statut1.png]] Validated - Some actions are expected for the object (that&#039;s why color is yellow).&lt;br /&gt;
* [[Image:statut3.png]] It is a more advanced status than Validated, but object still needs action to be done on it (that&#039;s why color is partially yellow)&lt;br /&gt;
* [[Image:statut4.png]] Processed or Active or Enabled - No particular action is expected for the object, even if some event can still occur (green color means everything is ok currently)&lt;br /&gt;
* [[Image:statut5.png]] Cancelled - No more action is expected on the object. No specific event can occur for this object (white color means &amp;quot;don&#039;t take care of me&amp;quot; and the cross means &amp;quot;anymore&amp;quot;)&lt;br /&gt;
* [[Image:statut8.png]] Error - There is a problem. This status means that there is a critical problem to fix for the object (red color means error)&lt;br /&gt;
Note that with other themes, meaning of status will not differ, but color code may be change (for example a theme may decide that good color for cancel symbol is &amp;quot;orange&amp;quot; and not &amp;quot;white crossed&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
Each feature is provided by a module. All modules are documented in the module documentation. For a complete list of modules and their documentation, see the following pages:&lt;br /&gt;
&lt;br /&gt;
*The list of standard modules is defined in page [[:Category:List_of_Modules]]&lt;br /&gt;
*The list of external modules (add-ons not provided by default) is set in the complementary modules page [[:Category:Complementary_modules]]&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=General_information_on_usage&amp;diff=36885</id>
		<title>General information on usage</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=General_information_on_usage&amp;diff=36885"/>
		<updated>2017-03-04T06:17:13Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TemplateDocUser}}&lt;br /&gt;
= Starting the application: =&lt;br /&gt;
To begin, launch the application, either by clicking on the icon installed on your desktop by the installation package or by typing appropriate URL in your web browser (The URL can be of the form http://localhost/dolibarr/ for local installation but can be different in the case of a manual installation, in that case it will depend on the configuration of your Web server).&lt;br /&gt;
&lt;br /&gt;
After launching application, you should see the login page with at least 2 fields:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Login&#039;&#039;&#039;: the login of user to connect. If this is a first usage, it is the user entered at last step of the installation (eg admin)&lt;br /&gt;
* &#039;&#039;&#039;Password&#039;&#039;&#039;: the password of user to connect. If this is a first usage, it is the password entered at last step of the installation (eg changeme)&lt;br /&gt;
[[File: identification.jpg | 360px |center]]&lt;br /&gt;
&lt;br /&gt;
= Homepage =&lt;br /&gt;
Once logged in, you see the home page. It contains menu bars (one horizontal bar and one vertical bar) and more informations in the center:&lt;br /&gt;
&lt;br /&gt;
*A box reminding your login account and the date of last access.&lt;br /&gt;
*A box of statistics related to all activated modules.&lt;br /&gt;
*A box showing &#039;tasks&#039; table (table containing informations of tasks to be done and tasks behind schedule). A weather sums it up.&lt;br /&gt;
*In the lower part, there may be other information boxes. The list depends upon boxes activated via the menu &#039;&#039;&#039;Home-&amp;gt;Setup-&amp;gt;Boxes&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Using the menus =&lt;br /&gt;
Each menu in the horizontal bar is related to one module. When a module is activated its associated menu appears in the horizontal menu bar. The menu entry of a module does not appear in the menus until the module has been activated. To activate a module, see page [[First_setup]].&lt;br /&gt;
&lt;br /&gt;
To use a module, click the menu associated with the module, a menu appears in the vertical bar to perform various tasks related to that module.&lt;br /&gt;
&lt;br /&gt;
For example, to list the products in stock (function provided by the Products and Stock modules), click on the menu Products / Services:&lt;br /&gt;
&lt;br /&gt;
[[File:liste_produits.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Once a top menu has been selected a left menu appears with various tasks related to the activated module.&lt;br /&gt;
&lt;br /&gt;
For example, menu you can see once top menu Products / Services has been selected:&lt;br /&gt;
&lt;br /&gt;
[[File:menuproduits.jpg|200px]]&lt;br /&gt;
&lt;br /&gt;
Note that the organization of the menus depends on the choice of menu manager configured in &#039;&#039;&#039;Home-&amp;gt;Setup-&amp;gt;Menus&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Objects =&lt;br /&gt;
Objects are the generic terms to speak about records managed by the application. It can be for example: a customer, a supplier, an invoice, an order, a proposal, an agenda event, a user, ...&lt;br /&gt;
&lt;br /&gt;
Each object is managed by a Dolibarr module. Depending on the module you enabled or not, some objects may or may not appear in the application.&lt;br /&gt;
Dolibarr policy is to use a common way of working for each managed modules or objects.&lt;br /&gt;
So, for each object, you will find a menu entry to Create (menu is called &amp;quot;New Object&amp;quot;) and a menu entry to list all objects (menu is called &amp;quot;List&amp;quot;).&lt;br /&gt;
Then clicking on an object found in a list, you can read all properties of the object arranged in several tabs. A button &amp;quot;Modify&amp;quot; is visible to the allowed user to edit the object.&lt;br /&gt;
&lt;br /&gt;
For example, this is a view of left menu to manage third-parties, and card of a selected third-party (click to enlarge):&lt;br /&gt;
&lt;br /&gt;
[[Image:Screenshot thirdparty.png|480px]]&lt;br /&gt;
&lt;br /&gt;
Also, in the list view (clicking menu &amp;quot;List&amp;quot; in the vertical menus), a status symbol/signage will appear in the last column of the list of objects. The symbol/signage varies according to object&#039;s status within it&#039;s workflow.&lt;br /&gt;
Symbol/signage of status depends on the object and its options defined in the module setup dedicated to object management.&lt;br /&gt;
Current definition and symbol/signage of status are (with default theme &amp;quot;eldy&amp;quot;) :&lt;br /&gt;
* [[Image:statut0.png]] Draft - Status when object is not yet validated (white color means &amp;quot;don&#039;t take care of me&amp;quot; yet)&lt;br /&gt;
* [[Image:statut1.png]] Validated - Some actions are expected for the object (that&#039;s why color is yellow).&lt;br /&gt;
* [[Image:statut3.png]] Name of status will varies according to object. It is a more advanced status than Validated, but object still need action to do on it (that&#039;s why color is partially yellow)&lt;br /&gt;
* [[Image:statut4.png]] Processed or Active or Enabled - No particular action is expected for the object, even if some event can still occur (green color means everything is ok currently)&lt;br /&gt;
* [[Image:statut5.png]] Cancelled - No more action is expected on the object. No specific event can occur for this object (white color means &amp;quot;don&#039;t take care of me&amp;quot; and the cross means &amp;quot;anymore&amp;quot;)&lt;br /&gt;
* [[Image:statut8.png]] Error - There is a problem. This status means there is a critical problem to fix on object (red color means error)&lt;br /&gt;
Note that with other theme, meaning of status will not differ, but colors codification may be changed (for example a theme can decide good color for cancel theme is &amp;quot;orange&amp;quot; and not &amp;quot;white crossed&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
Each feature is provided by a module. All modules are documented in the module documentation. For a complete list of modules and their documentation, see the following pages:&lt;br /&gt;
&lt;br /&gt;
*The list of standard modules is defined in page [[:Category:List_of_Modules]]&lt;br /&gt;
*The list of external modules (add-ons not provided by default) is set in the complementary modules page [[:Category:Complementary_modules]]&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Triggers_system&amp;diff=36884</id>
		<title>Triggers system</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Triggers_system&amp;diff=36884"/>
		<updated>2017-03-03T04:22:24Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Execute your own code on a Dolibarr&amp;#039;s action */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TemplateDocDevEn}}&lt;br /&gt;
&lt;br /&gt;
= Execute your own code on a Dolibarr&#039;s action =&lt;br /&gt;
To execute personalized code after a Dolibarr event (create/modify/remove a third party/invoice/product or other), Dolibarr offers a mechanism of business triggers. This mechanism allows you to personalize a work-flow to have Dolibarr business events being synchronized into another application for example.&lt;br /&gt;
You can also use triggers to modify the behavior of Dolibarr itself: for example, to create automatically a contract when an invoice is validated.&lt;br /&gt;
&lt;br /&gt;
So, to add your own code that will be triggered by a Dolibarr trigger, this is the way to process:&lt;br /&gt;
&lt;br /&gt;
1) Copy the trigger file &#039;&#039;&#039;htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN&#039;&#039;&#039; under the new name:&lt;br /&gt;
* &#039;&#039;&#039;interface_99_all_&#039;&#039;Xxx&#039;&#039;.class.php&#039;&#039;&#039;&lt;br /&gt;
or&lt;br /&gt;
* &#039;&#039;&#039;interface_99_mod&#039;&#039;MyModule_Xxx&#039;&#039;.class.php&#039;&#039;&#039;&lt;br /&gt;
where &#039;&#039;Xxx&#039;&#039; is a string of your choice starting with uppercase character, &#039;&#039;99&#039;&#039; is the priority number for the execution of your trigger (1 being the top priority) and &#039;&#039;MyModule&#039;&#039; is the name of a module if you want that trigger is activated only if module MyModyle is activated. If you want the trigger to be always active, use &#039;&#039;all&#039;&#039; instead of  modMyModule.&lt;br /&gt;
This new file must be saved inside same directory.&lt;br /&gt;
&lt;br /&gt;
Note: Value you can use for modMyModule are values found in directory&lt;br /&gt;
&#039;&#039;htdocs/includes/modules&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING&#039;&#039;&#039;: &#039;&#039;&#039;All&#039;&#039;&#039; those parameters are necessary for the trigger to be detected and executed! Eg: if you forget the priority number, your trigger won&#039;t be detected!&lt;br /&gt;
&lt;br /&gt;
For example, you can name your new trigger file: &lt;br /&gt;
&#039;&#039;htdocs/includes/triggers/interface_99_modFacture_Myworkflow.class.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By creating such a file with name as in the example, your new trigger file will be executed each time a Dolibarr business event occurs but only if the module Facture is enabled.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: With Dolibarr 3.2+, you can also place the triggers in your own module&#039;s subdirectly. Eg: if your module resides in htdocs/mymodule/, then you can place your triggers inside htdocs/mymodule/core/triggers/. But for this, you must declare the trigger into your module descriptor file (eg: &#039;&#039;&#039;/mymodule/core/modules/modMyModule.class.php&#039;&#039;&#039;). For this, add into this file triggers-&amp;gt;1 into module_parts array:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Defined all module parts (triggers, login, substitutions, menus, etc...) (0=disable,1=enable)&lt;br /&gt;
$this-&amp;gt;module_parts = array(&#039;triggers&#039; =&amp;gt; 1);&lt;br /&gt;
//$this-&amp;gt;module_parts = array(&#039;triggers&#039; =&amp;gt; 1,&lt;br /&gt;
//              &#039;login&#039; =&amp;gt; 0,&lt;br /&gt;
//              &#039;substitutions&#039; =&amp;gt; 0,&lt;br /&gt;
//              &#039;menus&#039; =&amp;gt; 0);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Then disable and reenable your module. This will add a record into [[Table llx_const]] to tell Dolibarr that a trigger file must be searched in the module directory &#039;&#039;&#039;htdocs/mymodule/core/triggers/&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Edit the file &#039;&#039;interface_99_modMyModule_Myworkflow.class.php&#039;&#039; to rename class &#039;&#039;InterfaceDemo&#039;&#039; by &#039;&#039;InterfaceMyworkflow&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Then go on page Home-&amp;gt; System Infos -&amp;gt; Dolibarr -&amp;gt; Triggers.&lt;br /&gt;
Your new trigger file must appears in the list without any error message. This means preceding actions have been done successfully.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Return now to edition of file to add your own code inside function  &#039;&#039;run_trigger&#039;&#039;.&lt;br /&gt;
This function is called at each Dolibarr business event. Put your code according to events on which you want to run. Each event is identified by a code (see following chapter to get full list of codes). So you can react or no after an event by doing just a test on variable &#039;&#039;&#039;$action&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
  function run_trigger($action,$object,$user,$langs,$conf)&lt;br /&gt;
  {&lt;br /&gt;
        // Put here code to execute after an action&lt;br /&gt;
        // The type of Dolibarr business event is stored into $action&lt;br /&gt;
        // Data of action are stored into object $object&lt;br /&gt;
        // Setup, user and language are saved into $conf, $user and $lang&lt;br /&gt;
        if ($action == &#039;COMPANY_CREATE&#039;)&lt;br /&gt;
        {&lt;br /&gt;
            dol_syslog(&amp;quot;Trigger for action &#039;$action&#039; launched. id=&amp;quot;.$object-&amp;gt;id);&lt;br /&gt;
        }&lt;br /&gt;
        elseif ($action == &#039;COMPANY_MODIFY&#039;)&lt;br /&gt;
        {        &lt;br /&gt;
            dol_syslog(&amp;quot;Trigger for action &#039;$action&#039; launched. id=&amp;quot;.$object-&amp;gt;id);&lt;br /&gt;
        }&lt;br /&gt;
        elseif ($action == &#039;COMPANY_DELETE&#039;)&lt;br /&gt;
        ...&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can do what you want into this coding part, if you check that function run_trigger returns a return code according to following rule:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;0 if KO, 0 if nothing is done, &amp;gt;0 if OK&lt;br /&gt;
&lt;br /&gt;
You can also use, inside this function, the following preinitialized variables:&lt;br /&gt;
* &#039;&#039;&#039;$object&#039;&#039;&#039; is the object on which action is done (see next chapter)&lt;br /&gt;
* &#039;&#039;&#039;$user&#039;&#039;&#039; is the object containing all information of Dolibarr user that realizes the business event.&lt;br /&gt;
* &#039;&#039;&#039;$langs&#039;&#039;&#039; is the object that contains the user language and translations strings&lt;br /&gt;
* &#039;&#039;&#039;$conf&#039;&#039;&#039; is the object that contains all the Dolibarr configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4) Once your trigger file has been developed, last action is to test by using Dolibarr to execute the business event that should trigger your code. Warning, call of function &#039;&#039;&#039;run_trigger&#039;&#039;&#039; is encapsulated into a transaction. If your code return a KO code, the calling function may rollback the transaction (this depends on calling function).&lt;br /&gt;
Add log information inside your function &#039;&#039;&#039;run_trigger&#039;&#039;&#039; to know if your code is correctly triggered and runs correctly. For this, you can use the function&lt;br /&gt;
dol_syslog(&amp;quot;my log message&amp;quot;, LOG_DEBUG);&lt;br /&gt;
&lt;br /&gt;
= List of known triggers actions =&lt;br /&gt;
List of all events that launch triggers are available in [[Table llx c action trigger]]. This is a quick list of those events, identified by value of variable &#039;&#039;&#039;$action&#039;&#039;&#039; into trigger code and type of variable &#039;&#039;&#039;$object&#039;&#039;&#039; for each code.&lt;br /&gt;
&lt;br /&gt;
In most cases, trigger action code is a key matching this rules:&lt;br /&gt;
* Start with module name&lt;br /&gt;
* Other information (isolated with character _)&lt;br /&gt;
* Action&lt;br /&gt;
&lt;br /&gt;
{{TemplateListOfTriggers}}&lt;br /&gt;
This list may be not complete.&lt;br /&gt;
&lt;br /&gt;
= Manage and create a new trigger&#039;s action =&lt;br /&gt;
&lt;br /&gt;
To manage other events on objects than the one defined before, you must edit the Dolibarr code to add the following code inside the business method of the class file of the object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Call triggers&lt;br /&gt;
include_once(DOL_DOCUMENT_ROOT . &amp;quot;/core/class/interfaces.class.php&amp;quot;);&lt;br /&gt;
$interface=new Interfaces($this-&amp;gt;db);&lt;br /&gt;
$result=$interface-&amp;gt;run_triggers(&#039;XXXXX_YYYYY&#039;,$this,$user,$langs,$conf);&lt;br /&gt;
if ($result &amp;lt; 0) { $error++; $this-&amp;gt;errors=$interface-&amp;gt;errors; }&lt;br /&gt;
// End call triggers&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;With Dolibarr &amp;gt;= 3.7 you must use this piece of code for new trigger :&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Call trigger&lt;br /&gt;
include_once(DOL_DOCUMENT_ROOT . &amp;quot;/core/class/interfaces.class.php&amp;quot;);&lt;br /&gt;
$interface=new Interfaces($this-&amp;gt;db);&lt;br /&gt;
$result=$this-&amp;gt;call_trigger(&#039;XXXXX_YYYYY&#039;,$user); // this is the new way to call triggers with Dolibarr &amp;gt;= 3.7.0&lt;br /&gt;
if ($result &amp;lt; 0) { $error++; $this-&amp;gt;errors=$interface-&amp;gt;errors; }&lt;br /&gt;
// End call triggers&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, &#039;&#039;&#039;$this&#039;&#039;&#039; contains the business class with all information to send to the trigger functions. Replace &#039;XXXXX_YYYYY&#039; by an event code not already used.&lt;br /&gt;
Then you will be able to add inside the run_trigger method, a &amp;quot;if&amp;quot; to manage this code. The run_trigger method will contains a part of code like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function run_trigger($action,$object,$user,$lang,$conf)&lt;br /&gt;
{&lt;br /&gt;
      // Put here code to execute after an action&lt;br /&gt;
      // The type of Dolibarr business event is stored into $action&lt;br /&gt;
      // Data of action are stored into object $object&lt;br /&gt;
      // Setup, user and language are saved into $conf, $user and $lang&lt;br /&gt;
      if ($action == &#039;XXXXX_YYYYY&#039;)&lt;br /&gt;
      {&lt;br /&gt;
          dol_syslog(&amp;quot;Trigger for action &#039;$action&#039; launched. id=&amp;quot;.$object-&amp;gt;id);&lt;br /&gt;
      }&lt;br /&gt;
      elseif ($action == &#039;COMPANY_CREATE&#039;)&lt;br /&gt;
      {&lt;br /&gt;
          dol_syslog(&amp;quot;Trigger for action &#039;$action&#039; launched. id=&amp;quot;.$object-&amp;gt;id);&lt;br /&gt;
      }&lt;br /&gt;
      elseif ($action == &#039;COMPANY_MODIFY&#039;)&lt;br /&gt;
      {        &lt;br /&gt;
          dol_syslog(&amp;quot;Trigger for action &#039;$action&#039; launched. id=&amp;quot;.$object-&amp;gt;id);&lt;br /&gt;
      }&lt;br /&gt;
      elseif ($action == &#039;COMPANY_DELETE&#039;)&lt;br /&gt;
      ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
You can in few minutes, add an interface from Dolibarr towards another system (or why not towards Dolibarr itself), with no risk since you don&#039;t touch anything to Dolibarr files. You only &amp;quot;added&amp;quot; a new trigger file inside the trigger directory.&lt;br /&gt;
If this new interface can serve a lot of other users, you can package it into a tgz file (see page [[Module_development#Create_a_package_to_distribute_and_install_your_module]]) and submit it on the download area in section external contributions on official Dolibarr web site.&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
* [[Hooks system]]&lt;br /&gt;
* [[Interfaces Dolibarr toward foreign systems]]&lt;br /&gt;
* [[Interfaces from foreign systems toward Dolibarr]]&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_development&amp;diff=35370</id>
		<title>Module development</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_development&amp;diff=35370"/>
		<updated>2016-04-24T02:19:12Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Generate the PHP DAO class */&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/rdoursenaud/dolibarr-module-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;
=== 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;
&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;
== 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 list of those files to include (DOL_DOCUMENT_ROOT is often dolibarr/htdocs/) :&lt;br /&gt;
* Object thirdparty (thirdparty) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/societe.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/lib/company.lib.php&lt;br /&gt;
* Object product (product) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/product.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/lib/product.lib.php&lt;br /&gt;
* Object invoice (invoice) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/facture.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/lib/invoice.lib.php&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;dev/skeletons&#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;skeletons_page.php&#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;
$res=0;&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;);			// to work if your module directory is into dolibarr root htdocs directory&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;);		// to work if your module directory is into a subdir of root htdocs directory&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;
require(&#039;../main.inc.php&#039;);&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>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=FAQ_Get,update_GIT_project_sources&amp;diff=35305</id>
		<title>FAQ Get,update GIT project sources</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=FAQ_Get,update_GIT_project_sources&amp;diff=35305"/>
		<updated>2016-04-11T06:13:15Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Clone process */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:FAQ EN]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
This is informations on how you can get sources of Dolibarr project.&lt;br /&gt;
Several methods are described, but we recommandusing  the one based on GitHub.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Get last version of sources by tgz download=&lt;br /&gt;
This method can be used by non technical users.&lt;br /&gt;
It allows you to get sources of main development branch (called HEAD) by just downloading a file: This operation consist to get last version of Dolibarr files that are packaged each night into a tgz file. File is available with link:&lt;br /&gt;
&lt;br /&gt;
{{LinkLastSnapshot}}&lt;br /&gt;
&lt;br /&gt;
New files overwrite old ones.&lt;br /&gt;
The inconvenient of this method is that you must download and uncompress package each time you want to get updates. Developers should not use this method to get sources but the next one.&lt;br /&gt;
&lt;br /&gt;
=Get last version of sources using a GIT anonymous access=&lt;br /&gt;
You can use this method if you don&#039;t have any GIT access. With this method, you won&#039;t be able to submit any changes, so, if you are a developer, it is recommended to create a GitHub account and use the next method instead of this one.&lt;br /&gt;
&lt;br /&gt;
== Prerequisite ==&lt;br /&gt;
* With Eclipse IDE&lt;br /&gt;
First you must have a working install of Eclipse. &#039;&#039;&#039;EGit&#039;&#039;&#039; plugin must also have been installed.&lt;br /&gt;
For this, use the &#039;&#039;&#039;Find And Install process&#039;&#039;&#039; into Eclipse menu, add the GIT update URL: &lt;br /&gt;
 http://download.eclipse.org/egit/updates&lt;br /&gt;
Then choose to install &#039;&#039;&#039;EGit&#039;&#039;&#039; (No need to choose JGit)&lt;br /&gt;
&lt;br /&gt;
* With the GIT Command Line Client Interface&lt;br /&gt;
You need to install GIT client (GIT command line tool with Linux installed with &amp;quot;sudo apt-get install git&amp;quot;, or the GIT client for Windows found at https://git-scm.com/download/win).&lt;br /&gt;
&lt;br /&gt;
== Clone process ==&lt;br /&gt;
First, enter value of the repository with reference sources into your GIT client tool.&lt;br /&gt;
&lt;br /&gt;
* With Eclipse, go into perspective GIT, click onto button &amp;quot;Clone GIT repository&amp;quot;. Enter GIT URL of project to get.&lt;br /&gt;
GIT Url for Dolibarr official source is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
git://github.com/Dolibarr/dolibarr.git (read only)&lt;br /&gt;
or if you created a fork of dolibarr github from github web interface&lt;br /&gt;
git@github.com:yourgitaccount/dolibarr.git (read and write access)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Your Eclipse GIT client will ask you to choose the branches you are interested in. Branches not selected now could be selected later by doing a &amp;quot;Fetch&amp;quot; from the &amp;quot;Remotes&amp;quot; view, but try to choose only the branch you need. This will save you time and problems later.&lt;br /&gt;
&lt;br /&gt;
Note: if you are behind a firewall, you must set Eclipse proxy credentials into Eclipse menu Windows - Preferences - General - Network connection and use the alternative URL:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
https://gitlogin:gitpassword@github.com/yourgitaccount/dolibarr.git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* With GIT on Command Line Interface:&lt;br /&gt;
First setup your git client:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git config --global user.name &amp;quot;Your Name&amp;quot;&lt;br /&gt;
git config --global user.email &amp;quot;user@domain.com&amp;quot;&lt;br /&gt;
git config --list&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Then clone repository locally:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git://github.com/Dolibarr/dolibarr.git (read only)&lt;br /&gt;
or if you created a fork of dolibarr github from github web interface&lt;br /&gt;
git@github.com:yourgitaccount/dolibarr.git (read and write access)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if you are behind a firewall, you must set your porxy information and use the alternative https URL:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git config --global http.proxy http://proxyuser:proxypass@proxyserver:proxyport&lt;br /&gt;
git clone https://gitlogin:gitpassword@github.com/yourgitaccount/dolibarr.git dolibarr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this step is validated, your GIT client will download all files from remote GIT server. This may last several seconds or minutes.&lt;br /&gt;
&lt;br /&gt;
Once download is finished, you must choose which branch to us to work on.&lt;br /&gt;
&lt;br /&gt;
* With GIT on Command Line Interface;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git checkout develop&lt;br /&gt;
git checkout x.y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This will create local branch and make checkout automatically.&lt;br /&gt;
* With Eclipse, right click on &amp;quot;Branches - Remotes - The branch you want to duplicate locally&amp;quot;.&lt;br /&gt;
Choose &amp;quot;Create Branch&amp;quot; (and check the box &amp;quot;Checkout&amp;quot;). This will duplicate content of branch to work on it locally and will refresh your &amp;quot;Working Directory&amp;quot; to work on this branch.&lt;br /&gt;
&lt;br /&gt;
Create Eclipse project:&lt;br /&gt;
&lt;br /&gt;
If using Eclipse, once your branch is created locally, create a PHP project from assistant by choosing &amp;quot;&#039;&#039;&#039;Create from existing project&#039;&#039;&#039;&amp;quot; and select directory that is your GIT local repository (Do not choose to create a PHP project from scratch).&lt;br /&gt;
Then right click on project from your Eclipse workspace and Choose &amp;quot;&#039;&#039;&#039;Team - Share&#039;&#039;&#039;&amp;quot;. Select GIT and click on option &amp;quot;&#039;&#039;&#039;Use or create repository in parent folder of project&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
An alternate method is File-&amp;gt;Import, Git-&amp;gt;Project from Git, Select the Git repository and Next, Use New project Wizard -&amp;gt; Php project, enter the folder of you GIT local repository.&lt;br /&gt;
&lt;br /&gt;
Then, you can setup Eclipse to avoid it to scan all project files for its build tools (Outline scanner, TODO scanner, syntax scanner...). This will avoid Eclipse to be too slow. For this, right click on project, choose Build Path and setup it like into following screenshot.&lt;br /&gt;
&lt;br /&gt;
[[File:Eclipse php build path.png|240px]]&lt;br /&gt;
&lt;br /&gt;
=Get last version of sources using a GitHub user access=&lt;br /&gt;
== Prerequisite ==&lt;br /&gt;
&lt;br /&gt;
* With Eclipse IDE&lt;br /&gt;
You must before create an account on GitHub (https://github.com/) and upload a public RSA or DSA certificate into your account profile.&lt;br /&gt;
&lt;br /&gt;
Then, you must have a working install of Eclipse. &#039;&#039;&#039;EGit&#039;&#039;&#039; plugin must also have been installed.&lt;br /&gt;
For this, use the &#039;&#039;&#039;Find And Install process&#039;&#039;&#039; into Eclipse menu, add the GIT update URL: &lt;br /&gt;
 http://download.eclipse.org/egit/updates&lt;br /&gt;
Then choose to install &#039;&#039;&#039;EGit&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* With the GIT Command Line Client Interface:&lt;br /&gt;
You must before create an account on GitHub (https://github.com/) and upload a public RSA or DSA certificate into your account profile.&lt;br /&gt;
&lt;br /&gt;
Then, you need to install GIT client (GIT command line tool with Linux installed with &amp;quot;sudo apt-get install git&amp;quot;, or the GIT client for Windows found at https://git-scm.com/download/win).&lt;br /&gt;
&lt;br /&gt;
== Fork process ==&lt;br /&gt;
Login to Github, with login you created in previous step. Then go onto page&lt;br /&gt;
&lt;br /&gt;
https://github.com/Dolibarr/dolibarr&lt;br /&gt;
&lt;br /&gt;
And click on button &amp;quot;Fork&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This will create a copy (a fork) of project into your own github area. Because you will be the owner of this fork, you will have all permissions on it to be used in next steps.&lt;br /&gt;
&lt;br /&gt;
== Clone process ==&lt;br /&gt;
Then process is same as getting sources with anonymous access.&lt;br /&gt;
&lt;br /&gt;
URL to use for GIT clone is same:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
git@github.com:YourGitHubLogin/dolibarr.git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that a HTTPS URL is also available but it&#039;s sometimes offline (so prefer using first one, link with HTTPS is required only if you are behind a firewall):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
https://yourgithublogin@github.com/Dolibarr/dolibarr.git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Update your repository=&lt;br /&gt;
To update your local workspace:&lt;br /&gt;
&lt;br /&gt;
* With Eclipse IDE:&lt;br /&gt;
right click on Eclipse project and select &amp;quot;Pull&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If you made some changes into your Eclipse workspace on files that were changed into the GIT remote reference, your GIT client will make a merge automatically.&lt;br /&gt;
* If there is conflicts, the merge will mark all conflict files as &amp;quot;conflict&amp;quot; (See later to solve this state).&lt;br /&gt;
* If not, you will get all new version files including all your changes.&lt;br /&gt;
&lt;br /&gt;
If you already have commited some files into your local repository, your workspace will be marked as &amp;quot;Merged&amp;quot;.&lt;br /&gt;
All you have to do is make a commit to validate your local repository as including your changes and changes made by others.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*With the GIT Command Line Client Interface:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git pull&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Commit and publish your changes =&lt;br /&gt;
To see all changes you made into your working directory and waiting to be added into Git:&lt;br /&gt;
* With GIT Command Line Interface:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git status&lt;br /&gt;
git diff subdir/filename&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To add changes made into your local repository into the GIT index, then commit this index :&lt;br /&gt;
* With Eclipse: Right click on file or directory to commit. Select file to add/remove/update into commit.&lt;br /&gt;
* With GIT Command Line Interface:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git commit -a -m &amp;quot;Commit text&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This will save add and changes into your local branch.&lt;br /&gt;
&lt;br /&gt;
To push them on the GIT repository server,&lt;br /&gt;
* With Eclipse: right click on project and choose &amp;quot;&#039;&#039;&#039;Team - Push to Upstream&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
* With GIT Command Line Interface:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git push&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To cancel a commit:&lt;br /&gt;
* With GIT Command Line Interface, if commit was not already pushed:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git reset --soft HEAD~1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* With GIT Command Line Interface, if commit was already pushed:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git revert IdCommit  or  git revert HEAD  (for last commit)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To merge changes done into your forked GIT instance into official Dolibarr instance:&lt;br /&gt;
* Go into GitHub web interface of your forked Git instance.&lt;br /&gt;
* Click on small button &amp;quot;Create a Pull request&amp;quot;.&lt;br /&gt;
* Choose commit you request inclusion and validate.&lt;br /&gt;
&lt;br /&gt;
= Ask official project to include your changes =&lt;br /&gt;
Once you pushed one or several commit toward your distant fork area on github, you can ask the Dolibarr core team to include it into official project.&lt;br /&gt;
For this, follow this tutorial: https://help.github.com/articles/creating-a-pull-request/&lt;br /&gt;
&lt;br /&gt;
= Add an external commit into current repository =&lt;br /&gt;
Some developers may work and do commit into their own Git repository after forking the project. If you are interesting into getting this changes, you can import them with the following steps.&lt;br /&gt;
&lt;br /&gt;
You need both Eclipse and GIT Command Line interface to achieve this:&lt;br /&gt;
* First, go into GIT setup view and right click on &amp;quot;&#039;&#039;&#039;Remotes&#039;&#039;&#039;&amp;quot; of your Eclipse Git working space and choose &amp;quot;&#039;&#039;&#039;Create a remote...&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
* Type name or remote fork the developer has create (in most cases, it&#039;s developer Git login). For example: &amp;quot;&#039;&#039;&#039;thedevlogin&#039;&#039;&#039;&amp;quot;. Choose also &amp;quot;&#039;&#039;&#039;Configure Fetch&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
* Type URI of Git repository of developer. For example: &#039;&#039;&#039;git://github.com/thedevlogin/dolibarr.git&#039;&#039;&#039;. Also add a refspec value to declare the branch you want to get. For example: &#039;&#039;&#039;refs/heads/master:refs/remotes/thedevlogin/master&#039;&#039;&#039;. Click &amp;quot;&#039;&#039;&#039;Save and Fetch&#039;&#039;&#039;&amp;quot;. A new entry will be added into &amp;quot;Remote Tracking&amp;quot; making possible to read/get commits done into this branch.&lt;br /&gt;
&lt;br /&gt;
Now, go on command line of your git repository (in most cases on Linux, it&#039;s &#039;&#039;&#039;/home/yourlogin/git/yourdolibarr&#039;&#039;&#039;) and type the git cherry-pick command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git cherry-pick -x commitid&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
where commitid is value of commit id you want to get.&lt;br /&gt;
&lt;br /&gt;
Once this is done, go back to Eclipse and make a refresh on project. You will see modified files appears with decorators (with conflicts if there is).&lt;br /&gt;
&lt;br /&gt;
It the cherry-pick fails because of conflicts, you can cancel the cherry-pick try with&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git cherry-pick --abort&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Solving a conflict=&lt;br /&gt;
If a file has been marked as &amp;quot;conflict&amp;quot; after a Pull, open the file to edit it.&lt;br /&gt;
Find string &amp;quot;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;quot;, you will see part of code that is conflict between &amp;quot;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;quot;. Edit manually code lines and remove &amp;quot;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Then, right click on file and select &amp;quot;Add&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If you prefer to forget completely all changes you made into all files (so to restore you workspace with content of remote repository), you can make a hard reset:&lt;br /&gt;
* With Eclipse: Right click on project top line and select &amp;quot;&#039;&#039;&#039;Reset&#039;&#039;&#039;&amp;quot; then &amp;quot;&#039;&#039;&#039;Hard&#039;&#039;&#039;&amp;quot; then &amp;quot;&#039;&#039;&#039;Reference - HEAD&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
* With GIT Command Line Interface: You can achieve this with command&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git reset --hard HEAD&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To reset changes you commited but not pushed to origin&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git reset --hard origin/develop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Tagging sources=&lt;br /&gt;
With GIT Command Line Interface:&lt;br /&gt;
&lt;br /&gt;
To add a tag to a current version:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git tag -a -m &amp;quot;Release|Maintenance release x.y.z&amp;quot; &amp;quot;x.y.z&amp;quot;&lt;br /&gt;
or&lt;br /&gt;
git tag -a -f -m &amp;quot;Beta x.y.betai&amp;quot; &amp;quot;x.y.betai_YYYYMMDD&amp;quot; idcommit   # -f force if an existing tag already exists, idcommit allows to choose commit to tag&lt;br /&gt;
&lt;br /&gt;
git push --tags   # To push tags to remote origin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To remove a tag:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git tag -d &amp;quot;x.y.z_YYYYMMDD&amp;quot;&lt;br /&gt;
git push remoteentryname :x.y.z_YYYYMMDD    # To validate delete on remote origin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Creating a new branch=&lt;br /&gt;
With GIT Command Line Interface:&lt;br /&gt;
&lt;br /&gt;
Create a clone (see previously) of the branch from where you want to create another branch, then go into directory and launch command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git branch x.y&lt;br /&gt;
git push origin x.y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With Eclipse:&lt;br /&gt;
&lt;br /&gt;
Create a clone (see previously) of the branch from where you want to create another branch, with a checkout done. The go into view git. Choose branches, remote tracking and select start branch.&lt;br /&gt;
Right click and choose &amp;quot;Create branch&amp;quot;. &lt;br /&gt;
Then make a push to create branch remotely.&lt;br /&gt;
Then go into &amp;quot;Remotes - origins&amp;quot; and edit the entries to pull and push onto new branch.&lt;br /&gt;
It may also be required to edit the .git/config file to have project linked by default onto new branch.&lt;br /&gt;
&lt;br /&gt;
= Deleting a branch=&lt;br /&gt;
With GIT Command Line Interface:&lt;br /&gt;
&lt;br /&gt;
Do a push on branch but add : before name of branch:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git push remoteentryname :branchnametodelete&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Merging a maintenance branch x.x into dev branch=&lt;br /&gt;
With Eclipse:&lt;br /&gt;
* Go onto the root directory of project with a checkout of the dev branch.&lt;br /&gt;
* Check fetch setup to be sure, this repository contains both information of dev branch and version x.x you want to merge.&lt;br /&gt;
* Right click onto root directory and choose &amp;quot;Team - Merge&amp;quot;. Select &amp;quot;x.x&amp;quot;. Click onto &amp;quot;Merge options - Commit&amp;quot;, because we want to commit merged branch if there is no conflicts.&lt;br /&gt;
* Once merge is done, check everything is ok.&lt;br /&gt;
* Commit and push.&lt;br /&gt;
&lt;br /&gt;
= Pushing a branch onto another Git server =&lt;br /&gt;
You may want to synchronize another GIT server.&lt;br /&gt;
To synchronize push to another server, this is how to proceed.&lt;br /&gt;
With Eclipse:&lt;br /&gt;
* Go onto Git clone view and add a remote with a name, choose &amp;quot;Configure push&amp;quot; and enter URL. For example, for name &amp;quot;sourceforge&amp;quot; and URL &amp;quot;ssh://yoursourceforgelogin@git.code.sf.net/p/dolibarr/code&amp;quot;&lt;br /&gt;
* Just validate, a first push will be done automatically.&lt;br /&gt;
* To force sync, run &lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git push sourceforge develop&lt;br /&gt;
git push --tags sourceforge develop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Statistics=&lt;br /&gt;
With GIT Command Line interface:&lt;br /&gt;
&lt;br /&gt;
To count number of changes developers have made between a version x and y:&lt;br /&gt;
* First, search commit id of tags you want to compare&lt;br /&gt;
To find id_start (common commit id between 2 versions/tags)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git merge-base refs/tags/3.3.0 origin/3.4&lt;br /&gt;
or&lt;br /&gt;
git merge-base 3.7 origin/develop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To find id_end, choose among&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git show-ref&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Choose a value for id_start and id_end&lt;br /&gt;
Note: id_end can be HEAD.&lt;br /&gt;
* Then run git log to have list of all changes from last common commit to last commit&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git log id_start..id_end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* To get total number of added/deleted lines:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git log --ancestry-path --numstat --pretty=&amp;quot;%H&amp;quot; id_start..id_end | awk &#039;NF==3 {plus+=$1; minus+=$2} END {printf(&amp;quot;+%d, -%d\n&amp;quot;, plus, minus)}&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To count number of changes finally between a version x and y (it differs from previous count because in previous count, a change can be done 2 times at two different moment to change differently. With second method, you count changes finally found if changes were ok at first try). &lt;br /&gt;
* Use same method than previously but instead of running git log, run git diff.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git diff -b -M --numstat --pretty=&amp;quot;%H&amp;quot; id_start..id_end | awk &#039;NF==3 {plus+=$1; minus+=$2} END {printf(&amp;quot;+%d, -%d\n&amp;quot;, plus, minus)}&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More information in GIT usage is available [http://wiki.eclipse.org/EGit/User_Guide here].&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=FAQ_Get,update_GIT_project_sources&amp;diff=35304</id>
		<title>FAQ Get,update GIT project sources</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=FAQ_Get,update_GIT_project_sources&amp;diff=35304"/>
		<updated>2016-04-11T06:12:21Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Fork process */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:FAQ EN]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
This is informations on how you can get sources of Dolibarr project.&lt;br /&gt;
Several methods are described, but we recommandusing  the one based on GitHub.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Get last version of sources by tgz download=&lt;br /&gt;
This method can be used by non technical users.&lt;br /&gt;
It allows you to get sources of main development branch (called HEAD) by just downloading a file: This operation consist to get last version of Dolibarr files that are packaged each night into a tgz file. File is available with link:&lt;br /&gt;
&lt;br /&gt;
{{LinkLastSnapshot}}&lt;br /&gt;
&lt;br /&gt;
New files overwrite old ones.&lt;br /&gt;
The inconvenient of this method is that you must download and uncompress package each time you want to get updates. Developers should not use this method to get sources but the next one.&lt;br /&gt;
&lt;br /&gt;
=Get last version of sources using a GIT anonymous access=&lt;br /&gt;
You can use this method if you don&#039;t have any GIT access. With this method, you won&#039;t be able to submit any changes, so, if you are a developer, it is recommended to create a GitHub account and use the next method instead of this one.&lt;br /&gt;
&lt;br /&gt;
== Prerequisite ==&lt;br /&gt;
* With Eclipse IDE&lt;br /&gt;
First you must have a working install of Eclipse. &#039;&#039;&#039;EGit&#039;&#039;&#039; plugin must also have been installed.&lt;br /&gt;
For this, use the &#039;&#039;&#039;Find And Install process&#039;&#039;&#039; into Eclipse menu, add the GIT update URL: &lt;br /&gt;
 http://download.eclipse.org/egit/updates&lt;br /&gt;
Then choose to install &#039;&#039;&#039;EGit&#039;&#039;&#039; (No need to choose JGit)&lt;br /&gt;
&lt;br /&gt;
* With the GIT Command Line Client Interface&lt;br /&gt;
You need to install GIT client (GIT command line tool with Linux installed with &amp;quot;sudo apt-get install git&amp;quot;, or the GIT client for Windows found at https://git-scm.com/download/win).&lt;br /&gt;
&lt;br /&gt;
== Clone process ==&lt;br /&gt;
First, enter value of the repository with reference sources into your GIT client tool.&lt;br /&gt;
&lt;br /&gt;
* With Eclipse, go into perspective GIT, click onto button &amp;quot;Clone GIT repository&amp;quot;. Enter GIT URL of project to get.&lt;br /&gt;
GIT Url for Dolibarr official source is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
git://github.com/Dolibarr/dolibarr.git (read only)&lt;br /&gt;
or if you created a fork of dolibarr github from github web interface&lt;br /&gt;
git@github.com:yourgitaccount/dolibarr.git (read and write access)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Your Eclipse GIT client will ask you to choose the branches you are interested in. Branches not selected now could be selected later by doing a &amp;quot;Fetch&amp;quot; from the &amp;quot;Remotes&amp;quot; view, but try to choose only the branch you need. This will save you time and problems later.&lt;br /&gt;
&lt;br /&gt;
Note: if you are behind a firewall, you must set Eclipse proxy credentials into Eclipse menu Windows - Preferences - General - Network connection and use the alternative URL:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
https://gitlogin:gitpassword@github.com/yourgitaccount/dolibarr.git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* With GIT on Command Line Interface:&lt;br /&gt;
First setup your git client:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git config --global user.name &amp;quot;Your Name&amp;quot;&lt;br /&gt;
git config --global user.email &amp;quot;user@domain.com&amp;quot;&lt;br /&gt;
git config --list&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Then clone repository locally:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git://github.com/Dolibarr/dolibarr.git (read only)&lt;br /&gt;
or if you created a fork of dolibarr github from github web interface&lt;br /&gt;
git@github.com:yourgitaccount/dolibarr.git (read and write access)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if you are behind a firewall, you must set your porxy information and use the alternative https URL:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git config --global http.proxy http://proxyuser:proxypass@proxyserver:proxyport&lt;br /&gt;
git clone https://gitlogin:gitpassword@github.com/yourgitaccount/dolibarr.git dolibarr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this step is validated, your GIT client will download all files from remote GIT server. This may last several seconds or minutes.&lt;br /&gt;
&lt;br /&gt;
Once download is finished, you must choose which branch to us to work on.&lt;br /&gt;
&lt;br /&gt;
* With GIT on Command Line Interface;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git checkout develop&lt;br /&gt;
git checkout x.y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This will create local branch and make checkout automatically.&lt;br /&gt;
* With Eclipse, right click on &amp;quot;Branches - Remotes - The branch you want to duplicate locally&amp;quot;.&lt;br /&gt;
Choose &amp;quot;Create Branch&amp;quot; (and check the box &amp;quot;Checkout&amp;quot;). This will duplicate content of branch to work on it locally and will refresh your &amp;quot;Working Directory&amp;quot; to work on this branch.&lt;br /&gt;
&lt;br /&gt;
Create Eclipse project:&lt;br /&gt;
&lt;br /&gt;
If using Eclipse, once your branch is created locally, create a PHP project from assistant by choosing &amp;quot;&#039;&#039;&#039;Create from existing project&#039;&#039;&#039;&amp;quot; and select directory that is your GIT local repository (Do not choose to create a PHP project from scratch).&lt;br /&gt;
Then right click on project from your Eclipse workspace and Choose &amp;quot;&#039;&#039;&#039;Team - Share&#039;&#039;&#039;&amp;quot;. Select GIT and click on option &amp;quot;&#039;&#039;&#039;Use or create repository in parent folder of project&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
An alternate method is File-&amp;gt;Import, Git-&amp;gt;Project from Git, Select the Git repository and Next, Use New project Wizard -&amp;gt; Php project, enter the folder of you GIT local repository.&lt;br /&gt;
&lt;br /&gt;
Then, you can setup Eclipse to avoid it to scan all project files for its build tools (Outline scanner, TODO scanner, syntax scanner...). This will avoid Eclipse to be too slow. For this, right click on project, choose Build Path and setup it like into following screenshot.&lt;br /&gt;
&lt;br /&gt;
[[File:Eclipse php build path.png|240px]]&lt;br /&gt;
&lt;br /&gt;
=Get last version of sources using a GitHub user access=&lt;br /&gt;
== Prerequisite ==&lt;br /&gt;
&lt;br /&gt;
* With Eclipse IDE&lt;br /&gt;
You must before create an account on GitHub (https://github.com/) and upload a public RSA or DSA certificate into your account profile.&lt;br /&gt;
&lt;br /&gt;
Then, you must have a working install of Eclipse. &#039;&#039;&#039;EGit&#039;&#039;&#039; plugin must also have been installed.&lt;br /&gt;
For this, use the &#039;&#039;&#039;Find And Install process&#039;&#039;&#039; into Eclipse menu, add the GIT update URL: &lt;br /&gt;
 http://download.eclipse.org/egit/updates&lt;br /&gt;
Then choose to install &#039;&#039;&#039;EGit&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* With the GIT Command Line Client Interface:&lt;br /&gt;
You must before create an account on GitHub (https://github.com/) and upload a public RSA or DSA certificate into your account profile.&lt;br /&gt;
&lt;br /&gt;
Then, you need to install GIT client (GIT command line tool with Linux installed with &amp;quot;sudo apt-get install git&amp;quot;, or the GIT client for Windows found at https://git-scm.com/download/win).&lt;br /&gt;
&lt;br /&gt;
== Fork process ==&lt;br /&gt;
Login to Github, with login you created in previous step. Then go onto page&lt;br /&gt;
&lt;br /&gt;
https://github.com/Dolibarr/dolibarr&lt;br /&gt;
&lt;br /&gt;
And click on button &amp;quot;Fork&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This will create a copy (a fork) of project into your own github area. Because you will be the owner of this fork, you will have all permissions on it to be used in next steps.&lt;br /&gt;
&lt;br /&gt;
== Clone process ==&lt;br /&gt;
Then process is same than getting sources with anonymous access.&lt;br /&gt;
&lt;br /&gt;
URL to use for GIT clone is same:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
git@github.com:YourGitHubLogin/dolibarr.git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that a HTTPS URL is also available but it&#039;s sometimes offline (so prefer using first one, link with HTTPS is required only if you are behind a firewall):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
https://yourgithublogin@github.com/Dolibarr/dolibarr.git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Update your repository=&lt;br /&gt;
To update your local workspace:&lt;br /&gt;
&lt;br /&gt;
* With Eclipse IDE:&lt;br /&gt;
right click on Eclipse project and select &amp;quot;Pull&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If you made some changes into your Eclipse workspace on files that were changed into the GIT remote reference, your GIT client will make a merge automatically.&lt;br /&gt;
* If there is conflicts, the merge will mark all conflict files as &amp;quot;conflict&amp;quot; (See later to solve this state).&lt;br /&gt;
* If not, you will get all new version files including all your changes.&lt;br /&gt;
&lt;br /&gt;
If you already have commited some files into your local repository, your workspace will be marked as &amp;quot;Merged&amp;quot;.&lt;br /&gt;
All you have to do is make a commit to validate your local repository as including your changes and changes made by others.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*With the GIT Command Line Client Interface:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git pull&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Commit and publish your changes =&lt;br /&gt;
To see all changes you made into your working directory and waiting to be added into Git:&lt;br /&gt;
* With GIT Command Line Interface:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git status&lt;br /&gt;
git diff subdir/filename&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To add changes made into your local repository into the GIT index, then commit this index :&lt;br /&gt;
* With Eclipse: Right click on file or directory to commit. Select file to add/remove/update into commit.&lt;br /&gt;
* With GIT Command Line Interface:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git commit -a -m &amp;quot;Commit text&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This will save add and changes into your local branch.&lt;br /&gt;
&lt;br /&gt;
To push them on the GIT repository server,&lt;br /&gt;
* With Eclipse: right click on project and choose &amp;quot;&#039;&#039;&#039;Team - Push to Upstream&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
* With GIT Command Line Interface:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git push&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To cancel a commit:&lt;br /&gt;
* With GIT Command Line Interface, if commit was not already pushed:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git reset --soft HEAD~1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* With GIT Command Line Interface, if commit was already pushed:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git revert IdCommit  or  git revert HEAD  (for last commit)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To merge changes done into your forked GIT instance into official Dolibarr instance:&lt;br /&gt;
* Go into GitHub web interface of your forked Git instance.&lt;br /&gt;
* Click on small button &amp;quot;Create a Pull request&amp;quot;.&lt;br /&gt;
* Choose commit you request inclusion and validate.&lt;br /&gt;
&lt;br /&gt;
= Ask official project to include your changes =&lt;br /&gt;
Once you pushed one or several commit toward your distant fork area on github, you can ask the Dolibarr core team to include it into official project.&lt;br /&gt;
For this, follow this tutorial: https://help.github.com/articles/creating-a-pull-request/&lt;br /&gt;
&lt;br /&gt;
= Add an external commit into current repository =&lt;br /&gt;
Some developers may work and do commit into their own Git repository after forking the project. If you are interesting into getting this changes, you can import them with the following steps.&lt;br /&gt;
&lt;br /&gt;
You need both Eclipse and GIT Command Line interface to achieve this:&lt;br /&gt;
* First, go into GIT setup view and right click on &amp;quot;&#039;&#039;&#039;Remotes&#039;&#039;&#039;&amp;quot; of your Eclipse Git working space and choose &amp;quot;&#039;&#039;&#039;Create a remote...&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
* Type name or remote fork the developer has create (in most cases, it&#039;s developer Git login). For example: &amp;quot;&#039;&#039;&#039;thedevlogin&#039;&#039;&#039;&amp;quot;. Choose also &amp;quot;&#039;&#039;&#039;Configure Fetch&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
* Type URI of Git repository of developer. For example: &#039;&#039;&#039;git://github.com/thedevlogin/dolibarr.git&#039;&#039;&#039;. Also add a refspec value to declare the branch you want to get. For example: &#039;&#039;&#039;refs/heads/master:refs/remotes/thedevlogin/master&#039;&#039;&#039;. Click &amp;quot;&#039;&#039;&#039;Save and Fetch&#039;&#039;&#039;&amp;quot;. A new entry will be added into &amp;quot;Remote Tracking&amp;quot; making possible to read/get commits done into this branch.&lt;br /&gt;
&lt;br /&gt;
Now, go on command line of your git repository (in most cases on Linux, it&#039;s &#039;&#039;&#039;/home/yourlogin/git/yourdolibarr&#039;&#039;&#039;) and type the git cherry-pick command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git cherry-pick -x commitid&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
where commitid is value of commit id you want to get.&lt;br /&gt;
&lt;br /&gt;
Once this is done, go back to Eclipse and make a refresh on project. You will see modified files appears with decorators (with conflicts if there is).&lt;br /&gt;
&lt;br /&gt;
It the cherry-pick fails because of conflicts, you can cancel the cherry-pick try with&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git cherry-pick --abort&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Solving a conflict=&lt;br /&gt;
If a file has been marked as &amp;quot;conflict&amp;quot; after a Pull, open the file to edit it.&lt;br /&gt;
Find string &amp;quot;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;quot;, you will see part of code that is conflict between &amp;quot;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;quot;. Edit manually code lines and remove &amp;quot;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Then, right click on file and select &amp;quot;Add&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If you prefer to forget completely all changes you made into all files (so to restore you workspace with content of remote repository), you can make a hard reset:&lt;br /&gt;
* With Eclipse: Right click on project top line and select &amp;quot;&#039;&#039;&#039;Reset&#039;&#039;&#039;&amp;quot; then &amp;quot;&#039;&#039;&#039;Hard&#039;&#039;&#039;&amp;quot; then &amp;quot;&#039;&#039;&#039;Reference - HEAD&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
* With GIT Command Line Interface: You can achieve this with command&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git reset --hard HEAD&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To reset changes you commited but not pushed to origin&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git reset --hard origin/develop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Tagging sources=&lt;br /&gt;
With GIT Command Line Interface:&lt;br /&gt;
&lt;br /&gt;
To add a tag to a current version:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git tag -a -m &amp;quot;Release|Maintenance release x.y.z&amp;quot; &amp;quot;x.y.z&amp;quot;&lt;br /&gt;
or&lt;br /&gt;
git tag -a -f -m &amp;quot;Beta x.y.betai&amp;quot; &amp;quot;x.y.betai_YYYYMMDD&amp;quot; idcommit   # -f force if an existing tag already exists, idcommit allows to choose commit to tag&lt;br /&gt;
&lt;br /&gt;
git push --tags   # To push tags to remote origin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To remove a tag:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git tag -d &amp;quot;x.y.z_YYYYMMDD&amp;quot;&lt;br /&gt;
git push remoteentryname :x.y.z_YYYYMMDD    # To validate delete on remote origin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Creating a new branch=&lt;br /&gt;
With GIT Command Line Interface:&lt;br /&gt;
&lt;br /&gt;
Create a clone (see previously) of the branch from where you want to create another branch, then go into directory and launch command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git branch x.y&lt;br /&gt;
git push origin x.y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With Eclipse:&lt;br /&gt;
&lt;br /&gt;
Create a clone (see previously) of the branch from where you want to create another branch, with a checkout done. The go into view git. Choose branches, remote tracking and select start branch.&lt;br /&gt;
Right click and choose &amp;quot;Create branch&amp;quot;. &lt;br /&gt;
Then make a push to create branch remotely.&lt;br /&gt;
Then go into &amp;quot;Remotes - origins&amp;quot; and edit the entries to pull and push onto new branch.&lt;br /&gt;
It may also be required to edit the .git/config file to have project linked by default onto new branch.&lt;br /&gt;
&lt;br /&gt;
= Deleting a branch=&lt;br /&gt;
With GIT Command Line Interface:&lt;br /&gt;
&lt;br /&gt;
Do a push on branch but add : before name of branch:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git push remoteentryname :branchnametodelete&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Merging a maintenance branch x.x into dev branch=&lt;br /&gt;
With Eclipse:&lt;br /&gt;
* Go onto the root directory of project with a checkout of the dev branch.&lt;br /&gt;
* Check fetch setup to be sure, this repository contains both information of dev branch and version x.x you want to merge.&lt;br /&gt;
* Right click onto root directory and choose &amp;quot;Team - Merge&amp;quot;. Select &amp;quot;x.x&amp;quot;. Click onto &amp;quot;Merge options - Commit&amp;quot;, because we want to commit merged branch if there is no conflicts.&lt;br /&gt;
* Once merge is done, check everything is ok.&lt;br /&gt;
* Commit and push.&lt;br /&gt;
&lt;br /&gt;
= Pushing a branch onto another Git server =&lt;br /&gt;
You may want to synchronize another GIT server.&lt;br /&gt;
To synchronize push to another server, this is how to proceed.&lt;br /&gt;
With Eclipse:&lt;br /&gt;
* Go onto Git clone view and add a remote with a name, choose &amp;quot;Configure push&amp;quot; and enter URL. For example, for name &amp;quot;sourceforge&amp;quot; and URL &amp;quot;ssh://yoursourceforgelogin@git.code.sf.net/p/dolibarr/code&amp;quot;&lt;br /&gt;
* Just validate, a first push will be done automatically.&lt;br /&gt;
* To force sync, run &lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git push sourceforge develop&lt;br /&gt;
git push --tags sourceforge develop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Statistics=&lt;br /&gt;
With GIT Command Line interface:&lt;br /&gt;
&lt;br /&gt;
To count number of changes developers have made between a version x and y:&lt;br /&gt;
* First, search commit id of tags you want to compare&lt;br /&gt;
To find id_start (common commit id between 2 versions/tags)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git merge-base refs/tags/3.3.0 origin/3.4&lt;br /&gt;
or&lt;br /&gt;
git merge-base 3.7 origin/develop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To find id_end, choose among&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git show-ref&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Choose a value for id_start and id_end&lt;br /&gt;
Note: id_end can be HEAD.&lt;br /&gt;
* Then run git log to have list of all changes from last common commit to last commit&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git log id_start..id_end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* To get total number of added/deleted lines:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git log --ancestry-path --numstat --pretty=&amp;quot;%H&amp;quot; id_start..id_end | awk &#039;NF==3 {plus+=$1; minus+=$2} END {printf(&amp;quot;+%d, -%d\n&amp;quot;, plus, minus)}&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To count number of changes finally between a version x and y (it differs from previous count because in previous count, a change can be done 2 times at two different moment to change differently. With second method, you count changes finally found if changes were ok at first try). &lt;br /&gt;
* Use same method than previously but instead of running git log, run git diff.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git diff -b -M --numstat --pretty=&amp;quot;%H&amp;quot; id_start..id_end | awk &#039;NF==3 {plus+=$1; minus+=$2} END {printf(&amp;quot;+%d, -%d\n&amp;quot;, plus, minus)}&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More information in GIT usage is available [http://wiki.eclipse.org/EGit/User_Guide here].&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=FAQ_Get,update_GIT_project_sources&amp;diff=35303</id>
		<title>FAQ Get,update GIT project sources</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=FAQ_Get,update_GIT_project_sources&amp;diff=35303"/>
		<updated>2016-04-11T05:50:58Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Fork process */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:FAQ EN]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
This is informations on how you can get sources of Dolibarr project.&lt;br /&gt;
Several methods are described, but we recommandusing  the one based on GitHub.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Get last version of sources by tgz download=&lt;br /&gt;
This method can be used by non technical users.&lt;br /&gt;
It allows you to get sources of main development branch (called HEAD) by just downloading a file: This operation consist to get last version of Dolibarr files that are packaged each night into a tgz file. File is available with link:&lt;br /&gt;
&lt;br /&gt;
{{LinkLastSnapshot}}&lt;br /&gt;
&lt;br /&gt;
New files overwrite old ones.&lt;br /&gt;
The inconvenient of this method is that you must download and uncompress package each time you want to get updates. Developers should not use this method to get sources but the next one.&lt;br /&gt;
&lt;br /&gt;
=Get last version of sources using a GIT anonymous access=&lt;br /&gt;
You can use this method if you don&#039;t have any GIT access. With this method, you won&#039;t be able to submit any changes, so, if you are a developer, it is recommended to create a GitHub account and use the next method instead of this one.&lt;br /&gt;
&lt;br /&gt;
== Prerequisite ==&lt;br /&gt;
* With Eclipse IDE&lt;br /&gt;
First you must have a working install of Eclipse. &#039;&#039;&#039;EGit&#039;&#039;&#039; plugin must also have been installed.&lt;br /&gt;
For this, use the &#039;&#039;&#039;Find And Install process&#039;&#039;&#039; into Eclipse menu, add the GIT update URL: &lt;br /&gt;
 http://download.eclipse.org/egit/updates&lt;br /&gt;
Then choose to install &#039;&#039;&#039;EGit&#039;&#039;&#039; (No need to choose JGit)&lt;br /&gt;
&lt;br /&gt;
* With the GIT Command Line Client Interface&lt;br /&gt;
You need to install GIT client (GIT command line tool with Linux installed with &amp;quot;sudo apt-get install git&amp;quot;, or the GIT client for Windows found at https://git-scm.com/download/win).&lt;br /&gt;
&lt;br /&gt;
== Clone process ==&lt;br /&gt;
First, enter value of the repository with reference sources into your GIT client tool.&lt;br /&gt;
&lt;br /&gt;
* With Eclipse, go into perspective GIT, click onto button &amp;quot;Clone GIT repository&amp;quot;. Enter GIT URL of project to get.&lt;br /&gt;
GIT Url for Dolibarr official source is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
git://github.com/Dolibarr/dolibarr.git (read only)&lt;br /&gt;
or if you created a fork of dolibarr github from github web interface&lt;br /&gt;
git@github.com:yourgitaccount/dolibarr.git (read and write access)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Your Eclipse GIT client will ask you to choose the branches you are interested in. Branches not selected now could be selected later by doing a &amp;quot;Fetch&amp;quot; from the &amp;quot;Remotes&amp;quot; view, but try to choose only the branch you need. This will save you time and problems later.&lt;br /&gt;
&lt;br /&gt;
Note: if you are behind a firewall, you must set Eclipse proxy credentials into Eclipse menu Windows - Preferences - General - Network connection and use the alternative URL:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
https://gitlogin:gitpassword@github.com/yourgitaccount/dolibarr.git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* With GIT on Command Line Interface:&lt;br /&gt;
First setup your git client:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git config --global user.name &amp;quot;Your Name&amp;quot;&lt;br /&gt;
git config --global user.email &amp;quot;user@domain.com&amp;quot;&lt;br /&gt;
git config --list&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Then clone repository locally:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git://github.com/Dolibarr/dolibarr.git (read only)&lt;br /&gt;
or if you created a fork of dolibarr github from github web interface&lt;br /&gt;
git@github.com:yourgitaccount/dolibarr.git (read and write access)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if you are behind a firewall, you must set your porxy information and use the alternative https URL:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git config --global http.proxy http://proxyuser:proxypass@proxyserver:proxyport&lt;br /&gt;
git clone https://gitlogin:gitpassword@github.com/yourgitaccount/dolibarr.git dolibarr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this step is validated, your GIT client will download all files from remote GIT server. This may last several seconds or minutes.&lt;br /&gt;
&lt;br /&gt;
Once download is finished, you must choose which branch to us to work on.&lt;br /&gt;
&lt;br /&gt;
* With GIT on Command Line Interface;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git checkout develop&lt;br /&gt;
git checkout x.y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This will create local branch and make checkout automatically.&lt;br /&gt;
* With Eclipse, right click on &amp;quot;Branches - Remotes - The branch you want to duplicate locally&amp;quot;.&lt;br /&gt;
Choose &amp;quot;Create Branch&amp;quot; (and check the box &amp;quot;Checkout&amp;quot;). This will duplicate content of branch to work on it locally and will refresh your &amp;quot;Working Directory&amp;quot; to work on this branch.&lt;br /&gt;
&lt;br /&gt;
Create Eclipse project:&lt;br /&gt;
&lt;br /&gt;
If using Eclipse, once your branch is created locally, create a PHP project from assistant by choosing &amp;quot;&#039;&#039;&#039;Create from existing project&#039;&#039;&#039;&amp;quot; and select directory that is your GIT local repository (Do not choose to create a PHP project from scratch).&lt;br /&gt;
Then right click on project from your Eclipse workspace and Choose &amp;quot;&#039;&#039;&#039;Team - Share&#039;&#039;&#039;&amp;quot;. Select GIT and click on option &amp;quot;&#039;&#039;&#039;Use or create repository in parent folder of project&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
An alternate method is File-&amp;gt;Import, Git-&amp;gt;Project from Git, Select the Git repository and Next, Use New project Wizard -&amp;gt; Php project, enter the folder of you GIT local repository.&lt;br /&gt;
&lt;br /&gt;
Then, you can setup Eclipse to avoid it to scan all project files for its build tools (Outline scanner, TODO scanner, syntax scanner...). This will avoid Eclipse to be too slow. For this, right click on project, choose Build Path and setup it like into following screenshot.&lt;br /&gt;
&lt;br /&gt;
[[File:Eclipse php build path.png|240px]]&lt;br /&gt;
&lt;br /&gt;
=Get last version of sources using a GitHub user access=&lt;br /&gt;
== Prerequisite ==&lt;br /&gt;
&lt;br /&gt;
* With Eclipse IDE&lt;br /&gt;
You must before create an account on GitHub (https://github.com/) and upload a public RSA or DSA certificate into your account profile.&lt;br /&gt;
&lt;br /&gt;
Then, you must have a working install of Eclipse. &#039;&#039;&#039;EGit&#039;&#039;&#039; plugin must also have been installed.&lt;br /&gt;
For this, use the &#039;&#039;&#039;Find And Install process&#039;&#039;&#039; into Eclipse menu, add the GIT update URL: &lt;br /&gt;
 http://download.eclipse.org/egit/updates&lt;br /&gt;
Then choose to install &#039;&#039;&#039;EGit&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* With the GIT Command Line Client Interface:&lt;br /&gt;
You must before create an account on GitHub (https://github.com/) and upload a public RSA or DSA certificate into your account profile.&lt;br /&gt;
&lt;br /&gt;
Then, you need to install GIT client (GIT command line tool with Linux installed with &amp;quot;sudo apt-get install git&amp;quot;, or the GIT client for Windows found at https://git-scm.com/download/win).&lt;br /&gt;
&lt;br /&gt;
== Fork process ==&lt;br /&gt;
Login to Github, with login you created a previous step. Then go onto page&lt;br /&gt;
&lt;br /&gt;
https://github.com/Dolibarr/dolibarr&lt;br /&gt;
&lt;br /&gt;
And click on button &amp;quot;Fork&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This will create a copy (a fork) of project into your own github area. Because you will be the owner of this fork, you will have all read/write permissions on it used in next steps.&lt;br /&gt;
&lt;br /&gt;
== Clone process ==&lt;br /&gt;
Then process is same than getting sources with anonymous access.&lt;br /&gt;
&lt;br /&gt;
URL to use for GIT clone is same:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
git@github.com:YourGitHubLogin/dolibarr.git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that a HTTPS URL is also available but it&#039;s sometimes offline (so prefer using first one, link with HTTPS is required only if you are behind a firewall):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
https://yourgithublogin@github.com/Dolibarr/dolibarr.git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Update your repository=&lt;br /&gt;
To update your local workspace:&lt;br /&gt;
&lt;br /&gt;
* With Eclipse IDE:&lt;br /&gt;
right click on Eclipse project and select &amp;quot;Pull&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If you made some changes into your Eclipse workspace on files that were changed into the GIT remote reference, your GIT client will make a merge automatically.&lt;br /&gt;
* If there is conflicts, the merge will mark all conflict files as &amp;quot;conflict&amp;quot; (See later to solve this state).&lt;br /&gt;
* If not, you will get all new version files including all your changes.&lt;br /&gt;
&lt;br /&gt;
If you already have commited some files into your local repository, your workspace will be marked as &amp;quot;Merged&amp;quot;.&lt;br /&gt;
All you have to do is make a commit to validate your local repository as including your changes and changes made by others.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*With the GIT Command Line Client Interface:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git pull&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Commit and publish your changes =&lt;br /&gt;
To see all changes you made into your working directory and waiting to be added into Git:&lt;br /&gt;
* With GIT Command Line Interface:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git status&lt;br /&gt;
git diff subdir/filename&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To add changes made into your local repository into the GIT index, then commit this index :&lt;br /&gt;
* With Eclipse: Right click on file or directory to commit. Select file to add/remove/update into commit.&lt;br /&gt;
* With GIT Command Line Interface:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git commit -a -m &amp;quot;Commit text&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This will save add and changes into your local branch.&lt;br /&gt;
&lt;br /&gt;
To push them on the GIT repository server,&lt;br /&gt;
* With Eclipse: right click on project and choose &amp;quot;&#039;&#039;&#039;Team - Push to Upstream&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
* With GIT Command Line Interface:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git push&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To cancel a commit:&lt;br /&gt;
* With GIT Command Line Interface, if commit was not already pushed:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git reset --soft HEAD~1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* With GIT Command Line Interface, if commit was already pushed:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git revert IdCommit  or  git revert HEAD  (for last commit)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To merge changes done into your forked GIT instance into official Dolibarr instance:&lt;br /&gt;
* Go into GitHub web interface of your forked Git instance.&lt;br /&gt;
* Click on small button &amp;quot;Create a Pull request&amp;quot;.&lt;br /&gt;
* Choose commit you request inclusion and validate.&lt;br /&gt;
&lt;br /&gt;
= Ask official project to include your changes =&lt;br /&gt;
Once you pushed one or several commit toward your distant fork area on github, you can ask the Dolibarr core team to include it into official project.&lt;br /&gt;
For this, follow this tutorial: https://help.github.com/articles/creating-a-pull-request/&lt;br /&gt;
&lt;br /&gt;
= Add an external commit into current repository =&lt;br /&gt;
Some developers may work and do commit into their own Git repository after forking the project. If you are interesting into getting this changes, you can import them with the following steps.&lt;br /&gt;
&lt;br /&gt;
You need both Eclipse and GIT Command Line interface to achieve this:&lt;br /&gt;
* First, go into GIT setup view and right click on &amp;quot;&#039;&#039;&#039;Remotes&#039;&#039;&#039;&amp;quot; of your Eclipse Git working space and choose &amp;quot;&#039;&#039;&#039;Create a remote...&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
* Type name or remote fork the developer has create (in most cases, it&#039;s developer Git login). For example: &amp;quot;&#039;&#039;&#039;thedevlogin&#039;&#039;&#039;&amp;quot;. Choose also &amp;quot;&#039;&#039;&#039;Configure Fetch&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
* Type URI of Git repository of developer. For example: &#039;&#039;&#039;git://github.com/thedevlogin/dolibarr.git&#039;&#039;&#039;. Also add a refspec value to declare the branch you want to get. For example: &#039;&#039;&#039;refs/heads/master:refs/remotes/thedevlogin/master&#039;&#039;&#039;. Click &amp;quot;&#039;&#039;&#039;Save and Fetch&#039;&#039;&#039;&amp;quot;. A new entry will be added into &amp;quot;Remote Tracking&amp;quot; making possible to read/get commits done into this branch.&lt;br /&gt;
&lt;br /&gt;
Now, go on command line of your git repository (in most cases on Linux, it&#039;s &#039;&#039;&#039;/home/yourlogin/git/yourdolibarr&#039;&#039;&#039;) and type the git cherry-pick command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git cherry-pick -x commitid&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
where commitid is value of commit id you want to get.&lt;br /&gt;
&lt;br /&gt;
Once this is done, go back to Eclipse and make a refresh on project. You will see modified files appears with decorators (with conflicts if there is).&lt;br /&gt;
&lt;br /&gt;
It the cherry-pick fails because of conflicts, you can cancel the cherry-pick try with&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git cherry-pick --abort&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Solving a conflict=&lt;br /&gt;
If a file has been marked as &amp;quot;conflict&amp;quot; after a Pull, open the file to edit it.&lt;br /&gt;
Find string &amp;quot;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;quot;, you will see part of code that is conflict between &amp;quot;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;quot;. Edit manually code lines and remove &amp;quot;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Then, right click on file and select &amp;quot;Add&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If you prefer to forget completely all changes you made into all files (so to restore you workspace with content of remote repository), you can make a hard reset:&lt;br /&gt;
* With Eclipse: Right click on project top line and select &amp;quot;&#039;&#039;&#039;Reset&#039;&#039;&#039;&amp;quot; then &amp;quot;&#039;&#039;&#039;Hard&#039;&#039;&#039;&amp;quot; then &amp;quot;&#039;&#039;&#039;Reference - HEAD&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
* With GIT Command Line Interface: You can achieve this with command&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git reset --hard HEAD&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To reset changes you commited but not pushed to origin&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git reset --hard origin/develop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Tagging sources=&lt;br /&gt;
With GIT Command Line Interface:&lt;br /&gt;
&lt;br /&gt;
To add a tag to a current version:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git tag -a -m &amp;quot;Release|Maintenance release x.y.z&amp;quot; &amp;quot;x.y.z&amp;quot;&lt;br /&gt;
or&lt;br /&gt;
git tag -a -f -m &amp;quot;Beta x.y.betai&amp;quot; &amp;quot;x.y.betai_YYYYMMDD&amp;quot; idcommit   # -f force if an existing tag already exists, idcommit allows to choose commit to tag&lt;br /&gt;
&lt;br /&gt;
git push --tags   # To push tags to remote origin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To remove a tag:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git tag -d &amp;quot;x.y.z_YYYYMMDD&amp;quot;&lt;br /&gt;
git push remoteentryname :x.y.z_YYYYMMDD    # To validate delete on remote origin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Creating a new branch=&lt;br /&gt;
With GIT Command Line Interface:&lt;br /&gt;
&lt;br /&gt;
Create a clone (see previously) of the branch from where you want to create another branch, then go into directory and launch command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git branch x.y&lt;br /&gt;
git push origin x.y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With Eclipse:&lt;br /&gt;
&lt;br /&gt;
Create a clone (see previously) of the branch from where you want to create another branch, with a checkout done. The go into view git. Choose branches, remote tracking and select start branch.&lt;br /&gt;
Right click and choose &amp;quot;Create branch&amp;quot;. &lt;br /&gt;
Then make a push to create branch remotely.&lt;br /&gt;
Then go into &amp;quot;Remotes - origins&amp;quot; and edit the entries to pull and push onto new branch.&lt;br /&gt;
It may also be required to edit the .git/config file to have project linked by default onto new branch.&lt;br /&gt;
&lt;br /&gt;
= Deleting a branch=&lt;br /&gt;
With GIT Command Line Interface:&lt;br /&gt;
&lt;br /&gt;
Do a push on branch but add : before name of branch:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git push remoteentryname :branchnametodelete&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Merging a maintenance branch x.x into dev branch=&lt;br /&gt;
With Eclipse:&lt;br /&gt;
* Go onto the root directory of project with a checkout of the dev branch.&lt;br /&gt;
* Check fetch setup to be sure, this repository contains both information of dev branch and version x.x you want to merge.&lt;br /&gt;
* Right click onto root directory and choose &amp;quot;Team - Merge&amp;quot;. Select &amp;quot;x.x&amp;quot;. Click onto &amp;quot;Merge options - Commit&amp;quot;, because we want to commit merged branch if there is no conflicts.&lt;br /&gt;
* Once merge is done, check everything is ok.&lt;br /&gt;
* Commit and push.&lt;br /&gt;
&lt;br /&gt;
= Pushing a branch onto another Git server =&lt;br /&gt;
You may want to synchronize another GIT server.&lt;br /&gt;
To synchronize push to another server, this is how to proceed.&lt;br /&gt;
With Eclipse:&lt;br /&gt;
* Go onto Git clone view and add a remote with a name, choose &amp;quot;Configure push&amp;quot; and enter URL. For example, for name &amp;quot;sourceforge&amp;quot; and URL &amp;quot;ssh://yoursourceforgelogin@git.code.sf.net/p/dolibarr/code&amp;quot;&lt;br /&gt;
* Just validate, a first push will be done automatically.&lt;br /&gt;
* To force sync, run &lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git push sourceforge develop&lt;br /&gt;
git push --tags sourceforge develop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Statistics=&lt;br /&gt;
With GIT Command Line interface:&lt;br /&gt;
&lt;br /&gt;
To count number of changes developers have made between a version x and y:&lt;br /&gt;
* First, search commit id of tags you want to compare&lt;br /&gt;
To find id_start (common commit id between 2 versions/tags)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git merge-base refs/tags/3.3.0 origin/3.4&lt;br /&gt;
or&lt;br /&gt;
git merge-base 3.7 origin/develop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To find id_end, choose among&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git show-ref&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Choose a value for id_start and id_end&lt;br /&gt;
Note: id_end can be HEAD.&lt;br /&gt;
* Then run git log to have list of all changes from last common commit to last commit&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git log id_start..id_end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* To get total number of added/deleted lines:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git log --ancestry-path --numstat --pretty=&amp;quot;%H&amp;quot; id_start..id_end | awk &#039;NF==3 {plus+=$1; minus+=$2} END {printf(&amp;quot;+%d, -%d\n&amp;quot;, plus, minus)}&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To count number of changes finally between a version x and y (it differs from previous count because in previous count, a change can be done 2 times at two different moment to change differently. With second method, you count changes finally found if changes were ok at first try). &lt;br /&gt;
* Use same method than previously but instead of running git log, run git diff.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git diff -b -M --numstat --pretty=&amp;quot;%H&amp;quot; id_start..id_end | awk &#039;NF==3 {plus+=$1; minus+=$2} END {printf(&amp;quot;+%d, -%d\n&amp;quot;, plus, minus)}&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More information in GIT usage is available [http://wiki.eclipse.org/EGit/User_Guide here].&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=FAQ_Get,update_GIT_project_sources&amp;diff=35302</id>
		<title>FAQ Get,update GIT project sources</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=FAQ_Get,update_GIT_project_sources&amp;diff=35302"/>
		<updated>2016-04-11T05:48:05Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Get last version of sources using a GIT anonymous access */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:FAQ EN]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
This is informations on how you can get sources of Dolibarr project.&lt;br /&gt;
Several methods are described, but we recommandusing  the one based on GitHub.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Get last version of sources by tgz download=&lt;br /&gt;
This method can be used by non technical users.&lt;br /&gt;
It allows you to get sources of main development branch (called HEAD) by just downloading a file: This operation consist to get last version of Dolibarr files that are packaged each night into a tgz file. File is available with link:&lt;br /&gt;
&lt;br /&gt;
{{LinkLastSnapshot}}&lt;br /&gt;
&lt;br /&gt;
New files overwrite old ones.&lt;br /&gt;
The inconvenient of this method is that you must download and uncompress package each time you want to get updates. Developers should not use this method to get sources but the next one.&lt;br /&gt;
&lt;br /&gt;
=Get last version of sources using a GIT anonymous access=&lt;br /&gt;
You can use this method if you don&#039;t have any GIT access. With this method, you won&#039;t be able to submit any changes, so, if you are a developer, it is recommended to create a GitHub account and use the next method instead of this one.&lt;br /&gt;
&lt;br /&gt;
== Prerequisite ==&lt;br /&gt;
* With Eclipse IDE&lt;br /&gt;
First you must have a working install of Eclipse. &#039;&#039;&#039;EGit&#039;&#039;&#039; plugin must also have been installed.&lt;br /&gt;
For this, use the &#039;&#039;&#039;Find And Install process&#039;&#039;&#039; into Eclipse menu, add the GIT update URL: &lt;br /&gt;
 http://download.eclipse.org/egit/updates&lt;br /&gt;
Then choose to install &#039;&#039;&#039;EGit&#039;&#039;&#039; (No need to choose JGit)&lt;br /&gt;
&lt;br /&gt;
* With the GIT Command Line Client Interface&lt;br /&gt;
You need to install GIT client (GIT command line tool with Linux installed with &amp;quot;sudo apt-get install git&amp;quot;, or the GIT client for Windows found at https://git-scm.com/download/win).&lt;br /&gt;
&lt;br /&gt;
== Clone process ==&lt;br /&gt;
First, enter value of the repository with reference sources into your GIT client tool.&lt;br /&gt;
&lt;br /&gt;
* With Eclipse, go into perspective GIT, click onto button &amp;quot;Clone GIT repository&amp;quot;. Enter GIT URL of project to get.&lt;br /&gt;
GIT Url for Dolibarr official source is:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
git://github.com/Dolibarr/dolibarr.git (read only)&lt;br /&gt;
or if you created a fork of dolibarr github from github web interface&lt;br /&gt;
git@github.com:yourgitaccount/dolibarr.git (read and write access)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Your Eclipse GIT client will ask you to choose the branches you are interested in. Branches not selected now could be selected later by doing a &amp;quot;Fetch&amp;quot; from the &amp;quot;Remotes&amp;quot; view, but try to choose only the branch you need. This will save you time and problems later.&lt;br /&gt;
&lt;br /&gt;
Note: if you are behind a firewall, you must set Eclipse proxy credentials into Eclipse menu Windows - Preferences - General - Network connection and use the alternative URL:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
https://gitlogin:gitpassword@github.com/yourgitaccount/dolibarr.git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* With GIT on Command Line Interface:&lt;br /&gt;
First setup your git client:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git config --global user.name &amp;quot;Your Name&amp;quot;&lt;br /&gt;
git config --global user.email &amp;quot;user@domain.com&amp;quot;&lt;br /&gt;
git config --list&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Then clone repository locally:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git://github.com/Dolibarr/dolibarr.git (read only)&lt;br /&gt;
or if you created a fork of dolibarr github from github web interface&lt;br /&gt;
git@github.com:yourgitaccount/dolibarr.git (read and write access)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if you are behind a firewall, you must set your porxy information and use the alternative https URL:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git config --global http.proxy http://proxyuser:proxypass@proxyserver:proxyport&lt;br /&gt;
git clone https://gitlogin:gitpassword@github.com/yourgitaccount/dolibarr.git dolibarr&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this step is validated, your GIT client will download all files from remote GIT server. This may last several seconds or minutes.&lt;br /&gt;
&lt;br /&gt;
Once download is finished, you must choose which branch to us to work on.&lt;br /&gt;
&lt;br /&gt;
* With GIT on Command Line Interface;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git checkout develop&lt;br /&gt;
git checkout x.y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This will create local branch and make checkout automatically.&lt;br /&gt;
* With Eclipse, right click on &amp;quot;Branches - Remotes - The branch you want to duplicate locally&amp;quot;.&lt;br /&gt;
Choose &amp;quot;Create Branch&amp;quot; (and check the box &amp;quot;Checkout&amp;quot;). This will duplicate content of branch to work on it locally and will refresh your &amp;quot;Working Directory&amp;quot; to work on this branch.&lt;br /&gt;
&lt;br /&gt;
Create Eclipse project:&lt;br /&gt;
&lt;br /&gt;
If using Eclipse, once your branch is created locally, create a PHP project from assistant by choosing &amp;quot;&#039;&#039;&#039;Create from existing project&#039;&#039;&#039;&amp;quot; and select directory that is your GIT local repository (Do not choose to create a PHP project from scratch).&lt;br /&gt;
Then right click on project from your Eclipse workspace and Choose &amp;quot;&#039;&#039;&#039;Team - Share&#039;&#039;&#039;&amp;quot;. Select GIT and click on option &amp;quot;&#039;&#039;&#039;Use or create repository in parent folder of project&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
An alternate method is File-&amp;gt;Import, Git-&amp;gt;Project from Git, Select the Git repository and Next, Use New project Wizard -&amp;gt; Php project, enter the folder of you GIT local repository.&lt;br /&gt;
&lt;br /&gt;
Then, you can setup Eclipse to avoid it to scan all project files for its build tools (Outline scanner, TODO scanner, syntax scanner...). This will avoid Eclipse to be too slow. For this, right click on project, choose Build Path and setup it like into following screenshot.&lt;br /&gt;
&lt;br /&gt;
[[File:Eclipse php build path.png|240px]]&lt;br /&gt;
&lt;br /&gt;
=Get last version of sources using a GitHub user access=&lt;br /&gt;
== Prerequisite ==&lt;br /&gt;
&lt;br /&gt;
* With Eclipse IDE&lt;br /&gt;
You must before create an account on GitHub (https://github.com/) and upload a public RSA or DSA certificate into your account profile.&lt;br /&gt;
&lt;br /&gt;
Then, you must have a working install of Eclipse. &#039;&#039;&#039;EGit&#039;&#039;&#039; plugin must also have been installed.&lt;br /&gt;
For this, use the &#039;&#039;&#039;Find And Install process&#039;&#039;&#039; into Eclipse menu, add the GIT update URL: &lt;br /&gt;
 http://download.eclipse.org/egit/updates&lt;br /&gt;
Then choose to install &#039;&#039;&#039;EGit&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* With the GIT Command Line Client Interface:&lt;br /&gt;
You must before create an account on GitHub (https://github.com/) and upload a public RSA or DSA certificate into your account profile.&lt;br /&gt;
&lt;br /&gt;
Then, you need to install GIT client (GIT command line tool with Linux installed with &amp;quot;sudo apt-get install git&amp;quot;, or the GIT client for Windows found at https://git-scm.com/download/win).&lt;br /&gt;
&lt;br /&gt;
== Fork process ==&lt;br /&gt;
Login to Github, with login you created a previous step. Then go onto page&lt;br /&gt;
&lt;br /&gt;
https://github.com/Dolibarr/dolibarr&lt;br /&gt;
&lt;br /&gt;
And click on button &amp;quot;Fork&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This will create a copy (a fork) of project into your own area. Because you will be the owner of this fork, you will have all permissions on it to make next steps.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Clone process ==&lt;br /&gt;
Then process is same than getting sources with anonymous access.&lt;br /&gt;
&lt;br /&gt;
URL to use for GIT clone is same:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
git@github.com:YourGitHubLogin/dolibarr.git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that a HTTPS URL is also available but it&#039;s sometimes offline (so prefer using first one, link with HTTPS is required only if you are behind a firewall):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
https://yourgithublogin@github.com/Dolibarr/dolibarr.git&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Update your repository=&lt;br /&gt;
To update your local workspace:&lt;br /&gt;
&lt;br /&gt;
* With Eclipse IDE:&lt;br /&gt;
right click on Eclipse project and select &amp;quot;Pull&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If you made some changes into your Eclipse workspace on files that were changed into the GIT remote reference, your GIT client will make a merge automatically.&lt;br /&gt;
* If there is conflicts, the merge will mark all conflict files as &amp;quot;conflict&amp;quot; (See later to solve this state).&lt;br /&gt;
* If not, you will get all new version files including all your changes.&lt;br /&gt;
&lt;br /&gt;
If you already have commited some files into your local repository, your workspace will be marked as &amp;quot;Merged&amp;quot;.&lt;br /&gt;
All you have to do is make a commit to validate your local repository as including your changes and changes made by others.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*With the GIT Command Line Client Interface:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git pull&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Commit and publish your changes =&lt;br /&gt;
To see all changes you made into your working directory and waiting to be added into Git:&lt;br /&gt;
* With GIT Command Line Interface:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git status&lt;br /&gt;
git diff subdir/filename&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To add changes made into your local repository into the GIT index, then commit this index :&lt;br /&gt;
* With Eclipse: Right click on file or directory to commit. Select file to add/remove/update into commit.&lt;br /&gt;
* With GIT Command Line Interface:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git commit -a -m &amp;quot;Commit text&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This will save add and changes into your local branch.&lt;br /&gt;
&lt;br /&gt;
To push them on the GIT repository server,&lt;br /&gt;
* With Eclipse: right click on project and choose &amp;quot;&#039;&#039;&#039;Team - Push to Upstream&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
* With GIT Command Line Interface:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git push&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To cancel a commit:&lt;br /&gt;
* With GIT Command Line Interface, if commit was not already pushed:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git reset --soft HEAD~1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* With GIT Command Line Interface, if commit was already pushed:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git revert IdCommit  or  git revert HEAD  (for last commit)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To merge changes done into your forked GIT instance into official Dolibarr instance:&lt;br /&gt;
* Go into GitHub web interface of your forked Git instance.&lt;br /&gt;
* Click on small button &amp;quot;Create a Pull request&amp;quot;.&lt;br /&gt;
* Choose commit you request inclusion and validate.&lt;br /&gt;
&lt;br /&gt;
= Ask official project to include your changes =&lt;br /&gt;
Once you pushed one or several commit toward your distant fork area on github, you can ask the Dolibarr core team to include it into official project.&lt;br /&gt;
For this, follow this tutorial: https://help.github.com/articles/creating-a-pull-request/&lt;br /&gt;
&lt;br /&gt;
= Add an external commit into current repository =&lt;br /&gt;
Some developers may work and do commit into their own Git repository after forking the project. If you are interesting into getting this changes, you can import them with the following steps.&lt;br /&gt;
&lt;br /&gt;
You need both Eclipse and GIT Command Line interface to achieve this:&lt;br /&gt;
* First, go into GIT setup view and right click on &amp;quot;&#039;&#039;&#039;Remotes&#039;&#039;&#039;&amp;quot; of your Eclipse Git working space and choose &amp;quot;&#039;&#039;&#039;Create a remote...&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
* Type name or remote fork the developer has create (in most cases, it&#039;s developer Git login). For example: &amp;quot;&#039;&#039;&#039;thedevlogin&#039;&#039;&#039;&amp;quot;. Choose also &amp;quot;&#039;&#039;&#039;Configure Fetch&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
* Type URI of Git repository of developer. For example: &#039;&#039;&#039;git://github.com/thedevlogin/dolibarr.git&#039;&#039;&#039;. Also add a refspec value to declare the branch you want to get. For example: &#039;&#039;&#039;refs/heads/master:refs/remotes/thedevlogin/master&#039;&#039;&#039;. Click &amp;quot;&#039;&#039;&#039;Save and Fetch&#039;&#039;&#039;&amp;quot;. A new entry will be added into &amp;quot;Remote Tracking&amp;quot; making possible to read/get commits done into this branch.&lt;br /&gt;
&lt;br /&gt;
Now, go on command line of your git repository (in most cases on Linux, it&#039;s &#039;&#039;&#039;/home/yourlogin/git/yourdolibarr&#039;&#039;&#039;) and type the git cherry-pick command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git cherry-pick -x commitid&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
where commitid is value of commit id you want to get.&lt;br /&gt;
&lt;br /&gt;
Once this is done, go back to Eclipse and make a refresh on project. You will see modified files appears with decorators (with conflicts if there is).&lt;br /&gt;
&lt;br /&gt;
It the cherry-pick fails because of conflicts, you can cancel the cherry-pick try with&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git cherry-pick --abort&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Solving a conflict=&lt;br /&gt;
If a file has been marked as &amp;quot;conflict&amp;quot; after a Pull, open the file to edit it.&lt;br /&gt;
Find string &amp;quot;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;quot;, you will see part of code that is conflict between &amp;quot;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;quot;. Edit manually code lines and remove &amp;quot;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Then, right click on file and select &amp;quot;Add&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If you prefer to forget completely all changes you made into all files (so to restore you workspace with content of remote repository), you can make a hard reset:&lt;br /&gt;
* With Eclipse: Right click on project top line and select &amp;quot;&#039;&#039;&#039;Reset&#039;&#039;&#039;&amp;quot; then &amp;quot;&#039;&#039;&#039;Hard&#039;&#039;&#039;&amp;quot; then &amp;quot;&#039;&#039;&#039;Reference - HEAD&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
* With GIT Command Line Interface: You can achieve this with command&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git reset --hard HEAD&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To reset changes you commited but not pushed to origin&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git reset --hard origin/develop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Tagging sources=&lt;br /&gt;
With GIT Command Line Interface:&lt;br /&gt;
&lt;br /&gt;
To add a tag to a current version:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git tag -a -m &amp;quot;Release|Maintenance release x.y.z&amp;quot; &amp;quot;x.y.z&amp;quot;&lt;br /&gt;
or&lt;br /&gt;
git tag -a -f -m &amp;quot;Beta x.y.betai&amp;quot; &amp;quot;x.y.betai_YYYYMMDD&amp;quot; idcommit   # -f force if an existing tag already exists, idcommit allows to choose commit to tag&lt;br /&gt;
&lt;br /&gt;
git push --tags   # To push tags to remote origin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To remove a tag:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git tag -d &amp;quot;x.y.z_YYYYMMDD&amp;quot;&lt;br /&gt;
git push remoteentryname :x.y.z_YYYYMMDD    # To validate delete on remote origin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Creating a new branch=&lt;br /&gt;
With GIT Command Line Interface:&lt;br /&gt;
&lt;br /&gt;
Create a clone (see previously) of the branch from where you want to create another branch, then go into directory and launch command:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git branch x.y&lt;br /&gt;
git push origin x.y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With Eclipse:&lt;br /&gt;
&lt;br /&gt;
Create a clone (see previously) of the branch from where you want to create another branch, with a checkout done. The go into view git. Choose branches, remote tracking and select start branch.&lt;br /&gt;
Right click and choose &amp;quot;Create branch&amp;quot;. &lt;br /&gt;
Then make a push to create branch remotely.&lt;br /&gt;
Then go into &amp;quot;Remotes - origins&amp;quot; and edit the entries to pull and push onto new branch.&lt;br /&gt;
It may also be required to edit the .git/config file to have project linked by default onto new branch.&lt;br /&gt;
&lt;br /&gt;
= Deleting a branch=&lt;br /&gt;
With GIT Command Line Interface:&lt;br /&gt;
&lt;br /&gt;
Do a push on branch but add : before name of branch:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git push remoteentryname :branchnametodelete&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Merging a maintenance branch x.x into dev branch=&lt;br /&gt;
With Eclipse:&lt;br /&gt;
* Go onto the root directory of project with a checkout of the dev branch.&lt;br /&gt;
* Check fetch setup to be sure, this repository contains both information of dev branch and version x.x you want to merge.&lt;br /&gt;
* Right click onto root directory and choose &amp;quot;Team - Merge&amp;quot;. Select &amp;quot;x.x&amp;quot;. Click onto &amp;quot;Merge options - Commit&amp;quot;, because we want to commit merged branch if there is no conflicts.&lt;br /&gt;
* Once merge is done, check everything is ok.&lt;br /&gt;
* Commit and push.&lt;br /&gt;
&lt;br /&gt;
= Pushing a branch onto another Git server =&lt;br /&gt;
You may want to synchronize another GIT server.&lt;br /&gt;
To synchronize push to another server, this is how to proceed.&lt;br /&gt;
With Eclipse:&lt;br /&gt;
* Go onto Git clone view and add a remote with a name, choose &amp;quot;Configure push&amp;quot; and enter URL. For example, for name &amp;quot;sourceforge&amp;quot; and URL &amp;quot;ssh://yoursourceforgelogin@git.code.sf.net/p/dolibarr/code&amp;quot;&lt;br /&gt;
* Just validate, a first push will be done automatically.&lt;br /&gt;
* To force sync, run &lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git push sourceforge develop&lt;br /&gt;
git push --tags sourceforge develop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Statistics=&lt;br /&gt;
With GIT Command Line interface:&lt;br /&gt;
&lt;br /&gt;
To count number of changes developers have made between a version x and y:&lt;br /&gt;
* First, search commit id of tags you want to compare&lt;br /&gt;
To find id_start (common commit id between 2 versions/tags)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git merge-base refs/tags/3.3.0 origin/3.4&lt;br /&gt;
or&lt;br /&gt;
git merge-base 3.7 origin/develop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To find id_end, choose among&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git show-ref&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Choose a value for id_start and id_end&lt;br /&gt;
Note: id_end can be HEAD.&lt;br /&gt;
* Then run git log to have list of all changes from last common commit to last commit&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git log id_start..id_end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* To get total number of added/deleted lines:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git log --ancestry-path --numstat --pretty=&amp;quot;%H&amp;quot; id_start..id_end | awk &#039;NF==3 {plus+=$1; minus+=$2} END {printf(&amp;quot;+%d, -%d\n&amp;quot;, plus, minus)}&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To count number of changes finally between a version x and y (it differs from previous count because in previous count, a change can be done 2 times at two different moment to change differently. With second method, you count changes finally found if changes were ok at first try). &lt;br /&gt;
* Use same method than previously but instead of running git log, run git diff.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git diff -b -M --numstat --pretty=&amp;quot;%H&amp;quot; id_start..id_end | awk &#039;NF==3 {plus+=$1; minus+=$2} END {printf(&amp;quot;+%d, -%d\n&amp;quot;, plus, minus)}&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More information in GIT usage is available [http://wiki.eclipse.org/EGit/User_Guide here].&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Medical_Center&amp;diff=34867</id>
		<title>Module Medical Center</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Medical_Center&amp;diff=34867"/>
		<updated>2016-01-18T08:04:28Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Users */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:CabinetMed]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=Medical Center&lt;br /&gt;
|editor=NLTechno&lt;br /&gt;
|web=[http://www.nltechno.com www.nltechno.com]&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=medical}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=&lt;br /&gt;
|minversion=3.5.3&lt;br /&gt;
|note=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
Can turn your Dolibarr into a medical office manager (dictionaries of pathology, patient management, history, directory of referents doctors, following consultations, examinations/radios, generation of consultation documents, statistics of your consultations, monitoring money input, check receipts, etc ...). &lt;br /&gt;
&lt;br /&gt;
How to use module is described in the &#039;&#039;&#039;usage&#039;&#039;&#039; chapter.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
{{InstallModuleDoliStoreEn}}&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
{{ActivationModuleEn}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setup page specific to module:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Into setup page dedicated to module, you can also define:&lt;br /&gt;
* Feature related to rhumatology.&lt;br /&gt;
* Enable or not standard menu  Thirdparies of yo have to manage thirdparies that are not patient.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Other options:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Into menu &#039;Home - Setup - Other&#039;, you can also add constant &amp;quot;&#039;&#039;&#039;CABINETMED_DELAY_TO_LOCK_RECORD&#039;&#039;&#039;&amp;quot; to a number of day. This means all consultation recorded could not be modified 2 days Iafter they were recorded.&lt;br /&gt;
&lt;br /&gt;
By default, professional ID fields are not visible when you are on a patient card. You can however decide to make them visible by adding the constant &#039;&#039;&#039;CABINETMED_SHOW_PROFIDx&#039;&#039;&#039; to 1 (where x is a number between 1 and 6 to define which professional ID you want to see. Add several constants, if you need several professional ID).&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
Activating this module will add the following new top menu entries:&lt;br /&gt;
* Patients&lt;br /&gt;
* Contacts (the other doctors)&lt;br /&gt;
* Consultation summary (show entry/output for a year, month or day of revenus)&lt;br /&gt;
&lt;br /&gt;
== Users ==&lt;br /&gt;
Quand le module est activé, un utilisateur Dolibarr est en fait un membre du personnel soigant (médecin, infirmière, sage-femme, kiné, ou encore secrétaire...), et donc u nutilisateur faisant partie du cabinet amené à consulter ou saisir dans Dolibarr. Il peut n&#039;y avoir qu&#039;un seul utilisateur dans le cas d&#039;un médecin ou soignant exerçant seul. Un utilisateur peut aussi être une personne du secrétariat téléphonique du cabinet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
When the module is activated, a Dolibarr user is actually a member of caregivers staff (doctor, nurse, midwife, physiotherapist, or secretary ...), and thus a user belonging to the firm using the Dolibarr. There may be only one user in the case of a sole practitioner physician or caregiver. A user can also be a person answering service firm.&lt;br /&gt;
&lt;br /&gt;
== Care givers contacts ==&lt;br /&gt;
Correspondents are other caregivers or doctors attending or being occupied Patient. Select the menu &amp;quot;Correspondents&amp;quot; brings up a submenu with the left functions to create, or add a new correspondent.&lt;br /&gt;
* To create a contact, just click on the entry &amp;quot;New correspondent&amp;quot; and enter information on the blank page and select Save.&lt;br /&gt;
* When selected the menu entry &amp;quot;List all&amp;quot;, it means the list of all registered correspondents. If you click on the name of one of them, its card opens. And it is possible to change it.&lt;br /&gt;
* It is possible to recall a detail Corresponding quickly by typing part of its name in the quick search box on the left panel.&lt;br /&gt;
&lt;br /&gt;
== Patients ==&lt;br /&gt;
Select the top menu &amp;quot;&#039;&#039; &#039;&#039;&#039; Patients&amp;quot;, brings up an offering functions to create a new patient list patients or past consultations submenu. &lt;br /&gt;
&lt;br /&gt;
* To create a new patient, simply click on the &amp;quot;New Patient&amp;quot; entry and enter the information on the blank sheet and then Save. &lt;br /&gt;
* When you have selected the menu entry &amp;quot;Patient List&amp;quot; is the track list of all registered patients. If you click on the name of one of them, his record opens. And it is possible to change it. &lt;br /&gt;
* It is also possible to recall the record of a patient quickly by typing part of its name in the quick search box on the left banner.&lt;br /&gt;
&lt;br /&gt;
=== Fiches Patient and consultations (Patient records and consultations)===&lt;br /&gt;
To create a patient file, click on the menu &#039;&#039; &#039;&#039; Patient - New Patient &#039;&#039; &#039;&#039;. Once created, a Patient card contains several tabs:&lt;br /&gt;
* A tab with general information (which are those recorded during the creation)&lt;br /&gt;
* A Calendar tab (if the Calendar module has been enabled)&lt;br /&gt;
* A Categories tab (if the Category module has been enabled)&lt;br /&gt;
* A Correspondence tab&lt;br /&gt;
* A history tab / Treatments&lt;br /&gt;
* A Notes tab&lt;br /&gt;
* A consultation tab&lt;br /&gt;
* A Bio tab&lt;br /&gt;
* A exploration tab&lt;br /&gt;
* A Couriers tab / Files&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;divforimgcentpercent&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Dolimed screenshot patientcard.png|border]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a description of how to use each tab.&lt;br /&gt;
&lt;br /&gt;
==== Onglet des informations générales (Tab general information)====&lt;br /&gt;
&lt;br /&gt;
Most information on this tab are properties to qualify the patient.&lt;br /&gt;
&lt;br /&gt;
The field &amp;quot;Followed by&amp;quot; has however a specific usage. It is set by default on the user creating the patient. It is possible to assign one or more users (individual doctors cabinet following the patient for example). If the user has permission &amp;quot;Extend acess to all patient&amp;quot;, the the user will see all patients. If permission is not granted, then user will see only patient he is a follower of. This information can also be used for some statistics reports.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Correspondans (tab for correspondents) ====&lt;br /&gt;
Sur cet onglet, vous pouvez associer tous les médecins traitant ou connaissant le patient avec leur spécialité.&lt;br /&gt;
&lt;br /&gt;
(On this tab, you can associate all physicians treating the patient with or knowing their specialty.)&lt;br /&gt;
&lt;br /&gt;
==== Onglet Agenda (tab agenda)====&lt;br /&gt;
(This tab is only visible if the Calendar module has been activated.)&lt;br /&gt;
(It provides a calendar-type view of certain events that have been recorded on the patient (creation of the patient file, appointments, entering a consultation).)&lt;br /&gt;
&lt;br /&gt;
==== Onglet Catégories (Tab for categories)====&lt;br /&gt;
This tab is only visible if the [[Module Categories]] has been activated.&lt;br /&gt;
It classifies a patient in one or more categories. You decide which categories you create. Their creation is fair from the &amp;quot;Patient - Category - New Category&amp;quot; menu.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Antécédents/Traitements (Tab Background / Treatments) ====&lt;br /&gt;
To complete ...&lt;br /&gt;
&lt;br /&gt;
==== Tab Notes ====&lt;br /&gt;
To complete&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Tab consultations ====&lt;br /&gt;
Cet onglet permet l&#039;enregistrement d&#039;une consultation du patient.&lt;br /&gt;
On y retrouve l&#039;historique des consultations du patient.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;divforimgcentpercent&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Capture dolimed consultations1.png|border]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
En cliquant sur une fiche &#039;&#039;&#039;Consultation existante&#039;&#039;&#039; ou en cliquant sur le bouton &#039;&#039;&#039;Créer consultation&#039;&#039;&#039;, on ouvre la fiche de consultation.&lt;br /&gt;
Sur cette fiche consultation, on va saisir les symptomes remontés par le patient ou détectés, les actes réalisés ou traitements prescrits.&lt;br /&gt;
Le montant pris pour la consultation se renseigne également à la fin de la saisie de la fiche.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;divforimgcentpercent&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Capture dolimed consultations2.png|border]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Tab Bio ====&lt;br /&gt;
&lt;br /&gt;
Cet onglet permet l&#039;enregistrements des demandes d&#039;analyses biologiques du patient ainsi que les résultats.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Tab Explorations ====&lt;br /&gt;
Cet onglet permet l&#039;enregistrements des demandes d&#039;analyses radiologiques du patient ainsi que les résultats.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;divforimgcentpercent&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Capture dolimed explorations.png|border]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Onglet Documents (Tab Documents)====&lt;br /&gt;
* This page allows you to attach attachments (image scanners, ultrasound, papers words ...)&lt;br /&gt;
But it also can generate OpenOffice documents from a model. The model is supplied in courrier_consult.odt example.&lt;br /&gt;
* To generate a document, choose the model, possibly associated Bio page and click Generate.&lt;br /&gt;
The model will be used and all variables tags will be replaced with the patient&#039;s information or consultation.&lt;br /&gt;
* To make your own document model, see the [[Create a template ODT]].&lt;br /&gt;
The following tags are available in addition to the standard Dolibarr:&lt;br /&gt;
{{TagsOdtCabinetMed}}&lt;br /&gt;
&lt;br /&gt;
Example of generated document (click twice to enlarge)&lt;br /&gt;
&lt;br /&gt;
[[File:Capture dolimed document odt.png|border|300px]]&lt;br /&gt;
&lt;br /&gt;
== Menu Bilan consultations ==&lt;br /&gt;
Select Balance consultations brings up a table that displays the menu for the past 3 years, income per month with details.&lt;br /&gt;
Clicking on a month, this place details about each day of the month.&lt;br /&gt;
It is also possible from this screen to export the details in an Excel file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;divforimgcentpercent&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Dolimed screenshot report.png|border]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Développement =&lt;br /&gt;
Development of this module is not included inside the standard GIT repository of Dolibarr but inside a repository dedicated to modules not supported by the Dolibarr development team but supported by NLTechno on platform Git by Framasoft:&lt;br /&gt;
&lt;br /&gt;
* GIT Repository: git clone https://git.framasoft.org/eldy/dolimed.git&lt;br /&gt;
&lt;br /&gt;
Note this is a private repository, so you must apply to be a member from https://git.framasoft.org web site to be able to clone sources using GIT.&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Third_Parties&amp;diff=34694</id>
		<title>Module Third Parties</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Third_Parties&amp;diff=34694"/>
		<updated>2015-12-02T17:18:19Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Third parties]]&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
{{TemplateModEN}}&lt;br /&gt;
{{BasculeDevUser|&lt;br /&gt;
nom=Third Parties|&lt;br /&gt;
num=1|&lt;br /&gt;
devdoc=[[Module Third Parties (developer)]]|&lt;br /&gt;
userdoc=This page|}}&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
The &amp;quot;Third Parties&amp;quot; module allows you to manage entities like customers, prospects and / or suppliers (called Tiers). This module is a pre-requisite for many other modules that are based on these concepts (invoices, orders, contracts, proposals, etc. ...).&lt;br /&gt;
&lt;br /&gt;
A third party means any customer, prospect or supplier which, can be a corporation/business entity (For example: An LLC, a trade association etc.) or can be an individual person. A contact on the otherhand, is a representative person of a corporation (For example: CEO or any other person of an LLC, the principal dealer of Trade, president or treasurer of an association etc.) or is the person himself (in case of an individual person).&lt;br /&gt;
&lt;br /&gt;
Dolibarr operates the same way for the third and businesses. Also, for individuals, a &amp;quot;Contact &amp;quot; contains the same features/informations as the object &amp;quot;Company&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
{{NoInstallModuleEn}}&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
{{ActivationModuleEn}}&lt;br /&gt;
Description of setup of third party module is available on page [[Module Third Parties setup]].&lt;br /&gt;
&lt;br /&gt;
= Creating a new third party =&lt;br /&gt;
&lt;br /&gt;
Click the tab &#039;Third parties&#039; then under the menus &#039;Third party&#039; choose &#039;New third party&#039; or &#039;New prospect&#039; or &#039;New customer&#039; (&#039;&#039;&#039;Example Third parties-&amp;gt;Third party-&amp;gt;New customer&#039;&#039;&#039;). Input all information (fill only mandatory fields if you want).&lt;br /&gt;
&lt;br /&gt;
Once third party is created, you can add some Notes, and add linked files using corresponding tabs.&lt;br /&gt;
&lt;br /&gt;
= Modify a third party =&lt;br /&gt;
Go into menu third party, click on name of third party to modify.&lt;br /&gt;
&lt;br /&gt;
Click on button &amp;quot;Modify&amp;quot; (right bottom). Type all changes.&lt;br /&gt;
&lt;br /&gt;
Click on button &amp;quot;Save&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= Delete a third party =&lt;br /&gt;
Go on third party card and click on button &amp;quot;Delete&amp;quot;.&lt;br /&gt;
Only a third party that has no linked objects (invoices, contracts, orders, etc) can be deleted.&lt;br /&gt;
&lt;br /&gt;
= Create a contact =&lt;br /&gt;
There are several ways to create contacts/addresses&lt;br /&gt;
&lt;br /&gt;
* Go to menu Third Parties - Contacts/Addresses - New contact/address. Enter the requested information (you do not have to complete all fields). This will create a contact that can not be linked to third.&lt;br /&gt;
&lt;br /&gt;
* On third, go to the customer or supplier tab and click on &amp;quot;Create Contact &amp;quot;. Enter the requested information (you do not have to complete all fields). This will create a contact linked to third.&lt;br /&gt;
&lt;br /&gt;
= Edit Contact =&lt;br /&gt;
Go to menu Third Parties - Contacts/Addresses - List, click the contact to edit and select the tab sheet or personal info.&lt;br /&gt;
&lt;br /&gt;
Click &amp;quot;Modify&amp;quot; (bottom right).&lt;br /&gt;
&lt;br /&gt;
Enter the changes.&lt;br /&gt;
&lt;br /&gt;
Click &amp;quot;Save&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= Delete Contact =&lt;br /&gt;
Go to contact and click &#039;Delete&#039;&lt;br /&gt;
&lt;br /&gt;
= Life cycle / Business rules =&lt;br /&gt;
&lt;br /&gt;
A third party has only two state: Active Or Inactive.&lt;br /&gt;
A deleted third party does not change its state, but disappears completely from Dolibarr.&lt;br /&gt;
&lt;br /&gt;
You can create one or more physical contact or addresses for a Third party (these will be then used as contacts to send emails for [[Module Commercial Proposals|commercial proposals]], [[Module Customers Orders|customer orders]], [[Module Customers Invoices|customer invoices]], etc...).&lt;br /&gt;
&lt;br /&gt;
= Examples of use cases =&lt;br /&gt;
{{ExamplesCaseEn&lt;br /&gt;
|name=UCTP01: &lt;br /&gt;
|situation=I have a new customer, prospect, supplier.&lt;br /&gt;
|actions=Go to menu Third party -&amp;gt; New third party -&amp;gt; Input all data and click on Create.&lt;br /&gt;
}}&amp;amp;nbsp;&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Products&amp;diff=34693</id>
		<title>Module Products</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Products&amp;diff=34693"/>
		<updated>2015-12-02T17:14:29Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Virtual products (also called Pack products) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Produit]]&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
{{TemplateModEN}}&lt;br /&gt;
{{BasculeDevUserEn|&lt;br /&gt;
name=Products|&lt;br /&gt;
num=50|&lt;br /&gt;
devdoc=[[Module Products (developer)]]|&lt;br /&gt;
userdoc=This page|}}&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This module manage a catalog of products. &lt;br /&gt;
&lt;br /&gt;
See also [[Module Services En|Modules Services]] to manage a catalog of services or page [[Module Stocks En|Module Stocks]] to manage warehouses and stock.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
{{NoInstallModuleEn}}&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
{{ActivationModuleEn}}&lt;br /&gt;
&lt;br /&gt;
= Definition =&lt;br /&gt;
== Products ==&lt;br /&gt;
A &#039;&#039;product&#039;&#039; is a good to manage as it is an object you sell to customers or it is an object you buy from suppliers. It is a material good, contrarily to [[ServicesEn|Services]].&lt;br /&gt;
&lt;br /&gt;
A product follows this rules:&lt;br /&gt;
* A product can be stocked into a warehouse (only products appears in module [[Module_StockEn|Stock]]. Services are not visible).&lt;br /&gt;
* A product can be delivered (only products appears in module [[Module Shipment|Shipment]]. Services are not visible. Services are realized but can not be shipped).&lt;br /&gt;
* A product is a material good. It&#039;s value often decrease with time (Value of an already used product is lower than same never used product).&lt;br /&gt;
&lt;br /&gt;
== Virtual products (also called Pack products) ==&lt;br /&gt;
{{ToTranslate}}&lt;br /&gt;
Un produit ou service virtuel est un produit père, constitué d&#039;autres produits. Cette fonction s&#039;active depuis la page de configuration du module Produits ou Service.&lt;br /&gt;
Elle a pour vocation à définir des &amp;quot;packages&amp;quot; ou &amp;quot;lots&amp;quot; de produits qui permettent de raisonner sur les commandes, factures et stocks avec un seul élément au lieu des n produits&lt;br /&gt;
constituant le lot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Translation:&#039;&#039;&#039;&lt;br /&gt;
A product or service is a virtual father product consisting of other products. This function is activated from the Products module or service configuration page. It aims to define &amp;quot;packages&amp;quot; or &amp;quot;batches&amp;quot; of products that allow to reason about orders, invoices and inventory with a single element instead of the n products as Lot.&lt;br /&gt;
&lt;br /&gt;
Un produit virtuel répond aux règles suivantes:&lt;br /&gt;
* Lors de l&#039;ajout d&#039;un produit dans un document (propositions, facture, commande), seule la ligne du produit virtuel père est affichée.&lt;br /&gt;
* Le stock de produit composant le produit virtuel est incrémenté/décrémenté quand le produit virtuel est incrémenté/décrémenté.&lt;br /&gt;
* Un produit virtuel peut lui même être constitué d&#039;autres produits virtuels qui eux contiennent de vrais produits.&lt;br /&gt;
&#039;&#039;&#039;Translation:&#039;&#039;&#039;&lt;br /&gt;
A virtual product complies with the following rules:&lt;br /&gt;
* When adding a product in a document (proposals, invoice, order), only the line of virtual product father is shown.&lt;br /&gt;
* Product stock component virtual product is incremented / decremented when the virtual product is incremented / decremented.&lt;br /&gt;
* A virtual product may itself be composed of other virtual products that contain them real products.&lt;br /&gt;
&lt;br /&gt;
Remarque:&lt;br /&gt;
Il ne s&#039;agit pas d&#039;une fonction de &amp;quot;fabrication/production&amp;quot; où les produits fils composant le produit virtuel seraient consommés du stock pour obtenir un produit père supplémentaire en stock.&lt;br /&gt;
Ici, les sous-produits composants un produit virtuel ne sont décrémentés du stock qu&#039;au moment de la consommation du produit virtuel et restent des sous-produits consommables de manière indépendantes des autres, contrairement à un de module de fabrication, où lorsque qu&#039;un sous-produits est utilisé pour fabriquer un module père, le sous produits est décrémenté du stock même si le produit père n&#039;est pas encore distribué, et souvent ce sous-produits ne peut plus faire le chemin inverse pour revenir en stock.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Translation:&#039;&#039;&#039;&lt;br /&gt;
Note:&lt;br /&gt;
It is not a function of &amp;quot;manufacturing / production&amp;quot; where the virtual product component products are consumed son of stock father for an additional product in stock.&lt;br /&gt;
Here, the sub-components produced a virtual product are decremented stock at the time of consumption of the virtual product and remain independent manner consumables byproducts other, unlike a manufacturing module, wherein when that a by-product is used to manufacture a father module, the products under the same stock is decremented if the father product is not yet distributed, and often this byproducts can no longer do the reverse way back in stock.&lt;br /&gt;
&lt;br /&gt;
= Life cycle / Business rules =&lt;br /&gt;
{{ToComplete}}&lt;br /&gt;
&lt;br /&gt;
= Examples of use cases =&lt;br /&gt;
{{ToComplete}}&lt;br /&gt;
{{ExamplesCaseEn&lt;br /&gt;
|name=UCMP01: &lt;br /&gt;
|situation=&lt;br /&gt;
|actions=&lt;br /&gt;
}}&amp;amp;nbsp;&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Products&amp;diff=34692</id>
		<title>Module Products</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Products&amp;diff=34692"/>
		<updated>2015-12-02T17:14:07Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Virtual products (also called Pack products) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Produit]]&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
{{TemplateModEN}}&lt;br /&gt;
{{BasculeDevUserEn|&lt;br /&gt;
name=Products|&lt;br /&gt;
num=50|&lt;br /&gt;
devdoc=[[Module Products (developer)]]|&lt;br /&gt;
userdoc=This page|}}&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This module manage a catalog of products. &lt;br /&gt;
&lt;br /&gt;
See also [[Module Services En|Modules Services]] to manage a catalog of services or page [[Module Stocks En|Module Stocks]] to manage warehouses and stock.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
{{NoInstallModuleEn}}&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
{{ActivationModuleEn}}&lt;br /&gt;
&lt;br /&gt;
= Definition =&lt;br /&gt;
== Products ==&lt;br /&gt;
A &#039;&#039;product&#039;&#039; is a good to manage as it is an object you sell to customers or it is an object you buy from suppliers. It is a material good, contrarily to [[ServicesEn|Services]].&lt;br /&gt;
&lt;br /&gt;
A product follows this rules:&lt;br /&gt;
* A product can be stocked into a warehouse (only products appears in module [[Module_StockEn|Stock]]. Services are not visible).&lt;br /&gt;
* A product can be delivered (only products appears in module [[Module Shipment|Shipment]]. Services are not visible. Services are realized but can not be shipped).&lt;br /&gt;
* A product is a material good. It&#039;s value often decrease with time (Value of an already used product is lower than same never used product).&lt;br /&gt;
&lt;br /&gt;
== Virtual products (also called Pack products) ==&lt;br /&gt;
{{ToTranslate}}&lt;br /&gt;
Un produit ou service virtuel est un produit père, constitué d&#039;autres produits. Cette fonction s&#039;active depuis la page de configuration du module Produits ou Service.&lt;br /&gt;
Elle a pour vocation à définir des &amp;quot;packages&amp;quot; ou &amp;quot;lots&amp;quot; de produits qui permettent de raisonner sur les commandes, factures et stocks avec un seul élément au lieu des n produits&lt;br /&gt;
constituant le lot.&lt;br /&gt;
&#039;&#039;&#039;Translation:&#039;&#039;&#039;&lt;br /&gt;
A product or service is a virtual father product consisting of other products. This function is activated from the Products module or service configuration page. It aims to define &amp;quot;packages&amp;quot; or &amp;quot;batches&amp;quot; of products that allow to reason about orders, invoices and inventory with a single element instead of the n products as Lot.&lt;br /&gt;
&lt;br /&gt;
Un produit virtuel répond aux règles suivantes:&lt;br /&gt;
* Lors de l&#039;ajout d&#039;un produit dans un document (propositions, facture, commande), seule la ligne du produit virtuel père est affichée.&lt;br /&gt;
* Le stock de produit composant le produit virtuel est incrémenté/décrémenté quand le produit virtuel est incrémenté/décrémenté.&lt;br /&gt;
* Un produit virtuel peut lui même être constitué d&#039;autres produits virtuels qui eux contiennent de vrais produits.&lt;br /&gt;
&#039;&#039;&#039;Translation:&#039;&#039;&#039;&lt;br /&gt;
A virtual product complies with the following rules:&lt;br /&gt;
* When adding a product in a document (proposals, invoice, order), only the line of virtual product father is shown.&lt;br /&gt;
* Product stock component virtual product is incremented / decremented when the virtual product is incremented / decremented.&lt;br /&gt;
* A virtual product may itself be composed of other virtual products that contain them real products.&lt;br /&gt;
&lt;br /&gt;
Remarque:&lt;br /&gt;
Il ne s&#039;agit pas d&#039;une fonction de &amp;quot;fabrication/production&amp;quot; où les produits fils composant le produit virtuel seraient consommés du stock pour obtenir un produit père supplémentaire en stock.&lt;br /&gt;
Ici, les sous-produits composants un produit virtuel ne sont décrémentés du stock qu&#039;au moment de la consommation du produit virtuel et restent des sous-produits consommables de manière indépendantes des autres, contrairement à un de module de fabrication, où lorsque qu&#039;un sous-produits est utilisé pour fabriquer un module père, le sous produits est décrémenté du stock même si le produit père n&#039;est pas encore distribué, et souvent ce sous-produits ne peut plus faire le chemin inverse pour revenir en stock.&lt;br /&gt;
&#039;&#039;&#039;Translation:&#039;&#039;&#039;&lt;br /&gt;
Note:&lt;br /&gt;
It is not a function of &amp;quot;manufacturing / production&amp;quot; where the virtual product component products are consumed son of stock father for an additional product in stock.&lt;br /&gt;
Here, the sub-components produced a virtual product are decremented stock at the time of consumption of the virtual product and remain independent manner consumables byproducts other, unlike a manufacturing module, wherein when that a by-product is used to manufacture a father module, the products under the same stock is decremented if the father product is not yet distributed, and often this byproducts can no longer do the reverse way back in stock.&lt;br /&gt;
&lt;br /&gt;
= Life cycle / Business rules =&lt;br /&gt;
{{ToComplete}}&lt;br /&gt;
&lt;br /&gt;
= Examples of use cases =&lt;br /&gt;
{{ToComplete}}&lt;br /&gt;
{{ExamplesCaseEn&lt;br /&gt;
|name=UCMP01: &lt;br /&gt;
|situation=&lt;br /&gt;
|actions=&lt;br /&gt;
}}&amp;amp;nbsp;&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Products&amp;diff=34691</id>
		<title>Module Products</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Products&amp;diff=34691"/>
		<updated>2015-12-02T17:13:05Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Virtual products (also called Pack products) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Produit]]&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
{{TemplateModEN}}&lt;br /&gt;
{{BasculeDevUserEn|&lt;br /&gt;
name=Products|&lt;br /&gt;
num=50|&lt;br /&gt;
devdoc=[[Module Products (developer)]]|&lt;br /&gt;
userdoc=This page|}}&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This module manage a catalog of products. &lt;br /&gt;
&lt;br /&gt;
See also [[Module Services En|Modules Services]] to manage a catalog of services or page [[Module Stocks En|Module Stocks]] to manage warehouses and stock.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
{{NoInstallModuleEn}}&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
{{ActivationModuleEn}}&lt;br /&gt;
&lt;br /&gt;
= Definition =&lt;br /&gt;
== Products ==&lt;br /&gt;
A &#039;&#039;product&#039;&#039; is a good to manage as it is an object you sell to customers or it is an object you buy from suppliers. It is a material good, contrarily to [[ServicesEn|Services]].&lt;br /&gt;
&lt;br /&gt;
A product follows this rules:&lt;br /&gt;
* A product can be stocked into a warehouse (only products appears in module [[Module_StockEn|Stock]]. Services are not visible).&lt;br /&gt;
* A product can be delivered (only products appears in module [[Module Shipment|Shipment]]. Services are not visible. Services are realized but can not be shipped).&lt;br /&gt;
* A product is a material good. It&#039;s value often decrease with time (Value of an already used product is lower than same never used product).&lt;br /&gt;
&lt;br /&gt;
== Virtual products (also called Pack products) ==&lt;br /&gt;
{{ToTranslate}}&lt;br /&gt;
Un produit ou service virtuel est un produit père, constitué d&#039;autres produits. Cette fonction s&#039;active depuis la page de configuration du module Produits ou Service.&lt;br /&gt;
Elle a pour vocation à définir des &amp;quot;packages&amp;quot; ou &amp;quot;lots&amp;quot; de produits qui permettent de raisonner sur les commandes, factures et stocks avec un seul élément au lieu des n produits&lt;br /&gt;
constituant le lot.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
Translation:&#039;&#039;&#039;&lt;br /&gt;
A product or service is a virtual father product consisting of other products. This function is activated from the Products module or service configuration page. It aims to define &amp;quot;packages&amp;quot; or &amp;quot;batches&amp;quot; of products that allow to reason about orders, invoices and inventory with a single element instead of the n products as Lot.&lt;br /&gt;
&lt;br /&gt;
Un produit virtuel répond aux règles suivantes:&lt;br /&gt;
* Lors de l&#039;ajout d&#039;un produit dans un document (propositions, facture, commande), seule la ligne du produit virtuel père est affichée.&lt;br /&gt;
* Le stock de produit composant le produit virtuel est incrémenté/décrémenté quand le produit virtuel est incrémenté/décrémenté.&lt;br /&gt;
* Un produit virtuel peut lui même être constitué d&#039;autres produits virtuels qui eux contiennent de vrais produits.&lt;br /&gt;
&#039;&#039;&#039;Translation:&#039;&#039;&#039;&lt;br /&gt;
A virtual product complies with the following rules:&lt;br /&gt;
* When adding a product in a document (proposals, invoice, order), only the line of virtual product father is shown.&lt;br /&gt;
* Product stock component virtual product is incremented / decremented when the virtual product is incremented / decremented.&lt;br /&gt;
* A virtual product may itself be composed of other virtual products that contain them real products.&lt;br /&gt;
&lt;br /&gt;
Remarque:&lt;br /&gt;
Il ne s&#039;agit pas d&#039;une fonction de &amp;quot;fabrication/production&amp;quot; où les produits fils composant le produit virtuel seraient consommés du stock pour obtenir un produit père supplémentaire en stock.&lt;br /&gt;
Ici, les sous-produits composants un produit virtuel ne sont décrémentés du stock qu&#039;au moment de la consommation du produit virtuel et restent des sous-produits consommables de manière indépendantes des autres, contrairement à un de module de fabrication, où lorsque qu&#039;un sous-produits est utilisé pour fabriquer un module père, le sous produits est décrémenté du stock même si le produit père n&#039;est pas encore distribué, et souvent ce sous-produits ne peut plus faire le chemin inverse pour revenir en stock.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
Translation:&#039;&#039;&#039;&lt;br /&gt;
Note:&lt;br /&gt;
It is not a function of &amp;quot;manufacturing / production&amp;quot; where the virtual product component products are consumed son of stock father for an additional product in stock.&lt;br /&gt;
Here, the sub-components produced a virtual product are decremented stock at the time of consumption of the virtual product and remain independent manner consumables byproducts other, unlike a manufacturing module, wherein when that a by-product is used to manufacture a father module, the products under the same stock is decremented if the father product is not yet distributed, and often this byproducts can no longer do the reverse way back in stock.&lt;br /&gt;
&lt;br /&gt;
= Life cycle / Business rules =&lt;br /&gt;
{{ToComplete}}&lt;br /&gt;
&lt;br /&gt;
= Examples of use cases =&lt;br /&gt;
{{ToComplete}}&lt;br /&gt;
{{ExamplesCaseEn&lt;br /&gt;
|name=UCMP01: &lt;br /&gt;
|situation=&lt;br /&gt;
|actions=&lt;br /&gt;
}}&amp;amp;nbsp;&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Products&amp;diff=34690</id>
		<title>Module Products</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Products&amp;diff=34690"/>
		<updated>2015-12-02T16:52:01Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Virtual products (also called Pack products) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Produit]]&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
{{TemplateModEN}}&lt;br /&gt;
{{BasculeDevUserEn|&lt;br /&gt;
name=Products|&lt;br /&gt;
num=50|&lt;br /&gt;
devdoc=[[Module Products (developer)]]|&lt;br /&gt;
userdoc=This page|}}&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This module manage a catalog of products. &lt;br /&gt;
&lt;br /&gt;
See also [[Module Services En|Modules Services]] to manage a catalog of services or page [[Module Stocks En|Module Stocks]] to manage warehouses and stock.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
{{NoInstallModuleEn}}&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
{{ActivationModuleEn}}&lt;br /&gt;
&lt;br /&gt;
= Definition =&lt;br /&gt;
== Products ==&lt;br /&gt;
A &#039;&#039;product&#039;&#039; is a good to manage as it is an object you sell to customers or it is an object you buy from suppliers. It is a material good, contrarily to [[ServicesEn|Services]].&lt;br /&gt;
&lt;br /&gt;
A product follows this rules:&lt;br /&gt;
* A product can be stocked into a warehouse (only products appears in module [[Module_StockEn|Stock]]. Services are not visible).&lt;br /&gt;
* A product can be delivered (only products appears in module [[Module Shipment|Shipment]]. Services are not visible. Services are realized but can not be shipped).&lt;br /&gt;
* A product is a material good. It&#039;s value often decrease with time (Value of an already used product is lower than same never used product).&lt;br /&gt;
&lt;br /&gt;
== Virtual products (also called Pack products) ==&lt;br /&gt;
{{ToTranslate}}&lt;br /&gt;
Un produit ou service virtuel est un produit père, constitué d&#039;autres produits. Cette fonction s&#039;active depuis la page de configuration du module Produits ou Service.&lt;br /&gt;
Elle a pour vocation à définir des &amp;quot;packages&amp;quot; ou &amp;quot;lots&amp;quot; de produits qui permettent de raisonner sur les commandes, factures et stocks avec un seul élément au lieu des n produits&lt;br /&gt;
constituant le lot.&lt;br /&gt;
&lt;br /&gt;
Translation:&lt;br /&gt;
A product or service is a virtual father product consisting of other products. This function is activated from the Products module or service configuration page. It aims to define &amp;quot;packages&amp;quot; or &amp;quot;batches&amp;quot; of products that allow to reason about orders, invoices and inventory with a single element instead of the n products as Lot.&lt;br /&gt;
&lt;br /&gt;
Un produit virtuel répond aux règles suivantes:&lt;br /&gt;
* Lors de l&#039;ajout d&#039;un produit dans un document (propositions, facture, commande), seule la ligne du produit virtuel père est affichée.&lt;br /&gt;
* Le stock de produit composant le produit virtuel est incrémenté/décrémenté quand le produit virtuel est incrémenté/décrémenté.&lt;br /&gt;
* Un produit virtuel peut lui même être constitué d&#039;autres produits virtuels qui eux contiennent de vrais produits.&lt;br /&gt;
Translation:&lt;br /&gt;
A virtual product complies with the following rules:&lt;br /&gt;
* When adding a product in a document (proposals, invoice, order), only the line of virtual product father is shown.&lt;br /&gt;
* Product stock component virtual product is incremented / decremented when the virtual product is incremented / decremented.&lt;br /&gt;
* A virtual product may itself be composed of other virtual products that contain them real products.&lt;br /&gt;
&lt;br /&gt;
Remarque:&lt;br /&gt;
Il ne s&#039;agit pas d&#039;une fonction de &amp;quot;fabrication/production&amp;quot; où les produits fils composant le produit virtuel seraient consommés du stock pour obtenir un produit père supplémentaire en stock.&lt;br /&gt;
Ici, les sous-produits composants un produit virtuel ne sont décrémentés du stock qu&#039;au moment de la consommation du produit virtuel et restent des sous-produits consommables de manière indépendantes des autres, contrairement à un de module de fabrication, où lorsque qu&#039;un sous-produits est utilisé pour fabriquer un module père, le sous produits est décrémenté du stock même si le produit père n&#039;est pas encore distribué, et souvent ce sous-produits ne peut plus faire le chemin inverse pour revenir en stock.&lt;br /&gt;
&lt;br /&gt;
Translation:&lt;br /&gt;
Note:&lt;br /&gt;
It is not a function of &amp;quot;manufacturing / production&amp;quot; where the virtual product component products are consumed son of stock father for an additional product in stock.&lt;br /&gt;
Here, the sub-components produced a virtual product are decremented stock at the time of consumption of the virtual product and remain independent manner consumables byproducts other, unlike a manufacturing module, wherein when that a by-product is used to manufacture a father module, the products under the same stock is decremented if the father product is not yet distributed, and often this byproducts can no longer do the reverse way back in stock.&lt;br /&gt;
&lt;br /&gt;
= Life cycle / Business rules =&lt;br /&gt;
{{ToComplete}}&lt;br /&gt;
&lt;br /&gt;
= Examples of use cases =&lt;br /&gt;
{{ToComplete}}&lt;br /&gt;
{{ExamplesCaseEn&lt;br /&gt;
|name=UCMP01: &lt;br /&gt;
|situation=&lt;br /&gt;
|actions=&lt;br /&gt;
}}&amp;amp;nbsp;&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Products&amp;diff=34689</id>
		<title>Module Products</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Products&amp;diff=34689"/>
		<updated>2015-12-02T16:50:23Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Virtual products (also called Pack products) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Produit]]&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
{{TemplateModEN}}&lt;br /&gt;
{{BasculeDevUserEn|&lt;br /&gt;
name=Products|&lt;br /&gt;
num=50|&lt;br /&gt;
devdoc=[[Module Products (developer)]]|&lt;br /&gt;
userdoc=This page|}}&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
This module manage a catalog of products. &lt;br /&gt;
&lt;br /&gt;
See also [[Module Services En|Modules Services]] to manage a catalog of services or page [[Module Stocks En|Module Stocks]] to manage warehouses and stock.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
{{NoInstallModuleEn}}&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
{{ActivationModuleEn}}&lt;br /&gt;
&lt;br /&gt;
= Definition =&lt;br /&gt;
== Products ==&lt;br /&gt;
A &#039;&#039;product&#039;&#039; is a good to manage as it is an object you sell to customers or it is an object you buy from suppliers. It is a material good, contrarily to [[ServicesEn|Services]].&lt;br /&gt;
&lt;br /&gt;
A product follows this rules:&lt;br /&gt;
* A product can be stocked into a warehouse (only products appears in module [[Module_StockEn|Stock]]. Services are not visible).&lt;br /&gt;
* A product can be delivered (only products appears in module [[Module Shipment|Shipment]]. Services are not visible. Services are realized but can not be shipped).&lt;br /&gt;
* A product is a material good. It&#039;s value often decrease with time (Value of an already used product is lower than same never used product).&lt;br /&gt;
&lt;br /&gt;
== Virtual products (also called Pack products) ==&lt;br /&gt;
{{ToTranslate}}&lt;br /&gt;
Un produit ou service virtuel est un produit père, constitué d&#039;autres produits. Cette fonction s&#039;active depuis la page de configuration du module Produits ou Service.&lt;br /&gt;
Elle a pour vocation à définir des &amp;quot;packages&amp;quot; ou &amp;quot;lots&amp;quot; de produits qui permettent de raisonner sur les commandes, factures et stocks avec un seul élément au lieu des n produits&lt;br /&gt;
constituant le lot.&lt;br /&gt;
Translation:&lt;br /&gt;
A product or service is a virtual father product consisting of other products. This function is activated from the Products module or service configuration page. It aims to define &amp;quot;packages&amp;quot; or &amp;quot;batches&amp;quot; of products that allow to reason about orders, invoices and inventory with a single element instead of the n products as Lot.&lt;br /&gt;
&lt;br /&gt;
Un produit virtuel répond aux règles suivantes:&lt;br /&gt;
* Lors de l&#039;ajout d&#039;un produit dans un document (propositions, facture, commande), seule la ligne du produit virtuel père est affichée.&lt;br /&gt;
* Le stock de produit composant le produit virtuel est incrémenté/décrémenté quand le produit virtuel est incrémenté/décrémenté.&lt;br /&gt;
* Un produit virtuel peut lui même être constitué d&#039;autres produits virtuels qui eux contiennent de vrais produits.&lt;br /&gt;
Translation:&lt;br /&gt;
A virtual product complies with the following rules:&lt;br /&gt;
* When adding a product in a document (proposals, invoice, order), only the line of virtual product father is shown.&lt;br /&gt;
* Product stock component virtual product is incremented / decremented when the virtual product is incremented / decremented.&lt;br /&gt;
* A virtual product may itself be composed of other virtual products that contain them real products.&lt;br /&gt;
&lt;br /&gt;
Remarque:&lt;br /&gt;
Il ne s&#039;agit pas d&#039;une fonction de &amp;quot;fabrication/production&amp;quot; où les produits fils composant le produit virtuel seraient consommés du stock pour obtenir un produit père supplémentaire en stock.&lt;br /&gt;
Ici, les sous-produits composants un produit virtuel ne sont décrémentés du stock qu&#039;au moment de la consommation du produit virtuel et restent des sous-produits consommables de manière indépendantes des autres, contrairement à un de module de fabrication, où lorsque qu&#039;un sous-produits est utilisé pour fabriquer un module père, le sous produits est décrémenté du stock même si le produit père n&#039;est pas encore distribué, et souvent ce sous-produits ne peut plus faire le chemin inverse pour revenir en stock.&lt;br /&gt;
Translation:&lt;br /&gt;
Note:&lt;br /&gt;
It is not a function of &amp;quot;manufacturing / production&amp;quot; where the virtual product component products are consumed son of stock father for an additional product in stock.&lt;br /&gt;
Here, the sub-components produced a virtual product are decremented stock at the time of consumption of the virtual product and remain independent manner consumables byproducts other, unlike a manufacturing module, wherein when that a by-product is used to manufacture a father module, the products under the same stock is decremented if the father product is not yet distributed, and often this byproducts can no longer do the reverse way back in stock.&lt;br /&gt;
&lt;br /&gt;
= Life cycle / Business rules =&lt;br /&gt;
{{ToComplete}}&lt;br /&gt;
&lt;br /&gt;
= Examples of use cases =&lt;br /&gt;
{{ToComplete}}&lt;br /&gt;
{{ExamplesCaseEn&lt;br /&gt;
|name=UCMP01: &lt;br /&gt;
|situation=&lt;br /&gt;
|actions=&lt;br /&gt;
}}&amp;amp;nbsp;&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_development&amp;diff=34220</id>
		<title>Module development</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_development&amp;diff=34220"/>
		<updated>2015-08-10T06:45:39Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Add or removed your own tabs on object sheets */&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/rdoursenaud/dolibarr-module-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 or a document template).&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 tha 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.&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;? You must see a new line with your new module and the possibility to activate it or not (browse all the tabs of each category of modules to find it). The value of $this-&amp;gt;special determines in which tab will be your module.&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;
&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&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;
== 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 list of those files to include (DOL_DOCUMENT_ROOT is often dolibarr/htdocs/) :&lt;br /&gt;
* Object thirdparty (thirdparty) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/societe.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/lib/company.lib.php&lt;br /&gt;
* Object product (product) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/product.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/lib/product.lib.php&lt;br /&gt;
* Object invoice (invoice) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/facture.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/lib/invoice.lib.php&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;dev/skeletons&#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;skeletons_page.php&#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;
$res=0;&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;);			// to work if your module directory is into dolibarr root htdocs directory&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;);		// to work if your module directory is into a subdir of root htdocs directory&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;
require(&#039;../main.inc.php&#039;);&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>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_development&amp;diff=34219</id>
		<title>Module development</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_development&amp;diff=34219"/>
		<updated>2015-08-10T06:19:10Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Modify the descriptor file of your module */&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/rdoursenaud/dolibarr-module-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 or a document template).&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 tha 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.&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;? You must see a new line with your new module and the possibility to activate it or not (browse all the tabs of each category of modules to find it). The value of $this-&amp;gt;special determines in which tab will be your module.&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;
&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&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;
== The tab management (optional) ==&lt;br /&gt;
&lt;br /&gt;
=== Add or removed 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 should the tab appears 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. Lang which contains correspondence between the code translation and language to display. If this name is followed with @mymodule, Dolibarr will search translation file into the lang file of 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 list of those files to include (DOL_DOCUMENT_ROOT is often dolibarr/htdocs/) :&lt;br /&gt;
* Object thirdparty (thirdparty) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/societe.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/lib/company.lib.php&lt;br /&gt;
* Object product (product) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/product.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/lib/product.lib.php&lt;br /&gt;
* Object invoice (invoice) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/facture.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/lib/invoice.lib.php&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;dev/skeletons&#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;skeletons_page.php&#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;
$res=0;&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;);			// to work if your module directory is into dolibarr root htdocs directory&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;);		// to work if your module directory is into a subdir of root htdocs directory&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;
require(&#039;../main.inc.php&#039;);&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>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_development&amp;diff=34218</id>
		<title>Module development</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_development&amp;diff=34218"/>
		<updated>2015-08-10T06:18:00Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Modify the descriptor file of your module */&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/rdoursenaud/dolibarr-module-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 or a document template).&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 tha 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.&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;? You must see a new line with your new module and the possibility to activate it or not (browse all the tabs of each category of modules to find it). The value of $this-&amp;gt;special determines in which tab will be your module.&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;
&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&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;
== The tab management (optional) ==&lt;br /&gt;
&lt;br /&gt;
=== Add or removed 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 should the tab appears 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. Lang which contains correspondence between the code translation and language to display. If this name is followed with @mymodule, Dolibarr will search translation file into the lang file of 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 list of those files to include (DOL_DOCUMENT_ROOT is often dolibarr/htdocs/) :&lt;br /&gt;
* Object thirdparty (thirdparty) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/societe.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/lib/company.lib.php&lt;br /&gt;
* Object product (product) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/product.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/lib/product.lib.php&lt;br /&gt;
* Object invoice (invoice) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/facture.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/lib/invoice.lib.php&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;dev/skeletons&#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;skeletons_page.php&#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;
$res=0;&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;);			// to work if your module directory is into dolibarr root htdocs directory&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;);		// to work if your module directory is into a subdir of root htdocs directory&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;
require(&#039;../main.inc.php&#039;);&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>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_development&amp;diff=34217</id>
		<title>Module development</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_development&amp;diff=34217"/>
		<updated>2015-08-10T06:08:39Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Add your own setup page (optional) */&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/rdoursenaud/dolibarr-module-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 or a document template).&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 tha 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.&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;? You must see a new line with your new module and the possibility to activate it or not (browse all the tabs of each category of modules to find it). The value of $this-&amp;gt;special determines in which tab will be your module.&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;
&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&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;
== The tab management (optional) ==&lt;br /&gt;
&lt;br /&gt;
=== Add or removed 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 should the tab appears 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. Lang which contains correspondence between the code translation and language to display. If this name is followed with @mymodule, Dolibarr will search translation file into the lang file of 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 list of those files to include (DOL_DOCUMENT_ROOT is often dolibarr/htdocs/) :&lt;br /&gt;
* Object thirdparty (thirdparty) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/societe.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/lib/company.lib.php&lt;br /&gt;
* Object product (product) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/product.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/lib/product.lib.php&lt;br /&gt;
* Object invoice (invoice) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/facture.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/lib/invoice.lib.php&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;dev/skeletons&#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;skeletons_page.php&#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;
$res=0;&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;);			// to work if your module directory is into dolibarr root htdocs directory&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;);		// to work if your module directory is into a subdir of root htdocs directory&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 config_page_url to set name of this PHP page (without the path, which is not necesary if the page is inside directory 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;mymodule_setuppage.php&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;
require(&#039;../main.inc.php&#039;);&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>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_development&amp;diff=34216</id>
		<title>Module development</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_development&amp;diff=34216"/>
		<updated>2015-08-10T06:01:46Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Create your page to edit parameters */&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/rdoursenaud/dolibarr-module-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 or a document template).&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 tha 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.&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;? You must see a new line with your new module and the possibility to activate it or not (browse all the tabs of each category of modules to find it). The value of $this-&amp;gt;special determines in which tab will be your module.&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;
&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&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;
== The tab management (optional) ==&lt;br /&gt;
&lt;br /&gt;
=== Add or removed 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 should the tab appears 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. Lang which contains correspondence between the code translation and language to display. If this name is followed with @mymodule, Dolibarr will search translation file into the lang file of 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 list of those files to include (DOL_DOCUMENT_ROOT is often dolibarr/htdocs/) :&lt;br /&gt;
* Object thirdparty (thirdparty) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/societe.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/lib/company.lib.php&lt;br /&gt;
* Object product (product) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/product.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/lib/product.lib.php&lt;br /&gt;
* Object invoice (invoice) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/facture.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/lib/invoice.lib.php&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;dev/skeletons&#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;skeletons_page.php&#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;
$res=0;&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;);			// to work if your module directory is into dolibarr root htdocs directory&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;);		// to work if your module directory is into a subdir of root htdocs directory&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 need to ask user several parameters.&lt;br /&gt;
&lt;br /&gt;
=== Create your page to edit parameters ===&lt;br /&gt;
If your module need 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;
Then, within the descriptor file of your module, modify the variable config_page_url to set name of this PHP page (without the path, which is not necesary if the page is inside directory 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;mymodule_setuppage.php&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;
require(&#039;../main.inc.php&#039;);&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>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Language_and_development_rules&amp;diff=34210</id>
		<title>Language and development rules</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Language_and_development_rules&amp;diff=34210"/>
		<updated>2015-08-07T04:52:25Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Classes and properties structures */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TemplateDocDevEn}}&lt;br /&gt;
&lt;br /&gt;
This is some rules on language, syntax and norm we use into Dolibarr project:&lt;br /&gt;
&lt;br /&gt;
= Versions =&lt;br /&gt;
* Dolibarr must work on:&lt;br /&gt;
# All OS (Windows, Linux, MACOS...)&lt;br /&gt;
# PHP {{PHPMinVersion}} (Must work with no need of complementary PHP module, except module to PHP module to access database).&lt;br /&gt;
# Mysql {{MySqlMinVersion}}&lt;br /&gt;
&lt;br /&gt;
= Copyright Norms =&lt;br /&gt;
* All PHP files must start with a header that looks like &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/* Copyright (C) YYYY John Doe  &amp;lt;email@email.com&amp;gt;&lt;br /&gt;
 *&lt;br /&gt;
 * Licence information&lt;br /&gt;
 */&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
When you edit an existing file of project, you must add a Copyright line under others.&lt;br /&gt;
&lt;br /&gt;
= PHP Norms =&lt;br /&gt;
== PHP ==&lt;br /&gt;
* Dolibarr is written with PHP and supports all PHP version higher than {{PHPMinVersion}}. All files must end with extension .php&lt;br /&gt;
&lt;br /&gt;
* Usage of PHP superglobals variables must use dedicated operators $_COOKIES, $_SERVER, $_ENV but use Dolibarr function GETPOST() to get content of $_GET or $_POST..&lt;br /&gt;
Other operators ($HTTP_SERVER_GET, ...) are now deprecated inside PHP, so they must no more be used. Like that code will work also if option &#039;&#039;&#039;register_long_arrays&#039;&#039;&#039; is set to off.&lt;br /&gt;
Moreover, the code must work when PHP option &#039;&#039;&#039;register_globals&#039;&#039;&#039; is off (recommended by PHP). It must work the same way when the option &#039;&#039;&#039;register_globals&#039;&#039;&#039; is on (by default on a lot of installations).&lt;br /&gt;
&lt;br /&gt;
* Do not use &#039;&#039;&#039;PHP_SELF&#039;&#039;&#039;. Use instead $_SERVER[&amp;quot;PHP_SELF&amp;quot;]. Also, Dolibarr framework sanitizes content of $_SERVER[&amp;quot;PHP_SELF&amp;quot;] variable (into main.inc.php file, so before any business code).&lt;br /&gt;
&lt;br /&gt;
* When several variables must be initialized with same value, you must use several instructions (separated with ;)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$var1=1;$var2=1;$var3=1;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
instead of&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$var1=$var2=$var3=1;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
that is slower.&lt;br /&gt;
&lt;br /&gt;
* String must be rounded by simple or double quote and a variable within the string must be out side of the quote.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
print &#039;My text show my &#039;.$variable.&#039; !&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Comments must use the C syntax, ie a double slash for a comment on one line and a slash-star to open a bloc for several lines&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
/* Bloc of comment&lt;br /&gt;
 *&lt;br /&gt;
 * End of bloc&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
$monobjet = new MonObjet($db);&lt;br /&gt;
$result=$monobjet-&amp;gt;fetch($idobject);&lt;br /&gt;
&lt;br /&gt;
for ($i = 1 , $i &amp;lt; 2 ; $i++)&lt;br /&gt;
{&lt;br /&gt;
  // comment on one line&lt;br /&gt;
  print $i;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Functions must return a value equal or higher than 0 if successful and strictly lower than 0 if error.&lt;br /&gt;
&lt;br /&gt;
* No dead code (code never used) into Dolibarr core code (code used by external modules only must be included within the external modules).&lt;br /&gt;
&lt;br /&gt;
* Use &amp;quot;include_once&amp;quot; for anything with functions or class definitions in it (like *.class.php and *.lib.php files), use &amp;quot;include&amp;quot; for template-style php with files containing common part of HTML and PHP code (like *.inc.php and *.tpl.php files).&lt;br /&gt;
&lt;br /&gt;
* Coding style to use is the PSR-2 (https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md). There is however exceptions:&lt;br /&gt;
** Length of line: PSR-2 mention we can go up to 120 characters on same line, this is a soft limit. It is better to have long lines instead of long page with code content that is just data declaration and does not contain any logic. However, we introduced a hard limit of &#039;&#039;&#039;1000&#039;&#039;&#039; characters (having line larger that this will return errors on Continuous Integration tests). &lt;br /&gt;
** Tabs are allowed: The other exception is that we don&#039;t replace the tabs with spaces. Using tabs is more convenient for most editors/developers. Also using spaces breaks some auto-format features (like Eclipse autoformat feature on some Eclipse version).&lt;br /&gt;
** Note 1: The following rule are very important to follow:&lt;br /&gt;
*** Files must be saved with Unix format (LF) and not Windows (CR/LF). Unix format is compatible on all OS such as Unix like, Windows, Mac, but the Windows text file format may not work on some PHP under Unix.&lt;br /&gt;
*** Smart tags PHP are not used. PHP code section must start with &#039;&#039;&#039;&amp;lt;?php&#039;&#039;&#039;&lt;br /&gt;
** Note 2: You can use the file &#039;&#039;&#039;dev/codesniffer/ruleset.xml&#039;&#039;&#039; as rule file to control coding style with PHPCodeSniffer.&lt;br /&gt;
** Note 3: You may note that current code is not yet compliant with this rule. The reason is that we must &amp;quot;now&amp;quot; follow the PSR-2, but it wasn&#039;t in the past. So feel free to change coding style to match new rules if you find such cases.&lt;br /&gt;
&lt;br /&gt;
== Classes and properties structures ==&lt;br /&gt;
&lt;br /&gt;
Some properties of classes are found in different classes. To avoid having different names, we will use the following names:&lt;br /&gt;
* date_creation:                 date of creation&lt;br /&gt;
* user_creation:                 object User creating object&lt;br /&gt;
* fk_user_creation:              id of user creating object&lt;br /&gt;
* date_modification:             date of last modification&lt;br /&gt;
* user_modification:             object User performing the modification&lt;br /&gt;
* fk_user_modification:          id of user doing modification&lt;br /&gt;
* date_validation:               date validation&lt;br /&gt;
* user_validation:               object User&lt;br /&gt;
* fk_user_validation:            id of user making validation&lt;br /&gt;
&lt;br /&gt;
= SQL rules =&lt;br /&gt;
&lt;br /&gt;
== Table and fields structures ==&lt;br /&gt;
&lt;br /&gt;
* Structure of tables.&lt;br /&gt;
When you create a new table, it is recommended to use the same conventions as other Dolibarr tables. This means the following fields:&lt;br /&gt;
 - rowid integer for id&lt;br /&gt;
 - tms timestamp that will contain date of last modification (the database manages this field automatically, no need to manage it by the code, just create the field)&lt;br /&gt;
 - import_key that will contains the import code YYYYMMDDHHMMSS if you make mass import.&lt;br /&gt;
Eventualy&lt;br /&gt;
 - datec timestamp that is the creation date&lt;br /&gt;
 - fk_user_author integer that is the id of user making creation&lt;br /&gt;
 - fk_user_mod integer that is the id of user making change&lt;br /&gt;
 - fk_soc integer that is the ID of the Thirdparty&lt;br /&gt;
&lt;br /&gt;
Note field:&lt;br /&gt;
 - note_private text for private comment of the object&lt;br /&gt;
 - note_pubic text for public comment of the object&lt;br /&gt;
or &lt;br /&gt;
 - note text if there is no need to have private and public&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Type of fields:&lt;br /&gt;
Well, to be compatible with any accuracy required by any country on amounts, and with any database syntax, we will use the following type into database:&lt;br /&gt;
 - integer for an any of foreign key&lt;br /&gt;
 - double(24,8) for any amount&lt;br /&gt;
 - double(6,3) for any vat rate&lt;br /&gt;
 - real for a quantity&lt;br /&gt;
 - varchar for a string (also if length is 1, the type char is more and more deprecated)&lt;br /&gt;
 - timestamp for a field date+time that is automatically updated&lt;br /&gt;
 - datetime for a field date+time&lt;br /&gt;
 - date for a field date&lt;br /&gt;
&lt;br /&gt;
* All tables has a prefix to avoid name conflicts with other projects. In current version this prefix is fixed ans can&#039;t be modified. Its value is &amp;lt;tt&amp;gt;llx_&amp;lt;/tt&amp;gt;. In a future version this value should be modified during installation process.&lt;br /&gt;
&lt;br /&gt;
== Primary keys ==&lt;br /&gt;
The primary key of a table must be called &amp;lt;tt&amp;gt;rowid&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Some old tables does not use this rule and use a primary key called &amp;lt;tt&amp;gt;id&amp;lt;/tt&amp;gt; (ie [[Table llx_c_actioncomm]]), but the reason is history and this should not happens anymore.&lt;br /&gt;
&lt;br /&gt;
== Foreign keys ==&lt;br /&gt;
Name of a foreign key must start with the prefix &amp;lt;tt&amp;gt;fk_&amp;lt;/tt&amp;gt; followed by the table name (i.e. name of the referencing table) (this is required to avoid duplicate names in project that are not allowed even if in different tables by some DBMS like Postgresql) then the field name (i.e. name of the referencing field) (this is to allow to have several foreign keys in same table).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&#039;&#039;fk_facture_fourn_fk_soc&#039;&#039;  is a foreign key in the table llx_facture_fourn for the field fk_soc in this table (that references the rowid field in another table)&lt;br /&gt;
&lt;br /&gt;
Note: If you develop your own external module, it must have no foreign keys that point to Dolibarr standard tables. This will break standard dolibarr upgrades, repair, backup and restore tools and may also break standard features.&lt;br /&gt;
&lt;br /&gt;
== Alternative keys ==&lt;br /&gt;
Sometimes, we need another unique keys than primary key. We can add in this case an alternate unique key. When we need this, we can create an alternate unique key. Such an index is called by a name that start by prefix &amp;lt;tt&amp;gt;uk_&amp;lt;/tt&amp;gt; followed by an underscore, then the the table name (this is required to avoid duplicate names of unique keys that may create problems for some DBMS like Postgresql) and then another string to define the key (this is to allow to have several unique keys on same table).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&#039;&#039;uk_societe_code_client&#039;&#039; is a unique key on table llx_societe on field code_client.&lt;br /&gt;
&lt;br /&gt;
== Index performance ==&lt;br /&gt;
Some fields are often used as search or order criteria, or for joins. In such case, we need to set a performance index on field to increase performances. Such indexes are named with a prefix &amp;lt;tt&amp;gt;idx_&amp;lt;/tt&amp;gt; then the table name and then the field name.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&#039;&#039;idx_societe_user_creat&#039;&#039; is a performance index on table llx_societe for field user_creat&lt;br /&gt;
&lt;br /&gt;
== DDL file format ==&lt;br /&gt;
Files containing definition of the database structure (DDL files) must be &#039;&#039;&#039;2 per table&#039;&#039;&#039;:&lt;br /&gt;
* The first file defines the table and its fields. The file name contains the table name, e.g. like this: &amp;lt;tt&amp;gt;llx_&#039;&#039;mytable&#039;&#039;.sql&amp;lt;/tt&amp;gt;&lt;br /&gt;
A comment will be added for each field to explain its usage.&lt;br /&gt;
* The second file defines all foreign keys, performance indexes or other constraints and the file name will be like: &amp;lt;tt&amp;gt;llx_&#039;&#039;mytable&#039;&#039;.key.sql&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These files must be stored in the directory &#039;&#039;&#039;install/mysql/tables&#039;&#039;&#039; for all standard files or &#039;&#039;&#039;mymodule/tables&#039;&#039;&#039; for tables provided by an external module.&lt;br /&gt;
&lt;br /&gt;
Example: &#039;&#039;&#039;file for creating the table llx_mytable will be llx_mytable.sql&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
-- ===========================================================================&lt;br /&gt;
-- Copyright (C) 2013 Author &amp;lt;email@author.com&amp;gt;&lt;br /&gt;
-- &lt;br /&gt;
-- This program is free software; you can redistribute it and/or modify&lt;br /&gt;
-- it under the terms of the GNU General Public License as published by&lt;br /&gt;
-- the Free Software Foundation; either version 3 of the License, or&lt;br /&gt;
-- (at your option) any later version.&lt;br /&gt;
--&lt;br /&gt;
-- This program is distributed in the hope that it will be useful,&lt;br /&gt;
-- but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
-- GNU General Public License for more details.&lt;br /&gt;
--&lt;br /&gt;
-- You should have received a copy of the GNU General Public License&lt;br /&gt;
-- along with this program. If not, see &amp;lt;http://www.gnu.org/licenses/&amp;gt;.&lt;br /&gt;
-- ===========================================================================&lt;br /&gt;
&lt;br /&gt;
create table llx_mytable&lt;br /&gt;
(&lt;br /&gt;
  rowid       integer NOT NULL AUTO_INCREMENT PRIMARY KEY,&lt;br /&gt;
  ref	      varchar(30)       NOT NULL,		-- object reference number&lt;br /&gt;
  entity      integer DEFAULT 1 NOT NULL,	        -- multi company id&lt;br /&gt;
  ref_ext     varchar(255),-- reference into an external system (not used by dolibarr)&lt;br /&gt;
  field_one   integer,&lt;br /&gt;
  field_two   integer NOT NULL,&lt;br /&gt;
  fk_field    integer,&lt;br /&gt;
  field_date  datetime,&lt;br /&gt;
  datec       timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,,   -- creation datetime&lt;br /&gt;
  tms         timestamp,    -- update time stamp&lt;br /&gt;
  fk_user_author integer NOT NULL,                     -- Author, foreign key of llx_user&lt;br /&gt;
  fk_user_mod    integer NOT NULL,                      -- Last updater, foreign key of llx_user&lt;br /&gt;
  import_key	varchar(14)                -- Use by import process&lt;br /&gt;
)type=innodb;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example: &#039;&#039;&#039;file for creating keys/indexes for the table llx_mytable will be llx_mytable.key.sql&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
-- ===========================================================================&lt;br /&gt;
-- Copyright (C) 2013 Author &amp;lt;email@author.com&amp;gt;&lt;br /&gt;
-- &lt;br /&gt;
-- This program is free software; you can redistribute it and/or modify&lt;br /&gt;
-- it under the terms of the GNU General Public License as published by&lt;br /&gt;
-- the Free Software Foundation; either version 3 of the License, or&lt;br /&gt;
-- (at your option) any later version.&lt;br /&gt;
--&lt;br /&gt;
-- This program is distributed in the hope that it will be useful,&lt;br /&gt;
-- but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
-- GNU General Public License for more details.&lt;br /&gt;
--&lt;br /&gt;
-- You should have received a copy of the GNU General Public License&lt;br /&gt;
-- along with this program. If not, see &amp;lt;http://www.gnu.org/licenses/&amp;gt;.&lt;br /&gt;
-- ===========================================================================&lt;br /&gt;
&lt;br /&gt;
ALTER TABLE llx_mytable ADD UNIQUE uk_mytable_field (field_one, field_two);&lt;br /&gt;
&lt;br /&gt;
ALTER TABLE llx_mytable ADD CONSTRAINT fk_mytable_fk_field FOREIGN KEY (fk_field) REFERENCES llx_matablepere (rowid);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SQL Coding rules ==&lt;br /&gt;
* Alias usage/Fields naming&lt;br /&gt;
When doing select, we can use alias to simplify writing/reading of requests:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
select chp1, chpxxx2 as chp2 from table2 as t1, table2 as t2 where t1.chpx = t2.chpy&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
However, we must not used alias for update request as they are not compatible with Mysql 3.1.&lt;br /&gt;
&lt;br /&gt;
* Using SELECT * is forbidden ! When using SELECT you must define complete list of fields to get. This avoids confusion. Example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
SELECT field_a, field_b, field_c FROM table_1 WHERE field_d = &#039;$id&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Into SQL requests, you must quote fields except the fields that contain amounts which must be stored as double or real type. Quotes on numbers may result in saving as a different value. For example 412.62 in an insert will be saved as value 412.61999512 into database (due to implicit conversion string to numeric) if the target field has type double(24,8). Only PHP see value 412.61999512. Other tools will see 412.62 giving a sense that there is no problem. But it&#039;s PHP that has the good vision. There is really a wrong value into database. By removing quotes on numbers, no problem occurs.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
Good:     INSERT INTO table_1 (field_txt, field_num) VALUES (&#039;txt&#039;, 412.62)&lt;br /&gt;
Bad:      INSERT INTO table_1 (field_txt, field_num) VALUES (&#039;txt&#039;, &#039;412.62&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note, problem of float numbers is same problem on all langauges and not only when inserting data into database. It occurs also with any language when you work on &amp;quot;real&amp;quot; numbers, so numbers must be, as soon as they are affected, cleaned with function price2num with second parameter defined to :&lt;br /&gt;
&#039;MU&#039; (for unit prices), &#039;MT&#039; (for total prices) or &#039;MS&#039; (otherwise) depending on usage of number. (see function documentation)&lt;br /&gt;
&lt;br /&gt;
* Functions NOW, SYSDATE or DATEDIFF are forbidden inside SQL requests. If you must use the current date into a field, value must come from the PHP and not from the database engine. This is for better portability of code and correct management of TimeZone.&lt;br /&gt;
&lt;br /&gt;
For example, don&#039;t do:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$sql=&amp;quot;SELECT rowid FROM table where datefield = NOW()&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
but do:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$sql=&amp;quot;SELECT rowid FROM table where datefield = &#039;&amp;quot;.$this-&amp;gt;db-&amp;gt;idate(dol_now()).&amp;quot;&#039;&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, don&#039;t do:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$sql=&amp;quot;SELECT rowid FROM table where DATEDIFF(table.datefield, NOW()) &amp;gt; 7&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
but do:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$sql=&amp;quot;SELECT rowid FROM table where datefield &amp;lt; &#039;&amp;quot;.$this-&amp;gt;db-&amp;gt;idate(dol_now() - (7 * 24 * 3600)).&amp;quot;&#039;&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An other advantage of this rule, is that request benefits of index because we are making a compare of a field with a fixed value. When using datediff, you make an operation on field before comparison, this means database can&#039;t use the index on field, resulting on very bad performance compared to solution without the datediff.&lt;br /&gt;
&lt;br /&gt;
== Mysql specificities ==&lt;br /&gt;
* Tables must be declared with format InnoDB.&lt;br /&gt;
This format supports foreign keys and their restrictions, and transactions integrity is also supported. This guarantees that Dolibarr events keep all data with correct values between tables even when transaction modify different tables.&lt;br /&gt;
&lt;br /&gt;
* Dolibarr must work even if Mysql option &#039;&#039;&#039;strict&#039;&#039;&#039; is active.&lt;br /&gt;
To activate it (recommended when developing on Dolibarr), add the following line into the config file of your Mysql server (my.cnf or my.ini)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
sql-mode=&amp;quot;STRICT_ALL_TABLES,ONLY_FULL_GROUP_BY,NO_ZERO_DATE&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== PostgreSQL specificities ==&lt;br /&gt;
Only Mysql SQL files must be maintained.&lt;br /&gt;
Those files are converted &amp;quot;on the fly&amp;quot; by the database Dolibarr driver.&lt;br /&gt;
&lt;br /&gt;
There is an exception&lt;br /&gt;
The SQL &amp;quot;UPDATE FROM&amp;quot;: &lt;br /&gt;
&lt;br /&gt;
MySQL Syntax:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
UPDATE table_taget as target, table_source as source SET fieldtarget=source.fieldsource&lt;br /&gt;
WHERE source.rowid=target.rowid;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PgSQL Syntax:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;&lt;br /&gt;
UPDATE table_taget as target SET fieldtarget=source.fieldsource&lt;br /&gt;
FROM table_source as source WHERE source.rowid=target.rowid;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no native SQL request &amp;quot;update from&amp;quot; in dolibarr core. But in your module you should do :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
if ($this-&amp;gt;db-&amp;gt;type==&#039;pgsql&#039;) {&lt;br /&gt;
$sql=&amp;quot;UPDATE table_taget as target SET fieldtarget=source.fieldsource&lt;br /&gt;
FROM table_source as source WHERE source.rowid=target.rowid&amp;quot;;&lt;br /&gt;
} else {&lt;br /&gt;
$sql= &amp;quot;UPDATE table_taget as target, table_source as source SET fieldtarget=source.fieldsource&lt;br /&gt;
WHERE source.rowid=target.rowid&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= HTML norms =&lt;br /&gt;
== Syntax rules ==&lt;br /&gt;
* HTML used must be HTML compliant and not XHTML. All attributes of HTML tags must be in lower case and quoted with &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* Links href must be absolute and use the function dol_buildpath() to get absolute path from a relative path and img tag must be build using function img_picto().&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
print &#039;&amp;lt;a href=&amp;quot;&#039;.dol_buildpath(&#039;/mydir/mypage.php&#039;).&#039;&amp;quot;&amp;gt;&#039;.img_picto(&#039;Texte alt&#039;,&#039;namepictopng&#039;,&#039;&#039;).&#039;&amp;lt;/a&amp;gt;&#039;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* HTML tables must have columns with no forced width, except for columns that contains data we know the length. For example, a column with a picto only can be forced to with=&amp;quot;20px&amp;quot;.&lt;br /&gt;
Otherwise, we must avoid forcing the column width. Reason is that, in most cases, the browser make a better works to define column width automatically than forced values, and it works whatever is the resolution.&lt;br /&gt;
&lt;br /&gt;
* Javascript/ajax code and call to javascript files into php pages must be avoided. However, if you need to include javascript code, you must add a condition on &amp;quot;$conf-&amp;gt;use_javascript_ajax&amp;quot;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
if ($conf-&amp;gt;use_javascript_ajax) {&lt;br /&gt;
...  // php code generating javascript here&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Popup windows must not be used, except for tooltips (and must have a condition as explained before).&lt;br /&gt;
&lt;br /&gt;
* External scripts must be written in Perl if they can&#039;t be written in PHP. Usage of another language is not forbidden but must be argued before in the development mailing-list.&lt;br /&gt;
&lt;br /&gt;
== External templating framework ? ==&lt;br /&gt;
There is ton of frameworks to provide a templating language of an HTML page. The best and faster is just called &amp;quot;PHP&amp;quot;, and because Dolibarr already depends on PHP, there is no need for depend on a third languages.&lt;br /&gt;
&lt;br /&gt;
All templating frameworks are just preprocessor, BEFORE PHP. It can&#039;t be faster than PHP alone. When we say &amp;quot;speed, when using cache of templating framework, is increase&amp;quot;, it is in fact the overtime spent by the framework that is reduced by cache, not the speed of processing PHP file. We should says &amp;quot;any templating framework has an overload over PHP, the cache of framework, just reduce the slowing effect of using it&amp;quot;, but not &amp;quot;the speed is increased, it is always increased&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Above all, having a templating system is completely possible by doing a &amp;quot;&#039;&#039;&#039;.tpl.php&#039;&#039;&#039;&amp;quot; file that dos not contains any logic code, but only HTML and echo. We get same result (but faster and easier to develop because it does not need to do all the setXXX) before calling each template. All variables (known by code that include the template) are automaticaly known into a PHP template page. No risk to forget a set, and a lot of line of codes reduced, a lot of time saved.&lt;br /&gt;
&lt;br /&gt;
Also, keeping a 100% isolation between code and HTML output is interesting in only 1 situation: When teams building design is complety different than team building logic code, AND if you build not too sophisticated pages, AND with no need of too many Ajax features (this need to know how code works).&lt;br /&gt;
And this situation is surely not the Dolibarr future (team will often be same, Ajax will be more and more present, event if I hope not too much, and screens are more and more dependent of dynamic or contextual events, difficult to have with a template without transforming the template into a page with high level of code).&lt;br /&gt;
&lt;br /&gt;
There is a ton of other reasons to not use an external templating system and all arguments to use them are the best argument to use PHP as our templating system.&lt;br /&gt;
&lt;br /&gt;
= Dolibarr norms and code skeleton =&lt;br /&gt;
&lt;br /&gt;
== Skeleton code ==&lt;br /&gt;
To standardize the code, and to speed up the development of new components in Dolibarr, you&#039;ll find 4 skeletons fully prepared in the directory &#039;&#039;&#039;dev/skeletons&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* 1 that serves as an example of the module description: &#039;&#039;&#039;myModule.class.php&#039;&#039;&#039;&lt;br /&gt;
* 1 that serves as an example of code for creating a new class: &#039;&#039;&#039;skeleton_class.class.php&#039;&#039;&#039;&lt;br /&gt;
* 1 that serves as an example of code for creating a new page: &#039;&#039;&#039;skeleton_page.php&#039;&#039;&#039;&lt;br /&gt;
* 1 that serves as an example of code for creating a script for executing command lines: &#039;&#039;&#039;skeleton_script.php&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use it as an example.&lt;br /&gt;
Note that the skeletons are also used by the PHP code generator, which is described in the development chapter of Dolibarr modules, to speed up your development.&lt;br /&gt;
&lt;br /&gt;
== Dates and Timezones ==&lt;br /&gt;
Dolibarr is an application that is multi-user and multi-location. It&#039;s therefore necessary to store dates in the right format. To avoid problems with conversions, the following rules should be applied:&lt;br /&gt;
&lt;br /&gt;
* A date into memory must always be stored with Timestamp GMT format.&lt;br /&gt;
* A date stored into database, is the GMT Timestamp of date submitted into the request usng the &amp;lt;b&amp;gt;PHP server&amp;lt;/b&amp;gt; timezone. This does not apply to date update automatically by database (fields &#039;&#039;&#039;tms&#039;&#039;&#039; into database).&lt;br /&gt;
For exemple le 1st january 1970, 3 hour at Paris (TZ=+1) = 2 hour at Greenwitch (TZ=0) will be stored into memory with value 7200 and will be submitted into a SQL request to database with the string &#039;19700101030000&#039; (PHP convert into its TZ hour and databse will unconvert it using its timezone too that is same than PHP).&lt;br /&gt;
&lt;br /&gt;
All select methods should translate date fields, that are with format TZ of database (&#039;19700101030000&#039;), into a timestamp field by calling the method db-&amp;gt;jdate. This is to store into memory a GTM Timestamp date. All insert methods must convert, during generation of SQL request, the memory date into the string by using db-&amp;gt;idate (you may find examples into skeleton).&lt;br /&gt;
&lt;br /&gt;
* Dates that are updated automatically (field &#039;&#039;&#039;tms&#039;&#039;&#039; into database) contains a GMT Timestamp GMT of date when change is done. The select will also use the db-&amp;gt;jdate (that use PHP server TZ) to convert read data into a GMT Timestamp into memory. So if timezone of database differs from timezone of PHP server (one of them is not correctly set), you may experience differences between creation date and update date.&lt;br /&gt;
&lt;br /&gt;
* Manipulation date with PHP must be done using the Dolibarr date functions: &#039;&#039;&#039;dol_now(), dol_mktime(), dol_stringtotime(), dol_getdate(), dol_time_plus_duree()&#039;&#039;&#039;. You may also find other functions available into file &#039;&#039;&#039;date.lib.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== UTF8/ISO encoding ==&lt;br /&gt;
Dolibarr stores data in the following way:&lt;br /&gt;
* In database, data is stored in UTF8 or ISO. It depends on the database&#039;s pagecode therefore these options are set at creation time. In any case, Dolibarr&#039;s database driver (in lib/database) deals with it to convert from/to UTF8 at insertion and readout.&lt;br /&gt;
* Memory data is stored in UTF8 (PHP object instances).&lt;br /&gt;
* Screen displayed web pages are UTF8 (for versions prior to 2.5.1, the deprecated $character_set parameter from conf.php file defines output format).&lt;br /&gt;
&lt;br /&gt;
== Float numbers, amount and calculation ==&lt;br /&gt;
With PHP, like other languages (Java for exemple), non integer data (float, real, double) are not reliable for calculation.&lt;br /&gt;
Try to make for example &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
print 239.2 - 229.3 - 9.9;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
You wont get zero but a very small decimal number. If you get zero her, you should be able to find other examples that don&#039;t work.&lt;br /&gt;
Problem of float is general, so a variable that is a result of a calculation using decimal numbers must ALWAYS be cleaned using the function &#039;&#039;&#039;price2num()&#039;&#039;&#039; with the econd parameter to: &#039;MU&#039;, &#039;MT&#039; or &#039;MS&#039; depending on need (see description of function).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
print price2num(239.2 - 229.3 - 9.9, &#039;MT&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If data manipulated is not an amount, then using MU, MT, MS has no sense, and you must use the function &#039;&#039;&#039;round()&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Creation of tables ==&lt;br /&gt;
Do not create tables, on the fly, during execution by a standard user, we mean, during current usage of software.&lt;br /&gt;
If you create a module that uses its own table, not available in the default Dolibarr code, then take a look at tutorial [[Module Development]]. It explains how to provide new tables with your module, so that, the tables will be created during module activation and not during module usage.&lt;br /&gt;
&lt;br /&gt;
== Logs ==&lt;br /&gt;
Add logs to your code using function&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
dol_syslog($yourmessage, LOG_INFO|LOG_DEBUG|LOG_WARNING|LOG_ERR);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Working directory ==&lt;br /&gt;
If you need to create a working directory, into your code, refer to it with &lt;br /&gt;
&#039;&#039;&#039;DOL_DATA_ROOT.&#039;/mymodule&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The directory can be created into your code by the following function:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$mymoduledir=DOL_DATA_ROOT.&#039;/mymodule&#039;;&lt;br /&gt;
dol_mkdir($mymoduledir);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you need a directory to store temporary data, this directory must be &#039;&#039;&#039;DOL_DATA_ROOT.&#039;/mymodule/temp&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Design patterns and Object programming =&lt;br /&gt;
&lt;br /&gt;
== Creation design patterns (GoF) ==&lt;br /&gt;
Design patterns defined by the Gang Of Four (see wikipédia on [[wikipedia:Design pattern|Design patters]]).&lt;br /&gt;
No usage of such patterns is required. We found some objects next to Singletons or Factory but not completely compliant with syntax, this is to be compatible with PHP 4 that is not a pure object language. &lt;br /&gt;
&lt;br /&gt;
== Structure design patterns (GoF) ==&lt;br /&gt;
Design patterns defined by the Gang Of Four (see wikipédia on [[wikipedia:Design pattern|Design patters]]). &lt;br /&gt;
No usage of such patterns is required.&lt;br /&gt;
&lt;br /&gt;
== Behavior design patterns (GoF) ==&lt;br /&gt;
Design patterns defined by the Gang Of Four (see wikipédia on [[wikipedia:Design pattern|Design patters]]). &lt;br /&gt;
No usage of such patterns is required.&lt;br /&gt;
&lt;br /&gt;
== Design patterns of enterprise (Martin Fowler) ==&lt;br /&gt;
&lt;br /&gt;
=== Patterns of code organization ===&lt;br /&gt;
[[wikipedia:Martin Fowler|Martin Fowler]] has identified 3 ways to organize code:&lt;br /&gt;
* The &#039;&#039;&#039;Transaction Script&#039;&#039;&#039; (The source code is linear for each user action).&lt;br /&gt;
This is the old school used by all procedural languages.&lt;br /&gt;
Inconvenient: Redundancy of code. Need to know the physical model of data to develop.&lt;br /&gt;
* The &#039;&#039;&#039;Domain Model&#039;&#039;&#039;&lt;br /&gt;
This notion is available with object languages. It is business process (to identify before) that are used for objects classes.&lt;br /&gt;
Inconvenient: Model very complex to maintain.&lt;br /&gt;
* The &#039;&#039;&#039;Table Module&#039;&#039;&#039;&lt;br /&gt;
This is a mix between 2 previous where we have only one unique class for each table of database.&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; As shown in code skeletons (see previous chapter), Dolibarr uses concept of &#039;&#039;&#039;Table Module&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Communication between business logic - data (ORM) ===&lt;br /&gt;
&lt;br /&gt;
There are 3 ways to make links:&lt;br /&gt;
&lt;br /&gt;
* The &#039;&#039;&#039;Table And Row Data Gateway&#039;&#039;&#039;&lt;br /&gt;
This is the most simple. You have one class per table and each class is a link to the table with CRUD methods (Ceate, Read, Update, Delete). A class instance is a record in the table. The class contains only code to reach lines and fields of table.&lt;br /&gt;
&lt;br /&gt;
Example: This mode is used by some ORM Frameworks, like &#039;&#039;&#039;iBatis&#039;&#039;&#039; (http://ibatis.apache.org/).&lt;br /&gt;
&lt;br /&gt;
* The &#039;&#039;&#039;Active Record&#039;&#039;&#039;&lt;br /&gt;
Same as previous, but we are allowed to add some business functions into the class, if such functions are dedicated to the table or recording into this table.&lt;br /&gt;
&lt;br /&gt;
Example: This mode is used for Dolibarr development and most PHP softwares that include their own framework and best practices.&lt;br /&gt;
&lt;br /&gt;
* The &#039;&#039;&#039;Data Mapper&#039;&#039;&#039;&lt;br /&gt;
Classes represent entities of the problem and not the data. So you have to double, triple ... these classes with Mapper classes to access the data.&lt;br /&gt;
More &amp;quot;purist&amp;quot; on paper (closer of business), this method also has the disadvantage of being more complex in practice.&lt;br /&gt;
&lt;br /&gt;
Example: This is the choice if you use the ORM Framework &#039;&#039;&#039;Propel&#039;&#039;&#039; (http://propel.phpdb.org/trac/). We find this model in heavier applications, based on this ORM among others.&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; For Dolibarr development, it is recommended to use the connection mode &#039;&#039;&#039;Active Record&#039;&#039;&#039;, which offers the advantages of a model close to the business without having the complexity, without obfuscating technical architecture. It is by this way that the development, understanding of code and technical maintenance and / or business behaviour seems the more productive (this is however an ongoing debate between the purists and the pragmatists, debate in which nobody can really be right, because it depends on the objectives).&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_development&amp;diff=33965</id>
		<title>Module development</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_development&amp;diff=33965"/>
		<updated>2015-06-11T09:13:41Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Create a descriptor of Module (required) */&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/rdoursenaud/dolibarr-module-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 or a document template).&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 tha 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.&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;? You must see a new line with your new module and the possibility to activate it or not (browse all the tabs of each category of modules to find it). The value of $this-&amp;gt;special determines in which tab will be your module.&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 of your own module must be placed in a directory.&lt;br /&gt;
&lt;br /&gt;
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. Then in the &amp;quot;load_tables&amp;quot; function of your file descriptor module, modify the line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$dir = DOL_DOCUMENT_ROOT.&#039;/mymodule/sql/&#039;;&amp;lt;/source&amp;gt;&lt;br /&gt;
by&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$dir = DOL_DOCUMENT_ROOT.&#039;/valuechooseformymodule/sql/&#039;;&amp;lt;/source&amp;gt;&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;
&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&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;
== The tab management (optional) ==&lt;br /&gt;
&lt;br /&gt;
=== Add or removed 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 should the tab appears 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. Lang which contains correspondence between the code translation and language to display. If this name is followed with @mymodule, Dolibarr will search translation file into the lang file of 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 list of those files to include (DOL_DOCUMENT_ROOT is often dolibarr/htdocs/) :&lt;br /&gt;
* Object thirdparty (thirdparty) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/societe.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/lib/company.lib.php&lt;br /&gt;
* Object product (product) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/product.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/lib/product.lib.php&lt;br /&gt;
* Object invoice (invoice) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/facture.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/lib/invoice.lib.php&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;dev/skeletons&#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;skeletons_page.php&#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;
$res=0;&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;);			// to work if your module directory is into dolibarr root htdocs directory&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;);		// to work if your module directory is into a subdir of root htdocs directory&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 need to ask user several parameters.&lt;br /&gt;
&lt;br /&gt;
=== Create your page to edit parameters ===&lt;br /&gt;
If your module need several parameters to be setup, you must create a page to edit options (that will be saved into [[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 show possibles options and update them into table from a form.&lt;br /&gt;
It is a necessary to take an example from a page into directory &#039;&#039;&#039;/admin&#039;&#039;&#039; that will show you the way to read/save your parameter.&lt;br /&gt;
Put this page into directory &#039;&#039;&#039;/admin&#039;&#039;&#039;.&lt;br /&gt;
Then, into the descriptor file of your module, modify the variable config_page_url to set name of this PHP page (without the path that is not necesary if page is inside directory 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;mymodule_setuppage.php&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;
require(&#039;../main.inc.php&#039;);&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>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=List_of_modules_id&amp;diff=33964</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=33964"/>
		<updated>2015-06-11T05:33:11Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* ID 100000 - 499999 */&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 (http://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)&lt;br /&gt;
* ID 108000 - 108999: ETHICWEB&lt;br /&gt;
* ID 109000 - 109999: Aplose&lt;br /&gt;
* ID 110000 - 110999: Aternatik&lt;br /&gt;
* ID 120000 - 120999: Régis Houssin (http://www.inodbox.com)&lt;br /&gt;
* ID 130000 - 130999: Technicks ICT (http://www.technicks.eu)&lt;br /&gt;
* ID 140000 - 140999: Altairis&lt;br /&gt;
* ID 150000 - 150999: Jeffinfo &lt;br /&gt;
* ID 160000 - 160999: Charles-François BENKE ( patas-monkey.com)&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 205000 - 205999: Kreiz IT&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 501000 - 501999: Aikhan&lt;br /&gt;
&lt;br /&gt;
= ID &amp;gt; 500000 =&lt;br /&gt;
{{Flag en}} If you don&#039;t already have reserved ids and need some, please don&#039;t use a round number and use a number higher than 500000. If you have a wiki account, you can 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 rond et utilisez une valeur supérieure à 500000. Si vous avez un compte wiki, vous pouvez 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>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_development&amp;diff=33963</id>
		<title>Module development</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_development&amp;diff=33963"/>
		<updated>2015-06-11T04:32:52Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* 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/rdoursenaud/dolibarr-module-template GitHub Dolibarr Module Modèle]&lt;br /&gt;
&lt;br /&gt;
=Create your module =&lt;br /&gt;
== Create a descriptor of Module (required) ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: Required as soon as an addon is developed, whatever its goal is (except for adding a skin or a document template).&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 tha 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.&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;? You must see a new line with your new module and the possibility to activate it or not (browse all the tabs of each category of modules to find it). The value of $this-&amp;gt;special determines in which tab will be your module.&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 of your own module must be placed in a directory.&lt;br /&gt;
&lt;br /&gt;
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. Then in the &amp;quot;load_tables&amp;quot; function of your file descriptor module, modify the line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$dir = DOL_DOCUMENT_ROOT.&#039;/mymodule/sql/&#039;;&amp;lt;/source&amp;gt;&lt;br /&gt;
by&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$dir = DOL_DOCUMENT_ROOT.&#039;/valuechooseformymodule/sql/&#039;;&amp;lt;/source&amp;gt;&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;
&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&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;
== The tab management (optional) ==&lt;br /&gt;
&lt;br /&gt;
=== Add or removed 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 should the tab appears 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. Lang which contains correspondence between the code translation and language to display. If this name is followed with @mymodule, Dolibarr will search translation file into the lang file of 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 list of those files to include (DOL_DOCUMENT_ROOT is often dolibarr/htdocs/) :&lt;br /&gt;
* Object thirdparty (thirdparty) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/societe.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/lib/company.lib.php&lt;br /&gt;
* Object product (product) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/product.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/lib/product.lib.php&lt;br /&gt;
* Object invoice (invoice) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/facture.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/lib/invoice.lib.php&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;dev/skeletons&#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;skeletons_page.php&#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;
$res=0;&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;);			// to work if your module directory is into dolibarr root htdocs directory&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;);		// to work if your module directory is into a subdir of root htdocs directory&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 need to ask user several parameters.&lt;br /&gt;
&lt;br /&gt;
=== Create your page to edit parameters ===&lt;br /&gt;
If your module need several parameters to be setup, you must create a page to edit options (that will be saved into [[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 show possibles options and update them into table from a form.&lt;br /&gt;
It is a necessary to take an example from a page into directory &#039;&#039;&#039;/admin&#039;&#039;&#039; that will show you the way to read/save your parameter.&lt;br /&gt;
Put this page into directory &#039;&#039;&#039;/admin&#039;&#039;&#039;.&lt;br /&gt;
Then, into the descriptor file of your module, modify the variable config_page_url to set name of this PHP page (without the path that is not necesary if page is inside directory 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;mymodule_setuppage.php&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;
require(&#039;../main.inc.php&#039;);&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>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_development&amp;diff=33962</id>
		<title>Module development</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_development&amp;diff=33962"/>
		<updated>2015-06-11T04:31:59Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Create your SQL tables and the PHP DAO class (optional) */&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/rdoursenaud/dolibarr-module-template GitHub Dolibarr Module Modèle]&lt;br /&gt;
&lt;br /&gt;
=Create your module =&lt;br /&gt;
== Create a descriptor of Module (required) ==&lt;br /&gt;
&#039;&#039;&#039;When&#039;&#039;&#039;: Required as soon as an addon is developed, whatever its goal is (except for adding a skin or a document template).&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 tha 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.&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;? You must see a new line with your new module and the possibility to activate it or not (browse all the tabs of each category of modules to find it). The value of $this-&amp;gt;special determines in which tab will be your module.&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 in your own module must be placed in a directory.&lt;br /&gt;
&lt;br /&gt;
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. Then in the &amp;quot;load_tables&amp;quot; function of your file descriptor module, modify the line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$dir = DOL_DOCUMENT_ROOT.&#039;/mymodule/sql/&#039;;&amp;lt;/source&amp;gt;&lt;br /&gt;
by&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;$dir = DOL_DOCUMENT_ROOT.&#039;/valuechooseformymodule/sql/&#039;;&amp;lt;/source&amp;gt;&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;
&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&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;
== The tab management (optional) ==&lt;br /&gt;
&lt;br /&gt;
=== Add or removed 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 should the tab appears 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. Lang which contains correspondence between the code translation and language to display. If this name is followed with @mymodule, Dolibarr will search translation file into the lang file of 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 list of those files to include (DOL_DOCUMENT_ROOT is often dolibarr/htdocs/) :&lt;br /&gt;
* Object thirdparty (thirdparty) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/societe.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/lib/company.lib.php&lt;br /&gt;
* Object product (product) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/product.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/lib/product.lib.php&lt;br /&gt;
* Object invoice (invoice) :&lt;br /&gt;
** DOL_DOCUMENT_ROOT/facture.class.php&lt;br /&gt;
** DOL_DOCUMENT_ROOT/lib/invoice.lib.php&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;dev/skeletons&#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;skeletons_page.php&#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;
$res=0;&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;);			// to work if your module directory is into dolibarr root htdocs directory&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;);		// to work if your module directory is into a subdir of root htdocs directory&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 need to ask user several parameters.&lt;br /&gt;
&lt;br /&gt;
=== Create your page to edit parameters ===&lt;br /&gt;
If your module need several parameters to be setup, you must create a page to edit options (that will be saved into [[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 show possibles options and update them into table from a form.&lt;br /&gt;
It is a necessary to take an example from a page into directory &#039;&#039;&#039;/admin&#039;&#039;&#039; that will show you the way to read/save your parameter.&lt;br /&gt;
Put this page into directory &#039;&#039;&#039;/admin&#039;&#039;&#039;.&lt;br /&gt;
Then, into the descriptor file of your module, modify the variable config_page_url to set name of this PHP page (without the path that is not necesary if page is inside directory 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;mymodule_setuppage.php&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;
require(&#039;../main.inc.php&#039;);&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>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Medical_Center&amp;diff=33914</id>
		<title>Module Medical Center</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Medical_Center&amp;diff=33914"/>
		<updated>2015-06-07T08:17:00Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Menu Bilan consultations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:CabinetMed]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=Medical Center&lt;br /&gt;
|editor=NLTechno&lt;br /&gt;
|web=[http://www.nltechno.com www.nltechno.com]&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=medical}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=&lt;br /&gt;
|minversion=3.5.3&lt;br /&gt;
|note=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
Can turn your Dolibarr into a medical office manager (dictionaries of pathology, patient management, history, directory of referents doctors, following consultations, examinations/radios, generation of consultation documents, statistics of your consultations, monitoring money input, check receipts, etc ...). &lt;br /&gt;
&lt;br /&gt;
How to use module is described a little later.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
{{InstallModuleDoliStoreEn}}&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
{{ActivationModuleEn}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setup page specific to module:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Into setup page dedicated to module, you can also define:&lt;br /&gt;
* Feature related to rhumatology.&lt;br /&gt;
* Enable or not standard menu  Thirdparies of yo have to manage thirdparies that are not patient.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Other options:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Into menu &#039;Home - Setup - Other&#039;, you can also add constant &amp;quot;&#039;&#039;&#039;CABINETMED_DELAY_TO_LOCK_RECORD&#039;&#039;&#039;&amp;quot; to a number of day. This means all consultation recorded could not be modified 2 days Iafter they were recorded.&lt;br /&gt;
&lt;br /&gt;
By default, professional ID fields are not visible when you are on a patient card. You can however decide to make them visible by adding the constant &#039;&#039;&#039;CABINETMED_SHOW_PROFIDx&#039;&#039;&#039; to 1 (where x is a number between 1 and 6 to define which professional ID you want to see. Add several constants, if you need several professional ID).&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
Activating this module will add the following new top menu entries:&lt;br /&gt;
* Patients&lt;br /&gt;
* Contacts (the other doctors)&lt;br /&gt;
* Consultation summary (show entry/output for a year, month or day of revenus)&lt;br /&gt;
&lt;br /&gt;
== Users ==&lt;br /&gt;
Quand le module est activé, un utilisateur Dolibarr est en fait un membre du personnel soigant (médecin, infirmière, sage-femme, kiné, ou encore secrétaire...), et donc u nutilisateur faisant partie du cabinet amené à consulter ou saisir dans Dolibarr. Il peut n&#039;y avoir qu&#039;un seul utilisateur dans le cas d&#039;un médecin ou soignant exerçant seul. Un utilisateur peut aussi être une personne du secrétariat téléphonique du cabinet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
When the module is activated, a Dolibarr user is actually a member of staff soigant (doctor, nurse, midwife, physiotherapist, or secretary ...), and therefore u nutilisateur part of the firm brought in to consult or enter Dolibarr. There may be only one user in the case of a sole practitioner physician or caregiver. A user can also be a person answering service firm.&lt;br /&gt;
&lt;br /&gt;
== Care givers contacts ==&lt;br /&gt;
{{ToTranslate}}&lt;br /&gt;
Les Correspondants sont les autres soignants ou médecins s&#039;occupant ou s&#039;étant occupé du Patient.&lt;br /&gt;
Choisir le menu &amp;quot;&#039;&#039;&#039;Correspondants&#039;&#039;&#039;&amp;quot; fait apparaitre un sous-menu gauche offrant les fonctions pour créer, ou ajouter un nouveau Correspondant.&lt;br /&gt;
* Pour créer un correspondant, il suffit de cliquer sur l&#039;entrée &amp;quot;Nouveau correspondant&amp;quot; et de saisir les informations sur la fiche vierge puis Enregistrer.&lt;br /&gt;
* Lorsqu&#039;on a choisi l&#039;entrée du menu &amp;quot;Liste des correspondants&amp;quot;, on voie la liste de tous les correspondants enregistrés. Si on clique sur le nom de l&#039;un d&#039;eux, sa fiche s&#039;ouvre. Et il est possible de la modifier.&lt;br /&gt;
* Il est possible de rappeler la fiche d&#039;un Correspondant rapidement en saisissant une partie de son nom dans la zone de recherche rapide sur le bandeau de gauche.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
Correspondents are other caregivers or doctors attending or being occupied Patient. Select the menu &amp;quot;Correspondents&amp;quot; brings up a submenu with the left functions to create, or add a new correspondent.&lt;br /&gt;
* To create a contact, just click on the entry &amp;quot;New correspondent&amp;quot; and enter information on the blank page and select Save.&lt;br /&gt;
* When selected the menu entry &amp;quot;List all&amp;quot;, it means the list of all registered correspondents. If you click on the name of one of them, its card opens. And it is possible to change it.&lt;br /&gt;
* It is possible to recall a detail Corresponding quickly by typing part of its name in the quick search box on the left panel.&lt;br /&gt;
&lt;br /&gt;
== Patients ==&lt;br /&gt;
Select the top menu &amp;quot;&#039;&#039; &#039;&#039;&#039; Patients&amp;quot;, brings up an offering functions to create a new patient list patients or past consultations submenu. &lt;br /&gt;
&lt;br /&gt;
* To create a new patient, simply click on the &amp;quot;New Patient&amp;quot; entry and enter the information on the blank sheet and then Save. &lt;br /&gt;
* When you have selected the menu entry &amp;quot;Patient List&amp;quot; is the track list of all registered patients. If you click on the name of one of them, his record opens. And it is possible to change it. &lt;br /&gt;
* It is also possible to recall the record of a patient quickly by typing part of its name in the quick search box on the left banner.&lt;br /&gt;
&lt;br /&gt;
=== Fiches Patient et consultations (Patient records and consultations)===&lt;br /&gt;
Pour créer une fiche patient, cliquer sur le menu &amp;quot;&#039;&#039;&#039;Patient - Nouveau Patient&#039;&#039;&#039;&amp;quot;. Une fois créée, une fiche Patient contient plusieurs onglets:&lt;br /&gt;
* Un onglet avec les informations générales (qui sont celles enregistrés lors de la création) &lt;br /&gt;
* Un onglet Agenda (si le module Agenda a été activé)&lt;br /&gt;
* Un onglet Catégories (si le module Catégorie a été activé)&lt;br /&gt;
* Un onglet Correspondants &lt;br /&gt;
* Un ognlet Antécedants/Traitements&lt;br /&gt;
* Un onglet Notes&lt;br /&gt;
* Un onglet Consultations&lt;br /&gt;
* Un onglet Bio&lt;br /&gt;
* Un onglet Exploration&lt;br /&gt;
* Un onglet Courriers/Fichiers&lt;br /&gt;
&lt;br /&gt;
Exemple: Cliquer sur l&#039;image pour l&#039;agrandir&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot patientcard.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Voici un description sur la manière d&#039;utiliser chaque onglet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;translation&#039;&#039;&#039;&lt;br /&gt;
To create a patient file, click on the menu &#039;&#039; &#039;&#039; Patient - New Patient &#039;&#039; &#039;&#039;. Once created, a Patient card contains several tabs:&lt;br /&gt;
* A tab with general information (which are those recorded during the creation)&lt;br /&gt;
* A Calendar tab (if the Calendar module has been enabled)&lt;br /&gt;
* A Categories tab (if the Category module has been enabled)&lt;br /&gt;
* A Correspondence tab&lt;br /&gt;
* A history tab / Treatments&lt;br /&gt;
* A Notes tab&lt;br /&gt;
* A consultation tab&lt;br /&gt;
* A Bio tab&lt;br /&gt;
* A exploration tab&lt;br /&gt;
* A Couriers tab / Files&lt;br /&gt;
&lt;br /&gt;
Example: Click on image to enlarge&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot patientcard.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Here is a description of how to use each tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Onglet des informations générales (Tab general information)====&lt;br /&gt;
* Sur la fiche du Patient, il est possible de lui affecter un ou plusieurs utilisateurs (médecins particuliers du cabinet suivant le patient par exemple). Bien que tous soignant puisse voir la fiche du patient d&#039;un autre, ceci est utile pour classifier les patients par soignant principal. Cela est utilisé aussi pour les statistiques.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;translation&#039;&#039;&#039;&lt;br /&gt;
* On the Patient card, it is possible to assign one or more users (individual doctors cabinet following the patient for example). Although all caregivers can see the patient&#039;s chart of another, this is useful to classify patients by primary caregiver. It is also used for statistics.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Correspondans (tab for correspondents) ====&lt;br /&gt;
Sur cet onglet, vous pouvez associer tous les médecins traitant ou connaissant le patient avec leur spécialité.&lt;br /&gt;
&lt;br /&gt;
(On this tab, you can associate all physicians treating the patient with or knowing their specialty.)&lt;br /&gt;
&lt;br /&gt;
==== Onglet Agenda (tab agenda)====&lt;br /&gt;
Cet onglet n&#039;est visible que si le [[Module Agenda]] a été activé. &lt;br /&gt;
Il offre une vue de type calendrier de certains évênements qui ont été enregistrés sur le patient (création de la fiche patient, rendez-vous, saisie d&#039;une consultation).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;translation&#039;&#039;&#039;&lt;br /&gt;
(This tab is only visible if the Calendar module has been activated.)&lt;br /&gt;
(It provides a calendar-type view of certain events that have been recorded on the patient (creation of the patient file, appointments, entering a consultation).)&lt;br /&gt;
&lt;br /&gt;
==== Onglet Catégories (Tab for categories)====&lt;br /&gt;
Cet onglet n&#039;est visible que si le [[Module Catégories]] a été activé.&lt;br /&gt;
&lt;br /&gt;
Il permet de classer un patient dans une ou plusieurs catégories. A vous de décider les catégories que vous créez. Leur création se fair depuis le menu &amp;quot;Patient - Catégorie - Nouvelle catégorie&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;transaltion&#039;&#039;&#039;&lt;br /&gt;
This tab is only visible if the [[Module Categories]] has been activated.&lt;br /&gt;
It classifies a patient in one or more categories. You decide which categories you create. Their creation is fair from the &amp;quot;Patient - Category - New Category&amp;quot; menu.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Antécédents/Traitements (Tab Background / Treatments) ====&lt;br /&gt;
To complete ...&lt;br /&gt;
&lt;br /&gt;
==== Tab Notes ====&lt;br /&gt;
To complete&lt;br /&gt;
&lt;br /&gt;
==== Onglet Documents (Tab Documents)====&lt;br /&gt;
* Cette page permet de joindre des pièces jointes (images de scanners, d&#039;échographie, documents words, ...)&lt;br /&gt;
Mais elle permet aussi de générer des documents OpenOffice à partir d&#039;un modèle. Le modèle courrier_consult.odt est fourni en example. &lt;br /&gt;
* Pour générer un document, il faut choisir le modèle, éventuellement la fiche Bio associée puis cliquer sur Générer.&lt;br /&gt;
Le modèle sera utilisé et toutes les balises variables seront remplacées par les infos du patient ou de la consultation.&lt;br /&gt;
* Pour faire son propre modèle de document, voir la page [[Créer un modèle de document ODT]].&lt;br /&gt;
Les balises suivantes sont disponibles en plus de celle standard de Dolibarr:&lt;br /&gt;
{{TagsOdtCabinetMed}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;translation&#039;&#039;&#039;&lt;br /&gt;
* This page allows you to attach attachments (image scanners, ultrasound, papers words ...)&lt;br /&gt;
But it also can generate OpenOffice documents from a model. The model is supplied in courrier_consult.odt example.&lt;br /&gt;
* To generate a document, choose the model, possibly associated Bio page and click Generate.&lt;br /&gt;
The model will be used and all variables tags will be replaced with the patient&#039;s information or consultation.&lt;br /&gt;
* To make your own document model, see the [[Create a template ODT]].&lt;br /&gt;
The following tags are available in addition to the standard Dolibarr:&lt;br /&gt;
{{TagsOdtCabinetMed}}&lt;br /&gt;
&lt;br /&gt;
== Menu Bilan consultations ==&lt;br /&gt;
Choisir le menu Bilan consultations fait apparaitre un tableau affichant pour les 3 dernières années, les revenus avec le détail par mois.&lt;br /&gt;
En cliquant sur un mois, cela déroule le détail sur chaque jour du mois.&lt;br /&gt;
Il est aussi possible depuis cet écran d&#039;exporter le détail dans un fichier Excel.&lt;br /&gt;
&lt;br /&gt;
Copie d&#039;écran exemple (cliquez sur l&#039;image pour agrandir):&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot report.png|200px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;translation&#039;&#039;&#039;&lt;br /&gt;
Select Balance consultations brings up a table that displays the menu for the past 3 years, income per month with details.&lt;br /&gt;
Clicking on a month, this place details about each day of the month.&lt;br /&gt;
It is also possible from this screen to export the details in an Excel file.&lt;br /&gt;
&lt;br /&gt;
Screenshot example (click on the image to enlarge):&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot report.png|200px]]&lt;br /&gt;
&lt;br /&gt;
= Développement =&lt;br /&gt;
{{TemplateModNLTechnoEn}}&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Medical_Center&amp;diff=33913</id>
		<title>Module Medical Center</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Medical_Center&amp;diff=33913"/>
		<updated>2015-06-07T08:14:24Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Fiches Patient et consultations (Patient records and consultations) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:CabinetMed]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=Medical Center&lt;br /&gt;
|editor=NLTechno&lt;br /&gt;
|web=[http://www.nltechno.com www.nltechno.com]&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=medical}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=&lt;br /&gt;
|minversion=3.5.3&lt;br /&gt;
|note=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
Can turn your Dolibarr into a medical office manager (dictionaries of pathology, patient management, history, directory of referents doctors, following consultations, examinations/radios, generation of consultation documents, statistics of your consultations, monitoring money input, check receipts, etc ...). &lt;br /&gt;
&lt;br /&gt;
How to use module is described a little later.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
{{InstallModuleDoliStoreEn}}&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
{{ActivationModuleEn}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setup page specific to module:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Into setup page dedicated to module, you can also define:&lt;br /&gt;
* Feature related to rhumatology.&lt;br /&gt;
* Enable or not standard menu  Thirdparies of yo have to manage thirdparies that are not patient.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Other options:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Into menu &#039;Home - Setup - Other&#039;, you can also add constant &amp;quot;&#039;&#039;&#039;CABINETMED_DELAY_TO_LOCK_RECORD&#039;&#039;&#039;&amp;quot; to a number of day. This means all consultation recorded could not be modified 2 days Iafter they were recorded.&lt;br /&gt;
&lt;br /&gt;
By default, professional ID fields are not visible when you are on a patient card. You can however decide to make them visible by adding the constant &#039;&#039;&#039;CABINETMED_SHOW_PROFIDx&#039;&#039;&#039; to 1 (where x is a number between 1 and 6 to define which professional ID you want to see. Add several constants, if you need several professional ID).&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
Activating this module will add the following new top menu entries:&lt;br /&gt;
* Patients&lt;br /&gt;
* Contacts (the other doctors)&lt;br /&gt;
* Consultation summary (show entry/output for a year, month or day of revenus)&lt;br /&gt;
&lt;br /&gt;
== Users ==&lt;br /&gt;
Quand le module est activé, un utilisateur Dolibarr est en fait un membre du personnel soigant (médecin, infirmière, sage-femme, kiné, ou encore secrétaire...), et donc u nutilisateur faisant partie du cabinet amené à consulter ou saisir dans Dolibarr. Il peut n&#039;y avoir qu&#039;un seul utilisateur dans le cas d&#039;un médecin ou soignant exerçant seul. Un utilisateur peut aussi être une personne du secrétariat téléphonique du cabinet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
When the module is activated, a Dolibarr user is actually a member of staff soigant (doctor, nurse, midwife, physiotherapist, or secretary ...), and therefore u nutilisateur part of the firm brought in to consult or enter Dolibarr. There may be only one user in the case of a sole practitioner physician or caregiver. A user can also be a person answering service firm.&lt;br /&gt;
&lt;br /&gt;
== Care givers contacts ==&lt;br /&gt;
{{ToTranslate}}&lt;br /&gt;
Les Correspondants sont les autres soignants ou médecins s&#039;occupant ou s&#039;étant occupé du Patient.&lt;br /&gt;
Choisir le menu &amp;quot;&#039;&#039;&#039;Correspondants&#039;&#039;&#039;&amp;quot; fait apparaitre un sous-menu gauche offrant les fonctions pour créer, ou ajouter un nouveau Correspondant.&lt;br /&gt;
* Pour créer un correspondant, il suffit de cliquer sur l&#039;entrée &amp;quot;Nouveau correspondant&amp;quot; et de saisir les informations sur la fiche vierge puis Enregistrer.&lt;br /&gt;
* Lorsqu&#039;on a choisi l&#039;entrée du menu &amp;quot;Liste des correspondants&amp;quot;, on voie la liste de tous les correspondants enregistrés. Si on clique sur le nom de l&#039;un d&#039;eux, sa fiche s&#039;ouvre. Et il est possible de la modifier.&lt;br /&gt;
* Il est possible de rappeler la fiche d&#039;un Correspondant rapidement en saisissant une partie de son nom dans la zone de recherche rapide sur le bandeau de gauche.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
Correspondents are other caregivers or doctors attending or being occupied Patient. Select the menu &amp;quot;Correspondents&amp;quot; brings up a submenu with the left functions to create, or add a new correspondent.&lt;br /&gt;
* To create a contact, just click on the entry &amp;quot;New correspondent&amp;quot; and enter information on the blank page and select Save.&lt;br /&gt;
* When selected the menu entry &amp;quot;List all&amp;quot;, it means the list of all registered correspondents. If you click on the name of one of them, its card opens. And it is possible to change it.&lt;br /&gt;
* It is possible to recall a detail Corresponding quickly by typing part of its name in the quick search box on the left panel.&lt;br /&gt;
&lt;br /&gt;
== Patients ==&lt;br /&gt;
Select the top menu &amp;quot;&#039;&#039; &#039;&#039;&#039; Patients&amp;quot;, brings up an offering functions to create a new patient list patients or past consultations submenu. &lt;br /&gt;
&lt;br /&gt;
* To create a new patient, simply click on the &amp;quot;New Patient&amp;quot; entry and enter the information on the blank sheet and then Save. &lt;br /&gt;
* When you have selected the menu entry &amp;quot;Patient List&amp;quot; is the track list of all registered patients. If you click on the name of one of them, his record opens. And it is possible to change it. &lt;br /&gt;
* It is also possible to recall the record of a patient quickly by typing part of its name in the quick search box on the left banner.&lt;br /&gt;
&lt;br /&gt;
=== Fiches Patient et consultations (Patient records and consultations)===&lt;br /&gt;
Pour créer une fiche patient, cliquer sur le menu &amp;quot;&#039;&#039;&#039;Patient - Nouveau Patient&#039;&#039;&#039;&amp;quot;. Une fois créée, une fiche Patient contient plusieurs onglets:&lt;br /&gt;
* Un onglet avec les informations générales (qui sont celles enregistrés lors de la création) &lt;br /&gt;
* Un onglet Agenda (si le module Agenda a été activé)&lt;br /&gt;
* Un onglet Catégories (si le module Catégorie a été activé)&lt;br /&gt;
* Un onglet Correspondants &lt;br /&gt;
* Un ognlet Antécedants/Traitements&lt;br /&gt;
* Un onglet Notes&lt;br /&gt;
* Un onglet Consultations&lt;br /&gt;
* Un onglet Bio&lt;br /&gt;
* Un onglet Exploration&lt;br /&gt;
* Un onglet Courriers/Fichiers&lt;br /&gt;
&lt;br /&gt;
Exemple: Cliquer sur l&#039;image pour l&#039;agrandir&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot patientcard.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Voici un description sur la manière d&#039;utiliser chaque onglet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;translation&#039;&#039;&#039;&lt;br /&gt;
To create a patient file, click on the menu &#039;&#039; &#039;&#039; Patient - New Patient &#039;&#039; &#039;&#039;. Once created, a Patient card contains several tabs:&lt;br /&gt;
* A tab with general information (which are those recorded during the creation)&lt;br /&gt;
* A Calendar tab (if the Calendar module has been enabled)&lt;br /&gt;
* A Categories tab (if the Category module has been enabled)&lt;br /&gt;
* A Correspondence tab&lt;br /&gt;
* A history tab / Treatments&lt;br /&gt;
* A Notes tab&lt;br /&gt;
* A consultation tab&lt;br /&gt;
* A Bio tab&lt;br /&gt;
* A exploration tab&lt;br /&gt;
* A Couriers tab / Files&lt;br /&gt;
&lt;br /&gt;
Example: Click on image to enlarge&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot patientcard.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Here is a description of how to use each tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Onglet des informations générales (Tab general information)====&lt;br /&gt;
* Sur la fiche du Patient, il est possible de lui affecter un ou plusieurs utilisateurs (médecins particuliers du cabinet suivant le patient par exemple). Bien que tous soignant puisse voir la fiche du patient d&#039;un autre, ceci est utile pour classifier les patients par soignant principal. Cela est utilisé aussi pour les statistiques.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;translation&#039;&#039;&#039;&lt;br /&gt;
* On the Patient card, it is possible to assign one or more users (individual doctors cabinet following the patient for example). Although all caregivers can see the patient&#039;s chart of another, this is useful to classify patients by primary caregiver. It is also used for statistics.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Correspondans (tab for correspondents) ====&lt;br /&gt;
Sur cet onglet, vous pouvez associer tous les médecins traitant ou connaissant le patient avec leur spécialité.&lt;br /&gt;
&lt;br /&gt;
(On this tab, you can associate all physicians treating the patient with or knowing their specialty.)&lt;br /&gt;
&lt;br /&gt;
==== Onglet Agenda (tab agenda)====&lt;br /&gt;
Cet onglet n&#039;est visible que si le [[Module Agenda]] a été activé. &lt;br /&gt;
Il offre une vue de type calendrier de certains évênements qui ont été enregistrés sur le patient (création de la fiche patient, rendez-vous, saisie d&#039;une consultation).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;translation&#039;&#039;&#039;&lt;br /&gt;
(This tab is only visible if the Calendar module has been activated.)&lt;br /&gt;
(It provides a calendar-type view of certain events that have been recorded on the patient (creation of the patient file, appointments, entering a consultation).)&lt;br /&gt;
&lt;br /&gt;
==== Onglet Catégories (Tab for categories)====&lt;br /&gt;
Cet onglet n&#039;est visible que si le [[Module Catégories]] a été activé.&lt;br /&gt;
&lt;br /&gt;
Il permet de classer un patient dans une ou plusieurs catégories. A vous de décider les catégories que vous créez. Leur création se fair depuis le menu &amp;quot;Patient - Catégorie - Nouvelle catégorie&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;transaltion&#039;&#039;&#039;&lt;br /&gt;
This tab is only visible if the [[Module Categories]] has been activated.&lt;br /&gt;
It classifies a patient in one or more categories. You decide which categories you create. Their creation is fair from the &amp;quot;Patient - Category - New Category&amp;quot; menu.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Antécédents/Traitements (Tab Background / Treatments) ====&lt;br /&gt;
To complete ...&lt;br /&gt;
&lt;br /&gt;
==== Tab Notes ====&lt;br /&gt;
To complete&lt;br /&gt;
&lt;br /&gt;
==== Onglet Documents (Tab Documents)====&lt;br /&gt;
* Cette page permet de joindre des pièces jointes (images de scanners, d&#039;échographie, documents words, ...)&lt;br /&gt;
Mais elle permet aussi de générer des documents OpenOffice à partir d&#039;un modèle. Le modèle courrier_consult.odt est fourni en example. &lt;br /&gt;
* Pour générer un document, il faut choisir le modèle, éventuellement la fiche Bio associée puis cliquer sur Générer.&lt;br /&gt;
Le modèle sera utilisé et toutes les balises variables seront remplacées par les infos du patient ou de la consultation.&lt;br /&gt;
* Pour faire son propre modèle de document, voir la page [[Créer un modèle de document ODT]].&lt;br /&gt;
Les balises suivantes sont disponibles en plus de celle standard de Dolibarr:&lt;br /&gt;
{{TagsOdtCabinetMed}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;translation&#039;&#039;&#039;&lt;br /&gt;
* This page allows you to attach attachments (image scanners, ultrasound, papers words ...)&lt;br /&gt;
But it also can generate OpenOffice documents from a model. The model is supplied in courrier_consult.odt example.&lt;br /&gt;
* To generate a document, choose the model, possibly associated Bio page and click Generate.&lt;br /&gt;
The model will be used and all variables tags will be replaced with the patient&#039;s information or consultation.&lt;br /&gt;
* To make your own document model, see the [[Create a template ODT]].&lt;br /&gt;
The following tags are available in addition to the standard Dolibarr:&lt;br /&gt;
{{TagsOdtCabinetMed}}&lt;br /&gt;
&lt;br /&gt;
== Menu Bilan consultations ==&lt;br /&gt;
Choisir le menu Bilan consultations fait apparaitre un tableau affichant pour les 3 dernières années, les revenus avec le détail par mois.&lt;br /&gt;
En cliquant sur un mois, cela déroule le détail sur chaque jour du mois.&lt;br /&gt;
Il est aussi possible depuis cet écran d&#039;exporter le détail dans un fichier Excel.&lt;br /&gt;
&lt;br /&gt;
Copie d&#039;écran exemple (cliquez sur l&#039;image pour agrandir):&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot report.png|200px]]&lt;br /&gt;
&lt;br /&gt;
= Développement =&lt;br /&gt;
{{TemplateModNLTechnoEn}}&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Medical_Center&amp;diff=33912</id>
		<title>Module Medical Center</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Medical_Center&amp;diff=33912"/>
		<updated>2015-06-07T08:09:32Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Onglet Documents */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:CabinetMed]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=Medical Center&lt;br /&gt;
|editor=NLTechno&lt;br /&gt;
|web=[http://www.nltechno.com www.nltechno.com]&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=medical}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=&lt;br /&gt;
|minversion=3.5.3&lt;br /&gt;
|note=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
Can turn your Dolibarr into a medical office manager (dictionaries of pathology, patient management, history, directory of referents doctors, following consultations, examinations/radios, generation of consultation documents, statistics of your consultations, monitoring money input, check receipts, etc ...). &lt;br /&gt;
&lt;br /&gt;
How to use module is described a little later.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
{{InstallModuleDoliStoreEn}}&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
{{ActivationModuleEn}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setup page specific to module:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Into setup page dedicated to module, you can also define:&lt;br /&gt;
* Feature related to rhumatology.&lt;br /&gt;
* Enable or not standard menu  Thirdparies of yo have to manage thirdparies that are not patient.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Other options:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Into menu &#039;Home - Setup - Other&#039;, you can also add constant &amp;quot;&#039;&#039;&#039;CABINETMED_DELAY_TO_LOCK_RECORD&#039;&#039;&#039;&amp;quot; to a number of day. This means all consultation recorded could not be modified 2 days Iafter they were recorded.&lt;br /&gt;
&lt;br /&gt;
By default, professional ID fields are not visible when you are on a patient card. You can however decide to make them visible by adding the constant &#039;&#039;&#039;CABINETMED_SHOW_PROFIDx&#039;&#039;&#039; to 1 (where x is a number between 1 and 6 to define which professional ID you want to see. Add several constants, if you need several professional ID).&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
Activating this module will add the following new top menu entries:&lt;br /&gt;
* Patients&lt;br /&gt;
* Contacts (the other doctors)&lt;br /&gt;
* Consultation summary (show entry/output for a year, month or day of revenus)&lt;br /&gt;
&lt;br /&gt;
== Users ==&lt;br /&gt;
Quand le module est activé, un utilisateur Dolibarr est en fait un membre du personnel soigant (médecin, infirmière, sage-femme, kiné, ou encore secrétaire...), et donc u nutilisateur faisant partie du cabinet amené à consulter ou saisir dans Dolibarr. Il peut n&#039;y avoir qu&#039;un seul utilisateur dans le cas d&#039;un médecin ou soignant exerçant seul. Un utilisateur peut aussi être une personne du secrétariat téléphonique du cabinet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
When the module is activated, a Dolibarr user is actually a member of staff soigant (doctor, nurse, midwife, physiotherapist, or secretary ...), and therefore u nutilisateur part of the firm brought in to consult or enter Dolibarr. There may be only one user in the case of a sole practitioner physician or caregiver. A user can also be a person answering service firm.&lt;br /&gt;
&lt;br /&gt;
== Care givers contacts ==&lt;br /&gt;
{{ToTranslate}}&lt;br /&gt;
Les Correspondants sont les autres soignants ou médecins s&#039;occupant ou s&#039;étant occupé du Patient.&lt;br /&gt;
Choisir le menu &amp;quot;&#039;&#039;&#039;Correspondants&#039;&#039;&#039;&amp;quot; fait apparaitre un sous-menu gauche offrant les fonctions pour créer, ou ajouter un nouveau Correspondant.&lt;br /&gt;
* Pour créer un correspondant, il suffit de cliquer sur l&#039;entrée &amp;quot;Nouveau correspondant&amp;quot; et de saisir les informations sur la fiche vierge puis Enregistrer.&lt;br /&gt;
* Lorsqu&#039;on a choisi l&#039;entrée du menu &amp;quot;Liste des correspondants&amp;quot;, on voie la liste de tous les correspondants enregistrés. Si on clique sur le nom de l&#039;un d&#039;eux, sa fiche s&#039;ouvre. Et il est possible de la modifier.&lt;br /&gt;
* Il est possible de rappeler la fiche d&#039;un Correspondant rapidement en saisissant une partie de son nom dans la zone de recherche rapide sur le bandeau de gauche.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
Correspondents are other caregivers or doctors attending or being occupied Patient. Select the menu &amp;quot;Correspondents&amp;quot; brings up a submenu with the left functions to create, or add a new correspondent.&lt;br /&gt;
* To create a contact, just click on the entry &amp;quot;New correspondent&amp;quot; and enter information on the blank page and select Save.&lt;br /&gt;
* When selected the menu entry &amp;quot;List all&amp;quot;, it means the list of all registered correspondents. If you click on the name of one of them, its card opens. And it is possible to change it.&lt;br /&gt;
* It is possible to recall a detail Corresponding quickly by typing part of its name in the quick search box on the left panel.&lt;br /&gt;
&lt;br /&gt;
== Patients ==&lt;br /&gt;
Select the top menu &amp;quot;&#039;&#039; &#039;&#039;&#039; Patients&amp;quot;, brings up an offering functions to create a new patient list patients or past consultations submenu. &lt;br /&gt;
&lt;br /&gt;
* To create a new patient, simply click on the &amp;quot;New Patient&amp;quot; entry and enter the information on the blank sheet and then Save. &lt;br /&gt;
* When you have selected the menu entry &amp;quot;Patient List&amp;quot; is the track list of all registered patients. If you click on the name of one of them, his record opens. And it is possible to change it. &lt;br /&gt;
* It is also possible to recall the record of a patient quickly by typing part of its name in the quick search box on the left banner.&lt;br /&gt;
&lt;br /&gt;
=== Fiches Patient et consultations (Patient records and consultations)===&lt;br /&gt;
Pour créer une fiche patient, cliquer sur le menu &amp;quot;&#039;&#039;&#039;Patient - Nouveau Patient&#039;&#039;&#039;&amp;quot;. Une fois créée, une fiche Patient contient plusieurs onglets:&lt;br /&gt;
* Un onglet avec les informations générales (qui sont celles enregistrés lors de la création) &lt;br /&gt;
* Un onglet Agenda (si le module Agenda a été activé)&lt;br /&gt;
* Un onglet Catégories (si le module Catégorie a été activé)&lt;br /&gt;
* Un onglet Correspondants &lt;br /&gt;
* Un ognlet Antécedants/Traitements&lt;br /&gt;
* Un onglet Notes&lt;br /&gt;
* Un onglet Consultations&lt;br /&gt;
* Un onglet Bio&lt;br /&gt;
* Un onglet Exploration&lt;br /&gt;
* Un onglet Courriers/Fichiers&lt;br /&gt;
&lt;br /&gt;
Exemple: Cliquer sur l&#039;image pour l&#039;agrandir&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot patientcard.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Voici un description sur la manière d&#039;utiliser chaque onglet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
To create a patient file, click on the menu &#039;&#039; &#039;&#039; Patient - New Patient &#039;&#039; &#039;&#039;. Once created, a Patient card contains several tabs:&lt;br /&gt;
* A tab with general information (which are those recorded during the creation)&lt;br /&gt;
* A Calendar tab (if the Calendar module has been enabled)&lt;br /&gt;
* A Categories tab (if the Category module has been enabled)&lt;br /&gt;
* A Correspondence tab&lt;br /&gt;
* A history tab / Treatments&lt;br /&gt;
* A Notes tab&lt;br /&gt;
* A consultation tab&lt;br /&gt;
* A Bio tab&lt;br /&gt;
* A exploration tab&lt;br /&gt;
* A Couriers tab / Files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Onglet des informations générales (Tab general information)====&lt;br /&gt;
* Sur la fiche du Patient, il est possible de lui affecter un ou plusieurs utilisateurs (médecins particuliers du cabinet suivant le patient par exemple). Bien que tous soignant puisse voir la fiche du patient d&#039;un autre, ceci est utile pour classifier les patients par soignant principal. Cela est utilisé aussi pour les statistiques.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;translation&#039;&#039;&#039;&lt;br /&gt;
* On the Patient card, it is possible to assign one or more users (individual doctors cabinet following the patient for example). Although all caregivers can see the patient&#039;s chart of another, this is useful to classify patients by primary caregiver. It is also used for statistics.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Correspondans (tab for correspondents) ====&lt;br /&gt;
Sur cet onglet, vous pouvez associer tous les médecins traitant ou connaissant le patient avec leur spécialité.&lt;br /&gt;
&lt;br /&gt;
(On this tab, you can associate all physicians treating the patient with or knowing their specialty.)&lt;br /&gt;
&lt;br /&gt;
==== Onglet Agenda (tab agenda)====&lt;br /&gt;
Cet onglet n&#039;est visible que si le [[Module Agenda]] a été activé. &lt;br /&gt;
Il offre une vue de type calendrier de certains évênements qui ont été enregistrés sur le patient (création de la fiche patient, rendez-vous, saisie d&#039;une consultation).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;translation&#039;&#039;&#039;&lt;br /&gt;
(This tab is only visible if the Calendar module has been activated.)&lt;br /&gt;
(It provides a calendar-type view of certain events that have been recorded on the patient (creation of the patient file, appointments, entering a consultation).)&lt;br /&gt;
&lt;br /&gt;
==== Onglet Catégories (Tab for categories)====&lt;br /&gt;
Cet onglet n&#039;est visible que si le [[Module Catégories]] a été activé.&lt;br /&gt;
&lt;br /&gt;
Il permet de classer un patient dans une ou plusieurs catégories. A vous de décider les catégories que vous créez. Leur création se fair depuis le menu &amp;quot;Patient - Catégorie - Nouvelle catégorie&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;transaltion&#039;&#039;&#039;&lt;br /&gt;
This tab is only visible if the [[Module Categories]] has been activated.&lt;br /&gt;
It classifies a patient in one or more categories. You decide which categories you create. Their creation is fair from the &amp;quot;Patient - Category - New Category&amp;quot; menu.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Antécédents/Traitements (Tab Background / Treatments) ====&lt;br /&gt;
To complete ...&lt;br /&gt;
&lt;br /&gt;
==== Tab Notes ====&lt;br /&gt;
To complete&lt;br /&gt;
&lt;br /&gt;
==== Onglet Documents (Tab Documents)====&lt;br /&gt;
* Cette page permet de joindre des pièces jointes (images de scanners, d&#039;échographie, documents words, ...)&lt;br /&gt;
Mais elle permet aussi de générer des documents OpenOffice à partir d&#039;un modèle. Le modèle courrier_consult.odt est fourni en example. &lt;br /&gt;
* Pour générer un document, il faut choisir le modèle, éventuellement la fiche Bio associée puis cliquer sur Générer.&lt;br /&gt;
Le modèle sera utilisé et toutes les balises variables seront remplacées par les infos du patient ou de la consultation.&lt;br /&gt;
* Pour faire son propre modèle de document, voir la page [[Créer un modèle de document ODT]].&lt;br /&gt;
Les balises suivantes sont disponibles en plus de celle standard de Dolibarr:&lt;br /&gt;
{{TagsOdtCabinetMed}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;translation&#039;&#039;&#039;&lt;br /&gt;
* This page allows you to attach attachments (image scanners, ultrasound, papers words ...)&lt;br /&gt;
But it also can generate OpenOffice documents from a model. The model is supplied in courrier_consult.odt example.&lt;br /&gt;
* To generate a document, choose the model, possibly associated Bio page and click Generate.&lt;br /&gt;
The model will be used and all variables tags will be replaced with the patient&#039;s information or consultation.&lt;br /&gt;
* To make your own document model, see the [[Create a template ODT]].&lt;br /&gt;
The following tags are available in addition to the standard Dolibarr:&lt;br /&gt;
{{TagsOdtCabinetMed}}&lt;br /&gt;
&lt;br /&gt;
== Menu Bilan consultations ==&lt;br /&gt;
Choisir le menu Bilan consultations fait apparaitre un tableau affichant pour les 3 dernières années, les revenus avec le détail par mois.&lt;br /&gt;
En cliquant sur un mois, cela déroule le détail sur chaque jour du mois.&lt;br /&gt;
Il est aussi possible depuis cet écran d&#039;exporter le détail dans un fichier Excel.&lt;br /&gt;
&lt;br /&gt;
Copie d&#039;écran exemple (cliquez sur l&#039;image pour agrandir):&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot report.png|200px]]&lt;br /&gt;
&lt;br /&gt;
= Développement =&lt;br /&gt;
{{TemplateModNLTechnoEn}}&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Medical_Center&amp;diff=33911</id>
		<title>Module Medical Center</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Medical_Center&amp;diff=33911"/>
		<updated>2015-06-07T08:08:22Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Onglet Documents */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:CabinetMed]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=Medical Center&lt;br /&gt;
|editor=NLTechno&lt;br /&gt;
|web=[http://www.nltechno.com www.nltechno.com]&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=medical}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=&lt;br /&gt;
|minversion=3.5.3&lt;br /&gt;
|note=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
Can turn your Dolibarr into a medical office manager (dictionaries of pathology, patient management, history, directory of referents doctors, following consultations, examinations/radios, generation of consultation documents, statistics of your consultations, monitoring money input, check receipts, etc ...). &lt;br /&gt;
&lt;br /&gt;
How to use module is described a little later.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
{{InstallModuleDoliStoreEn}}&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
{{ActivationModuleEn}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setup page specific to module:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Into setup page dedicated to module, you can also define:&lt;br /&gt;
* Feature related to rhumatology.&lt;br /&gt;
* Enable or not standard menu  Thirdparies of yo have to manage thirdparies that are not patient.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Other options:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Into menu &#039;Home - Setup - Other&#039;, you can also add constant &amp;quot;&#039;&#039;&#039;CABINETMED_DELAY_TO_LOCK_RECORD&#039;&#039;&#039;&amp;quot; to a number of day. This means all consultation recorded could not be modified 2 days Iafter they were recorded.&lt;br /&gt;
&lt;br /&gt;
By default, professional ID fields are not visible when you are on a patient card. You can however decide to make them visible by adding the constant &#039;&#039;&#039;CABINETMED_SHOW_PROFIDx&#039;&#039;&#039; to 1 (where x is a number between 1 and 6 to define which professional ID you want to see. Add several constants, if you need several professional ID).&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
Activating this module will add the following new top menu entries:&lt;br /&gt;
* Patients&lt;br /&gt;
* Contacts (the other doctors)&lt;br /&gt;
* Consultation summary (show entry/output for a year, month or day of revenus)&lt;br /&gt;
&lt;br /&gt;
== Users ==&lt;br /&gt;
Quand le module est activé, un utilisateur Dolibarr est en fait un membre du personnel soigant (médecin, infirmière, sage-femme, kiné, ou encore secrétaire...), et donc u nutilisateur faisant partie du cabinet amené à consulter ou saisir dans Dolibarr. Il peut n&#039;y avoir qu&#039;un seul utilisateur dans le cas d&#039;un médecin ou soignant exerçant seul. Un utilisateur peut aussi être une personne du secrétariat téléphonique du cabinet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
When the module is activated, a Dolibarr user is actually a member of staff soigant (doctor, nurse, midwife, physiotherapist, or secretary ...), and therefore u nutilisateur part of the firm brought in to consult or enter Dolibarr. There may be only one user in the case of a sole practitioner physician or caregiver. A user can also be a person answering service firm.&lt;br /&gt;
&lt;br /&gt;
== Care givers contacts ==&lt;br /&gt;
{{ToTranslate}}&lt;br /&gt;
Les Correspondants sont les autres soignants ou médecins s&#039;occupant ou s&#039;étant occupé du Patient.&lt;br /&gt;
Choisir le menu &amp;quot;&#039;&#039;&#039;Correspondants&#039;&#039;&#039;&amp;quot; fait apparaitre un sous-menu gauche offrant les fonctions pour créer, ou ajouter un nouveau Correspondant.&lt;br /&gt;
* Pour créer un correspondant, il suffit de cliquer sur l&#039;entrée &amp;quot;Nouveau correspondant&amp;quot; et de saisir les informations sur la fiche vierge puis Enregistrer.&lt;br /&gt;
* Lorsqu&#039;on a choisi l&#039;entrée du menu &amp;quot;Liste des correspondants&amp;quot;, on voie la liste de tous les correspondants enregistrés. Si on clique sur le nom de l&#039;un d&#039;eux, sa fiche s&#039;ouvre. Et il est possible de la modifier.&lt;br /&gt;
* Il est possible de rappeler la fiche d&#039;un Correspondant rapidement en saisissant une partie de son nom dans la zone de recherche rapide sur le bandeau de gauche.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
Correspondents are other caregivers or doctors attending or being occupied Patient. Select the menu &amp;quot;Correspondents&amp;quot; brings up a submenu with the left functions to create, or add a new correspondent.&lt;br /&gt;
* To create a contact, just click on the entry &amp;quot;New correspondent&amp;quot; and enter information on the blank page and select Save.&lt;br /&gt;
* When selected the menu entry &amp;quot;List all&amp;quot;, it means the list of all registered correspondents. If you click on the name of one of them, its card opens. And it is possible to change it.&lt;br /&gt;
* It is possible to recall a detail Corresponding quickly by typing part of its name in the quick search box on the left panel.&lt;br /&gt;
&lt;br /&gt;
== Patients ==&lt;br /&gt;
Select the top menu &amp;quot;&#039;&#039; &#039;&#039;&#039; Patients&amp;quot;, brings up an offering functions to create a new patient list patients or past consultations submenu. &lt;br /&gt;
&lt;br /&gt;
* To create a new patient, simply click on the &amp;quot;New Patient&amp;quot; entry and enter the information on the blank sheet and then Save. &lt;br /&gt;
* When you have selected the menu entry &amp;quot;Patient List&amp;quot; is the track list of all registered patients. If you click on the name of one of them, his record opens. And it is possible to change it. &lt;br /&gt;
* It is also possible to recall the record of a patient quickly by typing part of its name in the quick search box on the left banner.&lt;br /&gt;
&lt;br /&gt;
=== Fiches Patient et consultations (Patient records and consultations)===&lt;br /&gt;
Pour créer une fiche patient, cliquer sur le menu &amp;quot;&#039;&#039;&#039;Patient - Nouveau Patient&#039;&#039;&#039;&amp;quot;. Une fois créée, une fiche Patient contient plusieurs onglets:&lt;br /&gt;
* Un onglet avec les informations générales (qui sont celles enregistrés lors de la création) &lt;br /&gt;
* Un onglet Agenda (si le module Agenda a été activé)&lt;br /&gt;
* Un onglet Catégories (si le module Catégorie a été activé)&lt;br /&gt;
* Un onglet Correspondants &lt;br /&gt;
* Un ognlet Antécedants/Traitements&lt;br /&gt;
* Un onglet Notes&lt;br /&gt;
* Un onglet Consultations&lt;br /&gt;
* Un onglet Bio&lt;br /&gt;
* Un onglet Exploration&lt;br /&gt;
* Un onglet Courriers/Fichiers&lt;br /&gt;
&lt;br /&gt;
Exemple: Cliquer sur l&#039;image pour l&#039;agrandir&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot patientcard.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Voici un description sur la manière d&#039;utiliser chaque onglet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
To create a patient file, click on the menu &#039;&#039; &#039;&#039; Patient - New Patient &#039;&#039; &#039;&#039;. Once created, a Patient card contains several tabs:&lt;br /&gt;
* A tab with general information (which are those recorded during the creation)&lt;br /&gt;
* A Calendar tab (if the Calendar module has been enabled)&lt;br /&gt;
* A Categories tab (if the Category module has been enabled)&lt;br /&gt;
* A Correspondence tab&lt;br /&gt;
* A history tab / Treatments&lt;br /&gt;
* A Notes tab&lt;br /&gt;
* A consultation tab&lt;br /&gt;
* A Bio tab&lt;br /&gt;
* A exploration tab&lt;br /&gt;
* A Couriers tab / Files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Onglet des informations générales (Tab general information)====&lt;br /&gt;
* Sur la fiche du Patient, il est possible de lui affecter un ou plusieurs utilisateurs (médecins particuliers du cabinet suivant le patient par exemple). Bien que tous soignant puisse voir la fiche du patient d&#039;un autre, ceci est utile pour classifier les patients par soignant principal. Cela est utilisé aussi pour les statistiques.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;translation&#039;&#039;&#039;&lt;br /&gt;
* On the Patient card, it is possible to assign one or more users (individual doctors cabinet following the patient for example). Although all caregivers can see the patient&#039;s chart of another, this is useful to classify patients by primary caregiver. It is also used for statistics.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Correspondans (tab for correspondents) ====&lt;br /&gt;
Sur cet onglet, vous pouvez associer tous les médecins traitant ou connaissant le patient avec leur spécialité.&lt;br /&gt;
&lt;br /&gt;
(On this tab, you can associate all physicians treating the patient with or knowing their specialty.)&lt;br /&gt;
&lt;br /&gt;
==== Onglet Agenda (tab agenda)====&lt;br /&gt;
Cet onglet n&#039;est visible que si le [[Module Agenda]] a été activé. &lt;br /&gt;
Il offre une vue de type calendrier de certains évênements qui ont été enregistrés sur le patient (création de la fiche patient, rendez-vous, saisie d&#039;une consultation).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;translation&#039;&#039;&#039;&lt;br /&gt;
(This tab is only visible if the Calendar module has been activated.)&lt;br /&gt;
(It provides a calendar-type view of certain events that have been recorded on the patient (creation of the patient file, appointments, entering a consultation).)&lt;br /&gt;
&lt;br /&gt;
==== Onglet Catégories (Tab for categories)====&lt;br /&gt;
Cet onglet n&#039;est visible que si le [[Module Catégories]] a été activé.&lt;br /&gt;
&lt;br /&gt;
Il permet de classer un patient dans une ou plusieurs catégories. A vous de décider les catégories que vous créez. Leur création se fair depuis le menu &amp;quot;Patient - Catégorie - Nouvelle catégorie&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;transaltion&#039;&#039;&#039;&lt;br /&gt;
This tab is only visible if the [[Module Categories]] has been activated.&lt;br /&gt;
It classifies a patient in one or more categories. You decide which categories you create. Their creation is fair from the &amp;quot;Patient - Category - New Category&amp;quot; menu.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Antécédents/Traitements (Tab Background / Treatments) ====&lt;br /&gt;
To complete ...&lt;br /&gt;
&lt;br /&gt;
==== Tab Notes ====&lt;br /&gt;
To complete&lt;br /&gt;
&lt;br /&gt;
==== Onglet Documents ====&lt;br /&gt;
* Cette page permet de joindre des pièces jointes (images de scanners, d&#039;échographie, documents words, ...)&lt;br /&gt;
Mais elle permet aussi de générer des documents OpenOffice à partir d&#039;un modèle. Le modèle courrier_consult.odt est fourni en example. &lt;br /&gt;
* Pour générer un document, il faut choisir le modèle, éventuellement la fiche Bio associée puis cliquer sur Générer.&lt;br /&gt;
Le modèle sera utilisé et toutes les balises variables seront remplacées par les infos du patient ou de la consultation.&lt;br /&gt;
* Pour faire son propre modèle de document, voir la page [[Créer un modèle de document ODT]].&lt;br /&gt;
Les balises suivantes sont disponibles en plus de celle standard de Dolibarr:&lt;br /&gt;
{{TagsOdtCabinetMed}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;translation&#039;&#039;&#039;&lt;br /&gt;
* This page allows you to attach attachments (image scanners, ultrasound, papers words ...)&lt;br /&gt;
But it also can generate OpenOffice documents from a model. The model is supplied in courrier_consult.odt example.&lt;br /&gt;
* To generate a document, choose the model, possibly associated Bio page and click Generate.&lt;br /&gt;
The model will be used and all variables tags will be replaced with the patient&#039;s information or consultation.&lt;br /&gt;
* To make your own document model, see the [[Create a template ODT]].&lt;br /&gt;
The following tags are available in addition to the standard Dolibarr:&lt;br /&gt;
{{TagsOdtCabinetMed}}&lt;br /&gt;
&lt;br /&gt;
== Menu Bilan consultations ==&lt;br /&gt;
Choisir le menu Bilan consultations fait apparaitre un tableau affichant pour les 3 dernières années, les revenus avec le détail par mois.&lt;br /&gt;
En cliquant sur un mois, cela déroule le détail sur chaque jour du mois.&lt;br /&gt;
Il est aussi possible depuis cet écran d&#039;exporter le détail dans un fichier Excel.&lt;br /&gt;
&lt;br /&gt;
Copie d&#039;écran exemple (cliquez sur l&#039;image pour agrandir):&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot report.png|200px]]&lt;br /&gt;
&lt;br /&gt;
= Développement =&lt;br /&gt;
{{TemplateModNLTechnoEn}}&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Medical_Center&amp;diff=33910</id>
		<title>Module Medical Center</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Medical_Center&amp;diff=33910"/>
		<updated>2015-06-07T08:03:17Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Onglet Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:CabinetMed]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=Medical Center&lt;br /&gt;
|editor=NLTechno&lt;br /&gt;
|web=[http://www.nltechno.com www.nltechno.com]&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=medical}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=&lt;br /&gt;
|minversion=3.5.3&lt;br /&gt;
|note=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
Can turn your Dolibarr into a medical office manager (dictionaries of pathology, patient management, history, directory of referents doctors, following consultations, examinations/radios, generation of consultation documents, statistics of your consultations, monitoring money input, check receipts, etc ...). &lt;br /&gt;
&lt;br /&gt;
How to use module is described a little later.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
{{InstallModuleDoliStoreEn}}&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
{{ActivationModuleEn}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setup page specific to module:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Into setup page dedicated to module, you can also define:&lt;br /&gt;
* Feature related to rhumatology.&lt;br /&gt;
* Enable or not standard menu  Thirdparies of yo have to manage thirdparies that are not patient.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Other options:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Into menu &#039;Home - Setup - Other&#039;, you can also add constant &amp;quot;&#039;&#039;&#039;CABINETMED_DELAY_TO_LOCK_RECORD&#039;&#039;&#039;&amp;quot; to a number of day. This means all consultation recorded could not be modified 2 days Iafter they were recorded.&lt;br /&gt;
&lt;br /&gt;
By default, professional ID fields are not visible when you are on a patient card. You can however decide to make them visible by adding the constant &#039;&#039;&#039;CABINETMED_SHOW_PROFIDx&#039;&#039;&#039; to 1 (where x is a number between 1 and 6 to define which professional ID you want to see. Add several constants, if you need several professional ID).&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
Activating this module will add the following new top menu entries:&lt;br /&gt;
* Patients&lt;br /&gt;
* Contacts (the other doctors)&lt;br /&gt;
* Consultation summary (show entry/output for a year, month or day of revenus)&lt;br /&gt;
&lt;br /&gt;
== Users ==&lt;br /&gt;
Quand le module est activé, un utilisateur Dolibarr est en fait un membre du personnel soigant (médecin, infirmière, sage-femme, kiné, ou encore secrétaire...), et donc u nutilisateur faisant partie du cabinet amené à consulter ou saisir dans Dolibarr. Il peut n&#039;y avoir qu&#039;un seul utilisateur dans le cas d&#039;un médecin ou soignant exerçant seul. Un utilisateur peut aussi être une personne du secrétariat téléphonique du cabinet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
When the module is activated, a Dolibarr user is actually a member of staff soigant (doctor, nurse, midwife, physiotherapist, or secretary ...), and therefore u nutilisateur part of the firm brought in to consult or enter Dolibarr. There may be only one user in the case of a sole practitioner physician or caregiver. A user can also be a person answering service firm.&lt;br /&gt;
&lt;br /&gt;
== Care givers contacts ==&lt;br /&gt;
{{ToTranslate}}&lt;br /&gt;
Les Correspondants sont les autres soignants ou médecins s&#039;occupant ou s&#039;étant occupé du Patient.&lt;br /&gt;
Choisir le menu &amp;quot;&#039;&#039;&#039;Correspondants&#039;&#039;&#039;&amp;quot; fait apparaitre un sous-menu gauche offrant les fonctions pour créer, ou ajouter un nouveau Correspondant.&lt;br /&gt;
* Pour créer un correspondant, il suffit de cliquer sur l&#039;entrée &amp;quot;Nouveau correspondant&amp;quot; et de saisir les informations sur la fiche vierge puis Enregistrer.&lt;br /&gt;
* Lorsqu&#039;on a choisi l&#039;entrée du menu &amp;quot;Liste des correspondants&amp;quot;, on voie la liste de tous les correspondants enregistrés. Si on clique sur le nom de l&#039;un d&#039;eux, sa fiche s&#039;ouvre. Et il est possible de la modifier.&lt;br /&gt;
* Il est possible de rappeler la fiche d&#039;un Correspondant rapidement en saisissant une partie de son nom dans la zone de recherche rapide sur le bandeau de gauche.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
Correspondents are other caregivers or doctors attending or being occupied Patient. Select the menu &amp;quot;Correspondents&amp;quot; brings up a submenu with the left functions to create, or add a new correspondent.&lt;br /&gt;
* To create a contact, just click on the entry &amp;quot;New correspondent&amp;quot; and enter information on the blank page and select Save.&lt;br /&gt;
* When selected the menu entry &amp;quot;List all&amp;quot;, it means the list of all registered correspondents. If you click on the name of one of them, its card opens. And it is possible to change it.&lt;br /&gt;
* It is possible to recall a detail Corresponding quickly by typing part of its name in the quick search box on the left panel.&lt;br /&gt;
&lt;br /&gt;
== Patients ==&lt;br /&gt;
Select the top menu &amp;quot;&#039;&#039; &#039;&#039;&#039; Patients&amp;quot;, brings up an offering functions to create a new patient list patients or past consultations submenu. &lt;br /&gt;
&lt;br /&gt;
* To create a new patient, simply click on the &amp;quot;New Patient&amp;quot; entry and enter the information on the blank sheet and then Save. &lt;br /&gt;
* When you have selected the menu entry &amp;quot;Patient List&amp;quot; is the track list of all registered patients. If you click on the name of one of them, his record opens. And it is possible to change it. &lt;br /&gt;
* It is also possible to recall the record of a patient quickly by typing part of its name in the quick search box on the left banner.&lt;br /&gt;
&lt;br /&gt;
=== Fiches Patient et consultations (Patient records and consultations)===&lt;br /&gt;
Pour créer une fiche patient, cliquer sur le menu &amp;quot;&#039;&#039;&#039;Patient - Nouveau Patient&#039;&#039;&#039;&amp;quot;. Une fois créée, une fiche Patient contient plusieurs onglets:&lt;br /&gt;
* Un onglet avec les informations générales (qui sont celles enregistrés lors de la création) &lt;br /&gt;
* Un onglet Agenda (si le module Agenda a été activé)&lt;br /&gt;
* Un onglet Catégories (si le module Catégorie a été activé)&lt;br /&gt;
* Un onglet Correspondants &lt;br /&gt;
* Un ognlet Antécedants/Traitements&lt;br /&gt;
* Un onglet Notes&lt;br /&gt;
* Un onglet Consultations&lt;br /&gt;
* Un onglet Bio&lt;br /&gt;
* Un onglet Exploration&lt;br /&gt;
* Un onglet Courriers/Fichiers&lt;br /&gt;
&lt;br /&gt;
Exemple: Cliquer sur l&#039;image pour l&#039;agrandir&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot patientcard.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Voici un description sur la manière d&#039;utiliser chaque onglet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
To create a patient file, click on the menu &#039;&#039; &#039;&#039; Patient - New Patient &#039;&#039; &#039;&#039;. Once created, a Patient card contains several tabs:&lt;br /&gt;
* A tab with general information (which are those recorded during the creation)&lt;br /&gt;
* A Calendar tab (if the Calendar module has been enabled)&lt;br /&gt;
* A Categories tab (if the Category module has been enabled)&lt;br /&gt;
* A Correspondence tab&lt;br /&gt;
* A history tab / Treatments&lt;br /&gt;
* A Notes tab&lt;br /&gt;
* A consultation tab&lt;br /&gt;
* A Bio tab&lt;br /&gt;
* A exploration tab&lt;br /&gt;
* A Couriers tab / Files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Onglet des informations générales (Tab general information)====&lt;br /&gt;
* Sur la fiche du Patient, il est possible de lui affecter un ou plusieurs utilisateurs (médecins particuliers du cabinet suivant le patient par exemple). Bien que tous soignant puisse voir la fiche du patient d&#039;un autre, ceci est utile pour classifier les patients par soignant principal. Cela est utilisé aussi pour les statistiques.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;translation&#039;&#039;&#039;&lt;br /&gt;
* On the Patient card, it is possible to assign one or more users (individual doctors cabinet following the patient for example). Although all caregivers can see the patient&#039;s chart of another, this is useful to classify patients by primary caregiver. It is also used for statistics.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Correspondans (tab for correspondents) ====&lt;br /&gt;
Sur cet onglet, vous pouvez associer tous les médecins traitant ou connaissant le patient avec leur spécialité.&lt;br /&gt;
&lt;br /&gt;
(On this tab, you can associate all physicians treating the patient with or knowing their specialty.)&lt;br /&gt;
&lt;br /&gt;
==== Onglet Agenda (tab agenda)====&lt;br /&gt;
Cet onglet n&#039;est visible que si le [[Module Agenda]] a été activé. &lt;br /&gt;
Il offre une vue de type calendrier de certains évênements qui ont été enregistrés sur le patient (création de la fiche patient, rendez-vous, saisie d&#039;une consultation).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;translation&#039;&#039;&#039;&lt;br /&gt;
(This tab is only visible if the Calendar module has been activated.)&lt;br /&gt;
(It provides a calendar-type view of certain events that have been recorded on the patient (creation of the patient file, appointments, entering a consultation).)&lt;br /&gt;
&lt;br /&gt;
==== Onglet Catégories (Tab for categories)====&lt;br /&gt;
Cet onglet n&#039;est visible que si le [[Module Catégories]] a été activé.&lt;br /&gt;
&lt;br /&gt;
Il permet de classer un patient dans une ou plusieurs catégories. A vous de décider les catégories que vous créez. Leur création se fair depuis le menu &amp;quot;Patient - Catégorie - Nouvelle catégorie&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;transaltion&#039;&#039;&#039;&lt;br /&gt;
This tab is only visible if the [[Module Categories]] has been activated.&lt;br /&gt;
It classifies a patient in one or more categories. You decide which categories you create. Their creation is fair from the &amp;quot;Patient - Category - New Category&amp;quot; menu.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Antécédents/Traitements (Tab Background / Treatments) ====&lt;br /&gt;
To complete ...&lt;br /&gt;
&lt;br /&gt;
==== Tab Notes ====&lt;br /&gt;
To complete&lt;br /&gt;
&lt;br /&gt;
==== Onglet Documents ====&lt;br /&gt;
* Cette page permet de joindre des pièces jointes (images de scanners, d&#039;échographie, documents words, ...)&lt;br /&gt;
Mais elle permet aussi de générer des documents OpenOffice à partir d&#039;un modèle. Le modèle courrier_consult.odt est fourni en example. &lt;br /&gt;
* Pour générer un document, il faut choisir le modèle, éventuellement la fiche Bio associée puis cliquer sur Générer.&lt;br /&gt;
Le modèle sera utilisé et toutes les balises variables seront remplacées par les infos du patient ou de la consultation.&lt;br /&gt;
* Pour faire son propre modèle de document, voir la page [[Créer un modèle de document ODT]].&lt;br /&gt;
Les balises suivantes sont disponibles en plus de celle standard de Dolibarr:&lt;br /&gt;
{{TagsOdtCabinetMed}}&lt;br /&gt;
&lt;br /&gt;
== Menu Bilan consultations ==&lt;br /&gt;
Choisir le menu Bilan consultations fait apparaitre un tableau affichant pour les 3 dernières années, les revenus avec le détail par mois.&lt;br /&gt;
En cliquant sur un mois, cela déroule le détail sur chaque jour du mois.&lt;br /&gt;
Il est aussi possible depuis cet écran d&#039;exporter le détail dans un fichier Excel.&lt;br /&gt;
&lt;br /&gt;
Copie d&#039;écran exemple (cliquez sur l&#039;image pour agrandir):&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot report.png|200px]]&lt;br /&gt;
&lt;br /&gt;
= Développement =&lt;br /&gt;
{{TemplateModNLTechnoEn}}&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Medical_Center&amp;diff=33909</id>
		<title>Module Medical Center</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Medical_Center&amp;diff=33909"/>
		<updated>2015-06-07T08:02:42Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Onglet Antécédents/Traitements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:CabinetMed]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=Medical Center&lt;br /&gt;
|editor=NLTechno&lt;br /&gt;
|web=[http://www.nltechno.com www.nltechno.com]&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=medical}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=&lt;br /&gt;
|minversion=3.5.3&lt;br /&gt;
|note=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
Can turn your Dolibarr into a medical office manager (dictionaries of pathology, patient management, history, directory of referents doctors, following consultations, examinations/radios, generation of consultation documents, statistics of your consultations, monitoring money input, check receipts, etc ...). &lt;br /&gt;
&lt;br /&gt;
How to use module is described a little later.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
{{InstallModuleDoliStoreEn}}&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
{{ActivationModuleEn}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setup page specific to module:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Into setup page dedicated to module, you can also define:&lt;br /&gt;
* Feature related to rhumatology.&lt;br /&gt;
* Enable or not standard menu  Thirdparies of yo have to manage thirdparies that are not patient.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Other options:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Into menu &#039;Home - Setup - Other&#039;, you can also add constant &amp;quot;&#039;&#039;&#039;CABINETMED_DELAY_TO_LOCK_RECORD&#039;&#039;&#039;&amp;quot; to a number of day. This means all consultation recorded could not be modified 2 days Iafter they were recorded.&lt;br /&gt;
&lt;br /&gt;
By default, professional ID fields are not visible when you are on a patient card. You can however decide to make them visible by adding the constant &#039;&#039;&#039;CABINETMED_SHOW_PROFIDx&#039;&#039;&#039; to 1 (where x is a number between 1 and 6 to define which professional ID you want to see. Add several constants, if you need several professional ID).&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
Activating this module will add the following new top menu entries:&lt;br /&gt;
* Patients&lt;br /&gt;
* Contacts (the other doctors)&lt;br /&gt;
* Consultation summary (show entry/output for a year, month or day of revenus)&lt;br /&gt;
&lt;br /&gt;
== Users ==&lt;br /&gt;
Quand le module est activé, un utilisateur Dolibarr est en fait un membre du personnel soigant (médecin, infirmière, sage-femme, kiné, ou encore secrétaire...), et donc u nutilisateur faisant partie du cabinet amené à consulter ou saisir dans Dolibarr. Il peut n&#039;y avoir qu&#039;un seul utilisateur dans le cas d&#039;un médecin ou soignant exerçant seul. Un utilisateur peut aussi être une personne du secrétariat téléphonique du cabinet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
When the module is activated, a Dolibarr user is actually a member of staff soigant (doctor, nurse, midwife, physiotherapist, or secretary ...), and therefore u nutilisateur part of the firm brought in to consult or enter Dolibarr. There may be only one user in the case of a sole practitioner physician or caregiver. A user can also be a person answering service firm.&lt;br /&gt;
&lt;br /&gt;
== Care givers contacts ==&lt;br /&gt;
{{ToTranslate}}&lt;br /&gt;
Les Correspondants sont les autres soignants ou médecins s&#039;occupant ou s&#039;étant occupé du Patient.&lt;br /&gt;
Choisir le menu &amp;quot;&#039;&#039;&#039;Correspondants&#039;&#039;&#039;&amp;quot; fait apparaitre un sous-menu gauche offrant les fonctions pour créer, ou ajouter un nouveau Correspondant.&lt;br /&gt;
* Pour créer un correspondant, il suffit de cliquer sur l&#039;entrée &amp;quot;Nouveau correspondant&amp;quot; et de saisir les informations sur la fiche vierge puis Enregistrer.&lt;br /&gt;
* Lorsqu&#039;on a choisi l&#039;entrée du menu &amp;quot;Liste des correspondants&amp;quot;, on voie la liste de tous les correspondants enregistrés. Si on clique sur le nom de l&#039;un d&#039;eux, sa fiche s&#039;ouvre. Et il est possible de la modifier.&lt;br /&gt;
* Il est possible de rappeler la fiche d&#039;un Correspondant rapidement en saisissant une partie de son nom dans la zone de recherche rapide sur le bandeau de gauche.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
Correspondents are other caregivers or doctors attending or being occupied Patient. Select the menu &amp;quot;Correspondents&amp;quot; brings up a submenu with the left functions to create, or add a new correspondent.&lt;br /&gt;
* To create a contact, just click on the entry &amp;quot;New correspondent&amp;quot; and enter information on the blank page and select Save.&lt;br /&gt;
* When selected the menu entry &amp;quot;List all&amp;quot;, it means the list of all registered correspondents. If you click on the name of one of them, its card opens. And it is possible to change it.&lt;br /&gt;
* It is possible to recall a detail Corresponding quickly by typing part of its name in the quick search box on the left panel.&lt;br /&gt;
&lt;br /&gt;
== Patients ==&lt;br /&gt;
Select the top menu &amp;quot;&#039;&#039; &#039;&#039;&#039; Patients&amp;quot;, brings up an offering functions to create a new patient list patients or past consultations submenu. &lt;br /&gt;
&lt;br /&gt;
* To create a new patient, simply click on the &amp;quot;New Patient&amp;quot; entry and enter the information on the blank sheet and then Save. &lt;br /&gt;
* When you have selected the menu entry &amp;quot;Patient List&amp;quot; is the track list of all registered patients. If you click on the name of one of them, his record opens. And it is possible to change it. &lt;br /&gt;
* It is also possible to recall the record of a patient quickly by typing part of its name in the quick search box on the left banner.&lt;br /&gt;
&lt;br /&gt;
=== Fiches Patient et consultations (Patient records and consultations)===&lt;br /&gt;
Pour créer une fiche patient, cliquer sur le menu &amp;quot;&#039;&#039;&#039;Patient - Nouveau Patient&#039;&#039;&#039;&amp;quot;. Une fois créée, une fiche Patient contient plusieurs onglets:&lt;br /&gt;
* Un onglet avec les informations générales (qui sont celles enregistrés lors de la création) &lt;br /&gt;
* Un onglet Agenda (si le module Agenda a été activé)&lt;br /&gt;
* Un onglet Catégories (si le module Catégorie a été activé)&lt;br /&gt;
* Un onglet Correspondants &lt;br /&gt;
* Un ognlet Antécedants/Traitements&lt;br /&gt;
* Un onglet Notes&lt;br /&gt;
* Un onglet Consultations&lt;br /&gt;
* Un onglet Bio&lt;br /&gt;
* Un onglet Exploration&lt;br /&gt;
* Un onglet Courriers/Fichiers&lt;br /&gt;
&lt;br /&gt;
Exemple: Cliquer sur l&#039;image pour l&#039;agrandir&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot patientcard.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Voici un description sur la manière d&#039;utiliser chaque onglet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
To create a patient file, click on the menu &#039;&#039; &#039;&#039; Patient - New Patient &#039;&#039; &#039;&#039;. Once created, a Patient card contains several tabs:&lt;br /&gt;
* A tab with general information (which are those recorded during the creation)&lt;br /&gt;
* A Calendar tab (if the Calendar module has been enabled)&lt;br /&gt;
* A Categories tab (if the Category module has been enabled)&lt;br /&gt;
* A Correspondence tab&lt;br /&gt;
* A history tab / Treatments&lt;br /&gt;
* A Notes tab&lt;br /&gt;
* A consultation tab&lt;br /&gt;
* A Bio tab&lt;br /&gt;
* A exploration tab&lt;br /&gt;
* A Couriers tab / Files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Onglet des informations générales (Tab general information)====&lt;br /&gt;
* Sur la fiche du Patient, il est possible de lui affecter un ou plusieurs utilisateurs (médecins particuliers du cabinet suivant le patient par exemple). Bien que tous soignant puisse voir la fiche du patient d&#039;un autre, ceci est utile pour classifier les patients par soignant principal. Cela est utilisé aussi pour les statistiques.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;translation&#039;&#039;&#039;&lt;br /&gt;
* On the Patient card, it is possible to assign one or more users (individual doctors cabinet following the patient for example). Although all caregivers can see the patient&#039;s chart of another, this is useful to classify patients by primary caregiver. It is also used for statistics.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Correspondans (tab for correspondents) ====&lt;br /&gt;
Sur cet onglet, vous pouvez associer tous les médecins traitant ou connaissant le patient avec leur spécialité.&lt;br /&gt;
&lt;br /&gt;
(On this tab, you can associate all physicians treating the patient with or knowing their specialty.)&lt;br /&gt;
&lt;br /&gt;
==== Onglet Agenda (tab agenda)====&lt;br /&gt;
Cet onglet n&#039;est visible que si le [[Module Agenda]] a été activé. &lt;br /&gt;
Il offre une vue de type calendrier de certains évênements qui ont été enregistrés sur le patient (création de la fiche patient, rendez-vous, saisie d&#039;une consultation).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;translation&#039;&#039;&#039;&lt;br /&gt;
(This tab is only visible if the Calendar module has been activated.)&lt;br /&gt;
(It provides a calendar-type view of certain events that have been recorded on the patient (creation of the patient file, appointments, entering a consultation).)&lt;br /&gt;
&lt;br /&gt;
==== Onglet Catégories (Tab for categories)====&lt;br /&gt;
Cet onglet n&#039;est visible que si le [[Module Catégories]] a été activé.&lt;br /&gt;
&lt;br /&gt;
Il permet de classer un patient dans une ou plusieurs catégories. A vous de décider les catégories que vous créez. Leur création se fair depuis le menu &amp;quot;Patient - Catégorie - Nouvelle catégorie&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;transaltion&#039;&#039;&#039;&lt;br /&gt;
This tab is only visible if the [[Module Categories]] has been activated.&lt;br /&gt;
It classifies a patient in one or more categories. You decide which categories you create. Their creation is fair from the &amp;quot;Patient - Category - New Category&amp;quot; menu.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Antécédents/Traitements (Tab Background / Treatments) ====&lt;br /&gt;
To complete ...&lt;br /&gt;
&lt;br /&gt;
==== Onglet Notes ====&lt;br /&gt;
A compléter &lt;br /&gt;
&lt;br /&gt;
==== Onglet Documents ====&lt;br /&gt;
* Cette page permet de joindre des pièces jointes (images de scanners, d&#039;échographie, documents words, ...)&lt;br /&gt;
Mais elle permet aussi de générer des documents OpenOffice à partir d&#039;un modèle. Le modèle courrier_consult.odt est fourni en example. &lt;br /&gt;
* Pour générer un document, il faut choisir le modèle, éventuellement la fiche Bio associée puis cliquer sur Générer.&lt;br /&gt;
Le modèle sera utilisé et toutes les balises variables seront remplacées par les infos du patient ou de la consultation.&lt;br /&gt;
* Pour faire son propre modèle de document, voir la page [[Créer un modèle de document ODT]].&lt;br /&gt;
Les balises suivantes sont disponibles en plus de celle standard de Dolibarr:&lt;br /&gt;
{{TagsOdtCabinetMed}}&lt;br /&gt;
&lt;br /&gt;
== Menu Bilan consultations ==&lt;br /&gt;
Choisir le menu Bilan consultations fait apparaitre un tableau affichant pour les 3 dernières années, les revenus avec le détail par mois.&lt;br /&gt;
En cliquant sur un mois, cela déroule le détail sur chaque jour du mois.&lt;br /&gt;
Il est aussi possible depuis cet écran d&#039;exporter le détail dans un fichier Excel.&lt;br /&gt;
&lt;br /&gt;
Copie d&#039;écran exemple (cliquez sur l&#039;image pour agrandir):&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot report.png|200px]]&lt;br /&gt;
&lt;br /&gt;
= Développement =&lt;br /&gt;
{{TemplateModNLTechnoEn}}&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Medical_Center&amp;diff=33908</id>
		<title>Module Medical Center</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Medical_Center&amp;diff=33908"/>
		<updated>2015-06-07T08:01:03Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Onglet des informations générales (Tab general information) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:CabinetMed]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=Medical Center&lt;br /&gt;
|editor=NLTechno&lt;br /&gt;
|web=[http://www.nltechno.com www.nltechno.com]&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=medical}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=&lt;br /&gt;
|minversion=3.5.3&lt;br /&gt;
|note=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
Can turn your Dolibarr into a medical office manager (dictionaries of pathology, patient management, history, directory of referents doctors, following consultations, examinations/radios, generation of consultation documents, statistics of your consultations, monitoring money input, check receipts, etc ...). &lt;br /&gt;
&lt;br /&gt;
How to use module is described a little later.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
{{InstallModuleDoliStoreEn}}&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
{{ActivationModuleEn}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setup page specific to module:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Into setup page dedicated to module, you can also define:&lt;br /&gt;
* Feature related to rhumatology.&lt;br /&gt;
* Enable or not standard menu  Thirdparies of yo have to manage thirdparies that are not patient.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Other options:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Into menu &#039;Home - Setup - Other&#039;, you can also add constant &amp;quot;&#039;&#039;&#039;CABINETMED_DELAY_TO_LOCK_RECORD&#039;&#039;&#039;&amp;quot; to a number of day. This means all consultation recorded could not be modified 2 days Iafter they were recorded.&lt;br /&gt;
&lt;br /&gt;
By default, professional ID fields are not visible when you are on a patient card. You can however decide to make them visible by adding the constant &#039;&#039;&#039;CABINETMED_SHOW_PROFIDx&#039;&#039;&#039; to 1 (where x is a number between 1 and 6 to define which professional ID you want to see. Add several constants, if you need several professional ID).&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
Activating this module will add the following new top menu entries:&lt;br /&gt;
* Patients&lt;br /&gt;
* Contacts (the other doctors)&lt;br /&gt;
* Consultation summary (show entry/output for a year, month or day of revenus)&lt;br /&gt;
&lt;br /&gt;
== Users ==&lt;br /&gt;
Quand le module est activé, un utilisateur Dolibarr est en fait un membre du personnel soigant (médecin, infirmière, sage-femme, kiné, ou encore secrétaire...), et donc u nutilisateur faisant partie du cabinet amené à consulter ou saisir dans Dolibarr. Il peut n&#039;y avoir qu&#039;un seul utilisateur dans le cas d&#039;un médecin ou soignant exerçant seul. Un utilisateur peut aussi être une personne du secrétariat téléphonique du cabinet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
When the module is activated, a Dolibarr user is actually a member of staff soigant (doctor, nurse, midwife, physiotherapist, or secretary ...), and therefore u nutilisateur part of the firm brought in to consult or enter Dolibarr. There may be only one user in the case of a sole practitioner physician or caregiver. A user can also be a person answering service firm.&lt;br /&gt;
&lt;br /&gt;
== Care givers contacts ==&lt;br /&gt;
{{ToTranslate}}&lt;br /&gt;
Les Correspondants sont les autres soignants ou médecins s&#039;occupant ou s&#039;étant occupé du Patient.&lt;br /&gt;
Choisir le menu &amp;quot;&#039;&#039;&#039;Correspondants&#039;&#039;&#039;&amp;quot; fait apparaitre un sous-menu gauche offrant les fonctions pour créer, ou ajouter un nouveau Correspondant.&lt;br /&gt;
* Pour créer un correspondant, il suffit de cliquer sur l&#039;entrée &amp;quot;Nouveau correspondant&amp;quot; et de saisir les informations sur la fiche vierge puis Enregistrer.&lt;br /&gt;
* Lorsqu&#039;on a choisi l&#039;entrée du menu &amp;quot;Liste des correspondants&amp;quot;, on voie la liste de tous les correspondants enregistrés. Si on clique sur le nom de l&#039;un d&#039;eux, sa fiche s&#039;ouvre. Et il est possible de la modifier.&lt;br /&gt;
* Il est possible de rappeler la fiche d&#039;un Correspondant rapidement en saisissant une partie de son nom dans la zone de recherche rapide sur le bandeau de gauche.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
Correspondents are other caregivers or doctors attending or being occupied Patient. Select the menu &amp;quot;Correspondents&amp;quot; brings up a submenu with the left functions to create, or add a new correspondent.&lt;br /&gt;
* To create a contact, just click on the entry &amp;quot;New correspondent&amp;quot; and enter information on the blank page and select Save.&lt;br /&gt;
* When selected the menu entry &amp;quot;List all&amp;quot;, it means the list of all registered correspondents. If you click on the name of one of them, its card opens. And it is possible to change it.&lt;br /&gt;
* It is possible to recall a detail Corresponding quickly by typing part of its name in the quick search box on the left panel.&lt;br /&gt;
&lt;br /&gt;
== Patients ==&lt;br /&gt;
Select the top menu &amp;quot;&#039;&#039; &#039;&#039;&#039; Patients&amp;quot;, brings up an offering functions to create a new patient list patients or past consultations submenu. &lt;br /&gt;
&lt;br /&gt;
* To create a new patient, simply click on the &amp;quot;New Patient&amp;quot; entry and enter the information on the blank sheet and then Save. &lt;br /&gt;
* When you have selected the menu entry &amp;quot;Patient List&amp;quot; is the track list of all registered patients. If you click on the name of one of them, his record opens. And it is possible to change it. &lt;br /&gt;
* It is also possible to recall the record of a patient quickly by typing part of its name in the quick search box on the left banner.&lt;br /&gt;
&lt;br /&gt;
=== Fiches Patient et consultations (Patient records and consultations)===&lt;br /&gt;
Pour créer une fiche patient, cliquer sur le menu &amp;quot;&#039;&#039;&#039;Patient - Nouveau Patient&#039;&#039;&#039;&amp;quot;. Une fois créée, une fiche Patient contient plusieurs onglets:&lt;br /&gt;
* Un onglet avec les informations générales (qui sont celles enregistrés lors de la création) &lt;br /&gt;
* Un onglet Agenda (si le module Agenda a été activé)&lt;br /&gt;
* Un onglet Catégories (si le module Catégorie a été activé)&lt;br /&gt;
* Un onglet Correspondants &lt;br /&gt;
* Un ognlet Antécedants/Traitements&lt;br /&gt;
* Un onglet Notes&lt;br /&gt;
* Un onglet Consultations&lt;br /&gt;
* Un onglet Bio&lt;br /&gt;
* Un onglet Exploration&lt;br /&gt;
* Un onglet Courriers/Fichiers&lt;br /&gt;
&lt;br /&gt;
Exemple: Cliquer sur l&#039;image pour l&#039;agrandir&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot patientcard.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Voici un description sur la manière d&#039;utiliser chaque onglet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
To create a patient file, click on the menu &#039;&#039; &#039;&#039; Patient - New Patient &#039;&#039; &#039;&#039;. Once created, a Patient card contains several tabs:&lt;br /&gt;
* A tab with general information (which are those recorded during the creation)&lt;br /&gt;
* A Calendar tab (if the Calendar module has been enabled)&lt;br /&gt;
* A Categories tab (if the Category module has been enabled)&lt;br /&gt;
* A Correspondence tab&lt;br /&gt;
* A history tab / Treatments&lt;br /&gt;
* A Notes tab&lt;br /&gt;
* A consultation tab&lt;br /&gt;
* A Bio tab&lt;br /&gt;
* A exploration tab&lt;br /&gt;
* A Couriers tab / Files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Onglet des informations générales (Tab general information)====&lt;br /&gt;
* Sur la fiche du Patient, il est possible de lui affecter un ou plusieurs utilisateurs (médecins particuliers du cabinet suivant le patient par exemple). Bien que tous soignant puisse voir la fiche du patient d&#039;un autre, ceci est utile pour classifier les patients par soignant principal. Cela est utilisé aussi pour les statistiques.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;translation&#039;&#039;&#039;&lt;br /&gt;
* On the Patient card, it is possible to assign one or more users (individual doctors cabinet following the patient for example). Although all caregivers can see the patient&#039;s chart of another, this is useful to classify patients by primary caregiver. It is also used for statistics.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Correspondans (tab for correspondents) ====&lt;br /&gt;
Sur cet onglet, vous pouvez associer tous les médecins traitant ou connaissant le patient avec leur spécialité.&lt;br /&gt;
&lt;br /&gt;
(On this tab, you can associate all physicians treating the patient with or knowing their specialty.)&lt;br /&gt;
&lt;br /&gt;
==== Onglet Agenda (tab agenda)====&lt;br /&gt;
Cet onglet n&#039;est visible que si le [[Module Agenda]] a été activé. &lt;br /&gt;
Il offre une vue de type calendrier de certains évênements qui ont été enregistrés sur le patient (création de la fiche patient, rendez-vous, saisie d&#039;une consultation).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;translation&#039;&#039;&#039;&lt;br /&gt;
(This tab is only visible if the Calendar module has been activated.)&lt;br /&gt;
(It provides a calendar-type view of certain events that have been recorded on the patient (creation of the patient file, appointments, entering a consultation).)&lt;br /&gt;
&lt;br /&gt;
==== Onglet Catégories (Tab for categories)====&lt;br /&gt;
Cet onglet n&#039;est visible que si le [[Module Catégories]] a été activé.&lt;br /&gt;
&lt;br /&gt;
Il permet de classer un patient dans une ou plusieurs catégories. A vous de décider les catégories que vous créez. Leur création se fair depuis le menu &amp;quot;Patient - Catégorie - Nouvelle catégorie&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;transaltion&#039;&#039;&#039;&lt;br /&gt;
This tab is only visible if the [[Module Categories]] has been activated.&lt;br /&gt;
It classifies a patient in one or more categories. You decide which categories you create. Their creation is fair from the &amp;quot;Patient - Category - New Category&amp;quot; menu.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Antécédents/Traitements ====&lt;br /&gt;
A compléter &lt;br /&gt;
&lt;br /&gt;
==== Onglet Notes ====&lt;br /&gt;
A compléter &lt;br /&gt;
&lt;br /&gt;
==== Onglet Documents ====&lt;br /&gt;
* Cette page permet de joindre des pièces jointes (images de scanners, d&#039;échographie, documents words, ...)&lt;br /&gt;
Mais elle permet aussi de générer des documents OpenOffice à partir d&#039;un modèle. Le modèle courrier_consult.odt est fourni en example. &lt;br /&gt;
* Pour générer un document, il faut choisir le modèle, éventuellement la fiche Bio associée puis cliquer sur Générer.&lt;br /&gt;
Le modèle sera utilisé et toutes les balises variables seront remplacées par les infos du patient ou de la consultation.&lt;br /&gt;
* Pour faire son propre modèle de document, voir la page [[Créer un modèle de document ODT]].&lt;br /&gt;
Les balises suivantes sont disponibles en plus de celle standard de Dolibarr:&lt;br /&gt;
{{TagsOdtCabinetMed}}&lt;br /&gt;
&lt;br /&gt;
== Menu Bilan consultations ==&lt;br /&gt;
Choisir le menu Bilan consultations fait apparaitre un tableau affichant pour les 3 dernières années, les revenus avec le détail par mois.&lt;br /&gt;
En cliquant sur un mois, cela déroule le détail sur chaque jour du mois.&lt;br /&gt;
Il est aussi possible depuis cet écran d&#039;exporter le détail dans un fichier Excel.&lt;br /&gt;
&lt;br /&gt;
Copie d&#039;écran exemple (cliquez sur l&#039;image pour agrandir):&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot report.png|200px]]&lt;br /&gt;
&lt;br /&gt;
= Développement =&lt;br /&gt;
{{TemplateModNLTechnoEn}}&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Medical_Center&amp;diff=33907</id>
		<title>Module Medical Center</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Medical_Center&amp;diff=33907"/>
		<updated>2015-06-07T07:59:59Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Onglet Agenda */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:CabinetMed]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=Medical Center&lt;br /&gt;
|editor=NLTechno&lt;br /&gt;
|web=[http://www.nltechno.com www.nltechno.com]&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=medical}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=&lt;br /&gt;
|minversion=3.5.3&lt;br /&gt;
|note=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
Can turn your Dolibarr into a medical office manager (dictionaries of pathology, patient management, history, directory of referents doctors, following consultations, examinations/radios, generation of consultation documents, statistics of your consultations, monitoring money input, check receipts, etc ...). &lt;br /&gt;
&lt;br /&gt;
How to use module is described a little later.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
{{InstallModuleDoliStoreEn}}&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
{{ActivationModuleEn}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setup page specific to module:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Into setup page dedicated to module, you can also define:&lt;br /&gt;
* Feature related to rhumatology.&lt;br /&gt;
* Enable or not standard menu  Thirdparies of yo have to manage thirdparies that are not patient.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Other options:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Into menu &#039;Home - Setup - Other&#039;, you can also add constant &amp;quot;&#039;&#039;&#039;CABINETMED_DELAY_TO_LOCK_RECORD&#039;&#039;&#039;&amp;quot; to a number of day. This means all consultation recorded could not be modified 2 days Iafter they were recorded.&lt;br /&gt;
&lt;br /&gt;
By default, professional ID fields are not visible when you are on a patient card. You can however decide to make them visible by adding the constant &#039;&#039;&#039;CABINETMED_SHOW_PROFIDx&#039;&#039;&#039; to 1 (where x is a number between 1 and 6 to define which professional ID you want to see. Add several constants, if you need several professional ID).&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
Activating this module will add the following new top menu entries:&lt;br /&gt;
* Patients&lt;br /&gt;
* Contacts (the other doctors)&lt;br /&gt;
* Consultation summary (show entry/output for a year, month or day of revenus)&lt;br /&gt;
&lt;br /&gt;
== Users ==&lt;br /&gt;
Quand le module est activé, un utilisateur Dolibarr est en fait un membre du personnel soigant (médecin, infirmière, sage-femme, kiné, ou encore secrétaire...), et donc u nutilisateur faisant partie du cabinet amené à consulter ou saisir dans Dolibarr. Il peut n&#039;y avoir qu&#039;un seul utilisateur dans le cas d&#039;un médecin ou soignant exerçant seul. Un utilisateur peut aussi être une personne du secrétariat téléphonique du cabinet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
When the module is activated, a Dolibarr user is actually a member of staff soigant (doctor, nurse, midwife, physiotherapist, or secretary ...), and therefore u nutilisateur part of the firm brought in to consult or enter Dolibarr. There may be only one user in the case of a sole practitioner physician or caregiver. A user can also be a person answering service firm.&lt;br /&gt;
&lt;br /&gt;
== Care givers contacts ==&lt;br /&gt;
{{ToTranslate}}&lt;br /&gt;
Les Correspondants sont les autres soignants ou médecins s&#039;occupant ou s&#039;étant occupé du Patient.&lt;br /&gt;
Choisir le menu &amp;quot;&#039;&#039;&#039;Correspondants&#039;&#039;&#039;&amp;quot; fait apparaitre un sous-menu gauche offrant les fonctions pour créer, ou ajouter un nouveau Correspondant.&lt;br /&gt;
* Pour créer un correspondant, il suffit de cliquer sur l&#039;entrée &amp;quot;Nouveau correspondant&amp;quot; et de saisir les informations sur la fiche vierge puis Enregistrer.&lt;br /&gt;
* Lorsqu&#039;on a choisi l&#039;entrée du menu &amp;quot;Liste des correspondants&amp;quot;, on voie la liste de tous les correspondants enregistrés. Si on clique sur le nom de l&#039;un d&#039;eux, sa fiche s&#039;ouvre. Et il est possible de la modifier.&lt;br /&gt;
* Il est possible de rappeler la fiche d&#039;un Correspondant rapidement en saisissant une partie de son nom dans la zone de recherche rapide sur le bandeau de gauche.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
Correspondents are other caregivers or doctors attending or being occupied Patient. Select the menu &amp;quot;Correspondents&amp;quot; brings up a submenu with the left functions to create, or add a new correspondent.&lt;br /&gt;
* To create a contact, just click on the entry &amp;quot;New correspondent&amp;quot; and enter information on the blank page and select Save.&lt;br /&gt;
* When selected the menu entry &amp;quot;List all&amp;quot;, it means the list of all registered correspondents. If you click on the name of one of them, its card opens. And it is possible to change it.&lt;br /&gt;
* It is possible to recall a detail Corresponding quickly by typing part of its name in the quick search box on the left panel.&lt;br /&gt;
&lt;br /&gt;
== Patients ==&lt;br /&gt;
Select the top menu &amp;quot;&#039;&#039; &#039;&#039;&#039; Patients&amp;quot;, brings up an offering functions to create a new patient list patients or past consultations submenu. &lt;br /&gt;
&lt;br /&gt;
* To create a new patient, simply click on the &amp;quot;New Patient&amp;quot; entry and enter the information on the blank sheet and then Save. &lt;br /&gt;
* When you have selected the menu entry &amp;quot;Patient List&amp;quot; is the track list of all registered patients. If you click on the name of one of them, his record opens. And it is possible to change it. &lt;br /&gt;
* It is also possible to recall the record of a patient quickly by typing part of its name in the quick search box on the left banner.&lt;br /&gt;
&lt;br /&gt;
=== Fiches Patient et consultations (Patient records and consultations)===&lt;br /&gt;
Pour créer une fiche patient, cliquer sur le menu &amp;quot;&#039;&#039;&#039;Patient - Nouveau Patient&#039;&#039;&#039;&amp;quot;. Une fois créée, une fiche Patient contient plusieurs onglets:&lt;br /&gt;
* Un onglet avec les informations générales (qui sont celles enregistrés lors de la création) &lt;br /&gt;
* Un onglet Agenda (si le module Agenda a été activé)&lt;br /&gt;
* Un onglet Catégories (si le module Catégorie a été activé)&lt;br /&gt;
* Un onglet Correspondants &lt;br /&gt;
* Un ognlet Antécedants/Traitements&lt;br /&gt;
* Un onglet Notes&lt;br /&gt;
* Un onglet Consultations&lt;br /&gt;
* Un onglet Bio&lt;br /&gt;
* Un onglet Exploration&lt;br /&gt;
* Un onglet Courriers/Fichiers&lt;br /&gt;
&lt;br /&gt;
Exemple: Cliquer sur l&#039;image pour l&#039;agrandir&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot patientcard.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Voici un description sur la manière d&#039;utiliser chaque onglet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
To create a patient file, click on the menu &#039;&#039; &#039;&#039; Patient - New Patient &#039;&#039; &#039;&#039;. Once created, a Patient card contains several tabs:&lt;br /&gt;
* A tab with general information (which are those recorded during the creation)&lt;br /&gt;
* A Calendar tab (if the Calendar module has been enabled)&lt;br /&gt;
* A Categories tab (if the Category module has been enabled)&lt;br /&gt;
* A Correspondence tab&lt;br /&gt;
* A history tab / Treatments&lt;br /&gt;
* A Notes tab&lt;br /&gt;
* A consultation tab&lt;br /&gt;
* A Bio tab&lt;br /&gt;
* A exploration tab&lt;br /&gt;
* A Couriers tab / Files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Onglet des informations générales (Tab general information)====&lt;br /&gt;
* Sur la fiche du Patient, il est possible de lui affecter un ou plusieurs utilisateurs (médecins particuliers du cabinet suivant le patient par exemple). Bien que tous soignant puisse voir la fiche du patient d&#039;un autre, ceci est utile pour classifier les patients par soignant principal. Cela est utilisé aussi pour les statistiques.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
* On the Patient card, it is possible to assign one or more users (individual doctors cabinet following the patient for example). Although all caregivers can see the patient&#039;s chart of another, this is useful to classify patients by primary caregiver. It is also used for statistics.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Correspondans (tab for correspondents) ====&lt;br /&gt;
Sur cet onglet, vous pouvez associer tous les médecins traitant ou connaissant le patient avec leur spécialité.&lt;br /&gt;
&lt;br /&gt;
(On this tab, you can associate all physicians treating the patient with or knowing their specialty.)&lt;br /&gt;
&lt;br /&gt;
==== Onglet Agenda (tab agenda)====&lt;br /&gt;
Cet onglet n&#039;est visible que si le [[Module Agenda]] a été activé. &lt;br /&gt;
Il offre une vue de type calendrier de certains évênements qui ont été enregistrés sur le patient (création de la fiche patient, rendez-vous, saisie d&#039;une consultation).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;translation&#039;&#039;&#039;&lt;br /&gt;
(This tab is only visible if the Calendar module has been activated.)&lt;br /&gt;
(It provides a calendar-type view of certain events that have been recorded on the patient (creation of the patient file, appointments, entering a consultation).)&lt;br /&gt;
&lt;br /&gt;
==== Onglet Catégories (Tab for categories)====&lt;br /&gt;
Cet onglet n&#039;est visible que si le [[Module Catégories]] a été activé.&lt;br /&gt;
&lt;br /&gt;
Il permet de classer un patient dans une ou plusieurs catégories. A vous de décider les catégories que vous créez. Leur création se fair depuis le menu &amp;quot;Patient - Catégorie - Nouvelle catégorie&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;transaltion&#039;&#039;&#039;&lt;br /&gt;
This tab is only visible if the [[Module Categories]] has been activated.&lt;br /&gt;
It classifies a patient in one or more categories. You decide which categories you create. Their creation is fair from the &amp;quot;Patient - Category - New Category&amp;quot; menu.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Antécédents/Traitements ====&lt;br /&gt;
A compléter &lt;br /&gt;
&lt;br /&gt;
==== Onglet Notes ====&lt;br /&gt;
A compléter &lt;br /&gt;
&lt;br /&gt;
==== Onglet Documents ====&lt;br /&gt;
* Cette page permet de joindre des pièces jointes (images de scanners, d&#039;échographie, documents words, ...)&lt;br /&gt;
Mais elle permet aussi de générer des documents OpenOffice à partir d&#039;un modèle. Le modèle courrier_consult.odt est fourni en example. &lt;br /&gt;
* Pour générer un document, il faut choisir le modèle, éventuellement la fiche Bio associée puis cliquer sur Générer.&lt;br /&gt;
Le modèle sera utilisé et toutes les balises variables seront remplacées par les infos du patient ou de la consultation.&lt;br /&gt;
* Pour faire son propre modèle de document, voir la page [[Créer un modèle de document ODT]].&lt;br /&gt;
Les balises suivantes sont disponibles en plus de celle standard de Dolibarr:&lt;br /&gt;
{{TagsOdtCabinetMed}}&lt;br /&gt;
&lt;br /&gt;
== Menu Bilan consultations ==&lt;br /&gt;
Choisir le menu Bilan consultations fait apparaitre un tableau affichant pour les 3 dernières années, les revenus avec le détail par mois.&lt;br /&gt;
En cliquant sur un mois, cela déroule le détail sur chaque jour du mois.&lt;br /&gt;
Il est aussi possible depuis cet écran d&#039;exporter le détail dans un fichier Excel.&lt;br /&gt;
&lt;br /&gt;
Copie d&#039;écran exemple (cliquez sur l&#039;image pour agrandir):&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot report.png|200px]]&lt;br /&gt;
&lt;br /&gt;
= Développement =&lt;br /&gt;
{{TemplateModNLTechnoEn}}&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Medical_Center&amp;diff=33906</id>
		<title>Module Medical Center</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Medical_Center&amp;diff=33906"/>
		<updated>2015-06-07T07:58:15Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Onglet Catégories */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:CabinetMed]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=Medical Center&lt;br /&gt;
|editor=NLTechno&lt;br /&gt;
|web=[http://www.nltechno.com www.nltechno.com]&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=medical}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=&lt;br /&gt;
|minversion=3.5.3&lt;br /&gt;
|note=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
Can turn your Dolibarr into a medical office manager (dictionaries of pathology, patient management, history, directory of referents doctors, following consultations, examinations/radios, generation of consultation documents, statistics of your consultations, monitoring money input, check receipts, etc ...). &lt;br /&gt;
&lt;br /&gt;
How to use module is described a little later.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
{{InstallModuleDoliStoreEn}}&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
{{ActivationModuleEn}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setup page specific to module:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Into setup page dedicated to module, you can also define:&lt;br /&gt;
* Feature related to rhumatology.&lt;br /&gt;
* Enable or not standard menu  Thirdparies of yo have to manage thirdparies that are not patient.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Other options:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Into menu &#039;Home - Setup - Other&#039;, you can also add constant &amp;quot;&#039;&#039;&#039;CABINETMED_DELAY_TO_LOCK_RECORD&#039;&#039;&#039;&amp;quot; to a number of day. This means all consultation recorded could not be modified 2 days Iafter they were recorded.&lt;br /&gt;
&lt;br /&gt;
By default, professional ID fields are not visible when you are on a patient card. You can however decide to make them visible by adding the constant &#039;&#039;&#039;CABINETMED_SHOW_PROFIDx&#039;&#039;&#039; to 1 (where x is a number between 1 and 6 to define which professional ID you want to see. Add several constants, if you need several professional ID).&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
Activating this module will add the following new top menu entries:&lt;br /&gt;
* Patients&lt;br /&gt;
* Contacts (the other doctors)&lt;br /&gt;
* Consultation summary (show entry/output for a year, month or day of revenus)&lt;br /&gt;
&lt;br /&gt;
== Users ==&lt;br /&gt;
Quand le module est activé, un utilisateur Dolibarr est en fait un membre du personnel soigant (médecin, infirmière, sage-femme, kiné, ou encore secrétaire...), et donc u nutilisateur faisant partie du cabinet amené à consulter ou saisir dans Dolibarr. Il peut n&#039;y avoir qu&#039;un seul utilisateur dans le cas d&#039;un médecin ou soignant exerçant seul. Un utilisateur peut aussi être une personne du secrétariat téléphonique du cabinet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
When the module is activated, a Dolibarr user is actually a member of staff soigant (doctor, nurse, midwife, physiotherapist, or secretary ...), and therefore u nutilisateur part of the firm brought in to consult or enter Dolibarr. There may be only one user in the case of a sole practitioner physician or caregiver. A user can also be a person answering service firm.&lt;br /&gt;
&lt;br /&gt;
== Care givers contacts ==&lt;br /&gt;
{{ToTranslate}}&lt;br /&gt;
Les Correspondants sont les autres soignants ou médecins s&#039;occupant ou s&#039;étant occupé du Patient.&lt;br /&gt;
Choisir le menu &amp;quot;&#039;&#039;&#039;Correspondants&#039;&#039;&#039;&amp;quot; fait apparaitre un sous-menu gauche offrant les fonctions pour créer, ou ajouter un nouveau Correspondant.&lt;br /&gt;
* Pour créer un correspondant, il suffit de cliquer sur l&#039;entrée &amp;quot;Nouveau correspondant&amp;quot; et de saisir les informations sur la fiche vierge puis Enregistrer.&lt;br /&gt;
* Lorsqu&#039;on a choisi l&#039;entrée du menu &amp;quot;Liste des correspondants&amp;quot;, on voie la liste de tous les correspondants enregistrés. Si on clique sur le nom de l&#039;un d&#039;eux, sa fiche s&#039;ouvre. Et il est possible de la modifier.&lt;br /&gt;
* Il est possible de rappeler la fiche d&#039;un Correspondant rapidement en saisissant une partie de son nom dans la zone de recherche rapide sur le bandeau de gauche.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
Correspondents are other caregivers or doctors attending or being occupied Patient. Select the menu &amp;quot;Correspondents&amp;quot; brings up a submenu with the left functions to create, or add a new correspondent.&lt;br /&gt;
* To create a contact, just click on the entry &amp;quot;New correspondent&amp;quot; and enter information on the blank page and select Save.&lt;br /&gt;
* When selected the menu entry &amp;quot;List all&amp;quot;, it means the list of all registered correspondents. If you click on the name of one of them, its card opens. And it is possible to change it.&lt;br /&gt;
* It is possible to recall a detail Corresponding quickly by typing part of its name in the quick search box on the left panel.&lt;br /&gt;
&lt;br /&gt;
== Patients ==&lt;br /&gt;
Select the top menu &amp;quot;&#039;&#039; &#039;&#039;&#039; Patients&amp;quot;, brings up an offering functions to create a new patient list patients or past consultations submenu. &lt;br /&gt;
&lt;br /&gt;
* To create a new patient, simply click on the &amp;quot;New Patient&amp;quot; entry and enter the information on the blank sheet and then Save. &lt;br /&gt;
* When you have selected the menu entry &amp;quot;Patient List&amp;quot; is the track list of all registered patients. If you click on the name of one of them, his record opens. And it is possible to change it. &lt;br /&gt;
* It is also possible to recall the record of a patient quickly by typing part of its name in the quick search box on the left banner.&lt;br /&gt;
&lt;br /&gt;
=== Fiches Patient et consultations (Patient records and consultations)===&lt;br /&gt;
Pour créer une fiche patient, cliquer sur le menu &amp;quot;&#039;&#039;&#039;Patient - Nouveau Patient&#039;&#039;&#039;&amp;quot;. Une fois créée, une fiche Patient contient plusieurs onglets:&lt;br /&gt;
* Un onglet avec les informations générales (qui sont celles enregistrés lors de la création) &lt;br /&gt;
* Un onglet Agenda (si le module Agenda a été activé)&lt;br /&gt;
* Un onglet Catégories (si le module Catégorie a été activé)&lt;br /&gt;
* Un onglet Correspondants &lt;br /&gt;
* Un ognlet Antécedants/Traitements&lt;br /&gt;
* Un onglet Notes&lt;br /&gt;
* Un onglet Consultations&lt;br /&gt;
* Un onglet Bio&lt;br /&gt;
* Un onglet Exploration&lt;br /&gt;
* Un onglet Courriers/Fichiers&lt;br /&gt;
&lt;br /&gt;
Exemple: Cliquer sur l&#039;image pour l&#039;agrandir&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot patientcard.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Voici un description sur la manière d&#039;utiliser chaque onglet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
To create a patient file, click on the menu &#039;&#039; &#039;&#039; Patient - New Patient &#039;&#039; &#039;&#039;. Once created, a Patient card contains several tabs:&lt;br /&gt;
* A tab with general information (which are those recorded during the creation)&lt;br /&gt;
* A Calendar tab (if the Calendar module has been enabled)&lt;br /&gt;
* A Categories tab (if the Category module has been enabled)&lt;br /&gt;
* A Correspondence tab&lt;br /&gt;
* A history tab / Treatments&lt;br /&gt;
* A Notes tab&lt;br /&gt;
* A consultation tab&lt;br /&gt;
* A Bio tab&lt;br /&gt;
* A exploration tab&lt;br /&gt;
* A Couriers tab / Files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Onglet des informations générales (Tab general information)====&lt;br /&gt;
* Sur la fiche du Patient, il est possible de lui affecter un ou plusieurs utilisateurs (médecins particuliers du cabinet suivant le patient par exemple). Bien que tous soignant puisse voir la fiche du patient d&#039;un autre, ceci est utile pour classifier les patients par soignant principal. Cela est utilisé aussi pour les statistiques.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
* On the Patient card, it is possible to assign one or more users (individual doctors cabinet following the patient for example). Although all caregivers can see the patient&#039;s chart of another, this is useful to classify patients by primary caregiver. It is also used for statistics.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Correspondans (tab for correspondents) ====&lt;br /&gt;
Sur cet onglet, vous pouvez associer tous les médecins traitant ou connaissant le patient avec leur spécialité.&lt;br /&gt;
&lt;br /&gt;
(On this tab, you can associate all physicians treating the patient with or knowing their specialty.)&lt;br /&gt;
&lt;br /&gt;
==== Onglet Agenda ====&lt;br /&gt;
Cet onglet n&#039;est visible que si le [[Module Agenda]] a été activé. &lt;br /&gt;
(This tab is only visible if the Calendar module has been activated.)&lt;br /&gt;
&lt;br /&gt;
Il offre une vue de type calendrier de certains évênements qui ont été enregistrés sur le patient (création de la fiche patient, rendez-vous, saisie d&#039;une consultation).&lt;br /&gt;
(It provides a calendar-type view of certain events that have been recorded on the patient (creation of the patient file, appointments, entering a consultation).)&lt;br /&gt;
&lt;br /&gt;
==== Onglet Catégories (Tab for categories)====&lt;br /&gt;
Cet onglet n&#039;est visible que si le [[Module Catégories]] a été activé.&lt;br /&gt;
&lt;br /&gt;
Il permet de classer un patient dans une ou plusieurs catégories. A vous de décider les catégories que vous créez. Leur création se fair depuis le menu &amp;quot;Patient - Catégorie - Nouvelle catégorie&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;transaltion&#039;&#039;&#039;&lt;br /&gt;
This tab is only visible if the [[Module Categories]] has been activated.&lt;br /&gt;
It classifies a patient in one or more categories. You decide which categories you create. Their creation is fair from the &amp;quot;Patient - Category - New Category&amp;quot; menu.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Antécédents/Traitements ====&lt;br /&gt;
A compléter &lt;br /&gt;
&lt;br /&gt;
==== Onglet Notes ====&lt;br /&gt;
A compléter &lt;br /&gt;
&lt;br /&gt;
==== Onglet Documents ====&lt;br /&gt;
* Cette page permet de joindre des pièces jointes (images de scanners, d&#039;échographie, documents words, ...)&lt;br /&gt;
Mais elle permet aussi de générer des documents OpenOffice à partir d&#039;un modèle. Le modèle courrier_consult.odt est fourni en example. &lt;br /&gt;
* Pour générer un document, il faut choisir le modèle, éventuellement la fiche Bio associée puis cliquer sur Générer.&lt;br /&gt;
Le modèle sera utilisé et toutes les balises variables seront remplacées par les infos du patient ou de la consultation.&lt;br /&gt;
* Pour faire son propre modèle de document, voir la page [[Créer un modèle de document ODT]].&lt;br /&gt;
Les balises suivantes sont disponibles en plus de celle standard de Dolibarr:&lt;br /&gt;
{{TagsOdtCabinetMed}}&lt;br /&gt;
&lt;br /&gt;
== Menu Bilan consultations ==&lt;br /&gt;
Choisir le menu Bilan consultations fait apparaitre un tableau affichant pour les 3 dernières années, les revenus avec le détail par mois.&lt;br /&gt;
En cliquant sur un mois, cela déroule le détail sur chaque jour du mois.&lt;br /&gt;
Il est aussi possible depuis cet écran d&#039;exporter le détail dans un fichier Excel.&lt;br /&gt;
&lt;br /&gt;
Copie d&#039;écran exemple (cliquez sur l&#039;image pour agrandir):&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot report.png|200px]]&lt;br /&gt;
&lt;br /&gt;
= Développement =&lt;br /&gt;
{{TemplateModNLTechnoEn}}&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Medical_Center&amp;diff=33905</id>
		<title>Module Medical Center</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Medical_Center&amp;diff=33905"/>
		<updated>2015-06-07T07:56:07Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Onglet Correspondans (tab for correspondents) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:CabinetMed]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=Medical Center&lt;br /&gt;
|editor=NLTechno&lt;br /&gt;
|web=[http://www.nltechno.com www.nltechno.com]&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=medical}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=&lt;br /&gt;
|minversion=3.5.3&lt;br /&gt;
|note=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
Can turn your Dolibarr into a medical office manager (dictionaries of pathology, patient management, history, directory of referents doctors, following consultations, examinations/radios, generation of consultation documents, statistics of your consultations, monitoring money input, check receipts, etc ...). &lt;br /&gt;
&lt;br /&gt;
How to use module is described a little later.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
{{InstallModuleDoliStoreEn}}&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
{{ActivationModuleEn}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setup page specific to module:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Into setup page dedicated to module, you can also define:&lt;br /&gt;
* Feature related to rhumatology.&lt;br /&gt;
* Enable or not standard menu  Thirdparies of yo have to manage thirdparies that are not patient.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Other options:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Into menu &#039;Home - Setup - Other&#039;, you can also add constant &amp;quot;&#039;&#039;&#039;CABINETMED_DELAY_TO_LOCK_RECORD&#039;&#039;&#039;&amp;quot; to a number of day. This means all consultation recorded could not be modified 2 days Iafter they were recorded.&lt;br /&gt;
&lt;br /&gt;
By default, professional ID fields are not visible when you are on a patient card. You can however decide to make them visible by adding the constant &#039;&#039;&#039;CABINETMED_SHOW_PROFIDx&#039;&#039;&#039; to 1 (where x is a number between 1 and 6 to define which professional ID you want to see. Add several constants, if you need several professional ID).&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
Activating this module will add the following new top menu entries:&lt;br /&gt;
* Patients&lt;br /&gt;
* Contacts (the other doctors)&lt;br /&gt;
* Consultation summary (show entry/output for a year, month or day of revenus)&lt;br /&gt;
&lt;br /&gt;
== Users ==&lt;br /&gt;
Quand le module est activé, un utilisateur Dolibarr est en fait un membre du personnel soigant (médecin, infirmière, sage-femme, kiné, ou encore secrétaire...), et donc u nutilisateur faisant partie du cabinet amené à consulter ou saisir dans Dolibarr. Il peut n&#039;y avoir qu&#039;un seul utilisateur dans le cas d&#039;un médecin ou soignant exerçant seul. Un utilisateur peut aussi être une personne du secrétariat téléphonique du cabinet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
When the module is activated, a Dolibarr user is actually a member of staff soigant (doctor, nurse, midwife, physiotherapist, or secretary ...), and therefore u nutilisateur part of the firm brought in to consult or enter Dolibarr. There may be only one user in the case of a sole practitioner physician or caregiver. A user can also be a person answering service firm.&lt;br /&gt;
&lt;br /&gt;
== Care givers contacts ==&lt;br /&gt;
{{ToTranslate}}&lt;br /&gt;
Les Correspondants sont les autres soignants ou médecins s&#039;occupant ou s&#039;étant occupé du Patient.&lt;br /&gt;
Choisir le menu &amp;quot;&#039;&#039;&#039;Correspondants&#039;&#039;&#039;&amp;quot; fait apparaitre un sous-menu gauche offrant les fonctions pour créer, ou ajouter un nouveau Correspondant.&lt;br /&gt;
* Pour créer un correspondant, il suffit de cliquer sur l&#039;entrée &amp;quot;Nouveau correspondant&amp;quot; et de saisir les informations sur la fiche vierge puis Enregistrer.&lt;br /&gt;
* Lorsqu&#039;on a choisi l&#039;entrée du menu &amp;quot;Liste des correspondants&amp;quot;, on voie la liste de tous les correspondants enregistrés. Si on clique sur le nom de l&#039;un d&#039;eux, sa fiche s&#039;ouvre. Et il est possible de la modifier.&lt;br /&gt;
* Il est possible de rappeler la fiche d&#039;un Correspondant rapidement en saisissant une partie de son nom dans la zone de recherche rapide sur le bandeau de gauche.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
Correspondents are other caregivers or doctors attending or being occupied Patient. Select the menu &amp;quot;Correspondents&amp;quot; brings up a submenu with the left functions to create, or add a new correspondent.&lt;br /&gt;
* To create a contact, just click on the entry &amp;quot;New correspondent&amp;quot; and enter information on the blank page and select Save.&lt;br /&gt;
* When selected the menu entry &amp;quot;List all&amp;quot;, it means the list of all registered correspondents. If you click on the name of one of them, its card opens. And it is possible to change it.&lt;br /&gt;
* It is possible to recall a detail Corresponding quickly by typing part of its name in the quick search box on the left panel.&lt;br /&gt;
&lt;br /&gt;
== Patients ==&lt;br /&gt;
Select the top menu &amp;quot;&#039;&#039; &#039;&#039;&#039; Patients&amp;quot;, brings up an offering functions to create a new patient list patients or past consultations submenu. &lt;br /&gt;
&lt;br /&gt;
* To create a new patient, simply click on the &amp;quot;New Patient&amp;quot; entry and enter the information on the blank sheet and then Save. &lt;br /&gt;
* When you have selected the menu entry &amp;quot;Patient List&amp;quot; is the track list of all registered patients. If you click on the name of one of them, his record opens. And it is possible to change it. &lt;br /&gt;
* It is also possible to recall the record of a patient quickly by typing part of its name in the quick search box on the left banner.&lt;br /&gt;
&lt;br /&gt;
=== Fiches Patient et consultations (Patient records and consultations)===&lt;br /&gt;
Pour créer une fiche patient, cliquer sur le menu &amp;quot;&#039;&#039;&#039;Patient - Nouveau Patient&#039;&#039;&#039;&amp;quot;. Une fois créée, une fiche Patient contient plusieurs onglets:&lt;br /&gt;
* Un onglet avec les informations générales (qui sont celles enregistrés lors de la création) &lt;br /&gt;
* Un onglet Agenda (si le module Agenda a été activé)&lt;br /&gt;
* Un onglet Catégories (si le module Catégorie a été activé)&lt;br /&gt;
* Un onglet Correspondants &lt;br /&gt;
* Un ognlet Antécedants/Traitements&lt;br /&gt;
* Un onglet Notes&lt;br /&gt;
* Un onglet Consultations&lt;br /&gt;
* Un onglet Bio&lt;br /&gt;
* Un onglet Exploration&lt;br /&gt;
* Un onglet Courriers/Fichiers&lt;br /&gt;
&lt;br /&gt;
Exemple: Cliquer sur l&#039;image pour l&#039;agrandir&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot patientcard.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Voici un description sur la manière d&#039;utiliser chaque onglet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
To create a patient file, click on the menu &#039;&#039; &#039;&#039; Patient - New Patient &#039;&#039; &#039;&#039;. Once created, a Patient card contains several tabs:&lt;br /&gt;
* A tab with general information (which are those recorded during the creation)&lt;br /&gt;
* A Calendar tab (if the Calendar module has been enabled)&lt;br /&gt;
* A Categories tab (if the Category module has been enabled)&lt;br /&gt;
* A Correspondence tab&lt;br /&gt;
* A history tab / Treatments&lt;br /&gt;
* A Notes tab&lt;br /&gt;
* A consultation tab&lt;br /&gt;
* A Bio tab&lt;br /&gt;
* A exploration tab&lt;br /&gt;
* A Couriers tab / Files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Onglet des informations générales (Tab general information)====&lt;br /&gt;
* Sur la fiche du Patient, il est possible de lui affecter un ou plusieurs utilisateurs (médecins particuliers du cabinet suivant le patient par exemple). Bien que tous soignant puisse voir la fiche du patient d&#039;un autre, ceci est utile pour classifier les patients par soignant principal. Cela est utilisé aussi pour les statistiques.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
* On the Patient card, it is possible to assign one or more users (individual doctors cabinet following the patient for example). Although all caregivers can see the patient&#039;s chart of another, this is useful to classify patients by primary caregiver. It is also used for statistics.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Correspondans (tab for correspondents) ====&lt;br /&gt;
Sur cet onglet, vous pouvez associer tous les médecins traitant ou connaissant le patient avec leur spécialité.&lt;br /&gt;
&lt;br /&gt;
(On this tab, you can associate all physicians treating the patient with or knowing their specialty.)&lt;br /&gt;
&lt;br /&gt;
==== Onglet Agenda ====&lt;br /&gt;
Cet onglet n&#039;est visible que si le [[Module Agenda]] a été activé. &lt;br /&gt;
(This tab is only visible if the Calendar module has been activated.)&lt;br /&gt;
&lt;br /&gt;
Il offre une vue de type calendrier de certains évênements qui ont été enregistrés sur le patient (création de la fiche patient, rendez-vous, saisie d&#039;une consultation).&lt;br /&gt;
(It provides a calendar-type view of certain events that have been recorded on the patient (creation of the patient file, appointments, entering a consultation).)&lt;br /&gt;
&lt;br /&gt;
==== Onglet Catégories ====&lt;br /&gt;
Cet onglet n&#039;est visible que si le [[Module Catégories]] a été activé.&lt;br /&gt;
&lt;br /&gt;
Il permet de classer un patient dans une ou plusieurs catégories. A vous de décider les catégories que vous créez. Leur création se fair depuis le menu &amp;quot;Patient - Catégorie - Nouvelle catégorie&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Antécédents/Traitements ====&lt;br /&gt;
A compléter &lt;br /&gt;
&lt;br /&gt;
==== Onglet Notes ====&lt;br /&gt;
A compléter &lt;br /&gt;
&lt;br /&gt;
==== Onglet Documents ====&lt;br /&gt;
* Cette page permet de joindre des pièces jointes (images de scanners, d&#039;échographie, documents words, ...)&lt;br /&gt;
Mais elle permet aussi de générer des documents OpenOffice à partir d&#039;un modèle. Le modèle courrier_consult.odt est fourni en example. &lt;br /&gt;
* Pour générer un document, il faut choisir le modèle, éventuellement la fiche Bio associée puis cliquer sur Générer.&lt;br /&gt;
Le modèle sera utilisé et toutes les balises variables seront remplacées par les infos du patient ou de la consultation.&lt;br /&gt;
* Pour faire son propre modèle de document, voir la page [[Créer un modèle de document ODT]].&lt;br /&gt;
Les balises suivantes sont disponibles en plus de celle standard de Dolibarr:&lt;br /&gt;
{{TagsOdtCabinetMed}}&lt;br /&gt;
&lt;br /&gt;
== Menu Bilan consultations ==&lt;br /&gt;
Choisir le menu Bilan consultations fait apparaitre un tableau affichant pour les 3 dernières années, les revenus avec le détail par mois.&lt;br /&gt;
En cliquant sur un mois, cela déroule le détail sur chaque jour du mois.&lt;br /&gt;
Il est aussi possible depuis cet écran d&#039;exporter le détail dans un fichier Excel.&lt;br /&gt;
&lt;br /&gt;
Copie d&#039;écran exemple (cliquez sur l&#039;image pour agrandir):&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot report.png|200px]]&lt;br /&gt;
&lt;br /&gt;
= Développement =&lt;br /&gt;
{{TemplateModNLTechnoEn}}&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Medical_Center&amp;diff=33904</id>
		<title>Module Medical Center</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Medical_Center&amp;diff=33904"/>
		<updated>2015-06-07T07:55:02Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Onglet Agenda */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:CabinetMed]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=Medical Center&lt;br /&gt;
|editor=NLTechno&lt;br /&gt;
|web=[http://www.nltechno.com www.nltechno.com]&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=medical}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=&lt;br /&gt;
|minversion=3.5.3&lt;br /&gt;
|note=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
Can turn your Dolibarr into a medical office manager (dictionaries of pathology, patient management, history, directory of referents doctors, following consultations, examinations/radios, generation of consultation documents, statistics of your consultations, monitoring money input, check receipts, etc ...). &lt;br /&gt;
&lt;br /&gt;
How to use module is described a little later.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
{{InstallModuleDoliStoreEn}}&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
{{ActivationModuleEn}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setup page specific to module:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Into setup page dedicated to module, you can also define:&lt;br /&gt;
* Feature related to rhumatology.&lt;br /&gt;
* Enable or not standard menu  Thirdparies of yo have to manage thirdparies that are not patient.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Other options:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Into menu &#039;Home - Setup - Other&#039;, you can also add constant &amp;quot;&#039;&#039;&#039;CABINETMED_DELAY_TO_LOCK_RECORD&#039;&#039;&#039;&amp;quot; to a number of day. This means all consultation recorded could not be modified 2 days Iafter they were recorded.&lt;br /&gt;
&lt;br /&gt;
By default, professional ID fields are not visible when you are on a patient card. You can however decide to make them visible by adding the constant &#039;&#039;&#039;CABINETMED_SHOW_PROFIDx&#039;&#039;&#039; to 1 (where x is a number between 1 and 6 to define which professional ID you want to see. Add several constants, if you need several professional ID).&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
Activating this module will add the following new top menu entries:&lt;br /&gt;
* Patients&lt;br /&gt;
* Contacts (the other doctors)&lt;br /&gt;
* Consultation summary (show entry/output for a year, month or day of revenus)&lt;br /&gt;
&lt;br /&gt;
== Users ==&lt;br /&gt;
Quand le module est activé, un utilisateur Dolibarr est en fait un membre du personnel soigant (médecin, infirmière, sage-femme, kiné, ou encore secrétaire...), et donc u nutilisateur faisant partie du cabinet amené à consulter ou saisir dans Dolibarr. Il peut n&#039;y avoir qu&#039;un seul utilisateur dans le cas d&#039;un médecin ou soignant exerçant seul. Un utilisateur peut aussi être une personne du secrétariat téléphonique du cabinet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
When the module is activated, a Dolibarr user is actually a member of staff soigant (doctor, nurse, midwife, physiotherapist, or secretary ...), and therefore u nutilisateur part of the firm brought in to consult or enter Dolibarr. There may be only one user in the case of a sole practitioner physician or caregiver. A user can also be a person answering service firm.&lt;br /&gt;
&lt;br /&gt;
== Care givers contacts ==&lt;br /&gt;
{{ToTranslate}}&lt;br /&gt;
Les Correspondants sont les autres soignants ou médecins s&#039;occupant ou s&#039;étant occupé du Patient.&lt;br /&gt;
Choisir le menu &amp;quot;&#039;&#039;&#039;Correspondants&#039;&#039;&#039;&amp;quot; fait apparaitre un sous-menu gauche offrant les fonctions pour créer, ou ajouter un nouveau Correspondant.&lt;br /&gt;
* Pour créer un correspondant, il suffit de cliquer sur l&#039;entrée &amp;quot;Nouveau correspondant&amp;quot; et de saisir les informations sur la fiche vierge puis Enregistrer.&lt;br /&gt;
* Lorsqu&#039;on a choisi l&#039;entrée du menu &amp;quot;Liste des correspondants&amp;quot;, on voie la liste de tous les correspondants enregistrés. Si on clique sur le nom de l&#039;un d&#039;eux, sa fiche s&#039;ouvre. Et il est possible de la modifier.&lt;br /&gt;
* Il est possible de rappeler la fiche d&#039;un Correspondant rapidement en saisissant une partie de son nom dans la zone de recherche rapide sur le bandeau de gauche.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
Correspondents are other caregivers or doctors attending or being occupied Patient. Select the menu &amp;quot;Correspondents&amp;quot; brings up a submenu with the left functions to create, or add a new correspondent.&lt;br /&gt;
* To create a contact, just click on the entry &amp;quot;New correspondent&amp;quot; and enter information on the blank page and select Save.&lt;br /&gt;
* When selected the menu entry &amp;quot;List all&amp;quot;, it means the list of all registered correspondents. If you click on the name of one of them, its card opens. And it is possible to change it.&lt;br /&gt;
* It is possible to recall a detail Corresponding quickly by typing part of its name in the quick search box on the left panel.&lt;br /&gt;
&lt;br /&gt;
== Patients ==&lt;br /&gt;
Select the top menu &amp;quot;&#039;&#039; &#039;&#039;&#039; Patients&amp;quot;, brings up an offering functions to create a new patient list patients or past consultations submenu. &lt;br /&gt;
&lt;br /&gt;
* To create a new patient, simply click on the &amp;quot;New Patient&amp;quot; entry and enter the information on the blank sheet and then Save. &lt;br /&gt;
* When you have selected the menu entry &amp;quot;Patient List&amp;quot; is the track list of all registered patients. If you click on the name of one of them, his record opens. And it is possible to change it. &lt;br /&gt;
* It is also possible to recall the record of a patient quickly by typing part of its name in the quick search box on the left banner.&lt;br /&gt;
&lt;br /&gt;
=== Fiches Patient et consultations (Patient records and consultations)===&lt;br /&gt;
Pour créer une fiche patient, cliquer sur le menu &amp;quot;&#039;&#039;&#039;Patient - Nouveau Patient&#039;&#039;&#039;&amp;quot;. Une fois créée, une fiche Patient contient plusieurs onglets:&lt;br /&gt;
* Un onglet avec les informations générales (qui sont celles enregistrés lors de la création) &lt;br /&gt;
* Un onglet Agenda (si le module Agenda a été activé)&lt;br /&gt;
* Un onglet Catégories (si le module Catégorie a été activé)&lt;br /&gt;
* Un onglet Correspondants &lt;br /&gt;
* Un ognlet Antécedants/Traitements&lt;br /&gt;
* Un onglet Notes&lt;br /&gt;
* Un onglet Consultations&lt;br /&gt;
* Un onglet Bio&lt;br /&gt;
* Un onglet Exploration&lt;br /&gt;
* Un onglet Courriers/Fichiers&lt;br /&gt;
&lt;br /&gt;
Exemple: Cliquer sur l&#039;image pour l&#039;agrandir&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot patientcard.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Voici un description sur la manière d&#039;utiliser chaque onglet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
To create a patient file, click on the menu &#039;&#039; &#039;&#039; Patient - New Patient &#039;&#039; &#039;&#039;. Once created, a Patient card contains several tabs:&lt;br /&gt;
* A tab with general information (which are those recorded during the creation)&lt;br /&gt;
* A Calendar tab (if the Calendar module has been enabled)&lt;br /&gt;
* A Categories tab (if the Category module has been enabled)&lt;br /&gt;
* A Correspondence tab&lt;br /&gt;
* A history tab / Treatments&lt;br /&gt;
* A Notes tab&lt;br /&gt;
* A consultation tab&lt;br /&gt;
* A Bio tab&lt;br /&gt;
* A exploration tab&lt;br /&gt;
* A Couriers tab / Files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Onglet des informations générales (Tab general information)====&lt;br /&gt;
* Sur la fiche du Patient, il est possible de lui affecter un ou plusieurs utilisateurs (médecins particuliers du cabinet suivant le patient par exemple). Bien que tous soignant puisse voir la fiche du patient d&#039;un autre, ceci est utile pour classifier les patients par soignant principal. Cela est utilisé aussi pour les statistiques.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
* On the Patient card, it is possible to assign one or more users (individual doctors cabinet following the patient for example). Although all caregivers can see the patient&#039;s chart of another, this is useful to classify patients by primary caregiver. It is also used for statistics.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Correspondans (tab for correspondents) ====&lt;br /&gt;
Sur cet onglet, vous pouvez associer tous les médecins traitant ou connaissant le patient avec leur spécialité.&lt;br /&gt;
(On this tab, you can associate all physicians treating the patient with or knowing their specialty.)&lt;br /&gt;
&lt;br /&gt;
==== Onglet Agenda ====&lt;br /&gt;
Cet onglet n&#039;est visible que si le [[Module Agenda]] a été activé. &lt;br /&gt;
(This tab is only visible if the Calendar module has been activated.)&lt;br /&gt;
&lt;br /&gt;
Il offre une vue de type calendrier de certains évênements qui ont été enregistrés sur le patient (création de la fiche patient, rendez-vous, saisie d&#039;une consultation).&lt;br /&gt;
(It provides a calendar-type view of certain events that have been recorded on the patient (creation of the patient file, appointments, entering a consultation).)&lt;br /&gt;
&lt;br /&gt;
==== Onglet Catégories ====&lt;br /&gt;
Cet onglet n&#039;est visible que si le [[Module Catégories]] a été activé.&lt;br /&gt;
&lt;br /&gt;
Il permet de classer un patient dans une ou plusieurs catégories. A vous de décider les catégories que vous créez. Leur création se fair depuis le menu &amp;quot;Patient - Catégorie - Nouvelle catégorie&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Antécédents/Traitements ====&lt;br /&gt;
A compléter &lt;br /&gt;
&lt;br /&gt;
==== Onglet Notes ====&lt;br /&gt;
A compléter &lt;br /&gt;
&lt;br /&gt;
==== Onglet Documents ====&lt;br /&gt;
* Cette page permet de joindre des pièces jointes (images de scanners, d&#039;échographie, documents words, ...)&lt;br /&gt;
Mais elle permet aussi de générer des documents OpenOffice à partir d&#039;un modèle. Le modèle courrier_consult.odt est fourni en example. &lt;br /&gt;
* Pour générer un document, il faut choisir le modèle, éventuellement la fiche Bio associée puis cliquer sur Générer.&lt;br /&gt;
Le modèle sera utilisé et toutes les balises variables seront remplacées par les infos du patient ou de la consultation.&lt;br /&gt;
* Pour faire son propre modèle de document, voir la page [[Créer un modèle de document ODT]].&lt;br /&gt;
Les balises suivantes sont disponibles en plus de celle standard de Dolibarr:&lt;br /&gt;
{{TagsOdtCabinetMed}}&lt;br /&gt;
&lt;br /&gt;
== Menu Bilan consultations ==&lt;br /&gt;
Choisir le menu Bilan consultations fait apparaitre un tableau affichant pour les 3 dernières années, les revenus avec le détail par mois.&lt;br /&gt;
En cliquant sur un mois, cela déroule le détail sur chaque jour du mois.&lt;br /&gt;
Il est aussi possible depuis cet écran d&#039;exporter le détail dans un fichier Excel.&lt;br /&gt;
&lt;br /&gt;
Copie d&#039;écran exemple (cliquez sur l&#039;image pour agrandir):&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot report.png|200px]]&lt;br /&gt;
&lt;br /&gt;
= Développement =&lt;br /&gt;
{{TemplateModNLTechnoEn}}&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Medical_Center&amp;diff=33903</id>
		<title>Module Medical Center</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Medical_Center&amp;diff=33903"/>
		<updated>2015-06-07T07:53:12Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Onglet Correspondans */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:CabinetMed]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=Medical Center&lt;br /&gt;
|editor=NLTechno&lt;br /&gt;
|web=[http://www.nltechno.com www.nltechno.com]&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=medical}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=&lt;br /&gt;
|minversion=3.5.3&lt;br /&gt;
|note=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
Can turn your Dolibarr into a medical office manager (dictionaries of pathology, patient management, history, directory of referents doctors, following consultations, examinations/radios, generation of consultation documents, statistics of your consultations, monitoring money input, check receipts, etc ...). &lt;br /&gt;
&lt;br /&gt;
How to use module is described a little later.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
{{InstallModuleDoliStoreEn}}&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
{{ActivationModuleEn}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setup page specific to module:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Into setup page dedicated to module, you can also define:&lt;br /&gt;
* Feature related to rhumatology.&lt;br /&gt;
* Enable or not standard menu  Thirdparies of yo have to manage thirdparies that are not patient.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Other options:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Into menu &#039;Home - Setup - Other&#039;, you can also add constant &amp;quot;&#039;&#039;&#039;CABINETMED_DELAY_TO_LOCK_RECORD&#039;&#039;&#039;&amp;quot; to a number of day. This means all consultation recorded could not be modified 2 days Iafter they were recorded.&lt;br /&gt;
&lt;br /&gt;
By default, professional ID fields are not visible when you are on a patient card. You can however decide to make them visible by adding the constant &#039;&#039;&#039;CABINETMED_SHOW_PROFIDx&#039;&#039;&#039; to 1 (where x is a number between 1 and 6 to define which professional ID you want to see. Add several constants, if you need several professional ID).&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
Activating this module will add the following new top menu entries:&lt;br /&gt;
* Patients&lt;br /&gt;
* Contacts (the other doctors)&lt;br /&gt;
* Consultation summary (show entry/output for a year, month or day of revenus)&lt;br /&gt;
&lt;br /&gt;
== Users ==&lt;br /&gt;
Quand le module est activé, un utilisateur Dolibarr est en fait un membre du personnel soigant (médecin, infirmière, sage-femme, kiné, ou encore secrétaire...), et donc u nutilisateur faisant partie du cabinet amené à consulter ou saisir dans Dolibarr. Il peut n&#039;y avoir qu&#039;un seul utilisateur dans le cas d&#039;un médecin ou soignant exerçant seul. Un utilisateur peut aussi être une personne du secrétariat téléphonique du cabinet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
When the module is activated, a Dolibarr user is actually a member of staff soigant (doctor, nurse, midwife, physiotherapist, or secretary ...), and therefore u nutilisateur part of the firm brought in to consult or enter Dolibarr. There may be only one user in the case of a sole practitioner physician or caregiver. A user can also be a person answering service firm.&lt;br /&gt;
&lt;br /&gt;
== Care givers contacts ==&lt;br /&gt;
{{ToTranslate}}&lt;br /&gt;
Les Correspondants sont les autres soignants ou médecins s&#039;occupant ou s&#039;étant occupé du Patient.&lt;br /&gt;
Choisir le menu &amp;quot;&#039;&#039;&#039;Correspondants&#039;&#039;&#039;&amp;quot; fait apparaitre un sous-menu gauche offrant les fonctions pour créer, ou ajouter un nouveau Correspondant.&lt;br /&gt;
* Pour créer un correspondant, il suffit de cliquer sur l&#039;entrée &amp;quot;Nouveau correspondant&amp;quot; et de saisir les informations sur la fiche vierge puis Enregistrer.&lt;br /&gt;
* Lorsqu&#039;on a choisi l&#039;entrée du menu &amp;quot;Liste des correspondants&amp;quot;, on voie la liste de tous les correspondants enregistrés. Si on clique sur le nom de l&#039;un d&#039;eux, sa fiche s&#039;ouvre. Et il est possible de la modifier.&lt;br /&gt;
* Il est possible de rappeler la fiche d&#039;un Correspondant rapidement en saisissant une partie de son nom dans la zone de recherche rapide sur le bandeau de gauche.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
Correspondents are other caregivers or doctors attending or being occupied Patient. Select the menu &amp;quot;Correspondents&amp;quot; brings up a submenu with the left functions to create, or add a new correspondent.&lt;br /&gt;
* To create a contact, just click on the entry &amp;quot;New correspondent&amp;quot; and enter information on the blank page and select Save.&lt;br /&gt;
* When selected the menu entry &amp;quot;List all&amp;quot;, it means the list of all registered correspondents. If you click on the name of one of them, its card opens. And it is possible to change it.&lt;br /&gt;
* It is possible to recall a detail Corresponding quickly by typing part of its name in the quick search box on the left panel.&lt;br /&gt;
&lt;br /&gt;
== Patients ==&lt;br /&gt;
Select the top menu &amp;quot;&#039;&#039; &#039;&#039;&#039; Patients&amp;quot;, brings up an offering functions to create a new patient list patients or past consultations submenu. &lt;br /&gt;
&lt;br /&gt;
* To create a new patient, simply click on the &amp;quot;New Patient&amp;quot; entry and enter the information on the blank sheet and then Save. &lt;br /&gt;
* When you have selected the menu entry &amp;quot;Patient List&amp;quot; is the track list of all registered patients. If you click on the name of one of them, his record opens. And it is possible to change it. &lt;br /&gt;
* It is also possible to recall the record of a patient quickly by typing part of its name in the quick search box on the left banner.&lt;br /&gt;
&lt;br /&gt;
=== Fiches Patient et consultations (Patient records and consultations)===&lt;br /&gt;
Pour créer une fiche patient, cliquer sur le menu &amp;quot;&#039;&#039;&#039;Patient - Nouveau Patient&#039;&#039;&#039;&amp;quot;. Une fois créée, une fiche Patient contient plusieurs onglets:&lt;br /&gt;
* Un onglet avec les informations générales (qui sont celles enregistrés lors de la création) &lt;br /&gt;
* Un onglet Agenda (si le module Agenda a été activé)&lt;br /&gt;
* Un onglet Catégories (si le module Catégorie a été activé)&lt;br /&gt;
* Un onglet Correspondants &lt;br /&gt;
* Un ognlet Antécedants/Traitements&lt;br /&gt;
* Un onglet Notes&lt;br /&gt;
* Un onglet Consultations&lt;br /&gt;
* Un onglet Bio&lt;br /&gt;
* Un onglet Exploration&lt;br /&gt;
* Un onglet Courriers/Fichiers&lt;br /&gt;
&lt;br /&gt;
Exemple: Cliquer sur l&#039;image pour l&#039;agrandir&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot patientcard.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Voici un description sur la manière d&#039;utiliser chaque onglet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
To create a patient file, click on the menu &#039;&#039; &#039;&#039; Patient - New Patient &#039;&#039; &#039;&#039;. Once created, a Patient card contains several tabs:&lt;br /&gt;
* A tab with general information (which are those recorded during the creation)&lt;br /&gt;
* A Calendar tab (if the Calendar module has been enabled)&lt;br /&gt;
* A Categories tab (if the Category module has been enabled)&lt;br /&gt;
* A Correspondence tab&lt;br /&gt;
* A history tab / Treatments&lt;br /&gt;
* A Notes tab&lt;br /&gt;
* A consultation tab&lt;br /&gt;
* A Bio tab&lt;br /&gt;
* A exploration tab&lt;br /&gt;
* A Couriers tab / Files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Onglet des informations générales (Tab general information)====&lt;br /&gt;
* Sur la fiche du Patient, il est possible de lui affecter un ou plusieurs utilisateurs (médecins particuliers du cabinet suivant le patient par exemple). Bien que tous soignant puisse voir la fiche du patient d&#039;un autre, ceci est utile pour classifier les patients par soignant principal. Cela est utilisé aussi pour les statistiques.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
* On the Patient card, it is possible to assign one or more users (individual doctors cabinet following the patient for example). Although all caregivers can see the patient&#039;s chart of another, this is useful to classify patients by primary caregiver. It is also used for statistics.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Correspondans (tab for correspondents) ====&lt;br /&gt;
Sur cet onglet, vous pouvez associer tous les médecins traitant ou connaissant le patient avec leur spécialité.&lt;br /&gt;
(On this tab, you can associate all physicians treating the patient with or knowing their specialty.)&lt;br /&gt;
&lt;br /&gt;
==== Onglet Agenda ====&lt;br /&gt;
Cet onglet n&#039;est visible que si le [[Module Agenda]] a été activé.&lt;br /&gt;
&lt;br /&gt;
Il offre une vue de type calendrier de certains évênements qui ont été enregistrés sur le patient (création de la fiche patient, rendez-vous, saisie d&#039;une consultation).&lt;br /&gt;
&lt;br /&gt;
==== Onglet Catégories ====&lt;br /&gt;
Cet onglet n&#039;est visible que si le [[Module Catégories]] a été activé.&lt;br /&gt;
&lt;br /&gt;
Il permet de classer un patient dans une ou plusieurs catégories. A vous de décider les catégories que vous créez. Leur création se fair depuis le menu &amp;quot;Patient - Catégorie - Nouvelle catégorie&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Antécédents/Traitements ====&lt;br /&gt;
A compléter &lt;br /&gt;
&lt;br /&gt;
==== Onglet Notes ====&lt;br /&gt;
A compléter &lt;br /&gt;
&lt;br /&gt;
==== Onglet Documents ====&lt;br /&gt;
* Cette page permet de joindre des pièces jointes (images de scanners, d&#039;échographie, documents words, ...)&lt;br /&gt;
Mais elle permet aussi de générer des documents OpenOffice à partir d&#039;un modèle. Le modèle courrier_consult.odt est fourni en example. &lt;br /&gt;
* Pour générer un document, il faut choisir le modèle, éventuellement la fiche Bio associée puis cliquer sur Générer.&lt;br /&gt;
Le modèle sera utilisé et toutes les balises variables seront remplacées par les infos du patient ou de la consultation.&lt;br /&gt;
* Pour faire son propre modèle de document, voir la page [[Créer un modèle de document ODT]].&lt;br /&gt;
Les balises suivantes sont disponibles en plus de celle standard de Dolibarr:&lt;br /&gt;
{{TagsOdtCabinetMed}}&lt;br /&gt;
&lt;br /&gt;
== Menu Bilan consultations ==&lt;br /&gt;
Choisir le menu Bilan consultations fait apparaitre un tableau affichant pour les 3 dernières années, les revenus avec le détail par mois.&lt;br /&gt;
En cliquant sur un mois, cela déroule le détail sur chaque jour du mois.&lt;br /&gt;
Il est aussi possible depuis cet écran d&#039;exporter le détail dans un fichier Excel.&lt;br /&gt;
&lt;br /&gt;
Copie d&#039;écran exemple (cliquez sur l&#039;image pour agrandir):&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot report.png|200px]]&lt;br /&gt;
&lt;br /&gt;
= Développement =&lt;br /&gt;
{{TemplateModNLTechnoEn}}&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
	<entry>
		<id>https://wiki.dolibarr.org/index.php?title=Module_Medical_Center&amp;diff=33902</id>
		<title>Module Medical Center</title>
		<link rel="alternate" type="text/html" href="https://wiki.dolibarr.org/index.php?title=Module_Medical_Center&amp;diff=33902"/>
		<updated>2015-06-07T07:51:08Z</updated>

		<summary type="html">&lt;p&gt;Aikhan: /* Onglet des informations générales */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Complementary modules]]&lt;br /&gt;
[[Category:CabinetMed]]&lt;br /&gt;
{{TemplateDocDevEn}}&lt;br /&gt;
{{TemplateDocUser}}&lt;br /&gt;
= Informations =&lt;br /&gt;
{{TemplateModuleInfo&lt;br /&gt;
|modulename=Medical Center&lt;br /&gt;
|editor=NLTechno&lt;br /&gt;
|web=[http://www.nltechno.com www.nltechno.com]&lt;br /&gt;
|webbuy={{LinkToPluginDownloadDoliStore|keyword=medical}}&lt;br /&gt;
|status=stable&lt;br /&gt;
|prerequisites=&lt;br /&gt;
|minversion=3.5.3&lt;br /&gt;
|note=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
Can turn your Dolibarr into a medical office manager (dictionaries of pathology, patient management, history, directory of referents doctors, following consultations, examinations/radios, generation of consultation documents, statistics of your consultations, monitoring money input, check receipts, etc ...). &lt;br /&gt;
&lt;br /&gt;
How to use module is described a little later.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
{{InstallModuleDoliStoreEn}}&lt;br /&gt;
&lt;br /&gt;
= Setup =&lt;br /&gt;
{{ActivationModuleEn}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setup page specific to module:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Into setup page dedicated to module, you can also define:&lt;br /&gt;
* Feature related to rhumatology.&lt;br /&gt;
* Enable or not standard menu  Thirdparies of yo have to manage thirdparies that are not patient.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Other options:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Into menu &#039;Home - Setup - Other&#039;, you can also add constant &amp;quot;&#039;&#039;&#039;CABINETMED_DELAY_TO_LOCK_RECORD&#039;&#039;&#039;&amp;quot; to a number of day. This means all consultation recorded could not be modified 2 days Iafter they were recorded.&lt;br /&gt;
&lt;br /&gt;
By default, professional ID fields are not visible when you are on a patient card. You can however decide to make them visible by adding the constant &#039;&#039;&#039;CABINETMED_SHOW_PROFIDx&#039;&#039;&#039; to 1 (where x is a number between 1 and 6 to define which professional ID you want to see. Add several constants, if you need several professional ID).&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
Activating this module will add the following new top menu entries:&lt;br /&gt;
* Patients&lt;br /&gt;
* Contacts (the other doctors)&lt;br /&gt;
* Consultation summary (show entry/output for a year, month or day of revenus)&lt;br /&gt;
&lt;br /&gt;
== Users ==&lt;br /&gt;
Quand le module est activé, un utilisateur Dolibarr est en fait un membre du personnel soigant (médecin, infirmière, sage-femme, kiné, ou encore secrétaire...), et donc u nutilisateur faisant partie du cabinet amené à consulter ou saisir dans Dolibarr. Il peut n&#039;y avoir qu&#039;un seul utilisateur dans le cas d&#039;un médecin ou soignant exerçant seul. Un utilisateur peut aussi être une personne du secrétariat téléphonique du cabinet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
When the module is activated, a Dolibarr user is actually a member of staff soigant (doctor, nurse, midwife, physiotherapist, or secretary ...), and therefore u nutilisateur part of the firm brought in to consult or enter Dolibarr. There may be only one user in the case of a sole practitioner physician or caregiver. A user can also be a person answering service firm.&lt;br /&gt;
&lt;br /&gt;
== Care givers contacts ==&lt;br /&gt;
{{ToTranslate}}&lt;br /&gt;
Les Correspondants sont les autres soignants ou médecins s&#039;occupant ou s&#039;étant occupé du Patient.&lt;br /&gt;
Choisir le menu &amp;quot;&#039;&#039;&#039;Correspondants&#039;&#039;&#039;&amp;quot; fait apparaitre un sous-menu gauche offrant les fonctions pour créer, ou ajouter un nouveau Correspondant.&lt;br /&gt;
* Pour créer un correspondant, il suffit de cliquer sur l&#039;entrée &amp;quot;Nouveau correspondant&amp;quot; et de saisir les informations sur la fiche vierge puis Enregistrer.&lt;br /&gt;
* Lorsqu&#039;on a choisi l&#039;entrée du menu &amp;quot;Liste des correspondants&amp;quot;, on voie la liste de tous les correspondants enregistrés. Si on clique sur le nom de l&#039;un d&#039;eux, sa fiche s&#039;ouvre. Et il est possible de la modifier.&lt;br /&gt;
* Il est possible de rappeler la fiche d&#039;un Correspondant rapidement en saisissant une partie de son nom dans la zone de recherche rapide sur le bandeau de gauche.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
Correspondents are other caregivers or doctors attending or being occupied Patient. Select the menu &amp;quot;Correspondents&amp;quot; brings up a submenu with the left functions to create, or add a new correspondent.&lt;br /&gt;
* To create a contact, just click on the entry &amp;quot;New correspondent&amp;quot; and enter information on the blank page and select Save.&lt;br /&gt;
* When selected the menu entry &amp;quot;List all&amp;quot;, it means the list of all registered correspondents. If you click on the name of one of them, its card opens. And it is possible to change it.&lt;br /&gt;
* It is possible to recall a detail Corresponding quickly by typing part of its name in the quick search box on the left panel.&lt;br /&gt;
&lt;br /&gt;
== Patients ==&lt;br /&gt;
Select the top menu &amp;quot;&#039;&#039; &#039;&#039;&#039; Patients&amp;quot;, brings up an offering functions to create a new patient list patients or past consultations submenu. &lt;br /&gt;
&lt;br /&gt;
* To create a new patient, simply click on the &amp;quot;New Patient&amp;quot; entry and enter the information on the blank sheet and then Save. &lt;br /&gt;
* When you have selected the menu entry &amp;quot;Patient List&amp;quot; is the track list of all registered patients. If you click on the name of one of them, his record opens. And it is possible to change it. &lt;br /&gt;
* It is also possible to recall the record of a patient quickly by typing part of its name in the quick search box on the left banner.&lt;br /&gt;
&lt;br /&gt;
=== Fiches Patient et consultations (Patient records and consultations)===&lt;br /&gt;
Pour créer une fiche patient, cliquer sur le menu &amp;quot;&#039;&#039;&#039;Patient - Nouveau Patient&#039;&#039;&#039;&amp;quot;. Une fois créée, une fiche Patient contient plusieurs onglets:&lt;br /&gt;
* Un onglet avec les informations générales (qui sont celles enregistrés lors de la création) &lt;br /&gt;
* Un onglet Agenda (si le module Agenda a été activé)&lt;br /&gt;
* Un onglet Catégories (si le module Catégorie a été activé)&lt;br /&gt;
* Un onglet Correspondants &lt;br /&gt;
* Un ognlet Antécedants/Traitements&lt;br /&gt;
* Un onglet Notes&lt;br /&gt;
* Un onglet Consultations&lt;br /&gt;
* Un onglet Bio&lt;br /&gt;
* Un onglet Exploration&lt;br /&gt;
* Un onglet Courriers/Fichiers&lt;br /&gt;
&lt;br /&gt;
Exemple: Cliquer sur l&#039;image pour l&#039;agrandir&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot patientcard.png|200px]]&lt;br /&gt;
&lt;br /&gt;
Voici un description sur la manière d&#039;utiliser chaque onglet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
To create a patient file, click on the menu &#039;&#039; &#039;&#039; Patient - New Patient &#039;&#039; &#039;&#039;. Once created, a Patient card contains several tabs:&lt;br /&gt;
* A tab with general information (which are those recorded during the creation)&lt;br /&gt;
* A Calendar tab (if the Calendar module has been enabled)&lt;br /&gt;
* A Categories tab (if the Category module has been enabled)&lt;br /&gt;
* A Correspondence tab&lt;br /&gt;
* A history tab / Treatments&lt;br /&gt;
* A Notes tab&lt;br /&gt;
* A consultation tab&lt;br /&gt;
* A Bio tab&lt;br /&gt;
* A exploration tab&lt;br /&gt;
* A Couriers tab / Files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Onglet des informations générales (Tab general information)====&lt;br /&gt;
* Sur la fiche du Patient, il est possible de lui affecter un ou plusieurs utilisateurs (médecins particuliers du cabinet suivant le patient par exemple). Bien que tous soignant puisse voir la fiche du patient d&#039;un autre, ceci est utile pour classifier les patients par soignant principal. Cela est utilisé aussi pour les statistiques.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Temporary translation&#039;&#039;&#039;&lt;br /&gt;
* On the Patient card, it is possible to assign one or more users (individual doctors cabinet following the patient for example). Although all caregivers can see the patient&#039;s chart of another, this is useful to classify patients by primary caregiver. It is also used for statistics.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Correspondans ====&lt;br /&gt;
Sur cet onglet, vous pouvez associer tous les médecins traitant ou connaissant le patient avec leur spécialité.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Agenda ====&lt;br /&gt;
Cet onglet n&#039;est visible que si le [[Module Agenda]] a été activé.&lt;br /&gt;
&lt;br /&gt;
Il offre une vue de type calendrier de certains évênements qui ont été enregistrés sur le patient (création de la fiche patient, rendez-vous, saisie d&#039;une consultation).&lt;br /&gt;
&lt;br /&gt;
==== Onglet Catégories ====&lt;br /&gt;
Cet onglet n&#039;est visible que si le [[Module Catégories]] a été activé.&lt;br /&gt;
&lt;br /&gt;
Il permet de classer un patient dans une ou plusieurs catégories. A vous de décider les catégories que vous créez. Leur création se fair depuis le menu &amp;quot;Patient - Catégorie - Nouvelle catégorie&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Onglet Antécédents/Traitements ====&lt;br /&gt;
A compléter &lt;br /&gt;
&lt;br /&gt;
==== Onglet Notes ====&lt;br /&gt;
A compléter &lt;br /&gt;
&lt;br /&gt;
==== Onglet Documents ====&lt;br /&gt;
* Cette page permet de joindre des pièces jointes (images de scanners, d&#039;échographie, documents words, ...)&lt;br /&gt;
Mais elle permet aussi de générer des documents OpenOffice à partir d&#039;un modèle. Le modèle courrier_consult.odt est fourni en example. &lt;br /&gt;
* Pour générer un document, il faut choisir le modèle, éventuellement la fiche Bio associée puis cliquer sur Générer.&lt;br /&gt;
Le modèle sera utilisé et toutes les balises variables seront remplacées par les infos du patient ou de la consultation.&lt;br /&gt;
* Pour faire son propre modèle de document, voir la page [[Créer un modèle de document ODT]].&lt;br /&gt;
Les balises suivantes sont disponibles en plus de celle standard de Dolibarr:&lt;br /&gt;
{{TagsOdtCabinetMed}}&lt;br /&gt;
&lt;br /&gt;
== Menu Bilan consultations ==&lt;br /&gt;
Choisir le menu Bilan consultations fait apparaitre un tableau affichant pour les 3 dernières années, les revenus avec le détail par mois.&lt;br /&gt;
En cliquant sur un mois, cela déroule le détail sur chaque jour du mois.&lt;br /&gt;
Il est aussi possible depuis cet écran d&#039;exporter le détail dans un fichier Excel.&lt;br /&gt;
&lt;br /&gt;
Copie d&#039;écran exemple (cliquez sur l&#039;image pour agrandir):&lt;br /&gt;
&lt;br /&gt;
[[File:Dolimed screenshot report.png|200px]]&lt;br /&gt;
&lt;br /&gt;
= Développement =&lt;br /&gt;
{{TemplateModNLTechnoEn}}&lt;/div&gt;</summary>
		<author><name>Aikhan</name></author>
	</entry>
</feed>