From c2635f5242e39bfeedf5b6d491d4c7e06d6bfe73 Mon Sep 17 00:00:00 2001 From: Florian Mortgat <50440633+atm-florianm@users.noreply.github.com> Date: Mon, 24 Nov 2025 16:32:27 +0100 Subject: [PATCH 01/19] FIX 17.0: perweek.php resets task progress to 0% when: (#36401) * FIX 17.0: perweek.php resets task progress to 0% when: 1. the column "Declared real progress" is hidden (which means the corresponding form inputs won't be displayed) 2. and the user doesn't enter any time for that task (= leaves the input empty) If the column is shown, the bug doesn't occur because the correct value is sent with $_POST. If the user enters time, the bug doesn't occur because there is a GETPOSTISSET test for that case. * Apply suggestion from @atm-florianm variable name ($taskid vs $tmptaskid) --- htdocs/projet/activity/perweek.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index f39f96a6778..7a69b1c47e4 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -307,7 +307,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('formfilterac } } - if (!$updateoftaskdone) { // Check to update progress if no update were done on task. + if (!$updateoftaskdone && GETPOSTISSET($taskid.'progress')) { // Check to update progress if no update were done on task. $object->fetch($taskid); //var_dump($object->progress); //var_dump(GETPOST($taskid . 'progress', 'int')); exit; From 7d403a2fff8c263247efca4274908d993c4758ad Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 24 Nov 2025 19:15:04 +0100 Subject: [PATCH 02/19] FIX getEntity use element instead table_element (#36405) --- htdocs/core/actions_extrafields.inc.php | 2 +- htdocs/core/class/html.form.class.php | 2 +- htdocs/webportal/class/html.formwebportal.class.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/actions_extrafields.inc.php b/htdocs/core/actions_extrafields.inc.php index 2b16bd9faa0..d3ab24dd932 100644 --- a/htdocs/core/actions_extrafields.inc.php +++ b/htdocs/core/actions_extrafields.inc.php @@ -492,7 +492,7 @@ if ($action == 'encrypt') { $sql .= " AND te.".$attributekey." IS NOT NULL"; $sql .= " AND te.".$attributekey." <> ''"; if ($extrafields->attributes[$elementtype]['entityid'][$attributekey] == $conf->entity) { - $sql .= " AND t.entity = ".getEntity($arrayofelement['table_element'], 0); + $sql .= " AND t.entity = ".getEntity($arrayofelement['element'], 0); } //print $sql; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 40baa9d6fd7..baf3a476cfc 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -9180,7 +9180,7 @@ class Form // If table need a multientity restriction if (!empty($objecttmp->ismultientitymanaged)) { if ($objecttmp->ismultientitymanaged == 1) { - $sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")"; + $sql .= " AND t.entity IN (" . getEntity($objecttmp->element) . ")"; } if (!is_numeric($objecttmp->ismultientitymanaged)) { $sql .= " AND parenttable.entity = t." . $this->db->sanitize($tmparray[0]); diff --git a/htdocs/webportal/class/html.formwebportal.class.php b/htdocs/webportal/class/html.formwebportal.class.php index e246d54491c..6da1b08e9d2 100644 --- a/htdocs/webportal/class/html.formwebportal.class.php +++ b/htdocs/webportal/class/html.formwebportal.class.php @@ -536,7 +536,7 @@ class FormWebPortal extends Form $sql .= " WHERE 1=1"; if (isset($objecttmp->ismultientitymanaged)) { if ($objecttmp->ismultientitymanaged == 1) { - $sql .= " AND t.entity IN (" . getEntity($objecttmp->table_element) . ")"; + $sql .= " AND t.entity IN (" . getEntity($objecttmp->element) . ")"; } if (!is_numeric($objecttmp->ismultientitymanaged)) { $sql .= " AND parenttable.entity = t." . $tmparray[0]; From 71dc6dc1dbe84d6a79d450fbe1d49d7b193decab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Nov 2025 19:18:31 +0100 Subject: [PATCH 03/19] Fix #35096 #36393 --- htdocs/core/customreports.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index 75ee1126897..ca00f4fe84e 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -121,6 +121,7 @@ $hookmanager->initHooks(array('customreport')); // Note that conf->hooks_modules $title = ''; $picto = ''; +$errormessage = null; $head = array(); $ObjectClassName = ''; // Objects available by default From d24b8b62215ec8a1e9adcc572d5d19c5b7874f8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20St=C5=99=C3=ADbrn=C3=BD?= <35335130+kubajznik@users.noreply.github.com> Date: Tue, 25 Nov 2025 14:14:58 +0100 Subject: [PATCH 04/19] FIX do not force rowid to int (#36412) * do not force rowid to int * Update commonobject.class.php --------- Co-authored-by: Laurent Destailleur --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index cef1558a5ed..d45f07f6a7e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -8315,7 +8315,7 @@ abstract class CommonObject $isDependList = 1; } - $data[(int) $obj->rowid] = $labeltoshow; + $data[$obj->rowid] = $labeltoshow; // Warning: $obj->rowid is an alias and can be an int, but also a string ref. } $i++; From 244b6f04732374fe9c024c51dad8de9a63a6492b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20St=C5=99=C3=ADbrn=C3=BD?= <35335130+kubajznik@users.noreply.github.com> Date: Tue, 25 Nov 2025 14:14:58 +0100 Subject: [PATCH 05/19] FIX do not force rowid to int (#36412) * do not force rowid to int * Update commonobject.class.php --------- Co-authored-by: Laurent Destailleur --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 48afd79db8c..a0489c76653 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -8232,7 +8232,7 @@ abstract class CommonObject $isDependList = 1; } - $data[(int) $obj->rowid] = $labeltoshow; + $data[$obj->rowid] = $labeltoshow; // Warning: $obj->rowid is an alias and can be an int, but also a string ref. } $i++; From 7f27552a95af2c61d680be469de6b01026f04408 Mon Sep 17 00:00:00 2001 From: Florian Mortgat <50440633+atm-florianm@users.noreply.github.com> Date: Tue, 25 Nov 2025 14:18:12 +0100 Subject: [PATCH 06/19] FIX: empty origin type passed to addline when creating invoices from expeditions using massaction (confirm_createbills) (#36413) --- 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 776e9d592c6..4527c8189c5 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -429,7 +429,7 @@ if (empty($reshook)) { $product_type, $rang, $lines[$i]->special_code, - $objecttmp->origin, + $objecttmp->origin_type, $lines[$i]->rowid, $fk_parent_line, $lines[$i]->fk_fournprice, From d9b8abe3e4080b17732ecccb614d9dceece657d1 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 25 Nov 2025 14:20:05 +0100 Subject: [PATCH 07/19] FIX #36310 Accountancy - Data - Wrong account labels (cache) on write bookkeeping action (#36410) * FIX #36310 Accountancy - Data - Wrong account labels (cache) on writebookkeeping action (#36379) * Fix --- .../journal/expensereportsjournal.php | 20 ++++++++++++++----- .../accountancy/journal/purchasesjournal.php | 9 ++++++++- htdocs/accountancy/journal/sellsjournal.php | 18 +++++++++++++++-- 3 files changed, 39 insertions(+), 8 deletions(-) diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index 34abad53a40..2e62bdacc29 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -321,6 +321,16 @@ if ($action == 'writebookkeeping' && !$error && $user->hasRight('accounting', 'b if (!$errorforline) { foreach ($tabht[$key] as $k => $mt) { if ($mt) { + if (empty($conf->cache['accountingaccountincurrententity'][$k])) { + $accountingaccount = new AccountingAccount($db); + $accountingaccount->fetch(0, $k, true); + $conf->cache['accountingaccountincurrententity'][$k] = $accountingaccount; + } else { + $accountingaccount = $conf->cache['accountingaccountincurrententity'][$k]; + } + + $account_label = $accountingaccount->label; + // get compte id and label if ($accountingaccount->fetch(null, $k, true)) { $bookkeeping = new BookKeeping($db); @@ -335,9 +345,9 @@ if ($action == 'writebookkeeping' && !$error && $user->hasRight('accounting', 'b $bookkeeping->subledger_label = ''; $bookkeeping->numero_compte = $k; - $bookkeeping->label_compte = $accountingaccount->label; + $bookkeeping->label_compte = $account_label; - $bookkeeping->label_operation = $accountingaccount->label; + $bookkeeping->label_operation = $account_label; $bookkeeping->montant = $mt; $bookkeeping->sens = ($mt < 0) ? 'C' : 'D'; $bookkeeping->debit = ($mt > 0) ? $mt : 0; @@ -383,12 +393,12 @@ if ($action == 'writebookkeeping' && !$error && $user->hasRight('accounting', 'b foreach ($arrayofvat[$key] as $k => $mt) { if ($mt) { - if (empty($conf->cache['accountingaccountincurrententity'][$k])) { + if (empty($conf->cache['accountingaccountincurrententity_vat'][$k])) { $accountingaccount = new AccountingAccount($db); $accountingaccount->fetch(0, $k, true); - $conf->cache['accountingaccountincurrententity'][$k] = $accountingaccount; + $conf->cache['accountingaccountincurrententity_vat'][$k] = $accountingaccount; } else { - $accountingaccount = $conf->cache['accountingaccountincurrententity'][$k]; + $accountingaccount = $conf->cache['accountingaccountincurrententity_vat'][$k]; } $account_label = $accountingaccount->label; diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 91ac6b97ad8..324d45c62bb 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -616,7 +616,14 @@ if ($action == 'writebookkeeping' && !$error && $user->hasRight('accounting', 'b foreach ($arrayofvat[$key] as $k => $mt) { if ($mt) { - $accountingaccount->fetch(null, $k, true); // TODO Use a cache for label + if (empty($conf->cache['accountingaccountincurrententity_vat'][$k])) { + $accountingaccount = new AccountingAccount($db); + $accountingaccount->fetch(0, $k, true); + $conf->cache['accountingaccountincurrententity_vat'][$k] = $accountingaccount; + } else { + $accountingaccount = $conf->cache['accountingaccountincurrententity_vat'][$k]; + } + $label_account = $accountingaccount->label; $bookkeeping = new BookKeeping($db); diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index d46d7e8ff31..b7da60a23af 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -679,7 +679,14 @@ if ($action == 'writebookkeeping' && !$error && $user->hasRight('accounting', 'b foreach ($arrayofvat[$key] as $k => $mt) { if ($mt) { - $accountingaccount->fetch(null, $k, true); // TODO Use a cache for label + if (empty($conf->cache['accountingaccountincurrententity_vat'][$k])) { + $accountingaccount = new AccountingAccount($db); + $accountingaccount->fetch(0, $k, true); + $conf->cache['accountingaccountincurrententity_vat'][$k] = $accountingaccount; + } else { + $accountingaccount = $conf->cache['accountingaccountincurrententity_vat'][$k]; + } + $label_account = $accountingaccount->label; $bookkeeping = new BookKeeping($db); @@ -740,7 +747,14 @@ if ($action == 'writebookkeeping' && !$error && $user->hasRight('accounting', 'b if (isset($tabrevenuestamp[$key]) && is_array($tabrevenuestamp[$key])) { foreach ($tabrevenuestamp[$key] as $k => $mt) { if ($mt) { - $accountingaccount->fetch(null, $k, true); // TODO Use a cache for label + if (empty($conf->cache['accountingaccountincurrententity_rs'][$k])) { + $accountingaccount = new AccountingAccount($db); + $accountingaccount->fetch(0, $k, true); + $conf->cache['accountingaccountincurrententity_rs'][$k] = $accountingaccount; + } else { + $accountingaccount = $conf->cache['accountingaccountincurrententity_rs'][$k]; + } + $label_account = $accountingaccount->label; $bookkeeping = new BookKeeping($db); From 5044b3a102368a892d6667b1320a87468190bcd8 Mon Sep 17 00:00:00 2001 From: Jon Bendtsen Date: Tue, 25 Nov 2025 17:40:07 +0100 Subject: [PATCH 08/19] Qual: Undefined variable $errormessage in /var/www/html/core/customreports.php on line 951 (#36392) * checking if variable is set before testing the contents * more PHP warnings fixes detected during #35096 * using the fixed set above * backport eldy's fix --------- Co-authored-by: Jon Bendtsen --- htdocs/core/class/cleadstatus.class.php | 4 ++++ htdocs/core/customreports.php | 22 +++++++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/cleadstatus.class.php b/htdocs/core/class/cleadstatus.class.php index f72f9dddc7d..7f6c0b9d0da 100644 --- a/htdocs/core/class/cleadstatus.class.php +++ b/htdocs/core/class/cleadstatus.class.php @@ -57,6 +57,10 @@ class CLeadStatus extends CommonDict */ public $percent; + public $fields = array( + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), + 'label' => array('type' => 'varchar(128)', 'label' => 'Label', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'comment' => "Label of status"), + ); /** * Constructor diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index ca00f4fe84e..9486b02e5b2 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -202,7 +202,11 @@ if ($user->socid > 0) { // Protection if external user $extrafields->fetch_name_optionals_label('all'); // We load all extrafields definitions for all objects //$extrafields->fetch_name_optionals_label($object->table_element_line); -$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); +if (!empty($object->table_element)) { + $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); +} else { + $search_array_options = array(); +} $search_component_params = array(''); $search_component_params_hidden = trim(GETPOST('search_component_params_hidden', 'alphanohtml')); @@ -310,7 +314,11 @@ $arrayofgroupby = array(); $arrayofyaxis = array(); $arrayofvaluesforgroupby = array(); -$features = $object->element; +if (!empty($object->element)) { + $features = $object->element; +} else { + $features = ''; +} if (!empty($object->element_for_permission)) { $features = $object->element_for_permission; } else { @@ -1134,10 +1142,14 @@ if ($mode == 'graph') { $dir = $conf->user->dir_temp; dol_mkdir($dir); // $customreportkey may be defined when using customreports.php as an include - $filenamekey = $dir.'/customreport_'.$object->element.(empty($customreportkey) ? '' : $customreportkey).'.png'; - $fileurlkey = DOL_URL_ROOT.'/viewimage.php?modulepart=user&file=customreport_'.$object->element.(empty($customreportkey) ? '' : $customreportkey).'.png'; + if (!empty($object->element)) { + $filenamekey = $dir.'/customreport_'.$object->element.(empty($customreportkey) ? '' : $customreportkey).'.png'; + $fileurlkey = DOL_URL_ROOT.'/viewimage.php?modulepart=user&file=customreport_'.$object->element.(empty($customreportkey) ? '' : $customreportkey).'.png'; + } - $px1->draw($filenamekey, $fileurlkey); + if (isset($filenamekey) && isset($fileurlkey)) { + $px1->draw($filenamekey, $fileurlkey); + } $texttoshow = $langs->trans("NoRecordFound"); if (!GETPOSTISSET('search_measures') || !GETPOSTISSET('search_xaxis')) { From c5c0b85498acd9d39b5f79e49382ee3698f74a90 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Nov 2025 18:18:02 +0100 Subject: [PATCH 09/19] Debug v23 --- README.md | 2 +- htdocs/admin/system/security.php | 14 ++++++++++++++ htdocs/conf/conf.php.example | 6 +++--- htdocs/core/lib/functions.lib.php | 4 ++-- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3c2b2e0ac43..8577be43b8b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ![Downloads per day](https://img.shields.io/sourceforge/dw/dolibarr.svg) ![Docker hub pulls](https://img.shields.io/docker/pulls/dolibarr/dolibarr.svg) -[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.1-8892BF.svg?style=flat-square)](https://php.net/) +[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.2-8892BF.svg?style=flat-square)](https://php.net/) [![GitHub release](https://img.shields.io/github/v/release/Dolibarr/dolibarr)](https://github.com/Dolibarr/dolibarr) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5521/badge)](https://bestpractices.coreinfrastructure.org/projects/5521) diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 3d1b5995ed7..1d4a3c12d2c 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -35,6 +35,11 @@ require '../../main.inc.php'; * @var string $conffile // $conffile is defined into filefunc.inc.php * @var string $dolibarr_main_prod * @var string $dolibarr_main_document_root + * @var string $dolibarr_main_restrict_os_commands + * @var string $dolibarr_main_restrict_eval_methods + * @var string $dolibarr_main_restrict_ip + * @var string $dolibarr_main_db_pass + * @var string $dolibarr_main_db_encrypted_pass */ require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; @@ -387,6 +392,15 @@ if (empty($dolibarr_main_restrict_os_commands)) { print '     ('.$langs->trans("RecommendedValueIs", 'mysqldump, mysql, pg_dump, pg_restore, mariadb, mariadb-dump, clamdscan').')'; print '
'; +print '$dolibarr_main_restrict_eval_methods: '; +if (empty($dolibarr_main_restrict_eval_methods)) { + print $langs->trans("None"); +} else { + print $dolibarr_main_restrict_eval_methods; +} +print '     ('.$langs->trans("RecommendedValueIs", 'getDolGlobalString,getDolGlobalInt,getDolCurrency,fetchNoCompute,hasRight,isModEnabled,isStringVarMatching,abs,min,max,round,dol_now,dol_concat,preg_match').')'; +print '
'; + if (!getDolGlobalString('SECURITY_DISABLE_TEST_ON_OBFUSCATED_CONF')) { print '$dolibarr_main_db_pass: '; if (!empty($dolibarr_main_db_pass) && empty($dolibarr_main_db_encrypted_pass)) { diff --git a/htdocs/conf/conf.php.example b/htdocs/conf/conf.php.example index b6a041f1032..66b79e84ccf 100644 --- a/htdocs/conf/conf.php.example +++ b/htdocs/conf/conf.php.example @@ -316,11 +316,11 @@ $dolibarr_main_restrict_os_commands='mariadb-dump, mariadb, mysqldump, mysql, pg // ================================== // A whitelist of functions and methods to restrict the commands you can execute in a custom calculated fields, like "computed fields" of // extrafields or string conditions of extrafields. -// Default value: 'getDolGlobalString,getDolGlobalInt,getDolCurrency,fetchNoCompute,hasRight,isModEnabled,isStringVarMatching,abs,round,dol_now,preg_match' +// Default value: 'getDolGlobalString, getDolGlobalInt, getDolCurrency, fetchNoCompute, hasRight, isModEnabled, isStringVarMatching, abs, round, dol_now, preg_match' // Examples: -// $dolibarr_main_restrict_eval_methods='getDolGlobalString,getDolGlobalInt,getDolCurrency,fetchNoCompute,hasRight,isModEnabled,isStringVarMatching,abs,min,max,round,dol_now,dol_concat,preg_match'; +// $dolibarr_main_restrict_eval_methods='getDolGlobalString, getDolGlobalInt, getDolCurrency, fetchNoCompute, hasRight, isModEnabled, isStringVarMatching, abs, min, max, round, dol_now, dol_concat, preg_match'; // -$dolibarr_main_restrict_eval_methods='getDolGlobalString,getDolGlobalInt,getDolCurrency,fetchNoCompute,hasRight,isModEnabled,isStringVarMatching,abs,min,max,round,dol_now,preg_match'; +$dolibarr_main_restrict_eval_methods='getDolGlobalString, getDolGlobalInt, getDolCurrency, fetchNoCompute, hasRight, isModEnabled, isStringVarMatching, abs, min, max, round, dol_now, preg_match'; // dolibarr_main_disabled_modules // ================================== diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 87ef0d8acec..b3c9839cfcc 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -11935,10 +11935,10 @@ function dol_eval_standard($s, $hideerrors = 1, $onlysimplestring = '1') // Set $dolibarr_main_restrict_eval_methods_array if (!isset($dolibarr_main_restrict_eval_methods)) { - $dolibarr_main_restrict_eval_methods = 'getDolGlobalString,getDolGlobalInt,getDolCurrency,fetchNoCompute,hasRight,isModEnabled,isStringVarMatching,abs,min,max,round,dol_now,preg_match'; + $dolibarr_main_restrict_eval_methods = 'getDolGlobalString, getDolGlobalInt, getDolCurrency, fetchNoCompute, hasRight, isModEnabled, isStringVarMatching, abs, min, max, round, dol_now, preg_match'; } //print '$dolibarr_main_restrict_eval_methods = '.$dolibarr_main_restrict_eval_methods."\n"; - $dolibarr_main_restrict_eval_methods_array = explode(',', $dolibarr_main_restrict_eval_methods); + $dolibarr_main_restrict_eval_methods_array = explode(',', str_replace(" ", "", $dolibarr_main_restrict_eval_methods)); // Test on dangerous char (used for RCE), we allow only characters to make PHP variable testing // We must accept with 1: '1 && getDolGlobalInt("doesnotexist1") && getDolGlobalString("MAIN_FEATURES_LEVEL")' From e4070aeb97f3450ce9bb8571b7e93b376785fbb9 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 25 Nov 2025 18:52:45 +0100 Subject: [PATCH 10/19] FIX avoid php warnings (or not ?) (#36411) * FIX avoid php warnings (or not ?) * FIX wrong check --- htdocs/core/class/dolgraph.class.php | 8 +++-- htdocs/core/customreports.php | 46 +++++++++++++++------------- 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 79cff89f228..0f6f7b48b68 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -732,7 +732,9 @@ class DolGraph foreach ($this->data as $x) { // Loop on each x for ($i = 0; $i < $nbseries; $i++) { // Loop on each series if (is_null($max)) { - $max = $x[$i + 1]; // $i+1 because the index 0 is the legend + if (isset($x[$i + 1])) { + $max = $x[$i + 1]; // $i+1 because the index 0 is the legend + } } elseif ($max < $x[$i + 1]) { $max = $x[$i + 1]; } @@ -762,7 +764,9 @@ class DolGraph foreach ($this->data as $x) { // Loop on each x for ($i = 0; $i < $nbseries; $i++) { // Loop on each series if (is_null($min)) { - $min = $x[$i + 1]; // $i+1 because the index 0 is the legend + if (isset($x[$i + 1])) { + $min = $x[$i + 1]; // $i+1 because the index 0 is the legend + } } elseif ($min > $x[$i + 1]) { $min = $x[$i + 1]; } diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index bab97029c5f..1f713475096 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -493,28 +493,30 @@ if (is_array($search_groupby) && count($search_groupby)) { } $regs = array(); - if (!empty($object->fields[$gvalwithoutprefix]['arrayofkeyval'])) { - $valuetranslated = $object->fields[$gvalwithoutprefix]['arrayofkeyval'][$obj->val]; - if (is_null($valuetranslated)) { - $valuetranslated = $langs->transnoentitiesnoconv("UndefinedKey"); - } - $valuetranslated = $langs->trans($valuetranslated); - } elseif (preg_match('/integer:([^:]+):([^:]+)$/', $object->fields[$gvalwithoutprefix]['type'], $regs)) { - $classname = $regs[1]; - $classpath = $regs[2]; - dol_include_once($classpath); - if (class_exists($classname)) { - $tmpobject = new $classname($db); - '@phan-var-force CommonObject $tmpobject'; - $tmpobject->fetch($obj->val); - foreach ($tmpobject->fields as $fieldkey => $field) { - if ($field['showoncombobox']) { - $valuetranslated = $tmpobject->$fieldkey; - //if ($valuetranslated == '-') $valuetranslated = $langs->transnoentitiesnoconv("Unknown") - break; - } + if (isset($object->fields[$gvalwithoutprefix])) { + if (!empty($object->fields[$gvalwithoutprefix]['arrayofkeyval'])) { + $valuetranslated = $object->fields[$gvalwithoutprefix]['arrayofkeyval'][$obj->val]; + if (is_null($valuetranslated)) { + $valuetranslated = $langs->transnoentitiesnoconv("UndefinedKey"); + } + $valuetranslated = $langs->trans($valuetranslated); + } elseif (preg_match('/integer:([^:]+):([^:]+)$/', $object->fields[$gvalwithoutprefix]['type'], $regs)) { + $classname = $regs[1]; + $classpath = $regs[2]; + dol_include_once($classpath); + if (class_exists($classname)) { + $tmpobject = new $classname($db); + '@phan-var-force CommonObject $tmpobject'; + $tmpobject->fetch($obj->val); + foreach ($tmpobject->fields as $fieldkey => $field) { + if ($field['showoncombobox']) { + $valuetranslated = $tmpobject->$fieldkey; + //if ($valuetranslated == '-') $valuetranslated = $langs->transnoentitiesnoconv("Unknown") + break; + } + } + //$valuetranslated = $tmpobject->ref.'eee'; } - //$valuetranslated = $tmpobject->ref.'eee'; } } @@ -522,7 +524,7 @@ if (is_array($search_groupby) && count($search_groupby)) { } // Add also the possible NULL value if field is a parent field that is not a strict join $tmpfield = explode('.', $gval); - if ($tmpfield[0] != 't' || (is_array($object->fields[$tmpfield[1]]) && empty($object->fields[$tmpfield[1]]['notnull']))) { + if ($tmpfield[0] != 't' || (isset($object->fields[$tmpfield[1]]) && is_array($object->fields[$tmpfield[1]]) && empty($object->fields[$tmpfield[1]]['notnull']))) { dol_syslog("The group by field ".$gval." may be null (because field is null or it is a left join), so we add __NULL__ entry in list of possible values"); //var_dump($gval); var_dump($object->fields); $arrayofvaluesforgroupby['g_'.$gkey]['__NULL__'] = $langs->transnoentitiesnoconv("NotDefined"); From 6d42410dac87b9540081048acf870a156e85572d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Nov 2025 19:39:21 +0100 Subject: [PATCH 11/19] Debug v23 --- htdocs/reception/card.php | 12 +++++------- htdocs/reception/class/reception.class.php | 4 ++-- htdocs/reception/dispatch.php | 3 +-- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 55cbb825ee2..7b58aa5c5cf 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1917,7 +1917,6 @@ if ($action == 'create' && $permissiontoadd) { $typeobject = ''; if (!empty($object->origin) && $object->origin_id > 0) { - $object->origin = 'CommandeFournisseur'; $typeobject = $object->origin; $origin = $object->origin; $origin_id = $object->origin_id; @@ -2086,7 +2085,7 @@ if ($action == 'create' && $permissiontoadd) { print "\n"; print ''; } - if ($typeobject == 'CommandeFournisseur' && $object->origin_object->id && isModEnabled("propal")) { + if (($typeobject == 'supplier_order' || $typeobject == 'CommandeFournisseur') && $object->origin_object->id && isModEnabled("propal")) { print ''; print $langs->trans("SupplierOrder").''; print ''; @@ -2477,26 +2476,25 @@ if ($action == 'create' && $permissiontoadd) { // Get list of products already sent for same source object into $alreadysent $alreadysent = array(); - //$origin = 'commande_fournisseur'; + if (empty($origin)) { + $origin = 'supplier_order'; + } if ($origin && $origin_id > 0) { $sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.date_start, obj.date_end"; $sql .= ", ed.rowid as receptionline_id, ed.qty, ed.fk_reception as reception_id, ed.fk_entrepot"; $sql .= ", e.rowid as reception_id, e.ref as reception_ref, e.date_creation, e.date_valid, e.date_delivery, e.date_reception"; - //if (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY')) $sql .= ", l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received"; $sql .= ', p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid, p.tobatch as product_tobatch'; $sql .= ', p.description as product_desc'; $sql .= " FROM ".MAIN_DB_PREFIX."receptiondet_batch as ed"; $sql .= ", ".MAIN_DB_PREFIX."reception as e"; - $sql .= ", ".MAIN_DB_PREFIX.$origin."det as obj"; - //if (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY')) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.fk_reception = e.rowid LEFT JOIN ".MAIN_DB_PREFIX."deliverydet as ld ON ld.fk_delivery = l.rowid AND obj.rowid = ld.fk_origin_line"; + $sql .= ", ".MAIN_DB_PREFIX.(($origin == 'supplier_order') ? 'commande_fournisseur' : $origin)."det as obj"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON obj.fk_product = p.rowid"; $sql .= " WHERE e.entity IN (".getEntity('reception').")"; $sql .= " AND obj.fk_commande = ".((int) $origin_id); $sql .= " AND obj.rowid = ed.fk_elementdet"; $sql .= " AND ed.fk_reception = e.rowid"; $sql .= " AND ed.fk_reception !=".((int) $object->id); - //if ($filter) $sql.= $filter; $sql .= " ORDER BY obj.fk_product"; dol_syslog("get list of reception lines", LOG_DEBUG); diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 0ead07ec0d0..a6cdddd9c0e 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -336,7 +336,7 @@ class Reception extends CommonObject $sql .= ", fk_incoterms, location_incoterms"; $sql .= ") VALUES ("; $sql .= "'(PROV)'"; - $sql .= ", ".((int) $conf->entity); + $sql .= ", ".((int) $this->entity); $sql .= ", ".($this->ref_supplier ? "'".$this->db->escape($this->ref_supplier)."'" : "null"); $sql .= ", '".$this->db->idate($this->date_creation)."'"; $sql .= ", ".((int) $user->id); @@ -746,7 +746,7 @@ class Reception extends CommonObject } } - if (!$error) { + if (!$error && $this->origin_id > 0) { // Change status of purchase order to "reception in process" or "totally received" $status = $this->getStatusDispatch(); if ($status < 0) { diff --git a/htdocs/reception/dispatch.php b/htdocs/reception/dispatch.php index e901cde50c8..f1bb7e61a6b 100644 --- a/htdocs/reception/dispatch.php +++ b/htdocs/reception/dispatch.php @@ -322,7 +322,6 @@ llxHeader('', $title, $help_url, '', 0, 0, $morejs, '', '', 'mod-reception page- if ($id > 0 || !empty($ref)) { $typeobject = ''; if (!empty($object->origin) && $object->origin_id > 0) { - $object->origin = 'CommandeFournisseur'; $typeobject = $object->origin; $origin = $object->origin; $origin_id = $object->origin_id; @@ -418,7 +417,7 @@ if ($id > 0 || !empty($ref)) { print "\n"; print ''; } - if ($typeobject == 'CommandeFournisseur' && $object->origin_object->id && isModEnabled("propal")) { + if (($typeobject == 'supplier_order' || $typeobject == 'order_supplier') && $object->origin_object->id && isModEnabled("propal")) { print ''; print $langs->trans("SupplierOrder").''; print ''; From 3218e19091356b24217037629ee9c973e9026561 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Nov 2025 19:51:09 +0100 Subject: [PATCH 12/19] Debug v23 --- htdocs/core/lib/functions.lib.php | 2 +- htdocs/reception/card.php | 2 +- htdocs/workstation/class/api_workstations.class.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a3ee1ba0ce6..09760b5112c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -14651,7 +14651,7 @@ function getElementProperties($elementType) $classpath = $module . '/class'; $classfile = $module; $classname = preg_replace('/det$/', 'Line', $element); - if (in_array($module, array('expedition', 'propale', 'facture', 'contrat', 'fichinter', 'commandefournisseur'))) { + if (in_array($module, array('expedition', 'propale', 'facture', 'contrat', 'fichinter', 'supplier_order', 'commandefournisseur'))) { $classname = preg_replace('/det$/', 'Ligne', $element); } } diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 7b58aa5c5cf..7aa47e710b1 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1998,7 +1998,7 @@ if ($action == 'create' && $permissiontoadd) { $objectsrc = new Propal($db); $objectsrc->fetch($object->origin_object->id); } - if ($typeobject == 'CommandeFournisseur' && $object->origin_object->id && isModEnabled("supplier_order")) { + if (($typeobject == 'supplier_order' || $typeobject == 'CommandeFournisseur') && $object->origin_object->id && isModEnabled("supplier_order")) { $objectsrc = new CommandeFournisseur($db); $objectsrc->fetch($object->origin_object->id); } diff --git a/htdocs/workstation/class/api_workstations.class.php b/htdocs/workstation/class/api_workstations.class.php index f15c779e6bd..68e600143a1 100644 --- a/htdocs/workstation/class/api_workstations.class.php +++ b/htdocs/workstation/class/api_workstations.class.php @@ -197,13 +197,13 @@ class Workstations extends DolibarrApi { // phpcs:enable $object = parent::_cleanObjectDatas($object); + /** @var Workstation $object */ unset($object->statut); unset($object->regeximgext); unset($object->price_by_qty); unset($object->prices_by_qty_id); - unset($object->libelle); unset($object->product_id_already_linked); unset($object->reputations); unset($object->db); From c77220da52029bcc97984257cee21975ce37fad3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Nov 2025 20:42:28 +0100 Subject: [PATCH 13/19] Doc --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index b866c4db723..9dd3eefde10 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ English Dolibarr ChangeLog For users: ---------- +NEW: Need PHP 7.2 as minimum version NEW: Module datapolicy moved as stable (for anonimization features) NEW: #31723 - Improve project overview: Hide paid orders (#35524) NEW: #35700 : Throw an error when validating a propal, order, supplier with a product no more in sale/purchase… (#35709) From 427122ce7c151d3100a95df4febcbc13ababdf62 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Nov 2025 21:03:52 +0100 Subject: [PATCH 14/19] Fix merge --- htdocs/core/class/cleadstatus.class.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/htdocs/core/class/cleadstatus.class.php b/htdocs/core/class/cleadstatus.class.php index 06bc3303df3..7f6c0b9d0da 100644 --- a/htdocs/core/class/cleadstatus.class.php +++ b/htdocs/core/class/cleadstatus.class.php @@ -72,14 +72,6 @@ class CLeadStatus extends CommonDict $this->db = $db; } - /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> - */ - public $fields = array( - 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), - 'label' => array('type' => 'varchar(128)', 'label' => 'Label', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'comment' => "Label of status"), - ); - /** * Create object into database From 10b546db1c5a49ca26243bc93c0cad8cfe7ef200 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Nov 2025 23:35:15 +0100 Subject: [PATCH 15/19] Fix warning --- htdocs/main.inc.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 383b0f0bec4..0de6217deb6 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1273,13 +1273,15 @@ if (!defined('NOREQUIRETRAN')) { // accesskey is for Windows or Linux: ALT + key for chrome, ALT + SHIFT + KEY for firefox // accesskey is for Mac: CTRL + Option + key for all browsers + + // Note: $con->browser->os and $conf->browser->name may not be defined if we are in CLI mode. $conf->browser->stringforfirstkey = $langs->trans("KeyboardShortcut"); - if ($conf->browser->os == 'macintosh') { + if (!empty($conf->browser->os) && $conf->browser->os == 'macintosh') { $conf->browser->stringforfirstkey .= ' CTRL + Option +'; } else { - if ($conf->browser->name == 'chrome') { + if (!empty($conf->browser->name) && $conf->browser->name == 'chrome') { $conf->browser->stringforfirstkey .= ' ALT +'; - } elseif ($conf->browser->name == 'firefox') { + } elseif (!empty($conf->browser->name) && $conf->browser->name == 'firefox') { $conf->browser->stringforfirstkey .= ' ALT + SHIFT +'; } else { $conf->browser->stringforfirstkey .= ' CTL +'; From 0027e0c12684cca6479892541b52f32a177b8861 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Nov 2025 01:35:10 +0100 Subject: [PATCH 16/19] Fix CI --- htdocs/public/stripe/ipn.php | 38 +++++++++++++----------------------- htdocs/reception/card.php | 2 +- 2 files changed, 15 insertions(+), 25 deletions(-) diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index 6f471059de2..bc0297f82ee 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -376,8 +376,8 @@ if ($event->type == 'payout.created' && getDolGlobalString('STRIPE_AUTO_RECORD_P $currencyCodeType = strtoupper($object->currency); $paymentmethodstripeid = $object->payment_method; $customer_id = $object->customer; - $invoice_id = ""; - $supplierinvoice_id = ""; + $invoice_id = 0; + $supplierinvoice_id = 0; $salary_id = ""; $paymentTypeCode = ""; // payment type according to Stripe $paymentTypeCodeInDolibarr = ""; // payment type according to Dolibarr @@ -660,10 +660,11 @@ if ($event->type == 'payout.created' && getDolGlobalString('STRIPE_AUTO_RECORD_P $invoice = new Facture($db); $invoice->fetch($invoice_id); + $invoice->fetch_thirdparty(); // Set output language $outputlangs = new Translate('', $conf); - $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + $outputlangs->setDefaultLang(empty($invoice->thirdparty->default_lang) ? $mysoc->default_lang : $invoice->thirdparty->default_lang); $outputlangs->loadLangs(array("main", "members", "bills")); // Get email content from template @@ -672,16 +673,14 @@ if ($event->type == 'payout.created' && getDolGlobalString('STRIPE_AUTO_RECORD_P include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail=new FormMail($db); - if (! empty($labeltouse)) { - $arraydefaultmessage = $formmail->getEMailTemplate($db, 'facture_send', $user, $outputlangs, 0, 1, $labeltouse); - } + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'facture_send', $user, $outputlangs, 0, 1, $labeltouse); - if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + if (is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { $subject = $arraydefaultmessage->topic; $msg = $arraydefaultmessage->content; } - $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object); + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $invoice); complete_substitutions_array($substitutionarray, $outputlangs, $object); @@ -692,11 +691,12 @@ if ($event->type == 'payout.created' && getDolGlobalString('STRIPE_AUTO_RECORD_P if (is_array($invoice->linkedObjects['contrat']) && count($invoice->linkedObjects['contrat']) > 0) { //dol_sort_array($object->linkedObjects['facture'], 'date'); - foreach ($invoice->linkedObjects['contrat'] as $idcontract => $contract) { - $substitutionarray['__CONTRACT_REF__']=$contract->ref_customer; - $substitutionarray['__REFCLIENT__']=$contract->ref_customer; // For backward compatibility - $substitutionarray['__REF_CLIENT__']=$contract->ref_customer; - $substitutionarray['__REF_CUSTOMER__']=$contract->ref_customer; + foreach ($invoice->linkedObjects['contrat'] as $contract) { + /** @var Contrat $contract */ + $substitutionarray['__CONTRACT_REF__'] = $contract->ref_customer; + $substitutionarray['__REFCLIENT__'] = $contract->ref_customer; // For backward compatibility + $substitutionarray['__REF_CLIENT__'] = $contract->ref_customer; + $substitutionarray['__REF_CUSTOMER__'] = $contract->ref_customer; $foundcontract = $contract; break; } @@ -704,16 +704,6 @@ if ($event->type == 'payout.created' && getDolGlobalString('STRIPE_AUTO_RECORD_P dol_syslog('__DIRECTDOWNLOAD_URL_INVOICE__='.$substitutionarray['__DIRECTDOWNLOAD_URL_INVOICE__']); - $urlforsellyoursaasaccount = getRootUrlForAccount($foundcontract); - if ($urlforsellyoursaasaccount) { - $tmpforurl=preg_replace('/.*document.php/', '', $substitutionarray['__DIRECTDOWNLOAD_URL_INVOICE__']); - if ($tmpforurl) { - $substitutionarray['__DIRECTDOWNLOAD_URL_INVOICE__']=$urlforsellyoursaasaccount.'/source/document.php'.$tmpforurl; - } else { - $substitutionarray['__DIRECTDOWNLOAD_URL_INVOICE__']=$urlforsellyoursaasaccount; - } - } - $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); @@ -737,7 +727,7 @@ if ($event->type == 'payout.created' && getDolGlobalString('STRIPE_AUTO_RECORD_P $from = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL'); $trackid = 'inv'.$invoice->id; - $moreinheader = 'X-Dolibarr-Info: doTakeStripePaymentForThirdParty'."\r\n"; + $moreinheader = 'X-Dolibarr-Info: public stripe ipn.php'."\r\n"; $addr_cc = ''; if (!empty($invoice->thirdparty->array_options['options_emailccinvoice'])) { dol_syslog("We add the recipient ".$invoice->thirdparty->array_options['options_emailccinvoice']." as CC", LOG_DEBUG); diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 7aa47e710b1..e8d9a23780e 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -2480,7 +2480,7 @@ if ($action == 'create' && $permissiontoadd) { $origin = 'supplier_order'; } - if ($origin && $origin_id > 0) { + if ($origin_id > 0) { $sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.date_start, obj.date_end"; $sql .= ", ed.rowid as receptionline_id, ed.qty, ed.fk_reception as reception_id, ed.fk_entrepot"; $sql .= ", e.rowid as reception_id, e.ref as reception_ref, e.date_creation, e.date_valid, e.date_delivery, e.date_reception"; From 54cba89bc5a3758cbe0b324cb54732d37045c2b6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Nov 2025 01:40:45 +0100 Subject: [PATCH 17/19] Fix CI --- htdocs/public/stripe/ipn.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index bc0297f82ee..1e917a92c65 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -656,7 +656,8 @@ if ($event->type == 'payout.created' && getDolGlobalString('STRIPE_AUTO_RECORD_P if (!$error) { if (getDolGlobalString('STRIPE_IPN_SEND_EMAIL_ON_DIRECT_DEBIT_CONFIRMATION')) { // If option to send email after confirmation of direct debit is on, we send the email (template must exists - $labeltouse = getDolGlobalString('STRIPE_IPN_SEND_EMAIL_ON_DIRECT_DEBIT_CONFIRMATION'); // Example: 'InvoicePaymentSuccess' + $labeltouse = getDolGlobalString('STRIPE_IPN_SEND_EMAIL_ON_DIRECT_DEBIT_CONFIRMATION'); + // Example: $labeltouse = 'InvoicePaymentSuccess' $invoice = new Facture($db); $invoice->fetch($invoice_id); @@ -675,6 +676,10 @@ if ($event->type == 'payout.created' && getDolGlobalString('STRIPE_AUTO_RECORD_P $arraydefaultmessage = $formmail->getEMailTemplate($db, 'facture_send', $user, $outputlangs, 0, 1, $labeltouse); + $appli = $mysoc->name; + + $subject = '['.$appli.'] Invoice direct debit payment recevied'; + $msg = 'An invoice direct debit payment for invoice '.$invoice->ref.' has been recevied'; if (is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { $subject = $arraydefaultmessage->topic; $msg = $arraydefaultmessage->content; From e486d22b61d0c5b848cf9ce793f2a4389618ddfc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Nov 2025 01:43:23 +0100 Subject: [PATCH 18/19] Fix CI --- htdocs/public/stripe/ipn.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index 1e917a92c65..2a335f62882 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -713,22 +713,23 @@ if ($event->type == 'payout.created' && getDolGlobalString('STRIPE_AUTO_RECORD_P $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); // Attach a file ? - $file=''; $listofpaths=array(); $listofnames=array(); $listofmimes=array(); - if (is_object($invoice)) { - $invoicediroutput = $conf->invoice->dir_output; - $fileparams = dol_most_recent_file($invoicediroutput . '/' . $invoice->ref, preg_quote($invoice->ref, '/').'[^\-]+'); - $file = $fileparams['fullname']; - $file = ''; // Disable attachment of invoice in emails - if ($file) { - $listofpaths=array($file); - $listofnames=array(basename($file)); - $listofmimes=array(dol_mimetype($file)); - } + /* + $invoicediroutput = $conf->invoice->dir_output; + $fileparams = dol_most_recent_file($invoicediroutput . '/' . $invoice->ref, preg_quote($invoice->ref, '/').'[^\-]+'); + $file = $fileparams['fullname']; + $file = ''; // Disable attachment of invoice in emails + + if ($file) { + $listofpaths=array($file); + $listofnames=array(basename($file)); + $listofmimes=array(dol_mimetype($file)); } + */ + $from = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL'); $trackid = 'inv'.$invoice->id; From ed8fc3ab30904567f61e2c749ddcb63ca450f203 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Nov 2025 01:45:45 +0100 Subject: [PATCH 19/19] Fix CI --- htdocs/core/class/cleadstatus.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/class/cleadstatus.class.php b/htdocs/core/class/cleadstatus.class.php index 87c4e832370..46122f12a54 100644 --- a/htdocs/core/class/cleadstatus.class.php +++ b/htdocs/core/class/cleadstatus.class.php @@ -58,6 +58,9 @@ class CLeadStatus extends CommonDict */ public $percent; + /** + * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> + */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), 'label' => array('type' => 'varchar(128)', 'label' => 'Label', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'comment' => "Label of status"),