Difference between revisions of "Developer documentation"

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search
m (New page: == Global informations == This chapter contains global informations that must be read before to start any development on Dolibarr. # To known before to start # [[Environment and develo...)
 
m
Tag: 2017 source edit
 
(149 intermediate revisions by 12 users not shown)
Line 1: Line 1:
== Global informations ==
+
<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 -->
# [[To known before to start]]
+
<!-- Do NOT edit this section
# [[Environment and development tools]]
+
    Links below are automatically managed by PolyglotBot
# [[Dependencies and external libraries]]
+
    You can edit links on the English source page : Developer_documentation -->
# [[Langage and development rules]]
+
[[fr:Documentation_Développeur]]
# [[FAQ_Developer#R.C3.A9cup.C3.A9rer.2Fmettre_.C3.A0_jour_la_version_CVS_d.C3.A9veloppeur|Get a version from CVS]]
+
[[es:Documentación_Desarrolladores]]
 +
[[de:Entwickler_Dokumentation]]
 +
[[zh:开发文档]]
 +
[[ja:JA_Developer_documentation]]
 +
<!-- END interlang links -->
  
== Technical setup of Dolibarr ==
+
This page is main index of documents relating to developer documentation. For user documentation [[User documentation|see here]].
Dolibarr setup (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.
 
  
== Database ==
 
# [[Naming rules]]
 
# [[List of tables]]
 
# [[Database structure update]]
 
  
== Understand an existing module ==
+
=Development organization and tools=
Documentations, for developers, for a standard business modules, are defined on page [[ModulesEn]].
+
This chapter contains global information that must be read before starting any development on Dolibarr.
  
List of other modules is defined on page [http://wiki.dolibarr.org/index.php?title=Category:Complementary%20modules&]
+
#[[Dolibarr Project|Organization of project]]
 +
#[[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]]
  
== Développer un nouveau module/extension pour les IHM (nouveaux écrans) ==
+
=Coding rules and best practices=
Cette section décrit comment développer un nouveau module sur l'interface utilisateur de Dolibarr (IHM).
 
Un module pour l'IHM contient aussi bien des écrans que des données propres, voir une feuille de style.
 
Le développement de script ne rentre pas dans ce périmètre et est décrit au chapitre suivant.
 
Le développement de modules de numérotations, de documents, de thèmes ou de triggers est décrit dans des chapitres suivants également.
 
  
Pour développer votre propre module d'extension des IHM, aller sur le didacticiel: [[Developpement module]]
+
#[[Prerequisite|Prerequisites]]
 +
#[[Language and development rules|Language and development rules (PHP, SQL, HTML)]]
 +
#[[:Category:Table SQL|List of tables]]
 +
#Tree structure of files and classes are available in the [https://doxygen.dolibarr.org/ doxygen generated documentation]
  
== Développer un script ligne de commande ou batch ==
+
=List of modules=
Cette section décrit la procédure pour développer son propre script batch afin de réaliser des traitements dans Dolibarr (lecture, eccriture, etc...).
+
Technical documentation on standard business modules is available in each module's developer documentation pages. Choose the appropriate page you are interested in:
La réalisation de modification sur l'interface utilisateur (IHM) ne rentre pas dans ce périmètre. Voir le chapitre précédent pour cela.
 
  
Pour développer un script quel qu'il soit, comme un script de traitement cron ou encore un script d'import de données issus d'un autre système, se référer à la page: [[Developpement script]]
+
*[[:Category:List of Modules (developer)‎|List of standard modules]]
 +
*[[:Category:Complementary modules|List of complementary modules]]
 +
*[[Informations for developpers of complementary modules]]
  
== Le Système de paramétrage ==
+
=To develop a new module/addon for GUI=
Il existe 2 niveaux de paramétrage dans Dolibarr.
+
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.
* Le global est stocké dans la [[Table llx_const]].
 
* Le paramétrage propre à un utilisateur est stocké dans la [[Table llx_user_param]]
 
  
Voir la page [[Constantes]]
+
Script development is not included in this section (this is described in the next chapter).
  
== Le Système de menus ==
+
To develop your own module, check the [[Module development]] tutorial.
Voir la page [[Système de menus]]
 
  
== Le Système des thèmes ==
+
=To develop a batch or command line script=
Voir la page [[Themes]]
+
This chapter describes how to develop command line scripts to execute tasks in Dolibarr (read, update data...).
  
== Le Système des boites ==
+
Making modifications to the graphical user interface (GUI) is not included in this chapter. See the previous chapter for this.
Voir la page [[Système des boites]]
 
  
== Le Système d'authentification ==
+
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.
Voir la page [[Authentification]]
 
  
== Le Système des permissions ==
+
=Technical components of Dolibarr=
Voir la page [[Permissions]]
+
==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).
  
== Le Système de traduction ==
+
Paths to use to add new files by a new module are defined in the documentation to develop a new module (see [[Module development]]).
Voir la page [[Système de traduction]]
 
  
== La Gestion d'erreur ==
+
==Setup storage==
 +
There are 3 places for Dolibarr setup parameters.
  
* Voir la page [[Gestion d'erreur]]
+
*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]]
 
  
== Les modules de numérotation ==
+
:See [[Configuration file]] for more information.
Pour chaque entité crée dans l'application, Dolibarr attribue une référence. Afin de pouvoir adapter cette référence à toute utilisation, Dolibarr utilise des modules pour définir la règle de génération de cette référence. Des modules sont fournis en standard donc certains sont génériques et permettent de définir le masque de numérotation (nombre sur x caractère, avec ou sans prefix, incluant la date ou pas, etc), ce qui permet de répondre à la plupart des besoins. Toutefois, il existe toujours des cas où le module fourni en standard ne répond pas au besoin. Dans ce cas il est nécessaire de développer son propre module de numérotation.
 
Plus d'information sur la page [[Créer un module de numérotation]]
 
  
== Les modèles et la géneration de documents ==
+
*Global features parameters are stored in [[Table llx_const]].
Plus de documentation au sujet de la génération de documents depuis des modèles est disponible sur la page [[Creer un modele de document]]
 
  
== Le stockage des fichiers/documents ==
+
:See the [[Constants]] page for more information.
Voir la page [[Document générés]]
 
  
== Les exports/imports de masse ==
+
*Feature parameters specific to a user are stored in [[Table llx_user_param]].
# [[Imports de masse]]
 
# [[Exports|Exports de masse]]
 
  
== Interfaces et liens avec d'autres applications ==
+
==Business objects==
# [[Interfaces Dolibarr vers exterieur]] (Triggers Dolibarr)
+
See [[Business Objects]]  
# [[Interfaces Exterieur vers Dolibarr]]
 
# [[Services Web]]
 
  
== FAQ ==
+
==Menus system==
# [[FAQ Développeur]]
+
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 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]]
 +
 
 +
=FAQ=
 +
All FAQs are available through the FAQ index page [[:Category:FAQ EN|FAQ EN]]
 +
[[Category:Development]]

Latest revision as of 14:46, 19 January 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:

FAQ

All FAQs are available through the FAQ index page FAQ EN