Commit graph

155222 commits

Author SHA1 Message Date
Laurent Destailleur
3e95b7057c Fix bad picto on not allowed left menu 2026-07-13 13:39:25 +02:00
Laurent Destailleur
1d5acc6268 FIX bad dol_eval test when method is wrong 2026-07-13 13:17:41 +02:00
Laurent Destailleur
1b4f92b543 Fix warning 2026-07-13 12:13:35 +02:00
Laurent Destailleur
22c3b23d56 Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2026-07-13 12:07:16 +02:00
minimexat
9105fa4813
FIX: escape session list fields (#39129)
* FIX: Escape session list fields

* FIX: Cast nullable session fields before escaping

* Update ChangeLog with new features and fixes

---------

Co-authored-by: f-hoedl <hoefla14@htl-kaindorf.ac.at>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-07-13 12:05:08 +02:00
Laurent Destailleur
f96a4af9f3 Doc 2026-07-13 12:04:47 +02:00
minimexat
6b71832a44
FIX: escape cron command attributes (#39126)
* FIX: escape cron command attributes

* Update ChangeLog

---------

Co-authored-by: f-hoedl <hoefla14@htl-kaindorf.ac.at>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-07-13 12:02:09 +02:00
minimexat
049851bc31
FIX: require invoice right for order mass invoice action (#39139)
* FIX: Require invoice right for order mass invoice

* Update list.php

* Update ChangeLog

---------

Co-authored-by: f-hoedl <hoefla14@htl-kaindorf.ac.at>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-07-13 12:01:16 +02:00
Laurent Destailleur
0726bf945a Typo 2026-07-13 11:59:49 +02:00
Laurent Destailleur
d1e679633f Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2026-07-13 11:48:52 +02:00
Laurent Destailleur
2cd4aa3abb Doc 2026-07-13 11:48:42 +02:00
minimexat
95701131bc
FIX: use generic online signature token fallback (#39138)
* FIX: Use generic online signature token fallback

* FIX: Avoid nullable source in signature token lookup

* FIX: Initialize online signature message

* FIX: Print online signature error directly

---------

Co-authored-by: f-hoedl <hoefla14@htl-kaindorf.ac.at>
2026-07-13 11:45:45 +02:00
Laurent Destailleur
f6b4073c3f Fix fatal error 2026-07-13 11:37:27 +02:00
Laurent Destailleur
80ace0d0cb Complete template issue 2026-07-13 10:50:17 +02:00
Laurent Destailleur
5ec93d9c94 Debug v24 2026-07-13 10:35:52 +02:00
Laurent Destailleur
8e4cb12e3b Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2026-07-13 10:02:45 +02:00
Laurent Destailleur
d02749d15b css 2026-07-13 10:02:23 +02:00
Pichinov-Jose
1aeec05d80
Fix: MCP server propagates authenticated service user to tools (#38294)
The MCP server (htdocs/ai/server/mcp_server.php) loads a service user
from AI_MCP_USER_ID but does not expose it as the PHP global $user.
Several tool classes call 'global $user' to identify the caller --
they therefore see no authenticated user in HTTP MCP context (no PHP
web session exists) and return 'User not authenticated' even though
authentication via X-API-Key/Bearer has already succeeded.

This breaks roughly 40% of the MCP tools shipped by the module when
called from external clients (Claude Desktop Custom Connectors,
Claude Code CLI, MCP Inspector, custom scripts).

Two complementary fixes applied:

1. mcp_server.php: after successfully loading the service user,
   assign it to $GLOBALS['user'] and the local $user variable. This
   acts as a safety net for any tool (current or third-party) that
   relies on the legacy 'global $user' pattern.

2. Three tool classes harmonize their constructor signatures with
   the McpHandler contract -- new $className($db, $user, $conf):
   - ToolCrudObjects (htdocs/ai/tools/crud_objects.class.php)
   - ToolInvoices (htdocs/ai/tools/invoices.class.php)
   - ToolReports (htdocs/ai/tools/reports.class.php)

   These now accept $user via constructor (matching the pattern
   already used in ToolThirdParty, ToolCategories, ToolProducts)
   and store it as $this->user. Methods that previously called
   'global $user' (execute, validateInvoice, payInvoice) now use
   the injected $this->user, with a fallback to the global for
   web-session contexts.

Tested with:
- create_other_document (proposal, supplier_invoice): works
- search_invoice, validate_invoice, pay_invoice: works
- get_sales_report, get_purchase_report: works
- AI Assistant web UI: unchanged, no regression
2026-07-13 06:57:42 +02:00
Jam Balaya
217e32c6c1
FIX: undefined $objcanvas/$socid in societe thirdparty canvas templates (#39116)
Canvas::display_canvas() (htdocs/core/class/canvas.class.php) includes these
templates from inside a method and only imports $db,$conf,$langs,$user,
$canvas,$form,$formfile via 'global'. $objcanvas and $socid are never
brought into that scope, so they were undefined at runtime (the templates
already reconstruct the thirdparty object from $GLOBALS['objcanvas']).

- Derive $socid from the in-scope thirdparty object ($soc->id / $object->id),
  fixing the empty socid used for $filedir/$urlsource/showdocuments().
- Replace the bare $objcanvas->control->object with the already-derived $soc
  (company) / $object (individual).

For the company template $socid was previously masked from PHPStan by a
'@var int $socid' docblock; it is now actually defined.
2026-07-11 14:19:44 +02:00
MDW
d8f9286a25
Qual: Fix database typo (DoliDb -> DoliDB) (#39060)
# Qual: Fix database typo (DoliDb -> DoliDB)
The database handler type was updated from `DoliDb` to `DoliDB` in both `bookkeepingtemplate.class.php` and `bookkeepingtemplateline.class.php`.
2026-07-10 17:51:12 +02:00
MDW
1a1eafe74f
Qual: Update PHPDoc for setAsSelect method (#39061)
# Qual: Update PHPDoc for setAsSelect method

- Update the type definition of the $fieldOptions parameter in the setAsSelect method to make the color, picto, labelhtml, and note fields optional.
2026-07-10 17:50:47 +02:00
Nathan
95bcefbb9e
FIX: #39068 Ignore warning text in product search (#39071) 2026-07-10 17:46:28 +02:00
Francis Appels
0a3ba8e740
Revert "NEW: Show bom net needs treeview by line position. (#37459)" (#39083)
* Revert "NEW: Show bom net needs treeview by line position. (#37459)"

This reverts commit b02f1a4ebf.

* Update changelog and fix stan

* fix stan
2026-07-10 17:44:53 +02:00
Nathan
7612b0f74d
fix: correct import types phpdoc (#39096) 2026-07-10 17:28:02 +02:00
Laurent Destailleur
831c241c44 Debug v24 2026-07-10 14:39:11 +02:00
Laurent Destailleur
f3e3f55d6c Debug v24 2026-07-10 14:34:25 +02:00
Laurent Destailleur
d03101fae1 Doc and clean code (viewimage and document must follow same rules) 2026-07-10 14:22:08 +02:00
Laurent Destailleur
24b1b99c89 Sec possible injection during import - reported by Michael Holmquist
(Hasplabs)
2026-07-10 01:47:02 +02:00
Laurent Destailleur
a37aef26f7 Trans 2026-07-09 23:56:10 +02:00
Laurent Destailleur
52391ad574 Debug v24 2026-07-09 23:55:10 +02:00
Laurent Destailleur
eabfca88c5 Fix option to show statistics pages in menu. 2026-07-09 23:37:45 +02:00
Laurent Destailleur
9c45956003 Debug v24 2026-07-09 23:20:58 +02:00
Laurent Destailleur
09907cd37d Debug v24 2026-07-09 23:06:32 +02:00
Laurent Destailleur
83f566d5ac Fix: default color of subtotal lines in PDF 2026-07-09 16:59:35 +02:00
Laurent Destailleur
986b067ce5 css 2026-07-09 16:26:08 +02:00
Laurent Destailleur
e9caac12bb Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2026-07-07 15:43:41 +02:00
Laurent Destailleur
264a44defb Fix duplicate function. Missing sanitization of file path - credit
Michael Holmquist, HASP Labs.
2026-07-07 15:43:14 +02:00
GregcodeOhm
7c5ef541a6
FIX #38981 product/stats/facture.php fatal error when invoice module is disabled (#39049)
The massaction sendEmail feature added to this page for v24 by 8f0b7e3f
(#37937) reads $conf->invoice->dir_output and includes
core/actions_massactions.inc.php on every page load. When the invoice
module is disabled, dir_output is empty, so the include hits its
protection ('$objectclass or $uploaddir was not defined') and exits.
The referers tab built by product_prepare_head() links to this page
unconditionally, so any v24 install without the invoice module gets a
fatal error on the product referers tab. In 23.0 the page had no mass
action code and rendered fine without the module.

Make the whole massaction machinery conditional on isModEnabled('invoice'):
do not read dir_output, do not propose the mass action, neutralize
$massaction and skip the actions_massactions include when the module is
off. This restores the 23.0 behavior for installs without the invoice
module and changes nothing when the module is enabled.

Signed-off-by: GregcodeOhm <greg.aliot@gmail.com>
Co-authored-by: GregcodeOhm <greg.aliot@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 00:27:55 +02:00
Laurent Destailleur
c37923f9b1 Doc 2026-07-06 23:58:07 +02:00
Laurent Destailleur
5a6d518cac Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2026-07-06 23:56:01 +02:00
Laurent Destailleur
b281cfea57 Update AGENTS.md 2026-07-06 23:55:37 +02:00
Nathan
b0835b1dc8
fix: keep full product label searchable in combo (#39057) 2026-07-06 23:42:58 +02:00
Laurent Destailleur
c160e96206 css 2026-07-04 15:02:15 +02:00
Laurent Destailleur
cd412382ca css 2026-07-04 13:36:56 +02:00
Laurent Destailleur
9032eac8d3 Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2026-07-04 13:33:29 +02:00
Laurent Destailleur
9467f22c5a Fix option to set max short list 2026-07-04 13:33:17 +02:00
ThomasNgr-OpenDSI
5f2905d54a
FIX bon prelevement SEPA generation (#38998)
* TEST : add test for bon_prelevement generation

* TEST : add tests for bank transfer SEPA file generation

* FIX WARNING : dol_syslog(array) outputs a warning.

* FIX bon prelevement : non-default IBAN were not used in the generated XML.

* BonPrelevement test : add validation against XSD

* BonVirement test : add validation against XSD

* FIX codesniffer

* Enhance test error messages

* Avoid PHP warning during tests

* TEST FIX : one bank account was not created

* TEST FIX : runnning all tests makes this one fail because  is corrupted by a previous test.

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-07-04 13:27:58 +02:00
Laurent Destailleur
1e74fc3885 FIX Export of string starting with = must be quoted in CSV. Reported by
tk gamefactory.
2026-07-03 19:30:34 +02:00
Laurent Destailleur
215cfa465d FIX Export of string starting with = must be quoted in CSV. Reported by
tk gamefactory.
2026-07-03 19:19:54 +02:00
Laurent Destailleur
c1bc4c7298 Debug v24 2026-07-03 18:35:07 +02:00