From 8a2faed41f7b4be3fafeec452bd9c1bd8db69e2e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 23 Nov 2025 22:14:34 +0100 Subject: [PATCH 01/16] Debug v23 --- htdocs/projet/class/task.class.php | 7 +++-- htdocs/projet/tasks/time.php | 45 ++++++++++++++++-------------- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 99a8b9a856b..9f647dbeefc 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -2107,7 +2107,8 @@ class Task extends CommonObjectLine $timespent->element_date = $this->timespent_date; $timespent->element_datehour = $this->timespent_datehour; - $timespent->element_date_withhour = $this->timespent_withhour; + + $timespent->element_date_withhour = $this->timespent_withhour; // 0 or 1 $timespent->element_duration = $this->timespent_duration; if ($this->timespent_fk_user > 0) { $timespent->fk_user = $this->timespent_fk_user; @@ -2118,7 +2119,9 @@ class Task extends CommonObjectLine $timespent->invoice_line_id = $this->timespent_invoicelineid; dol_syslog(get_class($this)."::updateTimeSpent", LOG_DEBUG); - if ($timespent->update($user) > 0) { + + $resupdate = $timespent->update($user); + if ($resupdate > 0) { if (!$notrigger) { // Call trigger $result = $this->call_trigger('TASK_TIMESPENT_MODIFY', $user); diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 473714fd644..a1efbe71544 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -33,15 +33,6 @@ // Load Dolibarr environment require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; -require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php'; -require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; -require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; -require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formintervention.class.php'; - /** * @var Conf $conf * @var DoliDB $db @@ -53,6 +44,14 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formintervention.class.php'; ' @phan-var-force ?string $uploaddir '; +require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php'; +require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formintervention.class.php'; // Load translation files required by the page $langsLoad = array('projects', 'bills', 'orders', 'companies'); @@ -72,8 +71,9 @@ $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'alpha'); $mode = GETPOST('mode', 'alpha'); -$id = GETPOSTINT('id'); -$projectid = GETPOSTINT('projectid'); +$id = GETPOSTINT('id'); // Id of task +$projectid = GETPOSTINT('projectid'); // Id of project +$lineid = GETPOSTINT('lineid'); // Id of time spent line $ref = GETPOST('ref', 'alpha'); $withproject = GETPOSTINT('withproject'); $project_ref = GETPOST('project_ref', 'alpha'); @@ -164,6 +164,7 @@ if ($object->fk_project > 0) { /* * Actions */ + $error = 0; if (GETPOST('cancel', 'alpha')) { @@ -289,11 +290,10 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us $timespent_date = dol_mktime(12, 0, 0, GETPOSTINT("timelinemonth"), GETPOSTINT("timelineday"), GETPOSTINT("timelineyear")); if (!$error) { - if (GETPOSTINT('taskid') != $id) { // GETPOST('taskid') is id of new task - $id_temp = GETPOSTINT('taskid'); // should not overwrite $id + if (GETPOSTINT('taskid') != $id) { // GETPOSTINT('taskid') is the id of new task + $id_temp = GETPOSTINT('taskid'); // should not overwrite $id - - $object->fetchTimeSpent(GETPOSTINT('lineid')); + $object->fetchTimeSpent($lineid); $result = 0; @@ -326,7 +326,7 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us } } } else { - $object->fetch($id, $ref); + $object->fetch($id, $ref); // $object is Task $object->fetchTimeSpent(GETPOSTINT('lineid')); @@ -334,17 +334,21 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us $object->timespent_old_duration = GETPOSTINT("old_duration"); $object->timespent_duration = GETPOSTINT("new_durationhour") * 60 * 60; // We store duration in seconds $object->timespent_duration += (GETPOSTINT("new_durationmin") ? GETPOSTINT('new_durationmin') : 0) * 60; // We store duration in seconds + if (GETPOST("timelinehour") != '' && GETPOST("timelinehour") >= 0) { // If hour was entered $object->timespent_date = dol_mktime(GETPOSTINT("timelinehour"), GETPOSTINT("timelinemin"), 0, GETPOSTINT("timelinemonth"), GETPOSTINT("timelineday"), GETPOSTINT("timelineyear")); $object->timespent_withhour = 1; } elseif (!empty($timespent_date)) { $object->timespent_date = $timespent_date; + $object->timespent_datehour = $timespent_date; $object->timespent_withhour = 0; } + $object->timespent_fk_user = GETPOSTINT("userid_line"); $object->timespent_fk_product = GETPOSTINT("fk_product"); $object->timespent_invoiceid = GETPOSTINT("invoiceid"); $object->timespent_invoicelineid = GETPOSTINT("invoicelineid"); + $result = 0; if (in_array($object->timespent_fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { @@ -1398,9 +1402,6 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; */ - if ($id) { - $param .= '&id=' . urlencode((string) ($id)); - } if ($projectid) { $param .= '&projectid=' . urlencode((string) ($projectid)); } @@ -1434,7 +1435,6 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser print ''; print ''; - print ''; print ''; print ''; print ''; @@ -1598,7 +1598,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser $sql = "SELECT t.rowid, t.fk_element, t.element_date, t.element_datehour, t.element_date_withhour, t.element_duration, t.fk_user, t.note, t.thm,"; $sql .= " t.fk_product,"; - $sql .= " pt.ref, pt.label, pt.fk_projet,"; + $sql .= " pt.rowid as taskid, pt.ref, pt.label, pt.fk_projet,"; $sql .= " u.lastname, u.firstname, u.login, u.photo, u.gender, u.statut as user_status,"; $sql .= " il.fk_facture as invoice_id, inv.fk_statut,"; $sql .= " p.fk_soc,s.name_alias,"; @@ -1769,7 +1769,9 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser $i = 0; while ($i < $num) { $row = $db->fetch_object($resql); + $tasks[$i] = $row; + $i++; } $db->free($resql); @@ -2158,6 +2160,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser print ''; if (($action == 'editline' || $action == 'splitline') && GETPOSTINT('lineid') == $task_time->rowid) { print ''; + print ''; print ''; print '
'; print ''; From 7af079a87ffba6cd6732dbcd8bde02a7044e78a9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 23 Nov 2025 22:18:12 +0100 Subject: [PATCH 02/16] Debug v23 --- htdocs/projet/tasks/time.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index a1efbe71544..6ce1d08dabc 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -336,7 +336,8 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us $object->timespent_duration += (GETPOSTINT("new_durationmin") ? GETPOSTINT('new_durationmin') : 0) * 60; // We store duration in seconds if (GETPOST("timelinehour") != '' && GETPOST("timelinehour") >= 0) { // If hour was entered - $object->timespent_date = dol_mktime(GETPOSTINT("timelinehour"), GETPOSTINT("timelinemin"), 0, GETPOSTINT("timelinemonth"), GETPOSTINT("timelineday"), GETPOSTINT("timelineyear")); + $object->timespent_date = dol_mktime(12, 0, 0, GETPOSTINT("timelinemonth"), GETPOSTINT("timelineday"), GETPOSTINT("timelineyear")); + $object->timespent_datehour = dol_mktime(GETPOSTINT("timelinehour"), GETPOSTINT("timelinemin"), 0, GETPOSTINT("timelinemonth"), GETPOSTINT("timelineday"), GETPOSTINT("timelineyear")); $object->timespent_withhour = 1; } elseif (!empty($timespent_date)) { $object->timespent_date = $timespent_date; From 70b264715f842ff128fe446239711977c2169ebe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 23 Nov 2025 22:31:07 +0100 Subject: [PATCH 03/16] Debug v23 --- htdocs/projet/tasks/time.php | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 6ce1d08dabc..bb2b619fff7 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1154,6 +1154,8 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); + $formconfirm = ''; + // Task // Show section with information of task. If id of task is not defined and project id defined, then $projectidforalltimes is not empty. @@ -1163,7 +1165,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser if ($action == 'deleteline') { $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOSTINT("lineid") . ($withproject ? '&withproject=1' : ''); - print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); + $formconfirm .= $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); } $param = ($withproject ? '&withproject=1' : ''); @@ -1269,33 +1271,25 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser print dol_get_fiche_end(); } else { if ($action == 'deleteline') { - $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOSTINT("lineid") . ($withproject ? '&withproject=1' : ''); - print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); + $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($projectstatic->id > 0 ? 'projectid=' . $projectstatic->id : ($object->id > 0 ? "id=" . $object->id : '')) . '&lineid=' . GETPOSTINT("lineid") . ($withproject ? '&withproject=1' : ''). "&contextpage=" . urlencode($contextpage); + $formconfirm .= $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); } } + // Call Hook formConfirm + $parameters = array('formConfirm' => $formconfirm, "projectstatic" => $projectstatic, "withproject" => $withproject); + $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if (empty($reshook)) { + $formconfirm .= $hookmanager->resPrint; + } elseif ($reshook > 0) { + $formconfirm = $hookmanager->resPrint; + } + if ($projectstatic->id > 0 || $allprojectforuser > 0) { // Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('tasktimelist')); - $formconfirm = ''; - - if ($action == 'deleteline' && !empty($projectidforalltimes)) { - // We must use projectidprojectid if on list of timespent of project and id=taskid if on list of timespent of a task - $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($projectstatic->id > 0 ? 'projectid=' . $projectstatic->id : ($object->id > 0 ? "id=" . $object->id : '')) . '&lineid=' . GETPOSTINT('lineid') . ($withproject ? '&withproject=1' : '') . "&contextpage=" . urlencode($contextpage); - $formconfirm = $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); - } - - // Call Hook formConfirm - $parameters = array('formConfirm' => $formconfirm, "projectstatic" => $projectstatic, "withproject" => $withproject); - $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - if (empty($reshook)) { - $formconfirm .= $hookmanager->resPrint; - } elseif ($reshook > 0) { - $formconfirm = $hookmanager->resPrint; - } - // Print form confirm print $formconfirm; From 83f9d2cab764f13d54457f607188a52ba8ea7b08 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 23 Nov 2025 22:43:19 +0100 Subject: [PATCH 04/16] Debug v23 --- htdocs/projet/tasks/time.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index bb2b619fff7..e39155a6500 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -290,7 +290,7 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us $timespent_date = dol_mktime(12, 0, 0, GETPOSTINT("timelinemonth"), GETPOSTINT("timelineday"), GETPOSTINT("timelineyear")); if (!$error) { - if (GETPOSTINT('taskid') != $id) { // GETPOSTINT('taskid') is the id of new task + if ($id && GETPOSTINT('taskid') != $id) { // GETPOSTINT('taskid') is the id of new task $id_temp = GETPOSTINT('taskid'); // should not overwrite $id $object->fetchTimeSpent($lineid); @@ -418,6 +418,7 @@ if (GETPOSTINT('projectid') > 0) { } // If not task selected and no project selected $allprojectforuser = 0; + if ($id <= 0 && $projectidforalltimes == 0) { $allprojectforuser = $user->id; } @@ -917,9 +918,7 @@ $help_url = ''; llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-project project-tasks page-task_time'); if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser > 0) { - /* - * Fiche projet en mode visu - */ + // Project car in view mode if ($projectidforalltimes > 0) { $result = $projectstatic->fetch($projectidforalltimes); if (!empty($projectstatic->socid)) { @@ -2155,7 +2154,9 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser print ''; if (($action == 'editline' || $action == 'splitline') && GETPOSTINT('lineid') == $task_time->rowid) { print ''; - print ''; + if ($id) { + print ''; // If you enable this, the edit will go beack to task view + } print ''; print '
'; print ''; From 1b9f546dce5f66e7408d4718639b395c6f7a7a0f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Nov 2025 01:46:27 +0100 Subject: [PATCH 05/16] Debug v23 --- htdocs/core/class/html.form.class.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8da9a94beab..62e653aa2d0 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7793,11 +7793,13 @@ class Form $reduceformat = (!empty($conf->dol_optimize_smallscreen) ? 1 : 0); // Test on original $format param. if ($reduceformat) { $format = str_replace('%Y', '%y', $langs->transnoentitiesnoconv("FormatDateShortInput")); // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript + $formatjslong = $langs->transnoentitiesnoconv("FormatDateShortJavaInput"); // don't trust the name $formatjs = str_replace('yyyy', 'yy', $langs->transnoentitiesnoconv("FormatDateShortJavaInput")); $formatjquery = str_replace('yyyy', 'yy', $langs->trans("FormatDateShortJQueryInput")); } else { - $format = $langs->transnoentitiesnoconv("FormatDateShortInput"); // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript - $formatjs = $langs->transnoentitiesnoconv("FormatDateShortJavaInput"); // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript + $format = $langs->transnoentitiesnoconv("FormatDateShortInput"); // FormatDateShortInput for dol_print_date is same than FormatDateShortJavaInput for javascript + $formatjslong = $langs->transnoentitiesnoconv("FormatDateShortJavaInput"); // don't trust the name + $formatjs = $langs->transnoentitiesnoconv("FormatDateShortJavaInput"); // FormatDateShortInput for dol_print_date is same than FormatDateShortJavaInput for javascript $formatjquery = $langs->trans("FormatDateShortJQueryInput"); } @@ -7810,13 +7812,12 @@ class Form // Calendrier popup version eldy if ($usecalendar == "eldy") { // To have this manager working back, you must retrieve all functions showDP child found into the lib_head.js of v4 for example - // and use load the js so the call of showDP will works. - + // and load the js that contains them so the call of showDP will works. /* // Input area to enter date manually $retstring .= 'trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript + $retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($formatjslong")) . '\'); "'; // FormatDateShortInput for dol_print_date is same than FormatDateShortJavaInput for javascript $retstring .= ' autocomplete="off">'; // Icon calendar @@ -7875,7 +7876,7 @@ class Form $retstring .= ' Date: Mon, 24 Nov 2025 09:47:37 +0100 Subject: [PATCH 06/16] CSS --- htdocs/compta/sociales/list.php | 6 +++--- htdocs/theme/eldy/global.inc.php | 3 +++ htdocs/theme/md/style.css.php | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index 318e44dc892..0847204d20f 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -521,21 +521,21 @@ if (!empty($arrayfields['p.ref']['checked'])) { if (!empty($arrayfields['cs.fk_user']['checked'])) { // Employee print ''; - print $form->select_dolusers($search_users, 'search_users', 1, null, 0, '', '', '0', 0, 0, '', 0, '', 'maxwidth150', 0, 0, true); + print $form->select_dolusers($search_users, 'search_users', 1, null, 0, '', '', '0', 0, 0, '', 0, '', 'maxwidth125', 0, 0, true); print ''; } // Filter: Type if (!empty($arrayfields['cs.fk_mode_reglement']['checked'])) { print ''; - print $form->select_types_paiements($search_type, 'search_type', '', 0, 1, 1, 0, 1, 'maxwidth150', 1); + print $form->select_types_paiements($search_type, 'search_type', '', 0, 1, 1, 0, 1, 'maxwidth125', 1); print ''; } // Filter: Bank Account if (!empty($arrayfields['cs.fk_account']['checked'])) { print ''; - $form->select_comptes($search_account, 'search_account', 0, '', 1, '', 0, 'maxwidth150'); + $form->select_comptes($search_account, 'search_account', 0, '', 1, '', 0, 'maxwidth125'); print ''; } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 2cde543636a..e3d2f1aba7e 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -4107,6 +4107,9 @@ div.tabBar table.tableforservicepart2:last-child { /* Payment Screen : Pointer cursor in the autofill image */ .AutoFillAmount { cursor:pointer; + padding-left: 5px; + padding-right: 5px; + padding-top: 2px; } div.popuptabset { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 398d09961db..4535bee9b99 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -3106,6 +3106,9 @@ img.photorefnoborder { /* Payment Screen : Pointer cursor in the autofill image */ .AutoFillAmount { cursor:pointer; + padding-left: 5px; + padding-right: 5px; + padding-top: 2px; } From 2734f0a0324d8c982a91834331c9cbd4ae88af9b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Nov 2025 09:50:31 +0100 Subject: [PATCH 07/16] CSS --- htdocs/compta/sociales/list.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index 0847204d20f..72c00d61c3e 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -31,13 +31,6 @@ // Load Dolibarr environment require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - /** * @var Conf $conf * @var DoliDB $db @@ -45,6 +38,12 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; * @var Translate $langs * @var User $user */ +require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; // Load translation files required by the page $langs->loadLangs(array('compta', 'banks', 'bills', 'hrm', 'projects')); @@ -103,15 +102,13 @@ if (!$sortorder) { $sortorder = "DESC"; } -$filtre = GETPOSTINT("filtre"); - $arrayfields = array( 'cs.rowid' => array('label' => "Ref", 'checked' => '1', 'position' => 10), 'cs.libelle' => array('label' => "Label", 'checked' => '1', 'position' => 20), 'cs.fk_type' => array('label' => "Type", 'checked' => '1', 'position' => 30), 'cs.date_ech' => array('label' => "Date", 'checked' => '1', 'position' => 40), 'cs.periode' => array('label' => "PeriodEndDate", 'checked' => '1', 'position' => 50), - 'p.ref' => array('label' => "ProjectRef", 'checked' => '1', 'position' => 60, 'enabled' => (string) (int) (isModEnabled('project'))), + 'p.ref' => array('label' => "ProjectRef", 'checked' => '-1', 'position' => 60, 'enabled' => (string) (int) (isModEnabled('project'))), 'cs.fk_user' => array('label' => "Employee", 'checked' => '1', 'position' => 70), 'cs.fk_mode_reglement' => array('checked' => '-1', 'position' => 80, 'label' => "DefaultPaymentMode"), 'cs.amount' => array('label' => "Amount", 'checked' => '1', 'position' => 100), From 0870e00503cdf466a4eea00f6d5ef47996b8fe44 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 24 Nov 2025 13:00:38 +0100 Subject: [PATCH 08/16] Debug v23 --- htdocs/projet/tasks/time.php | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index e39155a6500..65a29ab0cc8 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -917,6 +917,19 @@ $help_url = ''; llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-project project-tasks page-task_time'); + +$param = ((!empty($mode) && $mode == 'mine') ? '&mode=mine' : ''); +if ($search_user) { + $param .= '&search_user=' . ((int) $search_user); +} +if ($search_month) { + $param .= '&search_month=' . ((int) $search_month); +} +if ($search_year) { + $param .= '&search_year=' . ((int) $search_year); +} + + if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser > 0) { // Project car in view mode if ($projectidforalltimes > 0) { @@ -956,17 +969,6 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser $head = project_prepare_head($projectstatic); print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project')); - $param = ((!empty($mode) && $mode == 'mine') ? '&mode=mine' : ''); - if ($search_user) { - $param .= '&search_user=' . ((int) $search_user); - } - if ($search_month) { - $param .= '&search_month=' . ((int) $search_month); - } - if ($search_year) { - $param .= '&search_year=' . ((int) $search_year); - } - // Project card $linkback = ''.$langs->trans("BackToList").''; @@ -1100,8 +1102,6 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser print '
'; } - $param = ''; - // Link to create time $linktocreatetimeBtnStatus = 0; $linktocreatetimeUrl = ''; @@ -1162,15 +1162,13 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser $head = task_prepare_head($object); print dol_get_fiche_head($head, 'task_time', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition'); + $linkback = $withproject ? '' . $langs->trans("BackToList") . '' : ''; + if ($action == 'deleteline') { - $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOSTINT("lineid") . ($withproject ? '&withproject=1' : ''); + $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOSTINT("lineid") . $param; $formconfirm .= $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); } - $param = ($withproject ? '&withproject=1' : ''); - $param .= ($param ? '&' : '') . 'id=' . $object->id; // ID of task - $linkback = $withproject ? '' . $langs->trans("BackToList") . '' : ''; - if (!GETPOST('withproject') || empty($projectstatic->id)) { $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); $object->next_prev_filter = "fk_projet:IN:" . $db->sanitize($projectsListId); @@ -1270,7 +1268,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser print dol_get_fiche_end(); } else { if ($action == 'deleteline') { - $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($projectstatic->id > 0 ? 'projectid=' . $projectstatic->id : ($object->id > 0 ? "id=" . $object->id : '')) . '&lineid=' . GETPOSTINT("lineid") . ($withproject ? '&withproject=1' : ''). "&contextpage=" . urlencode($contextpage); + $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($projectstatic->id > 0 ? 'projectid=' . $projectstatic->id : ($object->id > 0 ? "id=" . $object->id : '')) . '&lineid=' . GETPOSTINT("lineid") . ($withproject ? '&withproject=1' : ''). "&contextpage=" . urlencode($contextpage).$param; $formconfirm .= $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); } } From a2814f3d62569e3daa32afe2f3d5e663e7dc1411 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Nov 2025 14:55:54 +0100 Subject: [PATCH 09/16] Bump actions/checkout from 5 to 6 (#36394) Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci-cache-clean-pr.yml | 2 +- .github/workflows/ci-checkmajorversion.yml | 2 +- .github/workflows/ci-phpstan_baseline.yml | 2 +- .github/workflows/phan.yml | 2 +- .github/workflows/phpstan.yml | 2 +- .github/workflows/pre-commit.yml | 2 +- .github/workflows/windows-ci.yml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-cache-clean-pr.yml b/.github/workflows/ci-cache-clean-pr.yml index 9713af46134..5b6866b52c3 100644 --- a/.github/workflows/ci-cache-clean-pr.yml +++ b/.github/workflows/ci-cache-clean-pr.yml @@ -18,7 +18,7 @@ jobs: contents: read steps: - name: Check out code - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Cleanup run: | gh extension install actions/gh-actions-cache diff --git a/.github/workflows/ci-checkmajorversion.yml b/.github/workflows/ci-checkmajorversion.yml index 047d9b66f11..918f302e73c 100644 --- a/.github/workflows/ci-checkmajorversion.yml +++ b/.github/workflows/ci-checkmajorversion.yml @@ -17,7 +17,7 @@ jobs: github.repository == 'Dolibarr/dolibarr' || github.event.schedule == false steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Setup PHP uses: shivammathur/setup-php@v2 with: diff --git a/.github/workflows/ci-phpstan_baseline.yml b/.github/workflows/ci-phpstan_baseline.yml index a68414b62df..692d259d1d8 100644 --- a/.github/workflows/ci-phpstan_baseline.yml +++ b/.github/workflows/ci-phpstan_baseline.yml @@ -33,7 +33,7 @@ jobs: pull-requests: write steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Setup PHP uses: shivammathur/setup-php@v2 with: diff --git a/.github/workflows/phan.yml b/.github/workflows/phan.yml index 7004f68d1ea..9accfc8212d 100644 --- a/.github/workflows/phan.yml +++ b/.github/workflows/phan.yml @@ -33,7 +33,7 @@ jobs: github.repository == 'Dolibarr/dolibarr' || github.event.schedule == false steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Setup PHP uses: shivammathur/setup-php@v2 with: diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index d41d022a643..671326f83c1 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -37,7 +37,7 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 # Get PHP and addons - name: Setup PHP id: setup-php diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 48fc9cf2dfd..7cc7ed6f379 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -30,7 +30,7 @@ jobs: # if: false # Checkout git sources to analyze - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 # Try to get the list of modified files into steps.changed-php.outputs.all_changed_files #- name: Get changed files diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index cd772236d67..781a433bfbc 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -37,7 +37,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout code - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Setup PHP uses: shivammathur/setup-php@v2 with: From ee261b5a662a279642a32a578d92fa15e07bf1af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Mon, 24 Nov 2025 14:59:34 +0100 Subject: [PATCH 10/16] Adjust checkbox input style in subtotal_edit.tpl.php (#36387) --- htdocs/core/tpl/subtotal_edit.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/subtotal_edit.tpl.php b/htdocs/core/tpl/subtotal_edit.tpl.php index ddae4132e4c..47f9cbdd373 100644 --- a/htdocs/core/tpl/subtotal_edit.tpl.php +++ b/htdocs/core/tpl/subtotal_edit.tpl.php @@ -141,7 +141,7 @@ if (getDolGlobalString('PRODUCT_USE_UNITS')) { foreach ($line_options as $key => $value) { if (in_array($line_type, $value['type'])) { print '
  • '; - print '
  • '; } From 287ee92cb7c73cb71065da61f78552e22abb70d5 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 24 Nov 2025 15:00:15 +0100 Subject: [PATCH 11/16] Qual: Fix nullable value by cast (for phan) (#36381) # Qual: Fix nullable value by cast (for phan) The update method now explicitly casts the eatby and sellby fields to integers before passing them to the idate function. Otherwise phan considers the arguments as nullable (as it can not determine the impact of dol_strlen). --- htdocs/reception/class/receptionlinebatch.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/reception/class/receptionlinebatch.class.php b/htdocs/reception/class/receptionlinebatch.class.php index c4df1cc15be..4e5b1ad0217 100644 --- a/htdocs/reception/class/receptionlinebatch.class.php +++ b/htdocs/reception/class/receptionlinebatch.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024 Christophe Battarel - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2025 Nick Fragoulis * * This program is free software; you can redistribute it and/or modify @@ -590,8 +590,8 @@ class ReceptionLineBatch extends CommonObjectLine $sql .= " status=".(isset($this->status) ? $this->status : "null").","; $sql .= " tms=".(dol_strlen((string) $this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : 'null').","; $sql .= " batch=".(isset($this->batch) ? "'".$this->db->escape($this->batch)."'" : "null").","; - $sql .= " eatby=".(dol_strlen((string) $this->eatby) != 0 ? "'".$this->db->idate($this->eatby)."'" : 'null').","; - $sql .= " sellby=".(dol_strlen((string) $this->sellby) != 0 ? "'".$this->db->idate($this->sellby)."'" : 'null').","; + $sql .= " eatby=".(dol_strlen((string) $this->eatby) != 0 ? "'".$this->db->idate((int) $this->eatby)."'" : 'null').","; + $sql .= " sellby=".(dol_strlen((string) $this->sellby) != 0 ? "'".$this->db->idate((int) $this->sellby)."'" : 'null').","; $sql .= " fk_unit = ".((int) $this->fk_unit); $sql .= " WHERE rowid=".((int) $this->id); From 9db4c30918cfa19567cd3853975b46b5c3064755 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 24 Nov 2025 15:05:05 +0100 Subject: [PATCH 12/16] Qual: Add automatic_activation property (DolibarrModules) (#36386) * Qual: Add automatic_activation property (DolibarrModules) - Add `automatic_activation` property to store country-specific activation reasons - Add public to class constants (PSR-2/php-cs-fixer) * Qual: Simplify $module_activation test in admin.lib.php The test for $module_activation has been simplified after declaring the property in DolibarrModules. --- htdocs/core/lib/admin.lib.php | 2 +- htdocs/core/modules/DolibarrModules.class.php | 23 +++++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index daa27ffce26..ec2cf9c079c 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1629,7 +1629,7 @@ function activateModulesRequiredByCountry($country_code) if ($modulequalified) { // Load languages files of module - if (property_exists($objMod, 'automatic_activation') && isset($objMod->automatic_activation) && is_array($objMod->automatic_activation) && isset($objMod->automatic_activation[$country_code])) { + if (isset($objMod->automatic_activation[$country_code])) { activateModule($modName); setEventMessages($objMod->automatic_activation[$country_code], null, 'warnings'); diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 2315a2e013a..b425ea09617 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -139,16 +139,16 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it */ public $rights_class; - const URL_FOR_BLACKLISTED_MODULES = 'https://ping.dolibarr.org/modules-blacklist.txt'; + public const URL_FOR_BLACKLISTED_MODULES = 'https://ping.dolibarr.org/modules-blacklist.txt'; - const KEY_ID = 0; - const KEY_LABEL = 1; - const KEY_TYPE = 2; // deprecated - const KEY_DEFAULT = 3; - const KEY_FIRST_LEVEL = 4; - const KEY_SECOND_LEVEL = 5; - const KEY_MODULE = 6; - const KEY_ENABLED = 7; + public const KEY_ID = 0; + public const KEY_LABEL = 1; + public const KEY_TYPE = 2; // deprecated + public const KEY_DEFAULT = 3; + public const KEY_FIRST_LEVEL = 4; + public const KEY_SECOND_LEVEL = 5; + public const KEY_MODULE = 6; + public const KEY_ENABLED = 7; /** * @var array|int<1,1> Module menu entries (1 means the menu entries are not declared into module descriptor but are hardcoded into menu manager) @@ -400,6 +400,11 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it */ public $disabled; + /** + * @var array Array [''=>''] + */ + public $automatic_activation = array(); + /** * @var int Module is enabled globally (Multicompany support) */ From 4f5c32973fb4054a579abb4c12c6d5d9bd0c37dc Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 24 Nov 2025 15:05:55 +0100 Subject: [PATCH 13/16] Qual: Improve type hints and cache arrays in html.form.class.php (#36384) * Qual: Improve type hints and cache arrays in html.form.class.php - Added detailed type hints for cache arrays - Fixed a typo in the comment for the 'num' property - Ensured consistent type casting for integer values in cache arrays (fixes phpstan notices) * Qual: Add type casting in donation modules Following cache type improvement: - Added type casting in donation modules --- htdocs/core/class/html.form.class.php | 13 ++++++++++--- htdocs/core/modules/dons/html_cerfafr.modules.php | 4 ++-- htdocs/core/modules/dons/html_generic.modules.php | 4 ++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 62e653aa2d0..4ccad75628f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -74,18 +74,25 @@ class Form /** @var array */ public $result; - /** @var int Number of line returned by method to generate combo select */ + /** @var int Number of lines returned by method to generate combo select */ public $num; // Cache arrays + /** @var array */ public $cache_types_paiements = array(); + /** @var array */ public $cache_conditions_paiements = array(); + /** @var array */ public $cache_transport_mode = array(); /** @var array */ public $cache_availability = array(); + /** @var array */ public $cache_demand_reason = array(); + /** @var array */ public $cache_types_fees = array(); + /** @var array */ public $cache_vatrates = array(); + /** @var array */ public $cache_invoice_subtype = array(); /** @var array */ public $cache_rule_for_lines_dates = array(); @@ -4755,7 +4762,7 @@ class Form $label = $langs->trans($obj->code); // So translation key SRC_XXX will work } - $tmparray[$obj->rowid]['id'] = $obj->rowid; + $tmparray[$obj->rowid]['id'] = (int) $obj->rowid; $tmparray[$obj->rowid]['code'] = $obj->code; $tmparray[$obj->rowid]['label'] = $label; $i++; @@ -7300,7 +7307,7 @@ class Form $obj = $this->db->fetch_object($resql); $tmparray = array(); - $tmparray['rowid'] = $obj->rowid; + $tmparray['rowid'] = (int) $obj->rowid; $tmparray['type_vat'] = ($obj->type_vat <= 0 ? 0 : $obj->type_vat); // Some version have type_vat corrupted with value -1 $tmparray['code'] = $obj->code; $tmparray['txtva'] = $obj->taux; diff --git a/htdocs/core/modules/dons/html_cerfafr.modules.php b/htdocs/core/modules/dons/html_cerfafr.modules.php index 609443fa8f0..7148abfa637 100644 --- a/htdocs/core/modules/dons/html_cerfafr.modules.php +++ b/htdocs/core/modules/dons/html_cerfafr.modules.php @@ -5,7 +5,7 @@ * Copyright (C) 2012 Marcos García * Copyright (C) 2014-2020 Alexandre Spangaro * Copyright (C) 2015 Benoit Bruchard - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2025 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -172,7 +172,7 @@ class html_cerfafr extends ModeleDon $form = str_replace('__DONATOR_ADDRESS__', $don->address, $form); $form = str_replace('__DONATOR_ZIP__', $don->zip, $form); $form = str_replace('__DONATOR_TOWN__', $don->town, $form); - $form = str_replace('__PAYMENTMODE_LIB__ ', $paymentmode, $form); + $form = str_replace('__PAYMENTMODE_LIB__ ', (string) $paymentmode, $form); $form = str_replace('__NOW__', dol_print_date($now, 'day', false, $outputlangs), $form); $form = str_replace('__DonationRef__', $outputlangs->trans("DonationRef"), $form); $form = str_replace('__DonationTitle__', $outputlangs->trans("DonationTitle"), $form); diff --git a/htdocs/core/modules/dons/html_generic.modules.php b/htdocs/core/modules/dons/html_generic.modules.php index 622c8139cc0..5f7499cb2e5 100644 --- a/htdocs/core/modules/dons/html_generic.modules.php +++ b/htdocs/core/modules/dons/html_generic.modules.php @@ -6,7 +6,7 @@ * Copyright (C) 2014-2020 Alexandre Spangaro * Copyright (C) 2015 Benoit Bruchard * Copyright (C) 2015 Benjamin Neumann - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -97,7 +97,7 @@ class html_generic extends ModeleDon $formclass->load_cache_types_paiements(); if ($don->mode_reglement_id) { - $paymentmode = $formclass->cache_types_paiements[$don->mode_reglement_id]['label']; + $paymentmode = (string) $formclass->cache_types_paiements[$don->mode_reglement_id]['label']; } else { $paymentmode = ''; } From ff44d3ce3cee7077f7d78f70be3d8f43698685c7 Mon Sep 17 00:00:00 2001 From: Jon Bendtsen Date: Mon, 24 Nov 2025 15:06:17 +0100 Subject: [PATCH 14/16] fixing hurl test for api users (#36380) Co-authored-by: Jon Bendtsen --- test/hurl/api/users/10_users.hurl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/hurl/api/users/10_users.hurl b/test/hurl/api/users/10_users.hurl index 31b1543387b..0d8c125443c 100644 --- a/test/hurl/api/users/10_users.hurl +++ b/test/hurl/api/users/10_users.hurl @@ -45,7 +45,10 @@ HTTP 400 POST http://{{hostnport}}/api/index.php/users {} HTTP 500 -{"error":{"code":500,"message":"Internal Server Error: Error creating","0":"Email address is incorrect"}} +[Asserts] +jsonpath "$.error" exists +jsonpath "$.error.code" == 500 +jsonpath "$.error.message" == "Internal Server Error: login field missing" # DELETE DELETE http://{{hostnport}}/api/index.php/users/ From aae74dac7f08a1e6783b3905449a99c0a134e3d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Mon, 24 Nov 2025 15:07:07 +0100 Subject: [PATCH 15/16] fix subtotal column number displayed if margin enabled (#36383) --- htdocs/core/tpl/subtotal_view.tpl.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/tpl/subtotal_view.tpl.php b/htdocs/core/tpl/subtotal_view.tpl.php index 4600e760bce..de0138aa2fc 100644 --- a/htdocs/core/tpl/subtotal_view.tpl.php +++ b/htdocs/core/tpl/subtotal_view.tpl.php @@ -2,6 +2,7 @@ /* Copyright (C) 2014-2017 Laurent Destailleur * Copyright (C) 2024 MDW * Copyright (C) 2024-2025 Frédéric France + * Copyright (C) 2025 Charlene Benke * * 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 @@ -149,13 +150,13 @@ if ($line->qty > 0) { ?> // Handling colspan if margin module is enabled if (!empty($object->element) && in_array($object->element, array('facture', 'facturerec', 'propal', 'commande')) && isModEnabled('margin') && empty($user->socid)) { if ($user->hasRight('margins', 'creer')) { - print ''; + print ''; } if (getDolGlobalString('DISPLAY_MARGIN_RATES') && $user->hasRight('margins', 'liretous')) { - print ''; + print ''; } if (getDolGlobalString('DISPLAY_MARK_RATES') && $user->hasRight('margins', 'liretous')) { - print ''; + print ''; } } ?> From 236d45547b3e9f9bc27d61257bdabcd4350ff32e Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 24 Nov 2025 15:08:01 +0100 Subject: [PATCH 16/16] FIX Invoice - Problem with deposit line on Type of operation (#36378) --- .../doc/doc_generic_invoice_odt.modules.php | 24 +++++++++--- .../modules/facture/doc/pdf_crabe.modules.php | 15 ++++++- .../facture/doc/pdf_octopus.modules.php | 39 ++++++++++++------- .../facture/doc/pdf_sponge.modules.php | 37 ++++++++++++------ 4 files changed, 84 insertions(+), 31 deletions(-) diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 80e81be745a..bb9155f66b2 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -1,10 +1,11 @@ - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2014 Marcos García - * Copyright (C) 2016 Charlie Benke - * Copyright (C) 2018-2025 Frédéric France +/* Copyright (C) 2010-2012 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2014 Marcos García + * Copyright (C) 2016 Charlie Benke + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2024 MDW + * Copyright (C) 2025 Alexandre Spangaro * * 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 @@ -344,6 +345,19 @@ class doc_generic_invoice_odt extends ModelePDFFactures $nbProduct = 0; $nbService = 0; foreach ($object->lines as $line) { + // Do not take into account lines of the type “deposit.” + $is_deposit = false; + if (preg_match('/^\((.*)\)$/', $line->desc, $reg)) { + if ($reg[1] == 'DEPOSIT') { + $is_deposit = true; + } + } + + // If DEPOSIT, this line is completely ignored for calculations. + if ($is_deposit) { + continue; + } + // determine category of operation if ($categoryOfOperation < 2) { $lineProductType = $line->product_type; diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index b548cb510bf..29b1eadf415 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -13,7 +13,7 @@ * Copyright (C) 2022 Charlene Benke * Copyright (C) 2024-2025 MDW * Copyright (C) 2024-2025 Nick Fragoulis - * Copyright (C) 2024 Alexandre Spangaro + * Copyright (C) 2024-2025 Alexandre Spangaro * * 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 @@ -388,6 +388,19 @@ class pdf_crabe extends ModelePDFFactures $this->atleastonediscount++; } + // Do not take into account lines of the type “deposit.” + $is_deposit = false; + if (preg_match('/^\((.*)\)$/', $object->lines[$i]->desc, $reg)) { + if ($reg[1] == 'DEPOSIT') { + $is_deposit = true; + } + } + + // If DEPOSIT, this line is completely ignored for calculations. + if ($is_deposit) { + continue; + } + // determine category of operation if ($categoryOfOperation < 2) { $lineProductType = $object->lines[$i]->product_type; diff --git a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php index f7090067beb..3a2339b6b07 100644 --- a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php @@ -1,17 +1,17 @@ - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2008 Raphael Bertrand - * Copyright (C) 2010-2014 Juanjo Menent - * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2012 Cédric Salvador - * Copyright (C) 2012-2014 Raphaël Doursenaud - * Copyright (C) 2015 Marcos Garcia - * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2018-2025 Frédéric France - * Copyright (C) 2022 Anthony Berton - * Copyright (C) 2022-2025 Alexandre Spangaro - * Copyright (C) 2022-2024 Eric Seigne +/* Copyright (C) 2004-2014 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2008 Raphael Bertrand + * Copyright (C) 2010-2014 Juanjo Menent + * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2012 Cédric Salvador + * Copyright (C) 2012-2014 Raphaël Doursenaud + * Copyright (C) 2015 Marcos Garcia + * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2018-2025 Frédéric France + * Copyright (C) 2022 Anthony Berton + * Copyright (C) 2022-2025 Alexandre Spangaro + * Copyright (C) 2022-2024 Eric Seigne * Copyright (C) 2024-2025 MDW * Copyright (C) 2024-2025 Nick Fragoulis * @@ -488,6 +488,19 @@ class pdf_octopus extends ModelePDFFactures $this->atleastonediscount++; } + // Do not take into account lines of the type “deposit.” + $is_deposit = false; + if (preg_match('/^\((.*)\)$/', $object->lines[$i]->desc, $reg)) { + if ($reg[1] == 'DEPOSIT') { + $is_deposit = true; + } + } + + // If DEPOSIT, this line is completely ignored for calculations. + if ($is_deposit) { + continue; + } + // determine category of operation if ($categoryOfOperation < 2) { $lineProductType = $object->lines[$i]->product_type; diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index ea7488c96a0..209ead0c0b6 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1,17 +1,17 @@ - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2008 Raphael Bertrand - * Copyright (C) 2010-2014 Juanjo Menent - * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2012 Cédric Salvador - * Copyright (C) 2012-2014 Raphaël Doursenaud - * Copyright (C) 2015 Marcos García - * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2018-2025 Frédéric France +/* Copyright (C) 2004-2024 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2008 Raphael Bertrand + * Copyright (C) 2010-2014 Juanjo Menent + * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2012 Cédric Salvador + * Copyright (C) 2012-2014 Raphaël Doursenaud + * Copyright (C) 2015 Marcos García + * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2018-2024 Anthony Berton - * Copyright (C) 2022-2024 Alexandre Spangaro - * Copyright (C) 2024-2025 MDW + * Copyright (C) 2022-2025 Alexandre Spangaro + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024-2025 Nick Fragoulis * Copyright (C) 2024 Franck Moreau * @@ -419,6 +419,19 @@ class pdf_sponge extends ModelePDFFactures $this->atleastonediscount++; } + // Do not take into account lines of the type “deposit.” + $is_deposit = false; + if (preg_match('/^\((.*)\)$/', $object->lines[$i]->desc, $reg)) { + if ($reg[1] == 'DEPOSIT') { + $is_deposit = true; + } + } + + // If DEPOSIT, this line is completely ignored for calculations. + if ($is_deposit) { + continue; + } + // determine category of operation if ($categoryOfOperation < 2) { $lineProductType = $object->lines[$i]->product_type;