From c75663b2deb3b56a47aa6337f02fce2184f58743 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 28 Jul 2025 15:40:54 +0200 Subject: [PATCH 1/8] Fix CI --- htdocs/comm/action/index.php | 2 +- htdocs/comm/action/list.php | 2 +- htdocs/comm/action/pertype.php | 4 ++-- htdocs/comm/action/peruser.php | 4 ++-- htdocs/core/class/commonobject.class.php | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 8a9e3b7d340..089f9c4e7ae 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -773,7 +773,7 @@ if (($filtert != '-1' && $filtert != '-2') || $usergroup > 0) { if ($filtert != '-1' && $filtert != '-2' && $filtert != '-3') { $sql .= " AND (ar.fk_element IN (".$db->sanitize($filtert).") OR (ar.fk_element IS NULL AND a.fk_user_action = ".((int) $filtert)."))"; // The OR is for backward compatibility } elseif ($filtert == '-3') { - $sql .= " AND ar.fk_element IN (".$db->sanitize(implode(',', $user->getAllChildIds('hierarchyme'))).")"; + $sql .= " AND ar.fk_element IN (".$db->sanitize(implode(',', $user->getAllChildIds(1))).")"; } if ($usergroup > 0) { $sql .= " INNER JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element AND ugu.fk_usergroup = ".((int) $usergroup); diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 647c1405f63..2da484c7541 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -468,7 +468,7 @@ if (($filtert != '-1' && $filtert != '-2') || $usergroup > 0) { if ($filtert != '' && $filtert != '-1' && $filtert != '-2' && $filtert != '-3') { $sql .= " AND (ar.fk_element IN (".$db->sanitize($filtert).") OR (ar.fk_element IS NULL AND a.fk_user_action = ".((int) $filtert)."))"; // The OR is for backward compatibility } elseif ($filtert == '-3') { - $sql .= " AND ar.fk_element IN (".$db->sanitize(implode(',', $user->getAllChildIds('hierarchyme'))).")"; + $sql .= " AND ar.fk_element IN (".$db->sanitize(implode(',', $user->getAllChildIds(1))).")"; } if ($usergroup > 0) { $sql .= " INNER JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element AND ugu.fk_usergroup = ".((int) $usergroup); diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index ad286058579..f782ac280fc 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -555,7 +555,7 @@ if (($filtert != '-1' && $filtert != '-2') || $usergroup > 0) { if ($filtert != '-1' && $filtert != '-2' && $filtert != '-3') { $sql .= " AND ar.fk_element IN (".$db->sanitize($filtert).")"; } elseif ($filtert == -3) { - $sql .= " AND ar.fk_element IN (".$db->sanitize(implode(',', $user->getAllChildIds('hierarchyme'))).")"; + $sql .= " AND ar.fk_element IN (".$db->sanitize(implode(',', $user->getAllChildIds(1))).")"; } if ($usergroup > 0) { $sql .= " INNER JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element AND ugu.fk_usergroup = ".((int) $usergroup); @@ -677,7 +677,7 @@ if (($filtert > 0 || $filtert == -3) || $usergroup > 0) { if ($filtert > 0) { $sql .= "ar.fk_element = ".((int) $filtert); } elseif ($filtert == -3) { - $sql .= "ar.fk_element IN (".$db->sanitize(implode(',', $user->getAllChildIds('hierarchyme'))).")"; + $sql .= "ar.fk_element IN (".$db->sanitize(implode(',', $user->getAllChildIds(1))).")"; } if ($usergroup > 0) { $sql .= ($filtert > 0 ? " OR " : "")." ugu.fk_usergroup = ".((int) $usergroup); diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 4b364d8735f..abc952992f3 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -701,7 +701,7 @@ if (($filtert != '-1' && $filtert != '-2') || $usergroup > 0) { if ($filtert != '' && $filtert != '-1' && $filtert != '-2' && $filtert != '-3') { $sql .= " AND ar.fk_element IN (".$db->sanitize($filtert).")"; } elseif ($filtert == '-3') { - $sql .= " AND ar.fk_element IN (".$db->sanitize(implode(',', $user->getAllChildIds('hierarchyme'))).")"; + $sql .= " AND ar.fk_element IN (".$db->sanitize(implode(',', $user->getAllChildIds(1))).")"; } if ($usergroup > 0) { $sql .= " INNER JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element AND ugu.fk_usergroup = ".((int) $usergroup); @@ -823,7 +823,7 @@ if (($filtert > 0 || $filtert == -3) || $usergroup > 0) { if ($filtert > 0) { $sql .= "ar.fk_element = ".((int) $filtert); } elseif ($filtert == -3) { - $sql .= "ar.fk_element IN (".$db->sanitize(implode(',', $user->getAllChildIds('hierarchyme'))).")"; + $sql .= "ar.fk_element IN (".$db->sanitize(implode(',', $user->getAllChildIds(1))).")"; } if ($usergroup > 0) { $sql .= ($filtert > 0 ? " OR " : "")." ugu.fk_usergroup = ".((int) $usergroup); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 5ed546716da..1d82cdf9ab8 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -514,7 +514,7 @@ abstract class CommonObject public $multicurrency_code; /** - * @var float|float[] Multicurrency rate ("tx" = "taux" in French) + * @var ?float|float[] Multicurrency rate ("tx" = "taux" in French) * Or, just for the Paiement object, an array: invoice ID => currency rate for that invoice. */ public $multicurrency_tx; From 0fa59d0e9c21bbc1374a8ce4833402e64815c50c Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 28 Jul 2025 16:17:03 +0200 Subject: [PATCH 2/8] Fix CI and warning message --- htdocs/core/class/commonobject.class.php | 2 +- htdocs/langs/en_US/users.lang | 2 ++ htdocs/user/list.php | 10 +++++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 1d82cdf9ab8..5ed546716da 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -514,7 +514,7 @@ abstract class CommonObject public $multicurrency_code; /** - * @var ?float|float[] Multicurrency rate ("tx" = "taux" in French) + * @var float|float[] Multicurrency rate ("tx" = "taux" in French) * Or, just for the Paiement object, an array: invoice ID => currency rate for that invoice. */ public $multicurrency_tx; diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang index 4ad17dac539..2b19ff477ea 100644 --- a/htdocs/langs/en_US/users.lang +++ b/htdocs/langs/en_US/users.lang @@ -120,6 +120,8 @@ DateEmploymentStart=Employment Start Date DateEmploymentEnd=Employment End Date RangeOfLoginValidity=Access validity date range CantDisableYourself=You can't disable your own user record +CantDisableAnAdminUserWithMassActions=You can't disable users in a mass action when one of them is an admin user (like "%s"). Try to disable the admin user(s) manually, one by one from their dedicated page. +CantEnableAnAdminUserWithMassActions=You can't enable users in a mass action when one of them is an admin user (like "%s"). Try to disable the admin user(s) manually, one by one from their dedicated page. ForceUserExpenseValidator=Force expense report validator ForceUserHolidayValidator=Force leave request validator ValidatorIsSupervisorByDefault=By default, the validator is the supervisor of the user. Keep empty to keep this behavior. diff --git a/htdocs/user/list.php b/htdocs/user/list.php index c78df13668d..83fdbf40c1f 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -305,7 +305,6 @@ if (empty($reshook)) { $uploaddir = $conf->user->dir_output; global $error; - include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; // Disable or Enable records if (!$error && ($massaction == 'disable' || $massaction == 'reactivate') && $permissiontoadd) { @@ -316,7 +315,7 @@ if (empty($reshook)) { $nbok = 0; foreach ($toselect as $toselectid) { if ($toselectid == $user->id) { - setEventMessages($langs->trans($massaction == 0 ? 'CantDisableYourself' : 'CanEnableYourself'), null, 'errors'); + setEventMessages($langs->trans($massaction == 'disable' ? 'CantDisableYourself' : 'CanEnableYourself'), null, 'errors'); $error++; break; } @@ -324,7 +323,7 @@ if (empty($reshook)) { $result = $objecttmp->fetch($toselectid); if ($result > 0) { if ($objecttmp->admin) { - setEventMessages($langs->trans($massaction == 0 ? 'CantDisableAnAdminUserWithMassActions' : 'CantEnableAnAdminUserWithMassActions', $objecttmp->login), null, 'errors'); + setEventMessages($langs->trans($massaction == 'disable' ? 'CantDisableAnAdminUserWithMassActions' : 'CantEnableAnAdminUserWithMassActions', $objecttmp->login), null, 'errors'); $error++; break; } @@ -360,7 +359,12 @@ if (empty($reshook)) { } else { $db->rollback(); } + + $massaction = ''; } + + // Generic mass actions + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } From 98ce9717e520d1f979f3abac97cc8d9117cc34c3 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 28 Jul 2025 17:10:25 +0200 Subject: [PATCH 3/8] Doc --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8fbf0a21d12..fd04d5b5107 100644 --- a/ChangeLog +++ b/ChangeLog @@ -160,7 +160,7 @@ The following changes may create regressions for some external modules, but were * The API to create a website account /idthirdparty/accounts/site is now POST (instead of PUT) and to update is PUT (instead of PATCH). * Debug v22 - Invert option TICKET_DO_NOT_INCLUDE_LINK_TO_CUSTOMER (that add link to backoffice interface link when it should remain private) into TICKET_INCLUDE_LINK_TO_PUBLIC_INTERFACE_IN_MESSAGE. It also avoid often emails marked as SPAM due to suspicious link. - +* The property ->price_ht of an object line that was a duplicate of ->subprice has been standardized. Use ->subprice everywhere now. ***** ChangeLog for 21.0.3 compared to 21.0.2 ***** From 7c6a307a011e1b47520167bed4c4f6fe7c9cec12 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 28 Jul 2025 17:18:38 +0200 Subject: [PATCH 4/8] Fix CI --- htdocs/comm/action/index.php | 2 +- .../modules/facture/doc/pdf_sponge.modules.php | 18 ++++++++++++------ .../modules/propale/doc/pdf_azur.modules.php | 3 ++- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 089f9c4e7ae..6dc1d7dba5d 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -2359,7 +2359,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa print ''.img_picto("all", "1downarrow_selected.png").' ...'; print ' +'.(count($eventarray[$daykey]) - $maxprint); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 415b8088b84..84cf1d182ca 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -2169,12 +2169,18 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("Paid").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("Paid") : ''), 0, 'L', false); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - if (!isModEnabled("multicurrency") || $object->multicurrency_tx == 1 || getDolGlobalInt('MULTICURRENCY_SHOW_ALSO_MAIN_CURRENCY_ON_PDF') == 0) { - $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', false); - } else { - //$pdf->MultiCell($largcol2, $tab2_hl, '('.price($deja_regle_origin + $depositsamount_origin, 0, $outputlangs, 1, -1, 'MT', $mysoc->currency_code).') '.price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', false); - $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', false); - } + //if (!isModEnabled("multicurrency") || $object->multicurrency_tx == 1 || getDolGlobalInt('MULTICURRENCY_SHOW_ALSO_MAIN_CURRENCY_ON_PDF') == 0) { + $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', false); + //} else { + // $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', false); + // + // $index++; + // $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + // $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("Paid").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("Paid") : '').' ('.$outputlangs->getCurrencySymbol($mysoc->currency_code).')', $useborder, 'L', true); + + // $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + // $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle_origin + $depositsamount_origin, 0, $outputlangs, 1, -1, -1, $mysoc->currency_code), $useborder, 'L', true); + //} // Credit note if ($creditnoteamount) { diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 10d4a8fe2b4..5492a42980b 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1111,7 +1111,8 @@ class pdf_azur extends ModelePDFPropales protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs, $outputlangsbis = null) { // phpcs:enable - global $conf, $mysoc; + global $mysoc; + $default_font_size = pdf_getPDFFontSize($outputlangs); $tab2_top = $posy; From e7eff817e94b574f2ed5653bcb87d8b467ea56cf Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 28 Jul 2025 17:19:23 +0200 Subject: [PATCH 5/8] Fix bad position of closing brackets. --- .../modules/propale/doc/pdf_cyan.modules.php | 102 +++++++++--------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 9f86af4b311..b319120a0dd 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1551,64 +1551,64 @@ class pdf_cyan extends ModelePDFPropales $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc_origin, 0, $outputlangs, 1, -1, -1, $mysoc->currency_code), $useborder, 'L', true); } } + } - $pdf->SetTextColor(0, 0, 0); + $pdf->SetTextColor(0, 0, 0); + + $resteapayer = 0; + /* + $resteapayer = $object->total_ttc - $deja_regle; + if (!empty($object->paye)) $resteapayer=0; + */ + + if ($deja_regle > 0) { + // Already paid + Deposits + $index++; + + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("AlreadyPaid") : ''), 0, 'L', false); + + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle, 0, $outputlangs), 0, 'R', false); - $resteapayer = 0; /* - $resteapayer = $object->total_ttc - $deja_regle; - if (!empty($object->paye)) $resteapayer=0; + if ($object->close_code == 'discount_vat') { + $index++; + $pdf->SetFillColor(255,255,255); + + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("EscompteOfferedShort"), $useborder, 'L', 1); + + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc - $deja_regle, 0, $outputlangs), $useborder, 'R', 1); + + $resteapayer=0; + } */ - if ($deja_regle > 0) { - // Already paid + Deposits - $index++; - - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("AlreadyPaid") : ''), 0, 'L', false); - - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle, 0, $outputlangs), 0, 'R', false); - - /* - if ($object->close_code == 'discount_vat') { - $index++; - $pdf->SetFillColor(255,255,255); - - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("EscompteOfferedShort"), $useborder, 'L', 1); - - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc - $deja_regle, 0, $outputlangs), $useborder, 'R', 1); - - $resteapayer=0; - } - */ - - $index++; - $pdf->SetTextColor(0, 0, 60); - $pdf->SetFillColor(224, 224, 224); - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("RemainderToPay") : ''), $useborder, 'L', true); - - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', true); - - $pdf->SetFont('', '', $default_font_size - 1); - $pdf->SetTextColor(0, 0, 0); - } - - $parameters = array('pdf' => &$pdf, 'object' => &$object, 'outputlangs' => $outputlangs, 'index' => &$index, 'posy' => $posy); - - $reshook = $hookmanager->executeHooks('afterPDFTotalTable', $parameters, $this); // Note that $action and $object may have been modified by some hooks - if ($reshook < 0) { - $this->error = $hookmanager->error; - $this->errors = $hookmanager->errors; - } - $index++; - return ($tab2_top + ($tab2_hl * $index)); + $pdf->SetTextColor(0, 0, 60); + $pdf->SetFillColor(224, 224, 224); + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("RemainderToPay") : ''), $useborder, 'L', true); + + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', true); + + $pdf->SetFont('', '', $default_font_size - 1); + $pdf->SetTextColor(0, 0, 0); } + + $parameters = array('pdf' => &$pdf, 'object' => &$object, 'outputlangs' => $outputlangs, 'index' => &$index, 'posy' => $posy); + + $reshook = $hookmanager->executeHooks('afterPDFTotalTable', $parameters, $this); // Note that $action and $object may have been modified by some hooks + if ($reshook < 0) { + $this->error = $hookmanager->error; + $this->errors = $hookmanager->errors; + } + + $index++; + return ($tab2_top + ($tab2_hl * $index)); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore From e6e3486f95e67ef3076f722b450686e514cba323 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 28 Jul 2025 17:29:51 +0200 Subject: [PATCH 6/8] Fix CI --- htdocs/comm/action/peruser.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index abc952992f3..05b5feadb4c 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -531,7 +531,7 @@ if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda' $urltocreateaction = DOL_URL_ROOT.'/comm/action/card.php?action=create'; $urltocreateaction .= '&apyear='.$tmpforcreatebutton['year'].'&apmonth='.$tmpforcreatebutton['mon'].'&apday='.$tmpforcreatebutton['mday'].'&aphour='.$tmpforcreatebutton['hours'].'&apmin='.$tmpforcreatebutton['minutes']; - $urltocreateaction .= '&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : '')); + $urltocreateaction .= '&backtopage='.urlencode($_SERVER["PHP_SELF"].'?'.$newparam); $newcardbutton .= dolGetButtonTitle($langs->trans("AddAction"), '', 'fa fa-plus-circle', $urltocreateaction); } @@ -2479,7 +2479,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & print 'style="background: #'.$color1.'; "'; } print 'class="'; - print ($style1 ? $style1.' ' : ''); + print $style1.' '; print 'center'.($title1 ? ' classfortooltip' : '').($title1 ? ' cursorpointer' : '').'"'; print 'ref="'.$ref1.'_'.$username->id.'_'.sprintf("%04d", $year).'_'.sprintf("%02d", $month).'_'.sprintf("%02d", $day).'_'.sprintf("%02d", $h).'_00_'.($ids1 ? $ids1 : 'none').'"'; print ($title1 ? ' title="'.$title1.'"' : '').'>'; @@ -2493,7 +2493,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & print 'style="background: #'.$color2.'; "'; } print 'class="'; - print ($style2 ? $style2.' ' : ''); + print $style2.' '; print 'center'.($title2 ? ' classfortooltip' : '').($title2 ? ' cursorpointer' : '').'"'; print ' ref="'.$ref2.'_'.$username->id.'_'.sprintf("%04d", $year).'_'.sprintf("%02d", $month).'_'.sprintf("%02d", $day).'_'.sprintf("%02d", $h).'_15_'.($ids2 ? $ids2 : 'none').'"'; print ($title2 ? ' title="'.$title2.'"' : '').'>'; @@ -2507,7 +2507,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & print 'style="background: #'.$color3.'; "'; } print 'class="'; - print ($style3 ? $style3.' ' : ''); + print $style3.' '; print 'center'.($title3 ? ' classfortooltip' : '').($title3 ? ' cursorpointer' : '').'"'; print ' ref="'.$ref3.'_'.$username->id.'_'.sprintf("%04d", $year).'_'.sprintf("%02d", $month).'_'.sprintf("%02d", $day).'_'.sprintf("%02d", $h).'_30_'.($ids3 ? $ids3 : 'none').'"'; print ($title3 ? ' title="'.$title3.'"' : '').'>'; @@ -2521,7 +2521,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & print 'style="background: #'.$color4.'; "'; } print 'class="'; - print ($style4 ? $style4.' ' : ''); + print $style4.' '; print 'center'.($title4 ? ' classfortooltip' : '').($title4 ? ' cursorpointer' : '').'"'; print ' ref="'.$ref4.'_'.$username->id.'_'.sprintf("%04d", $year).'_'.sprintf("%02d", $month).'_'.sprintf("%02d", $day).'_'.sprintf("%02d", $h).'_45_'.($ids4 ? $ids4 : 'none').'"'; print ($title4 ? ' title="'.$title4.'"' : '').'>'; From 6d0277f2b80ca3063574bd635207afffab5d7b8d Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 28 Jul 2025 18:38:14 +0200 Subject: [PATCH 7/8] Fix CI --- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 6 +++--- .../core/modules/commande/doc/pdf_eratosthene.modules.php | 6 +++--- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 6 +++--- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 2 +- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index e4734135f95..c943858718d 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -960,7 +960,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top); - $total_before_discount_to_show = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines)); + $total_before_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines)); $pdf->MultiCell($largcol2, $tab2_hl, price($total_before_discount_to_show, 0, $outputlangs), 0, 'R', true); $index++; @@ -970,7 +970,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl); - $total_discount_to_show = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $multicurrency_total_discount_on_lines : $total_discount_on_lines); + $total_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $multicurrency_total_discount_on_lines : $total_discount_on_lines); $pdf->MultiCell($largcol2, $tab2_hl, price($total_discount_to_show, 0, $outputlangs), 0, 'R', true); $index++; @@ -981,7 +981,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', true); - $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', true); diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index cdbbc024709..d0c51a38fa1 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -1237,7 +1237,7 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top); - $total_before_discount_to_show = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines)); + $total_before_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines)); $pdf->MultiCell($largcol2, $tab2_hl, price($total_before_discount_to_show, 0, $outputlangs), 0, 'R', true); $index++; @@ -1257,7 +1257,7 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', true); - $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', true); @@ -1300,7 +1300,7 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); - $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); + $total_localtax = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 1aee52505c2..b4df7e43865 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1503,7 +1503,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top); - $total_before_discount_to_show = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines)); + $total_before_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines)); $pdf->MultiCell($largcol2, $tab2_hl, price($total_before_discount_to_show, 0, $outputlangs), 0, 'R', true); $index++; @@ -1513,7 +1513,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl); - $total_discount_to_show = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $multicurrency_total_discount_on_lines : $total_discount_on_lines); + $total_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $multicurrency_total_discount_on_lines : $total_discount_on_lines); $pdf->MultiCell($largcol2, $tab2_hl, price($total_discount_to_show, 0, $outputlangs), 0, 'R', true); $index++; @@ -1524,7 +1524,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') ? "TotalHT" : "Total").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities(!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') ? "TotalHT" : "Total") : ''), 0, 'L', true); - $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ht, 0, $outputlangs), 0, 'R', true); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 84cf1d182ca..88d025f6709 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1821,7 +1821,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top); - $total_before_discount_to_show = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines)); + $total_before_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines)); $pdf->MultiCell($largcol2, $tab2_hl, price($total_before_discount_to_show, 0, $outputlangs), 0, 'R', true); $index++; diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 5492a42980b..5f3fb6bd2dc 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1156,7 +1156,7 @@ class pdf_azur extends ModelePDFPropales $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top); - $total_before_discount_to_show = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines)); + $total_before_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines)); $pdf->MultiCell($largcol2, $tab2_hl, price($total_before_discount_to_show, 0, $outputlangs), 0, 'R', true); $index++; diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index b319120a0dd..279c59868d9 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1325,7 +1325,7 @@ class pdf_cyan extends ModelePDFPropales $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top); - $total_before_discount_to_show = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines)); + $total_before_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? ($object->multicurrency_total_ht + $multicurrency_total_discount_on_lines) : ($object->total_ht + $total_discount_on_lines)); $pdf->MultiCell($largcol2, $tab2_hl, price($total_before_discount_to_show, 0, $outputlangs), 0, 'R', true); $index++; @@ -1335,7 +1335,7 @@ class pdf_cyan extends ModelePDFPropales $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl); - $total_discount_to_show = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $multicurrency_total_discount_on_lines : $total_discount_on_lines); + $total_discount_to_show = ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $multicurrency_total_discount_on_lines : $total_discount_on_lines); $pdf->MultiCell($largcol2, $tab2_hl, price($total_discount_to_show, 0, $outputlangs), 0, 'R', true); $index++; From d8d1de1a4bc7e7aae0f1816564d1a6467618e642 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 28 Jul 2025 18:39:16 +0200 Subject: [PATCH 8/8] Accountancy - UX - Uniformize option overview of numbering module (#34816) * Accountancy - UX - Uniformize option overview of numbering module * Small ajust --- htdocs/accountancy/admin/index.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index aba0ae018dc..7c29ed6835d 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -579,18 +579,16 @@ print ''; print '
'; -print '
'; +// Show numbering options +print '

'; // Accountancy Numbering model $dirmodels = array_merge(array('/'), $conf->modules_parts['models']); -print load_fiche_titre($langs->trans("BookkeepingNumberingModules"), '', ''); - print '
'; print ''; print ''; -print ''; -print ''; +print ''; print ''; print ''; print '';
'.$langs->trans("Name").''.$langs->trans("BookkeepingNumberingModules").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("ShortInfo").'