From 5660bf5b4f64d421873a5f05e76a50e90892de75 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 4 Jul 2024 08:55:18 +0200 Subject: [PATCH 01/66] FIX wrong value for duration unit (#30261) --- htdocs/product/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 76d1863a4c6..5a74f5d2a82 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1544,7 +1544,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio print ''.$langs->trans("Duration").''; print img_picto('', 'clock', 'class="pictofixedwidth"'); print ''; - print $formproduct->selectMeasuringUnits("duration_unit", "time", (GETPOSTISSET('duration_value') ? GETPOST('duration_value', 'alpha') : 'h'), 0, 1); + print $formproduct->selectMeasuringUnits("duration_unit", "time", (GETPOSTISSET('duration_unit') ? GETPOST('duration_unit', 'alpha') : 'h'), 0, 1); // Mandatory period print '       '; From ac136ec1aeee17edf8ab5f02e567fabdbb320600 Mon Sep 17 00:00:00 2001 From: John BOTELLA Date: Thu, 4 Jul 2024 08:56:39 +0200 Subject: [PATCH 02/66] Fix inconsistant link element (#30258) --- htdocs/core/class/commonobject.class.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f8bbcd97511..6d49abf9902 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -8203,6 +8203,17 @@ abstract class CommonObject if (!empty($classpath)) { dol_include_once($InfoFieldList[1]); + + if ($classname && !class_exists($classname)) { + // from V19 of Dolibarr, In some cases link use element instead of class, example project_task + // TODO use newObjectByElement() introduce in V20 by PR #30036 for better errors management + $element_prop = getElementProperties($classname); + if ($element_prop) { + $classname = $element_prop['classname']; + } + } + + if ($classname && class_exists($classname)) { $object = new $classname($this->db); if ($object->element === 'product') { // Special case for product because default valut of fetch are wrong From e825898437abd3dce5c999a4ad92bba727a70b55 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jul 2024 20:46:29 +0200 Subject: [PATCH 03/66] Fix #30256 --- htdocs/accountancy/journal/bankjournal.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index a20724fbd84..95a4cd1f245 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -242,6 +242,7 @@ if ($result) { // one line tabpay = line into bank // one line for bank record = tabbq // one line for thirdparty record = tabtp + // Note: tabcompany is used to store the subledger account $i = 0; while ($i < $num) { $obj = $db->fetch_object($result); @@ -289,7 +290,8 @@ if ($result) { ); // Set accountancy code for user - // $obj->accountancy_code is the accountancy_code of table u=user but it is defined only if a link with type 'user' exists) + // $obj->accountancy_code is the accountancy_code of table u=user (but it is defined only if + // a link with type 'user' exists and user as a subledger account) $compta_user = (!empty($obj->accountancy_code) ? $obj->accountancy_code : ''); $tabuser[$obj->rowid] = array( @@ -408,13 +410,25 @@ if ($result) { $userstatic->lastname = $tabuser[$obj->rowid]['lastname']; $userstatic->status = $tabuser[$obj->rowid]['status']; $userstatic->accountancy_code = $tabuser[$obj->rowid]['accountancy_code']; + // For a payment of social contribution, we have a link sc + user. + // but we already fill the $tabpay[$obj->rowid]["soclib"] in the line 'sc'. + // If we fill it here to, we must concat if ($userstatic->id > 0) { - $tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, 'accountancy', 0); + if ($is_sc) { + $tabpay[$obj->rowid]["soclib"] .= ' '.$userstatic->getNomUrl(1, 'accountancy', 0); + } else { + $tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, 'accountancy', 0); + } } else { $tabpay[$obj->rowid]["soclib"] = '???'; // Should not happen, but happens with old data when id of user was not saved on expense report payment. } + if ($compta_user) { - $tabtp[$obj->rowid][$compta_user] += $amounttouse; + if ($is_sc) { + $tabcompany[$obj->rowid][$compta_user] += $amounttouse; + } else { + $tabtp[$obj->rowid][$compta_user] += $amounttouse; + } } } elseif ($links[$key]['type'] == 'sc') { $chargestatic->id = $links[$key]['url_id']; From 9cc1edb87648ce932fae5a49a30acc953c2e0ad6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Jul 2024 19:53:28 +0200 Subject: [PATCH 04/66] Debug v20 - fix warnings --- htdocs/admin/mails.php | 6 +++--- htdocs/core/lib/functions.lib.php | 9 +++++++-- htdocs/langs/en_US/admin.lang | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index ada3ba83cc4..25d6264bca6 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -683,9 +683,9 @@ if ($action == 'edit') { } print $text; - if (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail' && !getDolGlobalString('MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP')) { + if (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail' && getDolGlobalString('MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP')) { $textwarning = $langs->trans("WarningPHPMail").'
'.$langs->trans("WarningPHPMailA").'
'.$langs->trans("WarningPHPMailB").'
'.$langs->trans("WarningPHPMailC").'

'.$langs->trans("WarningPHPMailD"); - print $form->textwithpicto('', ''.$textwarning.'', 1, 'warning', 'nomargintop'); + print $form->textwithpicto('', ''.$textwarning.'', 1, 'help', 'nomargintop'); } print ''; @@ -830,7 +830,7 @@ if ($action == 'edit') { $messagetoshow = str_replace('{s1}', $linktosetvar1, $messagetoshow); $messagetoshow = str_replace('{s2}', $linktosetvar2, $messagetoshow); //print $messagetoshow; - print info_admin($messagetoshow, 0, 0, 'warning nomargintop'); + print info_admin($messagetoshow, 0, 0, 'warning', 'nomargintop', '', 'warning'); } print '
'; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 57b09750eb8..40f25fa3f59 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5737,9 +5737,10 @@ function img_searchclear($titlealt = 'default', $other = '') * @param string $admin '1'=Info for admin users. '0'=Info for standard users (change only the look), 'error', 'warning', 'xxx'=Other * @param string $morecss More CSS ('', 'warning', 'error') * @param string $textfordropdown Show a text to click to dropdown the info box. + * @param string $picto '' or 'warning' * @return string String with info text */ -function info_admin($text, $infoonimgalt = 0, $nodiv = 0, $admin = '1', $morecss = 'hideonsmartphone', $textfordropdown = '') +function info_admin($text, $infoonimgalt = 0, $nodiv = 0, $admin = '1', $morecss = 'hideonsmartphone', $textfordropdown = '', $picto = '') { global $conf, $langs; @@ -5751,7 +5752,11 @@ function info_admin($text, $infoonimgalt = 0, $nodiv = 0, $admin = '1', $morecss } $class = (empty($admin) ? 'undefined' : ($admin == '1' ? 'info' : $admin)); - $result = ($nodiv ? '' : '
').' '; + $fa = 'info-circle'; + if ($picto == 'warning') { + $fa = 'exclamation-triangle'; + } + $result = ($nodiv ? '' : '
').' '; $result .= dol_escape_htmltag($text, 1, 0, 'div,span,b,br,a'); $result .= ($nodiv ? '' : '
'); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index a6fec1dddf0..54f398cffa4 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -510,7 +510,7 @@ ModuleCompanyCodeCustomerDigitaria=%s followed by the truncated customer name by ModuleCompanyCodeSupplierDigitaria=%s followed by the truncated supplier name by the number of characters: %s for the supplier accounting code. Use3StepsApproval=By default, Purchase Orders need to be created and approved by 2 different users (one step/user to create and one step/user to approve. Note that if user has both permission to create and approve, one step/user will be enough). You can ask with this option to introduce a third step/user approval, if amount is higher than a dedicated value (so 3 steps will be necessary: 1=validation, 2=first approval and 3=second approval if amount is enough).
Set this to empty if one approval (2 steps) is enough, set it to a very low value (0.1) if a second approval (3 steps) is always required. UseDoubleApproval=Use a 3 steps approval when amount (without tax) is higher than... -WarningPHPMail=WARNING: The setup to send emails from the application is using the default generic setup. It is often better to setup outgoing emails to use the email server of your Email Service Provider instead of the default setup for several reasons: +WarningPHPMail=WARNING: The setup to send emails from the application is using the default generic setup. This choice needs no technical knowledge to complete the setup.
However, it is often better to setup outgoing emails to use the email server of your Email Service Provider instead of the default setup for several reasons: WarningPHPMailA=- Using the server of the Email Service Provider increases the trustworthiness of your email, so it increases the deliverability without being flagged as SPAM WarningPHPMailB=- Some Email Service Providers (like Yahoo) do not allow you to send an email from another server than their own server. Your current setup uses the server of the application to send email and not the server of your email provider, so some recipients (the one compatible with the restrictive DMARC protocol), will ask your email provider if they can accept your email and some email providers (like Yahoo) may respond "no" because the server is not theirs, so few of your sent Emails may not be accepted for delivery (be careful also of your email provider's sending quota). WarningPHPMailC=- Using the SMTP server of your own Email Service Provider to send emails is also interesting so all emails sent from application will also be saved into your "Sent" directory of your mailbox. From 952c894f0a37f2998fab7085257cd3f5da746c89 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Jul 2024 00:42:46 +0200 Subject: [PATCH 05/66] Debug v20 --- htdocs/compta/charges/index.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 047f90e543f..4c3bd3c0cb0 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -108,7 +108,7 @@ if ($sortorder) { $param .= '&sortorder='.$sortorder; } -$totalnboflines = 0; +$totalnboflines = ''; $num = 0; print '
'; @@ -123,6 +123,7 @@ print ''; print ''; $nav = ($year ? ''.img_previous($langs->trans("Previous"), 'class="valignbottom"')." ".$langs->trans("Year").' '.$year.' '.img_next($langs->trans("Next"), 'class="valignbottom"')."" : ""); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'object_payment', 0, $nav, '', $limit, 1); if ($year) { @@ -138,7 +139,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { print ''; print ''; - print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "cs.date_ech", "", $param, '', $sortfield, $sortorder, 'nowraponall '); + print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "cs.date_ech", "", $param, 'width="120"', $sortfield, $sortorder, 'nowraponall '); print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "c.libelle", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "cs.fk_type", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("ExpectedToPay", $_SERVER["PHP_SELF"], "cs.amount", "", $param, 'class="right"', $sortfield, $sortorder); @@ -309,7 +310,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { print '
'; print ''; - print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "pv.datev", "", $param, '', $sortfield, $sortorder, 'nowraponall '); + print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "pv.datev", "", $param, 'width="120"', $sortfield, $sortorder, 'nowraponall '); print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "pv.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("ExpectedToPay", $_SERVER["PHP_SELF"], "pv.amount", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "ptva.rowid", "", $param, '', $sortfield, $sortorder); @@ -378,6 +379,8 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { $i++; } + + print ''; print ''; @@ -481,7 +484,7 @@ while ($j < $numlt) { $i++; } - print ''; + print ''; print '"; print ''; print ''; From 4733007a4ffc98548d8144dd2ef8c6caf0e4d5e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Jul 2024 00:49:15 +0200 Subject: [PATCH 06/66] Debug v20 --- htdocs/compta/charges/index.php | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 4c3bd3c0cb0..20d889c3faf 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -145,7 +145,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { print_liste_field_titre("ExpectedToPay", $_SERVER["PHP_SELF"], "cs.amount", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "pc.rowid", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pc.datep", "", $param, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); if (isModEnabled("bank")) { print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); } @@ -206,7 +206,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { print $socialcontrib->getNomUrl(1, '20'); print ''; // Type - print ''; + print ''; // Expected to pay print ''; // Ref payment @@ -215,12 +215,17 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { print '\n"; // Date payment print ''; - // Type payment - print ''; + $s .= $obj->num_payment; + print '\n"; - // Type payment - print ''; + $s .= $obj->num_payment; + print ''; // Account if (isModEnabled("bank")) { From 5d0e88fcd1f293c97565c996be63b90f158f9cac Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Jul 2024 00:53:26 +0200 Subject: [PATCH 07/66] Debug v20 --- htdocs/compta/charges/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 20d889c3faf..f95a61b2ed2 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -222,7 +222,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { $s .= $langs->trans("PaymentTypeShort".$obj->payment_code).' '; } $s .= $obj->num_payment; - print ''; From fa50b709850840e4cb3d0c1efbb4235a7f7fbff7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Jul 2024 01:15:28 +0200 Subject: [PATCH 08/66] Debug v20 --- htdocs/compta/charges/index.php | 70 ++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 32 deletions(-) diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index f95a61b2ed2..13a8ac021d1 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -134,24 +134,6 @@ print ''.$langs->trans("DescTaxAndDividendsArea").'< print "
"; if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { - // Social contributions only - print load_fiche_titre($langs->trans("SocialContributions").($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), '', ''); - - print '
'.$langs->trans("Total").'
'.$langs->trans("Total").'
'.$langs->trans("Total").''.price($total)."  '.$obj->label.''.$obj->label.''.price($obj->total).''.$payment_sc_static->getNomUrl(1)."'.dol_print_date($db->jdate($obj->datep), 'day').''; + + // Payment mode + $s = ''; if ($obj->payment_code) { - print $langs->trans("PaymentTypeShort".$obj->payment_code).' '; + $s .= $langs->trans("PaymentTypeShort".$obj->payment_code).' '; } - print $obj->num_payment.''; @@ -315,7 +320,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { print_liste_field_titre("ExpectedToPay", $_SERVER["PHP_SELF"], "pv.amount", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "ptva.rowid", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "ptva.datep", "", $param, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); if (isModEnabled("bank")) { print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); } @@ -347,12 +352,15 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { // Date print ''.dol_print_date($db->jdate($obj->date_payment), 'day')."'; + // Payment mode + $s = ''; if ($obj->payment_code) { - print $langs->trans("PaymentTypeShort".$obj->payment_code).' '; + $s .= $langs->trans("PaymentTypeShort".$obj->payment_code).' '; } - print $obj->num_payment.''; + print $s; + print ''; print $s; print '
'; - print ''; - print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "cs.date_ech", "", $param, 'width="120"', $sortfield, $sortorder, 'nowraponall '); - print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "c.libelle", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "cs.fk_type", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("ExpectedToPay", $_SERVER["PHP_SELF"], "cs.amount", "", $param, 'class="right"', $sortfield, $sortorder); - print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "pc.rowid", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pc.datep", "", $param, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); - if (isModEnabled("bank")) { - print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); - } - print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "pc.amount", "", $param, 'class="right"', $sortfield, $sortorder); - print "\n"; - $sql = "SELECT c.id, c.libelle as label,"; $sql .= " cs.rowid, cs.libelle, cs.fk_type as type, cs.periode as period, cs.date_ech, cs.amount as total,"; $sql .= " pc.rowid as pid, pc.datep, pc.amount as totalpaid, pc.num_paiement as num_payment, pc.fk_bank,"; @@ -184,11 +166,33 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { if ($resql) { $num = $db->num_rows($resql); + // Social contributions only + //print_barre_liste($langs->trans("SocialContributions").($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $num, '', 0, $nav, '', $limit, 1); + print load_fiche_titre($langs->trans("SocialContributions").($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), '', ''); + + print '
'; + print ''; + print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "cs.date_ech", "", $param, 'width="120"', $sortfield, $sortorder, 'nowraponall '); + print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "c.libelle", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "cs.fk_type", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("ExpectedToPay", $_SERVER["PHP_SELF"], "cs.amount", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "pc.rowid", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pc.datep", "", $param, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); + if (isModEnabled("bank")) { + print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); + } + print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "pc.amount", "", $param, 'class="right"', $sortfield, $sortorder); + print "\n"; + + $total = 0; $totalpaid = 0; $i = 0; - while ($i < min($num, $limit)) { + //$imaxinloop = ($limit ? min($num, $limit) : $num); + $imaxinloop = $num; // We want to show all (we can't use navigation when there is 2 tables shown) + while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); print ''; @@ -281,12 +285,6 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { // VAT if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { - print "
"; - - $tva = new Tva($db); - - print load_fiche_titre($langs->trans("VATDeclarations").($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), '', ''); - $sql = "SELECT ptva.rowid, pv.rowid as id_tva, pv.amount as amount_tva, ptva.amount, pv.label, pv.datev as dm, ptva.datep as date_payment, ptva.fk_bank, ptva.num_paiement as num_payment,"; $sql .= " pct.code as payment_code,"; $sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel"; @@ -313,27 +311,35 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { $total = 0; $totaltopay = 0; + print "
"; + + $labeltax = $langs->transcountry("VAT", $mysoc->country_code); + + print load_fiche_titre($labeltax.($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), '', ''); + print '
'; print ''; print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "pv.datev", "", $param, 'width="120"', $sortfield, $sortorder, 'nowraponall '); print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "pv.label", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("ExpectedToPay", $_SERVER["PHP_SELF"], "pv.amount", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("ExpectedToPay", $_SERVER["PHP_SELF"], "pv.amount", "", $param, '', $sortfield, $sortorder, 'right '); print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "ptva.rowid", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "ptva.datep", "", $param, 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "ptva.datep", "", $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); if (isModEnabled("bank")) { print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); } - print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "ptva.amount", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "ptva.amount", "", $param, '', $sortfield, $sortorder, 'right '); print "\n"; - while ($i < $num) { + //$imaxinloop = ($limit ? min($num, $limit) : $num); + $imaxinloop = $num; // We want to show all (we can't use navigation when there is 2 tables shown) + + while ($i < $imaxinloop) { $obj = $db->fetch_object($result); $totaltopay = $totaltopay + $obj->amount_tva; $total = $total + $obj->amount; - print ''; print ''."\n"; @@ -435,9 +441,9 @@ if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") { while ($j < $numlt) { print "
"; - $tva = new Tva($db); + $labeltax = $langs->transcountry(($j == 1 ? "LT1" : "LT2"), $mysoc->country_code); - print load_fiche_titre($langs->transcountry(($j == 1 ? "LT1Payments" : "LT2Payments"), $mysoc->country_code).($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), '', ''); + print load_fiche_titre($labeltax.($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), '', ''); $sql = "SELECT pv.rowid, pv.amount, pv.label, pv.datev as dm, pv.datep as dp"; From 6e58d544750680fdd590317e854b709abf29d14d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 6 Jul 2024 02:57:22 +0200 Subject: [PATCH 09/66] NEW Project - Can upload a file with drag and drop (#30276) * NEW Product/Service - Can upload a file with drag and drop * NEW Project - Can upload a file with drag and drop --- htdocs/projet/card.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 3187f0095d7..ced98e6e122 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -4,8 +4,9 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2023 Charlene Benke * Copyright (C) 2023 Christian Foellmann - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 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 @@ -1298,7 +1299,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) { print '
'.dol_print_date($db->jdate($obj->dm), 'day').'
'; } else { - print dol_get_fiche_head($head, 'project', $langs->trans("Project"), -1, ($object->public ? 'projectpub' : 'project')); + print dol_get_fiche_head($head, 'project', $langs->trans("Project"), -1, ($object->public ? 'projectpub' : 'project'), 0, '', '', 0, '', 1); // Project card From ea416aac937490cf145a02716e4c268992f95f5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 6 Jul 2024 02:59:40 +0200 Subject: [PATCH 10/66] replace old syntax, rename pdf models with same class name (#30271) * replace old syntax * replace old syntax * replace old syntax * replace old syntax * rename files with same class name * rename files with same class name * rename files with same class name * rename files with same class name * rename files with same class name * rename files with same class name * rename files with same class name * rename files with same class name * rename files with same class name * rename files with same class name * rename files with same class name * fix class with same name * fix class with same name * clean code --- dev/tools/phan/baseline.txt | 16 ++++++------ htdocs/admin/accountant.php | 25 +++++++++--------- .../action/doc/pdf_standard_actions.class.php | 3 ++- .../asset/doc/pdf_standard_asset.modules.php | 2 +- .../core/modules/bank/doc/pdf_ban.modules.php | 3 ++- .../modules/cheque/doc/pdf_blochet.class.php | 2 +- .../delivery/doc/pdf_storm.modules.php | 2 +- .../delivery/doc/pdf_typhon.modules.php | 3 ++- .../expedition/doc/pdf_espadon.modules.php | 2 +- .../expedition/doc/pdf_merou.modules.php | 3 ++- .../expedition/doc/pdf_rouget.modules.php | 2 +- ...=> pdf_standard_expensereport.modules.php} | 8 +++--- .../modules/facture/doc/pdf_crabe.modules.php | 2 +- .../facture/doc/pdf_sponge.modules.php | 2 +- .../fichinter/doc/pdf_soleil.modules.php | 2 +- ...hp => pdf_standard_evaluation.modules.php} | 8 +++--- ...lass.php => pdf_standard_member.class.php} | 16 ++++++------ .../core/modules/modExpenseReport.class.php | 11 ++++---- htdocs/core/modules/modStock.class.php | 5 ++-- ...=> pdf_standard_movementstock.modules.php} | 26 +++++++++---------- .../modules/mrp/doc/pdf_vinci.modules.php | 2 +- .../product/doc/pdf_standard.modules.php | 5 ++-- .../project/doc/pdf_baleine.modules.php | 3 ++- .../project/doc/pdf_beluga.modules.php | 3 ++- .../project/doc/pdf_timespent.modules.php | 3 ++- .../modules/propale/doc/pdf_azur.modules.php | 2 +- .../modules/propale/doc/pdf_cyan.modules.php | 2 +- .../reception/doc/pdf_squille.modules.php | 2 +- ...les.php => pdf_standard_stock.modules.php} | 4 +-- .../stocktransfer/doc/pdf_eagle.modules.php | 2 +- .../doc/pdf_eagle_proforma.modules.php | 2 +- .../doc/pdf_canelle.modules.php | 4 +-- .../supplier_order/doc/pdf_cornas.modules.php | 2 +- .../doc/pdf_muscadet.modules.php | 2 +- ... pdf_standard_supplierpayment.modules.php} | 15 ++++++----- .../doc/pdf_aurore.modules.php | 2 +- .../doc/pdf_zenith.modules.php | 2 +- .../install/mysql/migration/20.0.0-21.0.0.sql | 13 ++++++++++ ...tandard_recruitmentjobposition.modules.php | 2 +- 39 files changed, 120 insertions(+), 95 deletions(-) rename htdocs/core/modules/expensereport/doc/{pdf_standard.modules.php => pdf_standard_expensereport.modules.php} (99%) rename htdocs/core/modules/hrm/doc/{pdf_standard.modules.php => pdf_standard_evaluation.modules.php} (98%) rename htdocs/core/modules/member/doc/{pdf_standard.class.php => pdf_standard_member.class.php} (97%) rename htdocs/core/modules/movement/doc/{pdf_standard.modules.php => pdf_standard_movementstock.modules.php} (98%) rename htdocs/core/modules/stock/doc/{pdf_standard.modules.php => pdf_standard_stock.modules.php} (99%) rename htdocs/core/modules/supplier_payment/doc/{pdf_standard.modules.php => pdf_standard_supplierpayment.modules.php} (97%) diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index ef24e13faff..1f83048b7b5 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -47,7 +47,7 @@ return [ // PhanPluginConstantVariableNull : 10+ occurrences // PhanPluginDuplicateExpressionBinaryOp : 10+ occurrences // PhanPluginSuspiciousParamPosition : 10+ occurrences - // PhanRedefineClass : 10+ occurrences + // PhanRedefineClass : 3 occurrences // PhanTypeMismatchDimFetchNullable : 10+ occurrences // PhanEmptyFQSENInClasslike : 5 occurrences // PhanInvalidFQSENInClasslike : 4 occurrences @@ -704,7 +704,7 @@ return [ 'htdocs/core/modules/expedition/doc/pdf_rouget.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/core/modules/expedition/mod_expedition_ribera.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/expedition/modules_expedition.php' => ['PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/core/modules/expensereport/doc/pdf_standard.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUnknownPropertyType', 'PhanRedefineClass', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUnknownPropertyType', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/core/modules/expensereport/mod_expensereport_sand.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/expensereport/modules_expensereport.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/export/export_csviso.modules.php' => ['PhanPluginUnknownArrayMethodParamType'], @@ -724,7 +724,7 @@ return [ 'htdocs/core/modules/fichinter/modules_fichinter.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall'], 'htdocs/core/modules/holiday/mod_holiday_immaculate.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/holiday/modules_holiday.php' => ['PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/core/modules/hrm/doc/pdf_standard.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUnknownPropertyType', 'PhanRedefineClass', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUnknownPropertyType', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/core/modules/hrm/mod_evaluation_advanced.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/core/modules/hrm/modules_evaluation.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/import/import_csv.modules.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty'], @@ -740,11 +740,11 @@ return [ 'htdocs/core/modules/mailings/xinputfile.modules.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/mailings/xinputuser.modules.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/member/doc/doc_generic_member_odt.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeSuspiciousNonTraversableForeach'], - 'htdocs/core/modules/member/doc/pdf_standard.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanRedefineClass'], + 'htdocs/core/modules/member/doc/pdf_standard_member.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/core/modules/member/modules_cards.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall'], 'htdocs/core/modules/member/modules_member.class.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/modFacture.class.php' => ['PhanPluginDuplicateExpressionAssignmentOperation'], - 'htdocs/core/modules/movement/doc/pdf_standard.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginEmptyStatementIf', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanRedefineClass', 'PhanUndeclaredMethod'], + 'htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginEmptyStatementIf', 'PhanPluginUnknownObjectMethodCall', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanUndeclaredMethod'], 'htdocs/core/modules/movement/modules_movement.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/core/modules/mrp/mod_mo_advanced.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], @@ -761,7 +761,7 @@ return [ 'htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php' => ['PhanPluginUnknownArrayMethodParamType'], 'htdocs/core/modules/printsheet/modules_labels.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall'], - 'htdocs/core/modules/product/doc/pdf_standard.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanRedefineClass', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'], + 'htdocs/core/modules/product/doc/pdf_standard.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'], 'htdocs/core/modules/product/modules_product.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/product_batch/mod_lot_advanced.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/product_batch/mod_lot_free.php' => ['PhanTypeMismatchArgumentProbablyReal'], @@ -788,7 +788,7 @@ return [ 'htdocs/core/modules/societe/mod_codecompta_aquarium.php' => ['PhanPluginUnknownPropertyType'], 'htdocs/core/modules/societe/mod_codecompta_digitaria.php' => ['PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanTypeMismatchArgumentNullableInternal'], 'htdocs/core/modules/societe/modules_societe.class.php' => ['PhanPluginUnknownArrayMethodReturnType'], - 'htdocs/core/modules/stock/doc/pdf_standard.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanRedefineClass', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'], + 'htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUnknownPropertyType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'], 'htdocs/core/modules/stock/modules_stock.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], 'htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanUndeclaredMethod'], @@ -804,7 +804,7 @@ return [ 'htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php' => ['PhanPossiblyUndeclaredVariable'], 'htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/supplier_order/modules_commandefournisseur.php' => ['PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownPropertyType'], - 'htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanRedefineClass', 'PhanUndeclaredMethod'], + 'htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php' => ['PhanPluginUnknownPropertyType', 'PhanUndeclaredMethod'], 'htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/core/modules/supplier_payment/modules_supplier_payment.php' => ['PhanPluginUnknownArrayMethodReturnType'], 'htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php' => ['PhanPluginConstantVariableBool', 'PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty'], diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index 9023ed207ab..61e3d483237 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * 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 @@ -121,24 +122,24 @@ print ''.$langs-> // Name of Accountant Company print ''; -print ''."\n"; +print ''."\n"; // Address print ''; -print ''."\n"; +print ''."\n"; // ZIP print ''; -print ''."\n"; +print ''."\n"; // Town/City print ''; -print ''."\n"; +print ''."\n"; // Country print ''; print img_picto('', 'globe-americas', 'class="pictofixedwidth"'); -print $form->select_country((GETPOSTISSET('country_id') ? GETPOSTINT('country_id') : (getDolGlobalString('MAIN_INFO_ACCOUNTANT_COUNTRY') ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'country_id'); +print $form->select_country((GETPOSTISSET('country_id') ? GETPOSTINT('country_id') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_COUNTRY')), 'country_id'); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } @@ -147,40 +148,40 @@ print ''."\n"; // State print ''; print img_picto('', 'state', 'class="pictofixedwidth"'); -print $formcompany->select_state((GETPOSTISSET('state_id') ? GETPOSTINT('state_id') : (getDolGlobalString('MAIN_INFO_ACCOUNTANT_STATE') ? $conf->global->MAIN_INFO_ACCOUNTANT_STATE : '')), (GETPOSTISSET('country_id') ? GETPOSTINT('country_id') : (getDolGlobalString('MAIN_INFO_ACCOUNTANT_COUNTRY') ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'state_id'); +print $formcompany->select_state((GETPOSTISSET('state_id') ? GETPOSTINT('state_id') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_STATE')), (GETPOSTISSET('country_id') ? GETPOSTINT('country_id') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_COUNTRY')), 'state_id'); print ''."\n"; // Telephone print ''; print img_picto('', 'object_phoning', '', false, 0, 0, '', 'pictofixedwidth'); -print ''; +print ''; print ''."\n"; // Fax print ''; print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'pictofixedwidth'); -print ''; +print ''; print ''."\n"; // eMail print ''; print img_picto('', 'object_email', '', false, 0, 0, '', 'pictofixedwidth'); -print ''; +print ''; print ''."\n"; // Web print ''; print img_picto('', 'globe', '', false, 0, 0, '', 'pictofixedwidth'); -print ''; +print ''; print ''."\n"; // Code print ''; -print ''."\n"; +print ''."\n"; // Note print ''; -print ''; +print ''; print ''; print ''; diff --git a/htdocs/core/modules/action/doc/pdf_standard_actions.class.php b/htdocs/core/modules/action/doc/pdf_standard_actions.class.php index bfd1c0b5bc8..1d2c32ca617 100644 --- a/htdocs/core/modules/action/doc/pdf_standard_actions.class.php +++ b/htdocs/core/modules/action/doc/pdf_standard_actions.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -166,7 +167,7 @@ class pdf_standard_actions $pdf = pdf_getInstance($this->format); $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $pdf->SetAutoPageBreak(1, 0); diff --git a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php index faedd65d993..90d2d60131f 100644 --- a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php +++ b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php @@ -220,7 +220,7 @@ class pdf_standard_asset extends ModelePDFAsset $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 50; // Height reserved to output the info and total part and payment part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin) if (class_exists('TCPDF')) { diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index 7f8ae3c09b5..daacb9aba68 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -154,7 +155,7 @@ class pdf_ban extends ModeleBankAccountDoc $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index babd72f3d68..684f52faa22 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -165,7 +165,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts // Create PDF instance $pdf = pdf_getInstance($this->format); $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php index 018e97f75ac..ec0fa3a38d1 100644 --- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php @@ -230,7 +230,7 @@ class pdf_storm extends ModelePDFDeliveryOrder $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 30; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php index 1c4b158bbd4..5c2321a6c87 100644 --- a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php @@ -6,6 +6,7 @@ * Copyright (C) 2011-2021 Philippe Grand * Copyright (C) 2015 Marcos García * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * 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 @@ -197,7 +198,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 30; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 17051e0c90e..b54e13710a9 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -241,7 +241,7 @@ class pdf_espadon extends ModelePdfExpedition $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); $heightforinfotot = 8; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index 53308cf110f..533847c31e2 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -5,6 +5,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2015 Marcos García * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -195,7 +196,7 @@ class pdf_merou extends ModelePdfExpedition $pdf = pdf_getInstance($this->format, 'mm', 'l'); $default_font_size = pdf_getPDFFontSize($outputlangs); $heightforinfotot = 0; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 20a809ea36a..c52e34f8590 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -274,7 +274,7 @@ class pdf_rouget extends ModelePdfExpedition $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); $heightforinfotot = 8; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php similarity index 99% rename from htdocs/core/modules/expensereport/doc/pdf_standard.modules.php rename to htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php index 16fc1284e34..14383a66e85 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php @@ -2,7 +2,7 @@ /* Copyright (C) 2015 Laurent Destailleur * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016-2023 Philippe Grand - * Copyright (C) 2018-2020 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2018 Francis Appels * Copyright (C) 2019 Markus Welters * Copyright (C) 2019 Rafael Ingenleuf @@ -25,7 +25,7 @@ */ /** - * \file htdocs/core/modules/expensereport/doc/pdf_standard.modules.php + * \file htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php * \ingroup expensereport * \brief File of class to generate expense report from standard model */ @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/userbankaccount.class.php'; /** * Class to generate expense report based on standard model */ -class pdf_standard extends ModeleExpenseReport +class pdf_standard_expensereport extends ModeleExpenseReport { /** * @var DoliDB Database handler @@ -236,7 +236,7 @@ class pdf_standard extends ModeleExpenseReport $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 40; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 12; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 5fb82673a45..8e721a632c8 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -303,7 +303,7 @@ class pdf_crabe extends ModelePDFFactures if ($heightforinfotot > 220) { $heightforinfotot = 220; } - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 0d7c33c3536..0dec7f20b65 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -333,7 +333,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetAutoPageBreak(1, 0); $this->heightforinfotot = 50 + (4 * $nbpayments); // Height reserved to output the info and total part and payment part - $this->heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $this->heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $this->heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin) $heightforqrinvoice = $heightforqrinvoice_firstpage = 0; diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index eb08a138e20..5a0c89480ba 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -187,7 +187,7 @@ class pdf_soleil extends ModelePDFFicheinter $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/hrm/doc/pdf_standard.modules.php b/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php similarity index 98% rename from htdocs/core/modules/hrm/doc/pdf_standard.modules.php rename to htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php index 0fd40330124..f581c42901a 100644 --- a/htdocs/core/modules/hrm/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php @@ -2,7 +2,7 @@ /* Copyright (C) 2015 Laurent Destailleur * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016-2023 Philippe Grand - * Copyright (C) 2018-2020 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2018 Francis Appels * Copyright (C) 2019 Markus Welters * Copyright (C) 2019 Rafael Ingenleuf @@ -25,7 +25,7 @@ */ /** - * \file htdocs/core/modules/hrm/doc/pdf_standard.modules.php + * \file htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php * \ingroup hrm * \brief File of class to generate evaluation report from standard model */ @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; /** * Class to generate Evaluation Pdf based on standard model */ -class pdf_standard extends ModelePDFEvaluation +class pdf_standard_evaluation extends ModelePDFEvaluation { /** * @var DoliDB Database handler @@ -196,7 +196,7 @@ class pdf_standard extends ModelePDFEvaluation $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 0; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 12; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard_member.class.php similarity index 97% rename from htdocs/core/modules/member/doc/pdf_standard.class.php rename to htdocs/core/modules/member/doc/pdf_standard_member.class.php index b8b8acbbec1..7e9f438443f 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard_member.class.php @@ -1,10 +1,10 @@ - * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2006-2013 Laurent Destailleur - * Copyright (C) 2015 Francis Appels +/* Copyright (C) 2003 Steve Dillon + * Copyright (C) 2003 Laurent Passebecq + * Copyright (C) 2001-2003 Rodolphe Quiedeville + * Copyright (C) 2002-2003 Jean-Louis Bergamo + * Copyright (C) 2006-2013 Laurent Destailleur + * Copyright (C) 2015 Francis Appels * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -22,7 +22,7 @@ */ /** - * \file htdocs/core/modules/member/doc/pdf_standard.class.php + * \file htdocs/core/modules/member/doc/pdf_standard_member.class.php * \ingroup member * \brief File of class to generate PDF document of labels */ @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonstickergenerator.class.php'; /** * Class to generate stick sheet with format Avery or other personalised */ -class pdf_standard extends CommonStickerGenerator +class pdf_standard_member extends CommonStickerGenerator { /** * Dolibarr version of the loaded document diff --git a/htdocs/core/modules/modExpenseReport.class.php b/htdocs/core/modules/modExpenseReport.class.php index c2843fffcb7..9d60b72c6dd 100644 --- a/htdocs/core/modules/modExpenseReport.class.php +++ b/htdocs/core/modules/modExpenseReport.class.php @@ -1,8 +1,9 @@ - * Copyright (C) 2015 Laurent Destailleur - * Copyright (C) 2023 Alexandre Spangaro +/* Copyright (C) 2011 Dimitri Mouillard + * Copyright (C) 2015 Laurent Destailleur + * Copyright (C) 2023 Alexandre Spangaro * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -261,8 +262,8 @@ class modExpenseReport extends DolibarrModules $this->remove($options); $sql = array( - "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = 'standard' AND type='expensereport' AND entity = ".((int) $conf->entity), - "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('standard','expensereport',".((int) $conf->entity).")" + "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = 'standard_expensereport' AND type='expensereport' AND entity = ".((int) $conf->entity), + "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('standard_expensereport','expensereport',".((int) $conf->entity).")" ); return $this->_init($sql, $options); diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index ad391a1ec92..de499e51e5c 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2021 Ferran Marcet * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -82,14 +83,14 @@ class modStock extends DolibarrModules $r++; $this->const[$r][0] = "STOCK_ADDON_PDF"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "standard"; + $this->const[$r][2] = "standard_stock"; $this->const[$r][3] = 'Name of PDF model of stock'; $this->const[$r][4] = 0; $r++; $this->const[$r][0] = "MOUVEMENT_ADDON_PDF"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "stdmovement"; + $this->const[$r][2] = "standard_movement_stock"; $this->const[$r][3] = 'Name of PDF model of stock movement'; $this->const[$r][4] = 0; diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php similarity index 98% rename from htdocs/core/modules/movement/doc/pdf_standard.modules.php rename to htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php index 319f8f39c3d..3324865d54c 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2024 MDW * Copyright (C) 2024 Frédéric France * @@ -19,7 +19,7 @@ */ /** - * \file htdocs/core/modules/movement/doc/pdf_standard.modules.php + * \file htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php * \ingroup societe * \brief File of class to build PDF documents for stocks movements */ @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; /** * Class to build documents using ODF templates generator */ -class pdf_standard extends ModelePDFMovement +class pdf_standard_movementstock extends ModelePDFMovement { /** * @var int Save the name of generated file as the main doc when generating a doc with this template @@ -386,7 +386,7 @@ class pdf_standard extends ModelePDFMovement $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 40; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (class_exists('TCPDF')) { @@ -904,7 +904,7 @@ class pdf_standard extends ModelePDFMovement * Show top header of page. * * @param TCPDF $pdf Object PDF - * @param Object $object Object to show + * @param MouvementStock|Entrepot $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output * @param string $titlekey Translation key to show as title of document @@ -919,17 +919,17 @@ class pdf_standard extends ModelePDFMovement $default_font_size = pdf_getPDFFontSize($outputlangs); - if ($object->type == 1) { - $titlekey = 'ServiceSheet'; - } else { - $titlekey = 'StockSheet'; - } + // if ($object->type == 1) { + // $titlekey = 'ServiceSheet'; + // } else { + // $titlekey = 'StockSheet'; + // } pdf_pagehead($pdf, $outputlangs, $this->page_hauteur); // Show Draft Watermark - if ($object->statut == 0 && getDolGlobalString('COMMANDE_DRAFT_WATERMARK')) { - pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', getDolGlobalString('COMMANDE_DRAFT_WATERMARK')); + if ($object->status == 0 && getDolGlobalString('WAREHOUSE_DRAFT_WATERMARK')) { + pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', getDolGlobalString('WAREHOUSE_DRAFT_WATERMARK')); } $pdf->SetTextColor(0, 0, 60); @@ -1127,7 +1127,7 @@ class pdf_standard extends ModelePDFMovement * Show footer of page. Need this->emetteur object * * @param TCPDF $pdf PDF - * @param Object $object Object to show + * @param MouvementStock|Entrepot $object Object to show * @param Translate $outputlangs Object lang for output * @param int $hidefreetext 1=Hide free text * @return int Return height of bottom margin including footer text diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php index 50bd5549d38..faa364523c0 100644 --- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php +++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php @@ -210,7 +210,7 @@ class pdf_vinci extends ModelePDFMo $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index 828688b2743..eacccaf96f7 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2023 Anthony Berton * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -177,7 +178,7 @@ class pdf_standard extends ModelePDFProduct $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 40; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; @@ -731,7 +732,7 @@ class pdf_standard extends ModelePDFProduct pdf_pagehead($pdf, $outputlangs, $this->page_hauteur); // Show Draft Watermark - if ($object->statut == 0 && getDolGlobalString('PRODUCT_DRAFT_WATERMARK')) { + if ($object->status == 0 && getDolGlobalString('PRODUCT_DRAFT_WATERMARK')) { pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', getDolGlobalString('COMMANDE_DRAFT_WATERMARK')); } diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index 3f26a05791c..797d643523f 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -2,6 +2,7 @@ /* Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2018 Laurent Destailleur * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -194,7 +195,7 @@ class pdf_baleine extends ModelePDFProjects $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 40; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 98b86f94000..e17ac35914f 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -3,6 +3,7 @@ * Copyright (C) 2015-2018 Charlene Benke * Copyright (C) 2018 Laurent Destailleur * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -225,7 +226,7 @@ class pdf_beluga extends ModelePDFProjects $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 40; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index e806a681de0..9422abeacd5 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * 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 @@ -189,7 +190,7 @@ class pdf_timespent extends ModelePDFProjects $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 40; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 66a4ae61fcb..cf2677a3cd8 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -366,7 +366,7 @@ class pdf_azur extends ModelePDFPropales $heightforinfotot = 40; // Height reserved to output the info and total part $heightforsignature = !getDolGlobalString('PROPAL_DISABLE_SIGNATURE') ? (pdfGetHeightForHtmlContent($pdf, $outputlangs->transnoentities("ProposalCustomerSignature")) + 10) : 0; - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index c0d886f2aa5..6eae41e821c 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -340,7 +340,7 @@ class pdf_cyan extends ModelePDFPropales $heightforinfotot = 40; // Height reserved to output the info and total part $heightforsignature = !getDolGlobalString('PROPAL_DISABLE_SIGNATURE') ? (pdfGetHeightForHtmlContent($pdf, $outputlangs->transnoentities("ProposalCustomerSignature")) + 10) : 0; - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin) //print $heightforinfotot + $heightforsignature + $heightforfreetext + $heightforfooter;exit; diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index f59c84f19c3..85c043e996b 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -245,7 +245,7 @@ class pdf_squille extends ModelePdfReception $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); $heightforinfotot = 8; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $pdf->SetAutoPageBreak(1, 0); diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php similarity index 99% rename from htdocs/core/modules/stock/doc/pdf_standard.modules.php rename to htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php index 7fac3e5ea6f..e54427d429a 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; /** * Class to build documents using ODF templates generator */ -class pdf_standard extends ModelePDFStock +class pdf_standard_stock extends ModelePDFStock { public $wref; public $posxdesc; @@ -188,7 +188,7 @@ class pdf_standard extends ModelePDFStock $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 40; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php index e06b579cbf3..d9e12ac3085 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php @@ -298,7 +298,7 @@ class pdf_eagle extends ModelePDFStockTransfer $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); $heightforinfotot = 8; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php index 070bb27d5f4..20c4a8e6cef 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -267,7 +267,7 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 40; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin) if (class_exists('TCPDF')) { diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index 526490336d9..5fde92b440e 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -2,7 +2,7 @@ /* Copyright (C) 2010-2011 Juanjo Menent * Copyright (C) 2010-2014 Laurent Destailleur * Copyright (C) 2015 Marcos García - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -238,7 +238,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices if ($heightforinfotot > 220) { $heightforinfotot = 220; } - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index d6247a50d43..56e90160a75 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -265,7 +265,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index 49c81f064ea..be8be8a2603 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -276,7 +276,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php similarity index 97% rename from htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php rename to htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php index b1b6e28514f..4cfd1a03d79 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php @@ -1,8 +1,9 @@ - * Copyright (C) 2010-2014 Laurent Destailleur - * Copyright (C) 2015 Marcos García - * Copyright (C) 2022 Ferran Marcet +/* Copyright (C) 2010-2011 Juanjo Menent + * Copyright (C) 2010-2014 Laurent Destailleur + * Copyright (C) 2015 Marcos García + * Copyright (C) 2022 Ferran Marcet + * Copyright (C) 2024 Frédéric France * * 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 @@ -20,7 +21,7 @@ */ /** - * \file htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php + * \file htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php * \ingroup fournisseur * \brief Class file to generate the supplier invoice payment file with the standard model */ @@ -37,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functionsnumtoword.lib.php'; /** * Class to generate the supplier invoices payment file with the standard model */ -class pdf_standard extends ModelePDFSuppliersPayments +class pdf_standard_supplierpayment extends ModelePDFSuppliersPayments { /** * @var DoliDB Database handler @@ -232,7 +233,7 @@ class pdf_standard extends ModelePDFSuppliersPayments $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index ebb32a3949f..3146afe8889 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -267,7 +267,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php index 13a6948fb1a..c8180c69623 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php @@ -264,7 +264,7 @@ class pdf_zenith extends ModelePDFSupplierProposal $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 50; // Height reserved to output the info and total part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; diff --git a/htdocs/install/mysql/migration/20.0.0-21.0.0.sql b/htdocs/install/mysql/migration/20.0.0-21.0.0.sql index 80425a58b73..07338c65ac9 100644 --- a/htdocs/install/mysql/migration/20.0.0-21.0.0.sql +++ b/htdocs/install/mysql/migration/20.0.0-21.0.0.sql @@ -40,6 +40,19 @@ ALTER TABLE llx_projet_task ADD COLUMN billable smallint DEFAULT 1; ALTER TABLE llx_inventory DROP COLUMN datec; +UPDATE llx_document_model SET nom='standard_expensereport' WHERE nom='standard' AND type='expensereport'; +UPDATE llx_document_model SET nom='standard_stock' WHERE nom='standard' AND type='stock'; +UPDATE llx_document_model SET name='standard_movementstock' WHERE nom='standard' AND type='mouvement'; +UPDATE llx_document_model SET nom='standard_evaluation' WHERE nom='standard' AND type='evaluation'; +UPDATE llx_document_model SET nom='standard_supplierpayment' WHERE nom='standard' AND type='supplier_payment'; +UPDATE llx_document_model SET nom='standard_member' WHERE nom='standard' AND type='member'; +-- if rename failed delete old models +DELETE FROM llx_document_model WHERE nom='standard' AND type='expensereport'; +DELETE FROM llx_document_model WHERE nom='standard' AND type='stock'; +DELETE FROM llx_document_model WHERE nom='standard' AND type='mouvement'; +DELETE FROM llx_document_model WHERE nom='standard' AND type='evaluation'; +DELETE FROM llx_document_model WHERE nom='standard' AND type='supplier_payment'; +DELETE FROM llx_document_model WHERE nom='standard' AND type='member'; ALTER TABLE llx_contrat ADD COLUMN total_tva double(24,8) DEFAULT 0; ALTER TABLE llx_contrat ADD COLUMN localtax1 double(24,8) DEFAULT 0; diff --git a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php index 8ed0e0d4207..54db0612084 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php @@ -253,7 +253,7 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio $pdf->SetAutoPageBreak(1, 0); $heightforinfotot = 50; // Height reserved to output the info and total part and payment part - $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page + $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin) if (class_exists('TCPDF')) { From 6fb7aee8088c9793903b7b2d1eeb1a5ada467c83 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Jul 2024 03:17:44 +0200 Subject: [PATCH 11/66] Clean code to avoid strange code manipulation as reported into #30259 FIX SQL Error group by --- htdocs/comm/card.php | 2 +- htdocs/contrat/card.php | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index fc5a015e820..46758f40670 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -1436,7 +1436,7 @@ if ($object->id > 0) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON f.rowid=pf.fk_facture'; $sql .= " WHERE f.fk_soc = s.rowid AND s.rowid = ".((int) $object->id); $sql .= " AND f.entity IN (".getEntity('invoice').")"; - $sql .= ' GROUP BY f.rowid, f.ref, f.type, f.total_ht, f.total_tva, f.total_ttc,'; + $sql .= ' GROUP BY f.rowid, f.ref, f.type, f.ref_client, f.total_ht, f.total_tva, f.total_ttc,'; $sql .= ' f.entity, f.datef, f.date_lim_reglement, f.datec, f.paye, f.fk_statut,'; $sql .= ' s.nom, s.rowid'; $sql .= " ORDER BY f.datef DESC, f.datec DESC"; diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 3cdbac83901..b81ff021d64 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -67,6 +67,7 @@ $id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $origin = GETPOST('origin', 'alpha'); $originid = GETPOSTINT('originid'); +$idline = GETPOSTINT('elrowid') ? GETPOSTINT('elrowid') : GETPOSTINT('rowid'); // PDF $hidedetails = (GETPOSTINT('hidedetails') ? GETPOSTINT('hidedetails') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0)); @@ -707,13 +708,12 @@ if (empty($reshook)) { if (!empty($date_start_update) && !empty($date_end_update) && $date_start_update > $date_end_update) { setEventMessages($langs->trans("Error").': '.$langs->trans("DateStartPlanned").' > '.$langs->trans("DateEndPlanned"), null, 'errors'); $action = 'editline'; - $_GET['rowid'] = GETPOST('elrowid'); // Keep $_GET here. Used by GETPOST('rowid') later $error++; } if (!$error) { $objectline = new ContratLigne($db); - if ($objectline->fetch(GETPOSTINT('elrowid')) < 0) { + if ($objectline->fetch($idline) < 0) { setEventMessages($objectline->error, $objectline->errors, 'errors'); $error++; } @@ -1594,7 +1594,7 @@ if ($action == 'create') { // Line in view mode - if ($action != 'editline' || GETPOST('rowid') != $objp->rowid) { + if ($action != 'editline' || $idline != $objp->rowid) { $moreparam = ''; if (getDolGlobalString('CONTRACT_HIDE_CLOSED_SERVICES_BY_DEFAULT') && $objp->statut == ContratLigne::STATUS_CLOSED && $action != 'showclosedlines') { $moreparam = 'style="display: none;"'; @@ -1663,18 +1663,18 @@ if ($action == 'create') { // Icon move, update et delete (status contract 0=draft,1=validated,2=closed) print ''; - if ($user->hasRight('contrat', 'creer') && is_array($arrayothercontracts) && count($arrayothercontracts) && ($object->statut >= 0)) { + if ($user->hasRight('contrat', 'creer') && is_array($arrayothercontracts) && count($arrayothercontracts) && ($object->status >= 0)) { print ''; print ''; print img_picto($langs->trans("MoveToAnotherContract"), 'uparrow'); print ''; } - if ($user->hasRight('contrat', 'creer') && ($object->statut >= 0)) { + if ($user->hasRight('contrat', 'creer') && ($object->status >= 0)) { print ''; print img_edit(); print ''; } - if ($user->hasRight('contrat', 'creer') && ($object->statut >= 0)) { + if ($user->hasRight('contrat', 'creer') && ($object->status >= 0)) { print ''; print img_delete(); print ''; @@ -1872,17 +1872,17 @@ if ($action == 'create') { /* * Confirmation to delete service line of contract */ - if ($action == 'deleteline' && !$_REQUEST["cancel"] && $user->hasRight('contrat', 'creer') && $object->lines[$cursorline - 1]->id == GETPOST('rowid')) { - print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('rowid'), $langs->trans("DeleteContractLine"), $langs->trans("ConfirmDeleteContractLine"), "confirm_deleteline", '', 0, 1); + if ($action == 'deleteline' && !$cancel && $user->hasRight('contrat', 'creer') && $object->lines[$cursorline - 1]->id == $idline) { + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".((int) $object->id)."&lineid=".((int) $idline), $langs->trans("DeleteContractLine"), $langs->trans("ConfirmDeleteContractLine"), "confirm_deleteline", '', 0, 1); if ($ret == 'html') { - print '
'; + print '
'; } } /* * Confirmation to move service toward another contract */ - if ($action == 'move' && !$_REQUEST["cancel"] && $user->hasRight('contrat', 'creer') && $object->lines[$cursorline - 1]->id == GETPOST('rowid')) { + if ($action == 'move' && !$cancel && $user->hasRight('contrat', 'creer') && $object->lines[$cursorline - 1]->id == $idline) { $arraycontractid = array(); foreach ($arrayothercontracts as $contractcursor) { $arraycontractid[$contractcursor->id] = $contractcursor->ref; @@ -1893,8 +1893,8 @@ if ($action == 'create') { 'text' => $langs->trans("ConfirmMoveToAnotherContractQuestion"), 0 => array('type' => 'select', 'name' => 'newcid', 'values' => $arraycontractid)); - print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOSTINT('rowid'), $langs->trans("MoveToAnotherContract"), $langs->trans("ConfirmMoveToAnotherContract"), "confirm_move", $formquestion); - print '
'; + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".((int) $object->id)."&lineid=".((int) $idline), $langs->trans("MoveToAnotherContract"), $langs->trans("ConfirmMoveToAnotherContract"), "confirm_move", $formquestion, 'yes'); + print '
'; } // Area with status and activation info of line From ed207cfb2f653584ed9d6ee95842502ec4403e54 Mon Sep 17 00:00:00 2001 From: dolibarr95 <24292300+dolibarr95@users.noreply.github.com> Date: Sat, 6 Jul 2024 03:34:48 +0200 Subject: [PATCH 12/66] NEW : manage several type of dangerous goods for a same parcel (#30238) * NEW : manage several type of dangerous goods for a same parcel Manage several type of dangerous goods for a same parcel Before : dangerous_goods : smallint (so only 1 type can be defined eg 3) After dangerous_goods : varchar so can be a list of numbers eg 3,5,8 * Update llx_expedition_package.sql > Adding a default value to default '0' to keep compatibility seems required. * Update 20.0.0-21.0.0.sql > You must include migration change into same PR so PR is atomic. Include change of #30237 * Update llx_expedition_package.sql space missing * Update 20.0.0-21.0.0.sql > -- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60); --- htdocs/install/mysql/migration/20.0.0-21.0.0.sql | 2 ++ htdocs/install/mysql/tables/llx_expedition_package.sql | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/20.0.0-21.0.0.sql b/htdocs/install/mysql/migration/20.0.0-21.0.0.sql index 07338c65ac9..fc0a2a5725a 100644 --- a/htdocs/install/mysql/migration/20.0.0-21.0.0.sql +++ b/htdocs/install/mysql/migration/20.0.0-21.0.0.sql @@ -60,3 +60,5 @@ ALTER TABLE llx_contrat ADD COLUMN localtax2 double(24,8) DEFAULT 0; ALTER TABLE llx_contrat ADD COLUMN revenuestamp double(24,8) DEFAULT 0; ALTER TABLE llx_contrat ADD COLUMN total_ht double(24,8) DEFAULT 0; ALTER TABLE llx_contrat ADD COLUMN total_ttc double(24,8) DEFAULT 0; + +ALTER TABLE llx_expedition_package MODIFY COLUMN dangerous_goods varchar(60) DEFAULT '0'; diff --git a/htdocs/install/mysql/tables/llx_expedition_package.sql b/htdocs/install/mysql/tables/llx_expedition_package.sql index 2f8d97a26a9..a4f372603ce 100644 --- a/htdocs/install/mysql/tables/llx_expedition_package.sql +++ b/htdocs/install/mysql/tables/llx_expedition_package.sql @@ -12,7 +12,7 @@ create table llx_expedition_package size_units integer, -- unit of all sizes (height, width, depth) weight float, -- weight weight_units integer, -- unit of weight - dangerous_goods smallint DEFAULT 0, -- 0 = no dangerous goods or 1 = Explosives, 2 = Flammable Gases, 3 = Flammable Liquids, 4 = Flammable solids, 5 = Oxidizing, 6 = Toxic & Infectious, 7 = Radioactive, 8 = Corrosives, 9 = Miscellaneous (see https://en.wikipedia.org/wiki/Dangerous_goods). I'm not sure if just register 0 (no) or 1 (yes) is enough. + dangerous_goods varchar(20) DEFAULT '0', -- (comma separated list eg : 3,5,7) 0 = no dangerous goods or 1 = Explosives, 2 = Flammable Gases, 3 = Flammable Liquids, 4 = Flammable solids, 5 = Oxidizing, 6 = Toxic & Infectious, 7 = Radioactive, 8 = Corrosives, 9 = Miscellaneous (see https://en.wikipedia.org/wiki/Dangerous_goods). I'm not sure if just register 0 (no) or 1 (yes) is enough. tail_lift smallint DEFAULT 0, -- 0 = no tail lift required to load/unload package(s), 1 = a tail lift is required to load/unload package(s). Sometime tail lift load can be different than tail lift delivery so maybe adding a new table line. rang integer DEFAULT 0 )ENGINE=innodb; From fbcc463a6f913053a5b9f0c4a8cd2fecec025b6d Mon Sep 17 00:00:00 2001 From: IC-Mathieu <95343351+IC-Mathieu@users.noreply.github.com> Date: Sat, 6 Jul 2024 03:54:33 +0200 Subject: [PATCH 13/66] ADD_HOOK_IN_SITUATION (#30240) * ADD_HOOK_SITUATION * Update card.php --------- Co-authored-by: Laurent Destailleur --- htdocs/compta/facture/card.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 86b6ba5d0fd..75d74750b2b 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2048,6 +2048,15 @@ if (empty($reshook)) { if ($ret > 0) { $nextSituationInvoice->insertExtraFields(); } + + // Hooks + $parameters = array('origin' => $origin); + $reshook = $hookmanager->executeHooks('createFrom', $parameters, $nextSituationInvoice, $action); // Note that $action and $object may have been + // modified by hook + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + $error++; + } } } } From 2f14f9cbaba840e74cad56f1313aa2e579031528 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Jul 2024 04:21:32 +0200 Subject: [PATCH 14/66] Clean code --- htdocs/compta/facture/card.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 75d74750b2b..13dfab130c4 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1530,11 +1530,12 @@ if (empty($reshook)) { $element = $subelement = 'expedition'; } - $object->origin = $origin; + $object->origin = $origin; // deprecated + $object->origin_type = $origin; $object->origin_id = $originid; // Possibility to add external linked objects with hooks - $object->linked_objects[$object->origin] = $object->origin_id; + $object->linked_objects[$object->origin_type] = $object->origin_id; // link with order if it is a shipping invoice if ($object->origin == 'shipping') { require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; @@ -1903,7 +1904,7 @@ if (empty($reshook)) { }*/ // Hooks - $parameters = array('objFrom' => $srcobject); + $parameters = array('origin_type' => $object->origin_type, 'origin_id' => $object->origin_id, 'objFrom' => $srcobject); $reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been // modified by hook if ($reshook < 0) { @@ -1959,7 +1960,8 @@ if (empty($reshook)) { if (!empty($origin) && !empty($originid)) { include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; - $object->origin = $origin; + $object->origin = $origin; // deprecated + $object->origin_type = $origin; $object->origin_id = $originid; // retained warranty @@ -1981,8 +1983,6 @@ if (empty($reshook)) { } foreach ($object->lines as $i => &$line) { - $line->origin = $object->origin; - $line->origin_id = $line->id; $line->fk_prev_id = $line->id; $line->fetch_optionals(); if (getDolGlobalInt('INVOICE_USE_SITUATION') == 2) { @@ -2023,6 +2023,7 @@ if (empty($reshook)) { $object->note = trim(GETPOST('note', 'restricthtml')); $object->note_private = trim(GETPOST('note', 'restricthtml')); $object->ref_client = GETPOST('ref_client', 'alpha'); + $object->ref_customer = GETPOST('ref_client', 'alpha'); $object->model_pdf = GETPOST('model', 'alpha'); $object->fk_project = GETPOSTINT('projectid'); $object->cond_reglement_id = GETPOSTINT('cond_reglement_id'); @@ -2035,6 +2036,7 @@ if (empty($reshook)) { // Special properties of replacement invoice $object->situation_counter += 1; + $id = $object->createFromCurrent($user); if ($id <= 0) { $mesg = $object->error; @@ -2050,7 +2052,7 @@ if (empty($reshook)) { } // Hooks - $parameters = array('origin' => $origin); + $parameters = array('origin_type' => $object->origin_type, 'origin_id' => $object->origin_id); $reshook = $hookmanager->executeHooks('createFrom', $parameters, $nextSituationInvoice, $action); // Note that $action and $object may have been // modified by hook if ($reshook < 0) { From 420704867273d9fc2b70aa7245263fb656d9e3fa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Jul 2024 05:07:14 +0200 Subject: [PATCH 15/66] Debug css v20 --- htdocs/core/bookmarks_page.php | 2 +- htdocs/core/search_page.php | 2 +- htdocs/theme/eldy/dropdown.inc.php | 4 ++-- htdocs/theme/eldy/global.inc.php | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/bookmarks_page.php b/htdocs/core/bookmarks_page.php index a24918273d8..06b855459ff 100644 --- a/htdocs/core/bookmarks_page.php +++ b/htdocs/core/bookmarks_page.php @@ -146,7 +146,7 @@ if (empty($reshook)) { print "\n"; print "\n"; -print '
'; +print '
'; print ''; print '
'."\n"; print $bookmarkList; diff --git a/htdocs/core/search_page.php b/htdocs/core/search_page.php index 0f91b78b9ed..77746652771 100644 --- a/htdocs/core/search_page.php +++ b/htdocs/core/search_page.php @@ -192,7 +192,7 @@ if ($conf->dol_use_jmobile) { // Show all forms print "\n"; print "\n"; -print '
'; +print '
'; print ''; print '
'."\n"; print $searchform; diff --git a/htdocs/theme/eldy/dropdown.inc.php b/htdocs/theme/eldy/dropdown.inc.php index 65a47cceadf..b59787308ed 100644 --- a/htdocs/theme/eldy/dropdown.inc.php +++ b/htdocs/theme/eldy/dropdown.inc.php @@ -578,13 +578,13 @@ dropdown-holder { } .tmenu .dropdown-menu, .login_block .dropdown-menu, .topnav .dropdown-menu { - margin-left: 5px; + margin-left: 8px; right: 0; } #topmenu-quickadd-dropdown .dropdown-menu { min-width: 220px; - max-width: 235px; + max-width: 270px; } #topmenu-bookmark-dropdown .dropdown-menu { min-width: 220px; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 94dae7825c5..72224fea8d8 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -8291,15 +8291,15 @@ table.jPicker { height: 50px; z-index: 202; - min-width: 200px; /* must be width of menu + padding + padding of sidenav */ - max-width: 200px; /* must be width of menu + padding + padding of sidenav */ - width: 200px; /* must be width of menu + padding + padding of sidenav */ + min-width: 245px; /* must be width of menu + padding + padding of sidenav */ + max-width: 245px; /* must be width of menu + padding + padding of sidenav */ + width: 245px; /* must be width of menu + padding + padding of sidenav */ } .loginbuttonexternal { width: 260px; } .side-nav-vert .user-menu .dropdown-menu { - width: 234px !important; + width: 278px !important; /* must be width of menu + padding + padding of sidenav */ } div.login_block_other { margin-right: unset; From f1b5902c28603417f74b7dee72acd194076b99a8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Jul 2024 13:42:05 +0200 Subject: [PATCH 16/66] Enhance popup of social contribution ref --- htdocs/accountancy/journal/bankjournal.php | 6 ++++++ htdocs/compta/sociales/class/chargesociales.class.php | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index a20724fbd84..16609343920 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -408,6 +408,10 @@ if ($result) { $userstatic->lastname = $tabuser[$obj->rowid]['lastname']; $userstatic->status = $tabuser[$obj->rowid]['status']; $userstatic->accountancy_code = $tabuser[$obj->rowid]['accountancy_code']; + + // For a payment of social contribution, we have a link sc + user. + // but we already fill the $tabpay[$obj->rowid]["soclib"] in the line 'sc'. + // If we fill it here to, we must concat. if ($userstatic->id > 0) { $tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, 'accountancy', 0); } else { @@ -431,6 +435,8 @@ if ($result) { $chargestatic->label = $links[$key]['label']; } $chargestatic->ref = $chargestatic->label; + //$chargestatic->fetch($chargestatic->id); + $tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, 30); $tabpay[$obj->rowid]["paymentscid"] = $chargestatic->id; diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 78a2f180dd6..a4ccb846821 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -65,6 +65,8 @@ class ChargeSociales extends CommonObject public $label; public $type; public $type_label; + public $type_code; + public $type_accountancy_code; public $amount; public $paye; @@ -142,7 +144,7 @@ class ChargeSociales extends CommonObject $sql = "SELECT cs.rowid, cs.date_ech"; $sql .= ", cs.libelle as label, cs.fk_type, cs.amount, cs.fk_projet as fk_project, cs.paye, cs.periode as period, cs.import_key"; $sql .= ", cs.fk_account, cs.fk_mode_reglement, cs.fk_user, note_public, note_private"; - $sql .= ", c.libelle as type_label"; + $sql .= ", c.libelle as type_label, c.code as type_code, c.accountancy_code as type_accountancy_code"; $sql .= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; $sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as cs"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_chargesociales as c ON cs.fk_type = c.id"; @@ -167,6 +169,8 @@ class ChargeSociales extends CommonObject $this->label = $obj->label; $this->type = $obj->fk_type; $this->type_label = $obj->type_label; + $this->type_code = $obj->type_code; + $this->type_accountancy_code = $obj->type_accountancy_code; $this->fk_account = $obj->fk_account; $this->mode_reglement_id = $obj->fk_mode_reglement; $this->mode_reglement_code = $obj->mode_reglement_code; @@ -614,6 +618,9 @@ class ChargeSociales extends CommonObject } if (!empty($this->type_label)) { $label .= '
'.$langs->trans('Type').': '.$this->type_label; + if (!empty($this->type_accountancy_code)) { + $label .= ' ('.$langs->trans('AccountancyCode').': '.$this->type_accountancy_code.')'; + } } $linkclose = ''; From ca39809658f116d974b76436761e38060c68f731 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jul 2024 20:46:29 +0200 Subject: [PATCH 17/66] Fix #30256 --- htdocs/accountancy/journal/bankjournal.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 9ca0c188fa2..1ddfd228328 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -215,6 +215,7 @@ if ($result) { // one line tabpay = line into bank // one line for bank record = tabbq // one line for thirdparty record = tabtp + // Note: tabcompany is used to store the subledger account $i = 0; while ($i < $num) { $obj = $db->fetch_object($result); @@ -262,7 +263,8 @@ if ($result) { ); // Set accountancy code for user - // $obj->accountancy_code is the accountancy_code of table u=user but it is defined only if a link with type 'user' exists) + // $obj->accountancy_code is the accountancy_code of table u=user (but it is defined only if + // a link with type 'user' exists and user as a subledger account) $compta_user = (!empty($obj->accountancy_code) ? $obj->accountancy_code : ''); $tabuser[$obj->rowid] = array( @@ -359,13 +361,25 @@ if ($result) { $userstatic->lastname = $tabuser[$obj->rowid]['lastname']; $userstatic->statut = $tabuser[$obj->rowid]['status']; $userstatic->accountancy_code = $tabuser[$obj->rowid]['accountancy_code']; + // For a payment of social contribution, we have a link sc + user. + // but we already fill the $tabpay[$obj->rowid]["soclib"] in the line 'sc'. + // If we fill it here to, we must concat if ($userstatic->id > 0) { - $tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, 'accountancy', 0); + if ($is_sc) { + $tabpay[$obj->rowid]["soclib"] .= ' '.$userstatic->getNomUrl(1, 'accountancy', 0); + } else { + $tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, 'accountancy', 0); + } } else { $tabpay[$obj->rowid]["soclib"] = '???'; // Should not happen, but happens with old data when id of user was not saved on expense report payment. } + if ($compta_user) { - $tabtp[$obj->rowid][$compta_user] += $amounttouse; + if ($is_sc) { + //$tabcompany[$obj->rowid][$compta_user] += $amounttouse; + } else { + $tabtp[$obj->rowid][$compta_user] += $amounttouse; + } } } elseif ($links[$key]['type'] == 'sc') { $chargestatic->id = $links[$key]['url_id']; From f99beb902304a32996f8427fac0d6bf04606be99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 6 Jul 2024 14:30:13 +0200 Subject: [PATCH 18/66] fix expects int (#30304) --- htdocs/adherents/agenda.php | 3 ++- htdocs/admin/external_rss.php | 3 ++- htdocs/admin/stock.php | 2 +- htdocs/compta/bank/bankentries_list.php | 10 ++++++---- htdocs/core/lib/admin.lib.php | 3 ++- htdocs/mrp/mo_production.php | 2 +- htdocs/ticket/card.php | 4 ++-- phpstan.neon.dist | 17 ++++++++++++++++- 8 files changed, 32 insertions(+), 12 deletions(-) diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index 286a66ea493..3875569448f 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -5,6 +5,7 @@ * Copyright (C) 2006-2011 Laurent Destailleur * Copyright (C) 2007 Patrick Raguin * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2024 Frédéric France * * 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 @@ -190,7 +191,7 @@ if ($object->id > 0) { $param .= '&limit='.$limit; } - print_barre_liste($langs->trans("ActionsOnMember"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', '', $newcardbutton, '', 0, 1, 0); + print_barre_liste($langs->trans("ActionsOnMember"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $newcardbutton, '', 0, 1, 0); // List of all actions $filters = array(); diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index 9c17713bbf5..8f9228b97c8 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -8,6 +8,7 @@ * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2020 Tobias Sekan * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -320,7 +321,7 @@ if ($resql) { } // Active - $active = _isInBoxList($idrss, $boxlist) ? 'yes' : 'no'; + $active = _isInBoxList((int) $idrss, $boxlist) ? 'yes' : 'no'; print ''; print ''.$langs->trans('WidgetAvailable').''; print ''.yn($active); diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 2524fe7b4a8..ed5e508cbd1 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -494,7 +494,7 @@ if ($virtualdiffersfromphysical) { print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print ''; print ''; - print "\n"; + print "\n"; print ''."\n"; print ''."\n"; diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 620ecbae808..d5a617b95f6 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -659,21 +659,23 @@ if ($search_thirdparty_user) { $sql .= " ( SELECT bu.fk_bank FROM ".MAIN_DB_PREFIX."bank_url AS bu"; $sql .= " JOIN ".MAIN_DB_PREFIX."bank AS b2 ON b2.rowid = bu.fk_bank"; $sql .= " JOIN ".MAIN_DB_PREFIX."user AS subUser ON (bu.type = 'user' AND bu.url_id = subUser.rowid)"; - $sql .= " WHERE ". natural_search(array("subUser.firstname", "subUser.lastname"), $search_thirdparty_user, '', 1).")"; + $sql .= " WHERE ". natural_search(array("subUser.firstname", "subUser.lastname"), $search_thirdparty_user, 0, 1).")"; $sql .= " OR b.rowid IN "; $sql .= " ( SELECT bu.fk_bank FROM ".MAIN_DB_PREFIX."bank_url AS bu"; $sql .= " JOIN ".MAIN_DB_PREFIX."bank AS b2 ON b2.rowid = bu.fk_bank"; $sql .= " JOIN ".MAIN_DB_PREFIX."societe AS subSoc ON (bu.type = 'company' AND bu.url_id = subSoc.rowid)"; - $sql .= " WHERE ". natural_search(array("subSoc.nom"), $search_thirdparty_user, '', 1); + $sql .= " WHERE ". natural_search(array("subSoc.nom"), $search_thirdparty_user, 0, 1); $sql .= "))"; } if ($search_description) { $search_description_to_use = $search_description; $arrayoffixedlabels = array( 'payment_salary', - 'CustomerInvoicePayment', 'CustomerInvoicePaymentBack', - 'SupplierInvoicePayment', 'SupplierInvoicePaymentBack', + 'CustomerInvoicePayment', + 'CustomerInvoicePaymentBack', + 'SupplierInvoicePayment', + 'SupplierInvoicePaymentBack', 'DonationPayment', 'ExpenseReportPayment', 'SocialContributionPayment', diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 3e52db42821..c085cfa09ad 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -5,6 +5,7 @@ * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2023 Eric Seigne * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -1066,7 +1067,7 @@ function listOfSessions() /** * Purge existing sessions * - * @param int $mysessionid To avoid to try to delete my own session + * @param string $mysessionid To avoid to try to delete my own session * @return int >0 if OK, <0 if KO */ function purgeSessions($mysessionid) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 5773f72354a..c7e2f268081 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -999,7 +999,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $reg = []; $qtyhourservice = 0; if (preg_match('/^(\d+)([a-z]+)$/', $tmpproduct->duration, $reg)) { - $qtyhourservice = convertDurationtoHour($reg[1], $reg[2]); + $qtyhourservice = convertDurationtoHour($reg[1], (string) $reg[2]); } $qtyhourforline = 0; if ($line->fk_unit) { diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 85e83794115..719c24c8a49 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -2,7 +2,7 @@ /* Copyright (C) 2013-2016 Jean-François FERRY * Copyright (C) 2016 Christophe Battarel * Copyright (C) 2018 Laurent Destailleur - * Copyright (C) 2021-2024 Frédéric France + * Copyright (C) 2021-2024 Frédéric France * Copyright (C) 2021 Alexandre Spangaro * Copyright (C) 2022-2023 Charlene Benke * Copyright (C) 2023 Benjamin Falière @@ -1060,7 +1060,7 @@ if ($action == 'create' || $action == 'presend') { print '
".$langs->trans("RuleForStockReplenishment")." ".img_help('help', $langs->trans("VirtualDiffersFromPhysical"))."".$langs->trans("RuleForStockReplenishment")." ".img_help(1, $langs->trans("VirtualDiffersFromPhysical"))."'.$langs->trans("Status").'
'; print $langs->trans("AssignedTo"); if (isset($object->status) && $object->status < $object::STATUS_CLOSED && GETPOST('set', 'alpha') != "assign_ticket" && $user->hasRight('ticket', 'manage')) { - print ''.img_edit($langs->trans('Modify'), '').''; + print ''.img_edit($langs->trans('Modify')).''; } print '
'; print ''; diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 8b2ec7364b7..cef82d0379d 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -69,7 +69,22 @@ parameters: - '#expects int\|#' - '#expects int<-2, 2>, bool given.#' - '#expects int<0, 1>#' - - '#expects int, string#' + - '#print.* expects int, string#' + - '#tax_by.* expects int, string#' + - '#load.* expects int, string#' + - '#ajax.* expects int, string#' + - '#measu.* expects int, string#' + - '#color.* expects int, string#' + - '#imap.* expects int, string#' + - '#show.* expects int, string#' + - '#pdf.* expects int, string#' + - '#dol.* expects int, string#' + - '#get.* expects int, string#' + - '#send.* expects int, string#' + - '#convert.* expects int, string#' + - '#constructor expects int, string#' + - '#\(\) expects int, string#' + - '#run_sql expects int, string#' - '#expects int, float#' - '#expects int, null#' - '#expects int, bool given.#' From 76f616796c5a8ffaf747c97260bce5af98bd0ac7 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 6 Jul 2024 14:32:06 +0200 Subject: [PATCH 19/66] Add llxHeader body css for member (#30302) * NEW : llxHeader body css for member * NEW : llxHeader body css for member * NEW : llxHeader body css for member * NEW : llxHeader body css for member * NEW : llxHeader body css for member * NEW : llxHeader body css for member --------- Co-authored-by: Laurent Destailleur --- htdocs/adherents/admin/member.php | 26 ++++++++------- htdocs/adherents/admin/member_emails.php | 22 +++++++------ htdocs/adherents/admin/member_extrafields.php | 13 +++++--- .../admin/member_type_extrafields.php | 17 ++++++---- htdocs/adherents/admin/website.php | 12 ++++--- htdocs/adherents/agenda.php | 15 +++++---- htdocs/adherents/card.php | 23 ++++++------- htdocs/adherents/cartes/carte.php | 12 ++++--- htdocs/adherents/class/adherent.class.php | 32 +++++++++---------- htdocs/adherents/document.php | 14 ++++---- htdocs/adherents/index.php | 20 +++++++----- htdocs/adherents/ldap.php | 16 ++++++---- htdocs/adherents/list.php | 21 ++++++------ htdocs/adherents/messaging.php | 20 ++++++------ htdocs/adherents/note.php | 10 +++--- htdocs/adherents/partnership.php | 9 ++++-- htdocs/adherents/stats/byproperties.php | 8 +++-- htdocs/adherents/stats/geo.php | 9 ++++-- htdocs/adherents/stats/index.php | 4 ++- htdocs/adherents/subscription.php | 19 ++++++----- htdocs/adherents/subscription/card.php | 9 ++++-- htdocs/adherents/subscription/info.php | 10 ++++-- htdocs/adherents/subscription/list.php | 9 +++--- htdocs/adherents/type.php | 21 ++++++------ htdocs/adherents/type_ldap.php | 5 ++- htdocs/adherents/type_translation.php | 12 +++---- htdocs/adherents/vcard.php | 12 +++---- 27 files changed, 225 insertions(+), 175 deletions(-) diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php index 617e8037983..0f5af1d4817 100644 --- a/htdocs/adherents/admin/member.php +++ b/htdocs/adherents/admin/member.php @@ -1,16 +1,17 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2004 Sebastien Di Cintio - * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2011-2012 Juanjo Menent - * Copyright (C) 2012 J. Fernando Lagrange - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2020-2021 Frédéric France - * Copyright (C) 2023 Waël Almoman +/* Copyright (C) 2003 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004 Sebastien Di Cintio + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2011-2012 Juanjo Menent + * Copyright (C) 2012 J. Fernando Lagrange + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2020-2021 Frédéric France + * Copyright (C) 2023 Waël Almoman * Copyright (C) 2024 MDW + * Copyright (C) 2024 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 @@ -219,9 +220,10 @@ if ($action == 'unset') { $form = new Form($db); +$title = $langs->trans("MembersSetup"); $help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; -llxHeader('', $langs->trans("MembersSetup"), $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-admin'); $linkback = ''.$langs->trans("BackToModuleList").''; diff --git a/htdocs/adherents/admin/member_emails.php b/htdocs/adherents/admin/member_emails.php index 88d5e0e108a..ee99f4cdef4 100644 --- a/htdocs/adherents/admin/member_emails.php +++ b/htdocs/adherents/admin/member_emails.php @@ -1,13 +1,14 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2004 Sebastien Di Cintio - * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2011-2012 Juanjo Menent - * Copyright (C) 2012 J. Fernando Lagrange - * Copyright (C) 2015 Jean-François Ferry +/* Copyright (C) 2003 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004 Sebastien Di Cintio + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2011-2012 Juanjo Menent + * Copyright (C) 2012 J. Fernando Lagrange + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2024 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 @@ -135,9 +136,10 @@ if ($action == 'update' || $action == 'add') { $form = new Form($db); +$title = $langs->trans("MembersSetup"); $help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; -llxHeader('', $langs->trans("MembersSetup"), $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-admin_emails'); $linkback = ''.$langs->trans("BackToModuleList").''; diff --git a/htdocs/adherents/admin/member_extrafields.php b/htdocs/adherents/admin/member_extrafields.php index b89a3a4cd05..e1ffbf5fceb 100644 --- a/htdocs/adherents/admin/member_extrafields.php +++ b/htdocs/adherents/admin/member_extrafields.php @@ -1,8 +1,9 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2012 Regis Houssin +/* Copyright (C) 2001-2002 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2024 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 @@ -61,8 +62,10 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; $textobject = $langs->transnoentitiesnoconv("Members"); +$title = $langs->trans("MembersSetup"); $help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; -llxHeader('', $langs->trans("MembersSetup"), $help_url); + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-admin_extrafields'); $linkback = ''.$langs->trans("BackToModuleList").''; diff --git a/htdocs/adherents/admin/member_type_extrafields.php b/htdocs/adherents/admin/member_type_extrafields.php index d8e935c592a..9ce9780f1d9 100644 --- a/htdocs/adherents/admin/member_type_extrafields.php +++ b/htdocs/adherents/admin/member_type_extrafields.php @@ -1,10 +1,11 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2015 Jean-François Ferry +/* Copyright (C) 2001-2002 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2024 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 @@ -64,8 +65,10 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; $textobject = $langs->transnoentitiesnoconv("MembersTypes"); +$title = $langs->trans("MembersSetup"); $help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; -llxHeader('', $langs->trans("MembersSetup"), $help_url); + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-admin_type_extrafields'); $linkback = ''.$langs->trans("BackToModuleList").''; diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index df69c5274d5..d15f0d19605 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -1,8 +1,9 @@ - * Copyright (C) 2006-2015 Laurent Destailleur - * Copyright (C) 2006-2012 Regis Houssin - * Copyright (C) 2011 Juanjo Menent +/* Copyright (C) 2001-2002 Rodolphe Quiedeville + * Copyright (C) 2006-2015 Laurent Destailleur + * Copyright (C) 2006-2012 Regis Houssin + * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2024 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 @@ -104,7 +105,8 @@ $form = new Form($db); $title = $langs->trans("MembersSetup"); $help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; -llxHeader('', $title, $help_url); + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-admin_website'); $linkback = ''.$langs->trans("BackToModuleList").''; diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index 3875569448f..bd40ed7166e 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -1,10 +1,11 @@ - * Copyright (C) 2005 Brice Davoleau - * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2006-2011 Laurent Destailleur - * Copyright (C) 2007 Patrick Raguin - * Copyright (C) 2010 Juanjo Menent +/* Copyright (C) 2001-2007 Rodolphe Quiedeville + * Copyright (C) 2005 Brice Davoleau + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2006-2011 Laurent Destailleur + * Copyright (C) 2007 Patrick Raguin + * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2024 Alexandre Spangaro * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -136,7 +137,7 @@ if ($object->id > 0) { $help_url = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder"; - llxHeader("", $title, $help_url); + llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-card_agenda'); if (isModEnabled('notification')) { $langs->load("mails"); diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 99eb76ee0bf..334ec4827f6 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1,14 +1,14 @@ - * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2005-2018 Regis Houssin - * Copyright (C) 2012 Marcos García - * Copyright (C) 2012-2020 Philippe Grand - * Copyright (C) 2015-2024 Alexandre Spangaro - * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2021 Waël Almoman - * Copyright (C) 2024 MDW +/* Copyright (C) 2001-2004 Rodolphe Quiedeville + * Copyright (C) 2002-2003 Jean-Louis Bergamo + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2005-2018 Regis Houssin + * Copyright (C) 2012 Marcos García + * Copyright (C) 2012-2020 Philippe Grand + * Copyright (C) 2015-2024 Alexandre Spangaro + * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2021 Waël Almoman + * Copyright (C) 2024 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 @@ -891,7 +891,8 @@ $formcompany = new FormCompany($db); $title = $langs->trans("Member")." - ".$langs->trans("Card"); $help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; -llxHeader('', $title, $help_url); + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-card'); $countrynotdefined = $langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index 1b4eb4979e1..e0a9284becb 100644 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -1,7 +1,8 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2006-2013 Laurent Destailleur +/* Copyright (C) 2003 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2006-2013 Laurent Destailleur + * Copyright (C) 2024 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 @@ -264,7 +265,10 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) { $form = new Form($db); -llxHeader('', $langs->trans("MembersCards")); +$title = $langs->trans('MembersCards'); +$help_url = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Mitglieder'; + +llxHeader('', $langs->trans("MembersCards"), $help_url, '', 0, 0, '', '', '', 'mod-member page-cards'); print load_fiche_titre($langs->trans("LinkToGeneratedPages"), '', $adherentstatic->picto); diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 3aeb87792f0..7eb943244d4 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1,20 +1,20 @@ - * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2004 Sebastien Di Cintio - * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2009-2017 Regis Houssin - * Copyright (C) 2014-2018 Alexandre Spangaro - * Copyright (C) 2015 Marcos García - * Copyright (C) 2015-2024 Frédéric France - * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2016 Juanjo Menent - * Copyright (C) 2018-2019 Thibault FOUCART - * Copyright (C) 2019 Nicolas ZABOURI - * Copyright (C) 2020 Josep Lluís Amador - * Copyright (C) 2021 Waël Almoman - * Copyright (C) 2021 Philippe Grand +/* Copyright (C) 2002-2003 Rodolphe Quiedeville + * Copyright (C) 2002-2003 Jean-Louis Bergamo + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004 Sebastien Di Cintio + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2009-2017 Regis Houssin + * Copyright (C) 2014-2018 Alexandre Spangaro + * Copyright (C) 2015 Marcos García + * Copyright (C) 2015-2024 Frédéric France + * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) 2016 Juanjo Menent + * Copyright (C) 2018-2019 Thibault FOUCART + * Copyright (C) 2019 Nicolas ZABOURI + * Copyright (C) 2020 Josep Lluís Amador + * Copyright (C) 2021 Waël Almoman + * Copyright (C) 2021 Philippe Grand * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index e92e1da0d41..8afcd57d5c8 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -1,9 +1,10 @@ - * Copyright (C) 2004-2010 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2010 Juanjo Menent - * Copyright (C) 2013 Cédric Salvador +/* Copyright (C) 2002-2007 Rodolphe Quiedeville + * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2024 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 @@ -114,10 +115,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; $form = new Form($db); $title = $langs->trans("Member")." - ".$langs->trans("Documents"); - $help_url = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder"; -llxHeader("", $title, $help_url); +llxHeader("", $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-card_documents'); if ($id > 0) { $result = $membert->fetch($object->typeid); diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index bd08c394026..1f48941688a 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -1,12 +1,13 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2020 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2019 Nicolas ZABOURI - * Copyright (C) 2021-2023 Frédéric France - * Copyright (C) 2021-2023 Waël Almoman +/* Copyright (C) 2001-2002 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2020 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2019 Nicolas ZABOURI + * Copyright (C) 2021-2023 Frédéric France + * Copyright (C) 2021-2023 Waël Almoman * Copyright (C) 2024 MDW + * Copyright (C) 2024 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 @@ -77,7 +78,10 @@ $form = new Form($db); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb) $resultboxes = FormOther::getBoxesArea($user, "2"); -llxHeader('', $langs->trans("Members"), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'); +$title = $langs->trans("Members"); +$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-index'); $staticmember = new Adherent($db); $statictype = new AdherentType($db); diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php index f94cc476321..e39152c788e 100644 --- a/htdocs/adherents/ldap.php +++ b/htdocs/adherents/ldap.php @@ -1,6 +1,7 @@ - * Copyright (C) 2006-2021 Regis Houssin +/* Copyright (C) 2006 Laurent Destailleur + * Copyright (C) 2006-2021 Regis Houssin + * Copyright (C) 2024 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 @@ -17,9 +18,9 @@ */ /** - * \file htdocs/adherents/ldap.php - * \ingroup ldap member - * \brief Page fiche LDAP adherent + * \file htdocs/adherents/ldap.php + * \ingroup ldap member + * \brief Page fiche LDAP adherent */ // Load Dolibarr environment @@ -104,7 +105,10 @@ if ($action == 'dolibarr2ldap') { $form = new Form($db); -llxHeader('', $langs->trans("Member"), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'); +$title = $langs->trans("Member"); +$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-card_ldap'); $head = member_prepare_head($object); diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 0f969a97bbc..2795204a3f8 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -1,13 +1,14 @@ - * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2004-2022 Laurent Destailleur - * Copyright (C) 2013-2015 Raphaël Doursenaud - * Copyright (C) 2014-2016 Juanjo Menent - * Copyright (C) 2018 Alexandre Spangaro - * Copyright (C) 2021-2024 Frédéric France - * Copyright (C) 2024 MDW - * Copyright (C) 2024 Benjamin Falière +/* Copyright (C) 2001-2003 Rodolphe Quiedeville + * Copyright (C) 2002-2003 Jean-Louis Bergamo + * Copyright (C) 2004-2022 Laurent Destailleur + * Copyright (C) 2013-2015 Raphaël Doursenaud + * Copyright (C) 2014-2016 Juanjo Menent + * Copyright (C) 2018-2024 Alexandre Spangaro + * Copyright (C) 2021-2024 Frédéric France + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Benjamin Falière + * Copyright (C) 2024 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 @@ -629,7 +630,7 @@ if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $s // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-member page-list bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll $arrayofselected = is_array($toselect) ? $toselect : array(); diff --git a/htdocs/adherents/messaging.php b/htdocs/adherents/messaging.php index 545b3f9b57c..63dfaaa564e 100644 --- a/htdocs/adherents/messaging.php +++ b/htdocs/adherents/messaging.php @@ -1,12 +1,13 @@ - * Copyright (C) 2005 Brice Davoleau - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2006-2019 Laurent Destailleur - * Copyright (C) 2007 Patrick Raguin - * Copyright (C) 2010 Juanjo Menent - * Copyright (C) 2015 Marcos García +/* Copyright (C) 2001-2007 Rodolphe Quiedeville + * Copyright (C) 2005 Brice Davoleau + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2006-2019 Laurent Destailleur + * Copyright (C) 2007 Patrick Raguin + * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2015 Marcos García * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 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 @@ -122,8 +123,9 @@ $form = new Form($db); $person_name = !empty($object->firstname) ? $object->lastname.", ".$object->firstname : $object->lastname; $title = $person_name." - ".$langs->trans('Info'); -$help_url = ''; -llxHeader('', $title, $help_url); +$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-card_messaging'); $head = member_prepare_head($object); diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index b76a08e6d82..3a176747716 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -1,7 +1,8 @@ - * Copyright (C) 2004-2014 Laurent Destailleur - * Copyright (C) 2015 Frederic France +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2004-2014 Laurent Destailleur + * Copyright (C) 2015 Frederic France + * Copyright (C) 2024 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 @@ -100,10 +101,9 @@ if (empty($reshook)) { */ $title = $langs->trans("Member")." - ".$langs->trans("Note"); - $help_url = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder"; -llxHeader("", $title, $help_url); +llxHeader("", $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-card_note'); $form = new Form($db); diff --git a/htdocs/adherents/partnership.php b/htdocs/adherents/partnership.php index d72825a11a6..c83f721d5fc 100644 --- a/htdocs/adherents/partnership.php +++ b/htdocs/adherents/partnership.php @@ -1,6 +1,7 @@ - * Copyright (C) 2021 NextGestion +/* Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2021 NextGestion + * Copyright (C) 2024 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 @@ -143,7 +144,9 @@ $form = new Form($db); $formfile = new FormFile($db); $title = $langs->trans("Partnership"); -llxHeader('', $title); +$help_url = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder"; + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-card_partnership'); $form = new Form($db); diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php index f7d530f0f62..8b927da7f4b 100644 --- a/htdocs/adherents/stats/byproperties.php +++ b/htdocs/adherents/stats/byproperties.php @@ -1,6 +1,7 @@ +/* Copyright (c) 2012 Laurent Destailleur * Copyright (C) 2024 MDW + * Copyright (C) 2024 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 @@ -55,9 +56,10 @@ $langs->loadLangs(array("companies", "members")); $memberstatic = new Adherent($db); -llxHeader('', $langs->trans("MembersStatisticsByProperties"), '', '', 0, 0, array('https://www.google.com/jsapi')); - $title = $langs->trans("MembersStatisticsByProperties"); +$help_url = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Mitglieder'; + +llxHeader('', $title, $help_url, '', 0, 0, array('https://www.google.com/jsapi'), '', '', 'mod-member page-stats_byproperties'); print load_fiche_titre($title, '', $memberstatic->picto); diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index b9d09f6f683..afb6f6ab4e2 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -1,6 +1,7 @@ - * Copyright (C) 2024 MDW +/* Copyright (c) 2004-2011 Laurent Destailleur + * Copyright (C) 2024 MDW + * Copyright (C) 2024 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 @@ -76,7 +77,9 @@ if ($mode == 'memberbyregion') { $title = $langs->trans("MembersStatisticsByRegion"); } -llxHeader('', $title, '', '', 0, 0, $arrayjs); +$help_url = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Mitglieder'; + +llxHeader('', $title, $help_url, '', 0, 0, $arrayjs, '', '', 'mod-member page-stats_geo'); print load_fiche_titre($title, '', $memberstatic->picto); diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index 17488f72508..51bac0047f9 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -69,7 +69,9 @@ $memberstatic = new Adherent($db); $form = new Form($db); $title = $langs->trans("SubscriptionsStatistics"); -llxHeader('', $title); +$help_url = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Mitglieder'; + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-stats'); print load_fiche_titre($title, '', $memberstatic->picto); diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 68db734ff14..8a4313e04b1 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -1,12 +1,12 @@ - * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2004-2018 Laurent Destailleur - * Copyright (C) 2012-2017 Regis Houssin - * Copyright (C) 2015-2016 Alexandre Spangaro - * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2019 Thibault FOUCART - * Copyright (C) 2023 Waël Almoman +/* Copyright (C) 2001-2004 Rodolphe Quiedeville + * Copyright (C) 2002-2003 Jean-Louis Bergamo + * Copyright (C) 2004-2018 Laurent Destailleur + * Copyright (C) 2012-2017 Regis Houssin + * Copyright (C) 2015-2024 Alexandre Spangaro + * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2019 Thibault FOUCART + * Copyright (C) 2023 Waël Almoman * * 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 @@ -441,10 +441,9 @@ $form = new Form($db); $now = dol_now(); $title = $langs->trans("Member")." - ".$langs->trans("Subscriptions"); - $help_url = "EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder"; -llxHeader("", $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-card_subscription'); $param = ''; diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index fff38874217..e01630fefd3 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -1,6 +1,7 @@ - * Copyright (C) 2018-2020 Frédéric France +/* Copyright (C) 2007-2019 Laurent Destailleur + * Copyright (C) 2018-2020 Frédéric France + * Copyright (C) 2024 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 @@ -164,8 +165,10 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('adheren $form = new Form($db); +$title = $langs->trans("SubscriptionCard"); $help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; -llxHeader('', $langs->trans("SubscriptionCard"), $help_url); + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-subscription-card'); dol_htmloutput_errors($errmsg); diff --git a/htdocs/adherents/subscription/info.php b/htdocs/adherents/subscription/info.php index 6bdf0fd6f5d..3f4cf87b990 100644 --- a/htdocs/adherents/subscription/info.php +++ b/htdocs/adherents/subscription/info.php @@ -1,6 +1,7 @@ - * Copyright (C) 2005-2006 Regis Houssin +/* Copyright (C) 2005-2011 Laurent Destailleur + * Copyright (C) 2005-2006 Regis Houssin + * Copyright (C) 2024 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 @@ -46,7 +47,10 @@ $rowid = GETPOSTINT("rowid"); $form = new Form($db); -llxHeader(); +$title = $langs->trans('Subscription')." - ".$langs->trans('Info'); +$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-subscription-card_info'); $object = new Subscription($db); $result = $object->fetch($rowid); diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 3d6488787d4..6da96055b98 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -1,7 +1,8 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2023 Laurent Destailleur +/* Copyright (C) 2001-2002 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2023 Laurent Destailleur + * Copyright (C) 2024 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 @@ -292,7 +293,7 @@ if (!empty($date_select)) { } $help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-subscription-list'); $arrayofselected = is_array($toselect) ? $toselect : array(); diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 1e750b71289..711b660a6d5 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -1,13 +1,13 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2005-2017 Regis Houssin - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2015 Alexandre Spangaro - * Copyright (C) 2019-2022 Thibault Foucart - * Copyright (C) 2020 Josep Lluís Amador - * Copyright (C) 2021 Waël Almoman +/* Copyright (C) 2001-2002 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2005-2017 Regis Houssin + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2015-2024 Alexandre Spangaro + * Copyright (C) 2019-2022 Thibault Foucart + * Copyright (C) 2020 Josep Lluís Amador + * Copyright (C) 2021 Waël Almoman * Copyright (C) 2024 MDW * Copyright (C) 2024 Frédéric France * @@ -249,9 +249,10 @@ if ($action == 'confirm_delete' && $user->hasRight('adherent', 'configurer')) { $form = new Form($db); $formproduct = new FormProduct($db); +$title = $langs->trans("MembersTypeSetup"); $help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder'; -llxHeader('', $langs->trans("MembersTypeSetup"), $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-type'); $arrayofselected = is_array($toselect) ? $toselect : array(); diff --git a/htdocs/adherents/type_ldap.php b/htdocs/adherents/type_ldap.php index 78af4a6c483..e85d39c1d36 100644 --- a/htdocs/adherents/type_ldap.php +++ b/htdocs/adherents/type_ldap.php @@ -83,7 +83,10 @@ if (empty($reshook)) { * View */ -llxHeader(); +$title = $langs->trans("MembersTypeSetup"); +$help_url = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Mitglieder'; + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-type_ldap'); $form = new Form($db); diff --git a/htdocs/adherents/type_translation.php b/htdocs/adherents/type_translation.php index b219d0ae92f..e8b20ff6afe 100644 --- a/htdocs/adherents/type_translation.php +++ b/htdocs/adherents/type_translation.php @@ -1,8 +1,9 @@ - * Copyright (C) 2007 Rodolphe Quiedeville - * Copyright (C) 2010-2012 Destailleur Laurent - * Copyright (C) 2014 Henry Florian +/* Copyright (C) 2005-2018 Regis Houssin + * Copyright (C) 2007 Rodolphe Quiedeville + * Copyright (C) 2010-2012 Destailleur Laurent + * Copyright (C) 2014 Henry Florian + * Copyright (C) 2024 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 @@ -154,10 +155,9 @@ $help_url = ''; $shortlabel = dol_trunc($object->label, 16); $title = $langs->trans('MemberType')." ".$shortlabel." - ".$langs->trans('Translation'); - $help_url = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Mitglieder'; -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-type_translation'); $form = new Form($db); $formadmin = new FormAdmin($db); diff --git a/htdocs/adherents/vcard.php b/htdocs/adherents/vcard.php index 56f82a7665d..52a112f5d91 100644 --- a/htdocs/adherents/vcard.php +++ b/htdocs/adherents/vcard.php @@ -1,9 +1,9 @@ - * Copyright (C) 2004-2010 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2020 Tobias Sekan - * Copyright (C) 2020-2021 Frédéric France +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2020 Tobias Sekan + * Copyright (C) 2020-2021 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -44,7 +44,7 @@ if ($id > 0 || !empty($ref)) { // Define variables to know what current user can do on users $canadduser = ($user->admin || $user->hasRight('user', 'user', 'creer')); - // Define variables to know what current user can do on properties of user linked to edited member + // Define variables to know what the current user can do on properties of user linked to edited member if ($object->user_id) { // $User is the user who edits, $object->user_id is the id of the related user in the edited member $caneditfielduser = ((($user->id == $object->user_id) && $user->hasRight('user', 'self', 'creer')) From 9a2db505f8932a2b42521a0db951693fbe472753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 6 Jul 2024 14:34:22 +0200 Subject: [PATCH 20/66] update ecmfile on product update (#30299) * update ecmfile on product update * update ecm * update ecm * update ecm --- htdocs/ecm/class/ecmfiles.class.php | 23 +++++++++++++++++++++-- htdocs/product/class/product.class.php | 9 +++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index f4ef3990726..a68e8a5273d 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2018 Francis Appels * Copyright (C) 2019-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024 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 @@ -884,6 +884,25 @@ class EcmFiles extends CommonObject } } + /** + * updateAfterRename update entries in ecmfiles if exist to avoid losing info + * + * @param string $olddir old directory + * @param string $newdir new directory + * @return void + */ + public function updateAfterRename($olddir, $newdir) + { + $sql = 'UPDATE '.MAIN_DB_PREFIX.'ecm_files SET'; + $sql .= ' filepath = "'.$this->db->escape($newdir).'"'; + //$sql .= ', fullpath_orig = "'.$dbs->escape($newdir)."'"; + $sql .= ' WHERE '; + $sql .= ' filepath = "'.$this->db->escape($olddir).'"'; + // $sql .= ' AND fullpath_orig = "'.$dbs->escape($olddir).'"'; + + $this->db->query($sql); + } + /** * Return a link to the object card (with optionally the picto) * @@ -906,7 +925,7 @@ class EcmFiles extends CommonObject $result = ''; - $label = ''.$langs->trans("MyModule").''; + $label = ''.$langs->trans("File").''; $label .= '
'; $label .= ''.$langs->trans('Ref').': '.$this->ref; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 7f756c5566c..f2e0b6915fc 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1446,14 +1446,19 @@ class Product extends CommonObject $olddir = $conf->product->dir_output."/".dol_sanitizeFileName($this->oldcopy->ref); $newdir = $conf->product->dir_output."/".dol_sanitizeFileName($this->ref); if (file_exists($olddir)) { - //include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; - //$res = dol_move($olddir, $newdir); + // include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; + // $res = dol_move($olddir, $newdir); // do not use dol_move with directory $res = @rename($olddir, $newdir); if (!$res) { $langs->load("errors"); $this->error = $langs->trans('ErrorFailToRenameDir', $olddir, $newdir); $error++; + } else { + // to keep old entries with the new dir + require_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php'; + $ecmfiles = new EcmFiles($this->db); + $ecmfiles->updateAfterRename("produit/".dol_sanitizeFileName($this->oldcopy->ref), "produit/".dol_sanitizeFileName($this->ref)); } } } From d2907b68c0be243d84f5de7dbd51a10e059f682f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Champlon?= <85104766+Kazimir42@users.noreply.github.com> Date: Sat, 6 Jul 2024 15:04:11 +0200 Subject: [PATCH 21/66] NEW : Add pagination data to some api routes (#29895) * Add pagination date * Spaces to tabs * fix --- .../comm/propal/class/api_proposals.class.php | 25 +++++++++++++++-- htdocs/commande/class/api_orders.class.php | 24 ++++++++++++++++- .../facture/class/api_invoices.class.php | 25 +++++++++++++++-- .../expedition/class/api_shipments.class.php | 23 +++++++++++++++- .../class/api_supplier_invoices.class.php | 23 +++++++++++++++- .../fourn/class/api_supplier_orders.class.php | 23 +++++++++++++++- .../reception/class/api_receptions.class.php | 25 +++++++++++++++-- .../societe/class/api_thirdparties.class.php | 27 ++++++++++++++++--- .../class/api_supplier_proposals.class.php | 23 +++++++++++++++- 9 files changed, 204 insertions(+), 14 deletions(-) diff --git a/htdocs/comm/propal/class/api_proposals.class.php b/htdocs/comm/propal/class/api_proposals.class.php index 2749800b0dd..9497526b4aa 100644 --- a/htdocs/comm/propal/class/api_proposals.class.php +++ b/htdocs/comm/propal/class/api_proposals.class.php @@ -157,10 +157,11 @@ class Proposals extends DolibarrApi * @param int $page Page number * @param string $thirdparty_ids Thirdparty ids to filter commercial proposals (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i} * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.datec:<:'2016-01-01')" - * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* * @return array Array of order objects */ - public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $properties = '') + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $properties = '', $pagination_data = false) { if (!DolibarrApiAccess::$user->hasRight('propal', 'lire')) { throw new RestException(403); @@ -201,6 +202,9 @@ class Proposals extends DolibarrApi } } + //this query will return total proposals with the filters given + $sqlTotals = str_replace('SELECT t.rowid', 'SELECT count(t.rowid) as total', $sql); + $sql .= $this->db->order($sortfield, $sortorder); if ($limit) { if ($page < 0) { @@ -235,6 +239,23 @@ class Proposals extends DolibarrApi throw new RestException(503, 'Error when retrieve propal list : '.$this->db->lasterror()); } + //if $pagination_data is true the response will contain element data with all values and element pagination with pagination data(total,page,limit) + if ($pagination_data) { + $totalsResult = $this->db->query($sqlTotals); + $total = $this->db->fetch_object($totalsResult)->total; + + $tmp = $obj_ret; + $obj_ret = []; + + $obj_ret['data'] = $tmp; + $obj_ret['pagination'] = [ + 'total' => (int) $total, + 'page' => $page, //count starts from 0 + 'page_count' => ceil((int) $total / $limit), + 'limit' => $limit + ]; + } + return $obj_ret; } diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index fdf2d48735c..9474ede15d9 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -158,12 +158,13 @@ class Orders extends DolibarrApi * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" * @param string $sqlfilterlines Other criteria to filter answers separated by a comma. Syntax example "(tl.fk_product:=:'17') and (tl.price:<:'250')" * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* * @return array Array of order objects * * @throws RestException 404 Not found * @throws RestException 503 Error */ - public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $sqlfilterlines = '', $properties = '') + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $sqlfilterlines = '', $properties = '', $pagination_data = false) { if (!DolibarrApiAccess::$user->hasRight('commande', 'lire')) { throw new RestException(403); @@ -213,6 +214,10 @@ class Orders extends DolibarrApi throw new RestException(400, 'Error when validating parameter sqlfilterlines -> '.$errormessage); } } + + //this query will return total orders with the filters given + $sqlTotals = str_replace('SELECT t.rowid', 'SELECT count(t.rowid) as total', $sql); + $sql .= $this->db->order($sortfield, $sortorder); if ($limit) { if ($page < 0) { @@ -251,6 +256,23 @@ class Orders extends DolibarrApi throw new RestException(503, 'Error when retrieve commande list : '.$this->db->lasterror()); } + //if $pagination_data is true the response will contain element data with all values and element pagination with pagination data(total,page,limit) + if ($pagination_data) { + $totalsResult = $this->db->query($sqlTotals); + $total = $this->db->fetch_object($totalsResult)->total; + + $tmp = $obj_ret; + $obj_ret = []; + + $obj_ret['data'] = $tmp; + $obj_ret['pagination'] = [ + 'total' => (int) $total, + 'page' => $page, //count starts from 0 + 'page_count' => ceil((int) $total / $limit), + 'limit' => $limit + ]; + } + return $obj_ret; } diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 07abf2c4c33..a7197f3c0d4 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -178,13 +178,14 @@ class Invoices extends DolibarrApi * @param string $thirdparty_ids Thirdparty ids to filter orders of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i} * @param string $status Filter by invoice status : draft | unpaid | paid | cancelled * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" - * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0 * @return array Array of invoice objects * * @throws RestException 404 Not found * @throws RestException 503 Error */ - public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $status = '', $sqlfilters = '', $properties = '') + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $status = '', $sqlfilters = '', $properties = '', $pagination_data = false) { if (!DolibarrApiAccess::$user->hasRight('facture', 'lire')) { throw new RestException(403); @@ -238,6 +239,9 @@ class Invoices extends DolibarrApi } } + //this query will return total invoices with the filters given + $sqlTotals = str_replace('SELECT t.rowid', 'SELECT count(t.rowid) as total', $sql); + $sql .= $this->db->order($sortfield, $sortorder); if ($limit) { if ($page < 0) { @@ -280,6 +284,23 @@ class Invoices extends DolibarrApi throw new RestException(503, 'Error when retrieve invoice list : '.$this->db->lasterror()); } + //if $pagination_data is true the response will contain element data with all values and element pagination with pagination data(total,page,limit) + if ($pagination_data) { + $totalsResult = $this->db->query($sqlTotals); + $total = $this->db->fetch_object($totalsResult)->total; + + $tmp = $obj_ret; + $obj_ret = []; + + $obj_ret['data'] = $tmp; + $obj_ret['pagination'] = [ + 'total' => (int) $total, + 'page' => $page, //count starts from 0 + 'page_count' => ceil((int) $total / $limit), + 'limit' => $limit + ]; + } + return $obj_ret; } diff --git a/htdocs/expedition/class/api_shipments.class.php b/htdocs/expedition/class/api_shipments.class.php index ce3d4c53096..51b3aa550b8 100644 --- a/htdocs/expedition/class/api_shipments.class.php +++ b/htdocs/expedition/class/api_shipments.class.php @@ -95,11 +95,12 @@ class Shipments extends DolibarrApi * @param string $thirdparty_ids Thirdparty ids to filter shipments of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i} * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* * @return array Array of shipment objects * * @throws RestException */ - public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $properties = '') + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $properties = '', $pagination_data = false) { if (!DolibarrApiAccess::$user->hasRight('expedition', 'lire')) { throw new RestException(403); @@ -140,6 +141,9 @@ class Shipments extends DolibarrApi } } + //this query will return total shipments with the filters given + $sqlTotals = str_replace('SELECT t.rowid', 'SELECT count(t.rowid) as total', $sql); + $sql .= $this->db->order($sortfield, $sortorder); if ($limit) { if ($page < 0) { @@ -169,6 +173,23 @@ class Shipments extends DolibarrApi throw new RestException(503, 'Error when retrieve commande list : '.$this->db->lasterror()); } + //if $pagination_data is true the response will contain element data with all values and element pagination with pagination data(total,page,limit) + if ($pagination_data) { + $totalsResult = $this->db->query($sqlTotals); + $total = $this->db->fetch_object($totalsResult)->total; + + $tmp = $obj_ret; + $obj_ret = []; + + $obj_ret['data'] = $tmp; + $obj_ret['pagination'] = [ + 'total' => (int) $total, + 'page' => $page, //count starts from 0 + 'page_count' => ceil((int) $total / $limit), + 'limit' => $limit + ]; + } + return $obj_ret; } diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php index 13626a9e72e..730e4c07c6d 100644 --- a/htdocs/fourn/class/api_supplier_invoices.class.php +++ b/htdocs/fourn/class/api_supplier_invoices.class.php @@ -98,11 +98,12 @@ class SupplierInvoices extends DolibarrApi * @param string $status Filter by invoice status : draft | unpaid | paid | cancelled * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.datec:<:'20160101')" * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* * @return array Array of invoice objects * * @throws RestException */ - public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $status = '', $sqlfilters = '', $properties = '') + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $status = '', $sqlfilters = '', $properties = '', $pagination_data = false) { if (!DolibarrApiAccess::$user->hasRight("fournisseur", "facture", "lire")) { throw new RestException(403); @@ -156,6 +157,9 @@ class SupplierInvoices extends DolibarrApi } } + //this query will return total supplier invoices with the filters given + $sqlTotals = str_replace('SELECT t.rowid', 'SELECT count(t.rowid) as total', $sql); + $sql .= $this->db->order($sortfield, $sortorder); if ($limit) { if ($page < 0) { @@ -183,6 +187,23 @@ class SupplierInvoices extends DolibarrApi throw new RestException(503, 'Error when retrieve supplier invoice list : ' . $this->db->lasterror()); } + //if $pagination_data is true the response will contain element data with all values and element pagination with pagination data(total,page,limit) + if ($pagination_data) { + $totalsResult = $this->db->query($sqlTotals); + $total = $this->db->fetch_object($totalsResult)->total; + + $tmp = $obj_ret; + $obj_ret = []; + + $obj_ret['data'] = $tmp; + $obj_ret['pagination'] = [ + 'total' => (int) $total, + 'page' => $page, //count starts from 0 + 'page_count' => ceil((int) $total / $limit), + 'limit' => $limit + ]; + } + return $obj_ret; } diff --git a/htdocs/fourn/class/api_supplier_orders.class.php b/htdocs/fourn/class/api_supplier_orders.class.php index a770f53a39e..a8a42ce1457 100644 --- a/htdocs/fourn/class/api_supplier_orders.class.php +++ b/htdocs/fourn/class/api_supplier_orders.class.php @@ -95,11 +95,12 @@ class SupplierOrders extends DolibarrApi * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.datec:<:'20160101')" * @param string $sqlfilterlines Other criteria to filter answers separated by a comma. Syntax example "(tl.fk_product:=:'17') and (tl.price:<:'250')" * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* * @return array Array of order objects * * @throws RestException */ - public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $product_ids = '', $status = '', $sqlfilters = '', $sqlfilterlines = '', $properties = '') + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $product_ids = '', $status = '', $sqlfilters = '', $sqlfilterlines = '', $properties = '', $pagination_data = false) { if (!DolibarrApiAccess::$user->hasRight("fournisseur", "commande", "lire")) { throw new RestException(403); @@ -181,6 +182,9 @@ class SupplierOrders extends DolibarrApi } } + //this query will return total supplier orders with the filters given + $sqlTotals = str_replace('SELECT t.rowid', 'SELECT count(t.rowid) as total', $sql); + $sql .= $this->db->order($sortfield, $sortorder); if ($limit) { if ($page < 0) { @@ -208,6 +212,23 @@ class SupplierOrders extends DolibarrApi throw new RestException(503, 'Error when retrieve supplier order list : '.$this->db->lasterror()); } + //if $pagination_data is true the response will contain element data with all values and element pagination with pagination data(total,page,limit) + if ($pagination_data) { + $totalsResult = $this->db->query($sqlTotals); + $total = $this->db->fetch_object($totalsResult)->total; + + $tmp = $obj_ret; + $obj_ret = []; + + $obj_ret['data'] = $tmp; + $obj_ret['pagination'] = [ + 'total' => (int) $total, + 'page' => $page, //count starts from 0 + 'page_count' => ceil((int) $total / $limit), + 'limit' => $limit + ]; + } + return $obj_ret; } diff --git a/htdocs/reception/class/api_receptions.class.php b/htdocs/reception/class/api_receptions.class.php index 9718cfe95a5..d4f8e94e3f4 100644 --- a/htdocs/reception/class/api_receptions.class.php +++ b/htdocs/reception/class/api_receptions.class.php @@ -94,12 +94,13 @@ class Receptions extends DolibarrApi * @param int $page Page number * @param string $thirdparty_ids Thirdparty ids to filter receptions of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i} * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" - * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* * @return array Array of reception objects * * @throws RestException */ - public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $properties = '') + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $properties = '', $pagination_data = false) { if (!DolibarrApiAccess::$user->hasRight('reception', 'lire')) { throw new RestException(403); @@ -140,6 +141,9 @@ class Receptions extends DolibarrApi } } + //this query will return total receptions with the filters given + $sqlTotals = str_replace('SELECT t.rowid', 'SELECT count(t.rowid) as total', $sql); + $sql .= $this->db->order($sortfield, $sortorder); if ($limit) { if ($page < 0) { @@ -169,6 +173,23 @@ class Receptions extends DolibarrApi throw new RestException(503, 'Error when retrieve commande list : '.$this->db->lasterror()); } + //if $pagination_data is true the response will contain element data with all values and element pagination with pagination data(total,page,limit) + if ($pagination_data) { + $totalsResult = $this->db->query($sqlTotals); + $total = $this->db->fetch_object($totalsResult)->total; + + $tmp = $obj_ret; + $obj_ret = []; + + $obj_ret['data'] = $tmp; + $obj_ret['pagination'] = [ + 'total' => (int) $total, + 'page' => $page, //count starts from 0 + 'page_count' => ceil((int) $total / $limit), + 'limit' => $limit + ]; + } + return $obj_ret; } diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 9ca96190901..6fcd0af3d6e 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -130,10 +130,11 @@ class Thirdparties extends DolibarrApi * Set to 4 to show only suppliers * @param int $category Use this param to filter list by category * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "((t.nom:like:'TheCompany%') or (t.name_alias:like:'TheCompany%')) and (t.datec:<:'20160101')" - * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* * @return array Array of thirdparty objects */ - public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $mode = 0, $category = 0, $sqlfilters = '', $properties = '') + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $mode = 0, $category = 0, $sqlfilters = '', $properties = '', $pagination_data = false) { $obj_ret = array(); @@ -203,8 +204,10 @@ class Thirdparties extends DolibarrApi } } - $sql .= $this->db->order($sortfield, $sortorder); + //this query will return total thirdparties with the filters given + $sqlTotals = str_replace('SELECT t.rowid', 'SELECT count(t.rowid) as total', $sql); + $sql .= $this->db->order($sortfield, $sortorder); if ($limit) { if ($page < 0) { $page = 0; @@ -236,6 +239,24 @@ class Thirdparties extends DolibarrApi if (!count($obj_ret)) { throw new RestException(404, 'Thirdparties not found'); } + + //if $pagination_data is true the response will contain element data with all values and element pagination with pagination data(total,page,limit) + if ($pagination_data) { + $totalsResult = $this->db->query($sqlTotals); + $total = $this->db->fetch_object($totalsResult)->total; + + $tmp = $obj_ret; + $obj_ret = []; + + $obj_ret['data'] = $tmp; + $obj_ret['pagination'] = [ + 'total' => (int) $total, + 'page' => $page, //count starts from 0 + 'page_count' => ceil((int) $total / $limit), + 'limit' => $limit + ]; + } + return $obj_ret; } diff --git a/htdocs/supplier_proposal/class/api_supplier_proposals.class.php b/htdocs/supplier_proposal/class/api_supplier_proposals.class.php index 70c7f1068fe..f5aa912e1f1 100644 --- a/htdocs/supplier_proposal/class/api_supplier_proposals.class.php +++ b/htdocs/supplier_proposal/class/api_supplier_proposals.class.php @@ -217,9 +217,10 @@ class SupplierProposals extends DolibarrApi * @param string $thirdparty_ids Thirdparty ids to filter supplier proposals (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i} * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.datec:<:'20160101')" * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names + * @param bool $pagination_data If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0* * @return array Array of order objects */ - public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $properties = '') + public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $properties = '', $pagination_data = false) { if (!DolibarrApiAccess::$user->hasRight('supplier_proposal', 'lire')) { throw new RestException(403); @@ -260,6 +261,9 @@ class SupplierProposals extends DolibarrApi } } + //this query will return total supplier proposals with the filters given + $sqlTotals = str_replace('SELECT t.rowid', 'SELECT count(t.rowid) as total', $sql); + $sql .= $this->db->order($sortfield, $sortorder); if ($limit) { if ($page < 0) { @@ -288,6 +292,23 @@ class SupplierProposals extends DolibarrApi throw new RestException(503, 'Error when retrieving supplier proposal list : '.$this->db->lasterror()); } + //if $pagination_data is true the response will contain element data with all values and element pagination with pagination data(total,page,limit) + if ($pagination_data) { + $totalsResult = $this->db->query($sqlTotals); + $total = $this->db->fetch_object($totalsResult)->total; + + $tmp = $obj_ret; + $obj_ret = []; + + $obj_ret['data'] = $tmp; + $obj_ret['pagination'] = [ + 'total' => (int) $total, + 'page' => $page, //count starts from 0 + 'page_count' => ceil((int) $total / $limit), + 'limit' => $limit + ]; + } + return $obj_ret; } From c4d7ffd01bcf4a2e20e565ff4d05ceeb396c9341 Mon Sep 17 00:00:00 2001 From: atm-lena <52402938+atm-lena@users.noreply.github.com> Date: Sat, 6 Jul 2024 15:07:38 +0200 Subject: [PATCH 22/66] New main only login allowed serveral logins (#29877) * Adding possibility to write several logins in MAIN_ONLY_LOGIN_ALLOWED * Clean * Clean --------- Co-authored-by: atm-lena --- htdocs/main.inc.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 28ed1ff4848..43a43a63e9c 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -444,23 +444,23 @@ if (getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')) { $ok = 0; if ((!session_id() || !isset($_SESSION["dol_login"])) && !isset($_POST["username"]) && !empty($_SERVER["GATEWAY_INTERFACE"])) { $ok = 1; // We let working pages if not logged and inside a web browser (login form, to allow login by admin) - } elseif (isset($_POST["username"]) && $_POST["username"] == $conf->global->MAIN_ONLY_LOGIN_ALLOWED) { + } elseif (isset($_POST["username"]) && in_array($_POST["username"], explode(';', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')))) { $ok = 1; // We let working pages that is a login submission (login submit, to allow login by admin) } elseif (defined('NOREQUIREDB')) { $ok = 1; // We let working pages that don't need database access (xxx.css.php) } elseif (defined('EVEN_IF_ONLY_LOGIN_ALLOWED')) { $ok = 1; // We let working pages that ask to work even if only login enabled (logout.php) - } elseif (session_id() && isset($_SESSION["dol_login"]) && $_SESSION["dol_login"] == $conf->global->MAIN_ONLY_LOGIN_ALLOWED) { + } elseif (session_id() && isset($_SESSION["dol_login"]) && in_array($_SESSION["dol_login"], explode(';', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')))) { $ok = 1; // We let working if user is allowed admin } if (!$ok) { - if (session_id() && isset($_SESSION["dol_login"]) && $_SESSION["dol_login"] != $conf->global->MAIN_ONLY_LOGIN_ALLOWED) { + if (session_id() && isset($_SESSION["dol_login"]) && !in_array($_SESSION["dol_login"], explode(';', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')))) { print 'Sorry, your application is offline.'."\n"; - print 'You are logged with user "'.$_SESSION["dol_login"].'" and only administrator user "' . getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED').'" is allowed to connect for the moment.'."\n"; + print 'You are logged with user "'.$_SESSION["dol_login"].'" and only administrator users (' . str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n"; $nexturl = DOL_URL_ROOT.'/user/logout.php?token='.newToken(); print 'Please try later or click here to disconnect and change login user...'."\n"; } else { - print 'Sorry, your application is offline. Only administrator user "' . getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED').'" is allowed to connect for the moment.'."\n"; + print 'Sorry, your application is offline. Only administrator users (' . str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n"; $nexturl = DOL_URL_ROOT.'/'; print 'Please try later or click here to change login user...'."\n"; } From 007c91e44870f92337393c5868768962e0b521f4 Mon Sep 17 00:00:00 2001 From: Bahfir Abbes Date: Sat, 6 Jul 2024 15:11:18 +0200 Subject: [PATCH 23/66] Fix:Non tag special chars should be escaped before calling xml_parse_into_struct (#30300) Fix:Non tag special chars should be escaped before calling xml_parse_into_struct --- htdocs/core/class/dolreceiptprinter.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index a634d4a747f..db724f12152 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -1,7 +1,8 @@ * Copyright (C) 2020 Andreu Bisquerra - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Abbes Bahfir * * 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 @@ -698,6 +699,9 @@ class dolReceiptPrinter extends Printer return $reshook; } + // escape special characters for xml_parse_into_struct + $this->template = htmlspecialchars($this->template, ENT_QUOTES | ENT_XML1); + // parse template $this->template = str_replace("{", "<", $this->template); $this->template = str_replace("}", ">", $this->template); From cfd520e595dd4c3f6cdf4dd0ea01d725d4bdc45d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Jul 2024 15:20:05 +0200 Subject: [PATCH 24/66] Clean code --- htdocs/compta/sociales/class/chargesociales.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index a4ccb846821..1a5cbbd740d 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -577,7 +577,7 @@ class ChargeSociales extends CommonObject */ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $short = 0, $save_lastsearch_value = -1) { - global $langs, $conf, $user, $form, $hookmanager; + global $langs, $conf, $user, $hookmanager; if (!empty($conf->dol_no_mouse_hover)) { $notooltip = 1; // Force disable tooltips @@ -645,6 +645,7 @@ class ChargeSociales extends CommonObject $result .= $this->ref; } $result .= $linkend; + global $action; $hookmanager->initHooks(array($this->element . 'dao')); $parameters = array('id' => $this->id, 'getnomurl' => &$result); @@ -654,6 +655,7 @@ class ChargeSociales extends CommonObject } else { $result .= $hookmanager->resPrint; } + return $result; } From 04a1b6b1f516eac89e350bc94fc65ef2b004b827 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Jul 2024 15:31:12 +0200 Subject: [PATCH 25/66] Close #24842 --- htdocs/install/mysql/migration/20.0.0-21.0.0.sql | 2 ++ htdocs/install/mysql/tables/llx_propal.sql | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/20.0.0-21.0.0.sql b/htdocs/install/mysql/migration/20.0.0-21.0.0.sql index fc0a2a5725a..f4a76d066bd 100644 --- a/htdocs/install/mysql/migration/20.0.0-21.0.0.sql +++ b/htdocs/install/mysql/migration/20.0.0-21.0.0.sql @@ -62,3 +62,5 @@ ALTER TABLE llx_contrat ADD COLUMN total_ht double(24,8) DEFAULT 0; ALTER TABLE llx_contrat ADD COLUMN total_ttc double(24,8) DEFAULT 0; ALTER TABLE llx_expedition_package MODIFY COLUMN dangerous_goods varchar(60) DEFAULT '0'; + +ALTER TABLE llx_propal ADD COLUMN model_pdf_pos_sign VARCHAR(32) DEFAULT NULL AFTER model_pdf; diff --git a/htdocs/install/mysql/tables/llx_propal.sql b/htdocs/install/mysql/tables/llx_propal.sql index 63b8103b339..6c2efd85ab0 100644 --- a/htdocs/install/mysql/tables/llx_propal.sql +++ b/htdocs/install/mysql/tables/llx_propal.sql @@ -66,8 +66,9 @@ create table llx_propal note_private text, note_public text, - model_pdf varchar(255), -- last template used to generate main document - last_main_doc varchar(255), -- relative filepath+filename of last main generated document + model_pdf varchar(255), -- last template used to generate main document (exemple: azur, generic_invoice_odt:/pathto/template_invoice.odt) + model_pdf_pos_sign varchar(32), -- last position used to include the signature (example: posX:posY:Height:Width) + last_main_doc varchar(255), -- relative filepath+filename of the last main generated document date_livraison date DEFAULT NULL, -- delivery date fk_shipping_method integer, -- shipping method id From 73d9c4a12ecb90de0208bfab136535dfbf6332f9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Jul 2024 16:27:23 +0200 Subject: [PATCH 26/66] Debug v20 --- htdocs/webhook/class/target.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/webhook/class/target.class.php b/htdocs/webhook/class/target.class.php index cb860fab1a6..5a6e94a943c 100644 --- a/htdocs/webhook/class/target.class.php +++ b/htdocs/webhook/class/target.class.php @@ -457,6 +457,9 @@ class Target extends CommonObject */ public function update(User $user, $notrigger = 0) { + // Clean trigger_codes + $this->trigger_codes = preg_replace('/[\r\n\s]/', '', $this->trigger_codes); + return $this->updateCommon($user, $notrigger); } From 829fe1dcc066ef895d6a3057fe4a79b1ef85fec3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Jul 2024 16:29:43 +0200 Subject: [PATCH 27/66] Debug v20 --- htdocs/webhook/target_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/webhook/target_list.php b/htdocs/webhook/target_list.php index 63591826abc..7fd775805b6 100644 --- a/htdocs/webhook/target_list.php +++ b/htdocs/webhook/target_list.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/webhook/class/target.class.php'; global $conf, $db, $hookmanager, $langs, $user; // Load translation files required by the page -$langs->loadLangs(array('other')); +$langs->loadLangs(array('other', 'admin')); // Get Parameters $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... From 6a3f044ba21c9ff441f5a26d1f552784df1ae701 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Jul 2024 17:41:00 +0200 Subject: [PATCH 28/66] Clean code --- htdocs/core/lib/files.lib.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 59d239032cd..8b8f5816c66 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1468,12 +1468,9 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable */ function dol_delete_file($file, $disableglob = 0, $nophperrors = 0, $nohook = 0, $object = null, $allowdotdot = false, $indexdatabase = 1, $nolog = 0) { - global $db, $user, $langs; + global $db, $user; global $hookmanager; - // Load translation files required by the page - $langs->loadLangs(array('other', 'errors')); - if (empty($nolog)) { dol_syslog("dol_delete_file file=".$file." disableglob=".$disableglob." nophperrors=".$nophperrors." nohook=".$nohook); } From 11491bb067581a4c62765e8246edae200a7269e1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Jul 2024 17:44:20 +0200 Subject: [PATCH 29/66] Fix error code --- build/generate_filelist_xml.php | 12 ++++++------ htdocs/filefunc.inc.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index d86b652ccb6..66eaa00e345 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -51,7 +51,7 @@ $buildzip = 0; if (empty($argv[1])) { print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value] [buildzip=1]\n"; print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n"; - exit -1; + exit(1); } @@ -87,7 +87,7 @@ while ($i < $argc) { if (empty($release)) { print "Error: Missing release parameter\n"; print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; - exit -1; + exit(2); } $savrelease = $release; @@ -107,21 +107,21 @@ if (empty($includecustom)) { if (DOL_VERSION != $tmpverbis[0] && $savrelease != 'auto') { print 'Error: When parameter "includecustom" is not set and there is no suffix in release parameter, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$tmpverbis[0].')'."\n"; print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; - exit -1; + exit(3); } } else { $tmpverter = explode('-', DOL_VERSION, 2); if ($tmpverter[0] != $tmpverbis[0]) { print 'Error: When parameter "includecustom" is not set, version declared into filefunc.in.php ('.DOL_VERSION.') must have value without prefix ('.$tmpverter[0].') that is exact same value than "release" parameter ('.$tmpverbis[0].')'."\n"; print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; - exit -1; + exit(4); } } } else { if (!preg_match('/'.preg_quote(DOL_VERSION, '/').'-/', $release)) { print 'Error: When parameter "includecustom" is set, version declared into filefunc.inc.php ('.DOL_VERSION.') must be used with a suffix into "release" parameter (ex: '.DOL_VERSION.'-mydistrib).'."\n"; print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; - exit -1; + exit(5); } } @@ -147,7 +147,7 @@ $outputfile = $outputdir.'/filelist-'.$release.'.xml'; $fp = fopen($outputfile, 'w'); if (empty($fp)) { print 'Failed to open file '.$outputfile."\n"; - exit(-1); + exit(6); } fputs($fp, ''."\n"); diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 8863c06386b..98515c56dc5 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -207,7 +207,7 @@ define('DOL_DOCUMENT_ROOT', $dolibarr_main_document_root); // Filesystem core ph if (!file_exists(DOL_DOCUMENT_ROOT."/core/lib/functions.lib.php")) { print "Error: Dolibarr config file content seems to be not correctly defined.
\n"; print "Please run dolibarr setup by calling page /install.
\n"; - exit; + exit(1); } From 4e9367e4634f469faec3cc321b835634accb97be Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Jul 2024 17:53:24 +0200 Subject: [PATCH 30/66] Fix error code --- build/generate_filelist_xml.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index 66eaa00e345..e08db3c0ccb 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -33,7 +33,7 @@ $path = dirname(__FILE__).'/'; // Test if batch mode if (substr($sapi_type, 0, 3) == 'cgi') { echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n"; - exit; + exit(1); } require_once $path."../htdocs/master.inc.php"; From 4e8e0b82deb6754f44a7f2419f5256c12e567625 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Jul 2024 13:31:36 +0200 Subject: [PATCH 31/66] Debug v20 --- htdocs/societe/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index ab5bf5d89c5..81abbdf02d9 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1383,7 +1383,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio if (getDolGlobalString('THIRDPARTY_SUPPLIER_BY_DEFAULT')) { $default = 1; } - print $form->selectyesno("fournisseur", (GETPOSTINT('fournisseur') != '' ? GETPOSTINT('fournisseur') : (GETPOSTINT("type") == '' ? $default : $object->fournisseur)), 1, 0, (GETPOSTINT("type") == '' ? 1 : 0), 1); + print $form->selectyesno("fournisseur", (GETPOSTINT('fournisseur') != '' ? GETPOSTINT('fournisseur') : (GETPOST("type") == '' ? $default : $object->fournisseur)), 1, 0, (GETPOST("type") == '' ? 1 : 0), 1); print ''; From 1ca30d8096168404d620d92167b105962ef02dae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Jul 2024 14:18:18 +0200 Subject: [PATCH 32/66] Better position of choice open/closed --- htdocs/societe/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 16772f72f19..b5259861a75 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1453,7 +1453,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio // Status print ''.$form->editfieldkey('Status', 'status', '', $object, 0).''; - print $form->selectarray('status', array('0' => $langs->trans('ActivityCeased'), '1' => $langs->trans('InActivity')), 1, 0, 0, 0, '', 0, 0, 0, '', 'minwidth100', 1); + print $form->selectarray('status', array('1' => $langs->trans('InActivity'), '0' => $langs->trans('ActivityCeased')), 1, 0, 0, 0, '', 0, 0, 0, '', 'minwidth100', 1); print ''; // Barcode From d78158f39d2e8e2e0240cfa947098215df25cd5a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Jul 2024 16:51:15 +0200 Subject: [PATCH 33/66] Typo --- htdocs/core/lib/xcal.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/xcal.lib.php b/htdocs/core/lib/xcal.lib.php index 5101f70959a..9986ccca60a 100644 --- a/htdocs/core/lib/xcal.lib.php +++ b/htdocs/core/lib/xcal.lib.php @@ -415,7 +415,7 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt $image = $event["image"]; } else { $reg = array(); - // IF we found a link like ... Date: Mon, 8 Jul 2024 21:45:35 +0200 Subject: [PATCH 34/66] fix phpstan (#30319) * fix phpstan * fix phpstan expects int, false given ... * fix phpstan expects int, true given ... --- dev/tools/codespell/codespell-lines-ignore.txt | 2 +- htdocs/accountancy/admin/accountmodel.php | 2 +- htdocs/accountancy/admin/categories_list.php | 2 +- htdocs/accountancy/admin/journals_list.php | 3 ++- htdocs/accountancy/class/accountancyexport.class.php | 8 ++++---- htdocs/admin/mails_templates.php | 4 ++-- htdocs/core/actions_massactions.inc.php | 4 ++-- htdocs/core/class/commonobject.class.php | 4 ++-- htdocs/core/class/html.form.class.php | 4 ++-- .../modules/asset/doc/pdf_standard_asset.modules.php | 2 +- .../core/modules/commande/doc/pdf_einstein.modules.php | 2 +- .../modules/commande/doc/pdf_eratosthene.modules.php | 2 +- htdocs/core/modules/contract/doc/pdf_strato.modules.php | 4 ++-- htdocs/core/modules/delivery/doc/pdf_storm.modules.php | 2 +- htdocs/core/modules/delivery/doc/pdf_typhon.modules.php | 2 +- .../core/modules/expedition/doc/pdf_espadon.modules.php | 2 +- htdocs/core/modules/expedition/doc/pdf_merou.modules.php | 2 +- .../core/modules/expedition/doc/pdf_rouget.modules.php | 2 +- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 4 ++-- htdocs/core/modules/facture/doc/pdf_octopus.modules.php | 4 ++-- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 4 ++-- htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php | 2 +- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 2 +- .../core/modules/reception/doc/pdf_squille.modules.php | 2 +- .../core/modules/societe/doc/doc_generic_odt.modules.php | 2 +- .../core/modules/stocktransfer/doc/pdf_eagle.modules.php | 2 +- .../stocktransfer/doc/pdf_eagle_proforma.modules.php | 2 +- .../modules/supplier_invoice/doc/pdf_canelle.modules.php | 2 +- .../modules/supplier_order/doc/pdf_cornas.modules.php | 2 +- .../modules/supplier_order/doc/pdf_muscadet.modules.php | 2 +- .../modules/supplier_proposal/doc/pdf_aurore.modules.php | 2 +- .../modules/supplier_proposal/doc/pdf_zenith.modules.php | 2 +- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- htdocs/fourn/class/fournisseur.facture.class.php | 4 ++-- htdocs/install/repair.php | 4 ++-- htdocs/install/upgrade2.php | 3 ++- .../mymodule/doc/pdf_standard_myobject.modules.php | 2 +- htdocs/product/class/product.class.php | 4 ++-- htdocs/product/inventory/inventory.php | 3 ++- htdocs/product/stock/movement_list.php | 2 +- htdocs/public/eventorganization/attendee_new.php | 3 ++- htdocs/public/payment/paymentko.php | 3 ++- htdocs/public/payment/paymentok.php | 9 +++++---- htdocs/public/project/suggestbooth.php | 3 ++- htdocs/public/project/suggestconference.php | 3 ++- phpstan.neon.dist | 3 --- 47 files changed, 71 insertions(+), 66 deletions(-) diff --git a/dev/tools/codespell/codespell-lines-ignore.txt b/dev/tools/codespell/codespell-lines-ignore.txt index 9029f7b0162..c04c6d0446d 100644 --- a/dev/tools/codespell/codespell-lines-ignore.txt +++ b/dev/tools/codespell/codespell-lines-ignore.txt @@ -58,7 +58,7 @@ $this->datee = $this->db->jdate($obj->datee); $this->periode = $this->db->jdate($obj->period); $tmp = array('id_users' => $obj->id_users, 'nom' => $obj->name, 'reponses' => $obj->reponses); - $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.od(s|t)$', '', 'name', SORT_ASC, 0, true); // Disable hook for the moment + $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.od(s|t)$', '', 'name', SORT_ASC, 0, 1); // Disable hook for the moment //si les reponses ne concerne pas la colonne effacée, on concatenate GETPOST("mouvement", 'alpha'), GETPOSTINT("mouvement"), diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index 0f5b8213ab9..1d15ae5d3a3 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -492,7 +492,7 @@ if ($resql) { // There is several pages if ($num > $listlimit) { print ''; - print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), ''); + print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit ? 1 : 0), ''); print ''; } diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 3e3a85c672e..4442b88a668 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -617,7 +617,7 @@ if ($resql) { // There is several pages if ($num > $listlimit) { print ''; - print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), ''); + print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit ? 1 : 0), ''); print ''; } diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index 6b201fe8e13..ed021d04917 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -494,7 +495,7 @@ if ($id) { // There is several pages if ($num > $listlimit) { print ''; - print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), ''); + print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit ? 1 : 0), ''); print ''; } diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 40315b46433..a3318346695 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -9,7 +9,7 @@ * Copyright (C) 2022 Lionel Vessiller * Copyright (C) 2013-2017 Olivier Geffroy * Copyright (C) 2017 Elarifr. Ari Elbaz - * Copyright (C) 2017-2019 Frédéric France + * Copyright (C) 2017-2024 Frédéric France * Copyright (C) 2017 André Schild * Copyright (C) 2020 Guillaume Alexandre * Copyright (C) 2022 Joachim Kueter @@ -1025,7 +1025,7 @@ class AccountancyExport $arrayofinclusion = array(); // If it is a supplier invoice, we want to use last uploaded file $arrayofinclusion[] = '^'.preg_quote($objectFileName, '/').(($line->doc_type == 'supplier_invoice') ? '.+' : '').'\.pdf$'; - $fileFoundList = dol_dir_list($objectDirPath.'/'.$objectFileName, 'files', 0, implode('|', $arrayofinclusion), '(\.meta|_preview.*\.png)$', 'date', SORT_DESC, 0, true); + $fileFoundList = dol_dir_list($objectDirPath.'/'.$objectFileName, 'files', 0, implode('|', $arrayofinclusion), '(\.meta|_preview.*\.png)$', 'date', SORT_DESC, 0, 1); if (!empty($fileFoundList)) { $attachmentFileNameTrunc = str_pad(self::trunc($line->piece_num, 8), 8, '0', STR_PAD_LEFT); foreach ($fileFoundList as $fileFound) { @@ -1491,7 +1491,7 @@ class AccountancyExport $arrayofinclusion = array(); // If it is a supplier invoice, we want to use last uploaded file $arrayofinclusion[] = '^'.preg_quote($objectFileName, '/').(($line->doc_type == 'supplier_invoice') ? '.+' : '').'\.pdf$'; - $fileFoundList = dol_dir_list($objectDirPath.'/'.$objectFileName, 'files', 0, implode('|', $arrayofinclusion), '(\.meta|_preview.*\.png)$', 'date', SORT_DESC, 0, true); + $fileFoundList = dol_dir_list($objectDirPath.'/'.$objectFileName, 'files', 0, implode('|', $arrayofinclusion), '(\.meta|_preview.*\.png)$', 'date', SORT_DESC, 0, 1); if (!empty($fileFoundList)) { $attachmentFileNameTrunc = $line->doc_ref; foreach ($fileFoundList as $fileFound) { @@ -1703,7 +1703,7 @@ class AccountancyExport $arrayofinclusion = array(); // If it is a supplier invoice, we want to use last uploaded file $arrayofinclusion[] = '^'.preg_quote($objectFileName, '/').(($line->doc_type == 'supplier_invoice') ? '.+' : '').'\.pdf$'; - $fileFoundList = dol_dir_list($objectDirPath.'/'.$objectFileName, 'files', 0, implode('|', $arrayofinclusion), '(\.meta|_preview.*\.png)$', 'date', SORT_DESC, 0, true); + $fileFoundList = dol_dir_list($objectDirPath.'/'.$objectFileName, 'files', 0, implode('|', $arrayofinclusion), '(\.meta|_preview.*\.png)$', 'date', SORT_DESC, 0, 1); if (!empty($fileFoundList)) { $attachmentFileNameTrunc = $line->doc_ref; foreach ($fileFoundList as $fileFound) { diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index cb695dfbe74..747f1c1654f 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -11,7 +11,7 @@ * Copyright (C) 2011-2016 Alexandre Spangaro * Copyright (C) 2015-2024 Ferran Marcet * Copyright (C) 2016 Raphaël Doursenaud - * Copyright (C) 2018-2023 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * * 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 @@ -921,7 +921,7 @@ if (GETPOST('from', 'alpha')) { // There is several pages if ($num > $listlimit) { print ''; - print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), ''); + print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit ? 1 : 0), ''); print ''; } diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 16ff4c0e050..b0639ec207c 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -3,7 +3,7 @@ * Copyright (C) 2018-2021 Nicolas ZABOURI * Copyright (C) 2018 Juanjo Menent * Copyright (C) 2019 Ferran Marcet - * Copyright (C) 2019-2024 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -761,7 +761,7 @@ if (!$error && $massaction == "builddoc" && $permissiontoread && !GETPOST('butto foreach ($listofobjectref as $tmppdf) { $arrayofinclusion[] = '^'.preg_quote(dol_sanitizeFileName($tmppdf), '/').'_[a-zA-Z0-9\-\_\'\&\.]+\.pdf$'; // To include PDF generated from ODX files } - $listoffiles = dol_dir_list($uploaddir, 'all', 1, implode('|', $arrayofinclusion), '\.meta$|\.png', 'date', SORT_DESC, 0, true); + $listoffiles = dol_dir_list($uploaddir, 'all', 1, implode('|', $arrayofinclusion), '\.meta$|\.png', 'date', SORT_DESC, 0, 1); // build list of files with full path $files = array(); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index ed974be35ec..578799b7ee7 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2864,7 +2864,7 @@ abstract class CommonObject 'HT', $line->info_bits, $line->product_type, - false, + 0, $line->date_start, $line->date_end, $line->array_options, @@ -2889,7 +2889,7 @@ abstract class CommonObject $line->info_bits, $line->product_type, $line->remise_percent, - false, + 0, $line->date_start, $line->date_end, $line->array_options, diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 10184b4fcf3..cfaf357b749 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -246,7 +246,7 @@ class Form // When option to edit inline is activated if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !preg_match('/^select;|day|datepicker|dayhour|datehourpicker/', $typeofdata)) { // TODO add jquery timepicker and support select - $ret .= $this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $custommsg); + $ret .= $this->editInPlace($object, $value, $htmlname, ($perm ? 1 : 0), $typeofdata, $editvalue, $extObject, $custommsg); } else { if ($editaction == '') { $editaction = GETPOST('action', 'aZ09'); @@ -1458,7 +1458,7 @@ class Form // Immediate load of all database $multiple = false; $disableifempty = 0; - $options_only = false; + $options_only = 0; $limitto = ''; $out .= $this->selectcontacts($socid, $selected, $htmlname, $showempty, $exclude, $limitto, $showfunction, $morecss, $options_only, $showsoc, $forcecombo, $events, $moreparam, $htmlid, $multiple, $disableifempty); diff --git a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php index 90d2d60131f..0bc163732be 100644 --- a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php +++ b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php @@ -992,7 +992,7 @@ class pdf_standard_asset extends ModelePDFAsset $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); } - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, 'target', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), 'target', $object); // Show recipient $widthrecbox = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index fcbc54c7dab..dd5e21bc0fa 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1486,7 +1486,7 @@ class pdf_einstein extends ModelePDFCommandes $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); $mode = 'target'; - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), $mode, $object); // Show recipient $widthrecbox = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index ab1a9f5c9c2..27de7592c59 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -1672,7 +1672,7 @@ class pdf_eratosthene extends ModelePDFCommandes } $mode = 'target'; - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), $mode, $object); // Show recipient $widthrecbox = getDolGlobalInt('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 42eef159102..ab762c06e7c 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -6,7 +6,7 @@ * Copyright (C) 2011 Fabrice CHERRIER * Copyright (C) 2013-2024 Philippe Grand * Copyright (C) 2015 Marcos García - * Copyright (C) 2018-2020 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -749,7 +749,7 @@ class pdf_strato extends ModelePDFContract $this->recipient->name = pdfBuildThirdpartyName($thirdparty, $outputlangs); $mode = 'target'; - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (isset($object->contact) ? $object->contact : ''), $usecontact, $mode, $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (isset($object->contact) ? $object->contact : ''), ($usecontact ? 1 : 0), $mode, $object); // Show recipient $widthrecbox = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php index ec0fa3a38d1..626f7907165 100644 --- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php @@ -815,7 +815,7 @@ class pdf_storm extends ModelePDFDeliveryOrder $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, 'target', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), 'target', $object); // Show recipient $widthrecbox = 100; diff --git a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php index 5c2321a6c87..f26095e885f 100644 --- a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php @@ -823,7 +823,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, 'target', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), 'target', $object); // Show recipient $widthrecbox = 100; diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index b54e13710a9..732b92d1b9f 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -1170,7 +1170,7 @@ class pdf_espadon extends ModelePdfExpedition $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (!empty($object->contact) ? $object->contact : null), $usecontact, 'targetwithdetails', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (!empty($object->contact) ? $object->contact : null), ($usecontact ? 1 : 0), 'targetwithdetails', $object); // Show recipient $widthrecbox = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index 533847c31e2..6a842cee2e6 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -652,7 +652,7 @@ class pdf_merou extends ModelePdfExpedition $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ((!empty($object->contact)) ? $object->contact : null), $usecontact, 'targetwithdetails', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ((!empty($object->contact)) ? $object->contact : null), ($usecontact ? 1 : 0), 'targetwithdetails', $object); $blDestX = $blExpX + 55; $blW = 54; diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index c52e34f8590..05372549673 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -1103,7 +1103,7 @@ class pdf_rouget extends ModelePdfExpedition $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (!empty($object->contact) ? $object->contact : null), $usecontact, 'targetwithdetails', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (!empty($object->contact) ? $object->contact : null), ($usecontact ? 1 : 0), 'targetwithdetails', $object); // Show recipient $widthrecbox = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 8e721a632c8..b9bf1e5f7d8 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -2122,7 +2122,7 @@ class pdf_crabe extends ModelePDFFactures $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); $mode = 'target'; - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), $mode, $object); // Show recipient $widthrecbox = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; @@ -2168,7 +2168,7 @@ class pdf_crabe extends ModelePDFFactures $companystatic = new Societe($this->db); $companystatic->fetch($object->contact->fk_soc); $carac_client_name_shipping = pdfBuildThirdpartyName($object->contact, $outputlangs); - $carac_client_shipping = pdf_build_address($outputlangs, $this->emetteur, $companystatic, $object->contact, $usecontact, 'target', $object); + $carac_client_shipping = pdf_build_address($outputlangs, $this->emetteur, $companystatic, $object->contact, ($usecontact ? 1 : 0), 'target', $object); } else { $carac_client_name_shipping = pdfBuildThirdpartyName($object->thirdparty, $outputlangs); $carac_client_shipping = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'target', $object); diff --git a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php index b401581ae7d..e0d5c731479 100644 --- a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php @@ -2330,7 +2330,7 @@ class pdf_octopus extends ModelePDFFactures $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); $mode = 'target'; - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), $mode, $object); // Show recipient $widthrecbox = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; @@ -2376,7 +2376,7 @@ class pdf_octopus extends ModelePDFFactures $companystatic = new Societe($this->db); $companystatic->fetch($object->contact->fk_soc); $carac_client_name_shipping = pdfBuildThirdpartyName($object->contact, $outputlangs); - $carac_client_shipping = pdf_build_address($outputlangs, $this->emetteur, $companystatic, $object->contact, $usecontact, 'target', $object); + $carac_client_shipping = pdf_build_address($outputlangs, $this->emetteur, $companystatic, $object->contact, ($usecontact ? 1 : 0), 'target', $object); } else { $carac_client_name_shipping = pdfBuildThirdpartyName($object->thirdparty, $outputlangs); $carac_client_shipping = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'target', $object); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 0dec7f20b65..8266bed4ea3 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -2403,7 +2403,7 @@ class pdf_sponge extends ModelePDFFactures $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); $mode = 'target'; - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), $mode, $object); // Show recipient $widthrecbox = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; @@ -2449,7 +2449,7 @@ class pdf_sponge extends ModelePDFFactures $companystatic = new Societe($this->db); $companystatic->fetch($object->contact->fk_soc); $carac_client_name_shipping = pdfBuildThirdpartyName($object->contact, $outputlangs); - $carac_client_shipping = pdf_build_address($outputlangs, $this->emetteur, $companystatic, $object->contact, $usecontact, 'target', $object); + $carac_client_shipping = pdf_build_address($outputlangs, $this->emetteur, $companystatic, $object->contact, ($usecontact ? 1 : 0), 'target', $object); } else { $carac_client_name_shipping = pdfBuildThirdpartyName($object->thirdparty, $outputlangs); $carac_client_shipping = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'target', $object); diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 5a0c89480ba..6d51ddbe1ed 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -665,7 +665,7 @@ class pdf_soleil extends ModelePDFFicheinter $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (isset($object->contact) ? $object->contact : ''), $usecontact, 'target', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (isset($object->contact) ? $object->contact : ''), ($usecontact ? 1 : 0), 'target', $object); // Show recipient $widthrecbox = 100; diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index cf2677a3cd8..d69a12adad9 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1694,7 +1694,7 @@ class pdf_azur extends ModelePDFPropales $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); $mode = 'target'; - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), $mode, $object); // Show recipient $widthrecbox = 100; diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 6eae41e821c..c093e34f6ac 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1761,7 +1761,7 @@ class pdf_cyan extends ModelePDFPropales $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); $mode = 'target'; - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), $mode, $object); // Show recipient $widthrecbox = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 85c043e996b..5ad5462ad1f 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -1076,7 +1076,7 @@ class pdf_squille extends ModelePdfReception $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (!empty($object->contact) ? $object->contact : null), $usecontact, 'targetwithdetails', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (!empty($object->contact) ? $object->contact : null), ($usecontact ? 1 : 0), 'targetwithdetails', $object); // Show recipient name $pdf->SetXY($posx + 2, $posy + 3); diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index 5e9b54f03c1..5a135ea49ef 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -120,7 +120,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc if (!is_dir($tmpdir)) { $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); } else { - $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.od(s|t)$', '', 'name', SORT_ASC, 0, true); // Disable hook for the moment + $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.od(s|t)$', '', 'name', SORT_ASC, 0, 1); // Disable hook for the moment if (count($tmpfiles)) { $listoffiles = array_merge($listoffiles, $tmpfiles); } diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php index d9e12ac3085..82e331db31a 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php @@ -1220,7 +1220,7 @@ class pdf_eagle extends ModelePDFStockTransfer $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); } - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (!empty($object->contact) ? $object->contact : null), $usecontact, 'targetwithdetails', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (!empty($object->contact) ? $object->contact : null), ($usecontact ? 1 : 0), 'targetwithdetails', $object); // Show recipient $widthrecbox = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php index 20c4a8e6cef..76a2735dbfd 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -1409,7 +1409,7 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); } - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (!empty($object->contact) ? $object->contact : null), $usecontact, 'targetwithdetails', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, (!empty($object->contact) ? $object->contact : null), ($usecontact ? 1 : 0), 'targetwithdetails', $object); // Show recipient $widthrecbox = getDolGlobalString('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index 5fde92b440e..f226baf46da 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -1229,7 +1229,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $mysoc, ((!empty($object->contact)) ? $object->contact : null), $usecontact, 'target', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $mysoc, ((!empty($object->contact)) ? $object->contact : null), ($usecontact ? 1 : 0), 'target', $object); // Show recipient $widthrecbox = 100; diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index 56e90160a75..c5bbc717e1b 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -1406,7 +1406,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, 'target', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), 'target', $object); // Show recipient $widthrecbox = 100; diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index be8be8a2603..525e7e89992 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -1317,7 +1317,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, 'target', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), 'target', $object); // Show recipient $widthrecbox = 100; diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 3146afe8889..0d2515893d2 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -1375,7 +1375,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $carac_client_name = pdfBuildThirdpartyName($socname, $outputlangs); - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, 'target', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), 'target', $object); // Show recipient $widthrecbox = 100; diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php index c8180c69623..9ccca2e64dd 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php @@ -1392,7 +1392,7 @@ class pdf_zenith extends ModelePDFSupplierProposal $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, 'target', $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), 'target', $object); // Show recipient $widthrecbox = 100; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index c130bbf50bf..950c1506fa4 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1609,7 +1609,7 @@ class CommandeFournisseur extends CommonOrder 0, $line->product_type, $line->info_bits, - false, + 0, $line->date_start, $line->date_end, $line->array_options, diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 06f4076c605..d6e92cff23e 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -660,7 +660,7 @@ class FactureFournisseur extends CommonInvoice (!empty($this->lines[$i]->info_bits) ? $this->lines[$i]->info_bits : ''), $this->lines[$i]->product_type, $this->lines[$i]->remise_percent, - false, + 0, $this->lines[$i]->date_start, $this->lines[$i]->date_end, $this->lines[$i]->array_options, @@ -788,7 +788,7 @@ class FactureFournisseur extends CommonInvoice 'HT', 0, $_facrec->lines[$i]->rang, - false, + 0, $_facrec->lines[$i]->array_options, $_facrec->lines[$i]->fk_unit, 0, diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index 845127210ca..2f985e418b7 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2021 Frédéric France + * Copyright (C) 2021-2024 Frédéric France * Copyright (C) 2023 Gauthier VERDOL * Copyright (C) 2024 MDW * Copyright (C) 2024 Vincent de Grandpré @@ -845,7 +845,7 @@ if ($ok && GETPOST('clean_orphelin_dir', 'alpha')) { print '
*** Clean orphelins files into files '.$upload_dir.''; - $filearray = dol_dir_list($upload_dir, "files", 1, '', array('^SPECIMEN\.pdf$', '^\.', '(\.meta|_preview.*\.png)$', '^temp$', '^payments$', '^CVS$', '^thumbs$'), '', SORT_DESC, 1, true); + $filearray = dol_dir_list($upload_dir, "files", 1, '', array('^SPECIMEN\.pdf$', '^\.', '(\.meta|_preview.*\.png)$', '^temp$', '^payments$', '^CVS$', '^thumbs$'), '', SORT_DESC, 1, 1); // To show ref or specific information according to view to show (defined by $module) if ($modulepart == 'company') { diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 68cbd675b32..7c2dfdf52c4 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -6,6 +6,7 @@ * Copyright (C) 2015-2016 Raphaël Doursenaud * Copyright (C) 2023 Gauthier VERDOL * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -4134,7 +4135,7 @@ function migrate_delete_old_files($db, $langs, $conf) //print ''DOL_DOCUMENT_ROOT.$filetodelete."
\n"; if (file_exists(DOL_DOCUMENT_ROOT.$filetodelete) || preg_match('/\*/', $filetodelete)) { //print "Process file ".$filetodelete."\n"; - $result = dol_delete_file(DOL_DOCUMENT_ROOT.$filetodelete, 0, 0, 0, null, true, false); + $result = dol_delete_file(DOL_DOCUMENT_ROOT.$filetodelete, 0, 0, 0, null, true, 0); if (!$result) { $langs->load("errors"); print '
'.$langs->trans("Error").': '.$langs->trans("ErrorFailToDeleteFile", DOL_DOCUMENT_ROOT.$filetodelete); diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php index e9379d8a348..10c76ef57b9 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php @@ -1121,7 +1121,7 @@ class pdf_standard_myobject extends ModelePDFMyObject } $mode = 'target'; - $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), $mode, $object); // Show recipient $widthrecbox = getDolGlobalInt('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index f2e0b6915fc..568bd5f47fc 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -914,7 +914,7 @@ class Product extends CommonObject $result = $this->_log_price($user); if ($result > 0) { - if ($this->update($id, $user, true, 'add') <= 0) { + if ($this->update($id, $user, 1, 'add') <= 0) { $error++; } } else { @@ -6608,7 +6608,7 @@ class Product extends CommonObject continue; } - if ($this->updatePrice($price, $price_type, $user, $price_vat, $price_min, $i, $npr, $psq, true) < 0) { + if ($this->updatePrice($price, $price_type, $user, $price_vat, $price_min, $i, $npr, $psq, 1) < 0) { return -1; } } diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 08ec41b6b46..d95224d5884 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * 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 @@ -1016,7 +1017,7 @@ if ($resql) { $num = $db->num_rows($resql); if (!empty($limit != 0) || $num > $limit || $page) { - print_fleche_navigation($page, $_SERVER["PHP_SELF"], '&id='.$object->id.$paramwithsearch, ($num >= $limit), '', '', $limit); + print_fleche_navigation($page, $_SERVER["PHP_SELF"], '&id='.$object->id.$paramwithsearch, ($num >= $limit ? 1 : 0), '', '', $limit); } $i = 0; diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index cf3158d86c5..5f8fc19dac5 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -270,7 +270,7 @@ if (empty($reshook)) { foreach ($listofobjectref as $tmppdf) { $arrayofinclusion[] = '^'.preg_quote(dol_sanitizeFileName($tmppdf), '/').'_[a-zA-Z0-9-_]+\.pdf$'; // To include PDF generated from ODX files } - $listoffiles = dol_dir_list($uploaddir, 'all', 1, implode('|', $arrayofinclusion), '\.meta$|\.png', 'date', SORT_DESC, 0, true); + $listoffiles = dol_dir_list($uploaddir, 'all', 1, implode('|', $arrayofinclusion), '\.meta$|\.png', 'date', SORT_DESC, 0, 1); // Define output language (Here it is not used because we do only merging existing PDF) $outputlangs = $langs; diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index 2eede71a814..f7313ae3b6a 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -2,6 +2,7 @@ /* Copyright (C) 2021 Dorian Vabre * Copyright (C) 2023 Laurent Destailleur * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -658,7 +659,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $ishtml = dol_textishtml($texttosend); // May contain urls - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, ($ishtml ? 1 : 0)); $result = $mailfile->sendfile(); if ($result) { diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index fc550a763b7..8c08c1659eb 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -2,6 +2,7 @@ /* Copyright (C) 2001-2002 Rodolphe Quiedeville * Copyright (C) 2006-2013 Laurent Destailleur * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2024 Frédéric France * * 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 @@ -197,7 +198,7 @@ if (!empty($_SESSION['ipaddress'])) { // To avoid to make action twice $ishtml = dol_textishtml($content); // May contain urls require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($topic, $sendto, $from, $content, array(), array(), array(), '', '', 0, $ishtml); + $mailfile = new CMailFile($topic, $sendto, $from, $content, array(), array(), array(), '', '', 0, $ishtml ? 1 : 0); $result = $mailfile->sendfile(); if ($result) { diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 2fac1e73f71..299ca894e28 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -5,6 +5,7 @@ * Copyright (C) 2021-2023 Waël Almoman * Copyright (C) 2021 Maxime Demarest * Copyright (C) 2021 Dorian Vabre + * Copyright (C) 2024 Frédéric France * * 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 @@ -1454,7 +1455,7 @@ if ($ispaymentok) { $trackid = 'inv'.$object->id; - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, $listofpaths, $listofmimes, $listofnames, $cc, '', 0, $ishtml, '', '', $trackid, '', 'standard'); + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, $listofpaths, $listofmimes, $listofnames, $cc, '', 0, ($ishtml ? 1 : 0), '', '', $trackid, '', 'standard'); $result = $mailfile->sendfile(); if ($result) { @@ -1658,7 +1659,7 @@ if ($ispaymentok) { $ishtml = dol_textishtml($texttosend); // May contain urls $trackid = 'inv'.$invoice->id; - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml, '', '', $trackid, '', 'standard'); + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml ? 1 : 0, '', '', $trackid, '', 'standard'); $result = $mailfile->sendfile(); if ($result) { @@ -1979,7 +1980,7 @@ if ($ispaymentok) { $trackid = ''; require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($topic, $sendto, $from, $content, array(), array(), array(), '', '', 0, $ishtml, '', '', $trackid, '', 'standard'); + $mailfile = new CMailFile($topic, $sendto, $from, $content, array(), array(), array(), '', '', 0, $ishtml ? 1 : 0, '', '', $trackid, '', 'standard'); $result = $mailfile->sendfile(); if ($result) { @@ -2040,7 +2041,7 @@ if ($ispaymentok) { $trackid = ''; require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($topic, $sendto, $from, $content, array(), array(), array(), '', '', 0, $ishtml, '', '', $trackid, '', 'standard'); + $mailfile = new CMailFile($topic, $sendto, $from, $content, array(), array(), array(), '', '', 0, $ishtml ? 1 : 0, '', '', $trackid, '', 'standard'); $result = $mailfile->sendfile(); if ($result) { diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 160ae7da02f..1429e7d6a5e 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -523,7 +524,7 @@ if (empty($reshook) && $action == 'add') { $ishtml = dol_textishtml($texttosend); // May contain urls - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml, '', '', $trackid); + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml ? 1 : 0, '', '', $trackid); $result = $mailfile->sendfile(); if ($result) { diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 70a87215f22..0a5ff43d07c 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -454,7 +455,7 @@ if (empty($reshook) && $action == 'add') { $ishtml = dol_textishtml($texttosend); // May contain urls - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml, '', '', $trackid); + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml ? 1 : 0, '', '', $trackid); $result = $mailfile->sendfile(); if ($result) { diff --git a/phpstan.neon.dist b/phpstan.neon.dist index cef82d0379d..6f63f66cc0d 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -87,9 +87,6 @@ parameters: - '#run_sql expects int, string#' - '#expects int, float#' - '#expects int, null#' - - '#expects int, bool given.#' - - '#expects int, false given.#' - - '#expects int, true given.#' - '#expects int, array\|string given.#' - '#expects int<0, 1>, '''' given.#' - '#expects float\|string#' From 1e4cc39e3bd156e3eba187b5e2ea752d91fea12b Mon Sep 17 00:00:00 2001 From: atm-jonathan <146709163+atm-jonathan@users.noreply.github.com> Date: Mon, 8 Jul 2024 21:46:07 +0200 Subject: [PATCH 35/66] getNextValue() (#30316) --- htdocs/delivery/class/delivery.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index 345ab2cce79..5b90acbe33c 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -422,7 +422,7 @@ class Delivery extends CommonObject $soc->fetch($this->socid); if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) { // empty should not happened, but when it occurs, the test save life - $numref = $objMod->delivery_get_num($soc, $this); + $numref = $objMod->getNextValue($soc, $this); } else { $numref = $this->ref; } From 4abe433c220755925ec69947bc04597c35318f3d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 8 Jul 2024 21:46:36 +0200 Subject: [PATCH 36/66] NEW Propale - Can upload a file with drag and drop (#30315) --- htdocs/comm/propal/card.php | 39 +++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 397a6ac51df..b33b51daa94 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1,23 +1,24 @@ - * Copyright (C) 2004-2022 Laurent Destailleur - * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2005 Marc Barilley / Ocebo - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2010-2023 Juanjo Menent - * Copyright (C) 2010-2022 Philippe Grand - * Copyright (C) 2012-2023 Christophe Battarel - * Copyright (C) 2012 Cedric Salvador - * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2014 Ferran Marcet - * Copyright (C) 2016 Marcos García - * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2020 Nicolas ZABOURI - * Copyright (C) 2022 Gauthier VERDOL - * Copyright (C) 2023 Lenin Rivas - * Copyright (C) 2023 William Mead +/* Copyright (C) 2001-2007 Rodolphe Quiedeville + * Copyright (C) 2004-2022 Laurent Destailleur + * Copyright (C) 2004 Eric Seigne + * Copyright (C) 2005 Marc Barilley / Ocebo + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2006 Andre Cianfarani + * Copyright (C) 2010-2023 Juanjo Menent + * Copyright (C) 2010-2022 Philippe Grand + * Copyright (C) 2012-2023 Christophe Battarel + * Copyright (C) 2012 Cedric Salvador + * Copyright (C) 2013-2014 Florian Henry + * Copyright (C) 2014 Ferran Marcet + * Copyright (C) 2016 Marcos García + * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2020 Nicolas ZABOURI + * Copyright (C) 2022 Gauthier VERDOL + * Copyright (C) 2023 Lenin Rivas + * Copyright (C) 2023 William Mead * Copyright (C) 2024 MDW + * Copyright (C) 2024 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 @@ -2264,7 +2265,7 @@ if ($action == 'create') { } $head = propal_prepare_head($object); - print dol_get_fiche_head($head, 'comm', $langs->trans('Proposal'), -1, 'propal'); + print dol_get_fiche_head($head, 'comm', $langs->trans('Proposal'), -1, 'propal', 0, '', '', 0, '', 1); $formconfirm = ''; From 58bba2d58cb82a5db5f7b89538bb453758c26f70 Mon Sep 17 00:00:00 2001 From: atm-jonathan <146709163+atm-jonathan@users.noreply.github.com> Date: Mon, 8 Jul 2024 21:46:59 +0200 Subject: [PATCH 37/66] missing token (#30313) --- htdocs/expedition/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 6541faf6561..73ea528c6e5 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -455,7 +455,7 @@ if (empty($reshook)) { if ($result > 0) { $db->commit(); - header("Location: ".DOL_URL_ROOT.'/delivery/card.php?action=create_delivery&id='.$result); + header("Location: ".DOL_URL_ROOT.'/delivery/card.php?action=create_delivery&token='.newToken().'&id='.$result); exit; } else { $db->rollback(); From dd8f5cc9e16463582b14f1c3b1a5b7c87dd80288 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 8 Jul 2024 21:50:47 +0200 Subject: [PATCH 38/66] Add llxHeader body css for contract (#30310) * Add llxHeader body css for contract * Add llxHeader body css for contract * Add llxHeader body css for contract * Fix codesniffer * Fix codesniffer * Fix codesniffer * Fix codesniffer --- htdocs/contrat/admin/contract_extrafields.php | 18 +-- .../contrat/admin/contractdet_extrafields.php | 18 +-- htdocs/contrat/agenda.php | 9 +- htdocs/contrat/card.php | 129 +++++++++--------- htdocs/contrat/contact.php | 17 +-- htdocs/contrat/document.php | 17 +-- htdocs/contrat/index.php | 15 +- htdocs/contrat/list.php | 28 ++-- htdocs/contrat/messaging.php | 19 +-- htdocs/contrat/note.php | 15 +- htdocs/contrat/services_list.php | 21 +-- htdocs/contrat/ticket.php | 11 +- 12 files changed, 166 insertions(+), 151 deletions(-) diff --git a/htdocs/contrat/admin/contract_extrafields.php b/htdocs/contrat/admin/contract_extrafields.php index 5756d23472f..076c0131704 100644 --- a/htdocs/contrat/admin/contract_extrafields.php +++ b/htdocs/contrat/admin/contract_extrafields.php @@ -1,10 +1,11 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013-2018 Philippe Grand +/* Copyright (C) 2001-2002 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013-2018 Philippe Grand + * Copyright (C) 2024 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 @@ -62,9 +63,10 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; * View */ -$textobject = $langs->transnoentitiesnoconv('Contracts'); +$title = $langs->transnoentitiesnoconv('Contracts'); +$help_url = 'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio'; -llxHeader(); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-contrat page-admin_extrafields'); $linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ContractsSetup"), $linkback, 'title_setup'); diff --git a/htdocs/contrat/admin/contractdet_extrafields.php b/htdocs/contrat/admin/contractdet_extrafields.php index cbefbdb0faf..44e82ef0639 100644 --- a/htdocs/contrat/admin/contractdet_extrafields.php +++ b/htdocs/contrat/admin/contractdet_extrafields.php @@ -1,10 +1,11 @@ - * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2014 Florian Henry - * Copyright (C) 2013 Philippe Grand +/* Copyright (C) 2001-2002 Rodolphe Quiedeville + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2014 Florian Henry + * Copyright (C) 2013 Philippe Grand + * Copyright (C) 2024 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 @@ -62,9 +63,10 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; * View */ -$textobject = $langs->transnoentitiesnoconv('Contracts'); +$title = $langs->transnoentitiesnoconv('Contracts'); +$help_url = 'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio'; -llxHeader(); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-contrat page-admin_extrafields_lines'); $linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ContractsSetup"), $linkback, 'title_setup'); diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index dbdb930bb6a..1e3f4e86d52 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -1,6 +1,7 @@ - * Copyright (C) 2017 Ferran Marcet +/* Copyright (C) 2004-2009 Laurent Destailleur + * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2024 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 @@ -151,9 +152,9 @@ if ($object->id > 0) { if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/contractrefonly/', getDolGlobalString('MAIN_HTML_TITLE')) && $object->ref) { $title = $object->ref." - ".$title; } - $help_url = 'EN:Module_Contracts|FR:Module_Contrat'; + $help_url = 'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio'; - llxHeader('', $title, $help_url); + llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-contrat page-card_agenda'); if (isModEnabled('notification')) { $langs->load("mails"); diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index b81ff021d64..eec04e92176 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1,18 +1,19 @@ - * Copyright (C) 2004-2019 Laurent Destailleur - * Copyright (C) 2005-2014 Regis Houssin - * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2010-2017 Juanjo Menent - * Copyright (C) 2013 Christophe Battarel - * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2014-2020 Ferran Marcet - * Copyright (C) 2014-2016 Marcos García - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2018-2021 Frédéric France - * Copyright (C) 2023 Charlene Benke - * Copyright (C) 2023 Nick Fragoulis +/* Copyright (C) 2003-2004 Rodolphe Quiedeville + * Copyright (C) 2004-2019 Laurent Destailleur + * Copyright (C) 2005-2014 Regis Houssin + * Copyright (C) 2006 Andre Cianfarani + * Copyright (C) 2010-2017 Juanjo Menent + * Copyright (C) 2013 Christophe Battarel + * Copyright (C) 2013-2014 Florian Henry + * Copyright (C) 2014-2020 Ferran Marcet + * Copyright (C) 2014-2016 Marcos García + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2018-2021 Frédéric France + * Copyright (C) 2023 Charlene Benke + * Copyright (C) 2023 Nick Fragoulis * Copyright (C) 2024 MDW + * Copyright (C) 2024 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 @@ -1077,14 +1078,13 @@ if (empty($reshook)) { * View */ -$help_url = 'EN:Module_Contracts|FR:Module_Contrat'; - $title = $object->ref." - ".$langs->trans('Contract'); if ($action == 'create') { $title = $langs->trans("NewContract"); } +$help_url = 'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio'; -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-contrat page-card'); $form = new Form($db); $formfile = new FormFile($db); @@ -2315,64 +2315,63 @@ if ($action == 'create') { llxFooter(); $db->close(); -?> - - + }); '."\n"; } diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index d9310761e02..f123a16d05f 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -1,9 +1,10 @@ - * Copyright (C) 2005-2009 Destailleur Laurent - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2023 Christian Foellmann +/* Copyright (C) 2005 Patrick Rouillon + * Copyright (C) 2005-2009 Destailleur Laurent + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2023 Christian Foellmann + * Copyright (C) 2024 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 @@ -121,9 +122,9 @@ if (empty($reshook)) { */ $title = $langs->trans("Contract"); -$help_url = 'EN:Module_Contracts|FR:Module_Contrat'; +$help_url = 'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio'; -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-contrat page-card_contact'); $form = new Form($db); $formcompany = new FormCompany($db); @@ -132,7 +133,7 @@ $userstatic = new User($db); /* *************************************************************************** */ /* */ -/* Card view and edit mode */ +/* Card view and edit mode */ /* */ /* *************************************************************************** */ diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 180c7bd8913..2d4a02ada5d 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -1,11 +1,12 @@ - * Copyright (C) 2004-2009 Laurent Destailleur - * Copyright (C) 2005 Marc Barilley / Ocebo - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2005 Simon TOSSER - * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2017 Ferran Marcet +/* Copyright (C) 2003-2007 Rodolphe Quiedeville + * Copyright (C) 2004-2009 Laurent Destailleur + * Copyright (C) 2005 Marc Barilley / Ocebo + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005 Simon TOSSER + * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2024 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 @@ -103,7 +104,7 @@ $form = new Form($db); $title = $langs->trans("Contract"); $help_url = 'EN:Module_Contracts|FR:Module_Contrat'; -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-contrat page-card_documents'); if ($object->id) { diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 5a83982ed4f..2e0ec47b4d4 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -1,10 +1,11 @@ - * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2019 Nicolas ZABOURI +/* Copyright (C) 2001-2004 Rodolphe Quiedeville + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2024 MDW + * Copyright (C) 2024 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 @@ -75,9 +76,9 @@ $productstatic = new Product($db); $now = dol_now(); $title = $langs->trans("ContractsArea"); -$help_url = ''; +$help_url = 'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio'; -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-contrat page-index'); print load_fiche_titre($langs->trans("ContractsArea"), '', 'contract'); diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index b43e84cdd30..60722a34607 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -1,17 +1,17 @@ - * Copyright (C) 2004-2020 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2014-2019 Juanjo Menent - * Copyright (C) 2015 Claudio Aschieri - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2016-2018 Ferran Marcet - * Copyright (C) 2019 Nicolas Zabouri - * Copyright (C) 2021 Alexandre Spangaro +/* Copyright (C) 2001-2004 Rodolphe Quiedeville + * Copyright (C) 2004-2020 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2014-2019 Juanjo Menent + * Copyright (C) 2015 Claudio Aschieri + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2016-2018 Ferran Marcet + * Copyright (C) 2019 Nicolas Zabouri + * Copyright (C) 2021-2024 Alexandre Spangaro * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 Benjamin Falière + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 Benjamin Falière * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -584,8 +584,10 @@ if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $s // Output page // -------------------------------------------------------------------- +$title = $langs->trans("Contracts"); +$help_url = 'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio'; -llxHeader('', $langs->trans("Contracts")); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-contrat page-list bodyforlist'); $i = 0; diff --git a/htdocs/contrat/messaging.php b/htdocs/contrat/messaging.php index 285ad325c28..6880ad9dffc 100644 --- a/htdocs/contrat/messaging.php +++ b/htdocs/contrat/messaging.php @@ -1,11 +1,12 @@ - * Copyright (C) 2005 Brice Davoleau - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2006-2019 Laurent Destailleur - * Copyright (C) 2007 Patrick Raguin - * Copyright (C) 2010 Juanjo Menent - * Copyright (C) 2015 Marcos García +/* Copyright (C) 2001-2007 Rodolphe Quiedeville + * Copyright (C) 2005 Brice Davoleau + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2006-2019 Laurent Destailleur + * Copyright (C) 2007 Patrick Raguin + * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2015 Marcos García + * Copyright (C) 2024 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 @@ -148,9 +149,9 @@ $title = $langs->trans("Agenda"); if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/contractrefonly/', getDolGlobalString('MAIN_HTML_TITLE')) && $object->ref) { $title = $object->ref." - ".$title; } -$help_url = 'EN:Module_Contracts|FR:Module_Contrat'; +$help_url = 'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio'; -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-contrat page-card_messaging'); if (isModEnabled('notification')) { $langs->load("mails"); diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php index 7a7f441375f..76d0d6cb6cc 100644 --- a/htdocs/contrat/note.php +++ b/htdocs/contrat/note.php @@ -1,8 +1,9 @@ - * Copyright (C) 2004-2016 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2017 Ferran Marcet +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2024 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 @@ -21,7 +22,7 @@ /** * \file htdocs/contrat/note.php * \ingroup contrat - * \brief Fiche de notes sur un contrat + * \brief Card with notes on contract */ // Load Dolibarr environment @@ -77,9 +78,9 @@ if (empty($reshook)) { */ $title = $langs->trans("Contract"); -$help_url = 'EN:Module_Contracts|FR:Module_Contrat'; +$help_url = 'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio'; -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-contrat page-card_note'); $form = new Form($db); diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 56bacf7159d..fb5b52abc46 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -1,13 +1,14 @@ - * Copyright (C) 2004-2016 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2018 Ferran Marcet - * Copyright (C) 2018 Frédéric France - * Copyright (C) 2019 Juanjo Menent - * Copyright (C) 2023-2024 William Mead +/* Copyright (C) 2001-2004 Rodolphe Quiedeville + * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2018 Ferran Marcet + * Copyright (C) 2018 Frédéric France + * Copyright (C) 2019 Juanjo Menent + * Copyright (C) 2023-2024 William Mead * Copyright (C) 2024 MDW + * Copyright (C) 2024 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 @@ -237,7 +238,7 @@ if ($search_status == "4" && $filter == "expired") { if ($search_status == "5") { $title = $langs->trans("ListOfClosedServices"); } -$help_url = ''; +$help_url = 'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio'; // Build and execute select // -------------------------------------------------------------------- @@ -432,7 +433,7 @@ if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $sear // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-contrat page-list_services bodyforlist'); $arrayofselected = is_array($toselect) ? $toselect : array(); diff --git a/htdocs/contrat/ticket.php b/htdocs/contrat/ticket.php index a4b37e28f71..067badc13c0 100644 --- a/htdocs/contrat/ticket.php +++ b/htdocs/contrat/ticket.php @@ -1,8 +1,9 @@ - * Copyright (C) 2004-2016 Laurent Destailleur - * Copyright (C) 2012-2023 Charlene BENKE +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2012-2023 Charlene BENKE * Copyright (C) 2024 MDW + * Copyright (C) 2024 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 @@ -60,8 +61,10 @@ $result = restrictedArea($user, 'contrat', $id); /* * View */ +$title = $langs->trans("Contract") . ' - ' . $langs->trans("Tickets"); +$help_url = 'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio'; -llxHeader("", $langs->trans("Tickets"), "Contrat"); +llxHeader("", $title, $help_url, '', 0, 0, '', '', '', 'mod-contrat page-card_ticket'); $form = new Form($db); $userstatic = new User($db); From ec3e26b1dfeb77cca79cba16205073cb2646a6d5 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 8 Jul 2024 21:50:58 +0200 Subject: [PATCH 39/66] Add llxHeader body css for contact (#30309) --- htdocs/contact/agenda.php | 25 +++++++++++++------------ htdocs/contact/card.php | 26 +++++++++++++------------- htdocs/contact/consumption.php | 14 ++++++++------ htdocs/contact/document.php | 9 +++++---- htdocs/contact/info.php | 13 +++++++------ htdocs/contact/ldap.php | 8 +++++--- htdocs/contact/list.php | 30 +++++++++++++++--------------- htdocs/contact/note.php | 14 ++++++++------ htdocs/contact/perso.php | 14 ++++++++------ htdocs/contact/project.php | 8 +++++--- 10 files changed, 87 insertions(+), 74 deletions(-) diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index db3fc45d2b4..5a4ac3ad1c1 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -1,13 +1,13 @@ - * Copyright (C) 2004-2018 Laurent Destailleur - * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2007 Franky Van Liedekerke - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013-2016 Alexandre Spangaro - * Copyright (C) 2014 Juanjo Menent - * Copyright (C) 2015 Jean-François Ferry +/* Copyright (C) 2004-2005 Rodolphe Quiedeville + * Copyright (C) 2004-2018 Laurent Destailleur + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2007 Franky Van Liedekerke + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013-2024 Alexandre Spangaro + * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2015 Jean-François Ferry * * 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 @@ -24,9 +24,9 @@ */ /** - * \file htdocs/contact/card.php + * \file htdocs/contact/agenda.php * \ingroup societe - * \brief Card of a contact + * \brief Card agenda of a contact */ @@ -149,7 +149,8 @@ if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/contactnameonly/', get $title = $object->lastname; } $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas|DE:Modul_Partner'; -llxHeader('', $title, $help_url); + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-societe page-contact-card_agenda'); if ($socid > 0) { diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index b8aa8fe81e8..66241726b61 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -1,16 +1,16 @@ - * Copyright (C) 2004-2019 Laurent Destailleur - * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2005-2017 Regis Houssin - * Copyright (C) 2007 Franky Van Liedekerke - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013-2016 Alexandre Spangaro - * Copyright (C) 2014 Juanjo Menent - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2018-2023 Frédéric France - * Copyright (C) 2019 Josep Lluís Amador - * Copyright (C) 2020 Open-Dsi +/* Copyright (C) 2004-2005 Rodolphe Quiedeville + * Copyright (C) 2004-2019 Laurent Destailleur + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2005-2017 Regis Houssin + * Copyright (C) 2007 Franky Van Liedekerke + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013-2024 Alexandre Spangaro + * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2018-2023 Frédéric France + * Copyright (C) 2019 Josep Lluís Amador + * Copyright (C) 2020 Open-Dsi * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -579,7 +579,7 @@ if (empty($object->id)) { } $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-societe page-contact-card'); $countrynotdefined = $langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index 888f90822ab..44a4b4247e9 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -1,9 +1,10 @@ - * Copyright (C) 2004-2016 Laurent Destailleur - * Copyright (C) 2013-2015 Juanjo Menent - * Copyright (C) 2015 Marcos García - * Copyright (C) 2015-2017 Ferran Marcet +/* Copyright (C) 2012-2013 Philippe Berthet + * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2013-2015 Juanjo Menent + * Copyright (C) 2015 Marcos García + * Copyright (C) 2015-2017 Ferran Marcet + * Copyright (C) 2024 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 @@ -113,7 +114,8 @@ $objsoc = new Societe($db); $title = $langs->trans("ContactRelatedItems"); $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('', $title, $help_url); + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-societe page-contact-card_consumption'); if (empty($id)) { dol_print_error($db); diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php index f4e2d3d6b03..fddfac390ab 100644 --- a/htdocs/contact/document.php +++ b/htdocs/contact/document.php @@ -1,7 +1,7 @@ - * Copyright (C) 2015-2021 Frederic France - * Copyright (C) 2017 Regis Houssin +/* Copyright (C) 2014-2024 Alexandre Spangaro + * Copyright (C) 2015-2021 Frederic France + * Copyright (C) 2017 Regis Houssin * * 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 @@ -115,7 +115,8 @@ if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/contactnameonly/', get $title = $object->lastname; } $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('', $title, $help_url); + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-societe page-contact-card_documents'); if ($object->id) { $head = contact_prepare_head($object); diff --git a/htdocs/contact/info.php b/htdocs/contact/info.php index d1248286792..22ca6701673 100644 --- a/htdocs/contact/info.php +++ b/htdocs/contact/info.php @@ -1,7 +1,8 @@ - * Copyright (C) 2004-2010 Laurent Destailleur - * Copyright (C) 2005-2015 Regis Houssin +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2005-2015 Regis Houssin + * Copyright (C) 2024 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 @@ -20,10 +21,9 @@ /** * \file htdocs/contact/info.php * \ingroup societe - * \brief Onglet info d'un contact + * \brief Contact info tab */ - // Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; @@ -52,8 +52,9 @@ $object = new Contact($db); $form = new Form($db); $title = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); +$help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas'; -llxHeader('', $title, 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas'); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-societe page-contact-card_info'); if ($id > 0) { $result = $object->fetch($id, $user); diff --git a/htdocs/contact/ldap.php b/htdocs/contact/ldap.php index 337966133c5..fa7659dfbe3 100644 --- a/htdocs/contact/ldap.php +++ b/htdocs/contact/ldap.php @@ -1,6 +1,7 @@ - * Copyright (C) 2006-2021 Regis Houssin +/* Copyright (C) 2006-2010 Laurent Destailleur + * Copyright (C) 2006-2021 Regis Houssin + * Copyright (C) 2024 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 @@ -81,8 +82,9 @@ if ($action == 'dolibarr2ldap') { $form = new Form($db); $title = (getDolGlobalString('SOCIETE_ADDRESSES_MANAGEMENT') ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); +$help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas'; -llxHeader('', $title, 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas'); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-societe page-contact-card_ldap'); $head = contact_prepare_head($object); diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index f50e643a843..87504a63822 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -1,19 +1,19 @@ - * Copyright (C) 2003 Eric Seigne - * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2013-2015 Raphaël Doursenaud - * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2013 Alexandre Spangaro - * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2018 Juanjo Menent - * Copyright (C) 2019 Frédéric France - * Copyright (C) 2019 Josep Lluís Amador - * Copyright (C) 2020 Open-Dsi +/* Copyright (C) 2001-2004 Rodolphe Quiedeville + * Copyright (C) 2003 Eric Seigne + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2013-2015 Raphaël Doursenaud + * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2013-2024 Alexandre Spangaro + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2018 Juanjo Menent + * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019 Josep Lluís Amador + * Copyright (C) 2020 Open-Dsi * Copyright (C) 2024 MDW - * Copyright (C) 2024 Benjamin Falière + * Copyright (C) 2024 Benjamin Falière * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -819,7 +819,7 @@ if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && ($ // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-societe page-contact-list bodyforlist'); $arrayofselected = is_array($toselect) ? $toselect : array(); diff --git a/htdocs/contact/note.php b/htdocs/contact/note.php index e979fa93103..70fa0def19e 100644 --- a/htdocs/contact/note.php +++ b/htdocs/contact/note.php @@ -1,9 +1,10 @@ - * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2010 Juanjo Menent - * Copyright (C) 2013 Florian Henry +/* Copyright (C) 2001-2005 Rodolphe Quiedeville + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2024 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 @@ -83,7 +84,8 @@ $title = $langs->trans("ContactNotes"); $form = new Form($db); $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('', $title, $help_url); + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-societe page-contact-card_note'); if ($id > 0) { /* diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index 0661a80b685..52dc8746d96 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -1,9 +1,10 @@ - * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2018-2021 Frédéric France +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2024 MDW + * Copyright (C) 2024 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 @@ -22,7 +23,7 @@ /** * \file htdocs/contact/perso.php * \ingroup societe - * \brief Onglet information personnelles d'un contact + * \brief Contact personal information tab */ // Load Dolibarr environment @@ -125,7 +126,8 @@ if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/contactnameonly/', get $title = $object->lastname; } $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('', $title, $help_url); + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-societe page-contact-card_perso'); $form = new Form($db); $formcompany = new FormCompany($db); diff --git a/htdocs/contact/project.php b/htdocs/contact/project.php index 2112b4aa9f5..d4b56b31d06 100644 --- a/htdocs/contact/project.php +++ b/htdocs/contact/project.php @@ -1,6 +1,6 @@ +/* Copyright (C) 2021 VIAL-GOUTEYRON Quentin + * Copyright (C) 2024 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 @@ -66,7 +66,9 @@ if ($id) { if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/thirdpartynameonly/', getDolGlobalString('MAIN_HTML_TITLE')) && $object->name) { $title = $object->name." - ".$title; } - llxHeader('', $title); + $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; + + llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-societe page-contact-card_project'); if (isModEnabled('notification')) { $langs->load("mails"); From 2874e85728da86fb329b75994610a68ee08c687f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 8 Jul 2024 21:51:27 +0200 Subject: [PATCH 40/66] fix phpdoc of tva_by_rate (#30308) * fix phpdoc of tva_by_rate * fix phpdoc of tva_by_thirdparty --- htdocs/compta/tva/quadri_detail.php | 4 +-- htdocs/core/lib/tax.lib.php | 41 +++++++++++++++-------------- phpstan.neon.dist | 1 - 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 25ed645538a..9d4c63c0e75 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -4,10 +4,10 @@ * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2006-2015 Yannick Warnier * Copyright (C) 2014 Ferran Marcet - * Copyright (C) 2018-2021 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2019 Eric Seigne * Copyright (C) 2021-2022 Open-Dsi - * Copyright (C) 2024 MDW + * Copyright (C) 2024 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 diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index 9632a893acd..0a199cb684f 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -7,6 +7,7 @@ * Copyright (C) 2012-2014 Raphaël Doursenaud * Copyright (C) 2015 Marcos García * Copyright (C) 2021-2022 Open-Dsi + * Copyright (C) 2024 Frédéric France * * 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 @@ -98,16 +99,16 @@ function tax_prepare_head(ChargeSociales $object) /** * Look for collectable VAT clients in the chosen year (and month) * - * @param string $type Tax type, either 'vat', 'localtax1' or 'localtax2' - * @param DoliDB $db Database handle - * @param int $y Year - * @param string $date_start Start date - * @param string $date_end End date - * @param int $modetax Not used - * @param string $direction 'sell' or 'buy' - * @param int $m Month - * @param int $q Quarter - * @return array|int Array with details of VATs (per third parties), -1 if no accountancy module, -2 if not yet developed, -3 if error + * @param string $type Tax type, either 'vat', 'localtax1' or 'localtax2' + * @param DoliDB $db Database handle + * @param int $y Year + * @param int|'' $date_start Start date + * @param int|'' $date_end End date + * @param int $modetax Not used + * @param 'sell'|'buy' $direction 'sell' or 'buy' + * @param int $m Month + * @param int $q Quarter + * @return array|int Array with details of VATs (per third parties), -1 if no accountancy module, -2 if not yet developed, -3 if error */ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $direction, $m = 0, $q = 0) { @@ -687,16 +688,16 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di * The function gets the Tax in split results, as the Tax declaration asks * to report the amounts for different Tax rates as different lines. * - * @param string $type Tax type, either 'vat', 'localtax1' or 'localtax2' - * @param DoliDB $db Database handler object - * @param int $y Year - * @param int $q Quarter - * @param string $date_start Start date - * @param string $date_end End date - * @param int $modetax Not used - * @param int $direction 'sell' (customer invoice) or 'buy' (supplier invoices) - * @param int $m Month - * @return array|int Array with details of VATs (per rate), -1 if no accountancy module, -2 if not yet developed, -3 if error + * @param string $type Tax type, either 'vat', 'localtax1' or 'localtax2' + * @param DoliDB $db Database handler object + * @param int $y Year + * @param int $q Quarter + * @param int|'' $date_start Start date + * @param int|'' $date_end End date + * @param int $modetax Not used + * @param 'sell'|'buy' $direction 'sell' (customer invoice) or 'buy' (supplier invoices) + * @param int $m Month + * @return array|int Array with details of VATs (per rate), -1 if no accountancy module, -2 if not yet developed, -3 if error */ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $direction, $m = 0) { diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 6f63f66cc0d..8421a1efc2a 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -70,7 +70,6 @@ parameters: - '#expects int<-2, 2>, bool given.#' - '#expects int<0, 1>#' - '#print.* expects int, string#' - - '#tax_by.* expects int, string#' - '#load.* expects int, string#' - '#ajax.* expects int, string#' - '#measu.* expects int, string#' From e457ff4ab1cbefdc3e7df74b869e25a65f741167 Mon Sep 17 00:00:00 2001 From: Eric - CAP-REL <1468823+rycks@users.noreply.github.com> Date: Mon, 8 Jul 2024 21:52:03 +0200 Subject: [PATCH 41/66] fix dol syslog message (#30306) --- htdocs/core/lib/tax.lib.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index 0a199cb684f..98fb8dadb65 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -116,7 +116,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di // If we use date_start and date_end, we must not use $y, $m, $q if (($date_start || $date_end) && (!empty($y) || !empty($m) || !empty($q))) { - dol_print_error(null, 'Bad value of input parameter for tax_by_rate'); + dol_print_error(null, 'Bad value of input parameter for tax_by_thirdparty'); } $list = array(); @@ -474,14 +474,14 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di } if (!$sql) { - dol_syslog("Tax.lib.php::tax_by_rate no accountancy module enabled".$sql, LOG_ERR); + dol_syslog("Tax.lib.php::tax_by_thirdparty no accountancy module enabled".$sql, LOG_ERR); return -1; // -1 = Not accountancy module enabled } if ($sql == 'TODO') { return -2; // -2 = Feature not yet available } if ($sql != 'TODO') { - dol_syslog("Tax.lib.php::tax_by_rate", LOG_DEBUG); + dol_syslog("Tax.lib.php::tax_by_thirdparty", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { $company_id = -1; @@ -596,14 +596,14 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di $sql .= " ORDER BY e.rowid"; if (!$sql) { - dol_syslog("Tax.lib.php::tax_by_rate no accountancy module enabled".$sql, LOG_ERR); + dol_syslog("Tax.lib.php::tax_by_thirdparty no accountancy module enabled".$sql, LOG_ERR); return -1; // -1 = Not accountancy module enabled } if ($sql == 'TODO') { return -2; // -2 = Feature not yet available } if ($sql != 'TODO') { - dol_syslog("Tax.lib.php::tax_by_rate", LOG_DEBUG); + dol_syslog("Tax.lib.php::tax_by_thirdparty", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { $company_id = -1; From 850cafb588a20b181f65afa4ef68fe5b0f53e468 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 8 Jul 2024 22:10:25 +0200 Subject: [PATCH 42/66] Add llxHeader body css for ai (#30307) * Add llxHeader body css for ai * Fix $title in cartes member --- htdocs/adherents/cartes/carte.php | 2 +- htdocs/ai/admin/custom_prompt.php | 9 +++++---- htdocs/ai/admin/setup.php | 7 ++++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index e0a9284becb..fe33407cf21 100644 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -268,7 +268,7 @@ $form = new Form($db); $title = $langs->trans('MembersCards'); $help_url = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Mitglieder'; -llxHeader('', $langs->trans("MembersCards"), $help_url, '', 0, 0, '', '', '', 'mod-member page-cards'); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-cards'); print load_fiche_titre($langs->trans("LinkToGeneratedPages"), '', $adherentstatic->picto); diff --git a/htdocs/ai/admin/custom_prompt.php b/htdocs/ai/admin/custom_prompt.php index a897467f72f..28bd0c2b8f3 100644 --- a/htdocs/ai/admin/custom_prompt.php +++ b/htdocs/ai/admin/custom_prompt.php @@ -1,7 +1,8 @@ - * Copyright (C) 2022 Alice Adminson - * Copyright (C) 2024 Frédéric France +/* Copyright (C) 2004-2017 Laurent Destailleur + * Copyright (C) 2022 Alice Adminson + * Copyright (C) 2024 Frédéric France + * Coryright (C) 2024 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 @@ -179,7 +180,7 @@ $form = new Form($db); $help_url = ''; $title = "AiSetup"; -llxHeader('', $langs->trans($title), $help_url); +llxHeader('', $langs->trans($title), $help_url, '', 0, 0, '', '', '', 'mod-ai page-admin_custom_prompt'); // Subheader $linkback = ''.$langs->trans("BackToModuleList").''; diff --git a/htdocs/ai/admin/setup.php b/htdocs/ai/admin/setup.php index a37a2efa723..796e65b9ad6 100644 --- a/htdocs/ai/admin/setup.php +++ b/htdocs/ai/admin/setup.php @@ -1,8 +1,9 @@ - * Copyright (C) 2022 Alice Adminson +/* Copyright (C) 2004-2017 Laurent Destailleur + * Copyright (C) 2022 Alice Adminson * Copyright (C) 2024 MDW * Copyright (C) 2024 Frédéric France + * Coryright (C) 2024 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 @@ -111,7 +112,7 @@ $form = new Form($db); $help_url = ''; $title = "AiSetup"; -llxHeader('', $langs->trans($title), $help_url); +llxHeader('', $langs->trans($title), $help_url, '', 0, 0, '', '', '', 'mod-ai page-admin'); // Subheader $linkback = ''.$langs->trans("BackToModuleList").''; From 2a18909e9dac89c1330621609e16eca65b4f2a53 Mon Sep 17 00:00:00 2001 From: jyhere Date: Mon, 8 Jul 2024 23:44:58 +0200 Subject: [PATCH 43/66] FIX: $rappro property should match the updated value (Account::updateconciliation()) (#30311) --- htdocs/compta/bank/class/account.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 12243827cbf..09aca21d8bb 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -2522,7 +2522,7 @@ class AccountLine extends CommonObjectLine // TODO Do no try the insert if link already exists } - $this->rappro = 1; + $this->rappro = (int) $conciliated; $this->db->commit(); return 1; From 2bf38d09eda6dd37fef6c60f0dc6c887a86e12df Mon Sep 17 00:00:00 2001 From: jyhere Date: Mon, 8 Jul 2024 23:44:58 +0200 Subject: [PATCH 44/66] FIX: $rappro property should match the updated value (Account::updateconciliation()) (#30311) --- htdocs/compta/bank/class/account.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 12243827cbf..09aca21d8bb 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -2522,7 +2522,7 @@ class AccountLine extends CommonObjectLine // TODO Do no try the insert if link already exists } - $this->rappro = 1; + $this->rappro = (int) $conciliated; $this->db->commit(); return 1; From a722a82a60f4bbe4b43019f3bf56b4445b95bbfe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 9 Jul 2024 03:02:56 +0200 Subject: [PATCH 45/66] Move line at better place for final v20 --- ChangeLog | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2777680bc0f..a56a9462451 100644 --- a/ChangeLog +++ b/ChangeLog @@ -276,7 +276,6 @@ QUAL: professional identifiers - remove TODO by adding profid.lib.php QUAL: Properties ->date_update and ->date_modification were merged QUAL: removed duplicate language file QUAL: Remove the external js library jstimezonedetect -QUAL: Remove use of customurl filter. Must use the USF syntax. QUAL: Rename all input fields "tel" into "phone" QUAL: Rename column fk_origin_line on shipment lines into fk_elementdet to match a generic use. (#28989) QUAL: replace $conf->global with getDolGlobalString() @@ -301,6 +300,7 @@ The following changes may create regressions for some external modules, but were * All CLI tools (into /scripts) return a positive value to the shell if error (0 remains success) for a better cross platform compatibility. On linux the exit(-1) was caught as 255, it may be now exit(1) so will be caught as 1. * The parameter $filter of method fetchAll does not accept array of SQL but must be a string of an Universal Search Filter syntax. +* Remove use of customurl into $filter. Must use the USF syntax. * Use of dol_eval with parameter $returnvalue=0 is deprecated. * The signature for all ->delete() method has been modified to match the modulebuilder template (so first param is now always $user), except the delete for thirdparty (still accept the id of thirdparty to delete as first parameter). Will probably be modified into another version. @@ -316,7 +316,6 @@ The following changes may create regressions for some external modules, but were * The signature of method fetch() of class CompanyBankAccount has been modified to match the signature of method Account->fetch() - ***** ChangeLog for 19.0.2 compared to 19.0.1 ***** FIX: $object->oldcopy may be a stdClass and not original object FIX: 16.0 - parent company gets emptied when updating a third party from the card in edit mode (#28269) From 74d4c59b17bb0f16d07c9ebdb84b1add6d1f5448 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 9 Jul 2024 16:33:10 +0200 Subject: [PATCH 46/66] CSS --- htdocs/install/step5.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/step5.php b/htdocs/install/step5.php index 4d8ca329baf..29166c03f5d 100644 --- a/htdocs/install/step5.php +++ b/htdocs/install/step5.php @@ -523,7 +523,7 @@ if ($action == "set") { print "
"; - $morehtml = '
'; + $morehtml = '

'; } else { @@ -533,7 +533,7 @@ if ($action == "set") { print "
"; - $morehtml = '
'; + $morehtml = '
'; } From 8a4f550d6457a6efd1c3dacc2b4909f5b67ffd37 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 9 Jul 2024 17:26:49 +0200 Subject: [PATCH 47/66] Debug v20 --- htdocs/adherents/list.php | 2 +- htdocs/admin/emailcollector_list.php | 10 +++++----- htdocs/admin/mails_senderprofile_list.php | 2 +- htdocs/asset/list.php | 2 +- htdocs/asset/model/list.php | 2 +- htdocs/bom/bom_list.php | 2 +- htdocs/bookcal/availabilities_list.php | 2 +- htdocs/bookcal/calendar_list.php | 2 +- htdocs/comm/propal/list.php | 2 +- htdocs/compta/cashcontrol/cashcontrol_list.php | 2 +- htdocs/compta/facture/list.php | 2 +- htdocs/contact/list.php | 2 +- htdocs/core/class/conf.class.php | 4 ++++ htdocs/eventorganization/conferenceorbooth_list.php | 2 +- .../conferenceorboothattendee_list.php | 2 +- htdocs/fourn/commande/list.php | 2 +- htdocs/hrm/evaluation_list.php | 10 +++++----- htdocs/hrm/job_list.php | 10 +++++----- htdocs/hrm/position.php | 2 +- htdocs/hrm/position_list.php | 10 +++++----- htdocs/hrm/skill_card.php | 2 +- htdocs/hrm/skill_list.php | 2 +- htdocs/knowledgemanagement/knowledgerecord_list.php | 2 +- htdocs/loan/list.php | 2 +- htdocs/modulebuilder/template/myobject_list.php | 10 +++++----- htdocs/mrp/mo_list.php | 4 ++-- htdocs/partnership/admin/setup.php | 2 +- htdocs/partnership/partnership_list.php | 4 ++-- htdocs/product/inventory/list.php | 2 +- htdocs/product/list.php | 2 +- htdocs/product/stock/list.php | 2 +- htdocs/product/stock/productlot_list.php | 2 +- .../product/stock/stocktransfer/stocktransfer_list.php | 10 +++++----- htdocs/projet/list.php | 2 +- htdocs/recruitment/recruitmentcandidature_list.php | 2 +- htdocs/recruitment/recruitmentjobposition_list.php | 2 +- htdocs/salaries/list.php | 2 +- htdocs/salaries/payments.php | 2 +- htdocs/societe/card.php | 5 ++++- htdocs/societe/price.php | 2 +- htdocs/ticket/list.php | 2 +- htdocs/variants/list.php | 2 +- htdocs/webhook/target_list.php | 2 +- .../webportal/class/html.formlistwebportal.class.php | 2 +- htdocs/workstation/workstation_list.php | 6 +++--- 45 files changed, 79 insertions(+), 72 deletions(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 13d956aa38a..958e6d9940d 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -202,7 +202,7 @@ foreach ($object->fields as $key => $val) { $arrayfields[$tableprefix.'.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 7199bac6d5a..a01c9f1c6d9 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -119,11 +119,11 @@ foreach ($object->fields as $key => $val) { if (!empty($val['visible'])) { $visible = (int) dol_eval($val['visible'], 1); $arrayfields['t.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), - 'position'=>$val['position'], - 'help'=> isset($val['help']) ? $val['help'] : '' + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' ); } } diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 1173ebbf883..404d15d607b 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -110,7 +110,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index d397d3c312c..7efb3102429 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -109,7 +109,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/asset/model/list.php b/htdocs/asset/model/list.php index b787fc95605..b3cd864387c 100644 --- a/htdocs/asset/model/list.php +++ b/htdocs/asset/model/list.php @@ -109,7 +109,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index bf1e2a87269..1d57797083b 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -112,7 +112,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/bookcal/availabilities_list.php b/htdocs/bookcal/availabilities_list.php index dd7d6df9b2e..75f95910f84 100644 --- a/htdocs/bookcal/availabilities_list.php +++ b/htdocs/bookcal/availabilities_list.php @@ -132,7 +132,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/bookcal/calendar_list.php b/htdocs/bookcal/calendar_list.php index a67858255bb..0b9123a6f99 100644 --- a/htdocs/bookcal/calendar_list.php +++ b/htdocs/bookcal/calendar_list.php @@ -128,7 +128,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index d7d5aa122f1..23ea35a2f09 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -272,7 +272,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index 984686af4d6..73e2c9170d4 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -110,7 +110,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index ed708fbcb17..c91a4e15a7f 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -287,7 +287,7 @@ foreach ($object->fields as $key => $val) { $arrayfields[$newkey] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => empty($val['help']) ? '' : $val['help'], ); diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 6f5796526df..5b096009eb8 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -232,7 +232,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['p.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 08ce16ce1cd..8f766e8457e 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -1032,6 +1032,10 @@ class Conf extends stdClass $this->global->PRODUIT_MULTIPRICES_LIMIT = 5; } + if (!isset($this->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + $this->global->MAIN_CHECKBOX_LEFT_COLUMN = 1; + } + // For modules that want to disable top or left menu if (!empty($this->global->MAIN_HIDE_TOP_MENU)) { $this->dol_hide_topmenu = $this->global->MAIN_HIDE_TOP_MENU; diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 43a6d1be07e..cd00973d845 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -122,7 +122,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 04d491ef5da..7186f6d0357 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -131,7 +131,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index bee99153ffe..2118a59f8bc 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -201,7 +201,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['cf.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index 4f1bb1de9f8..8106d149b1c 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -119,11 +119,11 @@ foreach ($object->fields as $key => $val) { if (!empty($val['visible'])) { $visible = (int) dol_eval($val['visible'], 1); $arrayfields['t.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), - 'position'=>$val['position'], - 'help'=> isset($val['help']) ? $val['help'] : '' + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' ); } } diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index eb710892a92..01342b30a0b 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -118,11 +118,11 @@ foreach ($object->fields as $key => $val) { if (!empty($val['visible'])) { $visible = (int) dol_eval($val['visible'], 1); $arrayfields['t.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), - 'position'=>$val['position'], - 'help'=> isset($val['help']) ? $val['help'] : '' + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' ); } } diff --git a/htdocs/hrm/position.php b/htdocs/hrm/position.php index 8797dd4b772..fe81c3b76be 100644 --- a/htdocs/hrm/position.php +++ b/htdocs/hrm/position.php @@ -127,7 +127,7 @@ foreach ($objectposition->fields as $key => $val) { $arrayfields['t.' . $key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index 864c14d5cba..6bf6490cdcd 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -119,11 +119,11 @@ foreach ($object->fields as $key => $val) { if (!empty($val['visible'])) { $visible = (int) dol_eval($val['visible'], 1); $arrayfields['t.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), - 'position'=>$val['position'], - 'help'=> isset($val['help']) ? $val['help'] : '' + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' ); } } diff --git a/htdocs/hrm/skill_card.php b/htdocs/hrm/skill_card.php index d7b8e3d49ea..8c700d174d3 100644 --- a/htdocs/hrm/skill_card.php +++ b/htdocs/hrm/skill_card.php @@ -570,7 +570,7 @@ if ($action != "create" && $action != "edit") { $arrayfields['t.' . $key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index 8d73bb14783..0adb700e0b9 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -128,7 +128,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index 043ab6327b7..1fa05a34202 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -123,7 +123,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/loan/list.php b/htdocs/loan/list.php index 8271a8869f9..af46c57738a 100644 --- a/htdocs/loan/list.php +++ b/htdocs/loan/list.php @@ -84,7 +84,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 0e817b7e80e..322ffd0cb58 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -173,11 +173,11 @@ foreach ($object->fields as $key => $val) { if (!empty($val['visible'])) { $visible = (int) dol_eval($val['visible'], 1); $arrayfields['t.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), - 'position'=>$val['position'], - 'help'=> isset($val['help']) ? $val['help'] : '' + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' ); } } diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 76caec517df..3b496588d00 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -117,7 +117,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); @@ -128,7 +128,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible <= 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/partnership/admin/setup.php b/htdocs/partnership/admin/setup.php index 843ae3fc9fe..eaa75fc3b5e 100644 --- a/htdocs/partnership/admin/setup.php +++ b/htdocs/partnership/admin/setup.php @@ -166,7 +166,7 @@ print ''; print ''.$langs->trans("PARTNERSHIP_BACKLINKS_TO_CHECK").''; print ''; -$backlinks = (!getDolGlobalString('PARTNERSHIP_BACKLINKS_TO_CHECK') ? '' : $conf->global->PARTNERSHIP_BACKLINKS_TO_CHECK); +$backlinks = getDolGlobalString('PARTNERSHIP_BACKLINKS_TO_CHECK'); print ''; print ''; print 'dolibarr.org|dolibarr.fr|dolibarr.es'; diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index 09dd60c7d29..fe8bb0ce5e2 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -138,7 +138,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); @@ -674,7 +674,7 @@ $newcardbutton = ''; $newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitleSeparator(); -$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/partnership/partnership_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); +$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/partnership/partnership_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF'].($socid > 0 ? '?socid='.$socid : '')), '', $permissiontoadd); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 6335bf3c68e..02344f08b15 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -115,7 +115,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 6a4eb772ef7..ccaaf1663d6 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -284,7 +284,7 @@ $arrayfields = array( $arrayfields['p.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'] ); } diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 9373a6d7014..0642d445335 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -124,7 +124,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 79e89258c99..e6d6842d75a 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -115,7 +115,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_list.php b/htdocs/product/stock/stocktransfer/stocktransfer_list.php index da87eb71191..89a72528d7a 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_list.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_list.php @@ -110,11 +110,11 @@ foreach ($object->fields as $key => $val) { if (!empty($val['visible'])) { $visible = (int) dol_eval($val['visible'], 1); $arrayfields['t.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), - 'position'=>$val['position'], - 'help'=> isset($val['help']) ? $val['help'] : '' + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' ); } } diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 05edffb1ddb..b9dd9b0e8fb 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -230,7 +230,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['p.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index 2a31b345c4a..fd1ac85d7e5 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -119,7 +119,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php index 761483aaa92..30182793678 100644 --- a/htdocs/recruitment/recruitmentjobposition_list.php +++ b/htdocs/recruitment/recruitmentjobposition_list.php @@ -108,7 +108,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index df3717dabdb..2ad58926683 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -128,7 +128,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php index 195494fe945..547eef70ad3 100644 --- a/htdocs/salaries/payments.php +++ b/htdocs/salaries/payments.php @@ -139,7 +139,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 81abbdf02d9..5255efafd43 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2665,7 +2665,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio print ''; // Type Prospect/Customer/Supplier - print ''; @@ -2718,6 +2718,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio $NBPROFIDMAX = getDolGlobalInt('THIRDPARTY_MAX_NB_PROF_ID', 6); while ($i <= $NBPROFIDMAX) { $idprof = $langs->transcountry('ProfId'.$i, $object->country_code); + if (!empty($conf->dol_optimize_smallscreen)) { + $idprof = $langs->transcountry('ProfId'.$i.'Short', $object->country_code); + } if ($idprof != '-' && ($i <= $NBPROFIDMIN || !empty($langs->tab_translate['ProfId'.$i.$object->country_code]))) { print ''; print ''; print ''; // VAT print ''; // Price - print ''; + print ''; // Price multicurrency /*if (isModEnabled("multicurrency")) { @@ -1788,24 +1790,24 @@ if ($action == 'create') { }*/ // Quantity - print ''; + print ''; // Unit if (getDolGlobalInt('PRODUCT_USE_UNITS')) { print ''; } // Discount - print ''; + print ''; if (!empty($usemargins)) { print ''; + print ''; } print '
'.$langs->trans('NatureOfThirdParty').''; + print '
'.$langs->trans('NatureOfThirdParty').''; print $object->getTypeUrl(1); print '
'.$idprof.''; diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index 55d0091a80b..89b18c6fc60 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -547,7 +547,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index d7ccf72867c..d39b1fe9dc4 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -147,7 +147,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/variants/list.php b/htdocs/variants/list.php index a627c998cfc..ae3c9ee86ce 100644 --- a/htdocs/variants/list.php +++ b/htdocs/variants/list.php @@ -116,7 +116,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/webhook/target_list.php b/htdocs/webhook/target_list.php index 7fd775805b6..d37bb16779f 100644 --- a/htdocs/webhook/target_list.php +++ b/htdocs/webhook/target_list.php @@ -117,7 +117,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/webportal/class/html.formlistwebportal.class.php b/htdocs/webportal/class/html.formlistwebportal.class.php index 6412ce1de41..8dee9bb347b 100644 --- a/htdocs/webportal/class/html.formlistwebportal.class.php +++ b/htdocs/webportal/class/html.formlistwebportal.class.php @@ -191,7 +191,7 @@ class FormListWebPortal $arrayfields['t.' . $key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/workstation/workstation_list.php b/htdocs/workstation/workstation_list.php index 67e4ba8d2c2..1ece6dc7ded 100644 --- a/htdocs/workstation/workstation_list.php +++ b/htdocs/workstation/workstation_list.php @@ -119,7 +119,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); @@ -129,7 +129,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['wug.fk_usergroup'] = array( 'label' => $langs->trans('UserGroups'), 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => 1000, 'help' => empty($val['help']) ? '' : $val['help'], 'csslist' => 'minwidth100' @@ -139,7 +139,7 @@ $arrayfields['wug.fk_usergroup'] = array( $arrayfields['wr.fk_resource'] = array( 'label'=>$langs->trans('Resources'), 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position'=>1001, 'help' => empty($val['help']) ? '' : $val['help'] ); From 1f7306b19e50427626680a87b5b1b049202b3433 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 9 Jul 2024 17:49:34 +0200 Subject: [PATCH 48/66] Debug v20 --- htdocs/core/lib/functions.lib.php | 4 ++-- htdocs/core/tpl/commonfields_view.tpl.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 40f25fa3f59..ca326240d1e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -10179,8 +10179,8 @@ function verifCond($strToEvaluate, $onlysimplestring = '1') if (isset($strToEvaluate) && $strToEvaluate !== '') { //var_dump($strToEvaluate); //$rep = dol_eval($strToEvaluate, 1, 0, '1'); // to show the error - $rep = (int) dol_eval($strToEvaluate, 1, 1, $onlysimplestring); // The dol_eval() must contains all the "global $xxx;" for all variables $xxx found into the string condition - $rights = $rep && (!is_string($rep) || strpos($rep, 'Bad string syntax to evaluate') === false); + $rep = dol_eval($strToEvaluate, 1, 1, $onlysimplestring); // The dol_eval() must contains all the "global $xxx;" for all variables $xxx found into the string condition + $rights = (bool) $rep && (!is_string($rep) || strpos($rep, 'Bad string syntax to evaluate') === false); //var_dump($rights); } return $rights; diff --git a/htdocs/core/tpl/commonfields_view.tpl.php b/htdocs/core/tpl/commonfields_view.tpl.php index 6065f64e189..4cb908025f4 100644 --- a/htdocs/core/tpl/commonfields_view.tpl.php +++ b/htdocs/core/tpl/commonfields_view.tpl.php @@ -47,10 +47,10 @@ foreach ($object->fields as $key => $val) { if (abs($val['visible']) != 1 && abs($val['visible']) != 3 && abs($val['visible']) != 4 && abs($val['visible']) != 5) { continue; } - if (array_key_exists('enabled', $val) && isset($val['enabled']) && !verifCond($val['enabled'])) { continue; // We don't want this field } + if (in_array($key, array('ref', 'status'))) { continue; // Ref and status are already in dol_banner } From 6601503edc99523c7400cf27078bed92d85c379b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Jul 2024 19:28:09 +0200 Subject: [PATCH 49/66] Fix phpstan llxheader (#30328) * fix phpstan for llxHeader * fix phpstan for llxHeader * fix phpstan for llxFooter --- htdocs/admin/modules.php | 4 +-- htdocs/asterisk/wrapper.php | 25 ++++++++++++++++--- htdocs/collab/index.php | 3 ++- htdocs/document.php | 19 ++++++++++++-- htdocs/ecm/index.php | 3 ++- htdocs/ecm/index_auto.php | 3 ++- htdocs/ecm/index_medias.php | 3 ++- htdocs/imports/emptyexample.php | 25 ++++++++++++++++--- htdocs/product/stats/commande.php | 3 ++- htdocs/product/stats/commande_fournisseur.php | 3 ++- htdocs/product/stats/contrat.php | 3 ++- htdocs/product/stats/expedition.php | 2 +- htdocs/product/stats/facture_fournisseur.php | 3 ++- htdocs/product/stats/facturerec.php | 3 ++- htdocs/product/stats/mo.php | 3 ++- htdocs/product/stats/propal.php | 3 ++- htdocs/product/stats/reception.php | 3 ++- htdocs/product/stats/supplier_proposal.php | 2 +- htdocs/projet/activity/perday.php | 5 +--- htdocs/projet/activity/permonth.php | 2 +- htdocs/projet/activity/perweek.php | 2 +- htdocs/public/emailing/mailing-read.php | 23 +++++++++++++++-- htdocs/public/website/index.php | 23 +++++++++++++++-- htdocs/public/website/javascript.js.php | 23 +++++++++++++++-- htdocs/public/website/styles.css.php | 23 +++++++++++++++-- htdocs/viewimage.php | 25 ++++++++++++++++--- phpstan.neon.dist | 2 +- 27 files changed, 196 insertions(+), 45 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 3d560a7a724..765a72d38a7 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -8,7 +8,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2021-2023 Frédéric France + * Copyright (C) 2021-2024 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -374,7 +374,7 @@ if (!dol_is_dir($dirins)) { $dirins_ok = (dol_is_dir($dirins)); $help_url = 'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; -llxHeader('', $langs->trans("Setup"), $help_url, '', '', '', $morejs, $morecss, 0, 'mod-admin page-modules'); +llxHeader('', $langs->trans("Setup"), $help_url, '', 0, 0, $morejs, $morecss, 0, 'mod-admin page-modules'); // Search modules dirs diff --git a/htdocs/asterisk/wrapper.php b/htdocs/asterisk/wrapper.php index 6d79f15aa6c..6d18833819d 100644 --- a/htdocs/asterisk/wrapper.php +++ b/htdocs/asterisk/wrapper.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * 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 @@ -49,10 +50,24 @@ if (!defined('NOREQUIREAJAX')) { /** * Empty header * - * @ignore + * @param string $head Optional head lines + * @param string $title HTML title + * @param string $help_url Url links to help page + * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage + * For other external page: http://server/url + * @param string $target Target to use on links + * @param int $disablejs More content into html header + * @param int $disablehead More content into html header + * @param array|string $arrayofjs Array of complementary js files + * @param array|string $arrayofcss Array of complementary css files + * @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails) + * @param string $morecssonbody More CSS on body tag. For example 'classforhorizontalscrolloftabs'. + * @param string $replacemainareaby Replace call to main_area() by a print of this string + * @param int $disablenofollow Disable the "nofollow" on meta robot header + * @param int $disablenoindex Disable the "noindex" on meta robot header * @return void */ -function llxHeader() +function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) { print ''."\n"; print ''."\n"; @@ -63,10 +78,12 @@ function llxHeader() /** * Empty footer * - * @ignore + * @param string $comment A text to add as HTML comment into HTML generated page + * @param string $zone 'private' (for private pages) or 'public' (for public pages) + * @param int $disabledoutputofmessages Clear all messages stored into session without displaying them * @return void */ -function llxFooter() +function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) { print "\n".''."\n"; } diff --git a/htdocs/collab/index.php b/htdocs/collab/index.php index bee5d778dc7..8b8b8f5df1a 100644 --- a/htdocs/collab/index.php +++ b/htdocs/collab/index.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * 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 @@ -163,7 +164,7 @@ $form = new Form($db); $help_url = ''; -llxHeader('', $langs->trans("WebsiteSetup"), $help_url, '', 0, '', '', '', '', '', ''."\n".'
'); +llxHeader('', $langs->trans("WebsiteSetup"), $help_url, '', 0, 0, '', '', '', '', ''."\n".'
'); print "\n".'
'; print ''; diff --git a/htdocs/document.php b/htdocs/document.php index e204956acd3..6356944cc27 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -6,6 +6,7 @@ * Copyright (C) 2010 Pierre Morin * Copyright (C) 2010 Juanjo Menent * Copyright (C) 2022 Ferran Marcet + * Copyright (C) 2024 Frédéric France * * 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 @@ -77,10 +78,24 @@ if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias')) { /** * Header empty * - * @ignore + * @param string $head Optional head lines + * @param string $title HTML title + * @param string $help_url Url links to help page + * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage + * For other external page: http://server/url + * @param string $target Target to use on links + * @param int $disablejs More content into html header + * @param int $disablehead More content into html header + * @param array|string $arrayofjs Array of complementary js files + * @param array|string $arrayofcss Array of complementary css files + * @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails) + * @param string $morecssonbody More CSS on body tag. For example 'classforhorizontalscrolloftabs'. + * @param string $replacemainareaby Replace call to main_area() by a print of this string + * @param int $disablenofollow Disable the "nofollow" on meta robot header + * @param int $disablenoindex Disable the "noindex" on meta robot header * @return void */ -function llxHeader() +function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) { } /** diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index 405fb76bc5d..433b763f842 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -1,6 +1,7 @@ * Copyright (C) 2008-2010 Regis Houssin + * Copyright (C) 2024 Frédéric France * * 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 @@ -331,7 +332,7 @@ $moreheadjs .= ''."\n"; -llxHeader($moreheadcss.$moreheadjs, $langs->trans("ECMArea"), '', '', '', '', $morejs, '', 0, 0); +llxHeader($moreheadcss.$moreheadjs, $langs->trans("ECMArea"), '', '', 0, 0, $morejs, '', 0, 0); $head = ecm_prepare_dasboard_head(null); print dol_get_fiche_head($head, 'index', '', -1, ''); diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index 8c54ffad45f..ce1b824db58 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -3,6 +3,7 @@ * Copyright (C) 2008-2010 Regis Houssin * Copyright (C) 2016 Alexandre Spangaro * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -304,7 +305,7 @@ $moreheadjs .= ''."\n"; -llxHeader($moreheadcss.$moreheadjs, $langs->trans("ECMArea"), '', '', '', '', $morejs, '', 0, 0); +llxHeader($moreheadcss.$moreheadjs, $langs->trans("ECMArea"), '', '', 0, 0, $morejs, '', 0, 0); // Add sections to manage diff --git a/htdocs/ecm/index_medias.php b/htdocs/ecm/index_medias.php index b435cc77e47..aec8bbbb5eb 100644 --- a/htdocs/ecm/index_medias.php +++ b/htdocs/ecm/index_medias.php @@ -1,6 +1,7 @@ * Copyright (C) 2008-2010 Regis Houssin + * Copyright (C) 2024 Frédéric France * * 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 @@ -296,7 +297,7 @@ $moreheadjs .= ''."\n"; -llxHeader($moreheadcss.$moreheadjs, $langs->trans("ECMArea"), '', '', '', '', $morejs, '', 0, 0); +llxHeader($moreheadcss.$moreheadjs, $langs->trans("ECMArea"), '', '', 0, 0, $morejs, '', 0, 0); $head = ecm_prepare_dasboard_head(null); print dol_get_fiche_head($head, 'index_medias', '', -1, ''); diff --git a/htdocs/imports/emptyexample.php b/htdocs/imports/emptyexample.php index 9a5c706e5ac..ec84e98e714 100644 --- a/htdocs/imports/emptyexample.php +++ b/htdocs/imports/emptyexample.php @@ -1,5 +1,6 @@ + * Copyright (C) 2024 Frédéric France * * 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 @@ -29,10 +30,24 @@ if (!defined('NOTOKENRENEWAL')) { /** * This file is a wrapper, so empty header * - * @ignore + * @param string $head Optional head lines + * @param string $title HTML title + * @param string $help_url Url links to help page + * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage + * For other external page: http://server/url + * @param string $target Target to use on links + * @param int $disablejs More content into html header + * @param int $disablehead More content into html header + * @param array|string $arrayofjs Array of complementary js files + * @param array|string $arrayofcss Array of complementary css files + * @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails) + * @param string $morecssonbody More CSS on body tag. For example 'classforhorizontalscrolloftabs'. + * @param string $replacemainareaby Replace call to main_area() by a print of this string + * @param int $disablenofollow Disable the "nofollow" on meta robot header + * @param int $disablenoindex Disable the "noindex" on meta robot header * @return void */ -function llxHeader() +function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) { print 'Build an import example file'; } @@ -40,10 +55,12 @@ function llxHeader() /** * This file is a wrapper, so empty footer * - * @ignore + * @param string $comment A text to add as HTML comment into HTML generated page + * @param string $zone 'private' (for private pages) or 'public' (for public pages) + * @param int $disabledoutputofmessages Clear all messages stored into session without displaying them * @return void */ -function llxFooter() +function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) { print ''; } diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php index 3938a12ac32..ec005f9600e 100644 --- a/htdocs/product/stats/commande.php +++ b/htdocs/product/stats/commande.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2014 Florian Henry + * Copyright (C) 2024 Frédéric France * * 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 @@ -106,7 +107,7 @@ if ($id > 0 || !empty($ref)) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } - llxHeader("", "", $langs->trans("CardProduct".$product->type), '', '', 0, 0, '', '', 'mod-product page-stats_commande'); + llxHeader("", "", $langs->trans("CardProduct".$product->type), '', 0, 0, '', '', 'mod-product page-stats_commande'); if ($result > 0) { $head = product_prepare_head($product); diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index 6aae0d6e78b..ca239a6ed34 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2014 Florian Henry + * Copyright (C) 2024 Frédéric France * * 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 @@ -106,7 +107,7 @@ if ($id > 0 || !empty($ref)) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } - llxHeader("", "", $langs->trans("CardProduct".$product->type), '', '', 0, 0, '', '', 'mod-product page-stats_commande_fournisseur'); + llxHeader("", "", $langs->trans("CardProduct".$product->type), '', 0, 0, '', '', 'mod-product page-stats_commande_fournisseur'); if ($result > 0) { $head = product_prepare_head($product); diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php index ad2f9d22996..44b0599416d 100644 --- a/htdocs/product/stats/contrat.php +++ b/htdocs/product/stats/contrat.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003-2007 Rodolphe Quiedeville * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2024 Frédéric France * * 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 @@ -89,7 +90,7 @@ if ($id > 0 || !empty($ref)) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } - llxHeader("", "", $langs->trans("CardProduct".$product->type), '', '', 0, 0, '', '', 'mod-product page-stats_contrat'); + llxHeader("", "", $langs->trans("CardProduct".$product->type), '', 0, 0, '', '', 'mod-product page-stats_contrat'); if ($result > 0) { $head = product_prepare_head($product); diff --git a/htdocs/product/stats/expedition.php b/htdocs/product/stats/expedition.php index 4ea3eb5e000..3ac50b95f4e 100644 --- a/htdocs/product/stats/expedition.php +++ b/htdocs/product/stats/expedition.php @@ -101,7 +101,7 @@ if ($id > 0 || !empty($ref)) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } - llxHeader("", "", $langs->trans("CardProduct".$product->type), '', '', 0, 0, '', '', 'mod-product page-stats_expedition'); + llxHeader('', '', $langs->trans("CardProduct".$product->type), '', 0, 0, '', '', 'mod-product page-stats_expedition'); if ($result > 0) { $head = product_prepare_head($product); diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index 69d7f088513..8c99976e7b6 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2014 Florian Henry + * Copyright (C) 2024 Frédéric France * * 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 @@ -101,7 +102,7 @@ if ($id > 0 || !empty($ref)) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } - llxHeader("", "", $langs->trans("CardProduct".$product->type), '', '', 0, 0, '', '', 'mod-product page-stats_facture_fournisseur'); + llxHeader("", "", $langs->trans("CardProduct".$product->type), '', 0, 0, '', '', 'mod-product page-stats_facture_fournisseur'); if ($result > 0) { $head = product_prepare_head($product); diff --git a/htdocs/product/stats/facturerec.php b/htdocs/product/stats/facturerec.php index 69c1905031d..64f6402edd8 100644 --- a/htdocs/product/stats/facturerec.php +++ b/htdocs/product/stats/facturerec.php @@ -5,6 +5,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2014 Florian Henry * Copyright (C) 2022 Eric Seigne + * Copyright (C) 2024 Frédéric France * * 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 @@ -115,7 +116,7 @@ if ($id > 0 || !empty($ref)) { $helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; } - llxHeader('', $title, $helpurl, '', '', 0, 0, '', '', 'mod-product page-stats_facturerec'); + llxHeader('', $title, $helpurl, '', 0, 0, '', '', 'mod-product page-stats_facturerec'); if ($result > 0) { $head = product_prepare_head($product); diff --git a/htdocs/product/stats/mo.php b/htdocs/product/stats/mo.php index 53ccc1dc88a..0de7a78eb6d 100644 --- a/htdocs/product/stats/mo.php +++ b/htdocs/product/stats/mo.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2021 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2023 Gauthier VERDOL + * Copyright (C) 2024 Frédéric France * * 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 @@ -100,7 +101,7 @@ if ($id > 0 || !empty($ref)) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } - llxHeader("", "", $langs->trans("CardProduct".$product->type), '', '', 0, 0, '', '', 'mod-product page-stats_mo'); + llxHeader("", "", $langs->trans("CardProduct".$product->type), '', 0, 0, '', '', 'mod-product page-stats_mo'); if ($result > 0) { $head = product_prepare_head($product); diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index abfe0c64614..ba148724206 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2014 Florian Henry + * Copyright (C) 2024 Frédéric France * * 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 @@ -100,7 +101,7 @@ if ($id > 0 || !empty($ref)) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } - llxHeader("", "", $langs->trans("CardProduct".$product->type), '', '', 0, 0, '', '', '', 'mod-product page-stats_propal'); + llxHeader('', '', $langs->trans("CardProduct".$product->type), '', 0, 0, '', '', '', 'mod-product page-stats_propal'); if ($result > 0) { $head = product_prepare_head($product); diff --git a/htdocs/product/stats/reception.php b/htdocs/product/stats/reception.php index 61b0bcfc910..00ae9a1bf16 100644 --- a/htdocs/product/stats/reception.php +++ b/htdocs/product/stats/reception.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2014 Florian Henry * Copyright (C) 2024 Jean-Rémi Taponier + * Copyright (C) 2024 Frédéric France * * 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 @@ -99,7 +100,7 @@ if ($id > 0 || !empty($ref)) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } - llxHeader("", "", $langs->trans("CardProduct".$product->type), '', '', 0, 0, '', '', '', 'mod-product page-stats_reception'); + llxHeader('', '', $langs->trans("CardProduct".$product->type), '', 0, 0, 0, '', '', '', 'mod-product page-stats_reception'); if ($result > 0) { $head = product_prepare_head($product); diff --git a/htdocs/product/stats/supplier_proposal.php b/htdocs/product/stats/supplier_proposal.php index 9432db225f9..e8976ff8ff3 100644 --- a/htdocs/product/stats/supplier_proposal.php +++ b/htdocs/product/stats/supplier_proposal.php @@ -100,7 +100,7 @@ if ($id > 0 || !empty($ref)) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } - llxHeader("", "", $langs->trans("CardProduct".$product->type), '', '', 0, 0, '', '', '', 'mod-product page-stats_supplier_proposal'); + llxHeader("", "", $langs->trans("CardProduct".$product->type), '', 0, 0, 0, '', '', '', 'mod-product page-stats_supplier_proposal'); if ($result > 0) { $head = product_prepare_head($product); diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 292c19b82a0..15201157ea6 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -404,11 +404,8 @@ if ($morewherefilter) { // Get all task without any filter, so we can show total } $projectsrole = $taskstatic->getUserRolesForProjectsOrTasks($usertoprocess, null, ($project->id ? $project->id : 0), 0, $onlyopenedproject); $tasksrole = $taskstatic->getUserRolesForProjectsOrTasks(null, $usertoprocess, ($project->id ? $project->id : 0), 0, $onlyopenedproject); -//var_dump($usertoprocess); -//var_dump($projectsrole); -//var_dump($taskrole); -llxHeader("", $title, "", '', '', '', array('/core/js/timesheet.js')); +llxHeader('', $title, '', '', 0, 0, array('/core/js/timesheet.js')); //print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num, '', 'project'); diff --git a/htdocs/projet/activity/permonth.php b/htdocs/projet/activity/permonth.php index f293576f07b..cc866386fe9 100644 --- a/htdocs/projet/activity/permonth.php +++ b/htdocs/projet/activity/permonth.php @@ -423,7 +423,7 @@ $tasksrole = $taskstatic->getUserRolesForProjectsOrTasks(null, $usertoprocess, ( //var_dump($taskrole); -llxHeader("", $title, "", '', '', '', array('/core/js/timesheet.js')); +llxHeader('', $title, '', '', 0, 0, array('/core/js/timesheet.js')); //print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num, '', 'project'); diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 0fbd7fb06b3..a9e98b0f3c3 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -424,7 +424,7 @@ $tasksrole = $taskstatic->getUserRolesForProjectsOrTasks(null, $usertoprocess, ( //var_dump($taskrole); -llxHeader("", $title, "", '', '', '', array('/core/js/timesheet.js')); +llxHeader("", $title, "", '', 0, 0, array('/core/js/timesheet.js')); //print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num, '', 'project'); diff --git a/htdocs/public/emailing/mailing-read.php b/htdocs/public/emailing/mailing-read.php index 7510b377365..710dcbf395d 100644 --- a/htdocs/public/emailing/mailing-read.php +++ b/htdocs/public/emailing/mailing-read.php @@ -3,6 +3,7 @@ * Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2005-2011 Laurent Destailleur * Copyright (C) 2012 Florian Henry + * Copyright (C) 2024 Frédéric France * * 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 @@ -53,9 +54,24 @@ if (!defined('NOSESSION')) { /** * Header empty * + * @param string $head Optional head lines + * @param string $title HTML title + * @param string $help_url Url links to help page + * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage + * For other external page: http://server/url + * @param string $target Target to use on links + * @param int $disablejs More content into html header + * @param int $disablehead More content into html header + * @param array|string $arrayofjs Array of complementary js files + * @param array|string $arrayofcss Array of complementary css files + * @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails) + * @param string $morecssonbody More CSS on body tag. For example 'classforhorizontalscrolloftabs'. + * @param string $replacemainareaby Replace call to main_area() by a print of this string + * @param int $disablenofollow Disable the "nofollow" on meta robot header + * @param int $disablenoindex Disable the "noindex" on meta robot header * @return void */ -function llxHeader() +function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) { } @@ -63,9 +79,12 @@ function llxHeader() /** * Footer empty * + * @param string $comment A text to add as HTML comment into HTML generated page + * @param string $zone 'private' (for private pages) or 'public' (for public pages) + * @param int $disabledoutputofmessages Clear all messages stored into session without displaying them * @return void */ -function llxFooter() +function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) { } diff --git a/htdocs/public/website/index.php b/htdocs/public/website/index.php index 7c9e55d569f..1d9fe017ef7 100644 --- a/htdocs/public/website/index.php +++ b/htdocs/public/website/index.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -59,17 +60,35 @@ if (!defined('NOBROWSERNOTIF')) { /** * Header empty * + * @param string $head Optional head lines + * @param string $title HTML title + * @param string $help_url Url links to help page + * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage + * For other external page: http://server/url + * @param string $target Target to use on links + * @param int $disablejs More content into html header + * @param int $disablehead More content into html header + * @param array|string $arrayofjs Array of complementary js files + * @param array|string $arrayofcss Array of complementary css files + * @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails) + * @param string $morecssonbody More CSS on body tag. For example 'classforhorizontalscrolloftabs'. + * @param string $replacemainareaby Replace call to main_area() by a print of this string + * @param int $disablenofollow Disable the "nofollow" on meta robot header + * @param int $disablenoindex Disable the "noindex" on meta robot header * @return void */ -function llxHeader() +function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) { } /** * Footer empty * + * @param string $comment A text to add as HTML comment into HTML generated page + * @param string $zone 'private' (for private pages) or 'public' (for public pages) + * @param int $disabledoutputofmessages Clear all messages stored into session without displaying them * @return void */ -function llxFooter() +function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) { } diff --git a/htdocs/public/website/javascript.js.php b/htdocs/public/website/javascript.js.php index 3ada7012645..9db4f059d5a 100644 --- a/htdocs/public/website/javascript.js.php +++ b/htdocs/public/website/javascript.js.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -50,17 +51,35 @@ if (!defined('NOBROWSERNOTIF')) { /** * Header empty * + * @param string $head Optional head lines + * @param string $title HTML title + * @param string $help_url Url links to help page + * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage + * For other external page: http://server/url + * @param string $target Target to use on links + * @param int $disablejs More content into html header + * @param int $disablehead More content into html header + * @param array|string $arrayofjs Array of complementary js files + * @param array|string $arrayofcss Array of complementary css files + * @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails) + * @param string $morecssonbody More CSS on body tag. For example 'classforhorizontalscrolloftabs'. + * @param string $replacemainareaby Replace call to main_area() by a print of this string + * @param int $disablenofollow Disable the "nofollow" on meta robot header + * @param int $disablenoindex Disable the "noindex" on meta robot header * @return void */ -function llxHeader() +function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) { } /** * Footer empty * + * @param string $comment A text to add as HTML comment into HTML generated page + * @param string $zone 'private' (for private pages) or 'public' (for public pages) + * @param int $disabledoutputofmessages Clear all messages stored into session without displaying them * @return void */ -function llxFooter() +function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) { } diff --git a/htdocs/public/website/styles.css.php b/htdocs/public/website/styles.css.php index 22e1319322f..4dbb3b3a89d 100644 --- a/htdocs/public/website/styles.css.php +++ b/htdocs/public/website/styles.css.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -50,17 +51,35 @@ if (!defined('NOBROWSERNOTIF')) { /** * Header empty * + * @param string $head Optional head lines + * @param string $title HTML title + * @param string $help_url Url links to help page + * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage + * For other external page: http://server/url + * @param string $target Target to use on links + * @param int $disablejs More content into html header + * @param int $disablehead More content into html header + * @param array|string $arrayofjs Array of complementary js files + * @param array|string $arrayofcss Array of complementary css files + * @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails) + * @param string $morecssonbody More CSS on body tag. For example 'classforhorizontalscrolloftabs'. + * @param string $replacemainareaby Replace call to main_area() by a print of this string + * @param int $disablenofollow Disable the "nofollow" on meta robot header + * @param int $disablenoindex Disable the "noindex" on meta robot header * @return void */ -function llxHeader() +function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) { } /** * Footer empty * + * @param string $comment A text to add as HTML comment into HTML generated page + * @param string $zone 'private' (for private pages) or 'public' (for public pages) + * @param int $disabledoutputofmessages Clear all messages stored into session without displaying them * @return void */ -function llxFooter() +function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) { } diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index b415af7be7b..75f7e34965c 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -2,6 +2,7 @@ /* Copyright (C) 2004-2005 Rodolphe Quiedeville * Copyright (C) 2005-2016 Laurent Destailleur * Copyright (C) 2005-2016 Regis Houssin + * Copyright (C) 2024 Frédéric France * * 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 @@ -112,19 +113,35 @@ if (is_numeric($entity)) { /** * Header empty * - * @ignore + * @param string $head Optional head lines + * @param string $title HTML title + * @param string $help_url Url links to help page + * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage + * For other external page: http://server/url + * @param string $target Target to use on links + * @param int $disablejs More content into html header + * @param int $disablehead More content into html header + * @param array|string $arrayofjs Array of complementary js files + * @param array|string $arrayofcss Array of complementary css files + * @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails) + * @param string $morecssonbody More CSS on body tag. For example 'classforhorizontalscrolloftabs'. + * @param string $replacemainareaby Replace call to main_area() by a print of this string + * @param int $disablenofollow Disable the "nofollow" on meta robot header + * @param int $disablenoindex Disable the "noindex" on meta robot header * @return void */ -function llxHeader() +function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) { } /** * Footer empty * - * @ignore + * @param string $comment A text to add as HTML comment into HTML generated page + * @param string $zone 'private' (for private pages) or 'public' (for public pages) + * @param int $disabledoutputofmessages Clear all messages stored into session without displaying them * @return void */ -function llxFooter() +function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) { } diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 8421a1efc2a..33be2e16802 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -48,7 +48,7 @@ parameters: ignoreErrors: - '#Result of function fieldList#' - '#Caught class Stripe#' - - '#Function llx.* invoked with#' + - '#Function llxHeaderVierge invoked with#' - '#always exists and is not falsy#' - '#always exists and is not nullable#' - '#is always fal#' From 94feb2cfa7dd5eeff6407ae9681ea8e7bafc56e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Jul 2024 19:28:59 +0200 Subject: [PATCH 50/66] fix phpstan expects values (#30324) * fix phpstan expects values * fix phpstan expects values --- htdocs/categories/viewcat.php | 21 +++++++++++---------- htdocs/comm/action/peruser.php | 4 ++-- htdocs/core/actions_massactions.inc.php | 12 ++++++------ htdocs/core/lib/invoice2.lib.php | 4 ++-- htdocs/core/lib/pdf.lib.php | 4 ++-- htdocs/holiday/define_holiday.php | 2 +- htdocs/hrm/skill_card.php | 4 ++-- htdocs/modulebuilder/index.php | 4 ++-- htdocs/paybox/lib/paybox.lib.php | 3 ++- htdocs/public/payment/newpayment.php | 3 ++- htdocs/resource/agenda.php | 19 ++++++++++--------- phpstan.neon.dist | 6 ++---- 12 files changed, 44 insertions(+), 42 deletions(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 74a1f0c4cfe..55df5382b7f 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -7,6 +7,7 @@ * Copyright (C) 2020 Tobias Sekan * Copyright (C) 2020 Josep Lluís Amador * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -580,7 +581,7 @@ if ($type == Categorie::TYPE_PRODUCT) { print ''."\n"; } } else { - print_barre_liste($langs->trans("ProductsAndServices"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'products'); + print_barre_liste($langs->trans("ProductsAndServices"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'products'); accessforbidden("NotEnoughPermissions", 0, 0); } } @@ -667,7 +668,7 @@ if ($type == Categorie::TYPE_CUSTOMER) { print ''."\n"; } } else { - print_barre_liste($langs->trans("Customers"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'companies'); + print_barre_liste($langs->trans("Customers"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'companies'); accessforbidden("NotEnoughPermissions", 0, 0); } } @@ -756,7 +757,7 @@ if ($type == Categorie::TYPE_SUPPLIER) { print ''."\n"; } } else { - print_barre_liste($langs->trans("Suppliers"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'companies'); + print_barre_liste($langs->trans("Suppliers"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'companies'); accessforbidden("NotEnoughPermissions", 0, 0); } } @@ -847,7 +848,7 @@ if ($type == Categorie::TYPE_MEMBER) { print ''."\n"; } } else { - print_barre_liste($langs->trans("Member"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'members'); + print_barre_liste($langs->trans("Member"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'members'); accessforbidden("NotEnoughPermissions", 0, 0); } } @@ -940,7 +941,7 @@ if ($type == Categorie::TYPE_CONTACT) { print ''."\n"; } } else { - print_barre_liste($langs->trans("Contact"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'contact'); + print_barre_liste($langs->trans("Contact"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'contact'); accessforbidden("NotEnoughPermissions", 0, 0); } } @@ -1030,7 +1031,7 @@ if ($type == Categorie::TYPE_ACCOUNT) { print ''."\n"; } } else { - print_barre_liste($langs->trans("Banque"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'bank'); + print_barre_liste($langs->trans("Banque"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'bank'); accessforbidden("NotEnoughPermissions", 0, 0); } } @@ -1120,7 +1121,7 @@ if ($type == Categorie::TYPE_PROJECT) { print ''."\n"; } } else { - print_barre_liste($langs->trans("Project"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'project'); + print_barre_liste($langs->trans("Project"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'project'); accessforbidden("NotEnoughPermissions", 0, 0); } } @@ -1204,7 +1205,7 @@ if ($type == Categorie::TYPE_USER) { print ''."\n"; } } else { - print_barre_liste($langs->trans("Users"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'user'); + print_barre_liste($langs->trans("Users"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'user'); accessforbidden("NotEnoughPermissions", 0, 0); } } @@ -1275,7 +1276,7 @@ if ($type == Categorie::TYPE_WAREHOUSE) { print ''."\n"; } } else { - print_barre_liste($langs->trans("Warehouse"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'stock'); + print_barre_liste($langs->trans("Warehouse"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'stock'); accessforbidden("NotEnoughPermissions", 0, 0); } } @@ -1363,7 +1364,7 @@ if ($type == Categorie::TYPE_TICKET) { print ''."\n"; } } else { - print_barre_liste($langs->trans("Ticket"), null, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'ticket'); + print_barre_liste($langs->trans("Ticket"), null, $_SERVER["PHP_SELF"], '', '', '', '', 0, '', 'ticket'); accessforbidden("NotEnoughPermissions", 0, 0); } } diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 1ee52af1ccc..0c6a2f89113 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2014 Cedric GROSS - * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2023 Florian HENRY * Copyright (C) 2024 MDW * @@ -508,7 +508,7 @@ if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda' $newcardbutton .= dolGetButtonTitle($langs->trans("AddAction"), '', 'fa fa-plus-circle', $urltocreateaction); } -$num = ''; +$num = 0; print_barre_liste($langs->trans("Agenda"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, -1, 'object_action', 0, $nav.''.$newcardbutton, '', $limit, 1, 0, 1, $viewmode); diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index b0639ec207c..0aa6fc47f66 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1,10 +1,10 @@ - * Copyright (C) 2018-2021 Nicolas ZABOURI - * Copyright (C) 2018 Juanjo Menent - * Copyright (C) 2019 Ferran Marcet - * Copyright (C) 2019-2024 Frédéric France - * Copyright (C) 2024 MDW +/* Copyright (C) 2015-2017 Laurent Destailleur + * Copyright (C) 2018-2021 Nicolas ZABOURI + * Copyright (C) 2018 Juanjo Menent + * Copyright (C) 2019 Ferran Marcet + * Copyright (C) 2019-2024 Frédéric France + * Copyright (C) 2024 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 diff --git a/htdocs/core/lib/invoice2.lib.php b/htdocs/core/lib/invoice2.lib.php index 18914beba62..4a89aaf8f6b 100644 --- a/htdocs/core/lib/invoice2.lib.php +++ b/htdocs/core/lib/invoice2.lib.php @@ -42,14 +42,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; * @param integer $paymentdateafter Payment after date (must includes hour) * @param integer $paymentdatebefore Payment before date (must includes hour) * @param int $usestdout Add information onto standard output - * @param int $regenerate ''=Use existing PDF files, 'nameofpdf'=Regenerate all PDF files using the template + * @param string $regenerate ''=Use existing PDF files, 'nameofpdf'=Regenerate all PDF files using the template * @param string $filesuffix Suffix to add into file name of generated PDF * @param string $paymentbankid Only if payment on this bank account id * @param array $thirdpartiesid List of thirdparties id when using filter=excludethirdpartiesid or filter=onlythirdpartiesid * @param string $fileprefix Prefix to add into filename of generated PDF * @return int Error code */ -function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filter, $dateafterdate, $datebeforedate, $paymentdateafter, $paymentdatebefore, $usestdout, $regenerate = 0, $filesuffix = '', $paymentbankid = '', $thirdpartiesid = [], $fileprefix = 'mergedpdf') +function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filter, $dateafterdate, $datebeforedate, $paymentdateafter, $paymentdatebefore, $usestdout, $regenerate = '', $filesuffix = '', $paymentbankid = '', $thirdpartiesid = [], $fileprefix = 'mergedpdf') { $sql = "SELECT DISTINCT f.rowid, f.ref"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 4096253a94d..ba3988492e1 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1380,14 +1380,14 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ /** * Show linked objects for PDF generation * - * @param TCPDF $pdf Object PDF + * @param TCPDF $pdf Object PDF * @param object $object Object * @param Translate $outputlangs Object lang * @param int $posx X * @param int $posy Y * @param float $w Width of cells. If 0, they extend up to the right margin of the page. * @param float $h Cell minimum height. The cell extends automatically if needed. - * @param int $align Align + * @param string $align Align * @param string $default_font_size Font size * @return float The Y PDF position */ diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 520b0a7155a..05c5dec246a 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -257,7 +257,7 @@ print ''; print ''; $title = $langs->trans("MenuConfCP"); -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $massactionbutton, '', '', 'title_hrm', 0, '', '', $limit, 0, 0, 1); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $massactionbutton, 0, '', 'title_hrm', 0, '', '', $limit, 0, 0, 1); include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; diff --git a/htdocs/hrm/skill_card.php b/htdocs/hrm/skill_card.php index 587a3bb1337..0d6a134737b 100644 --- a/htdocs/hrm/skill_card.php +++ b/htdocs/hrm/skill_card.php @@ -4,7 +4,7 @@ * Copyright (C) 2021 Greg Rastklan * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND - * Copyright (C) 2023 Frédéric France + * Copyright (C) 2023-2024 Frédéric France * * 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 @@ -632,7 +632,7 @@ if ($action != "create" && $action != "edit") { $massactionbutton = ""; //$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/hrm/skilldet_card.php', 1) . '?action=create&backtopage=' . urlencode($_SERVER['PHP_SELF']) . $param_fk . '&backtopage=' . $backtopage, '', $permissiontoadd); - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_' . $object->picto, 0, "", '', '', 0, 0, 1); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_' . $object->picto, 0, '', '', 0, 0, 0, 1); // Add code for pre mass action (confirmation or email presend form) $topicmail = "SendSkilldetRef"; diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 9ab22172df3..fb13dbb86e0 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -4361,7 +4361,7 @@ if ($module == 'initmodule') { $newproperty = dolGetButtonTitle($langs->trans('NewProperty'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/modulebuilder/index.php?tab=objects&module='.urlencode($module).'&tabobj=createproperty&obj='.urlencode($tabobj)); $nbOfProperties = count($reflectorpropdefault['fields']); - print_barre_liste($langs->trans("ObjectProperties"), 0, $_SERVER["PHP_SELF"], '', '', '', '', '', $nbOfProperties, '', 0, $newproperty, '', '', 0, 0, 1); + print_barre_liste($langs->trans("ObjectProperties"), 0, $_SERVER["PHP_SELF"], '', '', '', '', 0, $nbOfProperties, '', 0, $newproperty, '', 0, 0, 0, 1); //var_dump($reflectorpropdefault);exit; print ''."\n"; @@ -4802,7 +4802,7 @@ if ($module == 'initmodule') { $newdict = dolGetButtonTitle($langs->trans('NewDictionary'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/modulebuilder/index.php?tab=dictionaries&module='.urlencode($module).'&tabdic=newdictionary'); - print_barre_liste($langs->trans("ListOfDictionariesEntries"), '', $_SERVER["PHP_SELF"], '', '', '', '', '', '', '', 0, $newdict, '', '', 0, 0, 1); + print_barre_liste($langs->trans("ListOfDictionariesEntries"), '', $_SERVER["PHP_SELF"], '', '', '', '', 0, '', '', 0, $newdict, '', 0, 0, 0, 1); if ($tabdic != 'newdictionary') { print '
'; diff --git a/htdocs/paybox/lib/paybox.lib.php b/htdocs/paybox/lib/paybox.lib.php index 6cc94d4d6f3..25bba034e17 100644 --- a/htdocs/paybox/lib/paybox.lib.php +++ b/htdocs/paybox/lib/paybox.lib.php @@ -2,6 +2,7 @@ /* Copyright (C) 2008-2009 Laurent Destailleur * Copyright (C) 2005-2007 Regis Houssin * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -29,7 +30,7 @@ /** * Create a redirect form to paybox form * - * @param int $PRICE Price + * @param float $PRICE Price * @param string $CURRENCY Currency * @param string $EMAIL EMail * @param string $urlok Url to go back if payment is OK diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 177c4ae64c0..810ad196576 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -6,6 +6,7 @@ * Copyright (C) 2018-2021 Thibault FOUCART * Copyright (C) 2021 Waël Almoman * Copyright (C) 2021 Dorian Vabre + * Copyright (C) 2024 Frédéric France * * 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 @@ -465,7 +466,7 @@ if ($action == 'dopayment') { dol_syslog("newpayment.php call paybox api and do redirect", LOG_DEBUG); include_once DOL_DOCUMENT_ROOT.'/paybox/lib/paybox.lib.php'; - print_paybox_redirect($PRICE, $conf->currency, $email, $urlok, $urlko, $FULLTAG); + print_paybox_redirect((float) $PRICE, $conf->currency, $email, $urlok, $urlko, $FULLTAG); session_destroy(); exit; diff --git a/htdocs/resource/agenda.php b/htdocs/resource/agenda.php index 14bc13a2f4f..3ccacf0a371 100644 --- a/htdocs/resource/agenda.php +++ b/htdocs/resource/agenda.php @@ -1,12 +1,13 @@ - * Copyright (C) 2005 Brice Davoleau - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2006-2015 Laurent Destailleur - * Copyright (C) 2007 Patrick Raguin - * Copyright (C) 2010 Juanjo Menent - * Copyright (C) 2015 Marcos García - * Copyright (C) 2018 Florain Henry + * Copyright (C) 2005 Brice Davoleau + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2006-2015 Laurent Destailleur + * Copyright (C) 2007 Patrick Raguin + * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2015 Marcos García + * Copyright (C) 2018 Florain Henry * * 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 @@ -177,7 +178,7 @@ if ($object->id > 0) { $param .= '&limit='.((int) $limit); } - print_barre_liste($langs->trans("ActionsOnResource"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', '', '', '', 0, 1, 1); + print_barre_liste($langs->trans("ActionsOnResource"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, '', '', 0, 1, 1); // List of all actions $filters = array(); diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 33be2e16802..b4450f1df06 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -62,21 +62,19 @@ parameters: - '#.*phan-var#' - '#\$httpStatusCode of class Luracast\\Restler\\RestException constructor expects string, int given.#' - '#expects \(callable#' - - '#expects bool#' - - '#expects bool, int given.#' + - '#expects bool\|string#' + - '#expects bool, int#' - '#expects bool, string given.#' - '#expects int\|#' - '#expects int\|#' - '#expects int<-2, 2>, bool given.#' - '#expects int<0, 1>#' - - '#print.* expects int, string#' - '#load.* expects int, string#' - '#ajax.* expects int, string#' - '#measu.* expects int, string#' - '#color.* expects int, string#' - '#imap.* expects int, string#' - '#show.* expects int, string#' - - '#pdf.* expects int, string#' - '#dol.* expects int, string#' - '#get.* expects int, string#' - '#send.* expects int, string#' From fbbdf7fb3ec5e96f12cce8ce94da39c4859c8cdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Jul 2024 19:29:35 +0200 Subject: [PATCH 51/66] fix cti (#30323) --- htdocs/core/db/DoliDB.class.php | 2 +- htdocs/user/param_ihm.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index 8895cdf83ec..d6c52dc39bb 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -47,7 +47,7 @@ abstract class DoliDB implements Database public $forcecollate = 'utf8_unicode_ci'; /** @var resource Resultset of last query */ - private $_results; + private $_results; // @phpstan-ignore-line /** @var bool true if connected, else false */ public $connected; diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index a933a7dffaa..779bcecafbc 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -283,6 +283,7 @@ if ($reshook < 0) { foreach ($tmparray as $key => $val) { $tmparray[$key]['data-html'] = img_picto($langs->trans($val['label']), empty($val['picto']) ? 'generic' : $val['picto'], 'class="pictofixedwidth"').$langs->trans($val['label']); $tmparray[$key]['label'] = $langs->trans($val['label']); + $tmparray[$key]['picto'] = empty($val['picto']) ? 'generic' : $val['picto']; } $head = user_prepare_head($object); From fce19af830ba1a8f1459075dea562e849dc0a612 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 9 Jul 2024 19:30:34 +0200 Subject: [PATCH 52/66] Use HasRight() (#30322) * Use HasRight() * se HasRight() --- htdocs/eventorganization/conferenceorbooth_card.php | 2 +- htdocs/eventorganization/conferenceorbooth_contact.php | 2 +- htdocs/eventorganization/conferenceorbooth_document.php | 2 +- htdocs/eventorganization/conferenceorboothattendee_card.php | 2 +- htdocs/mrp/mo_card.php | 5 +++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index 5f00a49e9d6..e5b0f396a0e 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -88,7 +88,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ // Permissions $permissiontoread = $user->hasRight('eventorganization', 'read'); $permissiontoadd = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php -$permissiontodelete = $user->rights->eventorganization->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); +$permissiontodelete = $user->hasRight('eventorganization', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); $permissionnote = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_dellink.inc.php $upload_dir = $conf->eventorganization->multidir_output[isset($object->entity) ? $object->entity : 1]; diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php index b2ae4685c89..89a6771fa30 100644 --- a/htdocs/eventorganization/conferenceorbooth_contact.php +++ b/htdocs/eventorganization/conferenceorbooth_contact.php @@ -79,7 +79,7 @@ $result = restrictedArea($user, 'eventorganization', $object->id, '', '', 'fk_so $permissiontoread = $user->hasRight('eventorganization', 'read'); $permissiontoadd = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php -$permissiontodelete = $user->rights->eventorganization->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); +$permissiontodelete = $user->hasRight('eventorganization', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); $permissionnote = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_dellink.inc.php $upload_dir = $conf->eventorganization->multidir_output[isset($object->entity) ? $object->entity : 1]; diff --git a/htdocs/eventorganization/conferenceorbooth_document.php b/htdocs/eventorganization/conferenceorbooth_document.php index da8471988d9..778711f9a86 100644 --- a/htdocs/eventorganization/conferenceorbooth_document.php +++ b/htdocs/eventorganization/conferenceorbooth_document.php @@ -93,7 +93,7 @@ if ($id > 0 || !empty($ref)) { // Permissions $permissiontoread = $user->hasRight('eventorganization', 'read'); $permissiontoadd = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php -$permissiontodelete = $user->rights->eventorganization->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); +$permissiontodelete = $user->hasRight('eventorganization', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); $permissionnote = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_dellink.inc.php $upload_dir = $conf->eventorganization->multidir_output[isset($object->entity) ? $object->entity : 1]; diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index 4e6074703a6..5c260e275d0 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -115,7 +115,7 @@ if ($object->fk_project > 0) { // Permissions $permissiontoread = $user->hasRight('eventorganization', 'read'); $permissiontoadd = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php -$permissiontodelete = $user->rights->eventorganization->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); +$permissiontodelete = $user->hasRight('eventorganization', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); $permissionnote = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_dellink.inc.php $upload_dir = $conf->eventorganization->multidir_output[isset($object->entity) ? $object->entity : 1]; diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index df1f9e64683..17f5aefcb62 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2017-2020 Laurent Destailleur +/* Copyright (C) 2024 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 @@ -108,7 +109,7 @@ $result = restrictedArea($user, 'mrp', $object->id, 'mrp_mo', '', 'fk_soc', 'row $permissionnote = $user->hasRight('mrp', 'write'); // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->hasRight('mrp', 'write'); // Used by the include of actions_dellink.inc.php $permissiontoadd = $user->hasRight('mrp', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php -$permissiontodelete = $user->rights->mrp->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); +$permissiontodelete = $user->hasRight('mrp', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); $upload_dir = $conf->mrp->multidir_output[isset($object->entity) ? $object->entity : 1]; From 0b0818506a326383932876e8ff446d67ff7017cb Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 9 Jul 2024 19:37:34 +0200 Subject: [PATCH 53/66] Add llxHeader body css for event organization (#30321) --- .../eventorganization/conferenceorbooth_card.php | 10 ++++++---- .../conferenceorbooth_contact.php | 13 +++++++------ .../conferenceorbooth_document.php | 10 ++++++---- .../eventorganization/conferenceorbooth_list.php | 11 ++++++----- .../conferenceorboothattendee_card.php | 8 +++++--- .../conferenceorboothattendee_list.php | 11 ++++++----- .../conferenceorboothattendee_note.php | 15 ++++++++------- .../eventorganization/eventorganizationindex.php | 12 +++++++----- 8 files changed, 51 insertions(+), 39 deletions(-) diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index 5c00c56499d..a4cee43b84e 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -1,6 +1,7 @@ - * Copyright (C) 2021 Florian Henry +/* Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2021 Florian Henry + * Copyright (C) 2024 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 @@ -171,8 +172,9 @@ $formfile = new FormFile($db); $formproject = new FormProjets($db); $title = $langs->trans("ConferenceOrBooth"); -$help_url = ''; -llxHeader('', $title, $help_url); +$help_url='EN:Module_Event_Organization'; + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-eventorganization page-card'); if ($action == 'create') { $result = $projectstatic->fetch(GETPOST('fk_project')); diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php index bd7e7c087a5..b752bc13a3e 100644 --- a/htdocs/eventorganization/conferenceorbooth_contact.php +++ b/htdocs/eventorganization/conferenceorbooth_contact.php @@ -1,6 +1,7 @@ - * Copyright (C) 2021 Florian HENRY +/* Copyright (C) 2007-2017 Laurent Destailleur + * Copyright (C) 2021 Florian HENRY + * Copyright (C) 2024 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 @@ -148,14 +149,14 @@ $contactstatic = new Contact($db); $userstatic = new User($db); $title = $langs->trans('ConferenceOrBooth')." - ".$langs->trans('ContactsAddresses'); -$help_url = ''; -//$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('', $title, $help_url); +$help_url='EN:Module_Event_Organization'; + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-eventorganization page-card_contact'); /* *************************************************************************** */ /* */ -/* View and edit mode */ +/* View and edit mode */ /* */ /* *************************************************************************** */ diff --git a/htdocs/eventorganization/conferenceorbooth_document.php b/htdocs/eventorganization/conferenceorbooth_document.php index ab8cb6a96b8..3f5b2e06b2d 100644 --- a/htdocs/eventorganization/conferenceorbooth_document.php +++ b/htdocs/eventorganization/conferenceorbooth_document.php @@ -1,6 +1,7 @@ - * Copyright (C) 2021 Florian Henry +/* Copyright (C) 2007-2017 Laurent Destailleur + * Copyright (C) 2021 Florian Henry + * Copyright (C) 2024 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 @@ -130,8 +131,9 @@ include_once DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; $form = new Form($db); $title = $langs->trans("ConferenceOrBooth").' - '.$langs->trans("Files"); -$help_url = ''; -llxHeader('', $title, $help_url); +$help_url='EN:Module_Event_Organization'; + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-eventorganization page-card_documents'); $result = $projectstatic->fetch($object->fk_project); if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) { diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 4211eba558a..6946df93db1 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -1,7 +1,8 @@ - * Copyright (C) 2021 Florian Henry - * Copyright (C) 2023 Frédéric France +/* Copyright (C) 2007-2017 Laurent Destailleur + * Copyright (C) 2021 Florian Henry + * Copyright (C) 2023 Frédéric France + * Copyright (C) 2024 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 @@ -275,7 +276,7 @@ $now = dol_now(); $title = $langs->trans("EventOrganizationConfOrBoothes"); $help_url = "EN:Module_Event_Organization"; -$help_url = ''; + $morejs = array(); $morecss = array(); @@ -305,7 +306,7 @@ if ($projectid > 0 || $projectref) { // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-eventorganization page-list'); if ($projectid > 0) { diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index f400e55e38a..073ca13fc48 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2024 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 @@ -204,8 +205,9 @@ $formfile = new FormFile($db); $formproject = new FormProjets($db); $title = $langs->trans("ConferenceOrBoothAttendee"); -$help_url = ''; -llxHeader('', $title, $help_url); +$help_url='EN:Module_Event_Organization'; + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-eventorganization page-attendee-card'); $result = $projectstatic->fetch(empty($confOrBooth->fk_project) ? $fk_project : $confOrBooth->fk_project); if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) { diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 262b1df7b51..8fe148d0189 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -1,6 +1,7 @@ - * Copyright (C) 2021 Florian Henry +/* Copyright (C) 2017-2024 Laurent Destailleur + * Copyright (C) 2021 Florian Henry + * Copyright (C) 2024 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 @@ -237,8 +238,8 @@ if (empty($reshook)) { $form = new Form($db); $now = dol_now(); -//$help_url="EN:Module_ConferenceOrBoothAttendee|FR:Module_ConferenceOrBoothAttendee_FR|ES:Módulo_ConferenceOrBoothAttendee"; -$help_url = ''; +$help_url = "EN:Module_Event_Organization"; + $morejs = array(); $morecss = array(); @@ -390,7 +391,7 @@ if ($confOrBooth->id > 0) { // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'classforhorizontalscrolloftabs'); +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-eventorganization page-attendee-list classforhorizontalscrolloftabs'); diff --git a/htdocs/eventorganization/conferenceorboothattendee_note.php b/htdocs/eventorganization/conferenceorboothattendee_note.php index 12cd4852d27..06887d59cc4 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_note.php +++ b/htdocs/eventorganization/conferenceorboothattendee_note.php @@ -1,7 +1,7 @@ - * Copyright (C) ---Put here your own copyright and developer email--- - * Copyright (C) 2024 Frédéric France +/* Copyright (C) 2007-2017 Laurent Destailleur + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 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 @@ -83,16 +83,17 @@ if (empty($reshook)) { $form = new Form($db); -//$help_url='EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes'; -$help_url = ''; -llxHeader('', $langs->trans('ConferenceOrBoothAttendee'), $help_url); +$title = $langs->trans('ConferenceOrBoothAttendee'); +$help_url = "EN:Module_Event_Organization"; + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-eventorganization page-attendee-card_note'); if ($id > 0 || !empty($ref)) { $object->fetch_thirdparty(); $head = conferenceorboothAttendeePrepareHead($object); - print dol_get_fiche_head($head, 'note', $langs->trans("ConferenceOrBoothAttendee"), -1, $object->picto); + print dol_get_fiche_head($head, 'note', $title, -1, $object->picto); // Object card // ------------------------------------------------------------ diff --git a/htdocs/eventorganization/eventorganizationindex.php b/htdocs/eventorganization/eventorganizationindex.php index fe1e16ba5a0..657be99060a 100644 --- a/htdocs/eventorganization/eventorganizationindex.php +++ b/htdocs/eventorganization/eventorganizationindex.php @@ -1,8 +1,9 @@ - * Copyright (C) 2004-2015 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2015 Jean-François Ferry +/* Copyright (C) 2001-2005 Rodolphe Quiedeville + * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2024 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 @@ -62,8 +63,9 @@ $form = new Form($db); $formfile = new FormFile($db); $title = $langs->trans('EventOrganizationArea'); +$help_url='EN:Module_Event_Organization'; -llxHeader('', $title, ''); +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-eventorganization page-index'); print load_fiche_titre($langs->trans("EventOrganizationArea"), '', 'eventorganization.png@eventorganization'); From 2f351ae4dc80c5e899333be26a633f5e1c67843f Mon Sep 17 00:00:00 2001 From: Mohamed DAOUD Date: Tue, 9 Jul 2024 19:38:23 +0200 Subject: [PATCH 54/66] editinline message (#30330) --- htdocs/website/index.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index b7db73f2207..ad0522a4923 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -447,7 +447,6 @@ if ($action == 'setwebsiteoffline' && $usercanedit) { } if ($action == 'seteditinline') { // No need of write permission dolibarr_set_const($db, 'WEBSITE_EDITINLINE', 1); - setEventMessages($langs->trans("FeatureNotYetAvailable"), null, 'warnings'); //dolibarr_set_const($db, 'WEBSITE_SUBCONTAINERSINLINE', 0); // Force disable of 'Include dynamic content' header("Location: ".$_SERVER["PHP_SELF"].'?website='.urlencode(GETPOST('website')).'&pageid='.GETPOSTINT('pageid')); exit; @@ -3552,6 +3551,26 @@ if (!GETPOST('hide_websitemenu')) { }, success: function(response) { console.log(response); + var $lastWebsitebar = $(".websitebar").last(); + var $span = $("").html("'.$langs->trans("Saved").'").css({ + \'display\': \'block\', + \'position\': \'absolute\', + \'margin-top\': \'6px\', + \'right\': \'5px\', + \'background-color\': \'#e3f0db\', + \'color\': \'#446548\', + \'font-size\': \'14px\', + \'padding\': \'0px 5px\', + \'z-index\': 1000 + }); + $lastWebsitebar.after($span); + + // Close message after 2 seconds + setTimeout(function() { + $span.fadeOut(500, function() { + $(this).remove(); + }); + }, 2000); } }); From c3d89d8b3a01bf5e9ba132dc8adb73366318b170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Jul 2024 20:46:47 +0200 Subject: [PATCH 55/66] fix phpstan expects int, null ... (#30312) --- htdocs/core/class/html.formmail.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 49aec430b3f..84a7a948fa4 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2010-2011 Juanjo Menent * Copyright (C) 2015-2017 Marcos García * Copyright (C) 2015-2017 Nicolas ZABOURI - * Copyright (C) 2018-2022 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2022 Charlene Benke * Copyright (C) 2023 Anthony Berton * Copyright (C) 2024 MDW @@ -726,7 +726,7 @@ class FormMail extends Form // multiselect array convert html entities into options tags, even if we don't want this, so we encode them a second time $tmparray = $this->withtouser; foreach ($tmparray as $key => $val) { - $tmparray[$key] = dol_htmlentities($tmparray[$key], null, 'UTF-8', true); + $tmparray[$key] = dol_htmlentities($tmparray[$key], 0, 'UTF-8', true); } $withtoselected = GETPOST("receiveruser", 'array'); // Array of selected value if (empty($withtoselected) && count($tmparray) == 1 && GETPOST('action', 'aZ09') == 'presend') { @@ -775,7 +775,7 @@ class FormMail extends Form // multiselect array convert html entities into options tags, even if we don't want this, so we encode them a second time $tmparray = $this->withtoccuser; foreach ($tmparray as $key => $val) { - $tmparray[$key] = dol_htmlentities($tmparray[$key], null, 'UTF-8', true); + $tmparray[$key] = dol_htmlentities($tmparray[$key], 0, 'UTF-8', true); } $withtoselected = GETPOST("receiverccuser", 'array'); // Array of selected value if (empty($withtoselected) && count($tmparray) == 1 && GETPOST('action', 'aZ09') == 'presend') { From 8bce9c3866c802822299a9cde1d12ed9c5f414e9 Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Wed, 10 Jul 2024 18:48:57 +0200 Subject: [PATCH 56/66] fix: When update failed (extrafield check failed or 'date end' before 'date start' values inputed are lost (#30346) * fix: When update failed (extrafield check failed or 'date end' before 'date start'valur inputed are lost * fix: When update failed (extrafield check failed or 'date end' before 'date start'valur inputed are lost * fix: When update failed (extrafield check failed or 'date end' before 'date start' values inputed are lost * fix: When update failed (extrafield check failed or 'date end' before 'date start' values inputed are lost * Update card.php --------- Co-authored-by: Laurent Destailleur --- htdocs/contrat/card.php | 47 ++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index d3fb03dffa4..bb7ef944123 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -707,7 +707,6 @@ if (empty($reshook)) { if (!empty($date_start_update) && !empty($date_end_update) && $date_start_update > $date_end_update) { setEventMessages($langs->trans("Error").': '.$langs->trans("DateStartPlanned").' > '.$langs->trans("DateEndPlanned"), null, 'errors'); $action = 'editline'; - $_GET['rowid'] = GETPOST('elrowid'); // Keep $_GET here. Used by GETPOST('rowid') later $error++; } @@ -813,6 +812,7 @@ if (empty($reshook)) { $result = $objectline->update($user); if ($result < 0) { $error++; + $action = 'editline'; setEventMessages($objectline->error, $objectline->errors, 'errors'); } } @@ -1594,7 +1594,7 @@ if ($action == 'create') { // Line in view mode - if ($action != 'editline' || GETPOST('rowid') != $objp->rowid) { + if ($action != 'editline' || GETPOST('elrowid') != $objp->rowid) { $moreparam = ''; if (getDolGlobalString('CONTRACT_HIDE_CLOSED_SERVICES_BY_DEFAULT') && $objp->statut == ContratLigne::STATUS_CLOSED && $action != 'showclosedlines') { $moreparam = 'style="display: none;"'; @@ -1665,17 +1665,17 @@ if ($action == 'create') { print '
'; if ($user->hasRight('contrat', 'creer') && is_array($arrayothercontracts) && count($arrayothercontracts) && ($object->statut >= 0)) { print ''; - print ''; + print ''; print img_picto($langs->trans("MoveToAnotherContract"), 'uparrow'); print ''; } if ($user->hasRight('contrat', 'creer') && ($object->statut >= 0)) { - print ''; + print ''; print img_edit(); print ''; } if ($user->hasRight('contrat', 'creer') && ($object->statut >= 0)) { - print ''; + print ''; print img_delete(); print ''; } @@ -1738,8 +1738,11 @@ if ($action == 'create') { // Ligne carac print '
'; + $currentLineProductId=GETPOSTISSET('idprod')?GETPOST('idprod'):(!empty($object->lines[$cursorline - 1]->fk_product) ? $object->lines[$cursorline - 1]->fk_product : 0); if ($objp->fk_product > 0) { $canchangeproduct = 1; + + // TODO: As $canchangeproduct is set just before, in what usecase it can be empty ? if (empty($canchangeproduct)) { $productstatic->id = $objp->fk_product; $productstatic->type = $objp->ptype; @@ -1747,19 +1750,19 @@ if ($action == 'create') { $productstatic->entity = $objp->pentity; print $productstatic->getNomUrl(1, '', 32); print $objp->label ? ' - '.dol_trunc($objp->label, 32) : ''; - print ''; + print ''; } else { $senderissupplier = 0; if (empty($senderissupplier)) { - print $form->select_produits((!empty($object->lines[$cursorline - 1]->fk_product) ? $object->lines[$cursorline - 1]->fk_product : 0), 'idprod'); + print $form->select_produits($currentLineProductId, 'idprod'); } else { - $form->select_produits_fournisseurs((!empty($object->lines[$cursorline - 1]->fk_product) ? $object->lines[$cursorline - 1]->fk_product : 0), 'idprod'); + $form->select_produits_fournisseurs($currentLineProductId, 'idprod'); } } print '
'; } else { print $objp->label ? $objp->label.'
' : ''; - print ''; + print ''; } // editeur wysiwyg @@ -1768,19 +1771,18 @@ if ($action == 'create') { if (getDolGlobalString('MAIN_INPUT_DESC_HEIGHT')) { $nbrows = getDolGlobalString('MAIN_INPUT_DESC_HEIGHT'); } - $enable = (isset($conf->global->FCKEDITOR_ENABLE_DETAILS) ? $conf->global->FCKEDITOR_ENABLE_DETAILS : 0); - $doleditor = new DolEditor('product_desc', $objp->description, '', 92, 'dolibarr_details', '', false, true, $enable, $nbrows, '90%'); + $doleditor = new DolEditor('product_desc', (GETPOSTISSET('product_desc')?GETPOST('product_desc'):$objp->description), '', 92, 'dolibarr_details', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_DETAILS'), $nbrows, '90%'); $doleditor->Create(); print '
'; - print $form->load_tva("eltva_tx", $objp->tva_tx.($objp->vat_src_code ? (' ('.$objp->vat_src_code.')') : ''), $mysoc, $object->thirdparty, $objp->fk_product, $objp->info_bits, $objp->product_type, 0, 1); + print $form->load_tva("eltva_tx", $objp->tva_tx.($objp->vat_src_code ? (' ('.$objp->vat_src_code.')') : ''), $mysoc, $object->thirdparty, $currentLineProductId, $objp->info_bits, $objp->product_type, 0, 1); print ''; - print $form->selectUnits($objp->fk_unit, "unit"); + print $form->selectUnits((GETPOSTISSET('unit')?GETPOST('unit'):$objp->fk_unit), "unit"); print '%%'; if ($objp->fk_product) { print ''; } - print ''; print ''; @@ -1872,8 +1874,8 @@ if ($action == 'create') { /* * Confirmation to delete service line of contract */ - if ($action == 'deleteline' && !$_REQUEST["cancel"] && $user->hasRight('contrat', 'creer') && $object->lines[$cursorline - 1]->id == GETPOST('rowid')) { - print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('rowid'), $langs->trans("DeleteContractLine"), $langs->trans("ConfirmDeleteContractLine"), "confirm_deleteline", '', 0, 1); + if ($action == 'deleteline' && !$_REQUEST["cancel"] && $user->hasRight('contrat', 'creer') && $object->lines[$cursorline - 1]->id == GETPOST('elrowid')) { + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('elrowid'), $langs->trans("DeleteContractLine"), $langs->trans("ConfirmDeleteContractLine"), "confirm_deleteline", '', 0, 1); if ($ret == 'html') { print '
'; } @@ -1882,7 +1884,7 @@ if ($action == 'create') { /* * Confirmation to move service toward another contract */ - if ($action == 'move' && !$_REQUEST["cancel"] && $user->hasRight('contrat', 'creer') && $object->lines[$cursorline - 1]->id == GETPOST('rowid')) { + if ($action == 'move' && !$_REQUEST["cancel"] && $user->hasRight('contrat', 'creer') && $object->lines[$cursorline - 1]->id == GETPOST('elrowid')) { $arraycontractid = array(); foreach ($arrayothercontracts as $contractcursor) { $arraycontractid[$contractcursor->id] = $contractcursor->ref; @@ -1893,7 +1895,7 @@ if ($action == 'create') { 'text' => $langs->trans("ConfirmMoveToAnotherContractQuestion"), 0 => array('type' => 'select', 'name' => 'newcid', 'values' => $arraycontractid)); - print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOSTINT('rowid'), $langs->trans("MoveToAnotherContract"), $langs->trans("ConfirmMoveToAnotherContract"), "confirm_move", $formquestion); + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOSTINT('elrowid'), $langs->trans("MoveToAnotherContract"), $langs->trans("ConfirmMoveToAnotherContract"), "confirm_move", $formquestion); print '
'; } @@ -2319,7 +2321,8 @@ $db->close(); + // TODO Why this ? To manage margin on contracts +?>