Difference between revisions of "Developer documentation"

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search
Tag: 2017 source edit
(104 intermediate revisions by 12 users not shown)
Line 1: Line 1:
= Development organization and tools =
+
<seo metak="developer, development, documentation, guide, doc, tutorial, usage, help, api, coding, standard, rules" />
This chapter contains global informations that must be read before to start any development on Dolibarr.
+
<!-- BEGIN interlang links -->
# [[Dolibarr Project|Organization of project]]
+
<!-- Do NOT edit this section
# [[To known before to start|To known before to start to develop]]
+
    Links below are automatically managed by PolyglotBot
# [[Environment and development tools]]
+
    You can edit links on the English source page : Developer_documentation -->
# [[Dependencies and external libraries]]
+
[[fr:Documentation_Développeur]]
# [[Developer_FAQ|Get the development CVS version]]
+
[[es:Documentación_Desarrolladores]]
 +
[[de:Entwickler_Dokumentation]]
 +
[[zh:开发文档]]
 +
[[ja:JA_Developer_documentation]]
 +
<!-- END interlang links -->
  
= Coding rules =
+
This page is main index of documents relating to developer documentation. For user documentation [[User documentation|see here]].
# [[Language and development rules]]
 
  
= Database =
 
# [[Naming rules]]
 
# [[List of tables]]
 
  
= Technical setup of Dolibarr =
+
=Development organization and tools=
Dolibarr setup (authentication mode, database logins and storage area for files) are defined in only one setup file conf/conf.php.
+
This chapter contains global information that must be read before starting any development on Dolibarr.
See [[Configuration file]] for more information.
 
  
= List of existing modules =
+
#[[Dolibarr Project|Organization of project]]
Technical documentations on standard business modules are available on developer documentation of each modules. Choose page you are interested in to go on it:
+
#[[To known before to start|To be known before starting to develop]]
 +
#[[Environment and development tools]]
 +
#[[Dependencies and external libraries]]
 +
#[[FAQ_Get,update_project_sources|Get or update sources of a development version]]
  
* List of standard modules is defined on page [[:Category:List of Modules|List of Modules]]
+
=Coding rules and best practices=
* List of other modules is defined on page [[:Category:Complementary modules|Complementary modules]]
 
  
= To develop a new module/addon for GUI (new screens) =
+
#[[Prerequisite|Prerequisites]]
This section describe how to develop a new module on Dolibarr graphic user interfaces (GUI).
+
#[[Language and development rules|Language and development rules (PHP, SQL, HTML)]]
A GUI module can contains its own screens, its own data and its own CSS stylesheet.
+
#[[:Category:Table SQL|List of tables]]
Script development is not included in this section (this is described in next chapter).
+
#Tree structure of files and classes are available in the [https://doxygen.dolibarr.org/ doxygen generated documentation]
Numbering modules, modules for documents generation, skins or triggers are also described in other following chapters.
 
  
To develop your own GUI extension, go on tutorial: [[Module development]]
+
=List of modules=
 +
Technical documentation on standard business modules is available in each module's developer documentation pages. Choose the appropriate page you are interested in:
  
= To develop a batch or command line script =
+
*[[:Category:List of Modules (developer)‎|List of standard modules]]
This chapter describe the way to develop its own command line script to realize Dolibarr treatments (read, update data...).
+
*[[:Category:Complementary modules|List of complementary modules]]
Making modifications on user gui interface (GUI) is not included in this chpter. See previous chapter for this.
+
*[[Informations for developpers of complementary modules]]
  
To develop a script, like a cron script or an command line import tool to import data from an external source, you can have a look at the page: [[Script development]]
+
=To develop a new module/addon for GUI=
 +
This section describes how to develop a new module changing the Dolibarr user interface. This can be screens, themes, data, its own CSS stylesheet, source code or all of this.
  
= Setup system =
+
Script development is not included in this section (this is described in the next chapter).
There is 2 area for Dolibarr parameters.
 
