From 86610810ca9ab29e5daf75197db54cd2d0a431f9 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 15 Oct 2025 00:43:54 +0200 Subject: [PATCH 01/68] FIX Accountancy - General setup - Missing form on UpdateMask (#35735) Co-authored-by: Laurent Destailleur --- htdocs/accountancy/admin/index.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 7c29ed6835d..833923415b9 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -692,12 +692,17 @@ foreach ($arrayofmodules as $module) { } print ''; print ''; - +print ''; // Show advanced options print '

'; // Advanced params +print '
'; +print ''; +print ''; +print ''; + print '
'; print ''; print ''; From a4822e466a8cd93566514309105f394a69ca5d24 Mon Sep 17 00:00:00 2001 From: atm-corentin <165782689+atm-corentin@users.noreply.github.com> Date: Wed, 15 Oct 2025 00:46:57 +0200 Subject: [PATCH 02/68] remove redundant price2num calls in cost calculations to simplify code (#35743) Co-authored-by: Laurent Destailleur --- htdocs/bom/class/bom.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 0ba39eef43b..f987875059c 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -1455,10 +1455,10 @@ class BOM extends CommonObject $line->unit_cost = 0; } } else { - $line->unit_cost = (float) price2num($unit_cost); + $line->unit_cost = (float) $unit_cost; } - $line->total_cost = (float) price2num($line->qty * $line->unit_cost, 'MT'); + $line->total_cost = (float) $line->qty * $line->unit_cost; $this->total_cost += $line->total_cost; } else { @@ -1467,7 +1467,7 @@ class BOM extends CommonObject if ($res > 0) { $bom_child->calculateCosts(); $line->childBom[] = $bom_child; - $this->total_cost += (float) price2num($bom_child->total_cost * $line->qty, 'MT'); + $this->total_cost += (float) $bom_child->total_cost * $line->qty; $this->total_cost += $line->total_cost; } else { $this->error = $bom_child->error; @@ -1488,7 +1488,7 @@ class BOM extends CommonObject $res = $workstation->fetch($line->fk_default_workstation); if ($res > 0) { - $line->total_cost = (float) price2num($qtyhourforline * ($workstation->thm_operator_estimated + $workstation->thm_machine_estimated), 'MT'); + $line->total_cost = (float) $qtyhourforline * ($workstation->thm_operator_estimated + $workstation->thm_machine_estimated); } else { $this->error = $workstation->error; return -3; @@ -1502,9 +1502,9 @@ class BOM extends CommonObject } if ($qtyhourservice) { - $line->total_cost = (float) price2num($qtyhourforline / $qtyhourservice * $tmpproduct->cost_price, 'MT'); + $line->total_cost = (float) $qtyhourforline / $qtyhourservice * $tmpproduct->cost_price; } else { - $line->total_cost = (float) price2num($line->qty * $tmpproduct->cost_price, 'MT'); + $line->total_cost = (float) $line->qty * $tmpproduct->cost_price; } } From cfd17372f4540d6ee127667fe3bc7c890264daec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Oct 2025 04:36:06 +0200 Subject: [PATCH 03/68] Debug v23 --- htdocs/install/upgrade2.php | 28 ++++++++++++++++++---------- htdocs/user/class/user.class.php | 10 ++++++---- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 183d091d8e5..1e4b61412ce 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -76,6 +76,7 @@ require_once $dolibarr_main_document_root.'/core/lib/price.lib.php'; require_once $dolibarr_main_document_root.'/core/class/menubase.class.php'; require_once $dolibarr_main_document_root.'/core/lib/admin.lib.php'; require_once $dolibarr_main_document_root.'/core/lib/files.lib.php'; +require_once $dolibarr_main_document_root.'/user/class/user.class.php'; global $langs; @@ -129,7 +130,6 @@ if ((!$versionfrom || preg_match('/version/', $versionfrom)) && (!$versionto || // Test if batch mode $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); - $path = __DIR__.'/'; if (substr($sapi_type, 0, 3) == 'cli') { print 'Syntax from command line: '.$script_file." x.y.z a.b.c [MAIN_MODULE_NAME1_TO_ENABLE,MAIN_MODULE_NAME2_TO_ENABLE...]\n"; print 'Example, upgrade from 19 to 20: '.$script_file." 19.0.0 20.0.0\n"; @@ -5380,10 +5380,10 @@ function migrate_accountingbookkeeping(int $entity) */ function migrate_apiresttokens() { - global $db, $langs; + global $conf, $db, $langs; print ''; - print '\n"; + print $langs->trans("NothingToDo")."\n"; } else { print $langs->trans('MigratedTokens', $nbofmigration); - print ''; } + print ''; } diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index b53f66ed67f..72ed4fccbac 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -523,7 +523,7 @@ class User extends CommonObject * @param string $login If defined, login to used for search * @param string $sid If defined, sid to used for search * @param int<0,1> $loadpersonalconf 1=also load personal conf of user (in $user->conf->xxx), 0=do not load personal conf. - * @param int $entity If a value is >= 0, we force the search on a specific entity. If -1, means search depens on default setup. + * @param int $entity If a value is >= 0, we force the search on a specific entity. If -1, means search depends on default setup. * @param string $email If defined, email to used for search * @param int $fk_socpeople If defined, id of contact for search * @param int<0,1> $use_email_oauth2 1=Use also email_oauth2 to fetch on email @@ -761,7 +761,7 @@ class User extends CommonObject // To get back the global configuration unique to the user if ($loadpersonalconf) { - $result = $this->loadPersonalConf(); + $result = $this->loadPersonalConf($entity); $result = $this->loadDefaultValues(); @@ -784,16 +784,18 @@ class User extends CommonObject /** * Load const values from database table user_param and set it into user->conf->XXX * + * @param int $entity If >=0, force the entity, if -1, use the default entity * @return int >= 0 if OK, < 0 if KO */ - public function loadPersonalConf() + public function loadPersonalConf($entity = -1) { global $conf; // Load user->conf for user $sql = "SELECT param, value FROM ".$this->db->prefix()."user_param"; $sql .= " WHERE fk_user = ".((int) $this->id); - $sql .= " AND entity = ".((int) $conf->entity); + $sql .= " AND entity = ".($entity == -1 ? (int) $conf->entity : (int) $entity); + //dol_syslog(get_class($this).'::fetch load personalized conf', LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { From 56997cc06cc241acaed35b6a557a38c9505ca019 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Oct 2025 05:02:34 +0200 Subject: [PATCH 04/68] FIX The IBAN into EPC qr code must use the default bank account if not forced --- htdocs/core/class/commoninvoice.class.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 7a692b81fa7..198e75bef46 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -1909,9 +1909,18 @@ abstract class CommonInvoice extends CommonObject // Add the bank account information include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - $bankAccount = new Account($this->db); - if ($this->fk_account > 0) { - $bankAccount->fetch($this->fk_account); + + $idofbankaccountouse = $this->fk_account; + if (empty($idofbankaccountouse)) { + $idofbankaccountouse = $this->fk_bank; + } + if (empty($idofbankaccountouse)) { + $idofbankaccountouse = getDolGlobalInt('FACTURE_RIB_NUMBER'); + } + + if ($idofbankaccountouse > 0) { + $bankAccount = new Account($this->db); + $bankAccount->fetch($idofbankaccountouse); $lines[] = $bankAccount->bic; //BIC (required) if (!empty($bankAccount->owner_name)) { $lines[] = $bankAccount->owner_name; //Owner of the bank account, if present (required) From f33ed7a7022a246405851dd75bf692ee4aab922d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Oct 2025 05:02:34 +0200 Subject: [PATCH 05/68] FIX The IBAN into EPC qr code must use the default bank account if not forced --- htdocs/core/class/commoninvoice.class.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 83e71e81381..d7c0fd82126 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -1912,9 +1912,18 @@ abstract class CommonInvoice extends CommonObject // Add the bank account information include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - $bankAccount = new Account($this->db); - if ($this->fk_account > 0) { - $bankAccount->fetch($this->fk_account); + + $idofbankaccountouse = $this->fk_account; + if (empty($idofbankaccountouse)) { + $idofbankaccountouse = $this->fk_bank; + } + if (empty($idofbankaccountouse)) { + $idofbankaccountouse = getDolGlobalInt('FACTURE_RIB_NUMBER'); + } + + if ($idofbankaccountouse > 0) { + $bankAccount = new Account($this->db); + $bankAccount->fetch($idofbankaccountouse); $lines[] = $bankAccount->bic; //BIC (required) if (!empty($bankAccount->owner_name)) { $lines[] = $bankAccount->owner_name; //Owner of the bank account, if present (required) From dbc0905e79828f61598098258f613df3c732c962 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Oct 2025 11:19:00 +0200 Subject: [PATCH 06/68] Renamed salaries/paiement_salary.php into salaries/payment_salary.php --- htdocs/compta/bank/class/paymentvarious.class.php | 2 +- htdocs/salaries/card.php | 2 +- htdocs/salaries/class/paymentsalary.class.php | 2 +- htdocs/salaries/{paiement_salary.php => payment_salary.php} | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename htdocs/salaries/{paiement_salary.php => payment_salary.php} (99%) diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index b6e9889ed71..24dd0668443 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -565,7 +565,7 @@ class PaymentVarious extends CommonObject ); // Update fk_bank into llx_payment_various - // So we know the payment which has generate the banking ecriture + // So we know the payment which has generate the banking transaction if ($bank_line_id > 0) { $this->update_fk_bank($bank_line_id); } else { diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index d74574040a9..0de4e90ff40 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -1194,7 +1194,7 @@ if ($id > 0) { // Emit payment if ($object->status == $object::STATUS_UNPAID && ((price2num($object->amount) < 0 && $resteapayer < 0) || (price2num($object->amount) > 0 && $resteapayer > 0)) && $permissiontoadd) { - print dolGetButtonAction('', $langs->trans('DoPayment'), 'default', DOL_URL_ROOT.'/salaries/paiement_salary.php?action=create&token='.newToken().'&id='. $object->id, ''); + print dolGetButtonAction('', $langs->trans('DoPayment'), 'default', DOL_URL_ROOT.'/salaries/payment_salary.php?action=create&token='.newToken().'&id='. $object->id, ''); } // Classify 'paid' diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php index 92f4cf5eaf9..ff5f5e24c04 100644 --- a/htdocs/salaries/class/paymentsalary.class.php +++ b/htdocs/salaries/class/paymentsalary.class.php @@ -639,7 +639,7 @@ class PaymentSalary extends CommonObject $this->datev ); - // Update fk_bank into llx_paiement_salary. + // Update fk_bank into llx_payment_salary. // so we know the payment that was used to generated the bank entry. if ($bank_line_id > 0) { $result = $this->update_fk_bank($bank_line_id); diff --git a/htdocs/salaries/paiement_salary.php b/htdocs/salaries/payment_salary.php similarity index 99% rename from htdocs/salaries/paiement_salary.php rename to htdocs/salaries/payment_salary.php index 5ccc3426ed2..06301af8a23 100644 --- a/htdocs/salaries/paiement_salary.php +++ b/htdocs/salaries/payment_salary.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/salaries/paiement_salary.php + * \file htdocs/salaries/payment_salary.php * \ingroup salary * \brief Page to add payment of a salary */ From 7853a335605de9f3256675d463d2822218033d64 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Oct 2025 11:22:11 +0200 Subject: [PATCH 07/68] No need of token for action=create --- htdocs/salaries/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 0de4e90ff40..ae17abb5d79 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -1194,7 +1194,7 @@ if ($id > 0) { // Emit payment if ($object->status == $object::STATUS_UNPAID && ((price2num($object->amount) < 0 && $resteapayer < 0) || (price2num($object->amount) > 0 && $resteapayer > 0)) && $permissiontoadd) { - print dolGetButtonAction('', $langs->trans('DoPayment'), 'default', DOL_URL_ROOT.'/salaries/payment_salary.php?action=create&token='.newToken().'&id='. $object->id, ''); + print dolGetButtonAction('', $langs->trans('DoPayment'), 'default', DOL_URL_ROOT.'/salaries/payment_salary.php?action=create&id='. $object->id, ''); } // Classify 'paid' From 5367d63a56e51c596f327741f4d48a3917e5b5d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 15 Oct 2025 11:28:47 +0200 Subject: [PATCH 08/68] clean code page phpinfo.php (#35762) * clean code page phpinfo.php * Update check.php * Update phpinfo.php --------- Co-authored-by: Laurent Destailleur --- htdocs/admin/system/phpinfo.php | 12 ++++-------- htdocs/install/check.php | 20 +------------------- 2 files changed, 5 insertions(+), 27 deletions(-) diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php index a14671a8443..978d9ac59a8 100644 --- a/htdocs/admin/system/phpinfo.php +++ b/htdocs/admin/system/phpinfo.php @@ -4,8 +4,8 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2016 Juanjo Menent * Copyright (C) 2020 Tobias Sekan - * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -104,14 +104,10 @@ if ($maxphp > 0 && $maxphp2 > 0 && $maxphp > $maxphp2) { print '
'; - print ''.$langs->trans('MigrationApiRestTokens')."
\n"; + print ''.$langs->trans('MigrationApiRestTokens').":\n"; $error = 0; $nbofmigration = 0; @@ -5408,17 +5408,26 @@ function migrate_apiresttokens() } if (!$error) { - $sql = "SELECT 'dolibarr_rest_api' AS service, u.api_key AS token, u.rowid AS fk_user, CURRENT_TIMESTAMP AS datec, u.entity"; + $sql = "SELECT 'dolibarr_rest_api' AS service, u.api_key AS token, u.rowid AS fk_user, u.entity"; $sql .= " FROM llx_user AS u"; - $sql .= " WHERE u.api_key IS NOT NULL"; + $sql .= " WHERE u.api_key IS NOT NULL AND u.api_key <> ''"; $result = $db->query($sql); if ($result) { + $tmpuser = new User($db); + while ($obj = $db->fetch_object($result)) { if (!in_array(dolDecrypt($obj->token), $allexistingtokens)) { - $sqlforinsert = "INSERT INTO ".MAIN_DB_PREFIX."oauth_token (service, token, fk_user, datec, entity)"; - $sqlforinsert .= " VALUES ('".$db->escape($obj->service)."', '".$db->escape($obj->token)."', ".((int) $obj->fk_user).", '".$db->escape($obj->datec)."', ".((int) $obj->entity).")"; + // Load the object of the user of token so we can get the API_COUNT_CALL + unset($tmpuser->conf); $tmpuser->conf = new stdClass(); + $tmpuser->fetch((int) $obj->fk_user, '', '', 1, ($obj->entity ? $obj->entity : $conf->entity)); + + $sqlforinsert = "INSERT INTO ".MAIN_DB_PREFIX."oauth_token (service, token, fk_user, datec, entity, apicount_total)"; + $sqlforinsert .= " VALUES ('".$db->escape($obj->service)."', '".$db->escape(dolEncrypt(dolDecrypt($obj->token)))."', "; + $sqlforinsert .= ((int) $obj->fk_user).", '".$db->idate(dol_now())."', ".((int) $obj->entity).", "; + $sqlforinsert .= getDolUserInt('API_COUNT_CALL', 0, $tmpuser); + $sqlforinsert .= ")"; $insertresult = $db->query($sqlforinsert); if (!$insertresult) { @@ -5442,10 +5451,9 @@ function migrate_apiresttokens() } if (!$nbofmigration) { - print '
'.$langs->trans("NothingToDo")."
'; print ''; -$ErrorPicturePath = "../../theme/eldy/img/error.png"; -$WarningPicturePath = "../../theme/eldy/img/warning.png"; -$OkayPicturePath = "../../theme/eldy/img/tick.png"; - print ''; From 37ff735a802bcf9ea8f4f11e55ecf9203ae44b75 Mon Sep 17 00:00:00 2001 From: John BOTELLA <68917336+thersane-john@users.noreply.github.com> Date: Wed, 15 Oct 2025 11:30:24 +0200 Subject: [PATCH 09/68] Fix css badge pill definition (#35763) * fix css badge pill definition * fix css badge pill definition --- htdocs/theme/eldy/badges.inc.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/badges.inc.php b/htdocs/theme/eldy/badges.inc.php index fc444953afe..f9661e906f3 100644 --- a/htdocs/theme/eldy/badges.inc.php +++ b/htdocs/theme/eldy/badges.inc.php @@ -69,12 +69,19 @@ if (!defined('ISLOADEDBYSTEELSHEET')) { } } -.badge-pill, .tabs .badge { +.tabs .badge { padding-right: .5em; padding-left: .5em; border-radius: 0.25rem; } +.badge-pill{ + /* Use the .badge-pill modifier class to make badges more rounded (with a larger border-radius and additional horizontal padding). */ + padding-right: .8em; + padding-left: 0.8em; + border-radius: 0.5rem; +} + .badge-dot { padding: 0; border-radius: 50%; From d04e40dea3803f5c4f19f2647a21a246f9f99db5 Mon Sep 17 00:00:00 2001 From: John BOTELLA <68917336+thersane-john@users.noreply.github.com> Date: Wed, 15 Oct 2025 11:31:10 +0200 Subject: [PATCH 10/68] Fix missing cursor for copy action (#35765) --- htdocs/theme/eldy/global.inc.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index da531824ef9..365259c26ea 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -8608,6 +8608,10 @@ div.clipboardCPValue.hidewithsize { white-space: nowrap; } +.clipboardCPShowOnHover{ + cursor: copy; +} + .clipboardCPShowOnHover .clipboardCPButton { display: none; } From 9a99139d85545e325afd4922fe7089fc98a96d99 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Oct 2025 11:31:28 +0200 Subject: [PATCH 11/68] Fix status of salary --- htdocs/salaries/document.php | 6 ++++++ htdocs/salaries/info.php | 5 +++++ htdocs/salaries/virement_request.php | 5 +++++ 3 files changed, 16 insertions(+) diff --git a/htdocs/salaries/document.php b/htdocs/salaries/document.php index 96f14328d33..148fcbefb6f 100644 --- a/htdocs/salaries/document.php +++ b/htdocs/salaries/document.php @@ -122,6 +122,7 @@ $permissiontoread = $user->hasRight('salaries', 'read'); $permissiontoadd = $user->hasRight('salaries', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php $permissiontodelete = $user->hasRight('salaries', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_UNPAID); + /* * Actions */ @@ -218,6 +219,11 @@ if ($object->id) { $morehtmlref .= ''; + $totalpaid = $object->getSommePaiement(); + + $object->totalpaid = $totalpaid; + $object->alreadypaid = $totalpaid; // Same then $totalpaid because there is no amount of credit note or deposits for salary payments. + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', ''); print '
'; diff --git a/htdocs/salaries/info.php b/htdocs/salaries/info.php index e0b794879be..25e6c33bf07 100644 --- a/htdocs/salaries/info.php +++ b/htdocs/salaries/info.php @@ -184,6 +184,11 @@ if (isModEnabled('project')) { $morehtmlref .= '
'; +$totalpaid = $object->getSommePaiement(); + +$object->totalpaid = $totalpaid; +$object->alreadypaid = $totalpaid; // Same then $totalpaid because there is no amount of credit note or deposits for salary payments. + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', ''); print '
'; diff --git a/htdocs/salaries/virement_request.php b/htdocs/salaries/virement_request.php index 4c910370329..df748105224 100644 --- a/htdocs/salaries/virement_request.php +++ b/htdocs/salaries/virement_request.php @@ -283,6 +283,11 @@ if (isModEnabled('project')) { $morehtmlref .= '
'; +$totalpaid = $object->getSommePaiement(); + +$object->totalpaid = $totalpaid; +$object->alreadypaid = $totalpaid; // Same then $totalpaid because there is no amount of credit note or deposits for salary payments. + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', ''); print '
'; From f8218fe64bff87caf5743e7087c84fbd46aca26f Mon Sep 17 00:00:00 2001 From: lvessiller-opendsi Date: Wed, 15 Oct 2025 11:33:48 +0200 Subject: [PATCH 12/68] NEW const MENU_HIDE_EMAIL_TEMPLATES to hide email templates setup in Tools menu (#35739) Co-authored-by: Laurent Destailleur --- htdocs/core/menus/init_menu_auguria.sql | 2 +- htdocs/core/menus/standard/eldy.lib.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index fea15c859db..2e31955dbb6 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -424,7 +424,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left -- Tools insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("catgory")', __HANDLER__, 'left', 3905__+MAX_llx_menu__, 'tools', 'categories', 8__+MAX_llx_menu__, '/categories/index.php?mainmenu=tools&leftmenu=category', 'Categories', 0, '', '$user->hasRight("category","read")', '', 0, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($user->socid)', __HANDLER__, 'left', 3900__+MAX_llx_menu__, 'tools', 'email_templates', 8__+MAX_llx_menu__, '/admin/mails_templates.php?mainmenu=tools&leftmenu=email_templates', 'EMailTemplates', 0, '', '', '', 0, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '!getDolGlobalInt("MENU_HIDE_EMAIL_TEMPLATES") && empty($user->socid)', __HANDLER__, 'left', 3900__+MAX_llx_menu__, 'tools', 'email_templates', 8__+MAX_llx_menu__, '/admin/mails_templates.php?mainmenu=tools&leftmenu=email_templates', 'EMailTemplates', 0, '', '', '', 0, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("mailing")', __HANDLER__, 'left', 3910__+MAX_llx_menu__, 'tools', 'mailing', 8__+MAX_llx_menu__, '/comm/mailing/index.php?mainmenu=tools&leftmenu=mailing', 'EMailings', 0, 'mails', '$user->hasRight("mailing","lire")', '', 0, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("mailing")', __HANDLER__, 'left', 3911__+MAX_llx_menu__, 'tools', '', 3910__+MAX_llx_menu__, '/comm/mailing/card.php?mainmenu=tools&leftmenu=mailing&action=create', 'NewMailing', 1, 'mails', '$user->hasRight("mailing","creer")', '', 0, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("mailing")', __HANDLER__, 'left', 3912__+MAX_llx_menu__, 'tools', '', 3910__+MAX_llx_menu__, '/comm/mailing/list.php?mainmenu=tools&leftmenu=mailing', 'List', 1, 'mails', '$user->hasRight("mailing","lire")', '', 0, 1, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 8bc08d64f82..2dba517d647 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -2554,7 +2554,7 @@ function get_left_menu_tools($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu $newmenu->add(dolBuildUrl('/categories/index.php', ['leftmenu' => 'category']), $titleindex, 0, $user->hasRight('category', 'read'), '', $mainmenu, 'category', 5, '', '', '', img_picto('', 'category', 'class="paddingright pictofixedwidth"')); } - if (empty($user->socid)) { // limit to internal users + if (!getDolGlobalInt('MENU_HIDE_EMAIL_TEMPLATES') && empty($user->socid)) { // limit to internal users $langs->load("mails"); $newmenu->add(dolBuildUrl('/admin/mails_templates.php', ['leftmenu' => 'email_templates']), $langs->trans("EMailTemplates"), 0, 1, '', $mainmenu, 'email_templates', 10, '', '', '', img_picto('', 'email', 'class="paddingright pictofixedwidth"')); } From c09ae7c3fb8065cc96868c77dac675eafcc0b439 Mon Sep 17 00:00:00 2001 From: Mathieu Pellegrin Date: Wed, 15 Oct 2025 11:34:51 +0200 Subject: [PATCH 13/68] Fix #35703 (#35734) Co-authored-by: Laurent Destailleur --- htdocs/compta/cashcontrol/cashcontrol_card.php | 6 +++--- htdocs/compta/cashcontrol/report.php | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index 9beaccbee7e..95486a87ca2 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -368,11 +368,11 @@ if ($action == "create" || $action == "start" || $action == 'close') { exit; } if ($syear && !$smonth) { - $sql .= " AND datef BETWEEN '".$db->idate(dol_get_first_day($syear, 1))."' AND '".$db->idate(dol_get_last_day($syear, 12))."'"; + $sql .= " AND datep BETWEEN '".$db->idate(dol_get_first_day($syear, 1))."' AND '".$db->idate(dol_get_last_day($syear, 12))."'"; } elseif ($syear && $smonth && !$sday) { - $sql .= " AND datef BETWEEN '".$db->idate(dol_get_first_day($syear, $smonth))."' AND '".$db->idate(dol_get_last_day($syear, $smonth))."'"; + $sql .= " AND datep BETWEEN '".$db->idate(dol_get_first_day($syear, $smonth))."' AND '".$db->idate(dol_get_last_day($syear, $smonth))."'"; } elseif ($syear && $smonth && $sday) { - $sql .= " AND datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $smonth, $sday, $syear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $smonth, $sday, $syear))."'"; + $sql .= " AND datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $smonth, $sday, $syear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $smonth, $sday, $syear))."'"; } else { setEventMessages($langs->trans('YearNotDefined'), null, 'errors'); } diff --git a/htdocs/compta/cashcontrol/report.php b/htdocs/compta/cashcontrol/report.php index 695537eaffb..47f8dc8da9a 100644 --- a/htdocs/compta/cashcontrol/report.php +++ b/htdocs/compta/cashcontrol/report.php @@ -138,7 +138,7 @@ $sql.=" OR b.fk_account = ".((int) $conf->global->CASHDESK_ID_BANKACCOUNT_CB); $sql.=" OR b.fk_account = ".((int) $conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE); $sql.=")"; */ -$sql = "SELECT f.rowid as facid, f.ref, f.datef as do, pf.amount as amount, b.fk_account as bankid, cp.code"; +$sql = "SELECT f.rowid as facid, f.ref, f.datef as datef, p.datep as datep, pf.amount as amount, b.fk_account as bankid, cp.code"; $sql .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."c_paiement as cp, ".MAIN_DB_PREFIX."bank as b"; $sql .= " WHERE pf.fk_facture = f.rowid AND p.rowid = pf.fk_paiement AND cp.id = p.fk_paiement AND p.fk_bank = b.rowid"; $sql .= " AND f.module_source = '".$db->escape($posmodule)."'"; @@ -154,11 +154,11 @@ else exit; }*/ if ($syear && !$smonth) { - $sql .= " AND datef BETWEEN '".$db->idate(dol_get_first_day($syear, 1))."' AND '".$db->idate(dol_get_last_day($syear, 12))."'"; + $sql .= " AND datep BETWEEN '".$db->idate(dol_get_first_day($syear, 1))."' AND '".$db->idate(dol_get_last_day($syear, 12))."'"; } elseif ($syear && $smonth && !$sday) { - $sql .= " AND datef BETWEEN '".$db->idate(dol_get_first_day($syear, $smonth))."' AND '".$db->idate(dol_get_last_day($syear, $smonth))."'"; + $sql .= " AND datep BETWEEN '".$db->idate(dol_get_first_day($syear, $smonth))."' AND '".$db->idate(dol_get_last_day($syear, $smonth))."'"; } elseif ($syear && $smonth && $sday) { - $sql .= " AND datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $smonth, $sday, $syear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $smonth, $sday, $syear))."'"; + $sql .= " AND datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $smonth, $sday, $syear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $smonth, $sday, $syear))."'"; } else { dol_print_error(null, 'Year not defined'); } @@ -328,7 +328,7 @@ if ($resql) { // Date ope print '
\n"; if (!$i) { $totalarray['nbfield']++; From 520d44e8080673a02c4be67c2389926e044d7d1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Wed, 15 Oct 2025 11:43:21 +0200 Subject: [PATCH 14/68] New : add public and private note on contract list (#34252) * New : add public and private note on contract list * Update list.php * Update list.php --------- Co-authored-by: Laurent Destailleur --- htdocs/contrat/list.php | 62 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 2 deletions(-) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index cdb34cd858d..79794fa354c 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -12,6 +12,7 @@ * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * Copyright (C) 2024 Benjamin Falière + * Copyright (C) 2025 Charlene Benke * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -79,6 +80,9 @@ $search_ref_supplier = GETPOST('search_ref_supplier', 'alpha'); $search_all = GETPOST('search_all', 'alphanohtml'); $search_status = GETPOST('search_status', 'alpha'); $search_signed_status = GETPOST('search_signed_status', 'alpha'); +$search_note_public = GETPOST('search_note_public', 'alpha'); +$search_note_private = GETPOST('search_note_private', 'alpha'); + $search_user = GETPOST('search_user', 'intcomma'); $search_sale = GETPOST('search_sale', 'intcomma'); $search_product_category = GETPOST('search_product_category', 'intcomma'); @@ -198,6 +202,8 @@ $arrayfields = array( 'c.date_contrat' => array('label' => $langs->trans("DateContract"), 'checked' => '1', 'position' => 45), 'c.datec' => array('label' => $langs->trans("DateCreation"), 'checked' => '0', 'position' => 500), 'c.tms' => array('label' => $langs->trans("DateModificationShort"), 'checked' => '0', 'position' => 500), + 'c.note_public' => array('label' => $langs->trans("NotePublic"), 'checked' => '0', 'position' => 520, 'enabled' => (string) (!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES'))), + 'c.note_private' => array('label' => $langs->trans("NotePrivate"), 'checked' => '0', 'position' => 521, 'enabled' => (string) (!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES'))), 'lower_planned_end_date' => array('label' => $langs->trans("LowerDateEndPlannedShort"), 'checked' => '1', 'position' => 900, 'help' => $langs->trans("LowerDateEndPlannedShort")), 'status' => array('label' => $langs->trans("Status"), 'checked' => '1', 'position' => 1000), 'c.signed_status' => array('label' => $langs->trans('SignedStatus'), 'checked' => '0', 'position' => 1001), @@ -284,6 +290,8 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $search_date_modif_end = ""; $search_status = ""; $search_signed_status = ''; + $search_note_public = ""; + $search_note_private = ""; $toselect = array(); $searchCategoryCustomerList = array(); $search_array_options = array(); @@ -315,7 +323,7 @@ $title = ""; $sql = 'SELECT'; $sql .= " c.rowid, c.ref, c.datec as date_creation, c.tms as date_modification, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, c.note_private, c.note_public, c.entity, c.signed_status,"; $sql .= ' s.rowid as socid, s.nom as name, s.name_alias, s.email, s.town, s.zip, s.fk_pays as country_id, s.client, s.code_client, s.status as company_status, s.logo as company_logo,'; -$sql .= " typent.code as typent_code,"; +$sql .= " typent.code as typent_code, c.note_public, c.note_private,"; $sql .= " state.code_departement as state_code, state.nom as state_name,"; // TODO Add a denormalized field "denormalized_lower_planned_end_date" so we can remove the HAVING and then, // remove completely the SUM and GROUP BY (faster). Status of each service can be read into the loop that build the list. @@ -393,6 +401,16 @@ if ($search_town) { if ($search_country && $search_country != '-1') { $sql .= " AND s.fk_pays IN (".$db->sanitize($search_country).')'; } +if (!empty($search_note_private)) { + $sql .= natural_search(array('c.note_private'), $search_note_private); +} +if (!empty($search_note_public)) { + $sql .= natural_search(array('c.note_public'), $search_note_public); +} + +/*if ($search_sale > 0) { + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale); +}*/ if ($search_all) { $sql .= natural_search(array_keys($fieldstosearchall), $search_all); } @@ -507,7 +525,7 @@ $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $objec $sql .= $hookmanager->resPrint; $sql .= " GROUP BY c.rowid, c.ref, c.datec, c.tms, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, c.note_private, c.note_public, c.entity, c.signed_status,"; $sql .= ' s.rowid, s.nom, s.name_alias, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client, s.status, s.logo,'; -$sql .= " typent.code,"; +$sql .= " typent.code, c.note_public, c.note_private,"; $sql .= " state.code_departement, state.nom"; // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { @@ -651,6 +669,12 @@ if ($search_ref_customer != '') { if ($search_ref_supplier != '') { $param .= '&search_ref_supplier='.urlencode($search_ref_supplier); } +if ($search_note_private != '') { + $param .= '&search_note_private='.urlencode($search_note_private); +} +if ($search_note_public != '') { + $param .= '&search_note_public='.urlencode($search_note_public); +} if ($search_op2df != '') { $param .= '&search_op2df='.urlencode($search_op2df); } @@ -956,6 +980,18 @@ if (!empty($arrayfields['c.signed_status']['checked'])) { print $form->selectarray('search_signed_status', $list_signed_status, $search_signed_status, 1, 0, 0, '', 1, 0, 0, '', 'search_status'); print ''; } +// Public note +if (!empty($arrayfields['c.note_public']['checked'])) { + print ''; +} +// Private note +if (!empty($arrayfields['c.note_private']['checked'])) { + print ''; +} // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; @@ -1073,6 +1109,14 @@ if (!empty($arrayfields['c.signed_status']['checked'])) { print_liste_field_titre($arrayfields['c.signed_status']['label'], $_SERVER["PHP_SELF"], "c.signed_status", "", $param, '', $sortfield, $sortorder, 'center '); $totalarray['nbfield']++; } +if (!empty($arrayfields['c.note_public']['checked'])) { + print_liste_field_titre($arrayfields['c.note_public']['label'], $_SERVER["PHP_SELF"], "c.note_public", "", $param, '', $sortfield, $sortorder, 'center '); + $totalarray['nbfield']++; +} +if (!empty($arrayfields['c.note_private']['checked'])) { + print_liste_field_titre($arrayfields['c.note_private']['label'], $_SERVER["PHP_SELF"], "c.note_private", "", $param, '', $sortfield, $sortorder, 'center '); + $totalarray['nbfield']++; +} // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields @@ -1332,6 +1376,20 @@ while ($i < $imaxinloop) { $totalarray['nbfield']++; } } + // public note + if (!empty($arrayfields['c.note_public']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // private note + if (!empty($arrayfields['c.note_private']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook From 12bcdd0e8086f5bcfa8e9f3a800366fcbc88fcb4 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Wed, 15 Oct 2025 11:49:55 +0200 Subject: [PATCH 15/68] QUAL: stop support of run_trigger (#34373) Co-authored-by: Laurent Destailleur --- htdocs/core/class/interfaces.class.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index be93173910f..1a9c8bacb10 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -230,10 +230,6 @@ class Interfaces if (method_exists($objMod, 'runTrigger')) { // New method to implement //dol_syslog(get_class($this)."::run_triggers action=".$action." Launch runTrigger for file '".$files[$key]."'", LOG_DEBUG); $result = $objMod->runTrigger($action, $object, $user, $langs, $conf); - } elseif (method_exists($objMod, 'run_trigger')) { // Deprecated method - dol_syslog(get_class($this)."::run_triggers action=".$action." Launch old method run_trigger (rename your trigger into runTrigger) for file '".$files[$key]."'", LOG_WARNING); - // @phan-suppress-next-line PhanUndeclaredMethod - $result = $objMod->run_trigger($action, $object, $user, $langs, $conf); } else { dol_syslog(get_class($this)."::run_triggers action=".$action." A trigger was declared for class ".get_class($objMod)." but method runTrigger was not found", LOG_ERR); } From d13ebdef2f8eb22e97aa0408e2c6f7f7bee41004 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Oct 2025 11:51:55 +0200 Subject: [PATCH 16/68] Update doc --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 71eaf9fa326..d69d30f0693 100644 --- a/ChangeLog +++ b/ChangeLog @@ -31,6 +31,7 @@ The following changes may create regressions for some external modules, but were * The library timepicker.js has been removed. Was not used by Dolibarr. * Because of new TRIGGER_PREFIX property triggers SUPPLIER_PRODUCT_BUYPRICE_XXX are renamed to PRODUCT_BUYPRICE_XXX. * Function img_pdf() has been removed. Replace it with img_picto('', 'pdf.png') if you were using it. +* The method run_trigger() was deprecated 10+ years ago in favor of runTrigger(). It has been removed. Change your trigger file if you still use it. ***** ChangeLog for 22.0.2 compared to 22.0.1 ***** From 4fdf50752f121185fa94e50786e79128a22aa015 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Oct 2025 12:31:30 +0200 Subject: [PATCH 17/68] doc --- htdocs/core/class/commoninvoice.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index d7c0fd82126..f7d6b316604 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -1915,7 +1915,7 @@ abstract class CommonInvoice extends CommonObject $idofbankaccountouse = $this->fk_account; if (empty($idofbankaccountouse)) { - $idofbankaccountouse = $this->fk_bank; + $idofbankaccountouse = $this->fk_bank; // for backward compatibility } if (empty($idofbankaccountouse)) { $idofbankaccountouse = getDolGlobalInt('FACTURE_RIB_NUMBER'); From f0d53c7dc6fb0bee487c488bd419b6958ecfcaac Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Oct 2025 12:55:43 +0200 Subject: [PATCH 18/68] Fix pr --- .github/workflows/ci-pr-devcamp.yaml.disabled | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/ci-pr-devcamp.yaml.disabled diff --git a/.github/workflows/ci-pr-devcamp.yaml.disabled b/.github/workflows/ci-pr-devcamp.yaml.disabled new file mode 100644 index 00000000000..375974b43cd --- /dev/null +++ b/.github/workflows/ci-pr-devcamp.yaml.disabled @@ -0,0 +1,45 @@ +# Action to prepare the github action +# Go on Dolibarr Organization - Settings - Developer settings - GitHub App (https://github.com/organizations/Dolibarr/settings/apps) +# Create an App: Enter a name + In Home page URL use https://github.com/Dolibarr/dolibarr + Disable webhook +# Set Permissions (see other app for list of permissions) +# Click on generate the private keys +# Click on Install application - choose the repository of the bot +# Go on Organisation - Secret and variables and create a secret PR_SECRET_KEY and copy the content of received private key. Choose the repository access to "Repository Dolibarr". +# Go on Organisation - Secret and variables and create a variable PR_APP_ID and copy the ID of the previously create ID. Choose the repository access to "Repository Dolibarr". +# + +name: Set the tag with devcamp label during the session of a devcamp +on: + pull_request_target: + types: [opened] + + +permissions: + pull-requests: write + issues: write + +jobs: + add-label-devcamp: + runs-on: ubuntu-latest + + steps: + #- name: Install GitHub CLI + # run: sudo apt-get install gh + + - name: Generate a token + id: generate-token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ vars.PR_APP_ID }} + private-key: ${{ secrets.PR_SECRET_KEY }} + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Assign label + env: + GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} + url: ${{ github.event.pull_request.html_url }} + run: | + echo "env.url=${{env.url}}" + gh pr edit "${{env.url}}" --add-label "Event: DevCamp 2025 XXX" From 82010e7a60ef774792edb8116acbea6ba156ef0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 15 Oct 2025 18:56:13 +0200 Subject: [PATCH 19/68] fix CI payment_salary.php (#35767) * fix CI payment_salary.php * Update baseline.txt * Update phpstan-baseline.neon --- dev/build/phpstan/phpstan-baseline.neon | 4 +- dev/tools/phan/baseline.txt | 2 +- htdocs/salaries/payment_salary.php | 69 ++++++++++++------------- 3 files changed, 35 insertions(+), 40 deletions(-) diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index 18c0d0eeb6d..f459132b105 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -15850,13 +15850,13 @@ parameters: message: '#^Comparison operation "\>" between 1 and 1 is always false\.$#' identifier: greater.alwaysFalse count: 1 - path: ../../../htdocs/salaries/paiement_salary.php + path: ../../../htdocs/salaries/payment_salary.php - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue count: 2 - path: ../../../htdocs/salaries/paiement_salary.php + path: ../../../htdocs/salaries/payment_salary.php - message: '#^Negated boolean expression is always false\.$#' diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index 08c4603f85e..8c6712b16bd 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -253,7 +253,7 @@ return [ 'htdocs/recruitment/recruitmentjobposition_card.php' => ['PhanUndeclaredProperty'], 'htdocs/recruitment/recruitmentjobposition_document.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/recruitment/recruitmentjobposition_note.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/salaries/paiement_salary.php' => ['PhanUndeclaredProperty'], + 'htdocs/salaries/payment_salary.php' => ['PhanUndeclaredProperty'], 'htdocs/salaries/virement_request.php' => ['PhanUndeclaredProperty'], 'htdocs/societe/ajax/company.php' => ['PhanUndeclaredProperty'], 'htdocs/societe/class/societe.class.php' => ['PhanTypeMismatchProperty'], diff --git a/htdocs/salaries/payment_salary.php b/htdocs/salaries/payment_salary.php index 06301af8a23..bcf7cd4768d 100644 --- a/htdocs/salaries/payment_salary.php +++ b/htdocs/salaries/payment_salary.php @@ -109,48 +109,43 @@ if (($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == ' if (!$error) { $paymentid = 0; + $db->begin(); + + // Create a line of payments + $paiement = new PaymentSalary($db); + $paiement->fk_salary = $id; + $paiement->chid = $id; // deprecated + $paiement->datep = $datepaye; + $paiement->amounts = $amounts; // Tableau de montant + $paiement->fk_typepayment = GETPOSTINT("paiementtype"); + $paiement->num_payment = GETPOST("num_payment", 'alphanohtml'); + $paiement->note = GETPOST("note", 'restricthtml'); + $paiement->note_private = GETPOST("note", 'restricthtml'); + + $paymentid = $paiement->create($user, (GETPOST('closepaidsalary') == 'on' ? 1 : 0)); + if ($paymentid < 0) { + $error++; + setEventMessages($paiement->error, null, 'errors'); + $action = 'create'; + } if (!$error) { - $db->begin(); + $result = $paiement->addPaymentToBank($user, 'payment_salary', '(SalaryPayment)', GETPOSTINT('accountid'), '', ''); - // Create a line of payments - $paiement = new PaymentSalary($db); - $paiement->fk_salary = $id; - $paiement->chid = $id; // deprecated - $paiement->datep = $datepaye; - $paiement->amounts = $amounts; // Tableau de montant - $paiement->fk_typepayment = GETPOSTINT("paiementtype"); - $paiement->num_payment = GETPOST("num_payment", 'alphanohtml'); - $paiement->note = GETPOST("note", 'restricthtml'); - $paiement->note_private = GETPOST("note", 'restricthtml'); - - if (!$error) { - $paymentid = $paiement->create($user, (GETPOST('closepaidsalary') == 'on' ? 1 : 0)); - if ($paymentid < 0) { - $error++; - setEventMessages($paiement->error, null, 'errors'); - $action = 'create'; - } + if (!($result > 0)) { + $error++; + setEventMessages($paiement->error, null, 'errors'); + $action = 'create'; } + } - if (!$error) { - $result = $paiement->addPaymentToBank($user, 'payment_salary', '(SalaryPayment)', GETPOSTINT('accountid'), '', ''); - - if (!($result > 0)) { - $error++; - setEventMessages($paiement->error, null, 'errors'); - $action = 'create'; - } - } - - if (!$error) { - $db->commit(); - $loc = DOL_URL_ROOT.'/salaries/card.php?id='.$id; - header('Location: '.$loc); - exit; - } else { - $db->rollback(); - } + if (!$error) { + $db->commit(); + $loc = DOL_URL_ROOT.'/salaries/card.php?id='.$id; + header('Location: '.$loc); + exit; + } else { + $db->rollback(); } } } From fc7f9058af4ad50df5870b1e7691f97b6e29694f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Oct 2025 18:58:12 +0200 Subject: [PATCH 20/68] Fix ci --- htdocs/salaries/payment_salary.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/salaries/payment_salary.php b/htdocs/salaries/payment_salary.php index 06301af8a23..1a86e7c891d 100644 --- a/htdocs/salaries/payment_salary.php +++ b/htdocs/salaries/payment_salary.php @@ -315,6 +315,8 @@ if ($action == 'create') { $totalrecu += $objp->amount; $i++; } + + /* if ($i > 1) { // Print total print ''; @@ -325,6 +327,7 @@ if ($action == 'create') { print ''; print "\n"; } + */ print "
'.$langs->trans("Parameter").'
'.$langs->trans("Version").''; -$arrayphpminversionerror = array(5, 5, 0); -$arrayphpminversionwarning = array(5, 6, 0); +$arrayphpminversionerror = array(7, 1, 0); +$arrayphpminversionwarning = array(7, 1, 0); if (versioncompare(versionphparray(), $arrayphpminversionerror) < 0) { print img_picto('Error', 'error').' '.$langs->trans("ErrorPHPVersionTooLow", versiontostring($arrayphpminversionerror)); diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 06241b6034b..16e493f5317 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -98,7 +98,6 @@ if (!empty($useragent)) { $browserversion = $tmp['browserversion']; $browsername = $tmp['browsername']; if ($browsername == 'ie' && $browserversion < 7) { - //print 'Error '; print img_picto('', 'warning', 'class="pictofixedwidth warning"'); print $langs->trans("WarningBrowserTooOld")."
\n"; } @@ -109,18 +108,15 @@ if (!empty($useragent)) { $arrayphpminversionerror = array(7, 0, 0); $arrayphpminversionwarning = array(7, 1, 0); if (versioncompare(versionphparray(), $arrayphpminversionerror) < 0) { // Minimum to use (error if lower) - //print 'Error '; print img_picto('', 'warning', 'class="pictofixedwidth error"'); print $langs->trans("ErrorPHPVersionTooLow", versiontostring($arrayphpminversionerror)); $checksok = 0; // 0=error, 1=warning } elseif (versioncompare(versionphparray(), $arrayphpminversionwarning) < 0) { // Minimum supported (warning if lower) - //print 'Error '; print img_picto('', 'warning', 'class="pictofixedwidth warning"'); print $langs->trans("ErrorPHPVersionTooLow", versiontostring($arrayphpminversionwarning)); $checksok = 1; // 0=error, 1=warning } else { print img_picto('', 'tick', 'class="pictofixedwidth"'); - //print 'Ok '; print $langs->trans("PHPVersion")." ".versiontostring(versionphparray()); } if (empty($force_install_nophpinfo) && (!file_exists($lockfile) && !file_exists($lockfile2))) { // Do not show sensible information in update process, only in install process. @@ -135,7 +131,6 @@ print "
\n"; $arrayphpmaxversionwarning = array(8, 4, 0); if (versioncompare(versionphparray(), $arrayphpmaxversionwarning) > 0 && versioncompare(versionphparray(), $arrayphpmaxversionwarning) < 3) { // Maximum to use (warning if higher) print img_picto('', 'warning', 'class="pictofixedwidth error"'); - //print 'Error '; print $langs->trans("ErrorPHPVersionTooHigh", versiontostring($arrayphpmaxversionwarning)); $checksok = 1; // 0=error, 1=warning print "
\n"; @@ -145,26 +140,23 @@ if (versioncompare(versionphparray(), $arrayphpmaxversionwarning) > 0 && version // Check PHP support for $_GET and $_POST if (!isset($_GET["testget"]) && !isset($_POST["testpost"])) { // We must keep $_GET and $_POST here print img_picto('', 'warning', 'class="pictofixedwidth warning"'); - //print 'Warning '; print $langs->trans("PHPSupportPOSTGETKo"); print ' ('.$langs->trans("Recheck").')'; print "
\n"; $checksok = 0; } else { print img_picto('', 'tick', 'class="pictofixedwidth"'); - //print 'Ok '; print $langs->trans("PHPSupportPOSTGETOk")."
\n"; } // Check if session_id is enabled if (!function_exists("session_id")) { - print 'Error '; + print img_picto('', 'warning', 'class="pictofixedwidth error"'); print $langs->trans("ErrorPHPDoesNotSupportSessions")."
\n"; $checksok = 0; } else { print img_picto('', 'tick', 'class="pictofixedwidth"'); - //print 'Ok '; print $langs->trans("PHPSupportSessions")."
\n"; } @@ -287,11 +279,9 @@ if ($memmaxorig != '') { } if ($memmax >= $memrequired || $memmax == -1) { print img_picto('', 'tick', 'class="pictofixedwidth"'); - //print 'Ok '; print $langs->trans("PHPMemoryOK", $memmaxorig, $memrequiredorig)."
\n"; } else { print img_picto('', 'warning', 'class="pictofixedwidth warning"'); - //print 'Warning '; print $langs->trans("PHPMemoryTooLow", $memmaxorig, $memrequiredorig)."
\n"; } } @@ -351,7 +341,6 @@ if (!file_exists($conffile)) { } else { if (dol_is_dir($conffile)) { print img_picto('', 'warning', 'class="pictofixedwidth error"'); - //print 'Error '; print $langs->trans("ConfFileMustBeAFileNotADir", $conffiletoshow); $allowinstall = 0; @@ -359,16 +348,13 @@ if (!file_exists($conffile)) { // File exists but cannot be modified if ($confexists) { print img_picto('', 'tick', 'class="pictofixedwidth"'); - //print 'Ok '; print $langs->trans("ConfFileExists", $conffiletoshow); } else { print img_picto('', 'tick', 'class="pictofixedwidth"'); - //print 'Ok '; print $langs->trans("ConfFileCouldBeCreated", $conffiletoshow); } print "
"; print img_picto('', 'tick', 'class="pictofixedwidth warning"'); - //print 'Warning '; print $langs->trans("ConfFileIsNotWritable", $conffiletoshow); print "
\n"; @@ -377,16 +363,13 @@ if (!file_exists($conffile)) { // File exists and can be modified if ($confexists) { print img_picto('', 'tick', 'class="pictofixedwidth"'); - //print 'Ok '; print $langs->trans("ConfFileExists", $conffiletoshow); } else { print img_picto('', 'tick', 'class="pictofixedwidth"'); - //print 'Ok '; print $langs->trans("ConfFileCouldBeCreated", $conffiletoshow); } print "
"; print img_picto('', 'tick', 'class="pictofixedwidth"'); - //print 'Ok '; print $langs->trans("ConfFileIsWritable", $conffiletoshow); print "
\n"; @@ -497,7 +480,6 @@ if (!file_exists($conffile)) { $choice .= '
'; //print $langs->trans("InstallChoiceRecommanded",DOL_VERSION,$conf->global->MAIN_VERSION_LAST_UPGRADE); $choice .= '
'.$langs->trans("InstallChoiceSuggested").'
'; - // Ok '; } $choice .= '
'; - print ''.dol_print_date($db->jdate($objp->do), "day").""; + print ''.dol_print_date($db->jdate($objp->datep), "day").""; print "'; + print ''; + print ''; + print ''; + print ''.$obj->note_public.''.$obj->note_private.'
 
"; From e84ea68218e5f82d9ed0170ffa1b03a3a8cbf680 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 15 Oct 2025 18:58:53 +0200 Subject: [PATCH 21/68] FIX wrong getEntiy element name (#35771) --- htdocs/core/boxes/box_last_knowledgerecord.php | 2 +- htdocs/core/boxes/box_last_modified_knowledgerecord.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_last_knowledgerecord.php b/htdocs/core/boxes/box_last_knowledgerecord.php index 9f4d98999ac..cc1b158f356 100644 --- a/htdocs/core/boxes/box_last_knowledgerecord.php +++ b/htdocs/core/boxes/box_last_knowledgerecord.php @@ -93,7 +93,7 @@ class box_last_knowledgerecord extends ModeleBoxes if ($user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) { $sql = 'SELECT k.rowid as id, k.date_creation, k.ref, k.lang, k.question, k.status as status'; $sql .= " FROM ".MAIN_DB_PREFIX."knowledgemanagement_knowledgerecord as k"; - $sql .= " WHERE k.entity IN (".getEntity('knowledgemanagement').")"; + $sql .= " WHERE k.entity IN (".getEntity('knowledgerecord').")"; if ($user->socid) { $sql .= " AND k.fk_soc= ".((int) $user->socid); diff --git a/htdocs/core/boxes/box_last_modified_knowledgerecord.php b/htdocs/core/boxes/box_last_modified_knowledgerecord.php index c41d141d5e8..cc8c47bf46a 100644 --- a/htdocs/core/boxes/box_last_modified_knowledgerecord.php +++ b/htdocs/core/boxes/box_last_modified_knowledgerecord.php @@ -93,7 +93,7 @@ class box_last_modified_knowledgerecord extends ModeleBoxes if ($user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) { $sql = 'SELECT k.rowid as id, k.date_creation, k.ref, k.lang, k.question, k.status as status'; $sql .= " FROM ".MAIN_DB_PREFIX."knowledgemanagement_knowledgerecord as k"; - $sql .= " WHERE k.entity IN (".getEntity('knowledgemanagement').")"; + $sql .= " WHERE k.entity IN (".getEntity('knowledgerecord').")"; if ($user->socid) { $sql .= " AND k.fk_soc= ".((int) $user->socid); From f85108b8aca1684ce9cec36cda09901adb322606 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 15 Oct 2025 18:59:33 +0200 Subject: [PATCH 22/68] FIX check if category module is enabled (#35770) --- .../core/modules/modKnowledgeManagement.class.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/modules/modKnowledgeManagement.class.php b/htdocs/core/modules/modKnowledgeManagement.class.php index d7352647f24..a777585745b 100644 --- a/htdocs/core/modules/modKnowledgeManagement.class.php +++ b/htdocs/core/modules/modKnowledgeManagement.class.php @@ -300,9 +300,9 @@ class modKnowledgeManagement extends DolibarrModules 'langs' => 'knowledgemanagement', 'position' => 101, // Define condition to show or hide menu entry. Use '$conf->knowledgemanagement->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. - 'enabled' => '$conf->knowledgemanagement->enabled', + 'enabled' => 'isModEnabled("knowledgemanagement")', // Use 'perms'=>'$user->rights->knowledgemanagement->level1->level2' if you want your menu with a permission rules - 'perms' => '$user->rights->knowledgemanagement->knowledgerecord->read', + 'perms' => '$user->hasRight("knowledgemanagement", "knowledgerecord", "read")', 'target' => '', // 0=Menu for internal users, 1=external users, 2=both 'user' => 2, @@ -320,9 +320,9 @@ class modKnowledgeManagement extends DolibarrModules 'langs' => 'knowledgemanagement', 'position' => 111, // Define condition to show or hide menu entry. Use '$conf->knowledgemanagement->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. - 'enabled' => '$conf->knowledgemanagement->enabled', + 'enabled' => 'isModEnabled("knowledgemanagement")', // Use 'perms'=>'$user->rights->knowledgemanagement->level1->level2' if you want your menu with a permission rules - 'perms' => '$user->rights->knowledgemanagement->knowledgerecord->read', + 'perms' => '$user->hasRight("knowledgemanagement", "knowledgerecord", "read")', 'target' => '', // 0=Menu for internal users, 1=external users, 2=both 'user' => 2, @@ -340,7 +340,7 @@ class modKnowledgeManagement extends DolibarrModules 'langs' => 'knowledgemanagement', 'position' => 110, // Define condition to show or hide menu entry. Use '$conf->knowledgemanagement->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. - 'enabled' => '$conf->knowledgemanagement->enabled', + 'enabled' => 'isModEnabled("knowledgemanagement")', // Use 'perms'=>'$user->rights->knowledgemanagement->level1->level2' if you want your menu with a permission rules 'perms' => '$user->hasRight("knowledgemanagement", "knowledgerecord", "write")', 'target' => '', @@ -355,8 +355,8 @@ class modKnowledgeManagement extends DolibarrModules 'url' => '/categories/index.php?type=13', 'langs' => 'knowledgemanagement', 'position' => 112, - 'enabled' => '$conf->knowledgemanagement->enabled', - 'perms' => '$user->rights->knowledgemanagement->knowledgerecord->read', + 'enabled' => 'isModEnabled("knowledgemanagement") && isModenabled("category")', + 'perms' => '$user->hasRight("knowledgemanagement", "knowledgerecord", "read")', 'target' => '', 'user' => 0 ); From c45ab5c3870fdc0ce3a3ca8565d259569289adf4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Oct 2025 20:03:54 +0200 Subject: [PATCH 23/68] Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop --- htdocs/comm/propal/class/propal.class.php | 7 ++++++- test/phpunit/PropalTest.php | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 05a6ed2c135..37e263ac6bf 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -3582,9 +3582,10 @@ class Propal extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * + * @param array $param Array of options * @return int */ - public function initAsSpecimen() + public function initAsSpecimen($param = array()) { global $conf, $langs; @@ -3594,6 +3595,9 @@ class Propal extends CommonObject $sql = "SELECT rowid"; $sql .= " FROM ".MAIN_DB_PREFIX."product"; $sql .= " WHERE entity IN (".getEntity('product').")"; + if (array_key_exists('status', $param)) { + $sql .= " AND status = ".((int) $param['status']); + } $sql .= $this->db->plimit(100); $resql = $this->db->query($sql); @@ -3610,6 +3614,7 @@ class Propal extends CommonObject // Initialise parameters $this->id = 0; $this->ref = 'SPECIMEN'; + $this->ref_customer = 'NEMICEPS'; $this->ref_client = 'NEMICEPS'; $this->specimen = 1; $this->socid = 1; diff --git a/test/phpunit/PropalTest.php b/test/phpunit/PropalTest.php index ae388aeecd3..7a4691ff025 100644 --- a/test/phpunit/PropalTest.php +++ b/test/phpunit/PropalTest.php @@ -63,7 +63,8 @@ class PropalTest extends CommonClassTest $db = $this->savdb; $localobject = new Propal($db); - $localobject->initAsSpecimen(); + $param = array('status' => 1); + $localobject->initAsSpecimen($param); $result = $localobject->create($user); $this->assertLessThan($result, 0); From fa166d62a8b8e5d08217f90afcf2ae039ed15b8a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Oct 2025 19:34:59 +0200 Subject: [PATCH 24/68] Fix duplicates answers --- htdocs/admin/modules.php | 4 +-- .../class/externalModules.class.php | 36 ++++++++++++++++--- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 3b0f8ceb9cc..bd4ab9fde89 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -1323,7 +1323,7 @@ if ($mode == 'marketplace') { $categories_tree = $remotestore->getCategories($options['categorie']); // Call API to get the categories - $products_list = $remotestore->getProducts($options); + $products_list = $remotestore->getProducts($options); // Get list of product from all sources $previouslink = $remotestore->get_previous_link(); @@ -1337,7 +1337,7 @@ if ($mode == 'marketplace') {
- +
diff --git a/htdocs/admin/remotestore/class/externalModules.class.php b/htdocs/admin/remotestore/class/externalModules.class.php index 95a8767a25d..f1fb5427324 100644 --- a/htdocs/admin/remotestore/class/externalModules.class.php +++ b/htdocs/admin/remotestore/class/externalModules.class.php @@ -352,10 +352,13 @@ class ExternalModules 'lang' => $this->lang ]; + + $this->numberTotalOfProducts = 0; + // Fetch the products from Dolistore source + $dolistoreProducts = array(); $dolistoreProductsTotal = 0; - $this->numberTotalOfProducts = 0; if ($this->dolistoreApiStatus > 0 && getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_DOLISTORE')) { $getDolistoreProducts = $this->callApi('products', $data); @@ -368,8 +371,9 @@ class ExternalModules $this->numberTotalOfProducts += $dolistoreProductsTotal; } } - + var_dump($dolistoreProducts); // Fetch the products from the github repo + $fileProducts = array(); $fileProductsTotal = 0; if (!empty($this->githubFileStatus) && getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_COMMUNITY')) { @@ -389,8 +393,22 @@ class ExternalModules // Number of pages $this->numberTotalOfPages = (int) ceil(max($fileProductsTotal / $this->per_page, $dolistoreProductsTotal / $this->per_page)); - // merge both sources - $this->products = array_values(array_merge($fileProducts, $dolistoreProducts)); + // Merge both sources (github community modules have priority on dolistore). + $this->products = $dolistoreProducts; + foreach ($fileProducts as $fileProduct) { + $id = $fileProduct['id']; + if ($id > 0) { + if (empty($this->products[$id])) { // Not already present in array + array_unshift($this->products, $fileProduct); + } else { + $this->products[$id] = $fileProduct; + $this->products[$id]['category'] = $fileProduct['category']; + } + } else { + array_unshift($this->products, $fileProduct); + } + } + $i = 0; foreach ($this->products as $product) { @@ -975,7 +993,15 @@ class ExternalModules continue; } + // Check if there is a known ID + $reg = array(); + $id = 0; + if (!empty($package['dolistore-download']) && preg_match('/www\.dolistore\.com\/product\.php\?id=(\d+)/', $package['dolistore-download'], $reg)) { + $id = $reg[1]; + } + $adaptedPackage = [ + 'id' => $id, 'ref' => str_replace(' ', '', $package['modulename'] . '-' . $package['current_version'] . '@' . (array_key_exists('author', $package) ? $package['author'] : 'unkownauthor')), 'label' => !empty($package['label'][substr($this->lang, 0, 2)]) @@ -1064,7 +1090,7 @@ class ExternalModules 'status' => empty($package['status']) ? '' : $package['status'] ]; - $adaptedData[] = $adaptedPackage; + $adaptedData[$package['id']] = $adaptedPackage; } } From 65a57465f962626a4e2ce75ae57a14c8e1fae391 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Oct 2025 19:35:30 +0200 Subject: [PATCH 25/68] Fix var_dump --- htdocs/admin/remotestore/class/externalModules.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/remotestore/class/externalModules.class.php b/htdocs/admin/remotestore/class/externalModules.class.php index f1fb5427324..a57200d4f76 100644 --- a/htdocs/admin/remotestore/class/externalModules.class.php +++ b/htdocs/admin/remotestore/class/externalModules.class.php @@ -371,7 +371,7 @@ class ExternalModules $this->numberTotalOfProducts += $dolistoreProductsTotal; } } - var_dump($dolistoreProducts); + // Fetch the products from the github repo $fileProducts = array(); From 5228c9827e7477fec3166da9e7f568f534b7909f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Oct 2025 19:46:46 +0200 Subject: [PATCH 26/68] Fix CI --- .../supplier_proposal/class/supplier_proposal.class.php | 9 +++++++-- test/phpunit/SupplierProposalTest.php | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 8460015a074..f177778b1d5 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -2393,11 +2393,12 @@ class SupplierProposal extends CommonObject * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * + * @param array $param Array of options * @return int */ - public function initAsSpecimen() + public function initAsSpecimen($param = array()) { - global $user, $langs, $conf; + global $langs; // Load array of products prodids $num_prods = 0; @@ -2405,6 +2406,9 @@ class SupplierProposal extends CommonObject $sql = "SELECT rowid"; $sql .= " FROM ".MAIN_DB_PREFIX."product"; $sql .= " WHERE entity IN (".getEntity('product').")"; + if (array_key_exists('status', $param)) { + $sql .= " AND status = ".((int) $param['status']); + } $sql .= $this->db->plimit(100); $resql = $this->db->query($sql); @@ -2421,6 +2425,7 @@ class SupplierProposal extends CommonObject // Initialise parameters $this->id = 0; $this->ref = 'SPECIMEN'; + $this->ref_supplier = 'NEMICEPS'; $this->specimen = 1; $this->socid = 1; $this->date = time(); diff --git a/test/phpunit/SupplierProposalTest.php b/test/phpunit/SupplierProposalTest.php index 213938f4a38..4a7437c8313 100644 --- a/test/phpunit/SupplierProposalTest.php +++ b/test/phpunit/SupplierProposalTest.php @@ -105,7 +105,8 @@ class SupplierProposalTest extends CommonClassTest $db = $this->savdb; $localobject = new SupplierProposal($db); - $localobject->initAsSpecimen(); + $param = array('status' => 1); + $localobject->initAsSpecimen($param); $result = $localobject->create($user); $this->assertLessThan($result, 0); From 9d24127f379b9346900e7b33aa9c275b3109286a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Oct 2025 20:15:06 +0200 Subject: [PATCH 27/68] Clean code --- htdocs/supplier_proposal/class/supplier_proposal.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index f177778b1d5..8102875da37 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -2482,7 +2482,7 @@ class SupplierProposal extends CommonObject */ public function loadStateBoard() { - global $conf, $user; + global $user; $this->nb = array(); $clause = "WHERE"; From ef445760790d962b1a5ef4ee4e8f995ecdf43915 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Oct 2025 21:13:00 +0200 Subject: [PATCH 28/68] Fix bad test on non existing $result --- htdocs/core/actions_setnotes.inc.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/core/actions_setnotes.inc.php b/htdocs/core/actions_setnotes.inc.php index ac8c65a0670..c536e383870 100644 --- a/htdocs/core/actions_setnotes.inc.php +++ b/htdocs/core/actions_setnotes.inc.php @@ -47,7 +47,9 @@ if ($action == 'setnote_public' && !empty($permissionnote) && !GETPOST('cancel', $object->fetch($id); // Fetch may not be already done } - $result_update = $object->update_note(dol_html_entity_decode(GETPOST('note_public', 'restricthtml'), ENT_QUOTES | ENT_HTML5, 'UTF-8', 1), '_public'); + $notePublic = GETPOST('note_public', 'restricthtml'); + + $result_update = $object->update_note(dol_html_entity_decode($notePublic, ENT_QUOTES | ENT_HTML5, 'UTF-8', 1), '_public'); if ($result_update < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -82,10 +84,6 @@ if ($action == 'setnote_public' && !empty($permissionnote) && !GETPOST('cancel', if ($resultGenDoc < 0) { setEventMessages($object->error, $object->errors, 'warnings'); } - - if ($result < 0) { - dol_print_error($db, $object->error, $object->errors); - } } } } elseif ($action == 'setnote_private' && !empty($permissionnote) && !GETPOST('cancel', 'alpha')) { // Set public note @@ -97,7 +95,10 @@ if ($action == 'setnote_public' && !empty($permissionnote) && !GETPOST('cancel', if (empty($object->id)) { $object->fetch($id); // Fetch may not be already done } - $result = $object->update_note(dol_html_entity_decode(GETPOST('note_private', 'restricthtml'), ENT_QUOTES | ENT_HTML5, 'UTF-8', 1), '_private'); + + $notePrivate = GETPOST('note_private', 'restricthtml'); + + $result = $object->update_note(dol_html_entity_decode($notePrivate, ENT_QUOTES | ENT_HTML5, 'UTF-8', 1), '_private'); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } From 5d3c80e0afcb22c4be5fad3adda32ab0f0e2a185 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Oct 2025 21:19:00 +0200 Subject: [PATCH 29/68] FIx try a better fo for #35792 --- htdocs/core/lib/functions.lib.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 19380ee10bd..127f048cf5f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8793,6 +8793,12 @@ function dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox = 0, $check = ' do { $oldstringtoclean = $out; + $outishtml = 0; + if (dol_textishtml($out)) { + $outishtml = 1; + } + + // HTML sanitizer by DOMDocument if (!empty($out) && getDolGlobalString('MAIN_RESTRICTHTML_ONLY_VALID_HTML') && $check != 'restricthtmlallowunvalid') { try { libxml_use_internal_errors(false); // Avoid to fill memory with xml errors @@ -8809,7 +8815,7 @@ function dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox = 0, $check = ' // like 'abc' that wrongly ends up, without the trick, with '

abc

' // Add also a trick to solve utf8 lost. // I don't know what the xml encoding is the trick for - if (dol_textishtml($out)) { + if ($outishtml) { //$out = '
'.$out.'
'; $out = '
'.$out.'
'; //$out = '
'.$out.'
'; @@ -8832,6 +8838,10 @@ function dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox = 0, $check = ' // $out = preg_replace('/^<\?xml encoding="UTF-8">
/', '', $out); // $out = preg_replace('/<\/div>$/', '', $out); // var_dump('rrrrrrrrrrrrrrrrrrrrrrrrrrrrr'.$out); + + if (!$outishtml) { // If $out was not HTML content we made before a dol_nl2br so we must do the opposite operation now + $out = str_replace('
', '', $out); + } } catch (Exception $e) { // If error, invalid HTML string with no way to clean it //print $e->getMessage(); @@ -8839,8 +8849,10 @@ function dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox = 0, $check = ' } } - if (!empty($out) && getDolGlobalString('MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY') && !in_array($check, array('restricthtmlallowunvalid', 'restricthtmlallowlinkscript'))) { - // Tidy can't be used for restricthtmlallowunvalid and restricthtmlallowlinkscript + // HTML sanitizer by Tidy + // Tidy can't be used for restricthtmlallowunvalid and restricthtmlallowlinkscript + // Tidy can't be used for non html text content as it is corrupting the new lines fields. + if (!empty($out) && getDolGlobalString('MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY') && !in_array($check, array('restricthtmlallowunvalid', 'restricthtmlallowlinkscript')) && $outishtml) { // TODO Try to implement a hack for restricthtmlallowlinkscript by renaming tag and '."\n"; } -print ''; +print ''; print ''; print ''; diff --git a/htdocs/admin/accounting.php b/htdocs/admin/accounting.php index 9307ebe381b..49db0a149bc 100644 --- a/htdocs/admin/accounting.php +++ b/htdocs/admin/accounting.php @@ -67,13 +67,13 @@ $help_url = ''; llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-admin page-accounting'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($title, $linkback, 'title_setup'); print "
\n"; $texttoshow = $langs->trans("AccountancySetupDoneFromAccountancyMenu", '{s1}'.$langs->transnoentitiesnoconv("Accounting").' - '.$langs->transnoentitiesnoconv("Setup").'{s2}'); -$texttoshow = str_replace('{s1}', '', $texttoshow); +$texttoshow = str_replace('{s1}', '', $texttoshow); $texttoshow = str_replace('{s2}', ''.img_picto("", "url", 'class="paddingleft"'), $texttoshow); print ''.$texttoshow."
\n"; print "
\n"; diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index 742c541da99..b28dd64b274 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -129,7 +129,7 @@ $help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Ter llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-admin page-agenda'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/agenda_extrafields.php b/htdocs/admin/agenda_extrafields.php index 51aa833f5f8..8a581ac0fa3 100644 --- a/htdocs/admin/agenda_extrafields.php +++ b/htdocs/admin/agenda_extrafields.php @@ -75,7 +75,7 @@ $textobject = $langs->transnoentitiesnoconv("Agenda"); $wikihelp = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung'; llxHeader('', $langs->trans("AgendaSetup"), $wikihelp, '', 0, 0, '', '', '', 'mod-admin page-agenda_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 9593272bcaa..7ab2ac7508e 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -201,7 +201,7 @@ $arrayofcss = array(); $wikihelp = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung'; llxHeader('', $langs->trans("AgendaSetup"), $wikihelp, '', 0, 0, $arrayofjs, $arrayofcss, '', 'mod-admin page-agenda-extsites'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 060008ae883..fede7a740ca 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -198,7 +198,7 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); $wikihelp = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung'; llxHeader('', $langs->trans("AgendaSetup"), $wikihelp, '', 0, 0, '', '', '', 'mod-admin page-agenda_other'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index c95993e4586..c6a7c0d28d8 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/htdocs/admin/agenda_reminder.php @@ -166,7 +166,7 @@ $formactions = new FormActions($db); $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-agenda_reminder'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index 4ed15ecf8e3..2e21b9887fe 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -104,7 +104,7 @@ if (!isset($conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY)) { $wikihelp = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung'; llxHeader('', $langs->trans("AgendaSetup"), $wikihelp, '', 0, 0, '', '', '', 'mod-admin page-agenda_xcal'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index e412202f15d..369382bf4e5 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -224,7 +224,7 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); llxHeader("", $langs->trans("BankSetupModule"), '', '', 0, 0, '', '', '', 'mod-admin page-bank'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("BankSetupModule"), $linkback, 'title_setup'); diff --git a/htdocs/admin/bank_extrafields.php b/htdocs/admin/bank_extrafields.php index f005ce7466c..17ff1082230 100644 --- a/htdocs/admin/bank_extrafields.php +++ b/htdocs/admin/bank_extrafields.php @@ -76,7 +76,7 @@ $page_name = "BankSetupModule"; llxHeader('', $langs->trans("BankSetupModule"), $help_url, '', 0, 0, '', '', '', 'mod-admin page-bank_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); diff --git a/htdocs/admin/bank_payments_extrafields.php b/htdocs/admin/bank_payments_extrafields.php index e1b84db3157..b4ca2483f2c 100644 --- a/htdocs/admin/bank_payments_extrafields.php +++ b/htdocs/admin/bank_payments_extrafields.php @@ -76,7 +76,7 @@ $page_name = "BankSetupModule"; llxHeader('', $langs->trans("BankSetupModule"), $help_url, '', 0, 0, '', '', '', 'mod-admin page-bank_payments_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); diff --git a/htdocs/admin/bankline_extrafields.php b/htdocs/admin/bankline_extrafields.php index 0f0a2d97c77..d8c812d08d4 100644 --- a/htdocs/admin/bankline_extrafields.php +++ b/htdocs/admin/bankline_extrafields.php @@ -76,7 +76,7 @@ $page_name = "BankSetupModule"; llxHeader('', $langs->trans("BankSetupModule"), $help_url, '', 0, 0, '', '', '', 'mod-admin page-bankline_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index 790e5fb2cb1..14e773bf017 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -148,7 +148,7 @@ $formbarcode = new FormBarCode($db); $help_url = 'EN:Module_Barcode|FR:Module_Codes_Barre|ES:Módulo Código de barra|DE:Modul_Barcode'; llxHeader('', $langs->trans("BarcodeSetup"), $help_url, '', 0, 0, '', '', '', 'mod-admin page-barcode'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("BarcodeSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php index 57cb649fbe6..7009b6149f7 100644 --- a/htdocs/admin/bom.php +++ b/htdocs/admin/bom.php @@ -175,7 +175,7 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); llxHeader("", $langs->trans("BOMsSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-bom'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("BOMsSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/bom_extrafields.php b/htdocs/admin/bom_extrafields.php index 38e70b2e7a2..01d9ca59dbe 100644 --- a/htdocs/admin/bom_extrafields.php +++ b/htdocs/admin/bom_extrafields.php @@ -76,7 +76,7 @@ $help_url = ''; llxHeader('', $langs->trans("BOMsSetup"), $help_url, '', 0, 0, '', '', '', 'mod-admin page-bom_extrafiels'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("BOMsSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/bomline_extrafields.php b/htdocs/admin/bomline_extrafields.php index 6fc194fcb6d..8c5126c0ab8 100644 --- a/htdocs/admin/bomline_extrafields.php +++ b/htdocs/admin/bomline_extrafields.php @@ -76,7 +76,7 @@ $help_url = ''; llxHeader('', $langs->trans("BOMsSetup"), $help_url, '', 0, 0, '', '', '', 'mod-admin page-bomline_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("BOMsSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php index 322f8c73252..a4dd5c4fff5 100644 --- a/htdocs/admin/chequereceipts.php +++ b/htdocs/admin/chequereceipts.php @@ -115,7 +115,7 @@ llxHeader("", $langs->trans("BankSetupModule"), '', '', 0, 0, '', '', '', 'mod-a $form = new Form($db); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("BankSetupModule"), $linkback, 'title_setup'); diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 8cc80ef93fb..a8042b821f6 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -81,7 +81,7 @@ $user->fetch_clicktodial(); $wikihelp = 'EN:Module_ClickToDial_En|FR:Module_ClickToDial|ES:Módulo_ClickTodial_Es'; llxHeader('', $langs->trans("ClickToDialSetup"), $wikihelp, '', 0, 0, '', '', '', 'mod-admin page-clicktodial'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ClickToDialSetup"), $linkback, 'title_setup'); @@ -175,7 +175,7 @@ if (getDolGlobalString('CLICKTODIAL_URL')) { $phonefortest = GETPOST('phonefortest'); } - print ''; + print ''; print ''; print $langs->trans("LinkToTestClickToDial", $user->login).' : '; print ''; diff --git a/htdocs/admin/company_socialnetworks.php b/htdocs/admin/company_socialnetworks.php index 191c7f9d802..18b5493d9eb 100644 --- a/htdocs/admin/company_socialnetworks.php +++ b/htdocs/admin/company_socialnetworks.php @@ -6,7 +6,7 @@ * Copyright (C) 2011-2017 Philippe Grand * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2017 Rui Strecht - * Copyright (C) 2020-2024 Frédéric France + * Copyright (C) 2020-2025 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,7 +112,7 @@ print "
\n"; * Edit parameters */ -print ''; +print ''; print ''; print ''; diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index eca386cf842..c2311d835b0 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -142,7 +142,7 @@ llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-compta'); $form = new Form($db); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans('ComptaSetup'), $linkback, 'title_setup'); diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index e04ceef843a..8749fa2c62a 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -219,7 +219,7 @@ llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-contract'); $form = new Form($db); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ContractsSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/dav.php b/htdocs/admin/dav.php index bbc1539d84e..0afe48564ea 100644 --- a/htdocs/admin/dav.php +++ b/htdocs/admin/dav.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -85,7 +85,7 @@ $help_url = 'EN:Module_DAV'; llxHeader('', $langs->trans("DAVSetup"), $help_url, '', 0, 0, '', '', '', 'mod-admin page-dav'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("DAVSetup"), $linkback, 'title_setup'); @@ -98,7 +98,7 @@ $head = dav_admin_prepare_head(); print dol_get_fiche_head($head, 'webdav', '', -1, ''); if ($action == 'edit') { - print ''; + print ''; print ''; print ''; diff --git a/htdocs/admin/debugbar.php b/htdocs/admin/debugbar.php index d2c17dd88df..284a0b7d92c 100644 --- a/htdocs/admin/debugbar.php +++ b/htdocs/admin/debugbar.php @@ -80,7 +80,7 @@ llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-debugbar'); $form = new Form($db); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("DebugBarSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/delivery.php b/htdocs/admin/delivery.php index a4ee948e317..e4febb73d31 100644 --- a/htdocs/admin/delivery.php +++ b/htdocs/admin/delivery.php @@ -220,7 +220,7 @@ llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-delivery'); $form = new Form($db); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup'); print '
'; diff --git a/htdocs/admin/delivery_extrafields.php b/htdocs/admin/delivery_extrafields.php index f2f39fab87f..7153e8b2588 100644 --- a/htdocs/admin/delivery_extrafields.php +++ b/htdocs/admin/delivery_extrafields.php @@ -77,7 +77,7 @@ $textobject = $langs->transnoentitiesnoconv("Receivings"); llxHeader('', $langs->trans("SendingsSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-delivery-extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup'); print "
\n"; diff --git a/htdocs/admin/deliverydet_extrafields.php b/htdocs/admin/deliverydet_extrafields.php index ea9990c20b8..d778b547d18 100644 --- a/htdocs/admin/deliverydet_extrafields.php +++ b/htdocs/admin/deliverydet_extrafields.php @@ -78,7 +78,7 @@ $textobject = $langs->transnoentitiesnoconv("Receivings"); llxHeader('', $langs->trans("SendingsSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-deliverydet_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup'); print "
\n"; diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php index 23d798ff683..648ec2a8eb5 100644 --- a/htdocs/admin/ecm.php +++ b/htdocs/admin/ecm.php @@ -85,7 +85,7 @@ $form = new Form($db); $help_url = ''; llxHeader('', $langs->trans("ECMSetup"), $help_url, '', 0, 0, '', '', '', 'mod-admin page-ecm'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ECMSetup"), $linkback, 'title_setup'); print '
'; diff --git a/htdocs/admin/ecm_directories_extrafields.php b/htdocs/admin/ecm_directories_extrafields.php index 6ebdc1e490a..aaba4e1bf38 100644 --- a/htdocs/admin/ecm_directories_extrafields.php +++ b/htdocs/admin/ecm_directories_extrafields.php @@ -77,7 +77,7 @@ $textobject = $langs->transnoentitiesnoconv("ECM"); llxHeader('', $langs->trans("ECMSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-ecm_directories_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ECMSetup"), $linkback, 'title_setup'); print "
\n"; diff --git a/htdocs/admin/ecm_files_extrafields.php b/htdocs/admin/ecm_files_extrafields.php index d5aba25e7d0..c99dc245924 100644 --- a/htdocs/admin/ecm_files_extrafields.php +++ b/htdocs/admin/ecm_files_extrafields.php @@ -76,7 +76,7 @@ $textobject = $langs->transnoentitiesnoconv("ECM"); llxHeader('', $langs->trans("ECMSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-ecm_files_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ECMSetup"), $linkback, 'title_setup'); print "
\n"; diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index ac3aea7c570..b14439fc7cd 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -2,7 +2,7 @@ /* Copyright (C) 2018 Laurent Destailleur * Copyright (C) 2022 Charlene Benke * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -289,7 +289,7 @@ llxHeader('', 'EmailCollector', $help_url, '', 0, 0, '', '', '', 'mod-admin page if ($action == 'create') { print load_fiche_titre($langs->trans("NewEmailCollector", $langs->transnoentitiesnoconv("EmailCollector"))); - print ''; + print ''; print ''; print ''; print ''; @@ -319,7 +319,7 @@ if ($action == 'create') { if (($id || $ref) && $action == 'edit') { print load_fiche_titre($langs->trans("EmailCollector")); - print ''; + print ''; print ''; print ''; print ''; @@ -641,7 +641,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -838,16 +838,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Move up/down print ''; if ($i > 0) { - print ''.img_up('default', 0, 'imgupforline').''; + print ''.img_up('default', 0, 'imgupforline').''; } if ($i < count($object->actions) - 1) { - print ''.img_down('default', 0, 'imgdownforline').''; + print ''.img_down('default', 0, 'imgdownforline').''; } print ''; // Delete print ''; print ''.img_edit().''; - print ' '.img_delete().''; + print ' $object->id, 'action' => 'deleteoperation', 'operationid' => $ruleaction['id']], true).'">'.img_delete().''; print ''; print ''; $i++; diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 6f0813c62bf..1c3aec58f29 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -342,7 +342,7 @@ if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $sear llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist mod-user page-emailcollector_list'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($title, $linkback, 'title_setup'); diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index 5970b97d248..e1bab9af0ab 100644 --- a/htdocs/admin/eventorganization.php +++ b/htdocs/admin/eventorganization.php @@ -1,7 +1,7 @@ * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -161,7 +161,7 @@ print '
'; if ($action == 'edit') { - print ''; + print ''; print ''; print ''; diff --git a/htdocs/admin/eventorganization_confbooth_extrafields.php b/htdocs/admin/eventorganization_confbooth_extrafields.php index 267fb237203..8cef64b5db8 100644 --- a/htdocs/admin/eventorganization_confbooth_extrafields.php +++ b/htdocs/admin/eventorganization_confbooth_extrafields.php @@ -74,7 +74,7 @@ $page_name = "EventOrganizationSetup"; llxHeader('', $langs->trans($page_name), $help_url, '', 0, 0, '', '', '', 'mod-admin page-eventorganization_confbooth_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); diff --git a/htdocs/admin/eventorganization_confboothattendee_extrafields.php b/htdocs/admin/eventorganization_confboothattendee_extrafields.php index 8b5450fe74d..d33db8b1863 100644 --- a/htdocs/admin/eventorganization_confboothattendee_extrafields.php +++ b/htdocs/admin/eventorganization_confboothattendee_extrafields.php @@ -76,7 +76,7 @@ $page_name = 'EventOrganizationSetup'; llxHeader('', $langs->trans($page_name), $help_url, '', 0, 0, '', '', '', 'mod-admin page-eventorganization_conferenceorboothattendee_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); diff --git a/htdocs/admin/eventorganization_public.php b/htdocs/admin/eventorganization_public.php index cbd8ae0523d..a189e0e863e 100644 --- a/htdocs/admin/eventorganization_public.php +++ b/htdocs/admin/eventorganization_public.php @@ -1,7 +1,7 @@ * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -111,7 +111,7 @@ print dol_get_fiche_head($head, 'public', $langs->trans($page_name), -1, 'evento print '
'; if ($action == 'edit') { - print ''; + print ''; print ''; print ''; diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index f25571cb52c..baf97ee3897 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -102,7 +102,7 @@ $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); $wikihelp = 'EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad'; llxHeader('', $langs->trans("Audit"), $wikihelp, '', 0, 0, '', '', '', 'mod-admin page-events'); -//$linkback=''.$langs->trans("BackToModuleList").''; +//$linkback=''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("SecuritySetup"), '', 'title_setup'); print ''.$langs->trans("LogEventDesc", $langs->transnoentitiesnoconv("AdminTools"), $langs->transnoentitiesnoconv("Audit"))."
\n"; diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 05aae48375f..e01887416cc 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -178,7 +178,7 @@ $form = new Form($db); llxHeader("", $langs->trans("SendingsSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-expedition'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup'); print '
'; @@ -415,7 +415,7 @@ foreach ($dirmodels as $reldir) { // Preview print ''; if ($module->type == 'pdf') { - print 'scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"), 'pdf').''; + print ' 'specimen', 'module' => $name, 'scan_dir' => $module->scandir, 'label' => $module->name], true).'">'.img_object($langs->trans("Preview"), 'pdf').''; } else { print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic'); } diff --git a/htdocs/admin/expedition_extrafields.php b/htdocs/admin/expedition_extrafields.php index db5fa799ce1..63cb11e4335 100644 --- a/htdocs/admin/expedition_extrafields.php +++ b/htdocs/admin/expedition_extrafields.php @@ -78,7 +78,7 @@ $textobject = $langs->transnoentitiesnoconv("Sendings"); llxHeader('', $langs->trans("SendingsSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-expedition-extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup'); print "
\n"; diff --git a/htdocs/admin/expeditiondet_extrafields.php b/htdocs/admin/expeditiondet_extrafields.php index 2d577b5936e..b8d2d5f0093 100644 --- a/htdocs/admin/expeditiondet_extrafields.php +++ b/htdocs/admin/expeditiondet_extrafields.php @@ -79,7 +79,7 @@ $textobject = $langs->transnoentitiesnoconv("Sendings"); llxHeader('', $langs->trans("SendingsSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-expeditiondet_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup'); print "
\n"; diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index acb78e1ed94..cce9f65dd8b 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -201,7 +201,7 @@ llxHeader('', $langs->trans("ExpenseReportsSetup"), '', '', 0, 0, '', '', '', 'm $form = new Form($db); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ExpenseReportsSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/expensereport_extrafields.php b/htdocs/admin/expensereport_extrafields.php index 40d989d2d88..c3690d4a80c 100644 --- a/htdocs/admin/expensereport_extrafields.php +++ b/htdocs/admin/expensereport_extrafields.php @@ -74,7 +74,7 @@ $textobject = $langs->transnoentitiesnoconv("ExpenseReports"); llxHeader('', $langs->trans("ExpenseReportsSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-expensereport_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ExpenseReportsSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/expensereport_ik.php b/htdocs/admin/expensereport_ik.php index b8b914b88b0..0d07fe19d99 100644 --- a/htdocs/admin/expensereport_ik.php +++ b/htdocs/admin/expensereport_ik.php @@ -116,7 +116,7 @@ llxHeader('', $langs->trans("ExpenseReportsSetup"), '', '', 0, 0, '', '', '', 'm $form = new Form($db); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ExpenseReportsSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/expensereport_rules.php b/htdocs/admin/expensereport_rules.php index 17ede5126c1..1ec1adaa852 100644 --- a/htdocs/admin/expensereport_rules.php +++ b/htdocs/admin/expensereport_rules.php @@ -198,7 +198,7 @@ llxHeader('', $langs->trans("ExpenseReportsSetup"), '', '', 0, 0, '', '', '', 'm $form = new Form($db); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ExpenseReportsSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/export.php b/htdocs/admin/export.php index 2560e797e06..3578acac780 100644 --- a/htdocs/admin/export.php +++ b/htdocs/admin/export.php @@ -70,7 +70,7 @@ $page_name = "ExportSetup"; llxHeader('', $langs->trans($page_name), '', '', 0, 0, '', '', '', 'mod-admin page-export'); // Subheader -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans($page_name), $linkback); diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index c573bb0f20d..271198e9268 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -198,7 +198,7 @@ $form = new Form($db); llxHeader('', $langs->trans("ExternalRSSSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-external_rss'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ExternalRSSSetup"), $linkback, 'title_setup'); print '
'; diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index a11752ca594..5b7699de28c 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -152,7 +152,7 @@ if (GETPOST('save', 'alpha')) { llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-fckeditor'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("AdvancedEditor"), $linkback, 'title_setup'); print '
'; diff --git a/htdocs/admin/fediverse.php b/htdocs/admin/fediverse.php index c10fccc3404..67fa5f95306 100644 --- a/htdocs/admin/fediverse.php +++ b/htdocs/admin/fediverse.php @@ -269,7 +269,7 @@ llxHeader('', $langs->trans("FediverseSetup"), '', '', 0, 0, '', '', '', 'mod-ad $head = socialnetwork_prepare_head(); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print dol_get_fiche_head($head, 'divers', $langs->trans('MenuDict'), -1, 'user', 0, $linkback, '', 0, '', 0); diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 7550e9ffdaa..fd4c311626d 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -269,7 +269,7 @@ llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-fichinter'); $form = new Form($db); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("InterventionsSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/fichinter_xcal.php b/htdocs/admin/fichinter_xcal.php index 358cf0ee37c..f01cc23a759 100644 --- a/htdocs/admin/fichinter_xcal.php +++ b/htdocs/admin/fichinter_xcal.php @@ -103,7 +103,7 @@ if (!getDolGlobalString("MAIN_FICHINTER_EXPORT_PAST_DELAY")) { $wikihelp = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung'; llxHeader('', $langs->trans("AgendaSetup"), $wikihelp, '', 0, 0, '', '', '', 'mod-admin page-agenda_xcal'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/geoipmaxmind.php b/htdocs/admin/geoipmaxmind.php index 885a9efb988..2b9e1c8151d 100644 --- a/htdocs/admin/geoipmaxmind.php +++ b/htdocs/admin/geoipmaxmind.php @@ -93,7 +93,7 @@ $form = new Form($db); llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-geoipmaxmind'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("GeoIPMaxmindSetup"), $linkback, 'title_setup'); print '
'; diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index 9206053a24c..32a3815b9c5 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -177,7 +177,7 @@ llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-holiday'); $form = new Form($db); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("HolidaySetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/holiday_extrafields.php b/htdocs/admin/holiday_extrafields.php index 39136700989..eb052884c32 100644 --- a/htdocs/admin/holiday_extrafields.php +++ b/htdocs/admin/holiday_extrafields.php @@ -75,7 +75,7 @@ $textobject = $langs->transnoentitiesnoconv("Holidays"); llxHeader('', $langs->trans("HolidaySetup"), '', '', 0, 0, '', '', '', 'mod-admin page-holiday_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("HolidaySetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/hrm.php b/htdocs/admin/hrm.php index 1ee36e6528e..a2b18ea1dbf 100644 --- a/htdocs/admin/hrm.php +++ b/htdocs/admin/hrm.php @@ -5,7 +5,7 @@ * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -249,7 +249,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { print ''.$langs->trans("Example").''; print ''.$langs->trans("Status").''; print ''.$langs->trans("ShortInfo").''; - print ''."\n"; + print "\n"; clearstatcache(); @@ -266,8 +266,8 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { require_once $dir.'/'.$file.'.php'; $module = new $file($db); - '@phan-var-force ModeleNumRefEvaluation $module'; + /** @var ModeleNumRefEvaluation $module */ // Show modules according to features level if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) { @@ -311,6 +311,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { $nameofclass = ucfirst($myTmpObjectKey); $mytmpinstance = new $nameofclass($db); '@phan-var-force Evaluation $mytmpinstance'; + /** @var Evaluation $mytmpinstance */ $mytmpinstance->initAsSpecimen(); // Info @@ -436,13 +437,13 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { // Active if (in_array($name, $def)) { print ''."\n"; - print ''; + print ' 'del', 'value' => $name], true).'">'; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ' 'set', 'value' => $name, 'scan_dir' => $module->scandir, 'label' => $module->name], true).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -505,7 +506,7 @@ if (!getDolGlobalString('HRM_MAXRANK')) { } if ($action != 'editxxx') { - print ''; + print ''; print ''; print ''; diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index e2b52b32325..f85ad596a0f 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -8,7 +8,7 @@ * Copyright (C) 2021-2023 Anthony Berton * Copyright (C) 2023 Eric Seigne * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -379,7 +379,7 @@ print "
\n"; //WYSIWYG Editor require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; -print ''; +print ''; print ''; print ''; print ''; diff --git a/htdocs/admin/import.php b/htdocs/admin/import.php index 084c42790b0..1ac1bdbd71c 100644 --- a/htdocs/admin/import.php +++ b/htdocs/admin/import.php @@ -71,7 +71,7 @@ $page_name = "ImportSetup"; llxHeader('', $langs->trans($page_name), '', '', 0, 0, '', '', '', 'mod-admin page-import'); // Subheader -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans($page_name), $linkback); diff --git a/htdocs/admin/invoice.php b/htdocs/admin/invoice.php index 49513c935ed..6f3ae469e04 100644 --- a/htdocs/admin/invoice.php +++ b/htdocs/admin/invoice.php @@ -296,7 +296,7 @@ llxHeader("", $title, 'EN:Invoice_Configuration|FR:Configuration_module_facture| $form = new Form($db); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($title, $linkback, 'title_setup'); diff --git a/htdocs/admin/invoice_situation.php b/htdocs/admin/invoice_situation.php index 60bdd0eb7ae..cdeeb3ac5fd 100644 --- a/htdocs/admin/invoice_situation.php +++ b/htdocs/admin/invoice_situation.php @@ -140,7 +140,7 @@ $help_url = 'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:Configu llxHeader("", $langs->trans("BillsSetup"), $help_url, '', 0, 0, '', '', '', 'mod-admin page-invoice_situation'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("BillsSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/knowledgemanagement.php b/htdocs/admin/knowledgemanagement.php index c5aafc030b0..ae459e9b8c0 100644 --- a/htdocs/admin/knowledgemanagement.php +++ b/htdocs/admin/knowledgemanagement.php @@ -1,7 +1,7 @@ * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -199,7 +199,7 @@ $page_name = "KnowledgeManagementSetup"; llxHeader('', $langs->trans($page_name), '', '', 0, 0, '', '', '', 'mod-admin page-knowledgemanagement'); // Subheader -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); @@ -212,7 +212,7 @@ echo ''.$langs->trans("KnowledgeManagementSetupPage" if ($action == 'edit') { - print ''; + print ''; print ''; print ''; diff --git a/htdocs/admin/knowledgerecord_extrafields.php b/htdocs/admin/knowledgerecord_extrafields.php index 61595f95f95..d5fbaed92de 100644 --- a/htdocs/admin/knowledgerecord_extrafields.php +++ b/htdocs/admin/knowledgerecord_extrafields.php @@ -79,7 +79,7 @@ $page_name = 'KnowledgeManagementSetup'; llxHeader('', $langs->trans($page_name), $help_url, '', 0, 0, '', '', '', 'mod-admin page-knowledgerecord_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index 40d4dfc2aac..2ce6519839c 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -133,7 +133,7 @@ if (empty($reshook)) { llxHeader('', $langs->trans("LDAPSetup"), 'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP', '', 0, 0, '', '', '', 'mod-admin page-ldap'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("LDAPSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index b6d4b8d9bc8..ac177b0a3d1 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -136,7 +136,7 @@ $form = new Form($db); llxHeader('', $langs->trans("LDAPSetup"), 'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP', '', 0, 0, '', '', '', 'mod-admin page-ldap_contacts'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("LDAPSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 9e124b9e91e..5274979e07e 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -114,7 +114,7 @@ $form = new Form($db); llxHeader('', $langs->trans("LDAPSetup"), 'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP', '', 0, 0, '', '', '', 'mod-admin page-ldap_groups'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("LDAPSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index a43aa9cca30..1815af0447b 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -181,7 +181,7 @@ $form = new Form($db); llxHeader('', $langs->trans("LDAPSetup"), 'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP', '', 0, 0, '', '', '', 'mod-admin page-ldap_members'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("LDAPSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/ldap_members_types.php b/htdocs/admin/ldap_members_types.php index 3addaa9eb4c..74315d46737 100644 --- a/htdocs/admin/ldap_members_types.php +++ b/htdocs/admin/ldap_members_types.php @@ -105,7 +105,7 @@ if ($action == 'setvalue' /* && $user->admin */) { llxHeader('', $langs->trans("LDAPSetup"), 'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP', '', 0, 0, '', '', '', 'mod-admin page-ldap_members_types'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("LDAPSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index 5b50a98571d..015d3b141a8 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -170,7 +170,7 @@ $form = new Form($db); llxHeader('', $langs->trans("LDAPSetup"), 'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP', '', 0, 0, '', '', '', 'mod-admin page-ldap_users'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("LDAPSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/loan.php b/htdocs/admin/loan.php index f871642b940..61081ea83e1 100644 --- a/htdocs/admin/loan.php +++ b/htdocs/admin/loan.php @@ -93,7 +93,7 @@ if (isModEnabled('accounting')) { $formaccounting = null; } -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans('ConfigLoan'), $linkback, 'title_setup'); diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index 770c2a458b2..278bda99fb3 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -135,7 +135,7 @@ if ($action == 'setonsearchandlistgooncustomerorsuppliercard') { llxHeader('', $langs->trans("MailingSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-mailing'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("MailingSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/mailman.php b/htdocs/admin/mailman.php index d7570db8834..84299155bf5 100644 --- a/htdocs/admin/mailman.php +++ b/htdocs/admin/mailman.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2011-2013 Juanjo Menent - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -149,7 +149,7 @@ $help_url = ''; llxHeader('', $langs->trans("MailmanSpipSetup"), $help_url, '', 0, 0, '', '', '', 'mod-admin page-mailman'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("MailmanSpipSetup"), $linkback, 'title_setup'); @@ -224,7 +224,7 @@ if (getDolGlobalString('ADHERENT_USE_MAILMAN')) { if (getDolGlobalString('ADHERENT_USE_MAILMAN')) { - print ''; + print ''; print ''; print ''; @@ -233,7 +233,7 @@ if (getDolGlobalString('ADHERENT_USE_MAILMAN')) { print ''; - print '
'; + print ''; print ''; print ''; diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 307049f7e5a..d343d27c874 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -367,7 +367,7 @@ if ($action == 'edit') { print ''."\n"; } - print ''; + print ''; print ''; print ''; diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index a1dd3fa09f0..9c7e23b8457 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -343,7 +343,7 @@ if ($action == 'edit') { print ''."\n"; } - print ''; + print ''; print ''; print ''; diff --git a/htdocs/admin/mails_passwordreset.php b/htdocs/admin/mails_passwordreset.php index e82e69e47c5..81f7e481aab 100644 --- a/htdocs/admin/mails_passwordreset.php +++ b/htdocs/admin/mails_passwordreset.php @@ -3,7 +3,7 @@ * Copyright (C) 2009-2012 Regis Houssin * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2016 Jonathan TISSEAU - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -342,7 +342,7 @@ if ($action == 'edit') { print ''."\n"; } - print ''; + print ''; print ''; print ''; diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index feb9a573cff..10224371078 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -1,7 +1,7 @@ * Copyright (C) 2018 Ferran Marcet - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -463,7 +463,7 @@ if ($action != 'create') { print $form->buttonsSaveCancel(); } } else { - /*print ''; + /*print ''; if ($optioncss != '') print ''; print ''; print ''; diff --git a/htdocs/admin/mails_ticket.php b/htdocs/admin/mails_ticket.php index e263337da69..6320898456c 100644 --- a/htdocs/admin/mails_ticket.php +++ b/htdocs/admin/mails_ticket.php @@ -3,7 +3,7 @@ * Copyright (C) 2009-2012 Regis Houssin * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2016 Jonathan TISSEAU - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -340,7 +340,7 @@ if ($action == 'edit') { print ''."\n"; } - print ''; + print ''; print ''; print ''; diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php index 351bc9f962d..9869a960973 100644 --- a/htdocs/admin/menus.php +++ b/htdocs/admin/menus.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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,7 +121,7 @@ if ($action == 'update' && !$cancel) { $db->close(); // We make a header redirect because we need to change menu NOW. - header("Location: ".$_SERVER["PHP_SELF"]); + header("Location: ".dolBuildUrl($_SERVER["PHP_SELF"])); exit; } } @@ -143,17 +143,17 @@ print load_fiche_titre($langs->trans("Menus"), '', 'title_setup'); $h = 0; $head = array(); -$head[$h][0] = DOL_URL_ROOT."/admin/menus.php"; +$head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/menus.php"); $head[$h][1] = $langs->trans("MenuHandlers"); $head[$h][2] = 'handler'; $h++; -$head[$h][0] = DOL_URL_ROOT."/admin/menus/index.php"; +$head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/menus/index.php"); $head[$h][1] = $langs->trans("MenuAdmin"); $head[$h][2] = 'editor'; $h++; -print ''; +print ''; print ''; print ''; diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index 82adeb82823..6b2dc66b1aa 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -2,7 +2,7 @@ /* Copyright (C) 2007 Patrick Raguin * Copyright (C) 2007-2012 Laurent Destailleur * Copyright (C) 2009-2012 Regis Houssin - * Copyright (C) 2019-2024 Frédéric France + * Copyright (C) 2019-2025 Frédéric France * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -253,7 +253,7 @@ if ($user->admin) { $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/admin/menus/edit.php?menuId=0&action=create&menu_handler='.urlencode($menu_handler).'&backtopage='.urlencode($_SERVER['PHP_SELF'])); } -print ''; +print ''; print ''; print $langs->trans("MenuHandler").': '; $formadmin->select_menu_families($menu_handler.(preg_match('/_menu/', $menu_handler) ? '' : '_menu'), 'menu_handler', array_merge($dirstandard, $dirsmartphone)); diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 04319f8c226..a38a8fb3466 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -738,7 +738,7 @@ $head = modules_prepare_head($nbofactivatedmodules, count($modules), $nbmodulesn if ($mode == 'common' || $mode == 'commonkanban') { dol_set_focus('#search_keyword'); - print ''; + print ''; print ''; if (isset($optioncss) && $optioncss != '') { print ''; @@ -1063,22 +1063,26 @@ if ($mode == 'common' || $mode == 'commonkanban') { // Set $codetoconfig if (!empty($objMod->config_page_url) && !$disableSetup) { - $backtourlparam = ''; + $backtourlquery = []; if ($search_keyword != '') { - $backtourlparam .= ($backtourlparam ? '&' : '?').'search_keyword='.urlencode($search_keyword); // No urlencode here, done later + $backtourlquery += ['search_keyword' => $search_keyword]; // No urlencode here, done later } if ($search_nature > -1) { - $backtourlparam .= ($backtourlparam ? '&' : '?').'search_nature='.urlencode($search_nature); // No urlencode here, done later + $backtourlquery += ['search_nature' => $search_nature]; // No urlencode here, done later } if ($search_version > -1) { - $backtourlparam .= ($backtourlparam ? '&' : '?').'search_version='.urlencode($search_version); // No urlencode here, done later + $backtourlquery += ['search_version' => $search_version]; // No urlencode here, done later } if ($search_status > -1) { - $backtourlparam .= ($backtourlparam ? '&' : '?').'search_status='.urlencode($search_status); // No urlencode here, done later + $backtourlquery += ['search_status' => $search_status]; // No urlencode here, done later } - $backtourl = $_SERVER["PHP_SELF"].$backtourlparam; + $backtourl = dolBuildUrl($_SERVER["PHP_SELF"], $backtourlquery); $regs = array(); + $query = [ + 'save_lastsearch_values' => 1, + 'backtopage' => $backtourl, + ]; if (is_array($objMod->config_page_url)) { $i = 0; foreach ($objMod->config_page_url as $page) { diff --git a/htdocs/admin/mrp.php b/htdocs/admin/mrp.php index d704b40b677..bea575e709d 100644 --- a/htdocs/admin/mrp.php +++ b/htdocs/admin/mrp.php @@ -185,7 +185,7 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); llxHeader("", $langs->trans("MrpSetupPage"), '', '', 0, 0, '', '', '', 'mod-admin page-mrp'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("MrpSetupPage"), $linkback, 'title_setup'); diff --git a/htdocs/admin/mrp_extrafields.php b/htdocs/admin/mrp_extrafields.php index 741dee8e0dc..066fb9fe0bc 100644 --- a/htdocs/admin/mrp_extrafields.php +++ b/htdocs/admin/mrp_extrafields.php @@ -78,7 +78,7 @@ $textobject = $langs->transnoentitiesnoconv('ManufacturingOrder'); llxHeader('', $langs->trans("MrpSetupPage"), $help_url, '', 0, 0, '', '', '', 'mod-admin page-mrp_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("MrpSetupPage"), $linkback, 'title_setup'); diff --git a/htdocs/admin/mrp_production_extrafields.php b/htdocs/admin/mrp_production_extrafields.php index 9ef067e012d..9febcda909e 100644 --- a/htdocs/admin/mrp_production_extrafields.php +++ b/htdocs/admin/mrp_production_extrafields.php @@ -76,7 +76,7 @@ $help_url = ''; llxHeader('', $langs->trans("MrpSetupPage"), $help_url, '', 0, 0, '', '', '', 'mod-admin page-mrp_production_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("MrpSetupPage"), $linkback, 'title_setup'); diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php index 110707e4912..97ac1454da3 100644 --- a/htdocs/admin/multicurrency.php +++ b/htdocs/admin/multicurrency.php @@ -193,7 +193,7 @@ $help_url = ''; llxHeader('', $langs->trans($page_name), $help_url, '', 0, 0, '', '', '', 'mod-admin page-multicurrency'); // Subheader -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans($page_name), $linkback); diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index f02c475c627..502e22425f7 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -181,7 +181,7 @@ $notify = new Notify($db); llxHeader('', $langs->trans("NotificationSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-notification'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("NotificationSetup"), $linkback, 'title_setup'); @@ -195,7 +195,7 @@ print $langs->trans("NotificationsDescGlobal").' - '.$langs->trans("YouAreHere") print ''; print '
'; -print ''; +print ''; print ''; print ''; @@ -271,7 +271,7 @@ print '

'; // Emails templates for notification -print ''; +print ''; print ''; print ''; @@ -399,7 +399,7 @@ print ''; print '

'; -print '
'; +print ''; print ''; print ''; print ''; diff --git a/htdocs/admin/oauth.php b/htdocs/admin/oauth.php index f803fefb330..0903e2123a5 100644 --- a/htdocs/admin/oauth.php +++ b/htdocs/admin/oauth.php @@ -245,7 +245,7 @@ if ($action == 'delete') { } -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($title, $linkback, 'title_setup'); diff --git a/htdocs/admin/oauthlogintokens.php b/htdocs/admin/oauthlogintokens.php index 58c11c9b214..75b260beebe 100644 --- a/htdocs/admin/oauthlogintokens.php +++ b/htdocs/admin/oauthlogintokens.php @@ -235,7 +235,7 @@ $help_url = 'EN:Module_OAuth|FR:Module_OAuth_FR|ES:Módulo_OAuth_ES'; llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-admin page-oauthlogintokens'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans('ConfigOAuth'), $linkback, 'title_setup'); diff --git a/htdocs/admin/openid_connect.php b/htdocs/admin/openid_connect.php index 97e0c64b86e..a54ba4ab521 100644 --- a/htdocs/admin/openid_connect.php +++ b/htdocs/admin/openid_connect.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -146,7 +146,7 @@ print ''; print dol_get_fiche_end(); -print ''; +print ''; print ''; print ''; diff --git a/htdocs/admin/order.php b/htdocs/admin/order.php index 548e1bd9d33..8418b43e724 100644 --- a/htdocs/admin/order.php +++ b/htdocs/admin/order.php @@ -269,7 +269,7 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); llxHeader("", $langs->trans("OrdersSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-order'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("OrdersSetup"), $linkback, 'title_setup'); @@ -682,7 +682,7 @@ print ''; //Use draft Watermark -print '
'; +print ''; print ''; print ''; print ''; diff --git a/htdocs/admin/order_extrafields.php b/htdocs/admin/order_extrafields.php index 872aa8d9406..feaba5590ef 100644 --- a/htdocs/admin/order_extrafields.php +++ b/htdocs/admin/order_extrafields.php @@ -76,7 +76,7 @@ $textobject = $langs->transnoentitiesnoconv("Orders"); llxHeader('', $langs->trans("OrdersSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-order_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("OrdersSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/orderdet_extrafields.php b/htdocs/admin/orderdet_extrafields.php index 1569c661d81..636f2fd264d 100644 --- a/htdocs/admin/orderdet_extrafields.php +++ b/htdocs/admin/orderdet_extrafields.php @@ -76,7 +76,7 @@ $textobject = $langs->transnoentitiesnoconv("Orders"); llxHeader('', $langs->trans("OrdersSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-orderdet_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("OrdersSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index a02c4f22f49..e02e2c89d58 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -119,7 +119,7 @@ llxHeader('', $langs->trans("BillsSetup"), 'EN:Invoice_Configuration|FR:Configur $form = new Form($db); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("BillsSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php index e9db0c327a5..130e86902b5 100644 --- a/htdocs/admin/paymentbybanktransfer.php +++ b/htdocs/admin/paymentbybanktransfer.php @@ -153,7 +153,7 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); llxHeader('', $langs->trans("CreditTransferSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-paymentbybanktransfer'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("CreditTransferSetup"), $linkback, 'title_setup'); print '
'; diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index ed2de3906b8..a83290d7004 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -8,7 +8,7 @@ * Copyright (C) 2024 MDW * Copyright (C) 2024 Nick Fragoulis * Copyright (C) 2024 Alexandre Spangaro - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -284,7 +284,7 @@ print "
\n"; $noCountryCode = empty($mysoc->country_code); -print ''; +print ''; print ''; print ''; diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index e131e43c259..69de68ff05d 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -6,7 +6,7 @@ * Copyright (C) 2019 Ferran Marcet * Copyright (C) 2021-2024 Anthony Berton * Copyright (C) 2022 Alexandre Spangaro - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024-205 Nick Fragoulis * * This program is free software; you can redistribute it and/or modify @@ -242,7 +242,7 @@ if (isset($conf->global->DOL_URL_ROOT_DOCUMENT_PHP)) { } -print ''; +print ''; print ''; print ''; diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 67724e2f829..a5f88ef58dd 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -153,7 +153,7 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); llxHeader('', $langs->trans("WithdrawalsSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-prelevement'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("WithdrawalsSetup"), $linkback, 'title_setup'); print '
'; diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index d2c2c11c62e..95bcc926150 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -251,7 +251,7 @@ llxHeader('', $langs->trans("PropalSetup"), '', '', 0, 0, '', '', '', 'mod-admin //if ($mesg) print $mesg; -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("PropalSetup"), $linkback, 'title_setup'); @@ -621,7 +621,7 @@ print '
'; print load_fiche_titre($langs->trans("OtherOptions"), '', ''); -print ''; +print ''; print ''; print ''; print ''; diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php index d589d647fb2..b31e1b8e180 100644 --- a/htdocs/admin/receiptprinter.php +++ b/htdocs/admin/receiptprinter.php @@ -311,7 +311,7 @@ $form = new Form($db); llxHeader('', $langs->trans("ReceiptPrinterSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-receiptprinter'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ReceiptPrinterSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/reception_extrafields.php b/htdocs/admin/reception_extrafields.php index c20e63e6158..26103d779a9 100644 --- a/htdocs/admin/reception_extrafields.php +++ b/htdocs/admin/reception_extrafields.php @@ -77,7 +77,7 @@ $textobject = $langs->transnoentitiesnoconv("Receptions"); llxHeader('', $langs->trans("ReceptionsSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-reception_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ReceptionsSetup"), $linkback, 'title_setup'); print "
\n"; diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php index 81358b715c4..400009c95b3 100644 --- a/htdocs/admin/reception_setup.php +++ b/htdocs/admin/reception_setup.php @@ -184,7 +184,7 @@ $form = new Form($db); llxHeader('', $langs->trans("ReceptionsSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-reception_setup'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ReceptionsSetup"), $linkback, 'title_setup'); print '
'; diff --git a/htdocs/admin/receptiondet_batch_extrafields.php b/htdocs/admin/receptiondet_batch_extrafields.php index 8a02034e1f8..93864b69edd 100644 --- a/htdocs/admin/receptiondet_batch_extrafields.php +++ b/htdocs/admin/receptiondet_batch_extrafields.php @@ -81,7 +81,7 @@ $textobject = $langs->transnoentitiesnoconv("Receptions"); llxHeader('', $langs->trans("ReceptionsSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-receptiondet_batch_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ReceptionsSetup"), $linkback, 'title_setup'); print "
\n"; diff --git a/htdocs/admin/resource.php b/htdocs/admin/resource.php index 38528911358..968ad870b79 100644 --- a/htdocs/admin/resource.php +++ b/htdocs/admin/resource.php @@ -73,7 +73,7 @@ llxHeader('', $langs->trans('ResourceSetup'), '', '', 0, 0, '', '', '', 'mod-adm $form = new Form($db); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans('ResourceSetup'), $linkback, 'title_setup'); diff --git a/htdocs/admin/resource_extrafields.php b/htdocs/admin/resource_extrafields.php index 0258ad839cd..6d3b3806d82 100644 --- a/htdocs/admin/resource_extrafields.php +++ b/htdocs/admin/resource_extrafields.php @@ -75,7 +75,7 @@ $textobject = $langs->transnoentitiesnoconv("ResourceSingular"); llxHeader('', $langs->trans("ResourceSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-resource_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ResourceSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 35abc2e742d..59104ded74b 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -401,7 +401,7 @@ if (getDolGlobalString('USER_PASSWORD_GENERATED') == "Perso") { // Crypt passwords in database print '
'; -print ''; +print ''; print ''; print ''; diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index 10557ed64b8..92aa921b482 100644 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -174,7 +174,7 @@ if (!count($listofmethods)) { } if ($action == 'edit') { - print ''; + print ''; print ''; print ''; diff --git a/htdocs/admin/spip.php b/htdocs/admin/spip.php index 33031fa358e..e9d44beb8a6 100644 --- a/htdocs/admin/spip.php +++ b/htdocs/admin/spip.php @@ -114,7 +114,7 @@ $help_url = ''; llxHeader('', $langs->trans("MailmanSpipSetup"), $help_url, '', 0, 0, '', '', '', 'mod-admin page-spip'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("MailmanSpipSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 86a9400949f..05e6b651e53 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -216,7 +216,7 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); llxHeader('', $langs->trans("StockSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-stock'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("StockSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/stocktransfer.php b/htdocs/admin/stocktransfer.php index 6a9c2588fd9..dfdd53a07dd 100644 --- a/htdocs/admin/stocktransfer.php +++ b/htdocs/admin/stocktransfer.php @@ -3,7 +3,7 @@ * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2021 SuperAdmin * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -173,7 +173,7 @@ $page_name = "StockTransferSetup"; llxHeader('', $langs->trans($page_name), '', '', 0, 0, '', '', '', 'mod-admin page-stocktransfer'); // Subheader -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans($page_name), $linkback, 'stock'); @@ -184,7 +184,7 @@ print dol_get_fiche_head($head, 'settings', '', -1, "stocktransfer@stocktransfer /*if ($action == 'edit') { - print ''; + print ''; print ''; print ''; diff --git a/htdocs/admin/subtotals.php b/htdocs/admin/subtotals.php index 5c464e4d02a..3d598573f9e 100644 --- a/htdocs/admin/subtotals.php +++ b/htdocs/admin/subtotals.php @@ -122,7 +122,7 @@ if ($action == 'update_colors') { llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-subtotals'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("SubtotalSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index bf89c1ef132..c3a187e5abf 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -206,7 +206,7 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-supplier_invoice'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("SuppliersSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index d11730d9564..7cc64d32a77 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -223,7 +223,7 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-supplier_order'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("SuppliersSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index a7596440e7d..3d594c3073d 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -169,7 +169,7 @@ llxHeader('', $langs->trans("SupplierPaymentSetup"), 'EN:Supplier_Payment_Config $form = new Form($db); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("SuppliersSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index cbc814bb763..ecf42187f22 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -240,7 +240,7 @@ llxHeader('', $langs->trans("SupplierProposalSetup"), '', '', 0, 0, '', '', '', $form = new Form($db); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("SupplierProposalSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/supplierinvoice_extrafields.php b/htdocs/admin/supplierinvoice_extrafields.php index 4bcf68e18b1..8d9805bf171 100644 --- a/htdocs/admin/supplierinvoice_extrafields.php +++ b/htdocs/admin/supplierinvoice_extrafields.php @@ -75,7 +75,7 @@ $textobject = $langs->transnoentitiesnoconv("BillsSuppliers"); llxHeader('', $langs->trans("SuppliersSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-supplierinvoice_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("SuppliersSetup"), $linkback, 'title_setup'); print "
\n"; diff --git a/htdocs/admin/supplierinvoice_rec_extrafields.php b/htdocs/admin/supplierinvoice_rec_extrafields.php index 4ce20d8b9b2..a6d40829bbb 100644 --- a/htdocs/admin/supplierinvoice_rec_extrafields.php +++ b/htdocs/admin/supplierinvoice_rec_extrafields.php @@ -76,7 +76,7 @@ $textobject = $langs->transnoentitiesnoconv("BillsSuppliers"); llxHeader('', $langs->trans("SuppliersSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-supplierinvoice_rec_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("SuppliersSetup"), $linkback, 'title_setup'); print "
\n"; diff --git a/htdocs/admin/supplierinvoicedet_extrafields.php b/htdocs/admin/supplierinvoicedet_extrafields.php index 6f948baab91..8bbc44518e8 100644 --- a/htdocs/admin/supplierinvoicedet_extrafields.php +++ b/htdocs/admin/supplierinvoicedet_extrafields.php @@ -78,7 +78,7 @@ $textobject = $langs->transnoentitiesnoconv("BillsSuppliers"); llxHeader('', $langs->trans("SuppliersSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-supplierinvoicedet_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("SuppliersSetup"), $linkback, 'title_setup'); print "
\n"; diff --git a/htdocs/admin/supplierinvoicedet_rec_extrafields.php b/htdocs/admin/supplierinvoicedet_rec_extrafields.php index e0d551f52b1..697b13a43d5 100644 --- a/htdocs/admin/supplierinvoicedet_rec_extrafields.php +++ b/htdocs/admin/supplierinvoicedet_rec_extrafields.php @@ -79,7 +79,7 @@ $textobject = $langs->transnoentitiesnoconv("BillsSuppliers"); llxHeader('', $langs->trans("SuppliersSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-supplierinvoicedet_rec_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("SuppliersSetup"), $linkback, 'title_setup'); print "
\n"; diff --git a/htdocs/admin/supplierorder_extrafields.php b/htdocs/admin/supplierorder_extrafields.php index ba0072feb9c..d26d5e97a9f 100644 --- a/htdocs/admin/supplierorder_extrafields.php +++ b/htdocs/admin/supplierorder_extrafields.php @@ -76,7 +76,7 @@ $textobject = $langs->transnoentitiesnoconv("SuppliersOrders"); llxHeader('', $langs->trans("SuppliersSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-supplierorder_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("SuppliersSetup"), $linkback, 'title_setup'); print "
\n"; diff --git a/htdocs/admin/supplierorderdet_extrafields.php b/htdocs/admin/supplierorderdet_extrafields.php index 22901c10505..e9a03e6c53f 100644 --- a/htdocs/admin/supplierorderdet_extrafields.php +++ b/htdocs/admin/supplierorderdet_extrafields.php @@ -76,7 +76,7 @@ $textobject = $langs->transnoentitiesnoconv("SuppliersOrders"); llxHeader('', $langs->trans("SuppliersSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-supplierorderdet_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("SuppliersSetup"), $linkback, 'title_setup'); print "
\n"; diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index 736a1605ea0..7e8d7da76d4 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -184,7 +184,7 @@ llxHeader('', $langs->trans("SyslogSetup"), '', '', 0, 0, '', '', '', 'mod-admin $form = new Form($db); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("SyslogSetup"), $linkback, 'title_setup'); print '
'; diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index 1c6949f2510..155cc012b4c 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -2,7 +2,7 @@ /* Copyright (C) 2005-2020 Laurent Destailleur * Copyright (C) 2007 Rodolphe Quiedeville * Copyright (C) 2007-2012 Regis Houssin - * Copyright (C) 2015-2024 Frédéric France + * Copyright (C) 2015-2025 Frédéric France * Copyright (C) 2017 Nicolas ZABOURI * Copyright (C) 2024-2025 MDW * @@ -128,7 +128,7 @@ if (preg_match('/beta|alpha|rc/i', DOL_VERSION) || getDolGlobalString('MAIN_ALLO } $enableremotecheck = true; -print ''; +print ''; print ''; print $langs->trans("MakeIntegrityAnalysisFrom").':
'; diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 5f29b96afb4..f43abe596a7 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -1,7 +1,7 @@ * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -805,7 +805,7 @@ $exampletodecrypt = GETPOST('exampletodecrypt', 'password'); print ''.$langs->trans("AlgorithmFor", $langs->transnoentitiesnoconv("SensitiveData")); print $form->textwithpicto('', 'reversible encryption done with dolEncrypt/dolDecrypt'); print ' = '.constant('MAIN_SECURITY_REVERSIBLE_ALGO').' with key defined into conf.php file in $dolibarr_main_dolcrypt_key (or $dolibarr_main_instance_unique_id)
'; -print ''; +print ''; print ''; print ''; print ''; diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index 7bf6712fd9d..ac60811ac98 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -166,7 +166,7 @@ if (isModEnabled('accounting')) { $formaccounting = new FormAccounting($db); } -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans('TaxSetup'), $linkback, 'title_setup'); diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index 2f19c6dc80f..82ca2853d83 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -275,7 +275,7 @@ $page_name = 'TicketSetup'; llxHeader('', $langs->trans($page_name), $help_url, '', 0, 0, '', '', '', 'mod-admin page-ticket'); // Subheader -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); diff --git a/htdocs/admin/ticket_extrafields.php b/htdocs/admin/ticket_extrafields.php index 47da53203d0..5cfba7fd924 100644 --- a/htdocs/admin/ticket_extrafields.php +++ b/htdocs/admin/ticket_extrafields.php @@ -72,7 +72,7 @@ $help_url = "FR:Module_Ticket"; $page_name = "TicketSetup"; llxHeader('', $langs->trans($page_name), $help_url, '', 0, 0, '', '', '', 'mod-admin page-ticket_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("TicketSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php index f1da6b05509..f3b6ec38fe1 100644 --- a/htdocs/admin/ticket_public.php +++ b/htdocs/admin/ticket_public.php @@ -230,7 +230,7 @@ $page_name = "TicketSetup"; llxHeader('', $langs->trans($page_name), $help_url, '', 0, 0, '', '', '', 'mod-admin page-ticket_public'); // Subheader -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index 13569e10eaa..a4d470bfe3f 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004-2023 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Bahfir Abbes - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -342,7 +342,7 @@ if ($result) { $center = ''.$langs->trans("Purge").''; } - print ''; + print ''; print ''; // @phan-suppress-next-line PhanPluginSuspiciousParamOrder diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index 525198416fe..cf53a892b1f 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -140,7 +140,7 @@ dol_mkdir(DOL_DATA_ROOT.'/doctemplates/usergroups'); $help_url = 'EN:Module_Users|FR:Module_Utilisateurs|ES:Módulo_Usuarios'; llxHeader('', $langs->trans("UsersSetup"), $help_url, '', 0, 0, '', '', '', 'mod-admin page-user'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("UsersSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/usergroup.php b/htdocs/admin/usergroup.php index 15621f60325..ab7ed5a7386 100644 --- a/htdocs/admin/usergroup.php +++ b/htdocs/admin/usergroup.php @@ -112,7 +112,7 @@ if ($action == 'set_default') { $help_url = 'EN:Module_Users|FR:Module_Utilisateurs|ES:Módulo_Usuarios'; llxHeader('', $langs->trans("UsersSetup"), $help_url, '', 0, 0, '', '', '', 'mod-admin page-usergroup'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("UsersSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index 814884e2f97..0c568e70c99 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -257,7 +257,7 @@ if ($action == 'setvarworkflow') { // Test on permission already done llxHeader('', $langs->trans("WorkflowSetup"), "EN:Module_Workflow_En|FR:Module_Workflow|ES:Módulo_Workflow", '', 0, 0, '', '', '', 'mod-admin page-workflow'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("WorkflowSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/workstation_extrafields.php b/htdocs/admin/workstation_extrafields.php index c05423c18c0..193bd173afc 100644 --- a/htdocs/admin/workstation_extrafields.php +++ b/htdocs/admin/workstation_extrafields.php @@ -79,7 +79,7 @@ $page_name = "WorkstationSetup"; llxHeader('', $langs->trans("WorkstationSetup"), $help_url, '', 0, 0, '', '', '', 'mod-workstation page-admin_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); diff --git a/htdocs/api/admin/index.php b/htdocs/api/admin/index.php index 3dff437b8be..017874a088d 100644 --- a/htdocs/api/admin/index.php +++ b/htdocs/api/admin/index.php @@ -5,7 +5,7 @@ * Copyright (C) 2012-2018 Regis Houssin * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -113,14 +113,14 @@ dol_mkdir(DOL_DATA_ROOT.'/api/temp'); // May have been deleted by a purge llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-api page-admin-index'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ApiSetup"), $linkback, 'title_setup'); print ''.$langs->trans("ApiDesc")."
\n"; print "
\n"; -print ''; +print ''; print ''; print ''; diff --git a/htdocs/asset/admin/asset_extrafields.php b/htdocs/asset/admin/asset_extrafields.php index bb336e43fdc..dfec16bfb66 100644 --- a/htdocs/asset/admin/asset_extrafields.php +++ b/htdocs/asset/admin/asset_extrafields.php @@ -78,7 +78,7 @@ $textobject = $langs->transnoentitiesnoconv("Assets"); llxHeader('', $langs->trans("AssetSetup"), $help_url); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); diff --git a/htdocs/asset/admin/assetmodel_extrafields.php b/htdocs/asset/admin/assetmodel_extrafields.php index b6f5c759e1b..24ea12ec29f 100644 --- a/htdocs/asset/admin/assetmodel_extrafields.php +++ b/htdocs/asset/admin/assetmodel_extrafields.php @@ -78,7 +78,7 @@ $textobject = $langs->transnoentitiesnoconv("AssetModels"); llxHeader('', $langs->trans("AssetSetup"), $help_url); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); diff --git a/htdocs/asset/admin/setup.php b/htdocs/asset/admin/setup.php index 1ca21cbfffb..0dc37661fad 100644 --- a/htdocs/asset/admin/setup.php +++ b/htdocs/asset/admin/setup.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2018-2024 Alexandre Spangaro * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -469,7 +469,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { } if ($action == 'edit') { - print ''; + print ''; print ''; print ''; diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index e611f09628b..39fe2f99db5 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2018-2025 Alexandre Spangaro - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -188,7 +188,7 @@ llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-asset page-card'); if ($action == 'create') { print load_fiche_titre($langs->trans("NewAsset"), '', 'object_'.$object->picto); - print ''; + print ''; print ''; print ''; if ($backtopage) { @@ -228,7 +228,7 @@ if ($action == 'create') { if (($id || $ref) && $action == 'edit') { print load_fiche_titre($langs->trans("Asset"), '', 'object_'.$object->picto); - print ''; + print ''; print ''; print ''; print ''; @@ -324,7 +324,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea array('type' => 'checkbox', 'name' => 'disposal_depreciated', 'label' => $langs->trans("AssetDisposalDepreciated"), 'value' => $disposal_depreciated), array('type' => 'checkbox', 'name' => 'disposal_subject_to_vat', 'label' => $langs->trans("AssetDisposalSubjectToVat"), 'value' => $disposal_subject_to_vat), ); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('AssetDisposal'), $langs->trans('AssetConfirmDisposalAsk', $object->ref . ' - ' . $object->label), 'confirm_disposal', $formquestion, 'yes', 1, 350); + $formconfirm = $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]), $langs->trans('AssetDisposal'), $langs->trans('AssetConfirmDisposalAsk', $object->ref . ' - ' . $object->label), 'confirm_disposal', $formquestion, 'yes', 1, 350); } // Confirmation of reopen diff --git a/htdocs/asset/model/card.php b/htdocs/asset/model/card.php index 63cf541f6a4..9a13bc43fce 100644 --- a/htdocs/asset/model/card.php +++ b/htdocs/asset/model/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2018 Alexandre Spangaro - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -270,12 +270,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Confirmation to delete if ($action == 'delete') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteAssetModel'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); + $formconfirm = $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]), $langs->trans('DeleteAssetModel'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); } elseif ($action == 'clone') { // Clone confirmation // Create an array for form $formquestion = array(); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]), $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } // Call Hook formConfirm diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 2e678931cd2..266b8579142 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -1,7 +1,7 @@ * Copyright (C) 2017-2018 Laurent Destailleur - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Alexandre Spangaro * @@ -479,7 +479,7 @@ print '

'; print ''; -print '
'; +print ''; if ($optioncss != '') { print ''; diff --git a/htdocs/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php index bd4f2135d1c..cf57851314c 100644 --- a/htdocs/bom/bom_agenda.php +++ b/htdocs/bom/bom_agenda.php @@ -169,7 +169,7 @@ if ($object->id > 0) { $morehtmlref.='
'.$langs->trans('Project') . ' '; if ($user->hasRight('bom', 'creer')) { if ($action != 'classify') - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref.=' : '; if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index c7f25128c38..92a70caca1a 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -331,7 +331,7 @@ llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-bom page-card'); if ($action == 'create') { print load_fiche_titre($langs->trans("NewBOM"), '', 'bom'); - print ''; + print ''; print ''; print ''; print ''; @@ -359,7 +359,7 @@ if ($action == 'create') { if (($id || $ref) && $action == 'edit') { print load_fiche_titre($langs->trans("BillOfMaterials"), '', 'cubes'); - print ''; + print ''; print ''; print ''; print ''; @@ -531,7 +531,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($permissiontoadd) { if ($action != 'classify') - $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); $morehtmlref.=''; diff --git a/htdocs/bom/lib/bom.lib.php b/htdocs/bom/lib/bom.lib.php index c545b286723..91ba3d8b291 100644 --- a/htdocs/bom/lib/bom.lib.php +++ b/htdocs/bom/lib/bom.lib.php @@ -1,6 +1,6 @@ - * Copyright (C) 2019-2023 Frédéric France + * Copyright (C) 2019-2025 Frédéric France * Copyright (C) 2024 MDW * * This program is free software: you can redistribute it and/or modify @@ -42,12 +42,12 @@ function bomAdminPrepareHead() $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT."/admin/bom.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/bom.php"); $head[$h][1] = $langs->trans("Settings"); $head[$h][2] = 'settings'; $h++; - $head[$h][0] = DOL_URL_ROOT."/admin/bom_extrafields.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/bom_extrafields.php"); $head[$h][1] = $langs->trans("ExtraFields"); $nbExtrafields = (isset($extrafields->attributes['bom_bom']['label']) && is_countable($extrafields->attributes['bom_bom']['label'])) ? count($extrafields->attributes['bom_bom']['label']) : 0; if ($nbExtrafields > 0) { @@ -56,7 +56,7 @@ function bomAdminPrepareHead() $head[$h][2] = 'bom_extrafields'; $h++; - $head[$h][0] = DOL_URL_ROOT."/admin/bomline_extrafields.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/bomline_extrafields.php"); $head[$h][1] = $langs->trans("ExtraFieldsLines"); $nbExtrafields = (isset($extrafields->attributes['bom_bomline']['label']) && is_countable($extrafields->attributes['bom_bomline']['label'])) ? count($extrafields->attributes['bom_bomline']['label']) : 0; if ($nbExtrafields > 0) { @@ -98,12 +98,12 @@ function bomPrepareHead($object) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT."/bom/bom_card.php?id=".$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/bom/bom_card.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("BOM"); $head[$h][2] = 'card'; $h++; - $head[$h][0] = DOL_URL_ROOT."/bom/bom_net_needs.php?id=".$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/bom/bom_net_needs.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("BOMNetNeeds"); $head[$h][2] = 'net_needs'; $h++; @@ -116,7 +116,7 @@ function bomPrepareHead($object) if (!empty($object->note_public)) { $nbNote++; } - $head[$h][0] = DOL_URL_ROOT.'/bom/bom_note.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/bom/bom_note.php', ['id' => $object->id]); $head[$h][1] = $langs->trans('Notes'); if ($nbNote > 0) { $head[$h][1] .= (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? ''.$nbNote.'' : ''); @@ -130,7 +130,7 @@ function bomPrepareHead($object) $upload_dir = getMultidirOutput($object) . "/".dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks = Link::count($db, $object->element, $object->id); - $head[$h][0] = DOL_URL_ROOT.'/bom/bom_document.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/bom/bom_document.php', ['id' => $object->id]); $head[$h][1] = $langs->trans('Documents'); if (($nbFiles + $nbLinks) > 0) { $head[$h][1] .= (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? ''.($nbFiles + $nbLinks).'' : ''); @@ -138,7 +138,7 @@ function bomPrepareHead($object) $head[$h][2] = 'document'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/bom/bom_agenda.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/bom/bom_agenda.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("Events"); $head[$h][2] = 'agenda'; $h++; diff --git a/htdocs/bookcal/admin/availabilities_extrafields.php b/htdocs/bookcal/admin/availabilities_extrafields.php index f9b18492677..93098c3c6ae 100644 --- a/htdocs/bookcal/admin/availabilities_extrafields.php +++ b/htdocs/bookcal/admin/availabilities_extrafields.php @@ -79,7 +79,7 @@ $page_name = "BookCalSetup"; llxHeader('', $langs->trans("BookCalSetup"), $help_url, '', 0, 0, '', '', '', 'mod-bookcal page-admin_availabilities_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); diff --git a/htdocs/bookcal/admin/calendar_extrafields.php b/htdocs/bookcal/admin/calendar_extrafields.php index e6e47af2317..e9a13f4c31b 100644 --- a/htdocs/bookcal/admin/calendar_extrafields.php +++ b/htdocs/bookcal/admin/calendar_extrafields.php @@ -80,7 +80,7 @@ $page_name = "BookCalSetup"; llxHeader('', $langs->trans("BookCalSetup"), $help_url, '', 0, 0, '', '', '', 'mod-bookcal page-admin_calender_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); diff --git a/htdocs/bookcal/availabilities_agenda.php b/htdocs/bookcal/availabilities_agenda.php index 6cccf182dad..5153ae694ae 100644 --- a/htdocs/bookcal/availabilities_agenda.php +++ b/htdocs/bookcal/availabilities_agenda.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -170,7 +170,7 @@ if ($object->id > 0) { $morehtmlref.='
'.$langs->trans('Project') . ' '; if ($permissiontoadd) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; } $morehtmlref.=' : '; if ($action == 'classify') { diff --git a/htdocs/bookcal/availabilities_card.php b/htdocs/bookcal/availabilities_card.php index a8f017a7bdc..1faef7f96c9 100644 --- a/htdocs/bookcal/availabilities_card.php +++ b/htdocs/bookcal/availabilities_card.php @@ -238,7 +238,7 @@ if ($action == 'create') { } print load_fiche_titre($langs->trans("NewAvailabilities"), '', 'object_'.$object->picto); - print ''; + print ''; print ''; if ($error != 0) { print ''; @@ -277,7 +277,7 @@ if ($action == 'create') { if (($id || $ref) && $action == 'edit') { print load_fiche_titre($langs->trans("Availabilities"), '', 'object_'.$object->picto); - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/bookcal/availabilities_contact.php b/htdocs/bookcal/availabilities_contact.php index e8b7f950112..5f6ea80136c 100644 --- a/htdocs/bookcal/availabilities_contact.php +++ b/htdocs/bookcal/availabilities_contact.php @@ -155,7 +155,7 @@ if ($object->id) { if ($permissiontoadd) { if ($action != 'classify') - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref.=' : '; if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/bookcal/availabilities_document.php b/htdocs/bookcal/availabilities_document.php index 704484bf280..11d070e4f01 100644 --- a/htdocs/bookcal/availabilities_document.php +++ b/htdocs/bookcal/availabilities_document.php @@ -153,7 +153,7 @@ if ($object->id && $upload_dir !== null) { if ($permissiontoadd) { if ($action != 'classify') - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref.=' : '; if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/bookcal/availabilities_note.php b/htdocs/bookcal/availabilities_note.php index 713e5607a8e..c3331f295bd 100644 --- a/htdocs/bookcal/availabilities_note.php +++ b/htdocs/bookcal/availabilities_note.php @@ -127,7 +127,7 @@ if ($id > 0 || !empty($ref)) { if ($permissiontoadd) { if ($action != 'classify') - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref.=' : '; if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/bookcal/calendar_agenda.php b/htdocs/bookcal/calendar_agenda.php index 4a1c8bdd521..9a44ea9a5d1 100644 --- a/htdocs/bookcal/calendar_agenda.php +++ b/htdocs/bookcal/calendar_agenda.php @@ -1,7 +1,7 @@ * Copyright (C) 2023 Alice Adminson - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -179,7 +179,7 @@ if ($object->id > 0) { $morehtmlref.='
'.$langs->trans('Project') . ' '; if ($permissiontoadd) { if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; } $morehtmlref.=' : '; if ($action == 'classify') { diff --git a/htdocs/bookcal/calendar_card.php b/htdocs/bookcal/calendar_card.php index 958fb64c9e9..ae47031901b 100644 --- a/htdocs/bookcal/calendar_card.php +++ b/htdocs/bookcal/calendar_card.php @@ -1,7 +1,7 @@ * Copyright (C) 2023 Alice Adminson - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -214,7 +214,7 @@ if ($action == 'create') { print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Calendar")), '', 'object_'.$object->picto); - print ''; + print ''; print ''; print ''; if ($backtopage) { @@ -253,7 +253,7 @@ if ($action == 'create') { if (($id || $ref) && $action == 'edit') { print load_fiche_titre($langs->trans("Calendar"), '', 'object_'.$object->picto); - print ''; + print ''; print ''; print ''; print ''; @@ -341,7 +341,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($permissiontoadd) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/bookcal/calendar_contact.php b/htdocs/bookcal/calendar_contact.php index b67a8c07d45..c314c71778e 100644 --- a/htdocs/bookcal/calendar_contact.php +++ b/htdocs/bookcal/calendar_contact.php @@ -164,7 +164,7 @@ if ($object->id) { if ($permissiontoadd) { if ($action != 'classify') - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref.=' : '; if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/bookcal/calendar_document.php b/htdocs/bookcal/calendar_document.php index 73bb20e33b2..59f8e2c45a6 100644 --- a/htdocs/bookcal/calendar_document.php +++ b/htdocs/bookcal/calendar_document.php @@ -147,42 +147,6 @@ if ($object->id && $upload_dir !== null) { $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; - /* - // Ref customer - $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); - $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); - // Thirdparty - $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); - // Project - if (isModEnabled('project')) { - $langs->load("projects"); - $morehtmlref.='
'.$langs->trans('Project') . ' '; - if ($permissiontoadd) - { - if ($action != 'classify') - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - $morehtmlref.=' : '; - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref.=''; - $morehtmlref.=''; - $morehtmlref.=''; - $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref.=''; - $morehtmlref.=''; - } else { - $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); - } - } else { - if (!empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref .= ': '.$proj->getNomUrl(); - } else { - $morehtmlref .= ''; - } - } - }*/ $morehtmlref .= '
'; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/bookcal/calendar_note.php b/htdocs/bookcal/calendar_note.php index c3c7dcabdc8..8883631c69c 100644 --- a/htdocs/bookcal/calendar_note.php +++ b/htdocs/bookcal/calendar_note.php @@ -130,7 +130,7 @@ if ($id > 0 || !empty($ref)) { if ($permissiontoadd) { if ($action != 'classify') - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref.=' : '; if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/bookmarks/admin/bookmark.php b/htdocs/bookmarks/admin/bookmark.php index 752e8ea3806..b57cc2325f1 100644 --- a/htdocs/bookmarks/admin/bookmark.php +++ b/htdocs/bookmarks/admin/bookmark.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2005-2009 Laurent Destailleur * Copyright (C) 2011-2012 Juanjo Menent - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -73,13 +73,13 @@ if ($action == 'setvalue') { llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-bookmarks page-admin_bookmark'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("BookmarkSetup"), $linkback, 'title_setup'); print $langs->trans("BookmarkDesc")."
\n"; print '
'; -print '
'; +print ''; print ''; print ''; diff --git a/htdocs/categories/admin/categorie.php b/htdocs/categories/admin/categorie.php index 7561c83d351..9b6bcda99ce 100644 --- a/htdocs/categories/admin/categorie.php +++ b/htdocs/categories/admin/categorie.php @@ -77,11 +77,11 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) { */ $help_url = 'EN:Module Categories|FR:Module Catégories|ES:Módulo Categorías|DE:Modul_Kategorien'; -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; llxHeader('', $langs->trans("Categories"), $help_url); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("CategoriesSetup"), $linkback, 'title_setup'); diff --git a/htdocs/categories/admin/categorie_extrafields.php b/htdocs/categories/admin/categorie_extrafields.php index 764fd9e1249..f730c09dc1d 100644 --- a/htdocs/categories/admin/categorie_extrafields.php +++ b/htdocs/categories/admin/categorie_extrafields.php @@ -73,7 +73,7 @@ $help_url = 'EN:Module Categories|FR:Module Catégories|ES:Módulo Categorías|D llxHeader('', $langs->trans("Categories"), $help_url); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("CategoriesSetup"), $linkback, 'title_setup'); $head = categoriesadmin_prepare_head(); diff --git a/htdocs/categories/categorie_list.php b/htdocs/categories/categorie_list.php index 3bd2c48f342..0bfb015485a 100644 --- a/htdocs/categories/categorie_list.php +++ b/htdocs/categories/categorie_list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -448,7 +448,10 @@ if ($mode == 'hierarchy') { if (empty($conf->main_checkbox_left_column)) { $entry .= ''; if ($user->hasRight('categorie', 'creer')) { - $entry .= '' . img_edit() . ''; + $query = []; + parse_str($param, $query); + $query = array_merge($query, ['id' => $val['id'], 'backtopage' => (dolBuildUrl($_SERVER["PHP_SELF"], ['type' => $type]).$param)]); + $entry .= '' . img_edit() . ''; } $entry .= ''; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index a142f43309c..49b41a10597 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -176,7 +176,9 @@ class Categorie extends CommonObject 'order' => 'Commande', 'invoice' => 'Facture', 'supplier_order' => 'CommandeFournisseur', - 'supplier_invoice' => 'FactureFournisseur' + 'supplier_invoice' => 'FactureFournisseur', + 'supplier_proposal' => 'SupplierProposal', + 'propal' => 'Propal', ); /** @@ -202,7 +204,9 @@ class Categorie extends CommonObject 'order' => 'Orders', 'invoice' => 'Invoices', 'supplier_order' => 'SuppliersOrders', - 'supplier_invoice' => 'SuppliersInvoices' + 'supplier_invoice' => 'SuppliersInvoices', + 'propal' => 'Proposals', + 'supplier_proposal' => 'SupplierProposals', ); /** diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index 86694d7937e..f22cd884e46 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -5,7 +5,7 @@ * Copyright (C) 2007 Patrick Raguin * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2021-2024 Frédéric France + * Copyright (C) 2021-2025 Frédéric France * Copyright (C) 2024 MDW * Copyright (C) 2025 Alexandre Spangaro * @@ -31,10 +31,6 @@ // Load Dolibarr environment require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - /** * @var Conf $conf * @var DoliDB $db @@ -43,8 +39,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; * @var User $user */ +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + // Load translation files required by the page -$langs->loadLangs(array("accountancy", "agenda", "banks", "bills", "categories", "contracts", "interventions")); +$langs->loadLangs(array("accountancy", "agenda", "banks", "bills", "categories", "contracts", "interventions", "propal", "supplier_proposal")); $langs->loadLangs(array("knowledgemanagement", "members", "orders", "products", "stocks", "suppliers", "tickets", "website")); $mode = GETPOST('mode', 'aZ09'); @@ -165,11 +165,11 @@ foreach ($arrayofcateg as $idtype => $val) { print ''; print $arrayofcateg[$idtype]['nb']; print ''; - print ''.img_picto('', 'edit').''; + print ''.img_picto('', 'edit').''; print ''; } -print ""; +print "\n"; print '
'; diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 6e75a7bbb05..f131b1ae805 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -8,7 +8,7 @@ * Copyright (C) 2020 Josep Lluís Amador * Copyright (C) 2022-2023 Solution Libre SAS * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024-2025 Alexandre Spangaro * Copyright (C) 2023-2024 Charlene Benke * @@ -207,7 +207,7 @@ if ($user->hasRight('categorie', 'supprimer') && $action == 'confirm_delete' && header("Location: ".$backtopage); exit; } else { - header("Location: ".DOL_URL_ROOT.'/categories/categorie_list.php?type='.$type); + header("Location: ".dolBuildUrl(DOL_URL_ROOT.'/categories/categorie_list.php', ['type' => $type])); exit; } } else { @@ -387,12 +387,12 @@ if ($reshook < 0) { } if (empty($reshook)) { if ($user->hasRight('categorie', 'creer')) { - $socid = ($object->socid ? "&socid=".$object->socid : ""); - print ''.$langs->trans("Modify").''; + $socid = ($object->socid ? $object->socid : ""); + print ''.$langs->trans("Modify").''; } if ($user->hasRight('categorie', 'supprimer')) { - print 'id.'&type='.urlencode($type).'&backtolist='.urlencode($backtolist).'">'.$langs->trans("Delete").''; + print ' 'delete', 'id' => $object->id, 'type' => $type, 'backtolist' => $backtolist], true).'">'.$langs->trans("Delete").''; } } @@ -400,11 +400,7 @@ print "
"; $newcardbutton = ''; if ($user->hasRight('categorie', 'creer')) { - $link = DOL_URL_ROOT.'/categories/card.php'; - $link .= '?action=create'; - $link .= '&type='.urlencode($type); - $link .= '&catorigin='.((int) $object->id); - $link .= '&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.'&id='.$id); + $link = dolBuildUrl(DOL_URL_ROOT.'/categories/card.php', ['action'=> 'create', 'type' => $type, 'catorigin' => $object->id, 'backtopage' => dolBuildUrl($_SERVER["PHP_SELF"], ['type' => $type, 'id' => $id])]); $newcardbutton = '
'; $newcardbutton .= dolGetButtonTitle($langs->trans('NewCategory'), '', 'fa fa-plus-circle', $link); @@ -573,7 +569,7 @@ if ($type == Categorie::TYPE_PRODUCT) { /** @var Product[] $prods */ '@phan-var-force Product[] $prods'; // Form to add record into the category - print ''; + print ''; print ''; print ''; print ''; @@ -653,7 +649,7 @@ if ($type == Categorie::TYPE_CUSTOMER) { /** @var Societe[] $socs */ '@phan-var-force Societe[] $socs'; // Form to add record into a category - print ''; + print ''; print ''; print ''; print ''; @@ -734,7 +730,7 @@ if ($type == Categorie::TYPE_SUPPLIER) { /** @var Fournisseur[] $socs */ '@phan-var-force Fournisseur[] $socs'; // Form to add record into a category - print ''; + print ''; print ''; print ''; print ''; @@ -817,7 +813,7 @@ if ($type == Categorie::TYPE_MEMBER) { /** @var Adherent[] $members */ '@phan-var-force Adherent[] $members'; // Form to add record into a category - print ''; + print ''; print ''; print ''; print ''; @@ -899,7 +895,7 @@ if ($type == Categorie::TYPE_CONTACT) { /** @var Contact[] $contacts */ '@phan-var-force Contact[] $contacts'; // Form to add record into a category - print ''; + print ''; print ''; print ''; print ''; @@ -987,7 +983,7 @@ if ($type == Categorie::TYPE_ACCOUNT) { /** @var Account[] $accounts */ '@phan-var-force Account[] $accounts'; // Form to add record into a category - print ''; + print ''; print ''; print ''; print ''; @@ -1070,7 +1066,7 @@ if ($type == Categorie::TYPE_PROJECT) { /** @var Project $object */ '@phan-var-force Project $object'; // Form to add record into a category - print ''; + print ''; print ''; print ''; print ''; @@ -1150,7 +1146,7 @@ if ($type == Categorie::TYPE_USER) { /** @var User[] $users */ '@phan-var-force User[] $users'; // Form to add record into a category - print ''; + print ''; print ''; print ''; print ''; @@ -1228,7 +1224,7 @@ if ($type == Categorie::TYPE_WAREHOUSE) { } else { /** @var Entrepot[] $objects */ '@phan-var-force Entrepot[] $objects'; - print ''; + print ''; print ''; print ''; print ''; @@ -1299,7 +1295,7 @@ if ($type == Categorie::TYPE_TICKET) { /** @var Ticket[] $tickets */ '@phan-var-force Ticket[] $tickets'; // Form to add record into a category - print ''; + print ''; print ''; print ''; print ''; @@ -1382,7 +1378,7 @@ if ($type == Categorie::TYPE_FICHINTER) { $formfichinter = new FormIntervention($db); print '
'; - print ''; + print ''; print ''; print ''; print ''; @@ -1398,7 +1394,7 @@ if ($type == Categorie::TYPE_FICHINTER) { print ''; } - print '
'; + print ''; print ''; print ''; print ''; @@ -1467,7 +1463,7 @@ if ($type == Categorie::TYPE_ORDER) { $showclassifyform = $user->hasRight('order', 'write'); if ($showclassifyform) { print '
'; - print ''; + print ''; print ''; print ''; print ''; @@ -1483,7 +1479,7 @@ if ($type == Categorie::TYPE_ORDER) { print '
'; } - print '
'; + print ''; print ''; print ''; print ''; @@ -1548,7 +1544,7 @@ if ($type == Categorie::TYPE_INVOICE) { $showclassifyform = $user->hasRight('facture', 'write'); if ($showclassifyform) { print '
'; - print ''; + print ''; print ''; print ''; print ''; @@ -1564,7 +1560,7 @@ if ($type == Categorie::TYPE_INVOICE) { print '
'; } - print '
'; + print ''; print ''; print ''; print ''; @@ -1630,7 +1626,7 @@ if ($type == Categorie::TYPE_SUPPLIER_ORDER) { ; if ($showclassifyform) { print '
'; - print ''; + print ''; print ''; print ''; print ''; @@ -1646,7 +1642,7 @@ if ($type == Categorie::TYPE_SUPPLIER_ORDER) { print '
'; } - print '
'; + print ''; print ''; print ''; print ''; @@ -1711,7 +1707,7 @@ if ($type == Categorie::TYPE_SUPPLIER_INVOICE) { $showclassifyform = $user->hasRight('fournisseur', 'facture', 'creer');; if ($showclassifyform) { print '
'; - print ''; + print ''; print ''; print ''; print ''; @@ -1727,7 +1723,7 @@ if ($type == Categorie::TYPE_SUPPLIER_INVOICE) { print '
'; } - print '
'; + print ''; print ''; print ''; print ''; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index ef33d404774..ed271a7a30f 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -2605,7 +2605,7 @@ if ($id > 0 && $action != 'create') { if ($usercancreate) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index b8104639c7f..0f9c8afd648 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1850,13 +1850,13 @@ class ActionComm extends CommonObject $linkclose .= ' class="'.$morecss.'"'; } - $url = ''; + $query = ['id' => $this->id]; if ($option == 'birthday') { - $url = DOL_URL_ROOT.'/contact/perso.php?id='.$this->id; + $baseurl = DOL_URL_ROOT.'/contact/perso.php'; } elseif ($option == 'holiday') { - $url = DOL_URL_ROOT.'/holiday/card.php?id='.$this->id; + $baseurl = DOL_URL_ROOT.'/holiday/card.php'; } else { - $url = DOL_URL_ROOT.'/comm/action/card.php?id='.$this->id; + $baseurl = DOL_URL_ROOT.'/comm/action/card.php'; } if ($option !== 'nolink') { @@ -1866,9 +1866,10 @@ class ActionComm extends CommonObject $add_save_lastsearch_values = 1; } if ($add_save_lastsearch_values) { - $url .= '&save_lastsearch_values=1'; + $query += ['save_lastsearch_values' => 1]; } } + $url = dolBuildUrl($baseurl, $query); $linkstart = ''; diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 869644dc8a2..1ea2bf4e892 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2005 Simon TOSSER * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -206,7 +206,7 @@ if ($object->id > 0) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/comm/action/info.php b/htdocs/comm/action/info.php index f7b3098126c..d1b23884942 100644 --- a/htdocs/comm/action/info.php +++ b/htdocs/comm/action/info.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2023 Laurent Destailleur - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -130,7 +130,7 @@ if (isModEnabled('project')) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index 2d6f8211ecc..0fe6c736d53 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -3,7 +3,7 @@ * Copyright (C) 2003 Eric Seigne * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -126,7 +126,7 @@ if ($resql) { $param .= '&limit='.$limit; } - print ''; + print ''; if ($optioncss != '') { print ''; } diff --git a/htdocs/comm/admin/propal_extrafields.php b/htdocs/comm/admin/propal_extrafields.php index 9cb88a7fce8..acc54325a48 100644 --- a/htdocs/comm/admin/propal_extrafields.php +++ b/htdocs/comm/admin/propal_extrafields.php @@ -72,7 +72,7 @@ $textobject = $langs->transnoentitiesnoconv("Proposals"); llxHeader('', $langs->trans("PropalSetup")); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("PropalSetup"), $linkback, 'title_setup'); diff --git a/htdocs/comm/admin/propaldet_extrafields.php b/htdocs/comm/admin/propaldet_extrafields.php index 3479441c7eb..5f939d6edce 100644 --- a/htdocs/comm/admin/propaldet_extrafields.php +++ b/htdocs/comm/admin/propaldet_extrafields.php @@ -76,7 +76,7 @@ $textobject = $langs->transnoentitiesnoconv("Proposals"); llxHeader('', $langs->trans("PropalSetup")); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("PropalSetup"), $linkback, 'title_setup'); $head = propal_admin_prepare_head(); diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 19ac7e15d38..062fb7e68da 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -1264,7 +1264,7 @@ if (isModEnabled('order') && $user->hasRight('commande', 'lire') && is_object($o if ($resql) { $total = $total_ttc = 0; $num = $db->num_rows($resql); - $nbofloop = min($num, (!getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD)); + $nbofloop = min($num, getDolGlobalString('MAIN_MAXLIST_OVERLOAD', 500)); startSimpleTable("OrdersOpened", "commande/list.php", "search_status=".Commande::STATUS_VALIDATED, 4, $num); if ($num > 0) { diff --git a/htdocs/comm/mailing/note.php b/htdocs/comm/mailing/note.php index 534e128d643..1446b646e6c 100644 --- a/htdocs/comm/mailing/note.php +++ b/htdocs/comm/mailing/note.php @@ -121,7 +121,7 @@ if ($id > 0 || !empty($ref)) { if ($permissiontoadd) { if ($action != 'classify') - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref.=' : '; if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/comm/mailing/targetemailing.php b/htdocs/comm/mailing/targetemailing.php index 12f3c94f836..aed869d83f2 100644 --- a/htdocs/comm/mailing/targetemailing.php +++ b/htdocs/comm/mailing/targetemailing.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2014 Florian Henry * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -759,7 +759,7 @@ if ($object->fetch($id) >= 0) { $param .= "&search_other=".urlencode($search_other); } - print ''; + print ''; print ''; print ''; print ''; @@ -783,7 +783,7 @@ if ($object->fetch($id) >= 0) { print ''; print "\n\n"; - print '
'; + print ''; print ''; print ''; print ''; diff --git a/htdocs/comm/propal/agenda.php b/htdocs/comm/propal/agenda.php index fb39a439b96..51f7a9d5031 100644 --- a/htdocs/comm/propal/agenda.php +++ b/htdocs/comm/propal/agenda.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -154,8 +154,8 @@ if ($object->id > 0) { $morehtmlref = '
'; // Ref customer - $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); + $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_customer, $object, 0, 'string', '', 0, 1); + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_customer, $object, 0, 'string', '', null, null, '', 1); // Thirdparty $morehtmlref .= '
' . $object->thirdparty->getNomUrl(1); // Project @@ -165,7 +165,7 @@ if ($object->id > 0) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= '' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' '; + $morehtmlref .= '' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { @@ -201,20 +201,26 @@ if ($object->id > 0) { $objthirdparty = $object; $objcon = new stdClass(); - $out = '&origin=' . urlencode((string) ($object->element . (property_exists($object, 'module') ? '@' . $object->module : ''))) . '&originid=' . urlencode((string) ($object->id)); - $urlbacktopage = $_SERVER['PHP_SELF'] . '?id=' . $object->id; - $out .= '&backtopage=' . urlencode($urlbacktopage); + $query = [ + 'action' => 'create', + 'origin' => ($object->element . (property_exists($object, 'module') && !empty($object->module) ? '@' . $object->module : '')), + 'originid' => $object->id, + 'backtopage' => dolBuildUrl($_SERVER['PHP_SELF'], ['id' => $object->id]), + ]; $permok = $user->hasRight('agenda', 'myactions', 'create'); if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) { //$out.='trans("AddAnAction"),'filenew'); //$out.=""; } + $url = dolBuildUrl(DOL_URL_ROOT . '/comm/action/card.php', $query); $morehtmlright = ''; @@ -224,27 +230,24 @@ if ($object->id > 0) { //$messagingUrl = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id; //$morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2); - $messagingUrl = DOL_URL_ROOT . '/comm/propal/messaging.php?id=' . $object->id; + $messagingUrl = dolBuildUrl(DOL_URL_ROOT . '/comm/propal/messaging.php', ['id' => $object->id]); $morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 1); - $messagingUrl = DOL_URL_ROOT . '/comm/propal/agenda.php?id=' . $object->id; + $messagingUrl = dolBuildUrl(DOL_URL_ROOT . '/comm/propal/agenda.php', ['id' => $object->id]); $morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2); if (isModEnabled('agenda')) { if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create')) { - $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT . '/comm/action/card.php?action=create' . $out); + $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', $url); } else { - $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT . '/comm/action/card.php?action=create' . $out, '', 0); + $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', $url, '', 0); } } - if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { print '
'; - - $param = '&id=' . $object->id . (!empty($socid) ? '&socid=' . $socid : ''); if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage=' . urlencode($contextpage); diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 6f779fe34f3..0c20c81f150 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2736,7 +2736,7 @@ if ($action == 'create') { $formquestion[] = array('type' => 'date', 'name' => 'date_delivery', 'label' => $langs->trans("DeliveryDate"), 'value' => $object->delivery_date); } // Incomplete payment. We ask if reason = discount or other - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmClonePropal', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 250, 600); + $formconfirm = $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]), $langs->trans('ToClone'), $langs->trans('ConfirmClonePropal', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 250, 600); } // Subtotal line form @@ -2902,19 +2902,19 @@ if ($action == 'create') { } if (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('SetAcceptedRefused'), '', 'confirm_closeas', $formquestion, '', 1, 250); + $formconfirm = $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]), $langs->trans('SetAcceptedRefused'), '', 'confirm_closeas', $formquestion, '', 1, 250); } else { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?statut=3&id=' . $object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250); } } elseif ($action == 'cancel') { // Confirm cancel - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans("CancelPropal"), $langs->trans('ConfirmCancelPropal', $object->ref), 'confirm_cancel', '', 0, 1); + $formconfirm = $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]), $langs->trans("CancelPropal"), $langs->trans('ConfirmCancelPropal', $object->ref), 'confirm_cancel', '', 0, 1); } elseif ($action == 'delete') { // Confirm delete - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp', $object->ref), 'confirm_delete', '', 0, 1); + $formconfirm = $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]), $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp', $object->ref), 'confirm_delete', '', 0, 1); } elseif ($action == 'reopen') { // Confirm reopen - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenProp', $object->ref), 'confirm_reopen', '', 0, 1); + $formconfirm = $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]), $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenProp', $object->ref), 'confirm_reopen', '', 0, 1); } elseif ($action == 'ask_deleteline') { // Confirmation delete product/service line $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1); @@ -2974,7 +2974,7 @@ if ($action == 'create') { } if (!$error) { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateProp'), $text, 'confirm_validate', '', 0, 1, 240); + $formconfirm = $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]), $langs->trans('ValidateProp'), $text, 'confirm_validate', '', 0, 1, 240); } } diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index a173c70b23b..bee8a91c9f5 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -169,7 +169,7 @@ if ($object->id > 0) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 7ee0af21e10..0bc7f7f9c5b 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -150,7 +150,7 @@ if ($object->id > 0) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index d2d63a32ba0..1d3bc091b1c 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -115,7 +115,7 @@ if (isModEnabled("propal")) { $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); - $nbofloop = min($num, (!getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD)); + $nbofloop = min($num, getDolGlobalString('MAIN_MAXLIST_OVERLOAD', 500)); startSimpleTable("DraftPropals", "comm/propal/list.php", "search_status=".Propal::STATUS_DRAFT, 2, $num); $total = 0; @@ -295,7 +295,7 @@ if (isModEnabled("propal") && $user->hasRight('propal', 'lire')) { if ($resql) { $total = 0; $num = $db->num_rows($resql); - $nbofloop = min($num, (!getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD)); + $nbofloop = min($num, getDolGlobalString('MAIN_MAXLIST_OVERLOAD', 500)); startSimpleTable("ProposalsOpened", "comm/propal/list.php", "search_status=".Propal::STATUS_VALIDATED, 4, $num); if ($num > 0) { diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 5f1a4d12c8e..b71688ae289 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -1191,7 +1191,7 @@ $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('NewPropal'), '', 'fa fa-plus-circle', $url, '', $user->hasRight('propal', 'creer')); // Fields title search -print ''; +print ''; if ($optioncss != '') { print ''; } diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index 8f866464472..881731f4761 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Florian Henry * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -128,7 +128,7 @@ if ($object->id > 0) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 679e0d149b9..0b88546e524 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -6,7 +6,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2020 Maxime DEMAREST * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -284,7 +284,7 @@ print '
'; // Show filter box -print ''; +print ''; print ''; print ''; diff --git a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php index 11accaf3601..ae73891a1bd 100644 --- a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php +++ b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php @@ -63,8 +63,8 @@ foreach ($linkedObjectBlock as $key => $objectlink) { print ''; print ''.$langs->trans("Proposal"); if (!empty($showImportButton) && getDolGlobalInt('MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES')) { - $url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$objectlink->id; - print ' '; + $url = dolBuildUrl(DOL_URL_ROOT.'/comm/propal/card.php', ['id' => $objectlink->id, 'action' => 'selectlines'], true); + print ' '; } print ''; print ''.$objectlink->getNomUrl(1).''; @@ -77,7 +77,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { } print ''; print ''.$objectlink->getLibStatut(3).''; - print ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; + print ' $object->id, 'action' => 'dellink', 'dellinkid' => $key], true).'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; print "\n"; } if (count($linkedObjectBlock) > 1) { diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index ca9e7d12653..7d10de4ac73 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -3,8 +3,8 @@ * Copyright (C) 2004-2019 Laurent Destailleur * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2019-2025 Frédéric France - * Copyright (C) 2024-2025 MDW - * Copyright (C) 2025 Anthony Damhet + * Copyright (C) 2024-2025 MDW + * Copyright (C) 2025 Anthony Damhet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -149,7 +149,8 @@ if ($action == 'confirm_split_more' && $permissiontocreate) { $res = $discount->delete($user); if ($res > 0) { $db->commit(); - header("Location: ".$_SERVER["PHP_SELF"].'?id='.$id.($backtopage ? '&backtopage='.urlencode($backtopage) : '')); // To avoid pb with back + $query = ['id' => $id, 'backtopage' => $backtopage]; + header("Location: " . dolBuildUrl($_SERVER["PHP_SELF"], $query)); // To avoid pb with backtopage exit; } else { $db->rollback(); @@ -243,7 +244,8 @@ if ($action == 'confirm_split' && GETPOST("confirm", "alpha") == 'yes' && $permi $newid2 = $newdiscount2->create($user); if ($res > 0 && $newid1 > 0 && $newid2 > 0) { $db->commit(); - header("Location: ".$_SERVER["PHP_SELF"].'?id='.$id.($backtopage ? '&backtopage='.urlencode($backtopage) : '')); // To avoid pb with back + $query = ['id' => $id, 'backtopage' => $backtopage]; + header("Location: " . dolBuildUrl($_SERVER["PHP_SELF"], $query)); // To avoid pb with back exit; } else { $db->rollback(); @@ -296,7 +298,7 @@ if (GETPOST('action', 'aZ09') == 'confirm_remove' && GETPOST("confirm") == 'yes' $result = $discount->delete($user); if ($result > 0) { $db->commit(); - header("Location: ".$_SERVER["PHP_SELF"].'?id='.$id); // To avoid pb with back + header("Location: " . dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $id])); // To avoid pb with back exit; } else { setEventMessages($discount->error, $discount->errors, 'errors'); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 36d6fea35ab..e25f455c35b 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2613,7 +2613,7 @@ if ($action == 'create' && $usercancreate) { // Confirmation to delete if ($action == 'delete') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 1); + $formconfirm = $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]), $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 1); } // Confirmation of validation @@ -2793,7 +2793,7 @@ if ($action == 'create' && $usercancreate) { } if (!$error) { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', $formquestion, 0, 1, 240); + $formconfirm = $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]), $langs->trans('ValidateOrder'), $text, 'confirm_validate', $formquestion, 0, 1, 240); } } @@ -2829,12 +2829,12 @@ if ($action == 'create' && $usercancreate) { ]; } - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('UnvalidateOrder'), $text, 'confirm_modif', $formquestion, "yes", 1, 220); + $formconfirm = $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]), $langs->trans('UnvalidateOrder'), $text, 'confirm_modif', $formquestion, "yes", 1, 220); } // Confirmation of closing if ($action == 'shipped') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloseOrder'), $langs->trans('ConfirmCloseOrder'), 'confirm_shipped', '', 0, 1); + $formconfirm = $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]), $langs->trans('CloseOrder'), $langs->trans('ConfirmCloseOrder'), 'confirm_shipped', '', 0, 1); } // Confirmation of cancellation @@ -2864,7 +2864,7 @@ if ($action == 'create' && $usercancreate) { ); } - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans("Cancel"), $text, 'confirm_cancel', $formquestion, 0, 1); + $formconfirm = $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]), $langs->trans("Cancel"), $text, 'confirm_cancel', $formquestion, 0, 1); } // Confirmation to delete line @@ -2892,7 +2892,7 @@ if ($action == 'create' && $usercancreate) { $formquestion = array( array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOSTINT('socid'), 'socid', $filter, '', 0, 0, array(), 0, 'maxwidth300')) ); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneOrder', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + $formconfirm = $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]), $langs->trans('ToClone'), $langs->trans('ConfirmCloneOrder', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } // Subtotal line form diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index a2a4a63ed57..f036cebc541 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -160,7 +160,7 @@ if ($id > 0 || !empty($ref)) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php index 9e0e77c2c1e..6375076d2bc 100644 --- a/htdocs/commande/customer.php +++ b/htdocs/commande/customer.php @@ -5,7 +5,7 @@ * Copyright (C) 2012 Andreu Bisquerra Gaya * Copyright (C) 2012 David Rodriguez Martinez * Copyright (C) 2012 Juanjo Menent - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -139,7 +139,7 @@ if ($resql) { print_barre_liste($langs->trans("MenuOrdersToBill"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num); - print ''; + print ''; print ''; print ''; diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 21fb7ce68a7..bee1eb2c27c 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -153,7 +153,7 @@ if ($id > 0 || !empty($ref)) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php index d1c22a86195..5b6ece7adef 100644 --- a/htdocs/commande/list_det.php +++ b/htdocs/commande/list_det.php @@ -913,7 +913,7 @@ if ($resql) { $newcardbutton = '';//dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', $url, '', $contextpage == 'orderlistdet' && $permissiontoadd); // Lines of title fields - print ''; + print ''; if ($optioncss != '') { print ''; } diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index d2094f5a819..7bac8f13265 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -6,7 +6,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2020 Maxime DEMAREST * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -327,7 +327,7 @@ print '
'; // Show filter box -print ''; +print ''; print ''; print ''; diff --git a/htdocs/commande/tpl/linkedobjectblock.tpl.php b/htdocs/commande/tpl/linkedobjectblock.tpl.php index 01f5d10fbba..405e6f83de4 100644 --- a/htdocs/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/commande/tpl/linkedobjectblock.tpl.php @@ -74,7 +74,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { echo '
'; echo "\n"; diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index 4047d14d33f..9d8a7ba1686 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -5,7 +5,7 @@ * Copyright (C) 2013 Charles-Fr BENKE * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2016 Marcos García - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -107,7 +107,7 @@ llxHeader('', $title, $help_url); print load_fiche_titre($langs->trans("RubriquesTransactions"), '', 'object_category'); -print ''; +print ''; if ($optioncss != '') { print ''; } diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index a47d8cecdda..36d17d937a2 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -6,7 +6,7 @@ * Copyright (C) 2017 Patrick Delcroix * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2022 Alexandre Spangaro - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -464,7 +464,7 @@ if (empty($numref)) { $title = $langs->trans("AccountStatement").' '.$numref.' - '.$langs->trans("BankAccount").' '.$object->getNomUrl(1, 'receipts'); print load_fiche_titre($title, $morehtmlright, ''); - print ''; + print ''; print ''; print ''; diff --git a/htdocs/compta/bank/transfer.php b/htdocs/compta/bank/transfer.php index 9146ad5e612..a597468c111 100644 --- a/htdocs/compta/bank/transfer.php +++ b/htdocs/compta/bank/transfer.php @@ -5,7 +5,7 @@ * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Marcos García - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2023 Maxime Nicolas * Copyright (C) 2023 Benjamin GREMBI * Copyright (C) 2024-2025 MDW @@ -292,7 +292,7 @@ print load_fiche_titre($langs->trans("MenuBankInternalTransfer"), '', 'bank_acco print ''.$langs->trans("TransferDesc").''; print '

'; -print ''; +print ''; print ''; print ''; diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 7ad4cc2eecb..1ce62ce4c9e 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -622,7 +622,7 @@ if ($id) { if ($permissiontoadd) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/compta/bank/various_payment/document.php b/htdocs/compta/bank/various_payment/document.php index 7943bf83ee5..b3f40d48a21 100644 --- a/htdocs/compta/bank/various_payment/document.php +++ b/htdocs/compta/bank/various_payment/document.php @@ -1,7 +1,7 @@ * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -116,7 +116,7 @@ if ($object->id) { $langs->load("projects"); if ($user->hasRight('banque', 'modifier') && 0) { if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/compta/bank/various_payment/info.php b/htdocs/compta/bank/various_payment/info.php index 8dff526257d..e7ebe1f6817 100644 --- a/htdocs/compta/bank/various_payment/info.php +++ b/htdocs/compta/bank/various_payment/info.php @@ -1,7 +1,7 @@ * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -85,7 +85,7 @@ if (isModEnabled('project')) { $langs->load("projects"); if ($user->hasRight('banque', 'modifier') && 0) { if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index 95486a87ca2..c9eaadf93fc 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -7,7 +7,7 @@ * Copyright (C) 2016 Marcos García * Copyright (C) 2018 Andreu Bisquerra * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -396,7 +396,7 @@ if ($action == "create" || $action == "start" || $action == 'close') { if ($action != 'close') { print load_fiche_titre($langs->trans("CashControl")." - ".$langs->trans("New"), '', 'cash-register'); - print ''; + print ''; print ''; if ($contextpage == 'takepos') { print ''; diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 9f6e34be0be..4dbe1e8abe1 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -8,7 +8,7 @@ * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -122,7 +122,7 @@ if ($sortorder) { $totalnboflines = ''; $num = 0; -print ''; +print ''; if ($optioncss != '') { print ''; } diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php index 652d3d053c4..3bbfb59fb6f 100644 --- a/htdocs/compta/clients.php +++ b/htdocs/compta/clients.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003-2005 Rodolphe Quiedeville * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -147,7 +147,7 @@ if ($resql) { print_barre_liste($langs->trans("Customers"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num); - print ''; + print ''; print '
'; // For now, shipments must stay linked to order, so link is not deletable if ($object->element != 'shipping') { - echo ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; + echo ' $object->id, 'action' => 'dellink', 'dellinkid' => $key], true).'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; } echo '
'; print ''; diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index 159163e27f0..5c4c622cc55 100644 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -3,7 +3,7 @@ * Copyright (c) 2004-2012 Laurent Destailleur * Copyright (C) 2012 Marcos García * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -247,7 +247,7 @@ print '
'; // Show filter box -print ''; +print ''; print ''; print ''; diff --git a/htdocs/compta/facture/admin/invoice_cust_extrafields.php b/htdocs/compta/facture/admin/invoice_cust_extrafields.php index a9209196f85..08e83d7e76f 100644 --- a/htdocs/compta/facture/admin/invoice_cust_extrafields.php +++ b/htdocs/compta/facture/admin/invoice_cust_extrafields.php @@ -73,7 +73,7 @@ $textobject = strtolower($langs->transnoentitiesnoconv("BillsCustomers")); llxHeader('', $langs->trans("BillsSetup")); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("BillsSetup"), $linkback, 'title_setup'); diff --git a/htdocs/compta/facture/admin/invoice_rec_cust_extrafields.php b/htdocs/compta/facture/admin/invoice_rec_cust_extrafields.php index 65a92e02f7c..533ec4a7389 100644 --- a/htdocs/compta/facture/admin/invoice_rec_cust_extrafields.php +++ b/htdocs/compta/facture/admin/invoice_rec_cust_extrafields.php @@ -74,7 +74,7 @@ $textobject = strtolower($langs->transnoentitiesnoconv("BillsCustomers")); llxHeader('', $langs->trans("BillsSetup")); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("BillsSetup"), $linkback, 'title_setup'); diff --git a/htdocs/compta/facture/admin/invoicedet_cust_extrafields.php b/htdocs/compta/facture/admin/invoicedet_cust_extrafields.php index 3751da52696..fe4769f585b 100644 --- a/htdocs/compta/facture/admin/invoicedet_cust_extrafields.php +++ b/htdocs/compta/facture/admin/invoicedet_cust_extrafields.php @@ -74,7 +74,7 @@ $textobject = strtolower($langs->transnoentitiesnoconv("BillsCustomers")); llxHeader('', $langs->trans("BillsSetup")); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("BillsSetup"), $linkback, 'title_setup'); diff --git a/htdocs/compta/facture/admin/invoicedet_rec_cust_extrafields.php b/htdocs/compta/facture/admin/invoicedet_rec_cust_extrafields.php index 5a89ee7ffc0..cdef540dec7 100644 --- a/htdocs/compta/facture/admin/invoicedet_rec_cust_extrafields.php +++ b/htdocs/compta/facture/admin/invoicedet_rec_cust_extrafields.php @@ -74,7 +74,7 @@ $textobject = strtolower($langs->transnoentitiesnoconv("BillsCustomers")); llxHeader('', $langs->trans("BillsSetup")); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("BillsSetup"), $linkback, 'title_setup'); diff --git a/htdocs/compta/facture/agenda-rec.php b/htdocs/compta/facture/agenda-rec.php index dfec53e54da..c2556220121 100644 --- a/htdocs/compta/facture/agenda-rec.php +++ b/htdocs/compta/facture/agenda-rec.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -169,7 +169,7 @@ if ($object->id > 0) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/compta/facture/agenda.php b/htdocs/compta/facture/agenda.php index 86f3deb0fae..ad5568b4417 100644 --- a/htdocs/compta/facture/agenda.php +++ b/htdocs/compta/facture/agenda.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -164,7 +164,7 @@ if ($object->id > 0) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 169820b5e15..075143fed8d 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -1553,7 +1553,7 @@ if ($action == 'create') { if ($user->hasRight('facture', 'creer')) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 2554b1a5ad7..e4cde4ac777 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -5231,7 +5231,7 @@ if ($action == 'create') { if ($usercancreate) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index 07d518c7f6c..49beb5f65d7 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -167,7 +167,7 @@ if ($id > 0 || !empty($ref)) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index e00a841cebd..4ce67b885ea 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -168,7 +168,7 @@ if ($id > 0 || !empty($ref)) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/compta/facture/messaging.php b/htdocs/compta/facture/messaging.php index 3b91e447237..5120a968cad 100644 --- a/htdocs/compta/facture/messaging.php +++ b/htdocs/compta/facture/messaging.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -164,7 +164,7 @@ if ($object->id > 0) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/compta/facture/note-rec.php b/htdocs/compta/facture/note-rec.php index 2159fb9231e..a8c97166379 100644 --- a/htdocs/compta/facture/note-rec.php +++ b/htdocs/compta/facture/note-rec.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Florian Henry * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -151,7 +151,7 @@ if ($id > 0) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index 33420252456..2fb0377c3e8 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Florian Henry * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -138,7 +138,7 @@ if ($id > 0 || !empty($ref)) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 81c65e01c93..df2ea7eeab9 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -386,7 +386,7 @@ if ($object->id > 0) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { @@ -810,7 +810,7 @@ if ($object->id > 0) { } print ''; - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 980aeea27d2..eaecc303649 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -6,7 +6,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2020 Maxime DEMAREST * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -300,7 +300,7 @@ print '
'; // Show filter box -print ''; +print ''; print ''; print ''; diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index fcc6c564744..39a070b4cf8 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -85,7 +85,7 @@ $maxOpenCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->glob $hookmanager->initHooks(array('invoiceindex')); -$maxofloop = (!getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD); +$maxofloop = getDolGlobalString('MAIN_MAXLIST_OVERLOAD', 500); /* diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index 3240bdecfba..a24d8f30ea6 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -5,7 +5,7 @@ * Copyright (C) 2014-2024 Alexandre Spangaro * Copyright (C) 2016 Juanjo Menent * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -266,7 +266,7 @@ if ($resql) { $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('NewCheckDeposit'), '', 'fa fa-plus-circle', $url, '', $user->hasRight('banque', 'cheque')); - print ''; + print ''; if ($optioncss != '') { print ''; } diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 3cf5dc2f71f..ebcd51defc6 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -421,7 +421,7 @@ if ($search_noteprivate) { // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; -print ''; +print ''; if ($optioncss != '') { print ''; } diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 4b12af9085e..71e1ec9987a 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2010-2012 Juanjo Menent * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2019 Markus Welters * Copyright (C) 2024 MDW * @@ -483,7 +483,7 @@ if ($resql) { $param .= "&option=".urlencode($option); } - print ''; + print ''; print ''; print ''; if (!empty($limit)) { diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index c1ec93ef577..76cd3b0b7ef 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -3,7 +3,7 @@ * Copyright (C) 2005-2017 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2010-2012 Juanjo Menent - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -296,7 +296,7 @@ if ($resql) { } // Lines of title fields - print ''; + print ''; if ($optioncss != '') { print ''; } diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index bcd5eda4523..18faedc92fa 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2005-2013 Regis Houssin - * Copyright (C) 2016-2024 Frédéric France + * Copyright (C) 2016-2025 Frédéric France * Copyright (C) 2017-2024 Alexandre Spangaro * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2024-2025 MDW @@ -362,7 +362,7 @@ $resteapayer = 0; if ($action == 'create') { print load_fiche_titre($langs->trans("NewSocialContribution")); - print ''; + print ''; print ''; print ''; diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index 4d08927bce3..318e44dc892 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2003 Rodolphe Quiedeville * Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2016-2024 Frédéric France + * Copyright (C) 2016-2025 Frédéric France * Copyright (C) 2020 Pierre Ardoin * Copyright (C) 2020 Tobias Sekan * Copyright (C) 2021 Gauthier VERDOL @@ -408,7 +408,7 @@ if (!empty($permissiontodelete)) { $massactionbutton = $form->selectMassAction('', $arrayofmassactions); $moreforfilter = ''; -print ''; +print ''; if ($optioncss != '') { print ''; } diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index 8197c48151e..862845504a8 100644 --- a/htdocs/compta/sociales/payments.php +++ b/htdocs/compta/sociales/payments.php @@ -7,7 +7,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -143,7 +143,7 @@ if ($optioncss != '') { } $num = 0; -print ''; +print ''; if ($optioncss != '') { print ''; } diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index d32f585391d..ff1cd8c6247 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -2,7 +2,7 @@ /* Copyright (C) 2013 Antoine Iauch * Copyright (C) 2013-2016 Laurent Destailleur * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2022 Alexandre Spangaro * Copyright (C) 2024 Charlene Benke * Copyright (C) 2024-2025 MDW @@ -458,7 +458,7 @@ if ($modecompta == 'CREANCES-DETTES') { // Show Array $i = 0; - print ''; + print ''; print ''."\n"; // Extra parameters management foreach ($headerparams as $key => $value) { diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 343a026733e..afca100f00f 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2013 Antoine Iauch - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2022 Alexandre Spangaro * Copyright (C) 2024 MDW * @@ -252,7 +252,7 @@ if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') { $name = array(); // Show array -print ''; +print ''; print ''."\n"; // Extra parameters management foreach ($headerparams as $key => $value) { diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index 5f5257460d6..e157506567c 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -5,7 +5,7 @@ * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2013 Antoine Iauch * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2022 Alexandre Spangaro * Copyright (C) 2024 MDW * @@ -448,7 +448,7 @@ if ($modecompta == "RECETTES-DEPENSES") { // Show array $i = 0; -print ''; +print ''; print ''."\n"; // Extra parameters management foreach ($headerparams as $key => $value) { diff --git a/htdocs/compta/stats/supplier_turnover_by_prodserv.php b/htdocs/compta/stats/supplier_turnover_by_prodserv.php index 66401f051f0..60b7c6dc05c 100644 --- a/htdocs/compta/stats/supplier_turnover_by_prodserv.php +++ b/htdocs/compta/stats/supplier_turnover_by_prodserv.php @@ -1,7 +1,7 @@ * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -382,7 +382,7 @@ if ($modecompta == 'CREANCES-DETTES') { // Show array $i = 0; - print ''; + print ''; print ''."\n"; // Extra parameters management foreach ($headerparams as $key => $value) { diff --git a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php index cf4a17327ba..f6b054857a1 100644 --- a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php +++ b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php @@ -2,7 +2,7 @@ /* Copyright (C) 2020 Maxime Kohlhaas * Copyright (C) 2023 Ferran Marcet * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -412,7 +412,7 @@ if ($resql) { // Show array $i = 0; -print ''; +print ''; print ''."\n"; // Extra parameters management foreach ($headerparams as $key => $value) { diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 98052f8fb0e..ef67efab917 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -6,7 +6,7 @@ * Copyright (C) 2020 Tobias Sekan * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -352,7 +352,7 @@ $massactionbutton = $form->selectMassAction('', $arrayofmassactions); $moreforfilter = ''; -print ''; +print ''; if ($optioncss != '') { print ''; } diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index d343539e114..6e63db36c66 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -664,7 +664,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''."\n"; } - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/contrat/admin/contract_extrafields.php b/htdocs/contrat/admin/contract_extrafields.php index 99106d0d3ee..a92cdcb4ad3 100644 --- a/htdocs/contrat/admin/contract_extrafields.php +++ b/htdocs/contrat/admin/contract_extrafields.php @@ -77,7 +77,7 @@ $help_url = 'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio'; llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-contrat page-admin_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ContractsSetup"), $linkback, 'title_setup'); $head = contract_admin_prepare_head(); diff --git a/htdocs/contrat/admin/contractdet_extrafields.php b/htdocs/contrat/admin/contractdet_extrafields.php index f6018c961b2..00157e00322 100644 --- a/htdocs/contrat/admin/contractdet_extrafields.php +++ b/htdocs/contrat/admin/contractdet_extrafields.php @@ -77,7 +77,7 @@ $help_url = 'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio'; llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-contrat page-admin_extrafields_lines'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ContractsSetup"), $linkback, 'title_setup'); $head = contract_admin_prepare_head(); diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index 9172a02d173..10f95548054 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2017 Ferran Marcet * Copyright (C) 2024 Alexandre Spangaro - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -63,8 +63,8 @@ if (GETPOST('actioncode', 'array')) { $search_rowid = GETPOST('search_rowid'); $search_agenda_label = GETPOST('search_agenda_label'); -$id = GETPOSTINT('id'); -$ref = GETPOST('ref', 'alpha'); +$id = GETPOSTINT('id'); +$ref = GETPOST('ref', 'alpha'); // Security check if ($user->socid) { @@ -198,7 +198,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1); if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) { - $morehtmlref .= ' ('.$langs->trans("OtherContracts").')'; + $morehtmlref .= ' ('.$langs->trans("OtherContracts").')'; } // Project if (isModEnabled('project')) { @@ -207,7 +207,7 @@ if ($object->id > 0) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { @@ -263,12 +263,17 @@ if ($object->id > 0) { if (isModEnabled('agenda')) { if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create')) { $backtopage = $_SERVER['PHP_SELF'].'?id='.$object->id; - $out = '&origin='.$object->element.'&originid='.$object->id.'&backtopage='.urlencode($backtopage); - $messagingUrl = DOL_URL_ROOT.'/contrat/messaging.php?id='.$object->id; + $messagingUrl = dolBuildUrl(DOL_URL_ROOT.'/contrat/messaging.php', ['id' => $object->id]); $newcardbutton .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 1); - $messagingUrl = DOL_URL_ROOT.'/contrat/agenda.php?id='.$object->id; + $messagingUrl = dolBuildUrl(DOL_URL_ROOT.'/contrat/agenda.php', ['id' => $object->id]); $newcardbutton .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2); - $newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); + $query = [ + 'action' => 'create', + 'origin' => $object->element, + 'originid' => $object->id, + 'backtopage' => $backtopage, + ]; + $newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', dolBuildUrl(DOL_URL_ROOT.'/comm/action/card.php', $query)); } } diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index d24fe3012c7..74f82099628 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1500,7 +1500,7 @@ if ($action == 'create') { if ($permissiontoadd) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index ff092d6022d..d011a6489e3 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -190,7 +190,7 @@ if ($id > 0 || !empty($ref)) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 727a308d0ea..cc715d1df00 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -165,7 +165,7 @@ if ($object->id) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/contrat/messaging.php b/htdocs/contrat/messaging.php index 186d4e65108..a3fce41f7a2 100644 --- a/htdocs/contrat/messaging.php +++ b/htdocs/contrat/messaging.php @@ -7,7 +7,7 @@ * Copyright (C) 2010 Juanjo Menent * Copyright (C) 2015 Marcos García * Copyright (C) 2024 Alexandre Spangaro - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -203,7 +203,7 @@ if (isModEnabled('project')) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php index 7f6ff28db74..660ce00eeaa 100644 --- a/htdocs/contrat/note.php +++ b/htdocs/contrat/note.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2017 Ferran Marcet * Copyright (C) 2024 Alexandre Spangaro - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -136,7 +136,7 @@ if ($id > 0 || !empty($ref)) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index 9401154cefa..a9ad73b9daf 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -232,7 +232,7 @@ class box_graph_invoices_permonth extends ModeleBoxes }); '; $stringtoshow .= '
'; // hideobject is to start hidden - $stringtoshow .= ''; + $stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= ''; diff --git a/htdocs/core/boxes/box_graph_invoices_peryear.php b/htdocs/core/boxes/box_graph_invoices_peryear.php index b52fb20adfd..a0d52f5e07a 100644 --- a/htdocs/core/boxes/box_graph_invoices_peryear.php +++ b/htdocs/core/boxes/box_graph_invoices_peryear.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -184,7 +184,7 @@ class box_graph_invoices_peryear extends ModeleBoxes }); '; $stringtoshow .= '
'; // hideobject is to start hidden - $stringtoshow .= ''; + $stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= ''; diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index f3d556b0933..e14635cb27e 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -229,7 +229,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes }); '; $stringtoshow .= '
'; // hideobject is to start hidden - $stringtoshow .= ''; + $stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= ''; diff --git a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php index 55ba0451351..fa0480a18ad 100644 --- a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php +++ b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php @@ -2,7 +2,7 @@ /* Module descriptor for ticket system * Copyright (C) 2013-2016 Jean-François FERRY * Copyright (C) 2016 Christophe Battarel - * Copyright (C) 2019-2024 Frédéric France + * Copyright (C) 2019-2025 Frédéric France * Copyright (C) 2024 MDW * * This program is free software: you can redistribute it and/or modify @@ -146,7 +146,7 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes }); '; $stringtoshow .= '
'; // hideobject is to start hidden - $stringtoshow .= ''; + $stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= ''; diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index 3a3cb66df2d..35618b54d79 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -232,7 +232,7 @@ class box_graph_orders_permonth extends ModeleBoxes }); '; $stringtoshow .= '
'; // hideobject is to start hidden - $stringtoshow .= ''; + $stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= ''; diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index 0f0e9f2df6f..5263cd32039 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -231,7 +231,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes }); '; $stringtoshow .= '
'; // hideobject is to start hidden - $stringtoshow .= ''; + $stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= ''; diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index b7e039b3fed..14e1740e75c 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -355,7 +355,7 @@ class box_graph_product_distribution extends ModeleBoxes }); '; $stringtoshow .= '
'; // hideobject is to start hidden - $stringtoshow .= ''; + $stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= ''; diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index 6948f00912f..de7ef4b2cf2 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -228,7 +228,7 @@ class box_graph_propales_permonth extends ModeleBoxes }); '; $stringtoshow .= '
'; // hideobject is to start hidden - $stringtoshow .= ''; + $stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= ''; diff --git a/htdocs/core/boxes/box_members_by_tags.php b/htdocs/core/boxes/box_members_by_tags.php index 07a9e9962ad..79ec096034e 100644 --- a/htdocs/core/boxes/box_members_by_tags.php +++ b/htdocs/core/boxes/box_members_by_tags.php @@ -2,9 +2,9 @@ /* Copyright (C) 2003-2007 Rodolphe Quiedeville * Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2015-2024 Frédéric France + * Copyright (C) 2015-2025 Frédéric France * Copyright (C) 2021-2023 Waël Almoman - * 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 @@ -151,7 +151,7 @@ class box_members_by_tags extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"', - 'text' => ''.dol_trunc(($adhtag->ref ? $adhtag->ref : $adhtag->label), dol_size(32)).'', + 'text' => ''.dol_trunc(($adhtag->ref ? $adhtag->ref : $adhtag->label), dol_size(32)).'', 'asis' => 1, ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1e275b08f14..b67ce84e023 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -216,7 +216,7 @@ class Form $ret .= '
'; if ($conf->use_javascript_ajax) { - //var_dump($dataseries); $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); // @phan-suppress-current-line PhanTypeMismatchArgument @@ -572,7 +573,7 @@ function getCustomerInvoiceDraftTable($maxCount = 500, $socid = 0) if ($user->socid > 0) { $socid = $user->socid; } - $maxofloop = (!getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD); + $maxofloop = getDolGlobalString('MAIN_MAXLIST_OVERLOAD', 500); $tmpinvoice = new Facture($db); @@ -627,7 +628,7 @@ function getCustomerInvoiceDraftTable($maxCount = 500, $socid = 0) $result .= ''; $result .= ''; @@ -726,7 +727,7 @@ function getDraftSupplierTable($maxCount = 500, $socid = 0) if ($user->socid > 0) { $socid = $user->socid; } - $maxofloop = (!getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD); + $maxofloop = getDolGlobalString('MAIN_MAXLIST_OVERLOAD', 500); $facturesupplierstatic = new FactureFournisseur($db); @@ -764,7 +765,7 @@ function getDraftSupplierTable($maxCount = 500, $socid = 0) $result .= ''; $result .= ''; @@ -1002,7 +1003,7 @@ function getPurchaseInvoiceLatestEditTable($maxCount = 5, $socid = 0) $result .= '
'; } if ($htmlname && GETPOST('action', 'aZ09') != 'edit' . $htmlname && $perm) { - $ret .= ''; + $ret .= ' 'edit' . $htmlname, $paramid => $object->id], true) . $moreparam . '">'; $ret .= img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)); $ret .= ''; } diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 0ddbb5fdf57..2f54fe25b77 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -10,7 +10,7 @@ * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2007 Patrick Raguin * Copyright (C) 2019 Thibault FOUCART - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -1283,7 +1283,7 @@ class FormOther // Class Form must have been already loaded $selectboxlist .= ''."\n"; - $selectboxlist .= ''; + $selectboxlist .= ''; $selectboxlist .= ''; $selectboxlist .= ''; $selectboxlist .= ''; diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php index 9e521d83db2..909a63fbab7 100644 --- a/htdocs/core/lib/accounting.lib.php +++ b/htdocs/core/lib/accounting.lib.php @@ -1,9 +1,9 @@ - * Copyright (C) 2013-2025 Alexandre Spangaro - * Copyright (C) 2014 Florian Henry - * Copyright (C) 2019 Eric Seigne - * Copyright (C) 2021-2024 Frédéric France +/* Copyright (C) 2013-2014 Olivier Geffroy + * Copyright (C) 2013-2025 Alexandre Spangaro + * Copyright (C) 2014 Florian Henry + * Copyright (C) 2019 Eric Seigne + * Copyright (C) 2021-2025 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -57,7 +57,7 @@ function accounting_prepare_head(AccountingAccount $object) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/accountancy/admin/card.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/accountancy/admin/card.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("AccountAccounting"); $head[$h][2] = 'card'; $h++; @@ -110,7 +110,6 @@ function length_accountg($account) if ($i >= 1) { while ($i < $g) { $account .= '0'; - $i++; } @@ -149,7 +148,6 @@ function length_accounta($accounta) if ($i >= 1) { while ($i < $a) { $accounta .= '0'; - $i++; } diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 27d2e86c586..21ebecbec66 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -774,8 +774,9 @@ function modules_prepare_head($nbofactivatedmodules, $nboftotalmodules, $nbmodul $h = 0; $head = array(); + $mode = getDolGlobalString('MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT', 'commonkanban'); - $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$mode; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['mode' => $mode]); if ($nbmodulesnotautoenabled < getDolGlobalInt('MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING', 1)) { // If only minimal initial modules enabled) //$head[$h][1] = $form->textwithpicto($langs->trans("AvailableModules"), $desc); $head[$h][1] = $langs->trans("AvailableModules"); @@ -787,17 +788,17 @@ function modules_prepare_head($nbofactivatedmodules, $nboftotalmodules, $nbmodul $head[$h][2] = 'modules'; $h++; - $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=marketplace"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['mode' => 'marketplace']); $head[$h][1] = $langs->trans("ModulesMarketPlaces"); $head[$h][2] = 'marketplace'; $h++; - $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=deploy"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['mode' => 'deploy']); $head[$h][1] = $langs->trans("AddExtensionThemeModuleOrOther"); $head[$h][2] = 'deploy'; $h++; - $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=develop"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['mode' => 'develop']); $head[$h][1] = $langs->trans("ModulesDevelopYourModule"); $head[$h][2] = 'develop'; $h++; @@ -816,32 +817,32 @@ function ihm_prepare_head() $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT."/admin/ihm.php?mode=other"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/ihm.php', ['mode' => 'other']); $head[$h][1] = $langs->trans("LanguageAndPresentation"); $head[$h][2] = 'other'; $h++; - $head[$h][0] = DOL_URL_ROOT."/admin/ihm.php?mode=template"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/ihm.php', ['mode' => 'template']); $head[$h][1] = $langs->trans("SkinAndColors"); $head[$h][2] = 'template'; $h++; - $head[$h][0] = DOL_URL_ROOT."/admin/ihm.php?mode=dashboard"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/ihm.php', ['mode' => 'dashboard']); $head[$h][1] = $langs->trans("Dashboard"); $head[$h][2] = 'dashboard'; $h++; - $head[$h][0] = DOL_URL_ROOT."/admin/ihm.php?mode=login"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/ihm.php', ['mode' => 'login']); $head[$h][1] = $langs->trans("LoginPage"); $head[$h][2] = 'login'; $h++; - $head[$h][0] = DOL_URL_ROOT."/admin/ihm.php?mode=css"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/ihm.php', ['mode' => 'css']); $head[$h][1] = $langs->trans("CSSPage"); $head[$h][2] = 'css'; $h++; - $head[$h][0] = DOL_URL_ROOT."/admin/tools/ui/index.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/tools/ui/index.php'); $head[$h][1] = $langs->trans("UxComponentsDoc").' '.img_picto('', 'external-link-square-alt'); $head[$h][2] = 'ux'; $h++; @@ -866,44 +867,44 @@ function security_prepare_head() $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT."/admin/security_other.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/security_other.php"); $head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'misc'; $h++; - $head[$h][0] = DOL_URL_ROOT."/admin/security_captcha.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/security_captcha.php"); $head[$h][1] = $langs->trans("Captcha"); $head[$h][2] = 'captcha'; $h++; - $head[$h][0] = DOL_URL_ROOT."/admin/security.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/security.php"); $head[$h][1] = $langs->trans("Passwords"); $head[$h][2] = 'passwords'; $h++; - $head[$h][0] = DOL_URL_ROOT."/admin/security_file.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/security_file.php"); $head[$h][1] = $langs->trans("Files").' ('.$langs->trans("UploadName").' | '.$langs->trans("Download").')'; $head[$h][2] = 'file'; $h++; /* - $head[$h][0] = DOL_URL_ROOT."/admin/security_file_download.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/security_file_download.php"); $head[$h][1] = $langs->trans("Files").' ('.$langs->trans("Download").')'; $head[$h][2] = 'filedownload'; $h++; */ - $head[$h][0] = DOL_URL_ROOT."/admin/proxy.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/proxy.php"); $head[$h][1] = $langs->trans("ExternalAccess"); $head[$h][2] = 'proxy'; $h++; - $head[$h][0] = DOL_URL_ROOT."/admin/events.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/events.php"); $head[$h][1] = $langs->trans("Audit"); $head[$h][2] = 'audit'; $h++; - $head[$h][0] = DOL_URL_ROOT."/admin/openid_connect.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/openid_connect.php"); $head[$h][1] = $langs->trans("OpenIDconnectSetup"); $head[$h][2] = 'openid'; $h++; @@ -930,7 +931,7 @@ function security_prepare_head() } if (getDolGlobalString('MAIN_SECURITY_USE_DEFAULT_PERMISSIONS')) { - $head[$h][0] = DOL_URL_ROOT."/admin/perms.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/perms.php"); $head[$h][1] = $langs->trans("DefaultRights"); if ($nbPerms > 0) { $head[$h][1] .= (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? ''.$nbPerms.'' : ''); @@ -939,7 +940,7 @@ function security_prepare_head() $h++; } - $head[$h][0] = DOL_URL_ROOT."/admin/security_headers_http.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/security_headers_http.php"); $head[$h][1] = $langs->trans("MainHttpSecurityHeaders"); $head[$h][2] = 'headers_http'; $h++; @@ -962,18 +963,18 @@ function modulehelp_prepare_head($object) // FIX for compatibility habitual tabs $object->id = $object->numero; - $head[$h][0] = DOL_URL_ROOT."/admin/modulehelp.php?id=".$object->id.'&mode=desc'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/modulehelp.php', ['id' => $object->id, 'mode' => 'desc']); $head[$h][1] = $langs->trans("Description"); $head[$h][2] = 'desc'; $h++; - $head[$h][0] = DOL_URL_ROOT."/admin/modulehelp.php?id=".$object->id.'&mode=feature'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/modulehelp.php', ['id' => $object->id, 'mode' => 'feature']); $head[$h][1] = $langs->trans("TechnicalServicesProvided"); $head[$h][2] = 'feature'; $h++; if ($object->isCoreOrExternalModule() == 'external') { - $head[$h][0] = DOL_URL_ROOT."/admin/modulehelp.php?id=".$object->id.'&mode=changelog'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/modulehelp.php', ['id' => $object->id, 'mode' => 'changelog']); $head[$h][1] = $langs->trans("ChangeLog"); $head[$h][2] = 'changelog'; $h++; @@ -997,12 +998,12 @@ function translation_prepare_head() $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT."/admin/translation.php?mode=searchkey"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/translation.php', ['mode' => 'searchkey']); $head[$h][1] = $langs->trans("TranslationKeySearch"); $head[$h][2] = 'searchkey'; $h++; - $head[$h][0] = DOL_URL_ROOT."/admin/translation.php?mode=overwrite"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/translation.php', ['mode' => 'overwrite']); $head[$h][1] = ''.$langs->trans("TranslationOverwriteKey").''; $head[$h][2] = 'overwrite'; $h++; diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index c83b8c11eba..c9b89424d59 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -43,12 +43,12 @@ function bank_prepare_head(Account $object) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/compta/bank/card.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/compta/bank/card.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("BankAccount"); $head[$h][2] = 'bankname'; $h++; - $head[$h][0] = DOL_URL_ROOT."/compta/bank/bankentries_list.php?id=".$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/compta/bank/bankentries_list.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("BankTransactions"); $head[$h][2] = 'journal'; $h++; @@ -66,7 +66,15 @@ function bank_prepare_head(Account $object) // If not cash account and can be reconciliate if ($user->hasRight('banque', 'consolidate')) { - $head[$h][0] = DOL_URL_ROOT."/compta/bank/bankentries_list.php?id=".$object->id.'&action=reconcile&sortfield=b.datev,b.dateo,b.rowid&sortorder=asc,asc,asc&search_conciliated=0&search_account='.$object->id.$param; + $query = [ + 'id' => $object->id, + 'action' => 'reconcile', + 'sortfield' => 'b.datev,b.dateo,b.rowid', + 'sortorder' => 'asc,asc,asc', + 'search_conciliated' => 0, + 'search_account' => $object->id, + ]; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/compta/bank/bankentries_list.php', $query).$param; $head[$h][1] = $titletoconciliatemanual; $head[$h][2] = 'reconcile'; $h++; @@ -109,7 +117,7 @@ function bank_prepare_head(Account $object) $db->free($resql); } - $head[$h][0] = DOL_URL_ROOT."/compta/bank/releve.php?account=".((int) $object->id); + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/compta/bank/releve.php', ['account' => $object->id]); $head[$h][1] = $langs->trans("AccountStatements"); if (($nbReceipts) > 0) { $head[$h][1] .= ''.($nbReceipts).''; @@ -124,7 +132,7 @@ function bank_prepare_head(Account $object) $upload_dir = $conf->bank->dir_output."/".dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks = Link::count($db, $object->element, $object->id); - $head[$h][0] = DOL_URL_ROOT."/compta/bank/document.php?account=".$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/compta/bank/document.php', ['account' => $object->id]); $head[$h][1] = $langs->trans("Documents"); if (($nbFiles + $nbLinks) > 0) { $head[$h][1] .= ''.($nbFiles + $nbLinks).''; @@ -132,12 +140,12 @@ function bank_prepare_head(Account $object) $head[$h][2] = 'document'; $h++; - $head[$h][0] = DOL_URL_ROOT."/compta/bank/annuel.php?account=".$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/compta/bank/annuel.php', ['account' => $object->id]); $head[$h][1] = $langs->trans("Reports"); $head[$h][2] = 'annual'; $h++; - $head[$h][0] = DOL_URL_ROOT."/compta/bank/treso.php?account=".$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/compta/bank/treso.php', ['account' => $object->id]); $head[$h][1] = $langs->trans("PlannedTransactions"); $head[$h][2] = 'cash'; $h++; @@ -171,12 +179,12 @@ function bank_report_prepare_head(Account $object) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT."/compta/bank/annuel.php?account=".$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/compta/bank/annuel.php', ['account' => $object->id]); $head[$h][1] = $langs->trans("IOMonthlyReporting"); $head[$h][2] = 'annual'; $h++; - $head[$h][0] = DOL_URL_ROOT."/compta/bank/graph.php?account=".$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/compta/bank/graph.php', ['account' => $object->id]); $head[$h][1] = $langs->trans("Graph"); $head[$h][2] = 'graph'; $h++; @@ -203,12 +211,12 @@ function bank_admin_prepare_head($object) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/admin/bank.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/bank.php'); $head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'general'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/admin/chequereceipts.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/chequereceipts.php'); $head[$h][1] = $langs->trans("CheckReceiptShort"); $head[$h][2] = 'checkreceipts'; $h++; @@ -220,7 +228,7 @@ function bank_admin_prepare_head($object) // $this->tabs = array('entity:-tabname); to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'bank_admin'); - $head[$h][0] = DOL_URL_ROOT.'/admin/bank_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/bank_extrafields.php'); $head[$h][1] = $langs->trans("ExtraFields").' ('.$langs->trans("BankAccounts").')'; $nbExtrafields = $extrafields->attributes['bank_account']['count']; if ($nbExtrafields > 0) { @@ -229,7 +237,7 @@ function bank_admin_prepare_head($object) $head[$h][2] = 'attributes'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/admin/bankline_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/bankline_extrafields.php'); $head[$h][1] = $langs->trans("ExtraFields").' ('.$langs->trans("BankTransactions").')'; $nbExtrafields = $extrafields->attributes['bank']['count']; if ($nbExtrafields > 0) { @@ -238,7 +246,7 @@ function bank_admin_prepare_head($object) $head[$h][2] = 'bankline_extrafields'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/admin/bank_payments_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/bank_payments_extrafields.php'); $head[$h][1] = $langs->trans("ExtraFields").' ('.$langs->trans("Payments").')'; $nbExtrafields = $extrafields->attributes['paiement']['count']; if ($nbExtrafields > 0) { @@ -266,7 +274,7 @@ function account_statement_prepare_head($object, $num) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/compta/bank/releve.php?account='.$object->id.'&num='.$num; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/compta/bank/releve.php', ['account' => $object->id, 'num' => $num]); $head[$h][1] = $langs->trans("AccountStatement"); $head[$h][2] = 'statement'; $h++; @@ -278,7 +286,7 @@ function account_statement_prepare_head($object, $num) $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks = Link::count($db, $object->element, $object->id); - $head[$h][0] = DOL_URL_ROOT."/compta/bank/account_statement_document.php?account=".$object->id."&num=".$num; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/compta/bank/account_statement_document.php', ['account' => $object->id, 'num' => $num]); $head[$h][1] = $langs->trans("Documents"); if (($nbFiles + $nbLinks) > 0) { $head[$h][1] .= ''.($nbFiles + $nbLinks).''; diff --git a/htdocs/core/lib/categories.lib.php b/htdocs/core/lib/categories.lib.php index df41eeebf65..d312df286ea 100644 --- a/htdocs/core/lib/categories.lib.php +++ b/htdocs/core/lib/categories.lib.php @@ -1,7 +1,7 @@ * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -41,18 +41,18 @@ function categories_prepare_head(Categorie $object, $type) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&type='.$type; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/categories/viewcat.php', ['id' => $object->id, 'type' => $type]); $head[$h][1] = $langs->trans("Category"); $head[$h][2] = 'card'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/categories/photos.php?id='.$object->id.'&type='.$type; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/categories/photos.php', ['id' => $object->id, 'type' => $type]); $head[$h][1] = $langs->trans("Photos"); $head[$h][2] = 'photos'; $h++; if (getDolGlobalInt('MAIN_MULTILANGS')) { - $head[$h][0] = DOL_URL_ROOT.'/categories/traduction.php?id='.$object->id.'&type='.$type; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/categories/traduction.php', ['id' => $object->id, 'type' => $type]); $head[$h][1] = $langs->trans("Translation"); $nbTranslations = (!is_null($object->multilangs) && is_countable($object->multilangs)) ? count($object->multilangs) : 0; if ($nbTranslations > 0) { @@ -62,7 +62,7 @@ function categories_prepare_head(Categorie $object, $type) $h++; } - $head[$h][0] = DOL_URL_ROOT.'/categories/info.php?id='.$object->id.'&type='.$type; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/categories/info.php', ['id' => $object->id, 'type' => $type]); $head[$h][1] = $langs->trans("Info"); $head[$h][2] = 'info'; $h++; @@ -96,12 +96,12 @@ function categoriesadmin_prepare_head() $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/categories/admin/categorie.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/categories/admin/categorie.php'); $head[$h][1] = $langs->trans("Setup"); $head[$h][2] = 'setup'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/categories/admin/categorie_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/categories/admin/categorie_extrafields.php'); $head[$h][1] = $langs->trans("ExtraFieldsCategories"); $nbExtrafields = $extrafields->attributes['categorie']['count']; if ($nbExtrafields > 0) { diff --git a/htdocs/core/lib/donation.lib.php b/htdocs/core/lib/donation.lib.php index f08da546f3c..0bccf079dee 100644 --- a/htdocs/core/lib/donation.lib.php +++ b/htdocs/core/lib/donation.lib.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 MDW + * Copyright (C) 2025 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 @@ -37,7 +38,7 @@ function donation_admin_prepare_head() $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/don/admin/donation.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/don/admin/donation.php'); $head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'general'; $h++; @@ -48,7 +49,7 @@ function donation_admin_prepare_head() // $this->tabs = array('entity:-tabname); to remove a tab complete_head_from_modules($conf, $langs, null, $head, $h, 'donation_admin'); - $head[$h][0] = DOL_URL_ROOT.'/don/admin/donation_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/don/admin/donation_extrafields.php'); $head[$h][1] = $langs->trans("ExtraFields"); $nbExtrafields = $extrafields->attributes['don']['count']; if ($nbExtrafields > 0) { @@ -59,7 +60,7 @@ function donation_admin_prepare_head() complete_head_from_modules($conf, $langs, null, $head, $h, 'donation_admin', 'remove'); - $head[$h][0] = DOL_URL_ROOT.'/don/admin/website.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/don/admin/website.php'); $head[$h][1] = $langs->trans("BlankSubscriptionForm"); $head[$h][2] = 'website'; $h++; @@ -82,7 +83,7 @@ function donation_prepare_head($object) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/don/card.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/don/card.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("Donation"); $head[$h][2] = 'card'; $h++; @@ -98,7 +99,7 @@ function donation_prepare_head($object) $upload_dir = $conf->don->dir_output.'/'.dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks = Link::count($db, $object->element, $object->id); - $head[$h][0] = DOL_URL_ROOT.'/don/document.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/don/document.php', ['id' => $object->id]); $head[$h][1] = $langs->trans('Documents'); if (($nbFiles + $nbLinks) > 0) { $head[$h][1] .= ''.($nbFiles + $nbLinks).''; @@ -113,7 +114,7 @@ function donation_prepare_head($object) if (!empty($object->note_public)) { $nbNote++; } - $head[$h][0] = DOL_URL_ROOT.'/don/note.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/don/note.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("Notes"); if ($nbNote > 0) { $head[$h][1] .= ''.$nbNote.''; @@ -121,7 +122,7 @@ function donation_prepare_head($object) $head[$h][2] = 'note'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/don/info.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/don/info.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("Info"); $head[$h][2] = 'info'; $h++; diff --git a/htdocs/core/lib/ecm.lib.php b/htdocs/core/lib/ecm.lib.php index 91fedab9dcb..cafeaa1e659 100644 --- a/htdocs/core/lib/ecm.lib.php +++ b/htdocs/core/lib/ecm.lib.php @@ -1,6 +1,6 @@ - * Copyright (C) 2022-2024 Frédéric France + * Copyright (C) 2022-2025 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -49,20 +49,20 @@ function ecm_prepare_dasboard_head() $helptext .= '
'.$langs->trans("ECMAreaDesc3"); } - $head[$h][0] = DOL_URL_ROOT.'/ecm/index.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/ecm/index.php'); $head[$h][1] = $langs->trans("ECMSectionsManual").$form->textwithpicto('', $helptext, 1, 'info', '', 0, 3); $head[$h][2] = 'index'; $h++; if (!getDolGlobalString('ECM_AUTO_TREE_HIDEN')) { - $head[$h][0] = DOL_URL_ROOT.'/ecm/index_auto.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/ecm/index_auto.php'); $head[$h][1] = $langs->trans("ECMSectionsAuto").$form->textwithpicto('', $helptext, 1, 'info', '', 0, 3); $head[$h][2] = 'index_auto'; $h++; } if ($showmediasection) { - $head[$h][0] = DOL_URL_ROOT.'/ecm/index_medias.php?file_manager=1'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/ecm/index_medias.php', ['file_manager' => 1]); $head[$h][1] = $langs->trans("ECMSectionsMedias").$form->textwithpicto('', $helptext, 1, 'info', '', 0, 3); $head[$h][2] = 'index_medias'; $h++; @@ -95,12 +95,12 @@ function ecm_prepare_head($object, $module = 'ecm', $section = '') $head = array(); if ($module == 'ecm') { - $head[$h][0] = DOL_URL_ROOT.'/ecm/dir_card.php?section='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/ecm/dir_card.php', ['section' => $object->id]); $head[$h][1] = $langs->trans("Directory"); $head[$h][2] = 'card'; $h++; } else { - $head[$h][0] = DOL_URL_ROOT.'/ecm/dir_card.php?section='.$section.'&module='.$module; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/ecm/dir_card.php', ['section' => $section, 'module' => $module]); $head[$h][1] = $langs->trans("Directory"); $head[$h][2] = 'card'; $h++; @@ -121,13 +121,13 @@ function ecm_file_prepare_head($object) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/ecm/file_card.php?section='.$object->section_id.'&urlfile='.urlencode($object->label); + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/ecm/file_card.php', ['section' => $object->section_id, 'urlfile' => $object->label]); $head[$h][1] = $langs->trans("File"); $head[$h][2] = 'card'; $h++; // Notes - $head[$h][0] = DOL_URL_ROOT.'/ecm/file_note.php?section='.$object->section_id.'&urlfile='.urlencode($object->label); + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/ecm/file_note.php', ['section' => $object->section_id, 'urlfile' => $object->label]); $head[$h][1] = $langs->trans("Notes"); $nbNote = 0; if (!empty($object->note_private)) { @@ -157,12 +157,12 @@ function ecm_prepare_head_fm($object) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/ecm/index.php?action=file_manager'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/ecm/index.php?action=file_manager'); $head[$h][1] = $langs->trans('ECMFileManager'); $head[$h][2] = 'file_manager'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/ecm/search.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/ecm/search.php'); $head[$h][1] = $langs->trans('Search'); $head[$h][2] = 'search_form'; $h++; @@ -188,12 +188,12 @@ function ecm_admin_prepare_head() $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT."/admin/ecm.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/ecm.php"); $head[$h][1] = $langs->trans("Setup"); $head[$h][2] = 'ecm'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/admin/ecm_files_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/ecm_files_extrafields.php'); $head[$h][1] = $langs->trans("ExtraFieldsEcmFiles"); $nbExtrafields = $extrafields->attributes['ecm_files']['count']; if ($nbExtrafields > 0) { @@ -202,7 +202,7 @@ function ecm_admin_prepare_head() $head[$h][2] = 'attributes_ecm_files'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/admin/ecm_directories_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/ecm_directories_extrafields.php'); $head[$h][1] = $langs->trans("ExtraFieldsEcmDirectories"); $nbExtrafields = $extrafields->attributes['ecm_directories']['count']; if ($nbExtrafields > 0) { diff --git a/htdocs/core/lib/expedition.lib.php b/htdocs/core/lib/expedition.lib.php index f1d4f142d6c..6043c9027b0 100644 --- a/htdocs/core/lib/expedition.lib.php +++ b/htdocs/core/lib/expedition.lib.php @@ -5,6 +5,7 @@ * Copyright (C) 2010 Juanjo Menent * Copyright (C) 2015 Claudio Aschieri * Copyright (C) 2024-2025 MDW + * Copyright (C) 2025 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 @@ -44,19 +45,19 @@ function expedition_prepare_head(Expedition $object) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT."/admin/confexped.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/confexped.php"); $head[$h][1] = $langs->trans("Setup"); $head[$h][2] = ''; $h++; - $head[$h][0] = DOL_URL_ROOT."/admin/expedition.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/expedition.php"); $head[$h][1] = $langs->trans("Shipment"); $head[$h][2] = ''; $hselected = $h; $h++; if (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY')) { - $head[$h][0] = DOL_URL_ROOT."/admin/delivery.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/delivery.php"); $head[$h][1] = $langs->trans("Receivings"); $head[$h][2] = ''; $h++; @@ -95,12 +96,12 @@ function expedition_admin_prepare_head() $extrafields->fetch_name_optionals_label('expedition'); $extrafields->fetch_name_optionals_label('expeditiondet'); - $head[$h][0] = DOL_URL_ROOT."/admin/expedition.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/expedition.php"); $head[$h][1] = $langs->trans("Shipment"); $head[$h][2] = 'shipment'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/admin/expedition_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/expedition_extrafields.php'); $head[$h][1] = $langs->trans("ExtraFields"); $nbExtrafields = $extrafields->attributes['expedition']['count']; if ($nbExtrafields > 0) { @@ -109,7 +110,7 @@ function expedition_admin_prepare_head() $head[$h][2] = 'attributes_shipment'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/admin/expeditiondet_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/expeditiondet_extrafields.php'); $head[$h][1] = $langs->trans("ExtraFieldsLines"); $nbExtrafields = $extrafields->attributes['expeditiondet']['count']; if ($nbExtrafields > 0) { @@ -119,7 +120,7 @@ function expedition_admin_prepare_head() $h++; } - $head[$h][0] = DOL_URL_ROOT."/admin/delivery.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/delivery.php"); $head[$h][1] = $langs->trans("Receivings"); $head[$h][2] = 'receivings'; $h++; @@ -128,7 +129,7 @@ function expedition_admin_prepare_head() $extrafields->fetch_name_optionals_label('delivery'); $extrafields->fetch_name_optionals_label('deliverydet'); - $head[$h][0] = DOL_URL_ROOT.'/admin/delivery_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/delivery_extrafields.php'); $head[$h][1] = $langs->trans("ExtraFields"); $nbExtrafields = $extrafields->attributes['delivery']['count']; if ($nbExtrafields > 0) { @@ -137,7 +138,7 @@ function expedition_admin_prepare_head() $head[$h][2] = 'attributes_receivings'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/admin/deliverydet_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/deliverydet_extrafields.php'); $head[$h][1] = $langs->trans("ExtraFieldsLines"); $nbExtrafields = $extrafields->attributes['deliverydet']['count']; if ($nbExtrafields > 0) { diff --git a/htdocs/core/lib/expensereport.lib.php b/htdocs/core/lib/expensereport.lib.php index 5be6fe5e71c..071d66c4e1c 100644 --- a/htdocs/core/lib/expensereport.lib.php +++ b/htdocs/core/lib/expensereport.lib.php @@ -36,7 +36,7 @@ function expensereport_prepare_head($object) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/expensereport/card.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/expensereport/card.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("ExpenseReport"); $head[$h][2] = 'card'; $h++; @@ -52,7 +52,7 @@ function expensereport_prepare_head($object) $upload_dir = $conf->expensereport->dir_output."/".dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks = Link::count($db, $object->element, $object->id); - $head[$h][0] = DOL_URL_ROOT.'/expensereport/document.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/expensereport/document.php', ['id' => $object->id]); $head[$h][1] = $langs->trans('Documents'); if (($nbFiles + $nbLinks) > 0) { $head[$h][1] .= ''.($nbFiles + $nbLinks).''; @@ -68,7 +68,7 @@ function expensereport_prepare_head($object) if (!empty($object->note_public)) { $nbNote++; } - $head[$h][0] = DOL_URL_ROOT.'/expensereport/note.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/expensereport/note.php', ['id' => $object->id]); $head[$h][1] = $langs->trans('Notes'); if ($nbNote > 0) { $head[$h][1] .= ''.$nbNote.''; @@ -77,7 +77,7 @@ function expensereport_prepare_head($object) $h++; } - $head[$h][0] = DOL_URL_ROOT.'/expensereport/info.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/expensereport/info.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("Info"); $head[$h][2] = 'info'; $h++; @@ -103,7 +103,7 @@ function payment_expensereport_prepare_head(PaymentExpenseReport $object) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/expensereport/payment/card.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/expensereport/payment/card.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("ExpenseReportPayment"); $head[$h][2] = 'payment'; $h++; @@ -114,7 +114,7 @@ function payment_expensereport_prepare_head(PaymentExpenseReport $object) // $this->tabs = array('entity:-tabname); to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'payment_expensereport'); - $head[$h][0] = DOL_URL_ROOT.'/expensereport/payment/info.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/expensereport/payment/info.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("Info"); $head[$h][2] = 'info'; $h++; @@ -139,18 +139,18 @@ function expensereport_admin_prepare_head() $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT."/admin/expensereport.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/expensereport.php"); $head[$h][1] = $langs->trans("ExpenseReports"); $head[$h][2] = 'expensereport'; $h++; - $head[$h][0] = DOL_URL_ROOT."/admin/expensereport_rules.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/expensereport_rules.php"); $head[$h][1] = $langs->trans("ExpenseReportsRules"); $head[$h][2] = 'expenserules'; $h++; if (getDolGlobalString('MAIN_USE_EXPENSE_IK')) { - $head[$h][0] = DOL_URL_ROOT."/admin/expensereport_ik.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/expensereport_ik.php"); $head[$h][1] = $langs->trans("ExpenseReportsIk"); $head[$h][2] = 'expenseik'; $h++; @@ -162,7 +162,7 @@ function expensereport_admin_prepare_head() // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab complete_head_from_modules($conf, $langs, null, $head, $h, 'expensereport_admin'); - $head[$h][0] = DOL_URL_ROOT.'/admin/expensereport_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/expensereport_extrafields.php'); $head[$h][1] = $langs->trans("ExtraFields"); $nbExtrafields = $extrafields->attributes['expensereport']['count']; if ($nbExtrafields > 0) { @@ -171,13 +171,6 @@ function expensereport_admin_prepare_head() $head[$h][2] = 'attributes'; $h++; - /* - $head[$h][0] = DOL_URL_ROOT.'/fichinter/admin/fichinterdet_extrafields.php'; - $head[$h][1] = $langs->trans("ExtraFieldsLines"); - $head[$h][2] = 'attributesdet'; - $h++; - */ - complete_head_from_modules($conf, $langs, null, $head, $h, 'expensereport_admin', 'remove'); return $head; diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php index 2eeb365cc62..b42ec0d0d31 100644 --- a/htdocs/core/lib/fichinter.lib.php +++ b/htdocs/core/lib/fichinter.lib.php @@ -1,11 +1,11 @@ - * Copyright (C) 2007 Rodolphe Quiedeville - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2016 Gilles Poirier + * Copyright (C) 2007 Rodolphe Quiedeville + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2016 Gilles Poirier * Copyright (C) 2018-2024 Charlene Benke - * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 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 @@ -42,14 +42,14 @@ function fichinter_prepare_head($object) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/fichinter/card.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/fichinter/card.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("Intervention"); $head[$h][2] = 'card'; $h++; if (!getDolGlobalString('MAIN_DISABLE_CONTACTS_TAB')) { $nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external')); - $head[$h][0] = DOL_URL_ROOT.'/fichinter/contact.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/fichinter/contact.php', ['id' => $object->id]); $head[$h][1] = $langs->trans('InterventionContact'); if ($nbContact > 0) { $head[$h][1] .= ''.$nbContact.''; @@ -82,7 +82,7 @@ function fichinter_prepare_head($object) // } // } - $head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=fichinter&element_id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/resource/element_resource.php', ['element' => 'fichinter', 'element_id' => $object->id]); $head[$h][1] = $langs->trans("Resources"); if ($nbResource > 0) { $head[$h][1] .= ''.$nbResource.''; @@ -99,7 +99,7 @@ function fichinter_prepare_head($object) if (!empty($object->note_public)) { $nbNote++; } - $head[$h][0] = DOL_URL_ROOT.'/fichinter/note.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/fichinter/note.php', ['id' => $object->id]); $head[$h][1] = $langs->trans('Notes'); if ($nbNote > 0) { $head[$h][1] .= ''.$nbNote.''; @@ -113,7 +113,7 @@ function fichinter_prepare_head($object) $upload_dir = $conf->ficheinter->dir_output."/".dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks = Link::count($db, $object->element, $object->id); - $head[$h][0] = DOL_URL_ROOT.'/fichinter/document.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/fichinter/document.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("Documents"); if (($nbFiles + $nbLinks) > 0) { $head[$h][1] .= ''.($nbFiles + $nbLinks).''; @@ -121,7 +121,7 @@ function fichinter_prepare_head($object) $head[$h][2] = 'documents'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/fichinter/agenda.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/fichinter/agenda.php', ['id' => $object->id]); $head[$h][1] = $langs->trans('Events'); if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { $nbEvent = 0; @@ -179,12 +179,12 @@ function fichinter_admin_prepare_head() $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT."/admin/fichinter.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/fichinter.php"); $head[$h][1] = $langs->trans("Interventions"); $head[$h][2] = 'ficheinter'; $h++; - $head[$h][0] = DOL_URL_ROOT."/admin/fichinter_xcal.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/fichinter_xcal.php"); $head[$h][1] = $langs->trans("ExportCal"); $head[$h][2] = 'xcal'; $h++; @@ -195,7 +195,7 @@ function fichinter_admin_prepare_head() // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab complete_head_from_modules($conf, $langs, null, $head, $h, 'fichinter_admin'); - $head[$h][0] = DOL_URL_ROOT.'/fichinter/admin/fichinter_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/fichinter/admin/fichinter_extrafields.php'); $head[$h][1] = $langs->trans("ExtraFields"); $nbExtrafields = $extrafields->attributes['fichinter']['count']; if ($nbExtrafields > 0) { @@ -204,7 +204,7 @@ function fichinter_admin_prepare_head() $head[$h][2] = 'attributes'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/fichinter/admin/fichinterdet_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/fichinter/admin/fichinterdet_extrafields.php'); $head[$h][1] = $langs->trans("ExtraFieldsLines"); $nbExtrafields = $extrafields->attributes['fichinterdet']['count']; if ($nbExtrafields > 0) { @@ -231,7 +231,7 @@ function fichinter_rec_prepare_head($object) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/fichinter/card-rec.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/fichinter/card-rec.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("InterventionCard"); $head[$h][2] = 'card'; $h++; diff --git a/htdocs/core/lib/fiscalyear.lib.php b/htdocs/core/lib/fiscalyear.lib.php index c995dcc1693..01667294c5a 100644 --- a/htdocs/core/lib/fiscalyear.lib.php +++ b/htdocs/core/lib/fiscalyear.lib.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 MDW + * Copyright (C) 2025 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 @@ -35,7 +36,7 @@ function fiscalyear_prepare_head(Fiscalyear $object) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/accountancy/admin/fiscalyear_card.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/accountancy/admin/fiscalyear_card.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("FiscalPeriod"); $head[$h][2] = 'card'; $h++; @@ -46,7 +47,7 @@ function fiscalyear_prepare_head(Fiscalyear $object) // $this->tabs = array('entity:-tabname); to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'fiscalyear'); - $head[$h][0] = DOL_URL_ROOT.'/accountancy/admin/fiscalyear_info.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/accountancy/admin/fiscalyear_info.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("Info"); $head[$h][2] = 'info'; $h++; diff --git a/htdocs/core/lib/fourn.lib.php b/htdocs/core/lib/fourn.lib.php index da19ff1cf44..d7c484dbf79 100644 --- a/htdocs/core/lib/fourn.lib.php +++ b/htdocs/core/lib/fourn.lib.php @@ -300,24 +300,24 @@ function supplierorder_admin_prepare_head() $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT."/admin/supplier_order.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/supplier_order.php"); $head[$h][1] = $langs->trans("SupplierOrder"); $head[$h][2] = 'order'; $h++; - $head[$h][0] = DOL_URL_ROOT."/admin/supplier_invoice.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/supplier_invoice.php"); $head[$h][1] = $langs->trans("SuppliersInvoice"); $head[$h][2] = 'invoice'; $h++; - $head[$h][0] = DOL_URL_ROOT."/admin/supplier_payment.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/admin/supplier_payment.php"); $head[$h][1] = $langs->trans("SuppliersPayment"); $head[$h][2] = 'supplierpayment'; $h++; complete_head_from_modules($conf, $langs, null, $head, $h, 'supplierorder_admin'); - $head[$h][0] = DOL_URL_ROOT.'/admin/supplierorder_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/supplierorder_extrafields.php'); $head[$h][1] = $langs->trans("ExtraFieldsSupplierOrders"); $nbExtrafields = $extrafields->attributes['commande_fournisseur']['count']; if ($nbExtrafields > 0) { @@ -326,7 +326,7 @@ function supplierorder_admin_prepare_head() $head[$h][2] = 'supplierorder'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/admin/supplierorderdet_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/supplierorderdet_extrafields.php'); $head[$h][1] = $langs->trans("ExtraFieldsSupplierOrdersLines"); $nbExtrafields = $extrafields->attributes['commande_fournisseurdet']['count']; if ($nbExtrafields > 0) { @@ -335,7 +335,7 @@ function supplierorder_admin_prepare_head() $head[$h][2] = 'supplierorderdet'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/admin/supplierinvoice_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/supplierinvoice_extrafields.php'); $head[$h][1] = $langs->trans("ExtraFieldsSupplierInvoices"); $nbExtrafields = $extrafields->attributes['facture_fourn']['count']; if ($nbExtrafields > 0) { @@ -344,7 +344,7 @@ function supplierorder_admin_prepare_head() $head[$h][2] = 'supplierinvoice'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/admin/supplierinvoicedet_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/supplierinvoicedet_extrafields.php'); $head[$h][1] = $langs->trans("ExtraFieldsSupplierInvoicesLines"); $nbExtrafields = $extrafields->attributes['facture_fourn_det']['count']; if ($nbExtrafields > 0) { @@ -353,7 +353,7 @@ function supplierorder_admin_prepare_head() $head[$h][2] = 'supplierinvoicedet'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/admin/supplierinvoice_rec_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/supplierinvoice_rec_extrafields.php'); $head[$h][1] = $langs->trans("ExtraFieldsSupplierInvoicesRec"); $nbExtrafields = $extrafields->attributes['facture_fourn_rec']['count']; if ($nbExtrafields > 0) { @@ -362,7 +362,7 @@ function supplierorder_admin_prepare_head() $head[$h][2] = 'attributesrec'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/admin/supplierinvoicedet_rec_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/supplierinvoicedet_rec_extrafields.php'); $head[$h][1] = $langs->trans("ExtraFieldsSupplierInvoicesLinesRec"); $nbExtrafields = $extrafields->attributes['facture_fourn_det_rec']['count']; if ($nbExtrafields > 0) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index ebb2580f3b5..7373cc7e1dc 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1674,7 +1674,9 @@ function dolBuildUrl($url, $params = [], $addtoken = false) $params = array_merge($params, ['token' => newToken()]); } // TODO TO REMOVE - $params = array_merge($params, ['debug' => 'debug']); + if (getDolGlobalString('MAIN_DEBUG_DOL_BUILDURL')) { + $params = array_merge($params, ['debug' => 'debug']); + } if ($params) { $url .= '?' . http_build_query($params); } @@ -12367,7 +12369,9 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $url = preg_replace('/__ID__/i', ((is_object($object) && !empty($object->id)) ? $object->id : ''), $values[5]); $link = parse_url($url); $query = []; - parse_str($link['query'], $query); + if (isset($link['query'])) { + parse_str($link['query'], $query); + } $newtab[0] = dolBuildUrl(dol_buildpath($link['path'], 1), $query); $newtab[1] = $label; $newtab[2] = str_replace('+', '', $values[1]); diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 56602e91f0a..c545f33e9a6 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -42,14 +42,14 @@ function facture_prepare_head($object) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/card.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/compta/facture/card.php', ['id' => $object->id]); $head[$h][1] = $langs->trans('CustomerInvoice'); $head[$h][2] = 'compta'; $h++; if (!getDolGlobalString('MAIN_DISABLE_CONTACTS_TAB')) { $nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external')); - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/contact.php?id='.urlencode((string) ($object->id)); + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/compta/facture/contact.php', ['id' => $object->id]); $head[$h][1] = $langs->trans('ContactsAddresses'); if ($nbContact > 0) { $head[$h][1] .= ''.$nbContact.''; @@ -75,7 +75,7 @@ function facture_prepare_head($object) } $langs->load("banks"); - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?id='.urlencode((string) ($object->id)); + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/compta/facture/prelevement.php', ['id' => $object->id]); $head[$h][1] = $langs->trans('StandingOrders'); if ($nbStandingOrders > 0) { $head[$h][1] .= ''.$nbStandingOrders.''; @@ -98,7 +98,7 @@ function facture_prepare_head($object) if (!empty($object->note_public)) { $nbNote++; } - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/compta/facture/note.php', ['id' => $object->id]); $head[$h][1] = $langs->trans('Notes'); if ($nbNote > 0) { $head[$h][1] .= ''.$nbNote.''; @@ -112,7 +112,7 @@ function facture_prepare_head($object) $upload_dir = $conf->facture->dir_output."/".dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks = Link::count($db, $object->element, $object->id); - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/document.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/compta/facture/document.php', ['id' => $object->id]); $head[$h][1] = $langs->trans('Documents'); if (($nbFiles + $nbLinks) > 0) { $head[$h][1] .= ''.($nbFiles + $nbLinks).''; @@ -120,7 +120,7 @@ function facture_prepare_head($object) $head[$h][2] = 'documents'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/agenda.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/compta/facture/agenda.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("Events"); if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { $nbEvent = 0; @@ -179,12 +179,12 @@ function invoice_admin_prepare_head() $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/admin/invoice.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/invoice.php'); $head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'general'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/admin/payment.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/payment.php'); $head[$h][1] = $langs->trans("Payments"); $head[$h][2] = 'payment'; $h++; @@ -195,7 +195,7 @@ function invoice_admin_prepare_head() // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab complete_head_from_modules($conf, $langs, null, $head, $h, 'invoice_admin'); - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/invoice_cust_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/compta/facture/admin/invoice_cust_extrafields.php'); $head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoices"); $nbExtrafields = $extrafields->attributes['facture']['count']; if ($nbExtrafields > 0) { @@ -204,7 +204,7 @@ function invoice_admin_prepare_head() $head[$h][2] = 'attributes'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/invoicedet_cust_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/compta/facture/admin/invoicedet_cust_extrafields.php'); $head[$h][1] = $langs->trans("ExtraFieldsLines"); $nbExtrafields = $extrafields->attributes['facturedet']['count']; if ($nbExtrafields > 0) { @@ -213,7 +213,7 @@ function invoice_admin_prepare_head() $head[$h][2] = 'attributeslines'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/invoice_rec_cust_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/compta/facture/admin/invoice_rec_cust_extrafields.php'); $head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoicesRec"); $nbExtrafields = $extrafields->attributes['facture_rec']['count']; if ($nbExtrafields > 0) { @@ -222,7 +222,7 @@ function invoice_admin_prepare_head() $head[$h][2] = 'attributesrec'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/invoicedet_rec_cust_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/compta/facture/admin/invoicedet_rec_cust_extrafields.php'); $head[$h][1] = $langs->trans("ExtraFieldsLinesRec"); $nbExtrafields = $extrafields->attributes['facturedet_rec']['count']; if ($nbExtrafields > 0) { @@ -232,7 +232,7 @@ function invoice_admin_prepare_head() $h++; if (getDolGlobalInt('INVOICE_USE_SITUATION') > 0) { // Warning, implementation with value 1 is seriously bugged and a new one not compatible is expected to become stable - $head[$h][0] = DOL_URL_ROOT.'/admin/invoice_situation.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/invoice_situation.php'); $head[$h][1] = $langs->trans("InvoiceSituation"); $head[$h][2] = 'situation'; $h++; @@ -257,12 +257,12 @@ function invoice_rec_prepare_head($object) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT . '/compta/facture/card-rec.php?id=' . $object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT . '/compta/facture/card-rec.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("RepeatableInvoice"); $head[$h][2] = 'card'; $h++; - $head[$h][0] = DOL_URL_ROOT . '/compta/facture/list.php?search_fk_fac_rec_source=' . $object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT . '/compta/facture/list.php', ['search_fk_fac_rec_source' => $object->id]); $head[$h][1] = $langs->trans('InvoicesGeneratedFromRec'); //count facture rec $nbFacture = 0; @@ -290,7 +290,7 @@ function invoice_rec_prepare_head($object) if (!empty($object->note_public)) { $nbNote++; } - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/note-rec.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/compta/facture/note-rec.php', ['id' => $object->id]); $head[$h][1] = $langs->trans('Notes'); if ($nbNote > 0) { $head[$h][1] .= ''.$nbNote.''; @@ -299,7 +299,7 @@ function invoice_rec_prepare_head($object) $h++; } - $head[$h][0] = DOL_URL_ROOT.'/compta/facture/agenda-rec.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/compta/facture/agenda-rec.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("Events"); if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { $nbEvent = 0; @@ -357,7 +357,7 @@ function supplier_invoice_rec_prepare_head($object) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT . '/fourn/facture/card-rec.php?id=' . $object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT . '/fourn/facture/card-rec.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("RepeatableSupplierInvoice"); $head[$h][2] = 'card'; $h++; @@ -370,7 +370,7 @@ function supplier_invoice_rec_prepare_head($object) if (!empty($object->note_public)) { $nbNote++; } - $head[$h][0] = DOL_URL_ROOT.'/fourn/facture/note-rec.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/fourn/facture/note-rec.php', ['id' => $object->id]); $head[$h][1] = $langs->trans('Notes'); if ($nbNote > 0) { $head[$h][1] .= ''.$nbNote.''; @@ -378,7 +378,7 @@ function supplier_invoice_rec_prepare_head($object) $head[$h][2] = 'note'; $h++; } - $head[$h][0] = DOL_URL_ROOT . '/fourn/facture/list.php?search_fk_fac_rec_source=' . $object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT . '/fourn/facture/list.php', ['search_fk_fac_rec_source' => $object->id]); $head[$h][1] = $langs->trans('InvoicesGeneratedFromRec'); //count facture rec @@ -473,12 +473,14 @@ function getNumberInvoicesPieChart($mode) while ($i < $num) { $obj = $db->fetch_object($resql); /* - $dataseries = array(array($langs->trans('InvoiceLate30Days'), $obj->nblate30) - ,array($langs->trans('InvoiceLate15Days'), $obj->nblate15 - $obj->nblate30) - ,array($langs->trans('InvoiceLateMinus15Days'), $obj->nblatenow - $obj->nblate15) - ,array($langs->trans('InvoiceNotLate'), $obj->nbnotlatenow - $obj->nbnotlate15) - ,array($langs->trans('InvoiceNotLate15Days'), $obj->nbnotlate15 - $obj->nbnotlate30) - ,array($langs->trans('InvoiceNotLate30Days'), $obj->nbnotlate30)); + $dataseries = array( + array($langs->trans('InvoiceLate30Days'), $obj->nblate30), + array($langs->trans('InvoiceLate15Days'), $obj->nblate15 - $obj->nblate30), + array($langs->trans('InvoiceLateMinus15Days'), $obj->nblatenow - $obj->nblate15), + array($langs->trans('InvoiceNotLate'), $obj->nbnotlatenow - $obj->nbnotlate15), + array($langs->trans('InvoiceNotLate15Days'), $obj->nbnotlate15 - $obj->nbnotlate30), + array($langs->trans('InvoiceNotLate30Days'), $obj->nbnotlate30), + ); */ $dataseries[$i] = array($langs->transnoentitiesnoconv('NbOfOpenInvoices'), $obj->late30, $obj->late15, $obj->latenow, $obj->notlatenow, $obj->notlate15, $obj->notlate30); $i++; @@ -516,7 +518,6 @@ function getNumberInvoicesPieChart($mode) $result .= '
'; $result .= $langs->trans("CustomersDraftInvoices"); - $result .= ''; + $result .= ''; $result .= ''.$num.''; $result .= ''; $result .= '
'; $result .= $langs->trans("SuppliersDraftInvoices"); - $result .= ''; + $result .= ''; $result .= ''.$num.''; $result .= ''; $result .= '
'; $result .= ''; $result .= ''; @@ -1328,7 +1329,7 @@ function getPurchaseInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0) print ''; print ''; diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index d89214b20aa..70a7029982d 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -55,14 +55,14 @@ function product_prepare_head($object) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT."/product/card.php?id=".$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/product/card.php', ['id' => $object->id]); $head[$h][1] = $label; $head[$h][2] = 'card'; $h++; // if (!empty($object->status)) { if ($usercancreadprice) { - $head[$h][0] = DOL_URL_ROOT."/product/price.php?id=".$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/product/price.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("SellingPrices"); $head[$h][2] = 'price'; $h++; @@ -80,7 +80,7 @@ function product_prepare_head($object) || (isModEnabled('margin') && $user->hasRight("margin", "liretous")) ) { if ($usercancreadsupplierprice) { - $head[$h][0] = DOL_URL_ROOT."/product/price_suppliers.php?id=".$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/product/price_suppliers.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("BuyingPrices"); $head[$h][2] = 'suppliers'; $h++; @@ -96,7 +96,7 @@ function product_prepare_head($object) // Multilangs if (getDolGlobalInt('MAIN_MULTILANGS')) { - $head[$h][0] = DOL_URL_ROOT."/product/traduction.php?id=".$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/product/traduction.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("Translations"); $nbTranslations = !empty($object->multilangs) ? count($object->multilangs) : 0; if ($nbTranslations > 0) { @@ -108,7 +108,7 @@ function product_prepare_head($object) // Sub products if (getDolGlobalString('PRODUIT_SOUSPRODUITS')) { - $head[$h][0] = DOL_URL_ROOT."/product/composition/card.php?id=".$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/product/composition/card.php', ['id' => $object->id]); $head[$h][1] = $langs->trans('AssociatedProducts'); $nbFatherAndChild = $object->hasFatherOrChild(); @@ -127,7 +127,7 @@ function product_prepare_head($object) $prodcomb = new ProductCombination($db); if ($prodcomb->fetchByFkProductChild($object->id) <= 0) { - $head[$h][0] = DOL_URL_ROOT."/variants/combinations.php?id=".$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/variants/combinations.php', ['id' => $object->id]); $head[$h][1] = $langs->trans('ProductCombinations'); $head[$h][2] = 'combinations'; $nbVariant = $prodcomb->countNbOfCombinationForFkProductParent($object->id); @@ -141,7 +141,7 @@ function product_prepare_head($object) if (($object->isProduct() || ($object->isService() && getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) && $object->stockable_product == Product::ENABLED_STOCK) { // If physical product we can stock (or service with option) if (isModEnabled('stock') && $user->hasRight('stock', 'lire')) { - $head[$h][0] = DOL_URL_ROOT."/product/stock/product.php?id=".$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/product/stock/product.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("Stock"); $head[$h][2] = 'stock'; $h++; @@ -151,25 +151,25 @@ function product_prepare_head($object) // Tab to link resources if (isModEnabled('resource')) { if ($object->isProduct() && getDolGlobalString('RESOURCE_ON_PRODUCTS')) { - $head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=product&element_id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/resource/element_resource.php', ['element' => 'product', 'element_id' => $object->id]); $head[$h][1] = $langs->trans("Resources"); $head[$h][2] = 'resources'; $h++; } if ($object->isService() && getDolGlobalString('RESOURCE_ON_SERVICES')) { - $head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=service&element_id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/resource/element_resource.php', ['element' => 'service', 'element_id' => $object->id]); $head[$h][1] = $langs->trans("Resources"); $head[$h][2] = 'resources'; $h++; } } - $head[$h][0] = DOL_URL_ROOT."/product/stats/facture.php?showmessage=1&id=".$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/product/stats/facture.php', ['showmessage' => 1, 'id' => $object->id]); $head[$h][1] = $langs->trans('Referers'); $head[$h][2] = 'referers'; $h++; - $head[$h][0] = DOL_URL_ROOT."/product/stats/card.php?id=".$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/product/stats/card.php', ['id' => $object->id]); $head[$h][1] = $langs->trans('Statistics'); $head[$h][2] = 'stats'; $h++; @@ -189,7 +189,7 @@ function product_prepare_head($object) if (!empty($object->note_public)) { $nbNote++; } - $head[$h][0] = DOL_URL_ROOT.'/product/note.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/product/note.php', ['id' => $object->id]); $head[$h][1] = $langs->trans('Notes'); if ($nbNote > 0) { $head[$h][1] .= ''.$nbNote.''; @@ -224,7 +224,7 @@ function product_prepare_head($object) } } $nbLinks = Link::count($db, $object->element, $object->id); - $head[$h][0] = DOL_URL_ROOT.'/product/document.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/product/document.php', ['id' => $object->id]); $head[$h][1] = $langs->trans('Documents'); if (($nbFiles + $nbLinks) > 0) { $head[$h][1] .= ''.($nbFiles + $nbLinks).''; @@ -233,7 +233,7 @@ function product_prepare_head($object) $h++; // Log - $head[$h][0] = DOL_URL_ROOT.'/product/messaging.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/product/messaging.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("Events"); if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { $head[$h][1] .= '/'; @@ -265,12 +265,12 @@ function productlot_prepare_head($object) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT."/product/stock/productlot_card.php?id=".$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/product/stock/productlot_card.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("Lot"); $head[$h][2] = 'card'; $h++; - $head[$h][0] = DOL_URL_ROOT."/product/stock/stats/expedition.php?showmessage=1&id=".$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/product/stock/stats/expedition.php', ['showmessage' => 1, 'id' => $object->id]); $head[$h][1] = $langs->trans('Referers'); $head[$h][2] = 'referers'; $h++; @@ -281,7 +281,7 @@ function productlot_prepare_head($object) $upload_dir = $conf->productbatch->multidir_output[$object->entity ?? $conf->entity].'/'.dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks = Link::count($db, $object->element, $object->id); - $head[$h][0] = DOL_URL_ROOT."/product/stock/productlot_document.php?id=".$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/product/stock/productlot_document.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("Documents"); if (($nbFiles + $nbLinks) > 0) { $head[$h][1] .= ''.($nbFiles + $nbLinks).''; @@ -298,7 +298,7 @@ function productlot_prepare_head($object) if (!empty($object->note_public)) { $nbNote++; } - $head[$h][0] = DOL_URL_ROOT .'/product/stock/productlot_note.php?id=' . $object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT .'/product/stock/productlot_note.php', ['id' => $object->id]); $head[$h][1] = $langs->trans('Notes'); if ($nbNote > 0) { $head[$h][1] .= '' . $nbNote . ''; @@ -317,7 +317,7 @@ function productlot_prepare_head($object) // Log /* - $head[$h][0] = DOL_URL_ROOT.'/product/info.php?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT.'/product/info.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("Info"); $head[$h][2] = 'info'; $h++; @@ -346,14 +346,14 @@ function product_admin_prepare_head() $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT."/product/admin/product.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/product/admin/product.php"); $head[$h][1] = $langs->trans('Parameters'); $head[$h][2] = 'general'; $h++; if (getDolGlobalString('PRODUIT_MULTIPRICES') && getDolGlobalString('PRODUIT_MULTIPRICES_ALLOW_AUTOCALC_PRICELEVEL')) { $head[$h] = array( - 0 => DOL_URL_ROOT."/product/admin/price_rules.php", + 0 => dolBuildUrl(DOL_URL_ROOT."/product/admin/price_rules.php"), 1 => $langs->trans('MultipriceRules'), 2 => 'generator' ); @@ -366,7 +366,7 @@ function product_admin_prepare_head() // $this->tabs = array('entity:-tabname); to remove a tab complete_head_from_modules($conf, $langs, null, $head, $h, 'product_admin'); - $head[$h][0] = DOL_URL_ROOT.'/product/admin/product_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/product/admin/product_extrafields.php'); $head[$h][1] = $langs->trans("ExtraFields"); $nbExtrafields = isset($extrafields->attributes['product']['count']) ? $extrafields->attributes['product']['count'] : 0; if ($nbExtrafields > 0) { @@ -377,7 +377,7 @@ function product_admin_prepare_head() // Extrafields for price levels if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { - $head[$h][0] = DOL_URL_ROOT.'/product/admin/product_price_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/product/admin/product_price_extrafields.php'); $head[$h][1] = $langs->trans("ProductLevelExtraFields"); $nbExtrafields = isset($extrafields->attributes['product_price']['count']) ? $extrafields->attributes['product_price']['count'] : 0; if ($nbExtrafields > 0) { @@ -389,7 +389,7 @@ function product_admin_prepare_head() //Extrafields for price per customer if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { - $head[$h][0] = DOL_URL_ROOT.'/product/admin/product_customer_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/product/admin/product_customer_extrafields.php'); $head[$h][1] = $langs->trans("ProductCustomerExtraFields"); $nbExtrafields = isset($extrafields->attributes['product_customer_price']['count']) ? $extrafields->attributes['product_customer_price']['count'] : 0; if ($nbExtrafields > 0) { @@ -400,7 +400,7 @@ function product_admin_prepare_head() } // Supplier prices - $head[$h][0] = DOL_URL_ROOT.'/product/admin/product_supplier_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/product/admin/product_supplier_extrafields.php'); $head[$h][1] = $langs->trans("ProductSupplierExtraFields"); $nbExtrafields = isset($extrafields->attributes['product_fournisseur_price']['count']) ? $extrafields->attributes['product_fournisseur_price']['count'] : 0; if ($nbExtrafields > 0) { @@ -431,7 +431,7 @@ function product_lot_admin_prepare_head() $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT."/product/admin/product_lot.php"; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT."/product/admin/product_lot.php"); $head[$h][1] = $langs->trans('Parameters'); $head[$h][2] = 'settings'; $h++; @@ -442,7 +442,7 @@ function product_lot_admin_prepare_head() // $this->tabs = array('entity:-tabname); to remove a tab complete_head_from_modules($conf, $langs, null, $head, $h, 'product_lot_admin'); - $head[$h][0] = DOL_URL_ROOT.'/product/admin/product_lot_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/product/admin/product_lot_extrafields.php'); $head[$h][1] = $langs->trans("ExtraFields"); $nbExtrafields = $extrafields->attributes['product_lot']['count']; if ($nbExtrafields > 0) { @@ -489,7 +489,7 @@ function show_stats_for_company($product, $socid) } $langs->load("propal"); print ''; @@ -2903,7 +2903,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks if (getDolGlobalString('PROJECT_LIMIT_YEAR_RANGE')) { //Add the year filter input - print ''; + print ''; print '
'.$langs->trans("BoxTitleLastSupplierBills", $maxCount).' '; - $result .= ''; + $result .= ''; $result .= '...'; $result .= ''; $result .= '
'; print $langs->trans("BillsSuppliersUnpaid", $num).' '; - print ''; + print ''; print ''.$num.''; print ''; print '
'; - print ''.img_object('', 'propal', 'class="pictofixedwidth"').$langs->trans("Proposals").''; + print ''.img_object('', 'propal', 'class="pictofixedwidth"').$langs->trans("Proposals").''; print ''; print $product->stats_propale['customers']; print ''; @@ -508,7 +508,7 @@ function show_stats_for_company($product, $socid) } $langs->load("supplier_proposal"); print '
'; - print ''.img_object('', 'supplier_proposal', 'class="pictofixedwidth"').$langs->trans("SupplierProposals").''; + print ''.img_object('', 'supplier_proposal', 'class="pictofixedwidth"').$langs->trans("SupplierProposals").''; print ''; print $product->stats_proposal_supplier['suppliers']; print ''; @@ -527,7 +527,7 @@ function show_stats_for_company($product, $socid) } $langs->load("orders"); print '
'; - print ''.img_object('', 'order', 'class="pictofixedwidth"').$langs->trans("CustomersOrders").''; + print ''.img_object('', 'order', 'class="pictofixedwidth"').$langs->trans("CustomersOrders").''; print ''; print $product->stats_commande['customers']; print ''; @@ -546,7 +546,7 @@ function show_stats_for_company($product, $socid) } $langs->load("orders"); print '
'; - print ''.img_object('', 'supplier_order', 'class="pictofixedwidth"').$langs->trans("SuppliersOrders").''; + print ''.img_object('', 'supplier_order', 'class="pictofixedwidth"').$langs->trans("SuppliersOrders").''; print ''; print $product->stats_commande_fournisseur['suppliers']; print ''; @@ -565,7 +565,7 @@ function show_stats_for_company($product, $socid) } $langs->load("bills"); print '
'; - print ''.img_object('', 'bill', 'class="pictofixedwidth"').$langs->trans("CustomersInvoices").''; + print ''.img_object('', 'bill', 'class="pictofixedwidth"').$langs->trans("CustomersInvoices").''; print ''; print $product->stats_facture['customers']; print ''; @@ -584,7 +584,7 @@ function show_stats_for_company($product, $socid) } $langs->load("bills"); print '
'; - print ''.img_object('', 'bill', 'class="pictofixedwidth"').$langs->trans("RecurringInvoiceTemplate").''; + print ''.img_object('', 'bill', 'class="pictofixedwidth"').$langs->trans("RecurringInvoiceTemplate").''; print ''; print $product->stats_facturerec['customers']; print ''; @@ -603,7 +603,7 @@ function show_stats_for_company($product, $socid) } $langs->load("bills"); print '
'; - print ''.img_object('', 'supplier_invoice', 'class="pictofixedwidth"').$langs->trans("SuppliersInvoices").''; + print ''.img_object('', 'supplier_invoice', 'class="pictofixedwidth"').$langs->trans("SuppliersInvoices").''; print ''; print $product->stats_facture_fournisseur['suppliers']; print ''; @@ -623,7 +623,7 @@ function show_stats_for_company($product, $socid) } $langs->load("bills"); print '
'; - print ''.img_object('', 'bill', 'class="pictofixedwidth"').$langs->trans("RecurringInvoiceTemplate").''; + print ''.img_object('', 'bill', 'class="pictofixedwidth"').$langs->trans("RecurringInvoiceTemplate").''; print ''; print $product->stats_facturefournrec['customers']; print ''; @@ -644,7 +644,7 @@ function show_stats_for_company($product, $socid) } $langs->load("sendings"); print '
'; - print ''.img_object('', 'shipment', 'class="pictofixedwidth"').$langs->trans("Shipments").''; + print ''.img_object('', 'shipment', 'class="pictofixedwidth"').$langs->trans("Shipments").''; print ''; print $product->stats_expedition['customers']; print ''; @@ -664,7 +664,7 @@ function show_stats_for_company($product, $socid) } $langs->load("receptions"); print '
'; - print ''.img_object('', 'reception', 'class="pictofixedwidth"').$langs->trans("Receptions").''; + print ''.img_object('', 'reception', 'class="pictofixedwidth"').$langs->trans("Receptions").''; print ''; print $product->stats_reception['suppliers']; print ''; @@ -684,7 +684,7 @@ function show_stats_for_company($product, $socid) } $langs->load("contracts"); print '
'; - print ''.img_object('', 'contract', 'class="pictofixedwidth"').$langs->trans("Contracts").''; + print ''.img_object('', 'contract', 'class="pictofixedwidth"').$langs->trans("Contracts").''; print ''; print $product->stats_contrat['customers']; print ''; @@ -705,7 +705,7 @@ function show_stats_for_company($product, $socid) $langs->load("mrp"); print '
'; - print ''.img_object('', 'bom', 'class="pictofixedwidth"').$langs->trans("BOM").''; + print ''.img_object('', 'bom', 'class="pictofixedwidth"').$langs->trans("BOM").''; print ''; print ''; @@ -729,7 +729,7 @@ function show_stats_for_company($product, $socid) } $langs->load("mrp"); print '
'; - print ''.img_object('', 'mrp', 'class="pictofixedwidth"').$langs->trans("MO").''; + print ''.img_object('', 'mrp', 'class="pictofixedwidth"').$langs->trans("MO").''; print ''; print $form->textwithpicto((string) $product->stats_mo['customers_toconsume'], $langs->trans("ToConsume")); print ' '; @@ -802,7 +802,7 @@ function show_stats_for_batch($batch, $socid) } $langs->load("bills"); print '
'; - print ''.img_object('', 'bill', 'class="pictofixedwidth"').$langs->trans("Shipments").''; + print ''.img_object('', 'bill', 'class="pictofixedwidth"').$langs->trans("Shipments").''; print ''; print $batch->stats_expedition['customers']; print ''; @@ -821,7 +821,7 @@ function show_stats_for_batch($batch, $socid) } $langs->load("bills"); print '
'; - print ''.img_object('', 'bill', 'class="pictofixedwidth"').$langs->trans("Receptions").''; + print ''.img_object('', 'bill', 'class="pictofixedwidth"').$langs->trans("Receptions").''; print ''; print $batch->stats_reception['customers']; print ''; @@ -838,7 +838,7 @@ function show_stats_for_batch($batch, $socid) } $langs->load("bills"); print '
'; - print ''.img_object('', 'bill', 'class="pictofixedwidth"').$langs->trans("SuppliersOrders").''; + print ''.img_object('', 'bill', 'class="pictofixedwidth"').$langs->trans("SuppliersOrders").''; print ''; print $batch->stats_supplier_order['customers']; print ''; @@ -857,7 +857,7 @@ function show_stats_for_batch($batch, $socid) } $langs->load("mrp"); print '
'; - print ''.img_object('', 'mrp', 'class="pictofixedwidth"').$langs->trans("MO").''; + print ''.img_object('', 'mrp', 'class="pictofixedwidth"').$langs->trans("MO").''; print ''; // print $form->textwithpicto($batch->stats_mo['customers_toconsume'], $langs->trans("ToConsume")); Makes no sense with batch, at this moment we don't know batch number print $form->textwithpicto((string) $batch->stats_mo['customers_consumed'], $langs->trans("QtyAlreadyConsumed")); diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 7b038a7f30c..a551091913b 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -45,7 +45,7 @@ function project_prepare_head(Project $project, $moreparam = '') $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/projet/card.php?id='.((int) $project->id).($moreparam ? '&'.$moreparam : ''); + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/projet/card.php', ['id' => $project->id]).($moreparam ? '&'.$moreparam : ''); $head[$h][1] = $langs->trans("Project"); $head[$h][2] = 'project'; $h++; @@ -61,7 +61,7 @@ function project_prepare_head(Project $project, $moreparam = '') $nbContacts = count($project->liste_contact(-1, 'internal')) + count($project->liste_contact(-1, 'external')); dol_setcache($cachekey, $nbContacts, 120); // If setting cache fails, this is not a problem, so we do not test result. } - $head[$h][0] = DOL_URL_ROOT.'/projet/contact.php?id='.((int) $project->id).($moreparam ? '&'.$moreparam : ''); + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/projet/contact.php', ['id' => $project->id]).($moreparam ? '&'.$moreparam : ''); $head[$h][1] = $langs->trans("ProjectContact"); if ($nbContacts > 0) { $head[$h][1] .= ''.$nbContacts.''; @@ -85,7 +85,7 @@ function project_prepare_head(Project $project, $moreparam = '') $nbTasks = count($taskstatic->getTasksArray(null, null, $project->id, 0, 0)); dol_setcache($cachekey, $nbTasks, 120); // If setting cache fails, this is not a problem, so we do not test result. } - $head[$h][0] = DOL_URL_ROOT.'/projet/tasks.php?id='.((int) $project->id).($moreparam ? '&'.$moreparam : ''); + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/projet/tasks.php', ['id' => $project->id]).($moreparam ? '&'.$moreparam : ''); $head[$h][1] = $langs->trans("Tasks"); if ($nbTasks > 0) { $head[$h][1] .= ''.($nbTasks).''; @@ -119,7 +119,7 @@ function project_prepare_head(Project $project, $moreparam = '') } } - $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&projectid='.((int) $project->id).($moreparam ? '&'.$moreparam : ''); + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/projet/tasks/time.php', ['withproject' => 1, 'projectid' => $project->id]).($moreparam ? '&'.$moreparam : ''); $head[$h][1] = $langs->trans("TimeSpent"); if ($nbTimeSpent > 0) { $head[$h][1] .= '...'; @@ -204,7 +204,7 @@ function project_prepare_head(Project $project, $moreparam = '') } dol_setcache($cachekey, $nbElements, 120); // If setting cache fails, this is not a problem, so we do not test result. } - $head[$h][0] = DOL_URL_ROOT.'/projet/element.php?id='.$project->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/projet/element.php', ['id' => $project->id]); $head[$h][1] = $langs->trans("ProjectOverview"); if ($nbElements > 0) { $head[$h][1] .= ''.$nbElements.''; @@ -217,7 +217,7 @@ function project_prepare_head(Project $project, $moreparam = '') require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; $Tickettatic = new Ticket($db); $nbTicket = $Tickettatic->getCountOfItemsLinkedByObjectID($project->id, 'fk_project', 'ticket'); - $head[$h][0] = DOL_URL_ROOT.'/ticket/list.php?projectid='.((int) $project->id); + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/ticket/list.php', ['projectid' => $project->id]); $head[$h][1] = $langs->trans("Ticket"); if ($nbTicket > 0) { $head[$h][1] .= ''.($nbTicket).''; @@ -228,7 +228,7 @@ function project_prepare_head(Project $project, $moreparam = '') if (isModEnabled('eventorganization') && !empty($project->usage_organize_event)) { $langs->load('eventorganization'); - $head[$h][0] = DOL_URL_ROOT . '/eventorganization/conferenceorbooth_list.php?projectid=' . $project->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT . '/eventorganization/conferenceorbooth_list.php', ['projectid' => $project->id]); $head[$h][1] = $langs->trans("EventOrganization"); // Enable caching of conf or booth count @@ -293,7 +293,7 @@ function project_prepare_head(Project $project, $moreparam = '') if (!empty($project->note_public)) { $nbNote++; } - $head[$h][0] = DOL_URL_ROOT.'/projet/note.php?id='.$project->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/projet/note.php', ['id' => $project->id]); $head[$h][1] = $langs->trans('Notes'); if ($nbNote > 0) { $head[$h][1] .= ''.$nbNote.''; @@ -319,7 +319,7 @@ function project_prepare_head(Project $project, $moreparam = '') $totalAttached = $nbFiles + $nbLinks; dol_setcache($cachekey, $totalAttached, 120); // If setting cache fails, this is not a problem, so we do not test result. } - $head[$h][0] = DOL_URL_ROOT.'/projet/document.php?id='.$project->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/projet/document.php', ['id' => $project->id]); $head[$h][1] = $langs->trans('Documents'); if (($totalAttached) > 0) { $head[$h][1] .= ''.($totalAttached).''; @@ -340,7 +340,7 @@ function project_prepare_head(Project $project, $moreparam = '') $nbComments = $project->getNbComments(); dol_setcache($cachekey, $nbComments, 120); // If setting cache fails, this is not a problem, so we do not test result. } - $head[$h][0] = DOL_URL_ROOT.'/projet/comment.php?id='.$project->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/projet/comment.php', ['id' => $project->id]); $head[$h][1] = $langs->trans("CommentLink"); if ($nbComments > 0) { $head[$h][1] .= ''.$nbComments.''; @@ -349,7 +349,7 @@ function project_prepare_head(Project $project, $moreparam = '') $h++; } - $head[$h][0] = DOL_URL_ROOT.'/projet/messaging.php?id='.$project->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/projet/messaging.php', ['id' => $project->id]); $head[$h][1] = $langs->trans("Events"); if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { $head[$h][1] .= '/'; @@ -2582,7 +2582,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks global $langs, $conf, $user; global $theme_datacolor; - $maxofloop = (!getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD); + $maxofloop = getDolGlobalString('MAIN_MAXLIST_OVERLOAD', 500); require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; @@ -2701,7 +2701,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks $total_declaredprogressworkload = 0; $num = $db->num_rows($resql); - $nbofloop = min($num, (!getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD)); + $nbofloop = min($num, getDolGlobalString('MAIN_MAXLIST_OVERLOAD', 500)); $i = 0; print '
'; print ''; print ''; diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index 326196593e3..e73d594aeac 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -39,7 +39,7 @@ function propal_prepare_head($object) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/comm/propal/card.php', ['id' => $object->id]); $head[$h][1] = $langs->trans('Proposal'); $head[$h][2] = 'comm'; $h++; @@ -48,7 +48,7 @@ function propal_prepare_head($object) || (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') && $user->hasRight('expedition', 'delivery', 'lire'))))) { $langs->load("sendings"); $text = ''; - $head[$h][0] = DOL_URL_ROOT.'/expedition/propal.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/expedition/propal.php', ['id' => $object->id]); if (getDolGlobalInt('MAIN_SUBMODULE_EXPEDITION')) { $text = $langs->trans("Shipment"); } @@ -65,7 +65,7 @@ function propal_prepare_head($object) if (!getDolGlobalString('MAIN_DISABLE_CONTACTS_TAB')) { $nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external')); - $head[$h][0] = DOL_URL_ROOT.'/comm/propal/contact.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/comm/propal/contact.php', ['id' => $object->id]); $head[$h][1] = $langs->trans('ContactsAddresses'); if ($nbContact > 0) { $head[$h][1] .= ''.$nbContact.''; @@ -88,7 +88,7 @@ function propal_prepare_head($object) if (!empty($object->note_public)) { $nbNote++; } - $head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/comm/propal/note.php', ['id' => $object->id]); $head[$h][1] = $langs->trans('Notes'); if ($nbNote > 0) { $head[$h][1] .= ''.$nbNote.''; @@ -102,7 +102,7 @@ function propal_prepare_head($object) $upload_dir = $conf->propal->multidir_output[$object->entity ?? $conf->entity]."/".dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks = Link::count($db, $object->element, $object->id); - $head[$h][0] = DOL_URL_ROOT.'/comm/propal/document.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/comm/propal/document.php', ['id' => $object->id]); $head[$h][1] = $langs->trans('Documents'); if (($nbFiles + $nbLinks) > 0) { $head[$h][1] .= ''.($nbFiles + $nbLinks).''; @@ -111,7 +111,7 @@ function propal_prepare_head($object) $h++; - $head[$h][0] = DOL_URL_ROOT.'/comm/propal/agenda.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/comm/propal/agenda.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("Events"); if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { $nbEvent = 0; @@ -168,7 +168,7 @@ function propal_admin_prepare_head() $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/admin/propal.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/admin/propal.php'); $head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'general'; $h++; @@ -179,7 +179,7 @@ function propal_admin_prepare_head() // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab complete_head_from_modules($conf, $langs, null, $head, $h, 'propal_admin'); - $head[$h][0] = DOL_URL_ROOT.'/comm/admin/propal_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/comm/admin/propal_extrafields.php'); $head[$h][1] = $langs->trans("ExtraFields"); $nbExtrafields = $extrafields->attributes['propal']['count']; if ($nbExtrafields > 0) { @@ -188,7 +188,7 @@ function propal_admin_prepare_head() $head[$h][2] = 'attributes'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/comm/admin/propaldet_extrafields.php'; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/comm/admin/propaldet_extrafields.php'); $head[$h][1] = $langs->trans("ExtraFieldsLines"); $nbExtrafields = $extrafields->attributes['propaldet']['count']; if ($nbExtrafields > 0) { diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index 1a1d7e57846..7a0945c4f17 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -87,14 +87,14 @@ function ticket_prepare_head($object) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/ticket/card.php?track_id='.$object->track_id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/ticket/card.php', ['track_id' => $object->track_id]); $head[$h][1] = $langs->trans("Ticket"); $head[$h][2] = 'tabTicket'; $h++; if (!getDolGlobalInt('MAIN_DISABLE_CONTACTS_TAB') && empty($user->socid) && isModEnabled("societe")) { $nbContact = count($object->liste_contact(-1, 'internal')) + count($object->liste_contact(-1, 'external')); - $head[$h][0] = DOL_URL_ROOT.'/ticket/contact.php?track_id='.$object->track_id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/ticket/contact.php', ['track_id' => $object->track_id]); $head[$h][1] = $langs->trans('ContactsAddresses'); if ($nbContact > 0) { $head[$h][1] .= ''.$nbContact.''; @@ -112,7 +112,7 @@ function ticket_prepare_head($object) if (!empty($object->note_public)) { $nbNote++; } - $head[$h][0] = DOL_URL_ROOT.'/ticket/note.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/ticket/note.php', ['id' => $object->id]); $head[$h][1] = $langs->trans('Notes'); if ($nbNote > 0) { $head[$h][1] .= ''.$nbNote.''; @@ -139,7 +139,7 @@ function ticket_prepare_head($object) } } */ - $head[$h][0] = DOL_URL_ROOT.'/ticket/document.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/ticket/document.php', ['id' => $object->id]); $head[$h][1] = $langs->trans("Documents"); if ($nbFiles > 0) { $head[$h][1] .= ''.$nbFiles.''; @@ -158,10 +158,10 @@ function ticket_prepare_head($object) } if ($ticketViewType == "messaging") { - $head[$h][0] = DOL_URL_ROOT.'/ticket/messaging.php?track_id='.$object->track_id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/ticket/messaging.php', ['track_id' => $object->track_id]); } else { // $ticketViewType == "list" - $head[$h][0] = DOL_URL_ROOT.'/ticket/agenda.php?track_id='.$object->track_id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/ticket/agenda.php', ['track_id' => $object->track_id]); } $head[$h][1] = $langs->trans('Events'); if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { diff --git a/htdocs/core/lib/trip.lib.php b/htdocs/core/lib/trip.lib.php index 0d6a023186b..73a7f81267d 100644 --- a/htdocs/core/lib/trip.lib.php +++ b/htdocs/core/lib/trip.lib.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 MDW + * Copyright (C) 2025 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 @@ -35,7 +36,8 @@ function trip_prepare_head(Deplacement $object) $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/compta/deplacement/card.php?id='.$object->id; + $query = ['id' => $object->id]; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/compta/deplacement/card.php', $query); $head[$h][1] = $langs->trans("Trip"); $head[$h][2] = 'card'; $h++; @@ -46,12 +48,12 @@ function trip_prepare_head(Deplacement $object) // $this->tabs = array('entity:-tabname); to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'trip'); - $head[$h][0] = DOL_URL_ROOT.'/compta/deplacement/document.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/compta/deplacement/document.php', $query); $head[$h][1] = $langs->trans("Documents"); $head[$h][2] = 'documents'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/compta/deplacement/info.php?id='.$object->id; + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/compta/deplacement/info.php', $query); $head[$h][1] = $langs->trans("Info"); $head[$h][2] = 'info'; $h++; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 2dba517d647..b10060f69d2 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1309,9 +1309,9 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le // Prospects if (isModEnabled('societe') && !getDolGlobalString('SOCIETE_DISABLE_PROSPECTS')) { $langs->load("commercial"); - $newmenu->add("/societe/list.php?type=p&leftmenu=prospects", $langs->trans("Prospects"), 2, $user->hasRight('societe', 'lire'), '', $mainmenu, 'prospects', 5); + $newmenu->add(dolBuildUrl('/societe/list.php', ['type' => 'p', 'leftmenu' => 'prospects']), $langs->trans("Prospects"), 2, $user->hasRight('societe', 'lire'), '', $mainmenu, 'prospects', 5); - $newmenu->add("/societe/card.php?leftmenu=prospects&action=create&type=p", $langs->trans("MenuNewProspect"), 3, $user->hasRight('societe', 'creer')); + $newmenu->add(dolBuildUrl('/societe/card.php', ['leftmenu' => 'prospects', 'action' => 'create', 'type' => 'p']), $langs->trans("MenuNewProspect"), 3, $user->hasRight('societe', 'creer')); } // Customers/Prospects diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 86cb6ec2f97..04315d7bef2 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -477,7 +477,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it public $phpmin; /** - * @var int[] Maximum version of PHP ensured compatible with module. + * @var null|int[] Maximum version of PHP ensured compatible with module. */ public $phpmax; diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index 36b2f77bb36..d675ec0cffb 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -325,7 +325,7 @@ $param = 'id='.$object->id.'&mainmenu=home'; // Show list of contact links -print ''; +print ''; print ''; print ''; print ''; diff --git a/htdocs/core/upload_page.php b/htdocs/core/upload_page.php index baba144d931..a866a54006b 100644 --- a/htdocs/core/upload_page.php +++ b/htdocs/core/upload_page.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024 MDW * * This file is a modified version of datepicker.php from phpBSM to fix some @@ -242,7 +242,7 @@ $uploadform .= '
'; // Show all forms print "\n"; print "\n"; -print ''; +print ''; print ''; print ''; print ''; diff --git a/htdocs/core/upload_page2.php b/htdocs/core/upload_page2.php index 7ee99390663..3985f4f5721 100644 --- a/htdocs/core/upload_page2.php +++ b/htdocs/core/upload_page2.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024 MDW * * This file is a modified version of datepicker.php from phpBSM to fix some @@ -93,7 +93,7 @@ print load_fiche_titre('', '', '', 0, '', '', '

'.img_picto('', 'upload').' ' // Show all forms print "\n"; print "\n"; -print ''; +print ''; print ''; print ''; print ''; diff --git a/htdocs/cron/admin/cron.php b/htdocs/cron/admin/cron.php index e1d41374246..b560d173f53 100644 --- a/htdocs/cron/admin/cron.php +++ b/htdocs/cron/admin/cron.php @@ -73,7 +73,7 @@ if (!empty($actionsave)) { $help_url = ''; llxHeader('', '', $help_url); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("CronSetup"), $linkback, 'title_setup'); // Configuration header diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 28f3f095380..24093fadb07 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -464,7 +464,7 @@ $massactionbutton = $form->selectMassAction('', $arrayofmassactions); $head = []; if ($mode == 'modulesetup') { - $linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; + $linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("CronSetup"), $linkback, 'title_setup'); // Configuration header diff --git a/htdocs/datapolicy/admin/setup.php b/htdocs/datapolicy/admin/setup.php index 3208e6ce395..f7817a406e8 100644 --- a/htdocs/datapolicy/admin/setup.php +++ b/htdocs/datapolicy/admin/setup.php @@ -159,7 +159,7 @@ if (!isModEnabled('cron')) { } print '

'; -print ''; +print ''; print ''; print ''; print ''; diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index 2d261aadf88..4c3caee0229 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -380,7 +380,7 @@ if ($action == 'create') { if (0) { // @phpstan-ignore-line Do not change on shipment $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $objectsrc->socid, (string) $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/don/admin/donation.php b/htdocs/don/admin/donation.php index 989d366b6b4..a0189f6bc72 100644 --- a/htdocs/don/admin/donation.php +++ b/htdocs/don/admin/donation.php @@ -189,7 +189,7 @@ if (isModEnabled('accounting')) { $help_url = ''; llxHeader('', $langs->trans("DonationsSetup"), $help_url, '', 0, 0, '', '', '', 'mod-donation page-admin'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("DonationsSetup"), $linkback, 'title_setup'); $head = donation_admin_prepare_head(); diff --git a/htdocs/don/admin/donation_extrafields.php b/htdocs/don/admin/donation_extrafields.php index da26538e173..f6a8e0bc40d 100644 --- a/htdocs/don/admin/donation_extrafields.php +++ b/htdocs/don/admin/donation_extrafields.php @@ -71,7 +71,7 @@ $textobject = $langs->transnoentitiesnoconv("Donations"); $help_url = ''; llxHeader('', $langs->trans("DonationsSetup"), $help_url, '', 0, 0, '', '', '', 'mod-donation page-admin_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("DonationsSetup"), $linkback, 'title_setup'); diff --git a/htdocs/don/admin/website.php b/htdocs/don/admin/website.php index c02302bb524..ef87706c6d2 100644 --- a/htdocs/don/admin/website.php +++ b/htdocs/don/admin/website.php @@ -109,7 +109,7 @@ $help_url = 'EN:Module_Donation|FR:Module_Don'; llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-don page-admin_website'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($title, $linkback, 'title_setup'); $head = donation_admin_prepare_head(); diff --git a/htdocs/don/paiement/list.php b/htdocs/don/paiement/list.php index 0c9f1902e40..a23dd6072ba 100644 --- a/htdocs/don/paiement/list.php +++ b/htdocs/don/paiement/list.php @@ -5,7 +5,7 @@ * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2019 Thibault FOUCART * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -317,7 +317,7 @@ if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); } -print ''; +print ''; if ($optioncss != '') { print ''; } diff --git a/htdocs/don/stats/index.php b/htdocs/don/stats/index.php index 604d01125e1..5d9e9cbdc8f 100644 --- a/htdocs/don/stats/index.php +++ b/htdocs/don/stats/index.php @@ -208,7 +208,7 @@ print dol_get_fiche_head($head, 'byyear', '', -1); print '
'; // Show filter box -print ''; +print ''; print ''; print '

'.$langs->trans("Year").'
'; diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index 0e1aeaa584d..3658e5eeed1 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -460,7 +460,7 @@ if (!empty($withproject)) { if ($action == 'create') { print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("ConferenceOrBooth")), '', 'object_'.$object->picto); - print ''; + print ''; print ''; print ''; if ($withproject) { @@ -499,7 +499,7 @@ if ($action == 'create') { if (($id || $ref) && $action == 'edit') { print load_fiche_titre($langs->trans("ConferenceOrBooth"), '', 'object_'.$object->picto); - print ''; + print ''; print ''; if (!empty($withProjectUrl)) { print ''; diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php index 42b0971629f..0c4dc10fb1c 100644 --- a/htdocs/eventorganization/conferenceorbooth_contact.php +++ b/htdocs/eventorganization/conferenceorbooth_contact.php @@ -417,7 +417,7 @@ if ($object->id) { if ($permissiontoadd) { if ($action != 'classify') - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref.=' : '; if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index 2769f19ca27..6847f3e5a7c 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -545,7 +545,7 @@ if ($action == 'create' && $confOrBooth === null) { if (($id || $ref) && $action == 'edit') { print load_fiche_titre($langs->trans("ConferenceOrBoothAttendee"), '', 'object_'.$object->picto); - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index fe9af76105d..46c77e0c8f8 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2141,7 +2141,7 @@ if ($action == 'create') { 'label' => '' . $langs->trans('SignStatus') . '', 'values' => $object->getSignedStatusLocalisedArray() ]; - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('SignShipping'), $text, 'confirm_sign', $formquestion, 0, 1); + $formconfirm = $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]), $langs->trans('SignShipping'), $text, 'confirm_sign', $formquestion, 0, 1); } // Confirm unsign @@ -2153,7 +2153,7 @@ if ($action == 'create') { $text .= '
'; $text .= $notify->confirmMessage('SHIPPING_MODIFY', $object->socid, $object); } - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('UnsignShipping'), $text, 'confirm_unsign', '', 0, 1); + $formconfirm = $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]), $langs->trans('UnsignShipping'), $text, 'confirm_unsign', '', 0, 1); } // Call Hook formConfirm diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index e205f32c897..357f59660be 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -173,7 +173,7 @@ if ($id > 0 || !empty($ref)) { if (0) { // @phpstan-ignore-line Do not change on shipment $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $objectsrc->socid, (string) $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/expedition/dispatch.php b/htdocs/expedition/dispatch.php index cbbcbcb336f..a381b459648 100644 --- a/htdocs/expedition/dispatch.php +++ b/htdocs/expedition/dispatch.php @@ -470,7 +470,7 @@ if ($object->id > 0 || !empty($object->ref)) { if (0) { // @phpstan-ignore-line Do not change on reception $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify' && $permissiontoadd) { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (!getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') ? $object->socid : -1), (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { @@ -565,7 +565,7 @@ if ($object->id > 0 || !empty($object->ref)) { - print ''; + print ''; print ''; print ''; diff --git a/htdocs/expedition/document.php b/htdocs/expedition/document.php index 0b29655bcd1..fd8844ee503 100644 --- a/htdocs/expedition/document.php +++ b/htdocs/expedition/document.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -159,7 +159,7 @@ if ($id > 0 || !empty($ref)) { if (0) { // @phpstan-ignore-line Do not change on shipment $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $objectsrc->socid, (string) $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php index 73e7cdcee07..936c4856578 100644 --- a/htdocs/expedition/note.php +++ b/htdocs/expedition/note.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Florian Henry - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -128,7 +128,7 @@ if ($id > 0 || !empty($ref)) { if (0) { // @phpstan-ignore-line Do not change on shipment $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $objectsrc->socid, (string) $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index ea69096110e..bdf21ba9eab 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -304,7 +304,7 @@ if ($order_id > 0 || !empty($ref)) { if (0) { // @phpstan-ignore-line Do not change on shipment $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $objectsrc->socid, (string) $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/expedition/stats/index.php b/htdocs/expedition/stats/index.php index 4f7aad4f9d1..fc1b361d62f 100644 --- a/htdocs/expedition/stats/index.php +++ b/htdocs/expedition/stats/index.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -235,7 +235,7 @@ print '
'; // Show filter box -print ''; +print ''; print ''; print '
'; diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 8b1ef18c7ab..301f4769bb2 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -1056,7 +1056,7 @@ class ExpenseReport extends CommonObject print ''; print ''; print ''; print ''; @@ -1827,10 +1827,11 @@ class ExpenseReport extends CommonObject $result = ''; - $url = DOL_URL_ROOT.'/expensereport/card.php?id='.$this->id; + $baseurl = DOL_URL_ROOT.'/expensereport/card.php'; + $query = ['id' => $this->id]; if ($short) { - return $url; + return dolBuildUrl($baseurl, $query); } $params = [ @@ -1857,9 +1858,10 @@ class ExpenseReport extends CommonObject $add_save_lastsearch_values = 1; } if ($add_save_lastsearch_values) { - $url .= '&save_lastsearch_values=1'; + $query += ['save_lastsearch_values' => 1]; } } + $url = dolBuildUrl($baseurl, $query); $ref = $this->ref; if (empty($ref)) { @@ -2616,12 +2618,12 @@ class ExpenseReport extends CommonObject $response->warning_delay = $conf->expensereport->approve->warning_delay / 60 / 60 / 24; $response->label = $langs->trans("ExpenseReportsToApprove"); $response->labelShort = $langs->trans("ToApprove"); - $response->url = DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&statut='.self::STATUS_VALIDATED; + $response->url = dolBuildUrl(DOL_URL_ROOT.'/expensereport/list.php', ['mainmenu' => 'hrm', 'statut' => self::STATUS_VALIDATED]); } else { $response->warning_delay = $conf->expensereport->payment->warning_delay / 60 / 60 / 24; $response->label = $langs->trans("ExpenseReportsToPay"); $response->labelShort = $langs->trans("StatusToPay"); - $response->url = DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&statut='.self::STATUS_APPROVED; + $response->url = dolBuildUrl(DOL_URL_ROOT.'/expensereport/list.php', ['mainmenu' => 'hrm', 'statut' => self::STATUS_APPROVED]); } $response->img = img_object('', "trip"); diff --git a/htdocs/expensereport/stats/index.php b/htdocs/expensereport/stats/index.php index 37e82acbcd3..27ed366475b 100644 --- a/htdocs/expensereport/stats/index.php +++ b/htdocs/expensereport/stats/index.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003-2006 Rodolphe Quiedeville * Copyright (c) 2004-2012 Laurent Destailleur * Copyright (C) 2012 Marcos García - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -238,7 +238,7 @@ print '
'; // Show filter box -print ''; +print ''; print ''; print ''; diff --git a/htdocs/externalsite/admin/index.php b/htdocs/externalsite/admin/index.php index 775a7c90f32..8a2df90296b 100644 --- a/htdocs/externalsite/admin/index.php +++ b/htdocs/externalsite/admin/index.php @@ -90,7 +90,7 @@ if ($action == 'update') { llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-externalsite page-index'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ExternalSiteSetup"), $linkback, 'title_setup'); print '
'; diff --git a/htdocs/fichinter/admin/fichinter_extrafields.php b/htdocs/fichinter/admin/fichinter_extrafields.php index 894b1ff98e9..c691e1e0911 100644 --- a/htdocs/fichinter/admin/fichinter_extrafields.php +++ b/htdocs/fichinter/admin/fichinter_extrafields.php @@ -74,7 +74,7 @@ $textobject = $langs->transnoentitiesnoconv("Interventions"); llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-fichinter page-admin_fichinter_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("InterventionsSetup"), $linkback, 'title_setup'); $head = fichinter_admin_prepare_head(); diff --git a/htdocs/fichinter/admin/fichinterdet_extrafields.php b/htdocs/fichinter/admin/fichinterdet_extrafields.php index 6bdb7fe0004..1585c82c14e 100644 --- a/htdocs/fichinter/admin/fichinterdet_extrafields.php +++ b/htdocs/fichinter/admin/fichinterdet_extrafields.php @@ -74,7 +74,7 @@ $textobject = $langs->transnoentitiesnoconv("Interventions"); llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-fichinter page-admin_fichinterdet_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("InterventionsSetup"), $linkback, 'title_setup'); diff --git a/htdocs/fichinter/agenda.php b/htdocs/fichinter/agenda.php index 88cea17dd78..8935c28a994 100644 --- a/htdocs/fichinter/agenda.php +++ b/htdocs/fichinter/agenda.php @@ -1,7 +1,7 @@ * Copyright (C) ---Put here your own copyright and developer email--- - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -163,7 +163,7 @@ if ($object->id > 0) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index d8474848ee3..49402a9f401 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -8,7 +8,7 @@ * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016-2018 Charlie Benke - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2024 William Mead * Copyright (C) 2024-2025 MDW * @@ -530,7 +530,7 @@ if ($action == 'create') { $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->hasRight('ficheinter', 'creer')) { if ($action != 'classify') { - $morehtmlref .= ''; + $morehtmlref .= ''; $morehtmlref .= img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; } if ($action == 'classify') { diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 8edc5140cc4..d1d7e645c73 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1343,7 +1343,7 @@ if ($action == 'create') { if ($permissiontoadd) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/fichinter/contact.php b/htdocs/fichinter/contact.php index 30b9be2ff41..665dbdb66c7 100644 --- a/htdocs/fichinter/contact.php +++ b/htdocs/fichinter/contact.php @@ -145,7 +145,7 @@ if ($id > 0 || !empty($ref)) { if ($usercancreate && 0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php index 554e5e68a4e..432603a4579 100644 --- a/htdocs/fichinter/document.php +++ b/htdocs/fichinter/document.php @@ -7,7 +7,7 @@ * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -142,7 +142,7 @@ if ($object->id) { if ($permissiontoadd && 0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/fichinter/note.php b/htdocs/fichinter/note.php index 1c413266ae4..9a5f70518e3 100644 --- a/htdocs/fichinter/note.php +++ b/htdocs/fichinter/note.php @@ -3,7 +3,7 @@ * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2013 Florian Henry * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -105,7 +105,7 @@ if ($id > 0 || !empty($ref)) { if ($permissionnote && 0) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/fichinter/stats/index.php b/htdocs/fichinter/stats/index.php index 98eeef7b786..9c56c12af48 100644 --- a/htdocs/fichinter/stats/index.php +++ b/htdocs/fichinter/stats/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 +225,7 @@ print '
'; // Show filter box -print ''; +print ''; print ''; print ''; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 2b238e005b3..0b12a15d463 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2197,7 +2197,7 @@ if ($action == 'create') { if ($permissiontoadd) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify' && $caneditproject) { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (!getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') ? $object->socid : -1), (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 1, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php index dac023046f2..8b909374a02 100644 --- a/htdocs/fourn/commande/contact.php +++ b/htdocs/fourn/commande/contact.php @@ -168,7 +168,7 @@ if ($id > 0 || !empty($ref)) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify' && $caneditproject) { // Always false @phpstan-ignore-line - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (!getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') ? $object->socid : -1), (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 0f829bce955..3992d05e1c3 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -586,7 +586,7 @@ if ($id > 0 || !empty($ref)) { $caneditproject = false; // For static analysis $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify' && $caneditproject) { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (!getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') ? $object->socid : -1), (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php index bdf85efdacb..5eca8b8cb7c 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -6,7 +6,7 @@ * Copyright (C) 2012 Marcos García * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -149,7 +149,7 @@ if ($object->id > 0) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify' && $caneditproject) { // Always false @phpstan-ignore-line - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (!getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') ? $object->socid : -1), (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index d98f8138883..07a5f1fee6a 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -6,7 +6,7 @@ * Copyright (C) 2014 Marcos García * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2016 Ferran Marcet - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2018-2022 Charlene Benke * Copyright (C) 2019 Nicolas Zabouri * Copyright (C) 2021-2023 Alexandre Spangaro @@ -1306,7 +1306,7 @@ if ($resql) { $newcardbutton .= dolGetButtonTitle($langs->trans('NewSupplierOrderShort'), '', 'fa fa-plus-circle', $url, '', (int) $permissiontoadd); // Lines of title fields - print ''; + print ''; if ($optioncss != '') { print ''; } diff --git a/htdocs/fourn/commande/note.php b/htdocs/fourn/commande/note.php index e0a5b991d20..16df0e02fbd 100644 --- a/htdocs/fourn/commande/note.php +++ b/htdocs/fourn/commande/note.php @@ -131,7 +131,7 @@ if ($id > 0 || !empty($ref)) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify' && $caneditproject) { // Always false @phpstan-ignore-line - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (!getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') ? $object->socid : -1), (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/fourn/facture/agenda.php b/htdocs/fourn/facture/agenda.php index c1217720586..a89c8f35ebc 100644 --- a/htdocs/fourn/facture/agenda.php +++ b/htdocs/fourn/facture/agenda.php @@ -1,7 +1,7 @@ * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -181,7 +181,7 @@ if ($object->id > 0) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/fourn/facture/card-rec.php b/htdocs/fourn/facture/card-rec.php index c8bc7035880..8fae182c0ae 100644 --- a/htdocs/fourn/facture/card-rec.php +++ b/htdocs/fourn/facture/card-rec.php @@ -8,7 +8,7 @@ * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2015-2024 Alexandre Spangaro * Copyright (C) 2016 Meziane Sof - * Copyright (C) 2017-2024 Frédéric France + * Copyright (C) 2017-2025 Frédéric France * Copyright (C) 2023-2024 Nick Fragoulis * Copyright (C) 2024-2025 MDW * @@ -1161,7 +1161,7 @@ if ($action == 'create') { // Confirm delete of repeatable invoice if ($action == 'ask_deleteinvoice') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteRepeatableInvoice'), $langs->trans('ConfirmDeleteRepeatableInvoice'), 'confirm_deleteinvoice', '', 'no', 1); + $formconfirm = $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]), $langs->trans('DeleteRepeatableInvoice'), $langs->trans('ConfirmDeleteRepeatableInvoice'), 'confirm_deleteinvoice', '', 'no', 1); } print $formconfirm; diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index 101d6aba6bc..0311648af84 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -169,7 +169,7 @@ if ($id > 0 || !empty($ref)) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (!getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') ? $object->socid : -1), (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index 22ae26be6ea..8ffa1b39f9d 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -134,7 +134,7 @@ if ($object->id > 0 && $upload_dir !== null) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (!getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') ? $object->socid : -1), (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/fourn/facture/info.php b/htdocs/fourn/facture/info.php index e470cceabfe..1e5d66e0906 100644 --- a/htdocs/fourn/facture/info.php +++ b/htdocs/fourn/facture/info.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2016 Alexandre Spangaro * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -101,7 +101,7 @@ if (isModEnabled('project')) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (!getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') ? $object->socid : -1), (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/fourn/facture/messaging.php b/htdocs/fourn/facture/messaging.php index 0ad38e9738b..4b6ecf3bfe7 100644 --- a/htdocs/fourn/facture/messaging.php +++ b/htdocs/fourn/facture/messaging.php @@ -1,7 +1,7 @@ * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -183,7 +183,7 @@ if ($object->id > 0) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/fourn/facture/note-rec.php b/htdocs/fourn/facture/note-rec.php index 40176307ffd..2a546d82dde 100644 --- a/htdocs/fourn/facture/note-rec.php +++ b/htdocs/fourn/facture/note-rec.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Florian Henry * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -155,7 +155,7 @@ if ($id > 0) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php index 8e6c8cf860a..829de10e14f 100644 --- a/htdocs/fourn/facture/note.php +++ b/htdocs/fourn/facture/note.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Florian Henry * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2021-2024 Frédéric France + * Copyright (C) 2021-2025 Frédéric France * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -129,7 +129,7 @@ if ($object->id > 0) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (!getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') ? $object->socid : -1), (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index d81beae870e..05c62e8384e 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -9,7 +9,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2015 Juanjo Menent * Copyright (C) 2017-2023 Alexandre Spangaro - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2020 Tobias Sekan * Copyright (C) 2021 Ferran Marcet * Copyright (C) 2024-2025 MDW @@ -367,7 +367,7 @@ if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predel } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); -print ''; +print ''; if ($optioncss != '') { print ''; } diff --git a/htdocs/ftp/admin/ftpclient.php b/htdocs/ftp/admin/ftpclient.php index 0ec169cbc70..9dc2e36913a 100644 --- a/htdocs/ftp/admin/ftpclient.php +++ b/htdocs/ftp/admin/ftpclient.php @@ -173,7 +173,7 @@ $help_url = 'EN:Module_FTP_En|FR:Module_FTP|ES:Módulo_FTP'; llxHeader('', 'FTP', $help_url); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("FTPClientSetup"), $linkback, 'title_setup'); print '
'; diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index d4522e0c8ea..5a89a74b49b 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -255,7 +255,7 @@ if ($permissiontosetup) { $massactionbutton = $form->selectMassAction('', $arrayofmassactions); -print ''; +print ''; if ($optioncss != '') { print ''; } diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php index e05fb39561e..7e98cbcdf74 100644 --- a/htdocs/holiday/month_report.php +++ b/htdocs/holiday/month_report.php @@ -1,7 +1,7 @@ * Copyright (C) 2011 François Legastelois - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2020 Tobias Sekan * Copyright (C) 2024 Alexandre Spangaro * Copyright (C) 2025 MDW @@ -224,7 +224,7 @@ if (!empty($search_year)) { $param .= '&search_year='.((int) $search_year); } -print ''; +print ''; if ($optioncss != '') { print ''; } diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index a256c539e44..b5cd1b6cae4 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -2,7 +2,7 @@ /* Copyright (C) 2007-2016 Laurent Destailleur * Copyright (C) 2011 Dimitri Mouillard * Copyright (C) 2020 Tobias Sekan - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024 Alexandre Spangaro * Copyright (C) 2025 MDW * @@ -286,7 +286,7 @@ if (!empty($search_new_solde)) { $param .= '&search_new_solde='.urlencode($search_new_solde); } -print ''; +print ''; if ($optioncss != '') { print ''; } diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php index 7963b1dccad..ba56ca361af 100644 --- a/htdocs/hrm/admin/admin_establishment.php +++ b/htdocs/hrm/admin/admin_establishment.php @@ -95,7 +95,7 @@ llxHeader('', $title, ''); // Subheader -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("HRMSetup"), $linkback, 'title_setup'); diff --git a/htdocs/hrm/admin/admin_hrm.php b/htdocs/hrm/admin/admin_hrm.php index 7607bcc80bd..a878285a864 100644 --- a/htdocs/hrm/admin/admin_hrm.php +++ b/htdocs/hrm/admin/admin_hrm.php @@ -101,7 +101,7 @@ $form = new Form($db); dol_htmloutput_mesg($mesg); // Subheader -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("HRMSetup"), $linkback); diff --git a/htdocs/hrm/admin/evaluation_extrafields.php b/htdocs/hrm/admin/evaluation_extrafields.php index 0eeaac742df..966fe877c82 100644 --- a/htdocs/hrm/admin/evaluation_extrafields.php +++ b/htdocs/hrm/admin/evaluation_extrafields.php @@ -79,7 +79,7 @@ $page_name = "HrmSetup"; llxHeader('', $langs->trans("HrmSetup"), $help_url); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); diff --git a/htdocs/hrm/admin/job_extrafields.php b/htdocs/hrm/admin/job_extrafields.php index 85f15d540ef..b2260411f0b 100644 --- a/htdocs/hrm/admin/job_extrafields.php +++ b/htdocs/hrm/admin/job_extrafields.php @@ -79,7 +79,7 @@ $page_name = "HrmSetup"; llxHeader('', $langs->trans("Setup"), $help_url); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); diff --git a/htdocs/hrm/admin/skill_extrafields.php b/htdocs/hrm/admin/skill_extrafields.php index 64c5f03fa07..76ba79ec66b 100644 --- a/htdocs/hrm/admin/skill_extrafields.php +++ b/htdocs/hrm/admin/skill_extrafields.php @@ -78,7 +78,7 @@ $page_name = "HrmSetup"; llxHeader('', $langs->trans("HrmSetup"), $help_url); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); diff --git a/htdocs/hrm/establishment/info.php b/htdocs/hrm/establishment/info.php index 5b7dd497abe..f8b5da220d5 100644 --- a/htdocs/hrm/establishment/info.php +++ b/htdocs/hrm/establishment/info.php @@ -167,7 +167,7 @@ if ($object->id > 0) { if ($permissiontoadd) { if ($action != 'classify') - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref.=' : '; if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/hrm/evaluation_card.php b/htdocs/hrm/evaluation_card.php index e08b10435ee..c285289987a 100644 --- a/htdocs/hrm/evaluation_card.php +++ b/htdocs/hrm/evaluation_card.php @@ -291,7 +291,7 @@ print ''; $stringtoshow .= '
'; // hideobject is to start hidden -$stringtoshow .= ''; +$stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= ''; diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index 7e9acfb1c09..38c1f38d914 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -1,7 +1,7 @@ * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -224,7 +224,7 @@ if (isModEnabled('project')) { if (0) { // @phpstan-ignore-line $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/ticket/note.php b/htdocs/ticket/note.php index 618a01c8033..dea08e8d588 100644 --- a/htdocs/ticket/note.php +++ b/htdocs/ticket/note.php @@ -3,7 +3,7 @@ * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2013 Florian Henry * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 MDW * Copyright (C) 2025 Charlene Benke * @@ -136,7 +136,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= '
'; $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/ticket/stats/index.php b/htdocs/ticket/stats/index.php index 3e506311658..23a5afe75cc 100644 --- a/htdocs/ticket/stats/index.php +++ b/htdocs/ticket/stats/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -168,7 +168,7 @@ print '
'; // Show filter box -print ''; +print ''; print ''; print '
'; - print ''.$objp->ref_num.''; + print ''.$objp->ref_num.''; print ''.dol_print_date($objp->date, 'day').''.$author->getNomUrl(1).'
'; diff --git a/htdocs/user/admin/group_extrafields.php b/htdocs/user/admin/group_extrafields.php index 9ddc5ebcba2..6efd0f064b1 100644 --- a/htdocs/user/admin/group_extrafields.php +++ b/htdocs/user/admin/group_extrafields.php @@ -74,7 +74,7 @@ $textobject = $langs->transnoentitiesnoconv("Groups"); $help_url = 'EN:Module_Users|FR:Module_Utilisateurs|ES:Módulo_Usuarios'; llxHeader('', $langs->trans("UsersSetup"), $help_url, '', 0, 0, '', '', '', 'mod-user page-admin_group_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("UsersSetup"), $linkback, 'title_setup'); diff --git a/htdocs/user/admin/user_extrafields.php b/htdocs/user/admin/user_extrafields.php index 3dbb1f3b614..bedcc32efe5 100644 --- a/htdocs/user/admin/user_extrafields.php +++ b/htdocs/user/admin/user_extrafields.php @@ -73,7 +73,7 @@ $textobject = $langs->transnoentitiesnoconv("Users"); // Used into files core/tp $help_url = 'EN:Module_Users|FR:Module_Utilisateurs|ES:Módulo_Usuarios|DE:Modul_Benutzer'; llxHeader('', $langs->trans("UsersSetup"), $help_url, '', 0, 0, '', '', '', 'mod-user page-admin_user_extrafields'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("UsersSetup"), $linkback, 'title_setup'); diff --git a/htdocs/user/agenda.php b/htdocs/user/agenda.php index d3887a6adf8..8e87f8e4826 100644 --- a/htdocs/user/agenda.php +++ b/htdocs/user/agenda.php @@ -138,10 +138,10 @@ print dol_get_fiche_head($head, 'info', $title, -1, 'user'); $linkback = ''; if ($user->hasRight('user', 'user', 'lire') || $user->admin) { - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; } -$morehtmlref = ''; +$morehtmlref = ''; $morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard', 'class="valignmiddle marginleftonly paddingrightonly"'); $morehtmlref .= ''; @@ -169,26 +169,31 @@ print dol_get_fiche_end(); $objUser = $object; $objcon = new stdClass(); -$out = ''; +$query = []; $permok = $user->hasRight('agenda', 'myactions', 'create'); if ((!empty($objUser->id) || !empty($objcon->id)) && $permok) { if (is_object($objUser) && get_class($objUser) == 'User') { - $out .= '&originid='.$objUser->id.($objUser->id > 0 ? '&assignedtouser='.$objUser->id : '').'&backtopage='.urlencode($_SERVER['PHP_SELF'].($objUser->id > 0 ? '?id='.$objUser->id : '')); + $query = [ + 'originid' => $objUser->id, + 'assignedtouser' => ($objUser->id > 0 ? $objUser->id : ''), + 'backtopage' => dolBuildUrl($_SERVER['PHP_SELF'], ['id' => ($objUser->id > 0 ? $objUser->id : '')]) + ]; } - $out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : ''); - $out .= '&datep='.dol_print_date(dol_now(), 'dayhourlog', 'tzuserrel'); + $query += ['contactid' => (!empty($objcon->id) ? $objcon->id : '')]; + $query += ['datep' => dol_print_date(dol_now(), 'dayhourlog', 'tzuserrel')]; } $morehtmlright = ''; -$messagingUrl = DOL_URL_ROOT.'/user/messaging.php?userid='.$object->id; +$messagingUrl = dolBuildUrl(DOL_URL_ROOT.'/user/messaging.php', ['userid' => $object->id]); $morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 1); -$messagingUrl = DOL_URL_ROOT.'/user/agenda.php?id='.$object->id; +$messagingUrl = dolBuildUrl(DOL_URL_ROOT.'/user/agenda.php', ['id' => $object->id]); $morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2); if (isModEnabled('agenda')) { if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create')) { - $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); + $query = array_merge(['action' => 'create'], $query); + $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', dolBuildUrl(DOL_URL_ROOT.'/comm/action/card.php', $query)); } } diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 56e87cb3ca1..ae99a6ca1c7 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -555,7 +555,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac print $form->editfieldkey("DefaultCategoryCar", 'default_c_exp_tax_cat', (string) $object->default_c_exp_tax_cat, $object, $user->hasRight('user', 'user', 'creer')); print ''; - if (!empty($object->ldap_sid) && $object->statut == 0) { + if (!empty($object->ldap_sid) && $object->status == User::STATUS_DISABLED) { print ''; @@ -2136,21 +2136,21 @@ if ($action == 'create' || $action == 'adduserldap') { $langs->load("mails"); $params['attr']['title'] = $langs->trans('NoEMail'); } - print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle', '', $canSendMail, $params); + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', dolBuildUrl($_SERVER['PHP_SELF'], ['id' => $object->id, 'action' => 'presend', 'mode' => 'init']) . '#formmailbeforetitle', '', $canSendMail, $params); } if ($permissiontoedit && (!isModEnabled('multicompany') || !$user->entity || ($object->entity == $conf->entity) || (getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE') && $object->entity == 1))) { if (getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')) { $params['attr']['title'] = $langs->trans('DisabledInMonoUserMode'); - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'].'#', '', false, $params); + print dolGetButtonAction($langs->trans('Modify'), '', 'default', dolBuildUrl($_SERVER['PHP_SELF']).'#', '', false, $params); } else { unset($params['attr']['title']); - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit&token='.newToken(), '', true, $params); + print dolGetButtonAction($langs->trans('Modify'), '', 'default', dolBuildUrl($_SERVER['PHP_SELF'], ['id' => $object->id, 'action' => 'edit'], true), '', true, $params); } } elseif ($permissiontoeditpasswordandsee && !$object->ldap_sid && (!isModEnabled('multicompany') || !$user->entity || ($object->entity == $conf->entity) || (getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE') && $object->entity == 1))) { unset($params['attr']['title']); - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit', '', true, $params); + print dolGetButtonAction($langs->trans('Modify'), '', 'default', dolBuildUrl($_SERVER['PHP_SELF'], ['id' => $object->id, 'action' => 'edit'], true), '', true, $params); } // If we have a password generator engine enabled @@ -2176,7 +2176,7 @@ if ($action == 'create' || $action == 'adduserldap') { if (getDolGlobalString('USER_PASSWORD_GENERATED') != 'none') { if ($object->status == $object::STATUS_DISABLED) { $params['attr']['title'] = $langs->trans('UserDisabled'); - print dolGetButtonAction($langs->trans('ReinitPassword'), '', 'default', $_SERVER['PHP_SELF'].'#', '', false, $params); + print dolGetButtonAction($langs->trans('ReinitPassword'), '', 'default', dolBuildUrl($_SERVER['PHP_SELF']).'#', '', false, $params); } elseif (($user->id != $id && $permissiontoeditpasswordandsee) && $object->login && !$object->ldap_sid && ((!isModEnabled('multicompany') && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || (getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE') && $object->entity == 1))) { unset($params['attr']['title']); @@ -2198,13 +2198,13 @@ if ($action == 'create' || $action == 'adduserldap') { } } - if ($user->id != $id && $permissiontodisable && $object->statut == 0 && + if ($user->id != $id && $permissiontodisable && $object->status == User::STATUS_DISABLED && ((!isModEnabled('multicompany') && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || (getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE') && $object->entity == 1))) { unset($params['attr']['title']); print dolGetButtonAction($langs->trans('Reactivate'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=enable&token='.newToken(), '', true, $params); } // Disable user - if ($user->id != $id && $permissiontodisable && $object->statut == 1 && + if ($user->id != $id && $permissiontodisable && $object->status == User::STATUS_ENABLED && ((!isModEnabled('multicompany') && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || (getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE') && $object->entity == 1))) { unset($params['attr']['title']); print dolGetButtonAction($langs->trans('DisableUser'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=disable&token='.newToken(), '', true, $params); @@ -2304,7 +2304,7 @@ if ($action == 'create' || $action == 'adduserldap') { print ''; print '\n"; + // Search a member after member creation form + print '\n"; + print '
'; if ($action == 'editdefault_c_exp_tax_cat') { - $ret = ''; + $ret = ''; $ret .= ''; $ret .= ''; $ret .= ''; @@ -577,7 +577,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac print $form->editfieldkey("DefaultRangeNumber", 'default_range', (string) $object->default_range, $object, $user->hasRight('user', 'user', 'creer')); print ''; if ($action == 'editdefault_range') { - $ret = ''; + $ret = ''; $ret .= ''; $ret .= ''; $ret .= ''; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 4e8076444ba..2cabb21a3e7 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1593,27 +1593,27 @@ if ($action == 'create' || $action == 'adduserldap') { // Confirmation reinitialisation password if ($action == 'password') { - print $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id", $langs->trans("ReinitPassword"), $langs->trans("ConfirmReinitPassword", $object->login), "confirm_password", '', 0, 1); + print $form->formconfirm(dolBuildUrl($_SERVER['PHP_SELF'], ['id' => $object->id]), $langs->trans("ReinitPassword"), $langs->trans("ConfirmReinitPassword", $object->login), "confirm_password", '', 0, 1); } // Confirmation envoi password if ($action == 'passwordsend') { - print $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id", $langs->trans("SendNewPassword"), $langs->trans("ConfirmSendNewPassword", $object->login), "confirm_passwordsend", '', 0, 1); + print $form->formconfirm(dolBuildUrl($_SERVER['PHP_SELF'], ['id' => $object->id]), $langs->trans("SendNewPassword"), $langs->trans("ConfirmSendNewPassword", $object->login), "confirm_passwordsend", '', 0, 1); } // Confirm deactivation if ($action == 'disable') { - print $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id", $langs->trans("DisableAUser"), $langs->trans("ConfirmDisableUser", $object->login), "confirm_disable", '', 0, 1); + print $form->formconfirm(dolBuildUrl($_SERVER['PHP_SELF'], ['id' => $object->id]), $langs->trans("DisableAUser"), $langs->trans("ConfirmDisableUser", $object->login), "confirm_disable", '', 0, 1); } // Confirm activation if ($action == 'enable') { - print $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id", $langs->trans("EnableAUser"), $langs->trans("ConfirmEnableUser", $object->login), "confirm_enable", '', 0, 1); + print $form->formconfirm(dolBuildUrl($_SERVER['PHP_SELF'], ['id' => $object->id]), $langs->trans("EnableAUser"), $langs->trans("ConfirmEnableUser", $object->login), "confirm_enable", '', 0, 1); } // Confirmation delete if ($action == 'delete') { - print $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id", $langs->trans("DeleteAUser"), $langs->trans("ConfirmDeleteUser", $object->login), "confirm_delete", '', 0, 1); + print $form->formconfirm(dolBuildUrl($_SERVER['PHP_SELF'], ['id' => $object->id]), $langs->trans("DeleteAUser"), $langs->trans("ConfirmDeleteUser", $object->login), "confirm_delete", '', 0, 1); } // Confirmation clone @@ -1638,7 +1638,7 @@ if ($action == 'create' || $action == 'adduserldap') { if ($action != 'edit') { print dol_get_fiche_head($head, 'user', $title, -1, 'user', 0, '', '', 0, '', 1); - $morehtmlref = ''; + $morehtmlref = ''; $morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard").' ('.$langs->trans("AddToContacts").')', 'vcard', 'class="valignmiddle marginleftonly paddingrightonly"'); $morehtmlref .= ''; @@ -1655,7 +1655,7 @@ if ($action == 'create' || $action == 'adduserldap') { // Login print '
'.$langs->trans("Login").''; print $langs->trans("LoginAccountDisableInDolibarr"); print ''; if ($permissiontoeditgroup) { - print ''; + print ''; print img_picto($langs->trans("RemoveFromGroup"), 'unlink'); print ''; } else { diff --git a/htdocs/user/home.php b/htdocs/user/home.php index a1fff09b084..33a89c37c79 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -156,7 +156,7 @@ if ($resql) { $lastcreatedbox .= ''; $lastcreatedbox .= ''; diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 3e104e8fd5a..d03a5acbb4c 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -324,7 +324,7 @@ $head = user_prepare_head($object); $title = $langs->trans("User"); if ($action == 'edit') { - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 42b2794b1c5..34e385acd55 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -184,6 +184,7 @@ foreach ($modulesdir as $dir) { include_once $dir.$file; $objMod = new $modName($db); '@phan-var-force DolibarrModules $objMod'; + /** @var DolibarrModules $objMod */ // Load all lang files of module if (isset($objMod->langfiles) && is_array($objMod->langfiles)) { @@ -291,7 +292,7 @@ print '
'; $lastcreatedbox .= ''.$langs->trans("LastUsersCreated", min($num, $max)).''; - $lastcreatedbox .= ''; + $lastcreatedbox .= ''; $lastcreatedbox .= '...'; $lastcreatedbox .= ''; $lastcreatedbox .= '
'; // Login print ''; -if (!empty($object->ldap_sid) && $object->statut == 0) { +if (!empty($object->ldap_sid) && $object->status == 0) { print ''; @@ -356,9 +357,9 @@ print ''; print ''; if ($caneditperms) { print ''; } else { print ''; @@ -534,9 +535,9 @@ if ($result) { if ($caneditperms) { print ''; print ''."\n"; print ''."\n"; - if (getDolGlobalString('MEMBER_CODEMEMBER_ADDON') == "$file") { + if (getDolGlobalString('MEMBER_CODEMEMBER_ADDON', 'mod_member_simple') == "$file") { print '\n"; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 42798a0203a..d5fab4b50b3 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -712,23 +712,20 @@ class Adherent extends CommonObject $id = $this->db->last_insert_id(MAIN_DB_PREFIX."adherent"); if ($id > 0) { $this->id = $id; - if (getDolGlobalString('MEMBER_CODEMEMBER_ADDON') == '') { - // keep old numbering - $this->ref = (string) $id; - } else { - // auto code - $modfile = dol_buildpath('core/modules/member/'.getDolGlobalString('MEMBER_CODEMEMBER_ADDON').'.php', 0); - try { - require_once $modfile; - $modname = getDolGlobalString('MEMBER_CODEMEMBER_ADDON'); - $modCodeMember = new $modname(); - '@phan-var-force ModeleNumRefMembers $modCodeMember'; - /** @var ModeleNumRefMembers $modCodeMember */ - $this->ref = $modCodeMember->getNextValue($mysoc, $this); - } catch (Exception $e) { - dol_syslog($e->getMessage(), LOG_ERR); - $error++; - } + + $modulenum = getDolGlobalString('MEMBER_CODEMEMBER_ADDON', 'mod_member_simple'); + + $modfile = dol_buildpath('core/modules/member/'.$modulenum.'.php', 0); + try { + require_once $modfile; + $modname = $modulenum; + $modCodeMember = new $modname(); + '@phan-var-force ModeleNumRefMembers $modCodeMember'; + /** @var ModeleNumRefMembers $modCodeMember */ + $this->ref = $modCodeMember->getNextValue($mysoc, $this); + } catch (Exception $e) { + dol_syslog($e->getMessage(), LOG_ERR); + $error++; } // Update minor fields From fefc2ef466d3994163513f3f454c99b0f736b72a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Oct 2025 03:28:23 +0200 Subject: [PATCH 47/68] CSS --- htdocs/core/class/html.form.class.php | 2 +- htdocs/societe/card.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index b67ce84e023..570805aa43f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -9986,7 +9986,7 @@ class Form '; } + print ''; + print ''; + print ''; + print ''; + print '
'.$langs->trans("Login").''; print $langs->trans("LoginAccountDisableInDolibarr"); print '
'.$langs->trans("Module").''; - print ''.$langs->trans("All").""; + print ' $object->id, 'action' => 'addrights', 'entity' => $entity, 'module' => 'allmodules', 'confirm' => 'yes'], true).'">'.$langs->trans("All").""; print ' / '; - print ''.$langs->trans("None").""; + print ' $object->id, 'action' => 'delrights', 'entity' => $entity, 'module' => 'allmodules', 'confirm' => 'yes'], true).'">'.$langs->trans("None").""; print ''; print ''; print ''; @@ -603,7 +604,7 @@ if ($result) { print ''; if ($caneditperms) { print ''; - print 'id.'&confirm=yes&updatedmodulename='.$obj->module.'">'; + print ' $object->id, 'action' => 'delrights', 'entity' => $entity, 'rights' => $obj->id, 'confirm' => 'yes', 'updatedmodulename' => $obj->module], true).'">'; //print img_edit_remove($langs->trans("Remove")); print img_picto($langs->trans("Remove"), 'switch_on'); print ''; @@ -629,7 +630,7 @@ if ($result) { // Do not own permission if ($caneditperms) { print ''; - print 'id.'&confirm=yes&updatedmodulename='.$obj->module.'">'; + print ' $object->id, 'action' => 'addrights', 'entity' => $entity, 'rights' => $obj->id, 'confirm' => 'yes', 'updatedmodulename' => $obj->module], true).'">'; //print img_edit_add($langs->trans("Add")); print img_picto($langs->trans("Add"), 'switch_off'); print ''; @@ -647,7 +648,7 @@ if ($result) { print ''; if ($caneditperms) { print ''; - print 'id.'&confirm=yes&updatedmodulename='.$obj->module.'">'; + print ' $object->id, 'action' => 'addrights', 'entity' => $entity, 'rights' => $obj->id, 'confirm' => 'yes', 'updatedmodulename' => $obj->module], true).'">'; //print img_edit_add($langs->trans("Add")); print img_picto($langs->trans("Add"), 'switch_off'); print ''; diff --git a/htdocs/variants/admin/admin.php b/htdocs/variants/admin/admin.php index 25a2f951486..3bc3660fabd 100644 --- a/htdocs/variants/admin/admin.php +++ b/htdocs/variants/admin/admin.php @@ -73,14 +73,14 @@ if ($action) { $title = $langs->trans('ModuleSetup').' '.$langs->trans('Module610Name'); llxHeader('', $title); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($title, $linkback, 'title_setup'); $head = adminProductAttributePrepareHead(); print dol_get_fiche_head($head, 'admin', $title, -1, 'product'); -print ''; +print ''; print ''; print ''; diff --git a/htdocs/variants/admin/product_attribute_extrafields.php b/htdocs/variants/admin/product_attribute_extrafields.php index 7df5b9129f2..f0581df954a 100644 --- a/htdocs/variants/admin/product_attribute_extrafields.php +++ b/htdocs/variants/admin/product_attribute_extrafields.php @@ -73,7 +73,7 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; $title = $langs->trans("ProductAttributeExtrafieldsSetup"); llxHeader('', $title); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($title, $linkback, 'title_setup'); $head = adminProductAttributePrepareHead(); diff --git a/htdocs/variants/admin/product_attribute_value_extrafields.php b/htdocs/variants/admin/product_attribute_value_extrafields.php index 2120c3fff00..b9260cedf7b 100644 --- a/htdocs/variants/admin/product_attribute_value_extrafields.php +++ b/htdocs/variants/admin/product_attribute_value_extrafields.php @@ -72,7 +72,7 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; $title = $langs->trans("ProductAttributeValueExtrafieldsSetup"); llxHeader('', $title); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($title, $linkback, 'title_setup'); $head = adminProductAttributePrepareHead(); diff --git a/htdocs/variants/card.php b/htdocs/variants/card.php index d490f94a2a5..0d7548b2444 100644 --- a/htdocs/variants/card.php +++ b/htdocs/variants/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2022 Open-Dsi * Copyright (C) 2025 MDW * @@ -98,14 +98,14 @@ if ($reshook < 0) { if (empty($reshook)) { $error = 0; - $backurlforlist = dol_buildpath('/variants/list.php', 1); + $backurlforlist = dolBuildUrl(DOL_URL_ROOT.'/variants/list.php'); if (empty($backtopage) || ($cancel && empty($id))) { if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { $backtopage = $backurlforlist; } else { - $backtopage = dol_buildpath('/variants/card.php', 1).'?id='.((!empty($id) && $id > 0) ? $id : '__ID__'); + $backtopage = dolBuildUrl(DOL_URL_ROOT.'/variants/card.php', ['id' => ((!empty($id) && $id > 0) ? $id : '__ID__')]); } } } @@ -178,7 +178,7 @@ llxHeader('', $title, $help_url); if ($action == 'create') { print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("ProductAttribute")), '', 'object_' . $object->picto); - print ''; + print ''; print ''; print ''; if ($backtopage) { @@ -215,7 +215,7 @@ if ($action == 'create') { // Part to edit record print load_fiche_titre($langs->trans("ProductAttribute"), '', 'object_' . $object->picto); - print ''; + print ''; print ''; print ''; print ''; @@ -259,7 +259,7 @@ if ($action == 'create') { // Confirmation to delete if ($action == 'delete') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteMyObject'), $langs->trans('ProductAttributeDeleteDialog'), 'confirm_delete', '', 0, 1); + $formconfirm = $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]), $langs->trans('DeleteMyObject'), $langs->trans('ProductAttributeDeleteDialog'), 'confirm_delete', '', 0, 1); } elseif ($action == 'ask_deleteline') { // Confirmation to delete line $object_value = new ProductAttributeValue($db); diff --git a/htdocs/webhook/target_card.php b/htdocs/webhook/target_card.php index fcbac81cde4..47dac321fa0 100644 --- a/htdocs/webhook/target_card.php +++ b/htdocs/webhook/target_card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -231,7 +231,7 @@ if ($action == 'create') { print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Target")), '', 'object_'.$object->picto); - print ''; + print ''; print ''; print ''; if ($backtopage) { @@ -267,7 +267,7 @@ if ($action == 'create') { if (($id || $ref) && $action == 'edit') { print load_fiche_titre($langs->trans("Target"), '', 'object_'.$object->picto); - print ''; + print ''; print ''; print ''; print ''; @@ -353,7 +353,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project') . ' '; if ($permissiontoadd) { - //if ($action != 'classify') $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' '; + //if ($action != 'classify') $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' '; $morehtmlref .= ' : '; if ($action == 'classify') { //$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 0, 1, '', 'maxwidth300'); diff --git a/htdocs/webhook/triggerhistory_card.php b/htdocs/webhook/triggerhistory_card.php index 7b7dc3c82f4..1056895b2d9 100644 --- a/htdocs/webhook/triggerhistory_card.php +++ b/htdocs/webhook/triggerhistory_card.php @@ -228,7 +228,7 @@ if ($action == 'create') { print load_fiche_titre($title, '', $object->picto); - print ''; + print ''; print ''; print ''; if ($backtopage) { @@ -267,7 +267,7 @@ if ($action == 'create') { if (($id || $ref) && $action == 'edit') { print load_fiche_titre($langs->trans(""), '', $object->picto); - print ''; + print ''; print ''; print ''; print ''; @@ -378,7 +378,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($permissiontoadd) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/webhook/triggerhistory_note.php b/htdocs/webhook/triggerhistory_note.php index 36e7bf20d67..2e82e71b875 100644 --- a/htdocs/webhook/triggerhistory_note.php +++ b/htdocs/webhook/triggerhistory_note.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 Alice Adminson * * This program is free software; you can redistribute it and/or modify @@ -152,7 +152,7 @@ if ($id > 0 || !empty($ref)) { if ($permissiontoadd) { if ($action != 'classify') - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref.=' : '; if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/webservices/admin/index.php b/htdocs/webservices/admin/index.php index d1941e945a2..8b777b023c6 100644 --- a/htdocs/webservices/admin/index.php +++ b/htdocs/webservices/admin/index.php @@ -71,7 +71,7 @@ if ($actionsave) { llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-webservices page-admin_index'); -$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; +$linkback = ''.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("WebServicesSetup"), $linkback, 'title_setup'); diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index 4fe65e3257d..9ddf2a27e32 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -1,7 +1,7 @@ * Copyright (C) 2023-2024 Lionel Vessiller - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -218,7 +218,7 @@ if ($action == 'create') { print load_fiche_titre($langs->trans("NewWebsiteAccount", $langs->transnoentitiesnoconv("WebsiteAccount"))); - print ''; + print ''; print ''; print ''; if ($backtopage) { @@ -256,7 +256,7 @@ if ($action == 'create') { if (($id || $ref) && $action == 'edit') { print load_fiche_titre($langs->trans("WebsiteAccount")); - print ''; + print ''; print ''; print ''; print ''; @@ -341,7 +341,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { if ($action != 'classify') { - $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); $morehtmlref.=''; diff --git a/htdocs/workstation/workstation_agenda.php b/htdocs/workstation/workstation_agenda.php index 92b0976de09..9044ea0a8a6 100644 --- a/htdocs/workstation/workstation_agenda.php +++ b/htdocs/workstation/workstation_agenda.php @@ -2,7 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2020 Gauthier VERDOL - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -167,7 +167,7 @@ if ($object->id > 0) { if ($permissiontoadd) { if ($action != 'classify') - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref.=' : '; if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/workstation/workstation_card.php b/htdocs/workstation/workstation_card.php index 051f163a993..ab42cb0ba8c 100644 --- a/htdocs/workstation/workstation_card.php +++ b/htdocs/workstation/workstation_card.php @@ -212,7 +212,7 @@ if ($action == 'create') { print load_fiche_titre($title, '', 'object_'.$object->picto); - print ''; + print ''; print ''; print ''; if ($backtopage) { @@ -264,7 +264,7 @@ if ($action == 'create') { if (($id || $ref) && $action == 'edit') { print load_fiche_titre($langs->trans("Workstation"), '', 'object_'.$object->picto); - print ''; + print ''; print ''; print ''; print ''; @@ -371,7 +371,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($permissiontoadd) { $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); } else { diff --git a/htdocs/workstation/workstation_document.php b/htdocs/workstation/workstation_document.php index 5d6f97cef5d..5b6758f0c1e 100644 --- a/htdocs/workstation/workstation_document.php +++ b/htdocs/workstation/workstation_document.php @@ -147,7 +147,7 @@ if ($object->id && $upload_dir !== null) { if ($permissiontoadd) { if ($action != 'classify') - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref.=' : '; if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/workstation/workstation_note.php b/htdocs/workstation/workstation_note.php index 94fb9759d0f..10df4cb94ff 100644 --- a/htdocs/workstation/workstation_note.php +++ b/htdocs/workstation/workstation_note.php @@ -2,7 +2,7 @@ /* Copyright (C) 2007-2017 Laurent Destailleur * Copyright (C) 2020 Gauthier VERDOL - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 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 @@ -120,7 +120,7 @@ if ($id > 0 || !empty($ref)) { if ($permissiontoadd) { if ($action != 'classify') - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; $morehtmlref.=' : '; if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); From c0e395ee11065cdf0f69c08c2e3a4ea787b2eab2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Oct 2025 02:53:01 +0200 Subject: [PATCH 46/68] Clean code --- htdocs/adherents/admin/member.php | 2 +- htdocs/adherents/class/adherent.class.php | 31 ++++++++++------------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php index f5b13cbb620..00d247d1d63 100644 --- a/htdocs/adherents/admin/member.php +++ b/htdocs/adherents/admin/member.php @@ -367,7 +367,7 @@ foreach ($arrayofmodules as $file => $modCodeMember) { print '
'.$modCodeMember->info($langs).''.$modCodeMember->getExample().''."\n"; print img_picto($langs->trans("Activated"), 'switch_on'); print "browser->layout != 'phone' ? 'colspan="3"' : 'colspan="2"').'>'; if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTS')) { - print ''; + print ''; } if (!getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS')) { - print ''; + print ''; } if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire')) || (isModEnabled('supplier_proposal') && $user->hasRight('supplier_proposal', 'lire'))) { // Supplier - print ''; + print ''; } // Add js to manage the background of nature if ($conf->use_javascript_ajax) { From 6e184d41955b191435214bd20f415dc95e4251bc Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Fri, 17 Oct 2025 03:29:57 +0200 Subject: [PATCH 48/68] NEW : add free numbering module for members (#35636) * NEW : add free numbering module for members * fix next value * fix codesniffer * fix phan * fix missing class declaration * rename module --------- Co-authored-by: Christophe Battarel --- .../core/modules/member/mod_member_custom.php | 162 ++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 htdocs/core/modules/member/mod_member_custom.php diff --git a/htdocs/core/modules/member/mod_member_custom.php b/htdocs/core/modules/member/mod_member_custom.php new file mode 100644 index 00000000000..3fb668b93b2 --- /dev/null +++ b/htdocs/core/modules/member/mod_member_custom.php @@ -0,0 +1,162 @@ + + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see https://www.gnu.org/ + */ + +/** + * \file htdocs/core/modules/member/mod_member_custom.php + * \ingroup member + * \brief Fichier contenant la class du modele de numerotation d'ahérent Custom + */ + +require_once DOL_DOCUMENT_ROOT.'/core/modules/member/modules_member.class.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; + + +/** + * Class to manage member report numbering rules Custom + */ +class mod_member_custom extends ModeleNumRefMembers +{ + /** + * Dolibarr version of the loaded document + * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental' + */ + public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' + + /** + * @var string Error message + */ + public $error = ''; + + /** + * @var string Nom du modele + * @deprecated + * @see $name + */ + public $nom = 'Custom'; + + /** + * @var string model name + */ + public $name = 'Custom'; + + + /** + * Returns the description of the numbering model + * + * @param Translate $langs Lang object to use for output + * @return string Descriptive text + */ + public function info($langs) + { + global $db, $langs; + + $langs->load("bills"); + + $form = new Form($db); + + $texte = $langs->trans('GenericNumRefModelDesc')."
\n"; + $texte .= ''; + $texte .= ''; + $texte .= ''; + $texte .= ''; + $texte .= ''; + + $texte .= ''; + + $tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("Member"), $langs->transnoentities("Member")); + $tooltip .= $langs->trans("GenericMaskCodes1"); + $tooltip .= '
'; + //$tooltip.=$langs->trans("GenericMaskCodes2"); + $tooltip .= $langs->trans("GenericMaskCodes3"); + $tooltip .= $langs->trans("GenericMaskCodes4a", $langs->transnoentities("Member"), $langs->transnoentities("Member")); + $tooltip .= $langs->trans("GenericMaskCodes5"); + $tooltip .= '
'.$langs->trans("GenericMaskCodes5b"); + + // Parametrage du prefix + $texte .= ''; + $mask = getDolGlobalString('MEMBER_CUSTOM_MASK'); + $texte .= ''; + + $texte .= ''; + + $texte .= ''; + + $texte .= '
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name).' 
'; + $texte .= ''; + + return $texte; + } + + /** + * Return an example of numbering + * + * @return string Example + */ + public function getExample() + { + global $db, $langs, $user; + + $member = new Adherent($db); + $member->initAsSpecimen(); + $member->fk_user_author = $user->id; + + $numExample = $this->getNextValue(null, $member); + + if (!$numExample) { + $numExample = $langs->trans('NotConfigured'); + } + return $numExample; + } + + /** + * Return next free value + * + * @param ?Societe $objsoc Object third party + * @param ?Adherent $object Object we need next value for + * @return string|int<-1,0> Next value if OK, -1 or 0 if KO + */ + public function getNextValue($objsoc, $object) + { + global $db; + + require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + + // We get cursor rule + $mask = getDolGlobalString('MEMBER_CUSTOM_MASK'); + + if (!$mask) { + $this->error = 'NotConfigured'; + return 0; + } + + $date = dol_now(); + + $fuser = null; + if ($object->fk_user_author > 0) { + $fuser = new User($db); + $fuser->fetch($object->fk_user_author); + } + + // Get entities + $entity = getEntity('membernumber', 1, $object); + + $numFinal = get_next_value($db, $mask, 'adherent', 'ref', '', null, $date, 'next', true, $fuser, $entity); + + return $numFinal; + } +} From b395cee7c87f2d8d4926cc060eda662f41ec77b9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Oct 2025 03:33:54 +0200 Subject: [PATCH 49/68] Use position on each numbering module --- .../modules/member/mod_member_advanced.php | 5 +++++ .../core/modules/member/mod_member_custom.php | 22 +++++++++---------- .../core/modules/member/mod_member_simple.php | 5 +++++ 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/htdocs/core/modules/member/mod_member_advanced.php b/htdocs/core/modules/member/mod_member_advanced.php index a158c9ef21d..e2bc1ec8860 100644 --- a/htdocs/core/modules/member/mod_member_advanced.php +++ b/htdocs/core/modules/member/mod_member_advanced.php @@ -36,6 +36,11 @@ class mod_member_advanced extends ModeleNumRefMembers public $name = 'Advanced'; public $version = 'dolibarr'; + /** + * @var int Position + */ + public $position = 40; + // variables not inherited /** diff --git a/htdocs/core/modules/member/mod_member_custom.php b/htdocs/core/modules/member/mod_member_custom.php index 3fb668b93b2..185367485a1 100644 --- a/htdocs/core/modules/member/mod_member_custom.php +++ b/htdocs/core/modules/member/mod_member_custom.php @@ -31,29 +31,27 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; */ class mod_member_custom extends ModeleNumRefMembers { + /** + * @var string model name + */ + public $name = 'Custom'; + /** * Dolibarr version of the loaded document * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental' */ public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' + /** + * @var int Position + */ + public $position = 50; + /** * @var string Error message */ public $error = ''; - /** - * @var string Nom du modele - * @deprecated - * @see $name - */ - public $nom = 'Custom'; - - /** - * @var string model name - */ - public $name = 'Custom'; - /** * Returns the description of the numbering model diff --git a/htdocs/core/modules/member/mod_member_simple.php b/htdocs/core/modules/member/mod_member_simple.php index cf5d55f2a49..e69f7071730 100644 --- a/htdocs/core/modules/member/mod_member_simple.php +++ b/htdocs/core/modules/member/mod_member_simple.php @@ -36,6 +36,11 @@ class mod_member_simple extends ModeleNumRefMembers public $name = 'Simple'; public $version = 'dolibarr'; + /** + * @var int Position + */ + public $position = 30; + // variables not inherited /** From 88607b2eda89cc44095b49a48269516b9a819855 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 17 Oct 2025 03:46:20 +0200 Subject: [PATCH 50/68] QUAL Accountancy - Use xxx_prepare_head() on accounting transaction (#35778) * QUAL Accountancy - Use xxx_prepare_head() on accounting transaction * Fix phpstan * Fix phpstan * Fix according to Frederic --------- Co-authored-by: Laurent Destailleur --- htdocs/accountancy/bookkeeping/card.php | 8 +------ htdocs/core/lib/accounting.lib.php | 32 +++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 42303f17696..142d82f7ee8 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -606,13 +606,7 @@ if ($action == 'create') { print load_fiche_titre($langs->trans("UpdateMvts"), $backlink); }*/ - $head = array(); - $h = 0; - $head[$h][0] = DOL_URL_ROOT."/accountancy/bookkeeping/card.php".'?piece_num='.((int) $object->piece_num).($mode ? '&mode='.$mode : '').($type ? '&type='.$type : '').'&backtopage='.urlencode($backtopage); - $head[$h][1] = $langs->trans("Transaction"); - $head[$h][2] = 'transaction'; - $h++; - + $head = accounting_transaction_prepare_head($object, $mode, $type, $backtopage); print dol_get_fiche_head($head, 'transaction', '', -1); //$object->label = $object->doc_ref; diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php index 909a63fbab7..228b88a176f 100644 --- a/htdocs/core/lib/accounting.lib.php +++ b/htdocs/core/lib/accounting.lib.php @@ -73,6 +73,38 @@ function accounting_prepare_head(AccountingAccount $object) return $head; } +/** + * Prepare array with list of tabs for accounting transaction + * + * @param BookKeeping $object Bookkeeping + * @param string $mode Mode _tmp if operation are drafted + * @param string $type Type of list "sub" (for subsidiary list) or not + * @param string $backtopage Back to page (return on ledger by default) + * @return array Array of tabs to show + */ +function accounting_transaction_prepare_head(BookKeeping $object, $mode = '', $type = '', $backtopage = '/accountancy/bookkeeping/listbyaccount.php') +{ + global $langs, $conf; + + $h = 0; + $head = array(); + + $head[$h][0] = dolBuildUrl(DOL_URL_ROOT.'/accountancy/bookkeeping/card.php', ['piece_num' => $object->piece_num, 'mode' => $mode, 'type' => $type, 'backtopage' => $backtopage]); + $head[$h][1] = $langs->trans("Transaction"); + $head[$h][2] = 'transaction'; + $h++; + + // Show more tabs from modules + // Entries must be declared in modules descriptor with line + // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab + // $this->tabs = array('entity:-tabname); to remove a tab + complete_head_from_modules($conf, $langs, $object, $head, $h, 'accounting_transaction'); + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'accounting_transaction', 'remove'); + + return $head; +} + /** * Return accounting account without zero on the right * From b1854b7d4f1b8604bd69f47ca7938d0d550b37ad Mon Sep 17 00:00:00 2001 From: John BOTELLA <68917336+thersane-john@users.noreply.github.com> Date: Fri, 17 Oct 2025 12:22:20 +0200 Subject: [PATCH 51/68] UIUX : webportal css style PART 02 (#35774) * Add css * FIX CSS and UX * fix php doc * Fix missing badge for status * fix download link css * change space on comment --- htdocs/public/webportal/css/badges.css | 98 ++++++++++++++++++- htdocs/public/webportal/css/pico.css.php | 5 +- htdocs/public/webportal/css/style.css.php | 4 + .../class/html.formwebportal.class.php | 3 +- 4 files changed, 105 insertions(+), 5 deletions(-) diff --git a/htdocs/public/webportal/css/badges.css b/htdocs/public/webportal/css/badges.css index 7e06b2d173b..9d0804fe5e7 100644 --- a/htdocs/public/webportal/css/badges.css +++ b/htdocs/public/webportal/css/badges.css @@ -6,6 +6,7 @@ --spacing : 0.25rem; --tw-font-weight: var(--font-weight-medium); --radius-sm : 0.25rem; + --border-size: 1px; font-weight: var(--font-weight-medium); font-size: var(--text-xs); @@ -14,10 +15,10 @@ padding-inline: calc(var(--spacing) * 2.5); margin-inline-end: calc(var(--spacing) * 2); border-radius: var(--radius-sm); + white-space: nowrap; color: #1e40af; background-color: #dbeafe; - white-space: nowrap; --badge-color-border : #60a5fa; } @@ -25,16 +26,22 @@ border-radius: 9999999px; } .badge.--border { - border: 1px solid var(--badge-color-border); + border: var(--border-size) solid var(--badge-color-border); } .badge.--border-dashed { - border: 1px dashed var(--badge-color-border); + border: var(--border-size) dashed var(--badge-color-border); } .badge.--border.--no-bg, .badge.--border-dashed.--no-bg { background-color: #f3f4f6; color: #1f2937; } +/* default color */ +.badge.--blue{ + color: #1e40af; + background-color: #dbeafe; + --badge-color-border : #60a5fa; +} .badge.--yellow { --badge-color-border : #fcd34d; @@ -42,6 +49,18 @@ background-color: #fef3c7; } +.badge.--light{ + --badge-color-border :#cad2d2; + color: #717171; + background-color: #ffffff; +} + +.badge.--grey{ + --badge-color-border : #b1b1b1; + color: #474747; + background-color: #e7e7e7; +} + .badge.--dark { --badge-color-border : #1f2937; color: #1f2937; @@ -85,3 +104,76 @@ font-weight: bold; border-radius: 30px; } + +/** ******************************************************* + * STATUS BADGES + * --------------------------------------------------------- + * The styles for status badges are defined separately, + * although they are initially based on the standard badge styles. + * + * Reason: + * Status badges are not regular badges. To prevent future mistakes + * (e.g., someone unintentionally altering status badge appearance + * when modifying the standard badge styles), + * these definitions are isolated here. + ******************************************************** */ + +/* All status */ +.badge-status { + font-weight: var(--font-weight-semibold); +} + +/* All status with border solid */ +.badge-status3,.badge-status5,.badge-status7 { + border: var(--border-size) solid var(--badge-color-border); +} + +/* All status with border dashed */ +.badge-status0 { + border: var(--border-size) dashed var(--badge-color-border); +} + +/* +* Now define all colors +*/ + +/* light color based */ +.badge-status0, .badge-status5 , .badge-status9 { + --badge-color-border :#cad2d2; + color: #717171; + background-color: #ffffff; +} + +/* yellow color based */ +.badge-status1, .badge-status3 { + --badge-color-border : #fcd34d; + color: #92400e; + background-color: #fef3c7; +} + +.badge-status2 { + color: #1e40af; + background-color: #dbeafe; + --badge-color-border : #60a5fa; +} + +/* green color based */ +.badge-status4, .badge-status7 { + --badge-color-border :#34d399; + color: #065f46; + background-color: #d1fae5; +} + +/* grey color based */ +.badge-status6 { + --badge-color-border : #b1b1b1; + color: #474747; + background-color: #e7e7e7; +} + +/* pink color based */ +.badge-status8 { + --badge-color-border :#f472b6; + color: #9d174d; + background-color: #fce7f3; +} diff --git a/htdocs/public/webportal/css/pico.css.php b/htdocs/public/webportal/css/pico.css.php index da4141dfdde..dda7fa10c3d 100644 --- a/htdocs/public/webportal/css/pico.css.php +++ b/htdocs/public/webportal/css/pico.css.php @@ -73,8 +73,11 @@ if (empty($dolibarr_nocache)) { "Cantarell", "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; --line-height: 1.5; - --font-weight: 400; + --font-weight-light: 200; --font-weight-medium: 300; + --font-weight: 400; + --font-weight-semibold: 600; + --font-weight-bold: 700; --font-size: 16px; --border-radius: 0.25rem; --border-width: 1px; diff --git a/htdocs/public/webportal/css/style.css.php b/htdocs/public/webportal/css/style.css.php index 87bbffecd1b..a65741c4be3 100644 --- a/htdocs/public/webportal/css/style.css.php +++ b/htdocs/public/webportal/css/style.css.php @@ -255,6 +255,10 @@ a:link, a:visited, a:hover, a:active, .classlink { white-space: nowrap; } +.btn-download-link:not(:first-child){ + margin-left: 10px; +} + /** Home Styles */ diff --git a/htdocs/webportal/class/html.formwebportal.class.php b/htdocs/webportal/class/html.formwebportal.class.php index 8ab94ea2537..82c0c743cfd 100644 --- a/htdocs/webportal/class/html.formwebportal.class.php +++ b/htdocs/webportal/class/html.formwebportal.class.php @@ -327,7 +327,8 @@ class FormWebPortal extends Form // Download $url = $context->getControllerUrl('document') . '&modulepart=' . $modulepart . '&entity=' . $entity . '&file=' . urlencode($relativepath) . '&soc_id=' . $context->logged_thirdparty->id; - $tmpout .= ' Date: Fri, 17 Oct 2025 13:41:01 +0200 Subject: [PATCH 52/68] Fix allowed styles in ckeditor --- htdocs/core/class/doleditor.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index adb474cb416..f447af39301 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -207,9 +207,13 @@ class DolEditor $fullpage = false; + // syntax is [] for attributes and {} for value inside style $extraAllowedContent = 'a[target];'; $extraAllowedContent .= 'section[contenteditable,id];'; - $extraAllowedContent .= 'div{background-color,color,display,float,height,margin,margin-top,margin-bottom,padding,width,border-top-left-radius,border-top-right-radius,border-bottom-left-radius,border-bottom-right-radius,box-shadow}'; + $extraAllowedContent .= 'table{border-spacing};'; + $extraAllowedContent .= 'td{padding};'; + $extraAllowedContent .= 'p{margin-left,margin-right,margin-top,margin-bottom,padding,line-height};'; + $extraAllowedContent .= 'div{background-color,color,display,float,height,margin,margin-top,margin-bottom,padding,padding-left,padding-right,padding-top,padding-bottom,width,border-top-left-radius,border-top-right-radius,border-bottom-left-radius,border-bottom-right-radius,box-shadow}'; if (is_string($restrictContent)) { $extraAllowedContent = $restrictContent; From c48d4db3a5366136ea3164a6e280e4301a89e529 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Oct 2025 15:43:48 +0200 Subject: [PATCH 53/68] Trans --- htdocs/langs/en_US/members.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index fab66859400..9735fa94023 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -227,7 +227,7 @@ SubscriptionRecorded=Contribution recorded NoEmailSentToMember=No email sent to member EmailSentToMember=Email sent to member at %s SendReminderForExpiredSubscriptionTitle=Send reminder by email for expired membership -SendReminderForExpiredSubscription=Send reminder by email to members when membership is about to expire (parameter is number of days before end of membership to send the reminder. It can be a list of days separated by a semicolon, for example '10;5;0;-5') +SendReminderForExpiredSubscription=Send reminder by email to members when membership is about to expire (parameter is number of days before end of membership to send the reminder. It can be a list of days separated by a semicolon, for example '10;5;0;-5'). The template of email to send is defined in setup of membership module. MembershipPaid=Membership paid for current period (until %s) YouMayFindYourInvoiceInThisEmail=You may find your invoice attached to this email XMembersClosed=%s member(s) closed From 276f792e9ab3406b26bf95a18f2b541845b05060 Mon Sep 17 00:00:00 2001 From: William Mead Date: Fri, 17 Oct 2025 15:45:59 +0200 Subject: [PATCH 54/68] Fixed return object for expense report API (#35813) --- htdocs/expensereport/class/expensereport.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 301f4769bb2..755573242ca 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -7,6 +7,7 @@ * Copyright (C) 2016-2020 Ferran Marcet * Copyright (C) 2024-2025 MDW * Copyright (C) 2024-2025 Frédéric France + * Copyright (C) 2025 William Mead * * 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 @@ -1501,16 +1502,16 @@ class ExpenseReport extends CommonObject $now = dol_now(); $error = 0; - // date approval - $this->date_approve = $now; if ($this->status != self::STATUS_APPROVED) { $this->db->begin(); - $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql .= " SET ref = '".$this->db->escape($this->ref)."', fk_statut = ".self::STATUS_APPROVED.", fk_user_approve = ".((int) $fuser->id).","; - $sql .= " date_approve='".$this->db->idate($this->date_approve)."'"; + $sql .= " date_approve='".$this->db->idate($now)."'"; $sql .= " WHERE rowid = ".((int) $this->id); if ($this->db->query($sql)) { + $this->status = self::STATUS_APPROVED; + $this->date_approve = $now; + $this->fk_user_approve = $fuser->id; if (!$notrigger) { // Call trigger $result = $this->call_trigger('EXPENSE_REPORT_APPROVE', $fuser); From 9447f04876ba6d520ba34a594889883d384ff48a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 17 Oct 2025 15:46:08 +0200 Subject: [PATCH 55/68] PHPStan > Update baseline (#35810) Co-authored-by: Dolibot --- dev/build/phpstan/phpstan-baseline.neon | 6 ------ 1 file changed, 6 deletions(-) diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index 5e9471e4f1a..73988b23993 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -4446,12 +4446,6 @@ parameters: count: 1 path: ../../../htdocs/core/actions_setmoduleoptions.inc.php - - - message: '#^Variable \$result might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/actions_setnotes.inc.php - - message: '#^Loose comparison using \=\= between ''directory'' and ''directory'' will always evaluate to true\.$#' identifier: equal.alwaysTrue From 0245482bc650577210306e24c135b187c3906e09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josep=20Llu=C3=ADs?= Date: Fri, 17 Oct 2025 15:50:47 +0200 Subject: [PATCH 56/68] NEW Add configuration for default timesheet menu (#35805) * Add configuration for default timesheet menu Using PROJECT_OPEN_ALWAYS_ON_TIMESHEET config, you can use variables "perweek" (default), "perday" or "permonth" * Update eldy.lib.php * Fix default value for optionTimesheet variable --------- Co-authored-by: Laurent Destailleur --- htdocs/core/menus/standard/eldy.lib.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index b10060f69d2..c86410ea2e3 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -10,6 +10,7 @@ * Copyright (C) 2022-2023 Solution Libre SAS * Copyright (C) 2024-2025 MDW * Copyright (C) 2024-2025 Alexandre Spangaro + * Copyright (C) 2025 Josep Lluís Amador * * 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 @@ -2419,7 +2420,8 @@ function get_left_menu_projects($mainmenu, &$newmenu, $usemenuhider = 1, $leftme $newmenu->add("/projet/tasks/list.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->hasRight('projet', 'lire')); $newmenu->add("/projet/tasks/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->hasRight('projet', 'lire')); - $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("TimeEntry"), 0, $user->hasRight('projet', 'lire'), '', 'project', 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="paddingright pictofixedwidth"')); + $optionTimesheet = getDolGlobalString('PROJECT_OPEN_ALWAYS_ON_TIMESHEET', "perweek"); + $newmenu->add("/projet/activity/".$optionTimesheet.".php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("TimeEntry"), 0, $user->hasRight('projet', 'lire'), '', 'project', 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="paddingright pictofixedwidth"')); $newmenu->add("/projet/tasks/time.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->hasRight('projet', 'lire')); } } @@ -2527,7 +2529,8 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = $search_project_user = GETPOSTINT('search_project_user'); - $newmenu->add(dolBuildUrl('/projet/activity/perweek.php', ['leftmenu' => 'tasks', 'search_project_user' => ($search_project_user ? $search_project_user : '')]), $langs->trans("TimeEntry"), 0, $user->hasRight('projet', 'lire'), '', $mainmenu, 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="paddingright pictofixedwidth"')); + $optionTimesheet = getDolGlobalString('PROJECT_OPEN_ALWAYS_ON_TIMESHEET', "perweek"); + $newmenu->add(dolBuildUrl('/projet/activity/'.$optionTimesheet.'.php', ['leftmenu' => 'tasks', 'search_project_user' => ($search_project_user ? $search_project_user : '')]), $langs->trans("TimeEntry"), 0, $user->hasRight('projet', 'lire'), '', $mainmenu, 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="paddingright pictofixedwidth"')); } } } From 3c5d6b96495389ba4be32537d041cf2eed4f3ac6 Mon Sep 17 00:00:00 2001 From: William Mead Date: Fri, 17 Oct 2025 15:52:42 +0200 Subject: [PATCH 57/68] NEW: Option to clone parent categories on variant creation (#35806) * Added option to clone parent categories on product variant creation * Updated PHPDoc --- htdocs/variants/class/ProductCombination.class.php | 13 ++++++++++++- htdocs/variants/combinations.php | 9 ++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/htdocs/variants/class/ProductCombination.class.php b/htdocs/variants/class/ProductCombination.class.php index 3765b20ef82..47c4d479601 100644 --- a/htdocs/variants/class/ProductCombination.class.php +++ b/htdocs/variants/class/ProductCombination.class.php @@ -749,9 +749,10 @@ class ProductCombination * @param false|float $forced_weightvar Value of the weight variation if it is forced * @param false|string $forced_refvar Value of the reference if it is forced * @param string $ref_ext External reference + * @param bool $clone_categories Add parent product categories to the created variant * @return int<-1,1> Return integer <0 KO, >0 OK */ - public function createProductCombination(User $user, Product $product, array $combinations, array $variations, $price_var_percent = false, $forced_pricevar = false, $forced_weightvar = false, $forced_refvar = false, $ref_ext = '') + public function createProductCombination(User $user, Product $product, array $combinations, array $variations, $price_var_percent = false, $forced_pricevar = false, $forced_weightvar = false, $forced_refvar = false, $ref_ext = '', $clone_categories = false) { global $conf; @@ -948,6 +949,16 @@ class ProductCombination $newcomb->fk_product_child = $newproduct->id; + if ($clone_categories) { + $clone_result = $newproduct->cloneCategories($product->id, $newproduct->id); + if ($clone_result < 0) { + $this->error = $newproduct->error; + $this->errors = $newproduct->errors; + $this->db->rollback(); + return -1; + } + } + if ($newcomb->update($user) < 0) { $this->error = $newcomb->error; $this->errors = $newcomb->errors; diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index bad1f4f8269..360bea21987 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -4,6 +4,7 @@ * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2022 Open-Dsi * Copyright (C) 2024-2025 MDW + * Copyright (C) 2025 William Mead * * 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,6 +56,7 @@ $level_price_impact = array_map('price2num', $level_price_impact); $level_price_impact = array_map('floatval', $level_price_impact); $level_price_impact_percent = GETPOST('level_price_impact_percent', 'array'); $level_price_impact_percent = array_map('boolval', $level_price_impact_percent); +$clone_categories = (bool) GETPOST('clone_categories'); $form = new Form($db); @@ -196,7 +198,7 @@ if (($action == 'add' || $action == 'create') && $usercancreate && empty($massac // sanit_feature is an array with 1 (and only 1) value per attribute. // For example: Color->blue, Size->Small, Option->2 if (!$prodcomb->fetchByProductCombination2ValuePairs($id, $sanit_features)) { - $result = $prodcomb->createProductCombination($user, $object, $sanit_features, array(), $level_price_impact_percent, $level_price_impact, (float) $weight_impact, $reference); + $result = $prodcomb->createProductCombination($user, $object, $sanit_features, array(), $level_price_impact_percent, $level_price_impact, (float) $weight_impact, $reference, '', $clone_categories); if ($result > 0) { setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); unset($_SESSION['addvariant_'.$object->id]); @@ -759,6 +761,11 @@ if (!empty($id) || !empty($ref)) { print '
'; } From 54a2335d79c93072216907cb397a68af9fc1aeac Mon Sep 17 00:00:00 2001 From: Vincent Maury Date: Fri, 17 Oct 2025 15:56:17 +0200 Subject: [PATCH 58/68] Display error message when impossible to create user from contact (#35807) Co-authored-by: vmaury --- htdocs/contact/card.php | 3 +++ htdocs/langs/en_US/companies.lang | 1 + htdocs/langs/fr_FR/companies.lang | 1 + 3 files changed, 5 insertions(+) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 6e63db36c66..d91e2e1f593 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -184,6 +184,9 @@ if (empty($reshook)) { $errors = $nuser->errors; $db->rollback(); } + if ($error) { + setEventMessage($langs->trans('ImpossibleToCreateUserFromContact').' : '.$nuser->errorsToString(), 'errors'); + } } else { $error = $object->error; $errors = $object->errors; diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 143fffa8648..3fed4f40761 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -475,3 +475,4 @@ SocialNetworksBusiness=Social networks for company ErrorCommercialNotAllowedForThirdparty=The user %s has not the permission to see all thirdparties and is not an allowed sale representative of the company. EnablePublicCompanyPages=Enable the public contact page PublicInterfaceCompanyDesc=This option offer a public page to offer an online contact form to allow any anonymous visitor to send you a message (creating also a thirdparty and/or contact, automatically). +ImpossibleToCreateUserFromContact=Impossible to create user from this contact diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang index 2ef145999cc..ef8a947bfb8 100644 --- a/htdocs/langs/fr_FR/companies.lang +++ b/htdocs/langs/fr_FR/companies.lang @@ -473,3 +473,4 @@ NewSocNameForClone=Nouveau nom société ConfirmCloneThirdparties=Êtes-vous sûr de vouloir cloner %s société ? SocialNetworksBusiness=Réseaux sociaux de la société ErrorCommercialNotAllowedForThirdparty=Le utilisateur %s n'a pas l'autorisation de voir tous les tiers et n'est pas un représentant commercial autorisé du société. +ImpossibleToCreateUserFromContact=Impossible de créer l'utilisateur à partir ce ce contact From 8fb42b00618f7534464748dd30d6e6a669dbbbf5 Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Fri, 17 Oct 2025 18:13:39 +0200 Subject: [PATCH 59/68] New fetch member to redirect to membership payment (#35808) * New fetch member to redirect to membership payment * add constant * fix CI * Update new.php * Fix formatting of conditional check for member search --------- Co-authored-by: Lucas Marcouiller Co-authored-by: Laurent Destailleur --- htdocs/adherents/admin/website.php | 7 +++ htdocs/langs/en_US/members.lang | 3 + htdocs/public/members/new.php | 91 +++++++++++++++++++++++++++--- 3 files changed, 94 insertions(+), 7 deletions(-) diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index 3942635e4b7..34fe35153ca 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -312,6 +312,13 @@ if (getDolGlobalString('MEMBER_ENABLE_PUBLIC')) { print $form->selectarray("MEMBER_NEWFORM_PAYONLINE", $listofval, getDolGlobalString('MEMBER_NEWFORM_PAYONLINE'), 0); print "
'; + print $langs->trans("MEMBER_SEARCH_MEMBER_PUBLIC_FORM_CREATE"); + print ''; + print $form->selectyesno("MEMBER_SEARCH_MEMBER_PUBLIC_FORM_CREATE"); // Reverse the logic "hide -> show" for retrocompatibility + print "
'; print '
'; diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index 9735fa94023..31fbff8f215 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -262,3 +262,6 @@ MergeMembers=Merge members ConfirmMergeMembers=Are you sure you want to merge the chosen member with the current one ? ErrorMembersMerge=There was an error when merging the members. Please check the log. Changes have been reverted. ConfirmCreateMember=Confirm create member +CorrespondingMemberFound=Corresponding member found +CorrespondingMemberFoundQuestion=A member has been found with the given information.
Do you want to renew your membership? +MEMBER_SEARCH_MEMBER_PUBLIC_FORM_CREATE=Searches for a member matching the information entered in the public member creation form. If a member is found, redirects the user to the membership payment form diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 055f0700971..14a19156b76 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -194,6 +194,73 @@ if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } +// Verify if we can find member +if (empty($reshook) && getDolGlobalInt("MEMBER_SEARCH_MEMBER_PUBLIC_FORM_CREATE") && $action == 'add' && !GETPOSTISSET("nofetchmember")) { // Test on permission not required here + $memberfound = false; + if (!getDolGlobalString('ADHERENT_LOGIN_NOT_REQUIRED') && GETPOSTISSET('login')) { + $sql = "SELECT rowid as id"; + $sql .= " FROM ".MAIN_DB_PREFIX."adherent as a"; + $sql .= " WHERE a.login = '".$db->escape(GETPOST('login'))."'"; + $sql .= " AND statut = 1"; + $sql .= " AND entity IN (".getEntity($object->element).")"; + $resql = $db->query($sql); + if ($resql) { + if ($db->num_rows($resql) == 1) { + $obj = $db->fetch_object($resql); + $object->fetch($obj->id); + $memberfound = true; + } + } else { + dol_print_error($db); + } + } + + if (!$memberfound && GETPOST("morphy") == 'mor' && GETPOSTISSET("societe") ) { + $sql = "SELECT a.rowid as id"; + $sql .= " FROM ".MAIN_DB_PREFIX."adherent as a"; + $sql .= " JOIN ".MAIN_DB_PREFIX."societe as s"; + $sql .= " ON a.fk_soc = s.rowid"; + $sql .= " WHERE s.nom = '".$db->escape(GETPOST("societe", 'alphanohtml'))."'"; + $sql .= " AND a.email = '".$db->escape(preg_replace('/\s+/', '', GETPOST("member_email", 'aZ09arobase')))."'"; + $sql .= " AND a.statut = 1"; + $sql .= " AND a.entity IN (".getEntity($object->element).")"; + $resql = $db->query($sql); + if ($resql) { + if ($db->num_rows($resql) == 1) { + $obj = $db->fetch_object($resql); + $object->fetch($obj->id); + $memberfound = true; + } + } else { + dol_print_error($db); + } + } + + if (!$memberfound && GETPOST("morphy") == 'phy' && GETPOSTISSET("lastname") && GETPOSTISSET("firstname") && !empty(GETPOST("member_email", 'aZ09arobase'))) { + $sql = "SELECT rowid as id"; + $sql .= " FROM ".MAIN_DB_PREFIX."adherent"; + $sql .= " WHERE firstname = '".$db->escape(GETPOST("firstname", 'alphanohtml'))."'"; + $sql .= " AND lastname = '".$db->escape(GETPOST("lastname", 'alphanohtml'))."'"; + $sql .= " AND email = '".$db->escape(preg_replace('/\s+/', '', GETPOST("member_email", 'aZ09arobase')))."'"; + $sql .= " AND statut = 1"; + $sql .= " AND entity IN (".getEntity($object->element).")"; + $resql = $db->query($sql); + if ($resql) { + if ($db->num_rows($resql) == 1) { + $obj = $db->fetch_object($resql); + $object->fetch($obj->id); + $memberfound = true; + } + } else { + dol_print_error($db); + } + } + + if ($memberfound) { + $action = 'subscription'; + } +} + // Action called when page is submitted if (empty($reshook) && $action == 'add') { // Test on permission not required here. This is an anonymous form. Check is done on constant to enable and mitigation. $error = 0; @@ -546,13 +613,21 @@ print '
'; dol_htmloutput_errors($errmsg); dol_htmloutput_events(); +if ($action == "subscription") { + $urltocall = DOL_URL_ROOT.'/public/payment/newpayment.php?source=member&ref='.$object->id; + print $form->formconfirm($urltocall, $langs->trans("CorrespondingMemberFound"), $langs->trans("CorrespondingMemberFoundQuestion"), "confirm_subscription", '', 'no', 1); +} + // Print form print '
'."\n"; print ''; print ''; print ''; -if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFORM_FORCETYPE') || $action == 'create') { +if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFORM_FORCETYPE') || in_array($action, array('create', 'subscription'))) { + if ($action == 'subscription') { + print ''; + } print ''; print '
'; @@ -689,12 +764,14 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR $tdFirst.removeClass("fieldrequired"); break; - default: - $phyInput.prop({disabled: false, checked: false}); - $morInput.prop({disabled: false, checked: false}); - $span1.removeClass("member-individual-back").addClass("nonature-back"); - $span2.removeClass("member-company-back").addClass("nonature-back"); - } + default:'; + if ($action != "subscription") { + print ' $phyInput.prop({disabled: false, checked: false}); + $morInput.prop({disabled: false, checked: false}); + $span1.removeClass("member-individual-back").addClass("nonature-back"); + $span2.removeClass("member-company-back").addClass("nonature-back");'; + } + print'} }); // Initial state From 493630eb4f47f2b5f75568a13b114a5ff1bc16d1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Oct 2025 18:18:19 +0200 Subject: [PATCH 60/68] Add expire at into token table. SQL part of #35804 --- htdocs/install/mysql/migration/22.0.0-23.0.0.sql | 2 ++ htdocs/install/mysql/tables/llx_oauth_token.sql | 1 + 2 files changed, 3 insertions(+) diff --git a/htdocs/install/mysql/migration/22.0.0-23.0.0.sql b/htdocs/install/mysql/migration/22.0.0-23.0.0.sql index b1ea1b11aaa..16036ac4b8b 100644 --- a/htdocs/install/mysql/migration/22.0.0-23.0.0.sql +++ b/htdocs/install/mysql/migration/22.0.0-23.0.0.sql @@ -252,4 +252,6 @@ INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (5, '5 INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (5, '519', 'gGmbH - gemeinnützige Gesellschaft mit beschränkter Haftung', 1); INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (5, '520', 'gUG - gemeinnützige Unternehmergesellschaft (haftungsbeschränkt)', 1); +ALTER TABLE llx_oauth_token ADD COLUMN expire_at datetime NULL AFTER lastaccess; + -- end of migration diff --git a/htdocs/install/mysql/tables/llx_oauth_token.sql b/htdocs/install/mysql/tables/llx_oauth_token.sql index 21b777ea67c..a0c769768ff 100644 --- a/htdocs/install/mysql/tables/llx_oauth_token.sql +++ b/htdocs/install/mysql/tables/llx_oauth_token.sql @@ -29,6 +29,7 @@ CREATE TABLE llx_oauth_token ( tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, entity integer DEFAULT 1, lastaccess datetime NULL, -- updated at each api access + expire_at datetime NULL, apicount_previous_month BIGINT UNSIGNED DEFAULT 0, apicount_month BIGINT UNSIGNED DEFAULT 0, -- increased by 1 at each page access, saved into pageviews_previous_month when on different month than lastaccess apicount_total BIGINT UNSIGNED DEFAULT 0 -- increased by 1 at each page access, no reset From e81cca858e0309499b476b190604d54b0a1ddbe3 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Fri, 17 Oct 2025 18:24:40 +0200 Subject: [PATCH 61/68] NEW: import subscriptions (#35612) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * NEW: import subscriptions * remove bad code * FIX: already declared property is not needed * Update subscription.class.php * FIX: change format to please php-stan * ENH: DolibarrModules::$import_convertvalue_array value format --------- Co-authored-by: Christophe Battarel Co-authored-by: Noé Cendrier Co-authored-by: Noé Cendrier <81741011+altairis-noe@users.noreply.github.com> Co-authored-by: Laurent Destailleur --- htdocs/adherents/class/adherent.class.php | 1 - htdocs/adherents/class/subscription.class.php | 9 ++++++- htdocs/core/modules/DolibarrModules.class.php | 2 +- htdocs/core/modules/modAdherent.class.php | 25 +++++++++++++++++++ .../install/mysql/migration/22.0.0-23.0.0.sql | 6 +++++ .../install/mysql/tables/llx_subscription.sql | 3 ++- 6 files changed, 42 insertions(+), 4 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index d5fab4b50b3..8eda2fd4195 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -314,7 +314,6 @@ class Adherent extends CommonObject */ public $invoice; - /** * 'type' field format: * 'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]', diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index ebae7156dd8..f35d7703d97 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -113,6 +113,7 @@ class Subscription extends CommonObject 'fk_type' => array('type' => 'integer', 'label' => 'MemberType', 'enabled' => 1, 'visible' => -1, 'position' => 55), 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => -2, 'position' => 60), 'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'enabled' => 1, 'visible' => -1, 'position' => 65), + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 805), ); @@ -144,6 +145,11 @@ class Subscription extends CommonObject $now = dol_now(); + // Clean parameters + if (isset($this->import_key)) { + $this->import_key = trim($this->import_key); + } + // Check parameters if ($this->datef <= $this->dateh) { $this->error = $langs->trans("ErrorBadValueForDate"); @@ -165,7 +171,7 @@ class Subscription extends CommonObject $type = $this->fk_type; } - $sql = "INSERT INTO ".MAIN_DB_PREFIX."subscription (fk_adherent, fk_type, datec, dateadh, datef, subscription, note, note_private, ref_ext, fk_user_creat)"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."subscription (fk_adherent, fk_type, datec, dateadh, datef, subscription, note, note_private, ref_ext, fk_user_creat, import_key)"; $sql .= " VALUES (".((int) $this->fk_adherent).", '".$this->db->escape((string) $type)."', '".$this->db->idate($now)."',"; $sql .= " '".$this->db->idate($this->dateh)."',"; $sql .= " '".$this->db->idate($this->datef)."',"; @@ -174,6 +180,7 @@ class Subscription extends CommonObject $sql .= " '".$this->db->escape($this->note_private)."',"; $sql .= " ".(empty($this->ref_ext) ? "null" : "'".$this->db->escape($this->ref_ext)."'").","; $sql .= " ".((int) ($this->user_creation_id > 0 ? $this->user_creation_id : $user->id)); + $sql .= ", ".(!empty($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : "null"); $sql .= ")"; $resql = $this->db->query($sql); diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 04315d7bef2..42ad693d259 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -357,7 +357,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it */ public $import_fieldshidden_array; /** - * @var array> + * @var array>> */ public $import_convertvalue_array; /** diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index 9e8d43dbe65..84a480ea529 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -399,6 +399,31 @@ class modAdherent extends DolibarrModules } $this->import_updatekeys_array[$r] = array('a.ref'=>'MemberRef', 'a.login'=>'Login'); + // Import subscriptions + $r++; + $this->import_code[$r] = $this->rights_class.'_'.$r; + $this->import_label[$r] = "Subscriptions"; // Translation key + $this->import_icon[$r] = $this->picto; + $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon + $this->import_tables_array[$r] = array('c'=>MAIN_DB_PREFIX.'subscription'); + $this->import_fields_array[$r] = array( + 'c.fk_adherent' => 'MemberRef*', + 'c.note'=>'Note', 'c.dateadh'=>'SubscriptionStart', 'c.datef'=>'SubscriptionEnd', 'c.subscription'=>'Amount', 'c.fk_type' => 'MemberType', 'c.fk_bank' => 'Bank' + ); + $this->import_convertvalue_array[$r] = array( + 'c.fk_adherent' => array( + 'rule'=>'fetchidfromref', + 'classfile'=>'/adherents/class/adherent.class.php', + 'class'=>'Adherent', + 'method'=>'fetch', + 'element'=>'member' + ) + ); + $this->import_examplevalues_array[$r] = array( + 'c.fk_adherent' => 'member ref', + 'c.note'=>'Subscription #33', 'c.dateadh'=>'2025-09-01', 'c.datef'=>'2026-08-31', 'c.subscription'=>'50' + ); + // Cronjobs $arraydate = dol_getdate(dol_now()); $datestart = dol_mktime(22, 0, 0, $arraydate['mon'], $arraydate['mday'], $arraydate['year']); diff --git a/htdocs/install/mysql/migration/22.0.0-23.0.0.sql b/htdocs/install/mysql/migration/22.0.0-23.0.0.sql index 16036ac4b8b..889983f02f6 100644 --- a/htdocs/install/mysql/migration/22.0.0-23.0.0.sql +++ b/htdocs/install/mysql/migration/22.0.0-23.0.0.sql @@ -182,6 +182,12 @@ ALTER TABLE llx_element_contact ADD mandatory_signature TINYINT AFTER element_id -- default deposit % if payment term needs it on supplier ALTER TABLE llx_supplier_proposal ADD COLUMN deposit_percent varchar(63) DEFAULT NULL AFTER fk_cond_reglement; ALTER TABLE llx_commande_fournisseur ADD COLUMN deposit_percent varchar(63) DEFAULT NULL AFTER fk_cond_reglement; + + +-- import key for subscriptions +ALTER TABLE llx_subscription ADD COLUMN import_key varchar(14) NULL; + + CREATE TABLE llx_categorie_propal ( fk_categorie integer NOT NULL, diff --git a/htdocs/install/mysql/tables/llx_subscription.sql b/htdocs/install/mysql/tables/llx_subscription.sql index f280b87cc8f..3cdaec7a3c8 100644 --- a/htdocs/install/mysql/tables/llx_subscription.sql +++ b/htdocs/install/mysql/tables/llx_subscription.sql @@ -31,5 +31,6 @@ create table llx_subscription fk_user_valid integer DEFAULT NULL, ref_ext varchar(128), -- reference into an external system (not used by dolibarr) note text, -- public note - note_private text -- private note + note_private text, -- private note + import_key varchar(14) -- Import key )ENGINE=innodb; From b6171202db59a9e7c2eb63922efd96e8da88c3ec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Oct 2025 18:35:16 +0200 Subject: [PATCH 62/68] Trans --- htdocs/langs/en_US/products.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index e71110b138e..5d5666b71f4 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -345,10 +345,10 @@ PossibleValues=Possible values GoOnMenuToCreateVairants=Go on menu %s - %s to prepare attribute variants (like colors, size, ...) UseProductFournDesc=Add a feature to define the product description defined by the vendors (for each vendor reference) in addition to the description for customers ProductSupplierDescription=Vendor description for the product -UseProductSupplierPackaging=Use the "packaging" feature to round the quantities to some given multiples (when adding/updating line in a vendor documents, recalculate quantities and purchase prices according to the higher multiple set on the purchase prices of a product) +UseProductSupplierPackaging=Use the "packaging" feature to round the quantities to some given multiples (when adding/updating line in a vendor documents, the quantity is adjusted to match the nearest higher multiple of the "packaging" value of the product) PackagingForThisProduct=Packaging of quantities PackagingForThisProductDesc=You will automatically purchase a multiple of this quantity. -UseProductCustomerPackaging=Use the "packaging" feature to round the quantities to some given multiples (when adding/updating line in a customer documents, recalculate quantities and sale prices according to the higher multiple set on the sale prices of a product) +UseProductCustomerPackaging=Use the "packaging" feature to round the quantities to some given multiples (when adding/updating line in a customer documents, the quantity is adjusted to match the nearest higher multiple of the "packaging" value of the product) PackagingForThisProductSell=Packaging of quantities (sale) PackagingForThisProductSellDesc=You will automatically sell a multiple of this quantity. QtyRecalculatedWithPackaging=The quantity of the line were recalculated according to supplier packaging From 384d40ca01e3bfbc37ab8ef9af6c1ed6613f1575 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Oct 2025 19:39:45 +0200 Subject: [PATCH 63/68] phpunit more complete --- htdocs/commande/class/commande.class.php | 6 +++++- htdocs/supplier_proposal/class/supplier_proposal.class.php | 4 ++-- test/phpunit/CommandeTest.php | 3 ++- test/phpunit/SupplierProposalTest.php | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 9619e16923c..5833b5119ba 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -4046,9 +4046,10 @@ class Commande extends CommonOrder * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * + * @param array $param Array of options * @return int */ - public function initAsSpecimen() + public function initAsSpecimen($param = array()) { global $conf, $langs; @@ -4060,6 +4061,9 @@ class Commande extends CommonOrder $sql = "SELECT rowid"; $sql .= " FROM ".MAIN_DB_PREFIX."product"; $sql .= " WHERE entity IN (".getEntity('product').")"; + if (array_key_exists('tosell', $param)) { + $sql .= " AND tosell = ".((int) $param['tosell']); + } $sql .= $this->db->plimit(100); $resql = $this->db->query($sql); diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 93d121371f3..400cddcc3ec 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -2406,8 +2406,8 @@ class SupplierProposal extends CommonObject $sql = "SELECT rowid"; $sql .= " FROM ".MAIN_DB_PREFIX."product"; $sql .= " WHERE entity IN (".getEntity('product').")"; - if (array_key_exists('tosell', $param)) { - $sql .= " AND tosell = ".((int) $param['tosell']); + if (array_key_exists('tobuy', $param)) { + $sql .= " AND tobuy = ".((int) $param['tobuy']); } $sql .= $this->db->plimit(100); diff --git a/test/phpunit/CommandeTest.php b/test/phpunit/CommandeTest.php index b2dddb95951..0128cc418e9 100644 --- a/test/phpunit/CommandeTest.php +++ b/test/phpunit/CommandeTest.php @@ -87,7 +87,8 @@ class CommandeTest extends CommonClassTest $this->assertLessThan($socid, 0, $soc->errorsToString()); $localobject = new Commande($db); - $localobject->initAsSpecimen(); + $param = array('tosell' => 1); + $localobject->initAsSpecimen($param); $localobject->socid = $socid; $result = $localobject->create($user); diff --git a/test/phpunit/SupplierProposalTest.php b/test/phpunit/SupplierProposalTest.php index 21e143bd15c..1936fd464e3 100644 --- a/test/phpunit/SupplierProposalTest.php +++ b/test/phpunit/SupplierProposalTest.php @@ -105,7 +105,7 @@ class SupplierProposalTest extends CommonClassTest $db = $this->savdb; $localobject = new SupplierProposal($db); - $param = array('tosell' => 1); + $param = array('tobuy' => 1); $localobject->initAsSpecimen($param); $result = $localobject->create($user); From f0c61790ebfa7cb0c29184ccd6799d6d1b73e293 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 17 Oct 2025 23:43:28 +0200 Subject: [PATCH 64/68] Clean code --- htdocs/fourn/class/fournisseur.commande.class.php | 4 ++-- test/phpunit/CommandeFournisseurTest.php | 15 +++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 4d31090f4e7..06d08eab352 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1588,7 +1588,7 @@ class CommandeFournisseur extends CommonOrder */ public function create($user, $notrigger = 0) { - global $langs, $conf, $hookmanager; + global $conf; $this->db->begin(); @@ -1698,7 +1698,7 @@ class CommandeFournisseur extends CommonOrder $line->localtax2_tx, $line->fk_product, 0, - $line->ref_fourn, // $line->ref_fourn comes from field ref into table of lines. Value may ba a ref that does not exists anymore, so we first try with value of product + $line->ref_supplier ? $line->ref_supplier : $line->ref_fourn, // $line->ref_fourn comes from field ref into table of lines. Value may be a ref that does not exists anymore, so we first try with value of product $line->remise_percent, 'HT', 0, diff --git a/test/phpunit/CommandeFournisseurTest.php b/test/phpunit/CommandeFournisseurTest.php index 96460ee86a9..9c2d1b26d82 100644 --- a/test/phpunit/CommandeFournisseurTest.php +++ b/test/phpunit/CommandeFournisseurTest.php @@ -94,7 +94,8 @@ class CommandeFournisseurTest extends CommonClassTest $conf->global->SUPPLIER_ORDER_WITH_PREDEFINED_PRICES_ONLY = 1; $localobject = new CommandeFournisseur($db); - $localobject->initAsSpecimen(); + $param = array('tobuy' => 1); + $localobject->initAsSpecimen($param); $localobject->lines = array(); // Overwrite lines of order $line = new CommandeFournisseurLigne($db); $line->desc = $langs->trans("Description")." specimen line with qty too low"; @@ -102,6 +103,7 @@ class CommandeFournisseurTest extends CommonClassTest $line->subprice = 100; $line->fk_product = $product->id; $line->ref_fourn = $ref_fourn; + $line->ref_supplier = $ref_fourn; $localobject->lines[] = $line; $result = $localobject->create($user); @@ -113,14 +115,15 @@ class CommandeFournisseurTest extends CommonClassTest // Create purchase order $localobject2 = new CommandeFournisseur($db); - $localobject2->initAsSpecimen(); // This create 5 lines of first product found for socid 1 + $param = array('tobuy' => 1); + $localobject2->initAsSpecimen($param); // This create 5 lines of first product found for socid 1 $localobject2->lines = array(); // Overwrite lines of order $line = new CommandeFournisseurLigne($db); $line->desc = $langs->trans("Description")." specimen line ok"; $line->qty = 10; // So enough quantity $line->subprice = 100; $line->fk_product = $product->id; - $line->ref_fourn = $ref_fourn; + $line->ref_supplier = $ref_fourn; $localobject2->lines[] = $line; $result = $localobject2->create($user); @@ -132,14 +135,15 @@ class CommandeFournisseurTest extends CommonClassTest $conf->global->SUPPLIER_ORDER_WITH_PREDEFINED_PRICES_ONLY = 0; $localobject3 = new CommandeFournisseur($db); - $localobject3->initAsSpecimen(); + $param = array('tobuy' => 1); + $localobject3->initAsSpecimen($param); $localobject3->lines = array(); // Overwrite lines of order $line = new CommandeFournisseurLigne($db); $line->desc = $langs->trans("Description")." specimen line with qty too low"; $line->qty = 1; // So lower than $quantity $line->subprice = 100; $line->fk_product = $product->id; - $line->ref_fourn = $ref_fourn; + $line->ref_supplier = $ref_fourn; $localobject3->lines[] = $line; $result = $localobject3->create($user); @@ -158,7 +162,6 @@ class CommandeFournisseurTest extends CommonClassTest $line->qty = 10; // So enough quantity $line->subprice = 100; $line->fk_product = $product->id; - $line->ref_fourn = $ref_fourn; $localobject4->lines[] = $line; $result = $localobject4->create($user); From b28b94821f9e9d744ea58fb87e06096d8ade3fbc Mon Sep 17 00:00:00 2001 From: Vincent Maury Date: Sat, 18 Oct 2025 11:19:31 +0200 Subject: [PATCH 65/68] =?UTF-8?q?NEW=20#35700=20:=20Throw=20an=20error=20w?= =?UTF-8?q?hen=20validating=20a=20propal,=20order,=20supplier=20with=20a?= =?UTF-8?q?=20product=20no=20more=20in=20sale/purchase=E2=80=A6=20(#35709)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix #35700 : Throw an error when validating a propal, order, supplier proposal, supplier order if some products doesn't have the good status (on sale, on buy) * Fix #35700 : Throw an error when validating a propal, order, supplier proposal, supplier order if some products doesn't have the good status (on sale, on buy) * Fix #35700 : Throw an error when validating a propal, order, supplier proposal, supplier order if some products doesn't have the good status (on sale, on buy) * Fix #35700 : Throw an error when validating a propal, order, supplier proposal, supplier order if some products doesn't have the good status (on sale, on buy) * Fix #35700 : Throw an error when validating a propal, order, supplier proposal, supplier order if some products doesn't have the good status (on sale, on buy) * Update commonobject.class.php * Refactor checkActiveProductInLines method * Fix comment formatting in commonobject.class.php * Update commonobject.class.php --------- Co-authored-by: vmaury Co-authored-by: Laurent Destailleur --- htdocs/comm/propal/class/propal.class.php | 5 +++ htdocs/commande/class/commande.class.php | 5 ++- htdocs/core/class/commonobject.class.php | 42 ++++++++++++++++++- .../class/fournisseur.commande.class.php | 4 ++ htdocs/langs/en_US/errors.lang | 1 + htdocs/langs/fr_FR/errors.lang | 1 + .../class/supplier_proposal.class.php | 5 ++- 7 files changed, 60 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index dfd0bcafc78..c2af9bc7d12 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2102,6 +2102,11 @@ class Propal extends CommonObject return -1; } + if (!getDolGlobalBool('PROPALE_NOCHECK_ONSALE_PRODUCTS_ONVALID') && !$this->checkActiveProductInLines()) { + dol_syslog(get_class($this)."::valid checkActiveProductInLines ".$this->error, LOG_INFO); + return -1; + } + $now = dol_now(); $this->db->begin(); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 5833b5119ba..dd070117b55 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -529,7 +529,10 @@ class Commande extends CommonOrder $this->error = 'ErrorWrongParameters'; return -1; } - + if (!getDolGlobalBool('ORDER_NOCHECK_ONSALE_PRODUCTS_ONVALID') && !$this->checkActiveProductInLines()) { + dol_syslog(get_class($this)."::valid checkActiveProductInLines ".$this->error, LOG_INFO); + return -1; + } $now = dol_now(); $this->db->begin(); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index af10c4eabeb..8a300692617 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -20,7 +20,8 @@ * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 William Mead * Copyright (C) 2025 Alexandre Janniaux - * + * Copyright (C) 2025 Vincent Maury +* * 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 * the Free Software Foundation; either version 3 of the License, or @@ -11619,4 +11620,43 @@ abstract class CommonObject $this->db->commit(); return true; } + + /** + * Check if all products have the right status (on sale, on buy) called + * during validation of propal, order, supplier proposal, supplier order + * + * @global object $langs + * @param string $status onsale or onbuy + * @return bool + */ + public function checkActiveProductInLines($status = 'onsale') + { + global $langs; + + if (isModEnabled('product') || isModEnabled('service')) { + include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + + $ret = true; + $tmpproduct = new Product($this->db); + foreach ($this->lines as $line) { + if ($line->fk_product > 0) { + $tmpproduct->fetch($line->fk_product); + $statustotest = ($status == 'onsale' ? 'status' : 'status_buy'); + if (!$tmpproduct->$statustotest) { + $langs->load('products'); + $statuskey4lang = ($status == 'onsale' ? 'ProductStatusNotOnSell' : 'ProductStatusNotOnBuy'); + $ret = false; + $this->errors[] = $langs->trans('ProductRef').' '.$tmpproduct->ref.' '.$langs->trans($statuskey4lang); + break; + } + } + } + if (!$ret) { + $this->error = 'ErrorOneLineContainsADisactivatedProduct'; + } + return $ret; + } else { + return true; + } + } } diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 06d08eab352..b52c88733f8 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -800,6 +800,10 @@ class CommandeFournisseur extends CommonOrder || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight("fournisseur", "supplier_order_advance", "validate"))) { $this->db->begin(); + if (!getDolGlobalBool('SUPPLIER_ORDER_NOCHECK_ONBUY_PRODUCTS_ONVALID') && !$this->checkActiveProductInLines('onbuy')) { + dol_syslog(get_class($this)."::valid checkActiveProductInLines ".$this->error, LOG_INFO); + return -1; + } // Definition of supplier order numbering model name $soc = new Societe($this->db); $soc->fetch($this->fourn_id); diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 6622b68edd2..4bdde7393f5 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -364,6 +364,7 @@ ErrorIsNotInError=%s is not in error ErrorFilenameExtensionNotAllowed=File %s has a forbidden file extension ErrorNoValueForSelectListType=Error, a value for this type of field is mandatory ErrorPaymentAmountMustNotBeNull=Error, payment amount must be defined and not zero +ErrorOneLineContainsADisactivatedProduct=Error, at least one product is not or no more on sale or for purchase ErrorCalendarIsNotYetOpenOrHasBeenClosed=This calendar is not yet open or has been closed # Warnings diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang index 05803f1c04d..8c711c6dc68 100644 --- a/htdocs/langs/fr_FR/errors.lang +++ b/htdocs/langs/fr_FR/errors.lang @@ -361,6 +361,7 @@ ErrorThisGroupIsAlreadyDefinedAsThisType=Les contacts avec ce groupe sont déjà ErrorIsNotInError=%s n'est pas en erreur ErrorFilenameExtensionNotAllowed=Le fichier %s a une extension interdite ErrorNoValueForSelectListType=Erreur, une valeur pour ce type de champ est obligatoire +ErrorOneLineContainsADisactivatedProduct=Erreur, au moins un produit n'a pas le bon statut # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Votre paramètre PHP upload_max_filesize (%s) est supérieur au paramètre PHP post_max_size (%s). Ceci n'est pas une configuration cohérente. diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 400cddcc3ec..22d101e5077 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -1497,7 +1497,10 @@ class SupplierProposal extends CommonObject if ($result < 0) { return -1; } - + if (!getDolGlobalBool('SUPPLIER_PROPOSAL_NOCHECK_ONBUY_PRODUCTS_ONVALID') && !$this->checkActiveProductInLines('onbuy')) { + dol_syslog(get_class($this)."::valid checkActiveProductInLines ".$this->error, LOG_INFO); + return -1; + } // Define new ref if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) { // empty should not happened, but when it occurs, the test save life $num = $this->getNextNumRef($soc); From 3d852682ec0c1351938c361319ff5376f36e9c6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 18 Oct 2025 11:20:54 +0200 Subject: [PATCH 66/68] clean baseline (#35822) * clean baseline * clean baseline * clean baseline * clean baseline * clean baseline * clean baseline --- dev/build/phpstan/phpstan-baseline.neon | 198 ------------------ .../modules/mrp/doc/pdf_vinci.modules.php | 2 +- htdocs/mrp/class/mo.class.php | 109 +++++----- htdocs/mrp/mo_card.php | 2 +- 4 files changed, 57 insertions(+), 254 deletions(-) diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index 73988b23993..7c91286d1ca 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -7860,54 +7860,12 @@ parameters: count: 2 path: ../../../htdocs/core/modules/member/doc/pdf_standard_member.class.php - - - message: '#^Property DolibarrModules\:\:\$import_convertvalue_array \(array\\>\) does not accept non\-empty\-array\\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modAccounting.class.php - - - - message: '#^Property DolibarrModules\:\:\$import_convertvalue_array \(array\\>\) does not accept non\-empty\-array\\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modAccounting.class.php - - - - message: '#^Property DolibarrModules\:\:\$import_convertvalue_array \(array\\>\) does not accept non\-empty\-array\\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modAccounting.class.php - - - - message: '#^Property DolibarrModules\:\:\$import_convertvalue_array \(array\\>\) does not accept non\-empty\-array\\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modAdherent.class.php - - - - message: '#^Property DolibarrModules\:\:\$import_convertvalue_array \(array\\>\) does not accept non\-empty\-array\\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modAdherent.class.php - - message: '#^Variable \$user in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable count: 2 path: ../../../htdocs/core/modules/modAgenda.class.php - - - message: '#^Property DolibarrModules\:\:\$import_convertvalue_array \(array\\>\) does not accept non\-empty\-array\\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modCategorie.class.php - - - - message: '#^Property DolibarrModules\:\:\$import_convertvalue_array \(array\\>\) does not accept non\-empty\-array\\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modCategorie.class.php - - message: '#^Ternary operator condition is always false\.$#' identifier: ternary.alwaysFalse @@ -8106,36 +8064,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/modPrelevement.class.php - - - message: '#^Property DolibarrModules\:\:\$import_convertvalue_array \(array\\>\) does not accept non\-empty\-array\\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modProduct.class.php - - - - message: '#^Property DolibarrModules\:\:\$import_convertvalue_array \(array\\>\) does not accept non\-empty\-array\\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modProduct.class.php - - - - message: '#^Property DolibarrModules\:\:\$import_convertvalue_array \(array\\>\) does not accept non\-empty\-array\\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modProduct.class.php - - - - message: '#^Property DolibarrModules\:\:\$import_convertvalue_array \(array\\>\) does not accept non\-empty\-array\\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modProduct.class.php - - - - message: '#^Property DolibarrModules\:\:\$import_convertvalue_array \(array\\>\) does not accept non\-empty\-array\\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modProjet.class.php - - message: '#^Property DolibarrModules\:\:\$const \(array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\) does not accept non\-empty\-array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\.$#' identifier: assign.propertyType @@ -8220,42 +8148,12 @@ parameters: count: 1 path: ../../../htdocs/core/modules/modRecruitment.class.php - - - message: '#^Property DolibarrModules\:\:\$import_convertvalue_array \(array\\>\) does not accept non\-empty\-array\\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modResource.class.php - - message: '#^Property DolibarrModules\:\:\$const \(array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\) does not accept non\-empty\-array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\.$#' identifier: assign.propertyType count: 2 path: ../../../htdocs/core/modules/modSalaries.class.php - - - message: '#^Property DolibarrModules\:\:\$import_convertvalue_array \(array\\>\) does not accept non\-empty\-array\\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modService.class.php - - - - message: '#^Property DolibarrModules\:\:\$import_convertvalue_array \(array\\>\) does not accept non\-empty\-array\\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modService.class.php - - - - message: '#^Property DolibarrModules\:\:\$import_convertvalue_array \(array\\>\) does not accept non\-empty\-array\\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modService.class.php - - - - message: '#^Property DolibarrModules\:\:\$import_convertvalue_array \(array\\>\) does not accept non\-empty\-array\\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modService.class.php - - message: '#^Property DolibarrModules\:\:\$const \(array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\) does not accept non\-empty\-array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\.$#' identifier: assign.propertyType @@ -8292,18 +8190,6 @@ parameters: count: 5 path: ../../../htdocs/core/modules/modSociete.class.php - - - message: '#^Property DolibarrModules\:\:\$import_convertvalue_array \(array\\>\) does not accept non\-empty\-array\\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modSociete.class.php - - - - message: '#^Property DolibarrModules\:\:\$import_convertvalue_array \(array\\>\) does not accept non\-empty\-array\\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modSociete.class.php - - message: '#^Property DolibarrModules\:\:\$const \(array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\) does not accept non\-empty\-array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\.$#' identifier: assign.propertyType @@ -8340,18 +8226,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/modStock.class.php - - - message: '#^Property DolibarrModules\:\:\$import_convertvalue_array \(array\\>\) does not accept non\-empty\-array\\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modStock.class.php - - - - message: '#^Property DolibarrModules\:\:\$import_convertvalue_array \(array\\>\) does not accept non\-empty\-array\\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modStock.class.php - - message: '#^Property DolibarrModules\:\:\$const \(array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\) does not accept non\-empty\-array\, 5\?\: string, 6\?\: int\<0, 1\>\}\>\.$#' identifier: assign.propertyType @@ -8364,30 +8238,12 @@ parameters: count: 3 path: ../../../htdocs/core/modules/modSupplierProposal.class.php - - - message: '#^Property DolibarrModules\:\:\$import_convertvalue_array \(array\\>\) does not accept non\-empty\-array\\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modTax.class.php - - - - message: '#^Property DolibarrModules\:\:\$import_convertvalue_array \(array\\>\) does not accept non\-empty\-array\\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modTax.class.php - - message: '#^Property DolibarrModules\:\:\$export_permission \(array\\>\) does not accept non\-empty\-array\\>\.$#' identifier: assign.propertyType count: 1 path: ../../../htdocs/core/modules/modUser.class.php - - - message: '#^Property DolibarrModules\:\:\$import_convertvalue_array \(array\\>\) does not accept non\-empty\-array\\>\.$#' - identifier: assign.propertyType - count: 1 - path: ../../../htdocs/core/modules/modUser.class.php - - message: '#^Ternary operator condition is always false\.$#' identifier: ternary.alwaysFalse @@ -11952,42 +11808,6 @@ parameters: count: 1 path: ../../../htdocs/mrp/class/mo.class.php - - - message: '#^Negated boolean expression is always true\.$#' - identifier: booleanNot.alwaysTrue - count: 2 - path: ../../../htdocs/mrp/class/mo.class.php - - - - message: '#^Property Mo\:\:\$fk_product \(int\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 1 - path: ../../../htdocs/mrp/class/mo.class.php - - - - message: '#^Property Mo\:\:\$label \(string\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 1 - path: ../../../htdocs/mrp/class/mo.class.php - - - - message: '#^Property Mo\:\:\$mrptype \(int\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 1 - path: ../../../htdocs/mrp/class/mo.class.php - - - - message: '#^Property Mo\:\:\$qty \(float\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 1 - path: ../../../htdocs/mrp/class/mo.class.php - - - - message: '#^Property Mo\:\:\$status \(int\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 1 - path: ../../../htdocs/mrp/class/mo.class.php - - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue @@ -12030,18 +11850,6 @@ parameters: count: 1 path: ../../../htdocs/mrp/mo_agenda.php - - - message: '#^Property Mo\:\:\$status \(int\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 1 - path: ../../../htdocs/mrp/mo_card.php - - - - message: '#^Property Mo\:\:\$status \(int\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 1 - path: ../../../htdocs/mrp/mo_movements.php - - message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable @@ -12066,12 +11874,6 @@ parameters: count: 2 path: ../../../htdocs/mrp/mo_production.php - - - message: '#^Property Mo\:\:\$status \(int\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 1 - path: ../../../htdocs/mrp/mo_production.php - - message: '#^Result of \|\| is always true\.$#' identifier: booleanOr.alwaysTrue diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php index 2b7205c1b62..3095a5282c8 100644 --- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php +++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php @@ -1099,7 +1099,7 @@ class pdf_vinci extends ModelePDFMo // product info $prodToMake = new Product($this->db); - $resProdToMake = $prodToMake->fetch($object->fk_product); + $resProdToMake = $prodToMake->fetch((int) $object->fk_product); if ($resProdToMake > 0) { // ref diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 80048978817..057edb279d0 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -122,26 +122,30 @@ class Mo extends CommonObject public $ref; /** - * @var int mrptype + * @var ?int mrptype */ public $mrptype; + /** - * @var string + * @var ?string */ public $label; /** - * @var float Quantity + * @var ?float Quantity */ public $qty; + /** * @var ?int */ public $fk_warehouse; + /** * @var int */ public $fk_soc; + /** * @var int */ @@ -175,12 +179,12 @@ class Mo extends CommonObject */ public $import_key; /** - * @var int + * @var ?int */ public $status; /** - * @var int ID of product + * @var ?int ID of product */ public $fk_product; @@ -323,7 +327,7 @@ class Mo extends CommonObject if (getDolGlobalString('PRODUIT_SOUSPRODUITS') && !getDolGlobalString('ALLOW_USE_KITS_INTO_BOM_AND_MO') && $this->fk_product > 0) { include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; $tmpproduct = new Product($this->db); - $tmpproduct->fetch($this->fk_product); + $tmpproduct->fetch((int) $this->fk_product); if ($tmpproduct->hasFatherOrChild(1) > 0) { $this->error = 'ErrorAVirtualProductCantBeUsedIntoABomOrMo'; $this->errors[] = $this->error; @@ -342,11 +346,10 @@ class Mo extends CommonObject $this->mrptype = $tmpbom->bomtype; } - if (!$error) { - $idcreated = $this->createCommon($user, $notrigger); - if ($idcreated <= 0) { - $error++; - } + + $idcreated = $this->createCommon($user, $notrigger); + if ($idcreated <= 0) { + $error++; } if (!$error) { @@ -620,9 +623,9 @@ class Mo extends CommonObject $obj = $this->db->fetch_object($resql); if ($obj) { $resarray[] = array( - 'rowid' => $obj->rowid, + 'rowid' => (int) $obj->rowid, 'date' => $this->db->jdate($obj->date_creation), - 'qty' => $obj->qty, + 'qty' => (float) $obj->qty, 'role' => $obj->role, 'fk_product' => $obj->fk_product, 'fk_warehouse' => $obj->fk_warehouse, @@ -731,55 +734,53 @@ class Mo extends CommonObject $this->db->begin(); // Insert lines in mrp_production table from BOM data - if (!$error) { - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'mrp_production WHERE fk_mo = '.((int) $this->id); - $this->db->query($sql); - $moline = new MoLine($this->db); + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'mrp_production WHERE fk_mo = '.((int) $this->id); + $this->db->query($sql); - // Line to produce - $moline->fk_mo = $this->id; - $moline->qty = $this->qty; - $moline->fk_product = $this->fk_product; - $moline->position = 1; + $moline = new MoLine($this->db); - include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; - $tmpproduct = new Product($this->db); - $tmpproduct->fetch($this->fk_product); - $moline->fk_unit = $tmpproduct->fk_unit; + // Line to produce + $moline->fk_mo = $this->id; + $moline->qty = (float) $this->qty; + $moline->fk_product = (int) $this->fk_product; + $moline->position = 1; - if ($this->fk_bom > 0) { // If a BOM is defined, we know what to produce. - include_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; - $bom = new BOM($this->db); - $bom->fetch($this->fk_bom); - if ($bom->bomtype == 1) { - $role = 'toproduce'; - $moline->role = 'toconsume'; - } else { - $role = 'toconsume'; - $moline->role = 'toproduce'; - } + include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + $tmpproduct = new Product($this->db); + $tmpproduct->fetch((int) $this->fk_product); + $moline->fk_unit = $tmpproduct->fk_unit; + + if ($this->fk_bom > 0) { // If a BOM is defined, we know what to produce. + include_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; + $bom = new BOM($this->db); + $bom->fetch($this->fk_bom); + if ($bom->bomtype == 1) { + $role = 'toproduce'; + $moline->role = 'toconsume'; } else { - $bom = null; - if ($this->mrptype == 1) { - $moline->role = 'toconsume'; - } else { - $moline->role = 'toproduce'; - } + $role = 'toconsume'; + $moline->role = 'toproduce'; } - - $resultline = $moline->create($user, 0); // Never use triggers here - if ($resultline <= 0) { - $error++; - $this->error = $moline->error; - $this->errors = $moline->errors; + } else { + $bom = null; + if ($this->mrptype == 1) { + $moline->role = 'toconsume'; + } else { + $moline->role = 'toproduce'; } + } - if ($this->fk_bom > 0 && is_object($bom)) { // If a BOM is defined, we know what to consume. - if ($bom->id > 0) { - // process lines to consume, this needs to recurse through BOM's - $error += $this->processBOM($user, $role, $bom, $this->qty); - } + $resultline = $moline->create($user, 0); // Never use triggers here + if ($resultline <= 0) { + $error++; + $this->setErrorsFromObject($moline); + } + + if ($this->fk_bom > 0 && is_object($bom)) { // If a BOM is defined, we know what to consume. + if ($bom->id > 0) { + // process lines to consume, this needs to recurse through BOM's + $error += $this->processBOM($user, $role, $bom, (float) $this->qty); } } diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index 8a0db044bd9..f66e0e81217 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -139,7 +139,7 @@ if (empty($reshook)) { $backurlforlist = dol_buildpath('/mrp/mo_list.php', 1); - $object->oldQty = $object->qty; + $object->oldQty = (float) $object->qty; if (empty($backtopage) || ($cancel && empty($id))) { if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { From 0df13aedcb259f23c0989cecdc816f05063d1f81 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Oct 2025 11:53:37 +0200 Subject: [PATCH 67/68] Ignore file to avoid commiting it --- test/phpunit/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/test/phpunit/.gitignore b/test/phpunit/.gitignore index 647a82afb84..41e800ce46f 100644 --- a/test/phpunit/.gitignore +++ b/test/phpunit/.gitignore @@ -1 +1,2 @@ /DemoTest.php +/phpunit.xml From 78aefbaa2e5788970b7b1efb54be3e7035ad0f2f Mon Sep 17 00:00:00 2001 From: Guido Schratzer Date: Sat, 18 Oct 2025 12:54:09 +0300 Subject: [PATCH 68/68] FIX #35766: Update buying price INT Float (#35769) * FIX #35766: Update buying price INT Float loose Decimals . * Fix: keep fk_product_fournisseur_price as int; treat buying price as float (no truncation) [#35766] * Updated per feedback: keep fk_product_fournisseur_price as ?int (rowid) and as float. Adjusted FactureRec::updateline PHPDoc to ?int and float|'' (model still normalizes via price2num). Tested on a recurring line: decimals preserved, FK stored as int, CI green. Minor adjustments before v22 backport * Delete .hooktest * Delete dev/tools/pre-commit/README.md * Delete test/phpunit/phpunit.xml --------- Co-authored-by: Laurent Destailleur --- htdocs/compta/facture/card-rec.php | 2 +- htdocs/compta/facture/class/facture-rec.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 075143fed8d..54c4dc1ec21 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -1042,7 +1042,7 @@ if (empty($reshook)) { $date_start_fill, $date_end_fill, (int) $fournprice, - (int) $buyingprice, + (float) $buyingprice, (int) $fk_parent_line ); diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index ceaeb4ba03f..4d795a4c99c 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -1306,7 +1306,7 @@ class FactureRec extends CommonInvoice $sql .= ", total_ttc='".price2num($total_ttc)."'"; $sql .= ", date_start_fill=".((int) $date_start_fill); $sql .= ", date_end_fill=".((int) $date_end_fill); - $sql .= ", fk_product_fournisseur_price=".($fk_fournprice > 0 ? $fk_fournprice : 'null'); + $sql .= ", fk_product_fournisseur_price=".($fk_fournprice > 0 ? (int) $fk_fournprice : 'null'); $sql .= ", buy_price_ht=".($pa_ht ? price2num($pa_ht) : 0); $sql .= ", info_bits=".((int) $info_bits); $sql .= ", rang=".((int) $rang);