Commit graph

152269 commits

Author SHA1 Message Date
Laurent Destailleur
c895a4531e Doc 2026-07-03 18:48:20 +02:00
Laurent Destailleur
b60984aa19 Merge branch '22.0' of git@github.com:Dolibarr/dolibarr.git into 23.0 2026-07-02 12:48:16 +02:00
Laurent Destailleur
850f53b11b Merge branch '21.0' of git@github.com:Dolibarr/dolibarr.git into 22.0 2026-07-02 12:39:49 +02:00
Laurent Destailleur
5bb3714ef7 Fix: use the same condition everywhere 2026-07-02 12:39:23 +02:00
Laurent Destailleur
c7ab6d6ba7 Merge branch '21.0' of git@github.com:Dolibarr/dolibarr.git into 22.0 2026-07-02 12:25:50 +02:00
reachsanjivbhagat-gif
dc2a01ff28
FIX #32909 Restrict salary/HR field edit to authorized users (#39033)
* FIX #32909 Restrict salary/HR field edit to authorized users

On the user card, a user with only "modify own info" (user->self->write)
could edit thm, tjm, salary, salaryextra and weeklyhours, even though the
display of these fields is gated on salaries->readall / hrm->employee->read.
Guard the write of these fields with the same permission used for display,
so self-service users can no longer change compensation data they are not
allowed to see.

Signed-off-by: Sanjiv Kumar Bhagat <reach.sanjiv.bhagat@gmail.com>

* Update card.php

* Update salary edit permissions logic

---------