* Global parameters are stored in [[Table llx_const]].
 
* Parameters for particular users are stored in [[Table llx_user_param]]
 
  
See page [[Constants]]
+
To develop your own module, check the [[Module development]] tutorial.
  
= Menus system =
+
=To develop a batch or command line script=
See page [[Menus system]]
+
This chapter describes how to develop command line scripts to execute tasks in Dolibarr (read, update data...).
  
= Skins system =
+
Making modifications to the graphical user interface (GUI) is not included in this chapter. See the previous chapter for this.
See page [[Skins]]
 
  
= Box system =
+
To develop a script, like a cron script or a command line import tool to import data from an external source, you can have a look at the [[Script development]] page.
See page [[Box system]]
 
  
= Authentication system =
+
=Technical components of Dolibarr=
See page [[Authentication]]
+
==Tree structure==
 +
The path hierarchy of the current version files is available from the [http://doxygen.dolibarr.org/ doxygen generated documentation] (similar to generated "javadoc" documentation).
  
= Permission system =
+
Paths to use to add new files by a new module are defined in the documentation to develop a new module (see [[Module development]]).
See page [[Permissions En|Permissions]]
 
  
= Translation system =
+
==Setup storage==
See page [[Translation system]]
+
There are 3 places for Dolibarr setup parameters.
  
= Error management =
+
*Dolibarr technical setup parameters (authentication mode, database logins and storage area for files) are defined in only one setup file: <code>/conf/conf.php</code> .
See page [[Error reporting|Error reporting]]
 
  
= Numbering modules =
+
:See [[Configuration file]] for more information.
For each entity created in the application, Dolibarr assigns a reference. In order to adapt the reference to any use, Dolibarr use modules to define the rule of generation of this reference. Several modules are supplied with application. Some are generic and are used to define the mask numbering (number on x characters, with or without prefix, including the date or not, etc.), which can meet most needs. However, there are still cases where the modules provided does not meet the need. In this case it is necessary to develop its own numbering module.
 
  
For more information, see on page [[Create numeration module]]
+
*Global features parameters are stored in [[Table llx_const]].
  
= Numbering modules and generating documents =
+
:See the [[Constants]] page for more information.
More documentation about document generation from modeles is available on page [[Create document model]]
 
  
= Files/Documents storage management =
+
*Feature parameters specific to a user are stored in [[Table llx_user_param]].
See page [[Generated documents]]
 
  
= Mass exports/imports =
+
==Business objects==
# [[Mass imports]]
+
See [[Business Objects]]  
# [[Module Exports En|Mass exports]]
 
  
= Interfaces and links with other applications =
+
==Menus system==
# [[Interfaces Dolibarr toward foreign systems]] or toward Dolibarr (Dolibarr Triggers)
+
See [[Menus system]]  
# [[Interfaces from foreign systems toward Dolibarr]]
 
# [[Web Services]]
 
  
= FAQ =
+
==Tabs system==
All FAQ are available through index page [[:Category:FAQ EN|FAQ EN]]
+
See [[Tabs system]]
 +
 
 +
==Skins system==
 +
See [[Skins]]
 +
 
 +
==Widget system==
 +
See [[Widget system]]
 +
 
 +
==Authentication system==
 +
See [[Authentication]]
 +
 
 +
==Permission system==
 +
See [[Permissions En|Permissions]]
 +
 
 +
==Translation system==
 +
See [[Translation system]]
 +
 
 +
==Error management==
 +
See [[Error reporting|Error reporting]]
 +
 
 +
==Canvas system==
 +
Canvas is a developer feature to replace screens to create, update or view a record (products, thirdparties, contacts, ...). For example, you can replace the input form used to create a new third party, or its editing form, or replace its viewing template.
 +
 +
See [[Canvas development]]
 +
 
 +
==Triggers system==
 +
Triggers are a development feature to execute personalized code during a Dolibarr "business event" (creation of an invoice, deleting a user, update of third party, etc...), and only for a business event. To personalize code for other contexts, see the '''Hooks system''' chapter instead.
 +
 
 +
For triggers usage, see [[Interfaces Dolibarr toward foreign systems|this page]].
 +
 
 +
==Hooks system==
 +
See [[Hooks system]]
 +
 
 +
==Variable substitution system==
 +
See [[Variable substitution system]]
 +
 
 +
==Web services==
 +
Dolibarr can be setup to provide some services.
 +
 
 +
See [[Module Web Services API REST (developer)]]
 +
 
 +
Note: The [[Module Web Services API SOAP (developer)]] is deprecated.
 +
 
 +
==Files/Documents storage management==
 +
See [[Generated documents]]
 +
 
 +
==Numbering modules==
 +
For each entity created in the application, Dolibarr assigns a reference. In order to adapt the reference to any use, Dolibarr use modules to define the reference generation rule. Several standard modules are supplied. Some are generic and are used to define the numbering mask (number on x characters, with or without prefix, including the date or not, etc.), which can meet most needs. However, there are still cases where the modules provided don't meet the needs. In this case it is necessary to develop a custom numbering module.
 +
 
 +
For more information, see [[Create numeration module|Create numbering module]].
 +
 
 +
==Document templates and documents generation==
 +
 
 +
More documentation about document generation from templates is available to [[Create a PDF document template]] or [[Create an ODT document template]].
 +
 
 +
==Extrafields==
 +
See [[Extrafields]]
 +
 
 +
==Online payment system==
 +
See [[Online payment system]]
 +
 
 +
==Other internal function==
 +
There are many internal libraries your code can use.
 +
You may find a lot of generic functions in the functions.lib.php, functions2.lib.php or admin.lib.php. Any function found in htdocs/core/lib/*.lib files can be used.
 +
 
 +
'''To specify a requirement based on Dolibarr version number'''
 +
 
 +
For example, to make a condition based on requiring Dolibarr version > 3.5, you can use versioncompare and versiondolibarrarray found in admin.lib.php:
 +
 
 +
<syntaxhighlight lang="php">
 +
if (versioncompare(versiondolibarrarray(), array(3,5,0)) > 0)
 +
{
 +
...
 +
}
 +
</syntaxhighlight>
 +
 
 +
=Mass exports/imports=
 +
 
 +
*[[Mass imports]]
 +
*[[Module Exports En|Mass exports]]
 +
 
 +
=Interfaces and links with other applications=
 +
 
 +
Interfaces using API or WebHooks:
 +
 
 +
*[[Interfaces Dolibarr toward foreign systems]] or Dolibarr toward Dolibarr (Dolibarr Triggers, Hooks or WebHooks)
 +
*[[Interfaces from foreign systems toward Dolibarr]] (API WebServices)
 +
 
 +
Integrate Dolibarr to synchronization platforms:
 +
 
 +
*[[Module Splash|Integration of Dolibarr with Splash]]
 +
*[[Integration of Dolibarr with SyncHub]]
 +
 
 +
Integrate Dolibarr to automation/no code platforms:
 +
 
 +
*[[Integration of Dolibarr to the Zapier automation platform]]
 +
*[[Integration of Dolibarr to the n8n automation platform]]
 +
*[[Integration of Dolibarr to the Make automation platform]]
 +
 
 +
Integrate Dolibarr to data integration/no code platforms:
 +
 
 +
*[[Integration of Dolibarr to the Airbyte data integration platform]]
 +
 
 +
=FAQ=
 +
All FAQs are available through the FAQ index page [[:Category:FAQ EN|FAQ EN]]
 +
[[Category:Development]]

Revision as of 05:40, 4 July 2025

This page is main index of documents relating to developer documentation. For user documentation see here.


Development organization and tools

This chapter contains global information that must be read before starting any development on Dolibarr.

  1. Organization of project
  2. To be known before starting to develop
  3. Environment and development tools
  4. Dependencies and external libraries
  5. Get or update sources of a development version

Coding rules and best practices

  1. Prerequisites
  2. Language and development rules (PHP, SQL, HTML)
  3. List of tables
  4. Tree structure of files and classes are available in the doxygen generated documentation

List of modules

Technical documentation on standard business modules is available in each module's developer documentation pages. Choose the appropriate page you are interested in:

To develop a new module/addon for GUI

This section describes how to develop a new module changing the Dolibarr user interface. This can be screens, themes, data, its own CSS stylesheet, source code or all of this.

Script development is not included in this section (this is described in the next chapter).

To develop your own module, check the Module development tutorial.

To develop a batch or command line script

This chapter describes how to develop command line scripts to execute tasks in Dolibarr (read, update data...).

Making modifications to the graphical user interface (GUI) is not included in this chapter. See the previous chapter for this.

To develop a script, like a cron script or a command line import tool to import data from an external source, you can have a look at the Script development page.

Technical components of Dolibarr

Tree structure

The path hierarchy of the current version files is available from the doxygen generated documentation (similar to generated "javadoc" documentation).

Paths to use to add new files by a new module are defined in the documentation to develop a new module (see Module development).

Setup storage

There are 3 places for Dolibarr setup parameters.

  • Dolibarr technical setup parameters (authentication mode, database logins and storage area for files) are defined in only one setup file: /conf/conf.php .
See Configuration file for more information.
See the Constants page for more information.

Business objects

See Business Objects

Menus system

See Menus system

Tabs system

See Tabs system

Skins system

See Skins

Widget system

See Widget system

Authentication system

See Authentication

Permission system

See Permissions

Translation system

See Translation system

Error management

See Error reporting

Canvas system

Canvas is a developer feature to replace screens to create, update or view a record (products, thirdparties, contacts, ...). For example, you can replace the input form used to create a new third party, or its editing form, or replace its viewing template.

See Canvas development

Triggers system

Triggers are a development feature to execute personalized code during a Dolibarr "business event" (creation of an invoice, deleting a user, update of third party, etc...), and only for a business event. To personalize code for other contexts, see the Hooks system chapter instead.

For triggers usage, see this page.

Hooks system

See Hooks system

Variable substitution system

See Variable substitution system

Web services

Dolibarr can be setup to provide some services.

See Module Web Services API REST (developer)

Note: The Module Web Services API SOAP (developer) is deprecated.

Files/Documents storage management

See Generated documents

Numbering modules

For each entity created in the application, Dolibarr assigns a reference. In order to adapt the reference to any use, Dolibarr use modules to define the reference generation rule. Several standard modules are supplied. Some are generic and are used to define the numbering mask (number on x characters, with or without prefix, including the date or not, etc.), which can meet most needs. However, there are still cases where the modules provided don't meet the needs. In this case it is necessary to develop a custom numbering module.

For more information, see Create numbering module.

Document templates and documents generation

More documentation about document generation from templates is available to Create a PDF document template or Create an ODT document template.

Extrafields

See Extrafields

Online payment system

See Online payment system

Other internal function

There are many internal libraries your code can use. You may find a lot of generic functions in the functions.lib.php, functions2.lib.php or admin.lib.php. Any function found in htdocs/core/lib/*.lib files can be used.

To specify a requirement based on Dolibarr version number

For example, to make a condition based on requiring Dolibarr version > 3.5, you can use versioncompare and versiondolibarrarray found in admin.lib.php:

if (versioncompare(versiondolibarrarray(), array(3,5,0)) > 0)
{
 ...
}

Mass exports/imports

Interfaces and links with other applications

Interfaces using API or WebHooks:

Integrate Dolibarr to synchronization platforms:

Integrate Dolibarr to automation/no code platforms:

Integrate Dolibarr to data integration/no code platforms:

FAQ

All FAQs are available through the FAQ index page FAQ EN