From 52446678d083da7eee86f27dfc374ff85fc16968 Mon Sep 17 00:00:00 2001 From: Ryad ABANI Date: Mon, 20 Oct 2025 16:23:22 +0200 Subject: [PATCH 01/23] FIX: php8.1 warning in syslog message --- htdocs/core/class/CMailFile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index f6897b6a2d1..18424785ffe 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -319,7 +319,7 @@ class CMailFile foreach ($filename_list as $i => $val) { if ($filename_list[$i]) { $this->atleastonefile = 1; - dol_syslog("CMailFile::CMailfile: filename_list[$i]=".$filename_list[$i].", mimetype_list[$i]=".$mimetype_list[$i]." mimefilename_list[$i]=".$mimefilename_list[$i]." cid_list[$i]=".$cid_list[$i], LOG_DEBUG); + dol_syslog("CMailFile::CMailfile: filename_list[$i]=".$filename_list[$i].", mimetype_list[$i]=".$mimetype_list[$i]." mimefilename_list[$i]=".$mimefilename_list[$i]. (empty($cid_list[$i]) ? 'Not an image' : $cid_list[$i]), LOG_DEBUG); } } } From 2153dbb0f175e62eee0bd4815cf829c29c476eae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 21 Oct 2025 02:09:51 +0200 Subject: [PATCH 02/23] Update CMailFile.class.php --- htdocs/core/class/CMailFile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 18424785ffe..5ccd242bf1f 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -319,7 +319,7 @@ class CMailFile foreach ($filename_list as $i => $val) { if ($filename_list[$i]) { $this->atleastonefile = 1; - dol_syslog("CMailFile::CMailfile: filename_list[$i]=".$filename_list[$i].", mimetype_list[$i]=".$mimetype_list[$i]." mimefilename_list[$i]=".$mimefilename_list[$i]. (empty($cid_list[$i]) ? 'Not an image' : $cid_list[$i]), LOG_DEBUG); + dol_syslog("CMailFile::CMailfile: filename_list[$i]=".$filename_list[$i].", mimetype_list[$i]=".$mimetype_list[$i]." mimefilename_list[$i]=".$mimefilename_list[$i]. (empty($cid_list[$i]) ? 'Not an embedded image' : $cid_list[$i]), LOG_DEBUG); } } } From 1eed0e18a9581318f7071ff1e3d061f0f6a82089 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 21 Oct 2025 02:11:56 +0200 Subject: [PATCH 03/23] Update CMailFile.class.php --- htdocs/core/class/CMailFile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 5ccd242bf1f..9e096d27f64 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -319,7 +319,7 @@ class CMailFile foreach ($filename_list as $i => $val) { if ($filename_list[$i]) { $this->atleastonefile = 1; - dol_syslog("CMailFile::CMailfile: filename_list[$i]=".$filename_list[$i].", mimetype_list[$i]=".$mimetype_list[$i]." mimefilename_list[$i]=".$mimefilename_list[$i]. (empty($cid_list[$i]) ? 'Not an embedded image' : $cid_list[$i]), LOG_DEBUG); + dol_syslog("CMailFile::CMailfile: filename_list[$i]=".$filename_list[$i].", mimetype_list[$i]=".$mimetype_list[$i]." mimefilename_list[$i]=".$mimefilename_list[$i]." cid_list[$i]=".(empty($cid_list[$i]) ? 'Not an embedded image' : $cid_list[$i]), LOG_DEBUG); } } } From 9319059349ac4cb8fb916b004cd3936977c26ba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9?= Date: Thu, 20 Nov 2025 14:01:29 +0100 Subject: [PATCH 04/23] FIX: Sometimes socid = undefined --- htdocs/takepos/index.php | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index fe9c34946a4..3ae0da797c4 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -93,6 +93,8 @@ if ($conf->browser->layout == 'phone') { $MAXCATEG = (empty($conf->global->TAKEPOS_NB_MAXCATEG) ? $maxcategbydefaultforthisdevice : $conf->global->TAKEPOS_NB_MAXCATEG); $MAXPRODUCT = (empty($conf->global->TAKEPOS_NB_MAXPRODUCT) ? $maxproductbydefaultforthisdevice : $conf->global->TAKEPOS_NB_MAXPRODUCT); +$term = empty($_SESSION['takeposterminal']) ? 1 : $_SESSION['takeposterminal']; +$socid = getDolGlobalString('CASHDESK_ID_THIRDPARTY' . $term); /* $constforcompanyid = 'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]; $soc = new Societe($db); @@ -329,8 +331,15 @@ function LoadProducts(position, issubcat) { if (maxproduct >= 1) { limit = maxproduct-1; } + + // Get socid + let socid = jQuery('#thirdpartyid').val(); + if ((socid === undefined || socid === "") && parseInt("") > 0) { + socid = parseInt(""); + } + // Only show products for sale (tosell=1) - $.getJSON('/takepos/ajax/ajax.php?action=getProducts&token=&thirdpartyid=' + jQuery('#thirdpartyid').val() + '&category='+currentcat+'&tosell=1&limit='+limit+'&offset=0', function(data) { + $.getJSON('/takepos/ajax/ajax.php?action=getProducts&token=&thirdpartyid=' + socid + '&category='+currentcat+'&tosell=1&limit='+limit+'&offset=0', function(data) { console.log("Call ajax.php (in LoadProducts) to get Products of category "+currentcat+" then loop on result to fill image thumbs"); console.log(data); while (ishow < maxproduct) { @@ -437,8 +446,15 @@ function MoreProducts(moreorless) { limit = maxproduct-1; } var offset = * pageproducts; + + // Get socid + let socid = jQuery('#thirdpartyid').val(); + if ((socid === undefined || socid === "") && parseInt("") > 0) { + socid = parseInt(""); + } + // Only show products for sale (tosell=1) - $.getJSON('/takepos/ajax/ajax.php?action=getProducts&token=&thirdpartyid=' + jQuery('#thirdpartyid').val() + '&category='+currentcat+'&tosell=1&limit='+limit+'&offset='+offset, function(data) { + $.getJSON('/takepos/ajax/ajax.php?action=getProducts&token=&thirdpartyid=' + socid + '&category='+currentcat+'&tosell=1&limit='+limit+'&offset='+offset, function(data) { console.log("Call ajax.php (in MoreProducts) to get Products of category "+currentcat); if (typeof (data[0]) == "undefined" && moreorless=="more"){ // Return if no more pages @@ -662,7 +678,14 @@ function Search2(keyCodeForEnter, moreorless) { pageproducts = 0; jQuery(".wrapper2 .catwatermark").hide(); var nbsearchresults = 0; - $.getJSON('/takepos/ajax/ajax.php?action=search&token=&term=' + search_term + '&thirdpartyid=' + jQuery('#thirdpartyid').val() + '&search_start=' + search_start + '&search_limit=' + search_limit, function (data) { + + // Only show products for sale (tosell=1) + let socid = jQuery('#thirdpartyid').val(); + if ((socid === undefined || socid === "") && parseInt("") > 0) { + socid = parseInt(""); + } + + $.getJSON('/takepos/ajax/ajax.php?action=search&token=&term=' + search_term + '&thirdpartyid=' + socid + '&search_start=' + search_start + '&search_limit=' + search_limit, function (data) { for (i = 0; i < ; i++) { if (typeof (data[i]) == "undefined") { $("#prowatermark" + i).html(""); From 92197cb100c5cdce53b17cba22e66ec5f6516cf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9?= Date: Fri, 21 Nov 2025 16:06:09 +0100 Subject: [PATCH 05/23] FIX: php echo instead of ") > 0) { + if ((socid === undefined || socid === "") && parseInt("") > 0) { socid = parseInt(""); } @@ -449,7 +449,7 @@ function MoreProducts(moreorless) { // Get socid let socid = jQuery('#thirdpartyid').val(); - if ((socid === undefined || socid === "") && parseInt("") > 0) { + if ((socid === undefined || socid === "") && parseInt("") > 0) { socid = parseInt(""); } @@ -681,7 +681,7 @@ function Search2(keyCodeForEnter, moreorless) { // Only show products for sale (tosell=1) let socid = jQuery('#thirdpartyid').val(); - if ((socid === undefined || socid === "") && parseInt("") > 0) { + if ((socid === undefined || socid === "") && parseInt("") > 0) { socid = parseInt(""); } From 3416c6ccc03053566be5e67868de4f676123efde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9?= Date: Thu, 27 Nov 2025 10:00:43 +0100 Subject: [PATCH 06/23] FIX: getDolGlobalInt --- htdocs/takepos/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index cf999b7ecc7..bafe040f50c 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -94,7 +94,7 @@ $MAXCATEG = (empty($conf->global->TAKEPOS_NB_MAXCATEG) ? $maxcategbydefaultforth $MAXPRODUCT = (empty($conf->global->TAKEPOS_NB_MAXPRODUCT) ? $maxproductbydefaultforthisdevice : $conf->global->TAKEPOS_NB_MAXPRODUCT); $term = empty($_SESSION['takeposterminal']) ? 1 : $_SESSION['takeposterminal']; -$socid = getDolGlobalString('CASHDESK_ID_THIRDPARTY' . $term); +$socid = getDolGlobalInt('CASHDESK_ID_THIRDPARTY' . $term); /* $constforcompanyid = 'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]; $soc = new Societe($db); From 2ee07bb0494bf5a95e33c6f1cfed5bbcd2271554 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9?= Date: Thu, 4 Dec 2025 17:27:57 +0100 Subject: [PATCH 07/23] FIX: Remove ") > 0) { - socid = parseInt(""); + if ((socid === undefined || socid === "") && parseInt("") > 0) { + socid = parseInt(""); } // Only show products for sale (tosell=1) @@ -449,8 +449,8 @@ function MoreProducts(moreorless) { // Get socid let socid = jQuery('#thirdpartyid').val(); - if ((socid === undefined || socid === "") && parseInt("") > 0) { - socid = parseInt(""); + if ((socid === undefined || socid === "") && parseInt("") > 0) { + socid = parseInt(""); } // Only show products for sale (tosell=1) @@ -681,8 +681,8 @@ function Search2(keyCodeForEnter, moreorless) { // Only show products for sale (tosell=1) let socid = jQuery('#thirdpartyid').val(); - if ((socid === undefined || socid === "") && parseInt("") > 0) { - socid = parseInt(""); + if ((socid === undefined || socid === "") && parseInt("") > 0) { + socid = parseInt(""); } $.getJSON('/takepos/ajax/ajax.php?action=search&token=&term=' + search_term + '&thirdpartyid=' + socid + '&search_start=' + search_start + '&search_limit=' + search_limit, function (data) { From 8d84cec3ca7718c77d825634be0c87e6889c422b Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Thu, 11 Dec 2025 10:43:24 +0100 Subject: [PATCH 08/23] remove slash like other parts of dolibarr code for TICKET_URL_PUBLIC_INTERFACE --- htdocs/ticket/class/ticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 6d1ee87f93e..a18d23266dd 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2767,7 +2767,7 @@ class Ticket extends CommonObject } // If public interface is not enable, use link to internal page into mail - $url_public_ticket = getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE', dol_buildpath('/public/ticket/view.php', 2)) . '/view.php?track_id='.$object->track_id; + $url_public_ticket = getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE', dol_buildpath('/public/ticket/view.php', 2)) . 'view.php?track_id='.$object->track_id; $message .= '
'.$langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer').' : '.$object->track_id.'
'; // Build final message From eb4d9dec53450aa28d7404a1eecf9fc42118aaf6 Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Thu, 18 Dec 2025 09:36:45 +0100 Subject: [PATCH 09/23] thanks to lionel : remove view.php in default value like other part of dolibarr --- htdocs/ticket/class/ticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index a18d23266dd..1ee21cca17d 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2767,7 +2767,7 @@ class Ticket extends CommonObject } // If public interface is not enable, use link to internal page into mail - $url_public_ticket = getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE', dol_buildpath('/public/ticket/view.php', 2)) . 'view.php?track_id='.$object->track_id; + $url_public_ticket = getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE', dol_buildpath('/public/ticket/', 2)) . 'view.php?track_id='.$object->track_id; $message .= '
'.$langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer').' : '.$object->track_id.'
'; // Build final message From c33b7e0bf1d163673ce4cd9398b71eed72a53dd6 Mon Sep 17 00:00:00 2001 From: lvessiller-opendsi Date: Tue, 30 Dec 2025 11:03:20 +0100 Subject: [PATCH 10/23] FIX finished regex in product import (#36770) --- htdocs/core/modules/modProduct.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index e5b0473597b..9ae50528f6f 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -656,7 +656,6 @@ class modProduct extends DolibarrModules 'p.fk_product_type'=>'^[0|1]$', 'p.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$', 'p.recuperableonly' => '^[0|1]$', - 'p.finished' => '^[0|1]$' ); // field order as per structure of table llx_product $import_sample = array( From ad3304832dd95cef3ad2c33ec3135987c339c8cc Mon Sep 17 00:00:00 2001 From: Mathieu Moulin Date: Tue, 6 Jan 2026 15:32:59 +0100 Subject: [PATCH 11/23] FIX : remove stock correctly when reception is deleted (like 82e092f) --- htdocs/reception/class/reception.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 8e98cfe639e..6915dc1ded4 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -12,6 +12,7 @@ * Copyright (C) 2016-2022 Ferran Marcet * Copyright (C) 2018 Quentin Vial-Gouteyron * Copyright (C) 2022-2023 Frédéric France + * Copyright (C) 2026 Mathieu Moulin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1033,7 +1034,10 @@ class Reception extends CommonObject $this->db->begin(); // Stock control - if (isModEnabled('stock') && $conf->global->STOCK_CALCULATE_ON_RECEPTION && $this->statut > 0) { + if (isModEnabled('stock') && + ((getDolGlobalInt('STOCK_CALCULATE_ON_RECEPTION') && $this->statut > self::STATUS_DRAFT) || + (getDolGlobalInt('STOCK_CALCULATE_ON_RECEPTION_CLOSE') && $this->statut == self::STATUS_CLOSED)) + ) { require_once DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php"; $langs->load("agenda"); From d5cab67f4c669f6f3b214f56f7c55f901fba4585 Mon Sep 17 00:00:00 2001 From: Eric - CAP-REL <1468823+rycks@users.noreply.github.com> Date: Thu, 8 Jan 2026 09:55:28 +0100 Subject: [PATCH 12/23] Fix log message for empty cid_list apply same fix as 20.0 to avoid conflicts on next merges --- htdocs/core/class/CMailFile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 9e096d27f64..337876482fe 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -319,7 +319,7 @@ class CMailFile foreach ($filename_list as $i => $val) { if ($filename_list[$i]) { $this->atleastonefile = 1; - dol_syslog("CMailFile::CMailfile: filename_list[$i]=".$filename_list[$i].", mimetype_list[$i]=".$mimetype_list[$i]." mimefilename_list[$i]=".$mimefilename_list[$i]." cid_list[$i]=".(empty($cid_list[$i]) ? 'Not an embedded image' : $cid_list[$i]), LOG_DEBUG); + dol_syslog("CMailFile::CMailfile: filename_list[$i]=".$filename_list[$i].", mimetype_list[$i]=".$mimetype_list[$i]." mimefilename_list[$i]=".$mimefilename_list[$i]." cid_list[$i]=".(empty($cid_list[$i]) ? '' : $cid_list[$i]), LOG_DEBUG); } } } From f497a6a4fe3beea00ea3671d99a8e1fa471fa65b Mon Sep 17 00:00:00 2001 From: lvessiller-opendsi Date: Thu, 8 Jan 2026 18:54:15 +0100 Subject: [PATCH 13/23] FIX warning accountancy export from external module (#36832) --- htdocs/accountancy/class/accountancyexport.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 472f5b5ce38..3ed4c1c7583 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -181,7 +181,7 @@ class AccountancyExport ); global $hookmanager; - $code = $formatcode[$type]; + $code = $formatcode[$type] ?? ''; $parameters = array('type' => $type); $reshook = $hookmanager->executeHooks('getFormatCode', $parameters, $code); From a5b106fe70e90c7b229257bfd7d932c80a8a620c Mon Sep 17 00:00:00 2001 From: Mathieu Moulin Date: Sat, 10 Jan 2026 17:30:45 +0100 Subject: [PATCH 14/23] Fix error removing reception with product batches (eatby/sellby) (#36846) --- htdocs/reception/class/reception.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 6915dc1ded4..9b2870eb769 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -1061,7 +1061,7 @@ class Reception extends CommonObject // we do not log origin because it will be deleted $mouvS->origin = null; - $result = $mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, 0, $langs->trans("ReceptionDeletedInDolibarr", $this->ref), '', $obj->eatby, $obj->sellby, $obj->batch); // Price is set to 0, because we don't want to see WAP changed + $result = $mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, 0, $langs->trans("ReceptionDeletedInDolibarr", $this->ref), '', $obj->eatby ? $this->db->jdate($obj->eatby) : null, $obj->sellby ? $this->db->jdate($obj->sellby) : null, $obj->batch); // Price is set to 0, because we don't want to see WAP changed if ($result < 0) { $error++; $this->error = $mouvS->error; From b3669d4333187b626b294cc4b1422feafe4bfcbf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 10 Jan 2026 17:45:20 +0100 Subject: [PATCH 15/23] Try to fix script --- .github/workflows/pr-18.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index d12d7002844..733a3e788dc 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -42,9 +42,11 @@ jobs: env: GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} url: ${{ github.event.pull_request.html_url }} + url2: ${{ github.event.pull_request_target.html_url }} run: | echo "env.url=${{env.url}}" - gh pr edit "${{env.url}}" --add-label "Issue for v18 maintenance Team" + echo "env.url2=${{env.url2}}" + gh pr edit "${{env.url}}" --add-label "Issue for v18 maintenance Team" - name: Set reviewers except PR author id: set-reviewers @@ -58,6 +60,7 @@ jobs: FINAL_REVIEWERS+=("$reviewer") fi done + echo "AUTHOR=$AUTHOR" echo "reviewers=$(IFS=, ; echo "${FINAL_REVIEWERS[*]}")" >> $GITHUB_OUTPUT - name: Assign reviewers From 7b6051a0d0869990e4ad0e473d26bc37b622b45c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Fali=C3=A8re?= <121813548+BenjaminFlr@users.noreply.github.com> Date: Sat, 10 Jan 2026 17:46:45 +0100 Subject: [PATCH 16/23] FIX(ticket): check on TICKET_IMAGE_PUBLIC_INTERFACE (#36833) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * FIX(ticket): check on TICKET_IMAGE_PUBLIC_INTERFACE Must use getDolGlobalString instead of getDolGlobalInt here * Add contributor --------- Co-authored-by: Benjamin Falière --- htdocs/core/lib/ticket.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index fd777fbac2b..e46da88f5b5 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -2,6 +2,7 @@ /* Copyright (C) 2013-2018 Jean-François FERRY * Copyright (C) 2016 Christophe Battarel * Copyright (C) 2019-2022 Frédéric France + * Copyright (C) 2025 Benjamin Falière * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -261,7 +262,7 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $ print ''; } - if (getDolGlobalInt('TICKET_IMAGE_PUBLIC_INTERFACE')) { + if (getDolGlobalString('TICKET_IMAGE_PUBLIC_INTERFACE')) { print '
'; print ''; print '
'; From 2e7ab21d017e72d5d3812c018426db818e571039 Mon Sep 17 00:00:00 2001 From: ThomasNgr-OpenDSI Date: Tue, 13 Jan 2026 11:37:36 +0100 Subject: [PATCH 17/23] FIX #GHSA-w5j3-8fcr-h87w (#36868) Co-authored-by: Laurent Destailleur --- htdocs/includes/odtphp/odf.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php index 39f595f4934..4fd29562183 100644 --- a/htdocs/includes/odtphp/odf.php +++ b/htdocs/includes/odtphp/odf.php @@ -833,7 +833,7 @@ IMG; // using windows libreoffice that must be in path // using linux/mac libreoffice that must be in path // Note PHP Config "fastcgi.impersonate=0" must set to 0 - Default is 1 - $command ='soffice --headless -env:UserInstallation=file:\''.$conf->user->dir_temp.'/odtaspdf\' --convert-to pdf --outdir '. escapeshellarg(dirname($name)). " ".escapeshellarg($name); + $command ='soffice --headless -env:UserInstallation=file:\''.dol_sanitizePathName($conf->user->dir_temp).'/odtaspdf\' --convert-to pdf --outdir '. escapeshellarg(dirname($name)). " ".escapeshellarg($name); } elseif (preg_match('/unoconv/', getDolGlobalString('MAIN_ODT_AS_PDF'))) { // If issue with unoconv, see https://github.com/dagwieers/unoconv/issues/87 @@ -859,17 +859,19 @@ IMG; // - set shell of user to bash instead of nologin. // - set permission to read/write to user on home directory /var/www so user can create the libreoffice , dconf and .cache dir and files then set permission back - $command = getDolGlobalString('MAIN_ODT_AS_PDF').' '.escapeshellcmd($name); + $command = getDolGlobalString('MAIN_ODT_AS_PDF').' '.escapeshellarg($name); //$command = '/usr/bin/unoconv -vvv '.escapeshellcmd($name); } else { // deprecated old method using odt2pdf.sh (native, jodconverter, ...) $tmpname=preg_replace('/\.odt/i', '', $name); if (getDolGlobalString('MAIN_DOL_SCRIPTS_ROOT')) { - $command = getDolGlobalString('MAIN_DOL_SCRIPTS_ROOT').'/scripts/odt2pdf/odt2pdf.sh '.escapeshellcmd($tmpname).' '.(is_numeric(getDolGlobalString('MAIN_ODT_AS_PDF'))?'jodconverter':getDolGlobalString('MAIN_ODT_AS_PDF')); + $command = dol_sanitizePathName(getDolGlobalString('MAIN_DOL_SCRIPTS_ROOT')).'/scripts/odt2pdf/odt2pdf.sh '.escapeshellarg($tmpname).' '.escapeshellarg(is_numeric(getDolGlobalString('MAIN_ODT_AS_PDF')) ? 'jodconverter' : getDolGlobalString('MAIN_ODT_AS_PDF')); } else { dol_syslog(get_class($this).'::exportAsAttachedPDF is used but the constant MAIN_DOL_SCRIPTS_ROOT with path to script directory was not defined.', LOG_WARNING); - $command = '../../scripts/odt2pdf/odt2pdf.sh '.escapeshellcmd($tmpname).' '.(is_numeric(getDolGlobalString('MAIN_ODT_AS_PDF'))?'jodconverter':getDolGlobalString('MAIN_ODT_AS_PDF')); + $paramodt2pdf = (is_numeric(getDolGlobalString('MAIN_ODT_AS_PDF')) ? 'jodconverter' : getDolGlobalString('MAIN_ODT_AS_PDF')); + $paramodt2pdf = dol_sanitizePathName($paramodt2pdf); + $command = '../../scripts/odt2pdf/odt2pdf.sh '.escapeshellarg($tmpname).' '.escapeshellarg($paramodt2pdf); } } @@ -877,6 +879,7 @@ IMG; //$command = DOL_DOCUMENT_ROOT.'/includes/odtphp/odt2pdf.sh '.$name.' '.$dirname; dol_syslog(get_class($this).'::exportAsAttachedPDF $execmethod='.$execmethod.' Run command='.$command, LOG_DEBUG); + // TODO Use: // $outputfile = DOL_DATA_ROOT.'/odt2pdf.log'; // $result = $utils->executeCLI($command, $outputfile); and replace test on $execmethod. @@ -884,17 +887,17 @@ IMG; // $errorstring will be $result['output'] $retval=0; $output_arr=array(); if ($execmethod == 1) { - exec($command, $output_arr, $retval); + exec(escapeshellcmd($command), $output_arr, $retval); } if ($execmethod == 2) { $outputfile = DOL_DATA_ROOT.'/odt2pdf.log'; - $ok=0; $handle = fopen($outputfile, 'w'); if ($handle) { dol_syslog(get_class($this)."Run command ".$command, LOG_DEBUG); + dol_syslog(get_class($this)."escapeshellcmd(command) = ".escapeshellcmd($command), LOG_DEBUG); fwrite($handle, $command."\n"); - $handlein = popen($command, 'r'); + $handlein = popen(escapeshellcmd($command), 'r'); while (!feof($handlein)) { $read = fgets($handlein); fwrite($handle, $read); @@ -937,7 +940,7 @@ IMG; foreach ($output_arr as $line) { $errorstring.= $line."
"; } - throw new OdfException('ODT to PDF convert fail (option MAIN_ODT_AS_PDF is '.$conf->global->MAIN_ODT_AS_PDF.', command was '.$command.', retval='.$retval.') : ' . $errorstring); + throw new OdfException('ODT to PDF convert fail (option MAIN_ODT_AS_PDF is '.getDolGlobalString('MAIN_ODT_AS_PDF').', command was '.$command.', retval='.$retval.') : ' . $errorstring); } } } From 2cfdbd6b5ff2c29d632eeff79a18c44e29ccd230 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Jan 2026 16:04:20 +0100 Subject: [PATCH 18/23] Try to use PR ID instead of PR url --- .github/workflows/pr-18.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index 733a3e788dc..ef651ffa8e6 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -41,12 +41,14 @@ jobs: - name: Assign Tag env: GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} + prid: ${{ github.event.pull_request.number }} url: ${{ github.event.pull_request.html_url }} url2: ${{ github.event.pull_request_target.html_url }} run: | + echo "env.prid=${{env.prid}}" echo "env.url=${{env.url}}" echo "env.url2=${{env.url2}}" - gh pr edit "${{env.url}}" --add-label "Issue for v18 maintenance Team" + gh pr edit "${{env.prid}}" --add-label "Issue for v18 maintenance Team" - name: Set reviewers except PR author id: set-reviewers @@ -67,8 +69,9 @@ jobs: if: steps.set-reviewers.outputs.reviewers != '' env: GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} + prid: ${{ github.event.pull_request.number }} url: ${{ github.event.pull_request.html_url }} reviewers: ${{ steps.set-reviewers.outputs.reviewers }} run: | echo "Assigning reviewers: ${{env.reviewers}}" - gh pr edit "${{env.url}}" --add-reviewer "${{env.reviewers}}" + gh pr edit "${{env.prid}}" --add-reviewer "${{env.reviewers}}" From 39d30a23fe3c7b8cf8ffc5619b3654fba2425830 Mon Sep 17 00:00:00 2001 From: atm-lucas <121817516+atm-lucasmantegari@users.noreply.github.com> Date: Mon, 19 Jan 2026 13:44:09 +0100 Subject: [PATCH 19/23] Duplicates in the result of the SQL query (#36913) --- htdocs/compta/resultat/clientfourn.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index cf2a26979a9..197d0a7bfc5 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -292,16 +292,19 @@ if ($modecompta == 'BOOKKEEPING') { if ($showaccountdetail == 'no') { $sql .= ", f.thirdparty_code as name"; } - $sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as f"; - $sql .= ", ".MAIN_DB_PREFIX."accounting_account as aa"; - $sql .= " WHERE f.numero_compte = aa.account_number"; + $sql .= " FROM ".$db->prefix()."accounting_bookkeeping as f"; + $sql .= " INNER JOIN ".$db->prefix()."accounting_account as aa"; + $sql .= " ON aa.account_number = f.numero_compte"; + $sql .= " AND aa.entity = f.entity"; // Security prevents duplicate. + $sql .= " WHERE 1=1"; $sql .= " AND ".$predefinedgroupwhere; - $sql .= " AND fk_pcg_version = '".$db->escape($charofaccountstring)."'"; + $sql .= " AND aa.fk_pcg_version = '".$db->escape($charofaccountstring)."'"; $sql .= " AND f.entity = ".$conf->entity; if (!empty($date_start) && !empty($date_end)) { - $sql .= " AND f.doc_date >= '".$db->idate($date_start)."' AND f.doc_date <= '".$db->idate($date_end)."'"; + $sql .= " AND f.doc_date >= '".$db->idate($date_start)."'"; + $sql .= " AND f.doc_date <= '".$db->idate($date_end)."'"; } - $sql .= " GROUP BY pcg_type"; + $sql .= " GROUP BY aa.pcg_type"; if ($showaccountdetail == 'no') { $sql .= ", name, socid"; // group by "accounting group" (INCOME/EXPENSE), then "customer". } From 926ed04ebe3b9fd152dde6584b1dcd6366eb920e Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Tue, 20 Jan 2026 13:58:17 +0100 Subject: [PATCH 20/23] fix: PHP fatal error on php 8.2 Unsupported operand types: string * string (#36930) --- htdocs/mrp/mo_production.php | 2 +- htdocs/product/stock/class/mouvementstock.class.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 4a48a1fbaab..b883cd48316 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -250,7 +250,7 @@ if (empty($reshook)) { $i = 1; while (GETPOSTISSET('qty-'.$line->id.'-'.$i)) { - $qtytoprocess = price2num(GETPOST('qty-'.$line->id.'-'.$i)); + $qtytoprocess = (float) price2num(GETPOST('qty-'.$line->id.'-'.$i)); if ($qtytoprocess != 0) { // Check warehouse is set if we should have to diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 9506db38c4a..a6ed0bc0d15 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -505,6 +505,7 @@ class MouvementStock extends CommonObject // Test if there is already a record for couple (warehouse / product), so later we will make an update or create. $alreadyarecord = 0; + $fk_product_stock = 0; if (!$error) { $sql = "SELECT rowid, reel FROM ".$this->db->prefix()."product_stock"; $sql .= " WHERE fk_entrepot = ".((int) $entrepot_id)." AND fk_product = ".((int) $fk_product); // This is a unique key @@ -535,7 +536,7 @@ class MouvementStock extends CommonObject if ($price > 0 || (getDolGlobalString('STOCK_UPDATE_AWP_EVEN_WHEN_ENTRY_PRICE_IS_NULL') && $price == 0 && in_array($this->origin_type, array('order_supplier', 'invoice_supplier')))) { $oldqtytouse = ($oldqty >= 0 ? $oldqty : 0); // We make a test on oldpmp>0 to avoid to use normal rule on old data with no pmp field defined - if ($oldpmp > 0) { + if ($oldpmp > 0 && ($oldqtytouse + $qty) != 0) { $newpmp = price2num((($oldqtytouse * $oldpmp) + ($qty * $price)) / ($oldqtytouse + $qty), 'MU'); } else { $newpmp = $price; // For this product, PMP was not yet set. We set it to input price. From c19e4e33cbe2f079dc12b42ac6c438d05d39b89a Mon Sep 17 00:00:00 2001 From: noec764 <58433943+noec764@users.noreply.github.com> Date: Fri, 23 Jan 2026 18:29:12 +0100 Subject: [PATCH 21/23] FIX: Massaction Create Bills from expedition (#36958) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Noé Co-authored-by: Laurent Destailleur --- htdocs/expedition/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 4527c8189c5..82895dec519 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -299,7 +299,7 @@ if (empty($reshook)) { } if ($objecttmp->id > 0) { - $res = $objecttmp->add_object_linked($objecttmp->origin, $id_sending); + $res = $objecttmp->add_object_linked($objecttmp->origin_type, $id_sending); if ($res == 0) { $errors[] = $expd->ref.' : '.$langs->trans($objecttmp->errors[0]); From ee32411d6a00b39d006a7102d31d1d990788e7de Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 24 Jan 2026 00:00:14 +0100 Subject: [PATCH 22/23] FIX Contract - Wrong button to edit contract odt path (#36965) Co-authored-by: Laurent Destailleur --- .../modules/contract/doc/doc_generic_contract_odt.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index 92882228e17..2678a9777a5 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -145,7 +145,7 @@ class doc_generic_contract_odt extends ModelePDFContract $texte .= getDolGlobalString('CONTRACT_ADDON_PDF_ODT_PATH'); $texte .= ''; $texte .= '
'; - $texte .= ''; + $texte .= ''; $texte .= '
'; // Scan directories @@ -153,7 +153,7 @@ class doc_generic_contract_odt extends ModelePDFContract if (getDolGlobalString('CONTRACT_ADDON_PDF_ODT_PATH')) { $texte .= $langs->trans("NumberOfModelFilesFound").': '; //$texte.=$nbofiles?'':''; - $texte .= count($listoffiles); + $texte .= $nbofiles; //$texte.=$nbofiles?'':''; $texte .= ''; } From e3323c3ff17a655b48928cfbbac8dd52e9c6a09d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 26 Jan 2026 11:49:46 +0100 Subject: [PATCH 23/23] Remove message for Invoice Situation level 2 - Need more test (#36987) --- htdocs/accountancy/index.php | 2 ++ htdocs/index.php | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index 0577cac80fa..c10ca3155c1 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -122,12 +122,14 @@ if (isModEnabled('accounting')) { print load_fiche_titre($langs->trans("AccountancyArea"), empty($resultboxes['selectboxlist']) ? '' : $resultboxes['selectboxlist'], 'accountancy', 0, '', '', $showtutorial); + /* if (getDolGlobalInt('INVOICE_USE_SITUATION') == 1) { $messagewarning = $langs->trans("SorryThisModuleIsNotCompatibleWithTheExperimentalFeatureOfSituationInvoices"); $messagewarning .= ' '.$langs->trans("WarningExperimentalFeatureInvoiceSituationNeedToUpgradeToProgressiveMode", 'https://partners.dolibarr.org'); print info_admin($messagewarning); print "
"; } + */ if (!$helpisexpanded && empty($resultboxes['boxlista']) && empty($resultboxes['boxlistb'])) { print '

'.$langs->trans("ClickOnUseTutorialForHelp", $langs->transnoentities("ShowTutorial"))."
\n"; diff --git a/htdocs/index.php b/htdocs/index.php index 68fce7df62d..b8a68617714 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -118,11 +118,13 @@ if (getDolGlobalString('MAIN_MOTD')) { */ // Specific warning to propose to upgrade invoice situation to progressive mode -if (getDolGlobalInt('INVOICE_USE_SITUATION') == 1 && (float) DOL_VERSION >= 22.0) { +/* +if (getDolGlobalInt('INVOICE_USE_SITUATION') == 1) { $langs->loadLangs(array("admin")); print info_admin($langs->trans("WarningExperimentalFeatureInvoiceSituationNeedToUpgradeToProgressiveMode", 'https://partners.dolibarr.org')); //print "
"; } +*/ /* * Show security warnings