Module development: Difference between revisions

Jump to navigation Jump to search
m
Line 53: Line 53:
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.
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.


Files for your own module must be placed in a directory.
Scripts for creating tables in your own module must be placed in a directory.


Create a subdirectory called "sql" into directory of your module (eg htdocs/mymodule/sql) to put the sql scripts that you will create. Then in the "load_tables" function of your file descriptor module, modify the line
Create a subdirectory called "sql" into directory of your module (eg htdocs/mymodule/sql) to put the sql scripts that you will create. Then in the "load_tables" function of your file descriptor module, modify the line
Line 64: Line 64:
* Add the files about creating tables commands on the principle of a file '''llx_matable.sql''' per table with a possibly file '''llx_matable.key.sql''' (see existing files in '''install/mysql/tables''' for examples).
* Add the files about creating tables commands on the principle of a file '''llx_matable.sql''' per table with a possibly file '''llx_matable.key.sql''' (see existing files in '''install/mysql/tables''' for examples).


* To manage data, you must create a file called '''data.sql''' inside directory '''/mymodule/sql/''' that contains SQL command to add/edit/delete datas.
* To manage data, you must create a file called '''data.sql''' inside directory '''/mymodule/sql/''' that contains SQL command to add/edit/delete data.


Example of content of a file data.sql
Example of content of a file data.sql
304

edits

Navigation menu