Developer documentation

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search

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