Signed-off-by: Sanjiv Kumar Bhagat <reach.sanjiv.bhagat@gmail.com>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-07-02 12:25:04 +02:00
Laurent Destailleur
4d313cfd6a Fix warning 2026-07-01 17:10:37 +02:00
Laurent Destailleur
f8d674f324 Test disable consumming task 2026-06-30 02:05:02 +02:00
Laurent Destailleur
08e69b581d Merge branch '23.0' of git@github.com:Dolibarr/dolibarr.git into 23.0 2026-06-30 02:04:38 +02:00
Laurent Destailleur
d39bb3a3be Test disable consumming task 2026-06-30 02:04:22 +02:00
tcesar
2d7a3d2a66
Fix: mass createbills could invoice canceled or already-billed orders (#39015)
* Fix: mass createbills could invoice canceled or already-billed orders

* Update orders.lang

* fix indent
2026-06-29 20:27:37 +02:00
tcesar
9f50160528
Fix: mass createbills success message showed draft PROV ref instead … (#39013)
* Fix: mass createbills success message showed draft PROV ref instead of final ref

Extended description (corps de la PR)

  When creating an invoice from several orders at once via the order list
  mass action ("Create invoice for this customer"), with the "Validate
  generated invoices" option set to "yes", the success message and its link
  displayed the temporary draft reference (PROVxxxx) instead of the final
  validated invoice reference.

  Root cause:
  In htdocs/commande/list.php, during the confirm_createbills action, $lastref
  is captured right after $objecttmp->create($user), at which point the invoice
  is still a draft (PROVxxxx). When the "validate invoices" option is enabled,
  each invoice is then validated through $objecttmp->validate($user), which
  assigns the definitive reference to the object. However $lastref was never
  refreshed afterwards, so the "BillXCreated" message (single-invoice case) kept
  showing the draft ref.

  Fix:
  Refresh $lastref from the object inside the validation loop, after a successful
  validate(), so the success message links to and displays the final reference.

  Only the single-invoice success message exposes a reference, so this is the only
  case affected; the multi-invoice message only shows a counter.

  Steps to reproduce:
  1. Go to the orders list.
  2. Select several orders (or one), and choose the "Create invoice for this
     customer" mass action.
  3. Set "Validate generated invoices" to "Yes".
  4. Confirm.
  => Before: the success message links to the draft ref PROVxxxx.
  => After: the success message links to the final validated invoice ref.

* Fix indent
2026-06-29 20:26:29 +02:00
Laurent Destailleur
92ee0f2303 Fix - bad test permission on deleting documents api - credit Seonghyeon
Lee
2026-06-29 13:32:26 +02:00
Laurent Destailleur
0ef1eb7269 Merge branch '23.0' of git@github.com:Dolibarr/dolibarr.git into 23.0 2026-06-28 05:18:20 +02:00
Laurent Destailleur
ea79631659 Merge branch '23.0' of git@github.com:Dolibarr/dolibarr.git into 23.0 2026-06-28 05:10:17 +02:00
Laurent Destailleur
798e65356e FIX #39000 2026-06-28 05:10:04 +02:00
Pierre Ardoin
7d093dc4f4
FIX category links cleanup before deleting commercial objects (#38970)
* Delete linked categories on proposals and invoices

Ensure category links are removed when deleting proposals, supplier proposals and supplier invoices by adding DELETE queries for categorie_propal, categorie_supplier_proposal and categorie_supplier_invoice and handling DB errors. Reorganize supplier invoice delete logic so category cleanup occurs before discount freeing. Update PHPUnit tests (PropalTest, SupplierProposalTest, FactureFournisseurTest) to create a category link, assert deletion of the category row after object delete, and require the categorie class.

* Update FactureFournisseurTest.php

* Always delete linked supplier invoice categories

Remove the surrounding if(!$error) guard so the DELETE from categorie_supplier_invoice runs regardless of prior errors. This ensures linked categories are always cleaned up for the supplier invoice; preserved existing error handling to record DB failures.

* Update PropalTest.php

* Update SupplierProposalTest.php
2026-06-27 18:23:50 +02:00
nicolasVr
5ade4d0567 FIX Syntax error (#38976)
This prevented display of reminder fields
2026-06-27 17:57:37 +02:00
nicolasVr
b56e5cfcb0 FIX Syntax error (#38976)
This prevented display of reminder fields
2026-06-27 17:57:22 +02:00
Laurent Destailleur
6e101143e0 Fix showunused option in sanity_check_trans_missing_unused.sh 2026-06-27 16:53:08 +02:00
Laurent Destailleur
d9102959fd Fix showunused option in sanity_check_trans_missing_unused.sh 2026-06-27 16:52:14 +02:00
Laurent Destailleur
7166241f78 Fix showunused option in sanity_check_trans_missing_unused.sh 2026-06-27 16:51:54 +02:00
Frédéric FRANCE
51d3a3269e
do note evaluate in loop (#38995)
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-06-27 14:52:55 +02:00
Alexandre SPANGARO
17a75b47bc
Merge pull request #38991 from Boushabazakaria/fix/clone-invoice-reset-fk-code-ventilation
FIX reset fk_code_ventilation on cloned customer invoice lines
2026-06-27 03:00:10 +02:00
Alexandre SPANGARO
aa1df9f931
Merge branch '22.0' into fix/clone-invoice-reset-fk-code-ventilation 2026-06-27 02:43:59 +02:00
Laurent Destailleur
3fa1a2cae6 css 2026-06-26 17:56:12 +02:00
Laurent Destailleur
7fb6093924 Fix MAIN_SHOW_INVALID_EMAIL_IN_LIST option 2026-06-26 17:47:04 +02:00
Laurent Destailleur
a8713b2e7d Fix css 2026-06-26 17:35:35 +02:00
ThomasNgr-OpenDSI
0a810507bb
FIX : when cloning a supplier order, the date would be set to 01/01/1970 (#38270) 2026-06-26 13:26:11 +02:00
Laurent Destailleur
9679724a4d FIX in list we must not make DNS checks to validate emails 2026-06-26 11:33:43 +02:00
Régis Houssin
75fd1f451a
QUAL add MAIN_DISABLE_SHOW_INVALID_EMAIL to avoid slow display (#38992)
* QUAL add MAIN_DISABLE_SHOW_INVALID_EMAIL to avoid slow display

* FIX phpstan error
2026-06-26 11:02:30 +02:00
Zakaria Boushaba
93602a7246 Fix: reset fk_code_ventilation on cloned customer invoice lines 2026-06-26 09:23:25 +01:00
w3houde
09b979e010
Fix #34774 accept YYYYMMDDHHMMSS datep param sent by /societe/agenda.php (#38792)
* Fix #34774 accept YYYYMMDDHHMMSS datep param sent by /societe/agenda.php

htdocs/societe/agenda.php:195 builds the AddAction button URL with
&datep=...dol_print_date(dol_now(), 'dayhourlog')... which expands to
14 digits (YYYYMMDDHHMMSS). htdocs/comm/action/card.php:104 only accepts
the 8-digit YYYYMMDD variant, so the regex misses, $datep stays null
and the date/time pre-fill on the form fails.

Add a leading regex branch that decodes the dayhourlog form and falls
through to the existing 8-digit handler for legacy callers.

Signed-off-by: Dolicraft <contact@dolicraft.com>

* Fix #34774 follow-up: producer-side emit &datep=now per eldy review

PR #38792 was the consumer-side fix (accept 14-digit datep in comm/action/card.php).
Eldy pointed out the cleaner fix is producer-side: send the documented
&datep=now form that the consumer comment at line 104 already recommends
('Try to not use this. Use instead datep=now'). Apply that on the
AddAction URL in /societe/agenda.php.

Kept the consumer-side 14-digit fallback from the previous commit so any
other caller still emitting the old YmdHis form keeps working until they
are migrated too.

Signed-off-by: Dolicraft <contact@dolicraft.com>

* Fix #34774 CI: cast $search_filtert to string for urlencode (phpstan)

Signed-off-by: Dolicraft <contact@dolicraft.com>

---------

Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
2026-06-25 22:02:03 +02:00
w3houde
638c98b2b8
Fix #37357 emailcollector: pick exact source folder before falling back to first match (#38815)
Webklex/PHPIMAP getFolders() in pattern mode treats the second argument
as a sourcedir* glob, so INBOX returns INBOX plus every INBOX.* subfolder.
The collector then took $f[0], which is whichever folder the IMAP server
returned first - often an empty 'INBOX.Traites' archive - so the polling
silently scanned the wrong mailbox and reported no new mail while messages
piled up in INBOX.

Walk the returned list once and prefer the folder whose full_name matches
$tmpsourcedir exactly. Fallback to $f[0] preserves the previous behavior
when no exact match exists (e.g. server-side capitalization quirks).

Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
2026-06-25 21:42:53 +02:00
w3houde
296b33aa97
Fix #37663 guard SUBTOTALS_SPECIAL_CODE before use in printOriginLine (#38817)
SUBTOTALS_SPECIAL_CODE is only defined by the subtotals module
(htdocs/subtotals/class/commonsubtotal.class.php:24). When a PO line
is printed into a vendor invoice create screen and the subtotals module
is not loaded for the current request, htdocs/core/class/commonobject.class.php
line 5872 fatals with 'Undefined constant SUBTOTALS_SPECIAL_CODE',
hiding every origin line.

Wrap the comparison with defined() to match the existing pattern used in
objectline_view.tpl.php:81, objectline_edit.tpl.php:71 and
originproductline.tpl.php:50.

Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
2026-06-25 21:35:03 +02:00
w3houde
d6793d9796
Fix #37407 rename main lang key IM to InstantMessaging to free Imperia province code (#38818)
htdocs/core/class/html.formcompany.class.php:339,341,347 picks
$langs->trans($obj->code) for the province dropdown, where $obj->code
is the c_departements code. For Italy that includes IM = Imperia. The
en_US main.lang key 'IM=Instant messaging' was used as fallback and
shadowed the province label.

Rename the lang key to InstantMessaging. No PHP caller references the
old key (grep finds only the .lang files themselves), so this rename
breaks no flow today. Non-en_US locales will resync through Transifex.

Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
2026-06-25 21:32:54 +02:00
w3houde
08e9766c2a
Fix #37282 dispatch API classes whose name ends with the 'Api' suffix (#38819)
The API discovery loop in htdocs/api/index.php (around line 308) accepts
both Foo and FooApi class names when scanning module directories. The
dispatch loop on the request-handling side (line 422) only checked
class_exists($classname), so a module exposing class MyModuleApi from
api_mymodule.class.php would appear in the API Explorer yet 501 with
'API not found' when the endpoint was actually called.

Probe class_exists($classname.'Api') first to mirror the discovery
behavior. Falls back to the plain class name so existing modules keep
working.

Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
2026-06-25 21:32:02 +02:00
kkhelifa-opendsi
9570b49024
FIX: Fix rang of added lines when create a contract from another element (#38856) 2026-06-25 21:28:08 +02:00
Laurent Destailleur
eed3218153 Fix NaN set into unit price 2026-06-25 13:06:51 +02:00
Zakaria Boushaba
c8ebd5ce53
Fix date/datetime extrafield shown empty after update_extras due to stale POST data (#38984)
Co-authored-by: Zakaria Boushaba <z.boushaba@vold.africa>
2026-06-24 16:51:23 +02:00
Laurent Destailleur
452eb31996 Trans 2026-06-23 19:00:28 +02:00
Laurent Destailleur
31e9075989 Merge 2026-06-23 18:52:44 +02:00
Laurent Destailleur
b599407b93 Automated merge from 21.0 to 22.0 by tool pullmerge.sh 2026-06-23 15:54:36 +02:00
Laurent Destailleur
8dea97510e Fix duplicate fetch 2026-06-22 13:51:42 +02:00
jman482002
d522c28b70
FIX supplier proposal line extrafields not loaded (#38870) 2026-06-22 13:49:00 +02:00
Eric - CAP-REL
95a5391732
fix adherent table name (#38873)
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-06-22 13:39:55 +02:00
Laurent Destailleur
ee8933f3ec Automated merge from 22.0 to 23.0 by tool pullmerge.sh 2026-06-22 13:23:05 +02:00
Laurent Destailleur
97636bf8ad Automated merge from 21.0 to 22.0 by tool pullmerge.sh 2026-06-22 13:22:27 +02:00
Laurent Destailleur
47d72ce724 Automated merge from 20.0 to 21.0 by tool pullmerge.sh 2026-06-22 13:22:24 +02:00
Laurent Destailleur
998967c93a Automated merge from 19.0 to 20.0 by tool pullmerge.sh 2026-06-22 13:22:21 +02:00