Module development: Difference between revisions

Jump to navigation Jump to search
Line 26: Line 26:


=== Create your module descriptor ===
=== Create your module descriptor ===
The first step is to create a file descriptor for the module. To do this go into the directory dev/skeletons and copy the file modMyModule.class.php in the directory '''htdocs/''mymodyle''/core/modules'''.
The first step is to create a file descriptor for the module.  
* Create directory '''/htdocs/''mymodule''/core/modules'''. Then go into the directory dev/skeletons and copy the file modMyModule.class.php in this directory '''htdocs/''mymodyle''/core/modules'''.
Then change the contents of this file to replace:
Then change the contents of this file to replace:
* all "modMyModule" with a value which corresponds to the vocation of your module. This value must always start with 'mod' and contains only alpha characters.
* all "modMyModule" with a value which corresponds to the vocation of your module. This value must always start with 'mod' and contains only alpha characters.
* $this->numero = 10000 by a number of free module (Go to '''Home page -> System Information -> Dolibarr -> Modules''' to know id already used by existing modules).
* $this->numero = 10000 by a number of free module (Go to '''Home page -> System Information -> Dolibarr -> Modules''' to know id already used by existing modules).
* Modify any other variables defined in the constructor (see comment in the code skeleton for their meaning).  
* Modify any other variables defined in the constructor (see comment in the code skeleton for their meaning).  
* Create directory /htdocs/mymodule/
Your file descriptor for your module is ready.
Your file descriptor for your module is ready.


Navigation menu