No description
Find a file
VIAL-GOUTEYRON Quentin ea54342891
NEW Drag and drop a file on the 23 remaining cards (#39473)
* FIX Drag and drop of a file reports a wrong error, or none at all

The error handler of dragAndDropFileUpload() had three defects that all end on
the user believing the file was attached when it was not.

 - The first assignment of the message was dead code, there was no return after
   the test on the http code 403, so a refusal was reported as a generic error.
 - The key ErrorUploadPermissionDenied it used exists in no language file, so
   the raw key was shown.
 - JSON.parse() was called with no try/catch on an answer that is not always a
   json, a fatal error of the endpoint or a request over post_max_size for
   example. The exception left the user on a page with no message at all.
 - An empty list of files was treated as a success, while it means the endpoint
   stored nothing.

The value of PHP_SELF is also escaped before it is written into the 6 generated
javascript strings. It holds the path info of the request on a server that
accepts it, so it is a user input. dol_escape_js() is called with the mode that
escapes a double quote by a double quote, the strings being delimited by double
quotes, and the sequence '</' is escaped too because the function does not do it
and the path info could otherwise close the script tag and open one of its own.

Adds the key ErrorOnAtLeastOneFileUpload to en_US, used when some files of a
batch failed and some did not.

* FIX getMultidirOutput returns a directory the Documents tab does not read

Four defects of the same function, all ending on a file stored where the user
will never see it, or written outside the documents directory.

 - The ref of the project of a task was only passed through dol_sanitizePathName(),
   which keeps a slash, a colon and the accented chars, while projet/tasks/document.php
   sanitizes it with dol_sanitizeFileName(). A project ref holding a slash even
   created an extra level of directory. Measured on real databases: 304 projects
   over 330 hold a slash on one of them, carrying 701 tasks over 824.
 - The same case calls $object->fetchProject() with no guard, while the signature
   of the function accepts an object that is not a CommonObject, and even a null
   when a module is given. Such a caller gets a fatal error where it expects the
   error string. No core caller is in that case today, an external module or a
   hook can be.
 - The entity of the object may have no declared directory, an object shared by
   another entity for example. The undefined index returned a relative path, so
   the caller read or wrote under the web root. The current entity is used
   instead, and the fallback is logged because the directory is then not the one
   of the entity of the object, which matters for a caller that deletes files.
 - When the current entity has no declared directory either, the fallback
   returned the sub directory alone, again a relative path. The same error than
   for a module that declares no directory at all is now returned.

Adds the sub directory of a partnership and of a stock transfer, which their own
document tabs already read.

* FIX getElementProperties answers wrong properties for 9 elements

A customer payment, a supplier payment, a various payment, a stock transfer and
the 4 objects of the hrm module had no properties at all, or wrong ones, so any
caller that resolves a class, a table or a document directory from an element
failed on them.

 - payment, payment_supplier and payment_various had no branch. The branch of a
   customer payment tests $elementType and not $element, because the rule on the
   elements named myobject_mysubobject rewrites $element to 'payment' for
   'payment_salary' too, which is stored somewhere else.
 - job, position, skill and evaluation answered a wrong table (hrm_job_user for
   a position, and so on) and no sub directory, while their document tabs read
   one named after the element.
 - stocktransfer answered an empty classname, because it is not the ucfirst() of
   the element, so a caller doing new $classname($db) ended on a fatal error.
 - The sub directory was concatenated even when the module is disabled and the
   directory is empty, which answered a path at the root of the file system.
 - A contact and a conference are stored into a sub directory their tab reads.

isModEnabled('invoice') is tested for a customer payment: there is no module
named 'compta', so testing it was always false, while $conf->compta->payment is
set unconditionally by Conf::setValues() and could not be used as a proxy.

* FIX Access refused to everyone on 11 objects of the core

restrictedArea() and checkUserAccessToObject() refuse the access to objects that
no permission and no rule can match, whatever the user, an administrator
included.

 - The hrm module declares no permission at its first level, only 'all', and the
   stocktransfer module only 'stocktransfer'. A check on the module itself
   therefore tests a permission that does not exist. The mapping is the same one
   as into User::hasRight().
 - The module of an event organization declares no permission at all, its whole
   permission block being commented out on purpose, and its cards check the
   parent project instead. The feature is mapped onto that project, with the two
   guards the card has: an external user is refused, and so is a conference with
   no parent project, whose id of 0 would otherwise grant an access with no check
   on the record at all.
 - The default rule of checkUserAccessToObject() builds its sql on the columns
   entity and fk_soc of the table. llx_asset, llx_paiement, llx_paiementfourn and
   llx_workstation_workstation have no fk_soc, and llx_hrm_job, llx_hrm_job_user
   and llx_hrm_skill have neither. The sql failed, so the access was refused to
   every user this rule applies to. These tables are now checked on their entity
   only, which is what the $check rule already does for the same class of tables,
   and the 3 tables of hrm can be checked on nothing at all. The rule is selected
   on the table and not on the element, because $object is an id and not an
   object for most of the callers, the cards of an asset and of a workstation
   included, which are broken today for any user without the permission to see
   all third parties.
 - An external user is refused explicitly on those tables: none of these objects
   is linked to a third party, so the default rule refused him through a link
   that does not exist, and the rules that replace it do not look at the third
   party of the user at all.

Measured on a vanilla instance with 5 profiles, an administrator, an internal
user with every right, one without the permission to see all third parties, one
that is not a sales representative of the third party of the object, and an
external user: the 11 objects go from refused to granted for the internal users
and stay refused for the external one, and the 26 other elements answer exactly
the same for the 5 profiles.

* FIX A file dropped on a card is lost, or reported as refused when it was stored

FileUpload stores the file into a directory that the "Attached files" tab of the
object never reads, so the user attaches a file that no screen will ever show,
and nothing is indexed in database to find it back. Measured on real databases:
216487 thirdparties over 216887 and 157852 products over 280319 are in that case
on the cards that already enable the drag and drop.

 - The directory of the object is now forged with get_exdir(), the way the tabs
   do: it always uses the id for a thirdparty, whose ref is a company name and is
   not unique, and it falls back on the id when the ref is empty. The sub
   directory of the module is read with getMultidirOutput(), which knows the
   elements that store their documents into one. That function does not return
   an empty string when it fails but a string starting with 'error-', so only an
   absolute path is accepted: writing into that string would create the files
   under the web root.
 - fetchObjectByElement() returns an object even when fetch() returned 0. The
   object was then not loaded, and the file was stored at the root of the
   directory of the module, out of any object. The constructor now throws, and
   the endpoint answers the error with the same json contract than a successful
   call so that the caller can show it, instead of a fatal error and an http 500.
 - An attachment of the same name was silently overwritten, dol_move_uploaded_file()
   being called with $allowoverwrite = 1 while the name was checked before the
   ref of the object was added as a prefix. The check is done again on the final
   name, and on the .noexe suffixed name too, which that function appends to an
   executable file.
 - An executable file was renamed with that .noexe suffix and then reported as an
   error, while it was correctly stored.
 - The endpoint called restrictedArea() with an empty feature when the element is
   unknown, and the loop of that function then takes no branch at all and grants
   the access with no check. It refuses before, with the same http code and the
   same message than a refusal, so that a user cannot tell an object that exists
   but is not allowed from an object that does not exist. The refusal of an
   external user on an object of another third party answered a message of its
   own, which allowed the same enumeration.

Comes with the tests of the path resolution, of the fallback of get_exdir(), of
the rejection of the error string of getMultidirOutput(), and of the file name
deduplication.

* FIX Remove the drop area from 13 cards where dropping a file is harmful

Two distinct groups, both of them removing a drop area that only produces a
result the user does not want.

7 pages have no "Attached files" tab at all, so a file dropped on them can be
reached by no screen: a fiscal year and its info page, an accounting model, a
webhook trigger history, an intracomm report, a bookcal calendar and its booking
list. Measured: 4 of them accepted the upload and wrote an orphan file, the
accounting model wrote it at the root of the directory of the module, out of any
object, and the 2 bookcal ones answered an http 500.

6 cards print their tabs inside their edit form, so the drop area covered that
form: a product, an expense report, a VAT payment, a social contribution, a loan
and a salary. Dropping a file there reloads the page, which discards what the
user is typing. A product and an expense report have a second call for the read
only view, so the drop area is only removed from the call of the edit branch;
the 4 others share a single call between both views, so the parameter is now
conditional.

* NEW Drag and drop a file on the 23 remaining cards

Every card of the core that owns an "Attached files" tab can now receive a file
by drag and drop, which was the case of 32 of them only. The 23 added here are
an asset, an event, a various payment, a customer payment, a contact, a donation,
a conference or booth, a shipment, a supplier payment, a leave request, an
evaluation, a job, a position, a skill, a knowledge record, a manufacturing
order, a partnership, a lot, a stock transfer, a task, a reception, a resource
and a workstation.

The tab bar of a leave request and of a resource is printed inside their edit
form, so the drop area is not enabled there: dropping a file reloads the page,
which would discard what the user is typing. The card of a supplier payment
prints its tab bar even when the object was not loaded, so the drop area is only
enabled when it is.

* FIX getMultidirOutput refuses an entity with no directory instead of falling back [skip-claudemd]

The previous revision of this PR fell back on the directory of the current
entity when the entity of the object had none, with a LOG_WARNING. On a
multicompany install that made a caller read, write and above all delete
files in the directory of another entity. Refuse instead: the function
already answers 'error-diroutput-not-defined-for-this-object' when the
module declares no directory at all, so the caller has one behaviour to
handle, not two.

The entity is cast to int, which is what the array index needs and what
silences the four PhanTypeMismatchDimFetchNullable this function reported.

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-08-19 02:46:21 +02:00
.agents Qual: Update Dolibarr Development AI SKILL (#39353) 2026-08-05 10:24:23 +02:00
.github Bump mdeweerd/logToCheckStyle from 2026.7.1 to 2026.8.2 (#39565) 2026-08-19 01:16:46 +02:00
.phan
.tx Update config for tx transifex (#37897) 2026-04-16 13:18:37 +02:00
dev NEW Link manage extrafields and phpunit test for the class (#39514) 2026-08-19 02:18:46 +02:00
doc Clean files 2026-01-07 19:01:54 +01:00
htdocs NEW Drag and drop a file on the 23 remaining cards (#39473) 2026-08-19 02:46:21 +02:00
scripts QUAL add hook printWebsitePageContent (#39576) 2026-08-19 01:01:45 +02:00
test NEW Drag and drop a file on the 23 remaining cards (#39473) 2026-08-19 02:46:21 +02:00
.agentsignore Default ai cli setup 2026-08-09 23:58:19 +02:00
.codeclimate.yml Update files after moving build into dev/ 2025-01-05 14:46:26 +01:00
.editorconfig Qual: Update pre-commit for shell script formatting (#37221) 2026-02-17 22:05:03 +01:00
.gitattributes Update gitattributes 2025-12-22 14:48:46 +01:00
.gitignore chore: ignore .worktrees/ directory used for isolated agent workspaces 2026-08-11 16:31:29 +02:00
.mailmap Fix mailmap file 2026-07-15 00:56:44 +02:00
.pre-commit-config.yaml Qual: Fix PHPStan for 23.0 + pre-commit backports (#39192) 2026-07-16 11:29:42 +02:00
.travis.yml Add migration to v25 2026-08-13 12:53:10 +02:00
ChangeLog pdf logo header mutualization (#39503) 2026-08-19 02:37:18 +02:00
composer.json.disabled
COPYING
COPYRIGHT Merge branch 'fix_dev_remove_unused_jeditable' of 2026-05-11 01:49:01 +02:00
DCO
phpstan.neon.dist CI 2026-05-22 12:17:17 +02:00
pyproject.toml Qual: Fix PHPStan for 23.0 + pre-commit backports (#39192) 2026-07-16 11:29:42 +02:00
README.md Update link for European directives in README (#38115) 2026-05-07 10:05:17 +02:00
robots.txt Clean files 2026-01-07 19:01:54 +01:00
SECURITY.md Update file 2026-08-13 02:59:53 +02:00

DOLIBARR ERP & CRM

Downloads per day Docker hub pulls Minimum PHP Version GitHub release CII Best Practices

Dolibarr ERP & CRM is a modern software package that helps manage your organization's activities (contacts, quotes, invoices, orders, stocks, agenda, human resources, ecm, manufacturing…).

It's an Open-Source Software suite (written in PHP with JavaScript enhancements) designed for small, medium or large companies, foundations and freelancers.

You can freely use, study, modify or distribute it according to its license.

You can use it as a standalone application or as a web application to access it from the Internet or from a LAN.

Dolibarr has a large community ready to help you, free forums and preferred partners ready to offer commercial support should you need it

ScreenShot

LICENSE

Dolibarr is released under the terms of the GNU General Public License as published by the Free Software Foundation; either Version 3 of the License, or (at your option) any later version (GPL-3+).

See the COPYING file for a full copy of the license.

Other licenses apply for some included dependencies. See COPYRIGHT for a full list.

INSTALLING

There is a lot of different solutions to install Dolibarr.

Using packages

If you have low technical skills and you're looking to install Dolibarr ERP/CRM with just few clicks, you can use one of the packaged versions (see next chapter if you have IT knowledge) :

Releases can be downloaded from official website.

You can use any web server supporting PHP (Apache, Nginx, ...) and a supported database (MariaDB, MySQL or PostgreSQL) to install the standard version:

  • Verify that your installed PHP version is supported see PHP support.

  • Uncompress the downloaded .zip archive to copy the dolibarr/htdocs directory and all its files inside your web server root or get the files directly from GitHub (recommended if you know git as it makes it easier if you want to upgrade later):

    git clone https://github.com/dolibarr/dolibarr -b x.y (where x.y is the main version like 9.0, 19.0, ...)

  • Set up your web server to use dolibarr/htdocs as root if your web server does not already define a directory to point to.

  • Create an empty htdocs/conf/conf.php file and set write permissions for your web server user (write permission will be removed once install is finished)

  • From your browser, go to the dolibarr "install/" page

    The URL will depend on how your web configuration directs to your dolibarr installation. It may look like:

    http://localhost/dolibarr/htdocs/install/

    or

    http://localhost/dolibarr/install/

    or

    http://yourdolibarrvirtualhost/install/

  • Follow the installer instructions

Using Docker images

Dolibarr is also available as a Docker image. Installation instructions are available here.

Using ready to use SaaS/Cloud offers

If you lack the time to install it yourself, consider exploring commercial 'ready-to-use' Cloud offerings (refer to https://saas.dolibarr.org). Keep in mind that this third option comes with associated costs.

UPGRADING

Dolibarr supports upgrading, usually without the need for any (commercial) support (depending on if you use any commercial extensions). It supports upgrading all the way from any version after 2.8 without breakage. This is unique in the ERP ecosystem and a benefit our users highly appreciate!

Follow these step-by-step instructions to seamlessly upgrade Dolibarr to the latest version:

  • At first make a backup of your Dolibarr files & then see
  • Verify that your installed PHP version is supported by the new version see PHP support.
  • Overwrite all old files from the 'dolibarr' directory with files provided in the new version's package.
  • At your next access, Dolibarr will redirect you to the "install/" page to follow the upgrade process.  If an install.lock file exists to lock any other upgrade process, the application will ask you to remove the file manually (you should find the install.lock file in the directory used to store generated and uploaded documents, in most cases, it is the directory called "documents").

WHAT'S NEW

See the ChangeLog file.

FEATURES

Main application/modules (all optional)

  • Third-Parties Management: Customers, Prospects (Leads) and/or Suppliers + Contacts
  • Members/Membership/Foundation management

Product Management

  • Products and/or Services catalogue
  • Stock / Warehouse management + Inventory
  • Barcodes
  • Batches / Lots / Serials
  • Product Variants
  • Bill of Materials (BOM)
  • Manufacturing Orders (MO)
  • Workstations / Workplaces

Customer/Sales Management

  • Customers/Prospects + Contacts management
  • Opportunities or Leads management
  • Commercial proposals management (online signing)
  • Customer Orders management
  • Contracts/Subscription management
  • Interventions management
  • Ticket System (+ Knowledge management)
  • Partnership management
  • Shipping management
  • Customer Invoices/Credit notes and payment management
  • Point of Sale (POS)

Supplier/Purchase Management

  • Suppliers/Vendors + Contacts
  • Supplier (pricing) requests
  • Purchase Orders management
  • Delivery/Reception
  • Supplier Invoices/Credit notes and payment management
  • INCOTERMS

Finance/Accounting

  • Invoices/Payments
  • Bank accounts management
  • Direct debit and Credit transfer management (European SEPA)
  • Accounting management
  • Donations management
  • Loan management
  • Margins
  • Reports

Collaboration

  • Shared calendar/agenda (with ical and vcal import/export for third-party tools integration)
  • Projects & Tasks management
  • Event organization
  • Ticket System
  • Surveys

HR - Human Resources Management

  • Employee leave management
  • Expense reports
  • Recruitment management
  • Employee/staff management
  • Timesheets

Other application/modules

  • Electronic Document Management (EDM)
  • Bookmarks
  • Reporting
  • Data export/import
  • Barcodes
  • LDAP connectivity
  • Click-To-Dial integration
  • Mass emailing
  • RSS integration
  • Social platforms linking
  • Payment platforms integration (PayPal, Stripe, Paybox...)
  • Email-Collector
  • AI support via API

(around 100 modules available by default, 1000+ addons at the official marketplace Dolistore.com)

Other general features

  • Multi-Language Support (Localization in most major languages)
  • Multi-users and groups with finely-grained rights
  • Multi-Currency
  • Multi-Company (by adding an external module)
  • Very user-friendly and easy to use
  • Customizable dashboards
  • Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one)
  • APIs (REST, SOAP)
  • Code that is easy to understand, maintain and develop (PHP with no heavy framework; trigger and hook architecture)
  • Support a lot of country-specific features:
    • Spanish Tax RE and IRPF
    • French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM)
    • Canadian double taxes (federal/province) and other countries using cumulative VAT
    • Tunisian tax stamp
    • Argentina invoice numbering using A,B,C...
    • Greece fetch customer vat details from AADE, all invoice types, MyData(external free module)
    • ZATCA e-invoicing QR-Code
    • Compatible with European directives (2006/112/CE ... 2010/45/UE)
    • Compatible with data privacy rules (Europe's GDPR, ...)
    • ...
  • Flexible PDF & ODT generation for invoices, proposals, orders...
  • ...

System Environment / Requirements

  • PHP
  • MariaDB, MySQL or PostgreSQL
  • Compatible with all Cloud solutions that match PHP & MySQL or PostgreSQL prerequisites.

See exact requirements on the Wiki

Extending

Dolibarr can be extended with a lot of other external applications or modules from third-party developers available at the DoliStore.

WHAT DOLIBARR CAN'T DO YET

These are features that Dolibarr does not yet fully support:

  • Tasks dependencies in projects
  • Payroll module
  • Native embedded Webmail, but you can send email to contacts in Dolibarr with e.g. offers, invoices, etc.
  • Dolibarr can't do coffee (yet)

DOCUMENTATION

Administrator, user, developer and translator's documentation are available along with other community resources in the Wiki.

CONTRIBUTING AND RELEASE PROCESS

This project exists thanks to all the people who contribute. Please read the instructions on how to contribute (report a bug/error, a feature request, send code, ...) [Contributing]

A View on Contributors:

Dolibarr

The release process is described into the file dev/build/makepack-howto.md

CREDITS

Dolibarr is the work of many contributors over the years and uses some fine PHP libraries.

See COPYRIGHT file.

NEWS AND SOCIAL NETWORKS

Follow Dolibarr project on:

Sponsors

Support this project by becoming a sponsor. Your logo will show up here. 🙏 [Become a sponsor/backer]