From 7eb3f03eb23d5ef05de0cf939cdc0167ed2aa1de Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 21 Feb 2024 16:52:54 +0100 Subject: [PATCH 1/3] Fix: Remove unused invalid global $lang (#28327) # Fix: Remove unused invalid global $lang was invalid but not used in function -> removed. --- htdocs/emailcollector/lib/emailcollector.lib.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/emailcollector/lib/emailcollector.lib.php b/htdocs/emailcollector/lib/emailcollector.lib.php index c8c7544c9f9..d63077049dd 100644 --- a/htdocs/emailcollector/lib/emailcollector.lib.php +++ b/htdocs/emailcollector/lib/emailcollector.lib.php @@ -169,7 +169,6 @@ function getFileData($jk, $fpos, $type, $mbox) **/ function saveAttachment($path, $filename, $data) { - global $lang; $tmp = explode('.', $filename); $ext = array_pop($tmp); $filename = implode('.', $tmp); From 05f809818e31c1ebdc5a33e32efd7ad38039b088 Mon Sep 17 00:00:00 2001 From: William Mead Date: Wed, 21 Feb 2024 16:54:40 +0100 Subject: [PATCH 2/3] Fixed duplicate llxHeader (#28330) --- htdocs/fourn/commande/index.php | 1 - htdocs/fourn/commande/note.php | 1 - 2 files changed, 2 deletions(-) diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index caaa44666ec..30a5e5a7045 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -55,7 +55,6 @@ $hookmanager->initHooks(array('orderssuppliersindex')); * View */ -llxHeader('', $langs->trans("SuppliersOrdersArea")); llxHeader('', $langs->trans("SuppliersOrdersArea"), '', '', 0, 0, '', '', '', 'mod-supplier-order page-stats'); $commandestatic = new CommandeFournisseur($db); diff --git a/htdocs/fourn/commande/note.php b/htdocs/fourn/commande/note.php index f64eb6fb6a3..e8ad23b0246 100644 --- a/htdocs/fourn/commande/note.php +++ b/htdocs/fourn/commande/note.php @@ -79,7 +79,6 @@ if (empty($reshook)) { $title = $object->ref." - ".$langs->trans('Notes'); $help_url = 'EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores'; -llxHeader('', $title, $help_url); llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-supplier-order page-notes'); $form = new Form($db); From 05527d3998a5b8ecabe0110b3d3e13ec580bacce Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 21 Feb 2024 17:31:08 +0100 Subject: [PATCH 3/3] Fix: Allow new & old names to check if module is loaded. (#28297) * Fix: Allow new & old names to check if module is loaded. # Fix: Allow new & old names to check if module is loaded. The method 'isModEnabled()' was already checking some modules for their new name, but after transitioning Conf this was not working for 'member'. Now testing for both names as 'Conf' can handle both and deprecation will be reported. Several issues were discovered after removing deprecated values. * Update functions.lib.php --------- Co-authored-by: Laurent Destailleur --- htdocs/core/lib/functions.lib.php | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f02017700e3..ff40c78e06b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -216,23 +216,31 @@ function isModEnabled($module) { global $conf; - // Fix special cases + // Fix old names (map to new names) $arrayconv = array( - 'bank' => 'banque', - 'category' => 'categorie', - 'contract' => 'contrat', - 'project' => 'projet', - 'delivery_note' => 'expedition' + 'adherent' => 'member', + 'banque' => 'bank', + 'categorie' => 'category', + 'commande' => 'order', + 'contrat' => 'contract', + 'expedition' => 'delivery_note', + 'facture' => 'invoice', + 'projet' => 'project', + 'propale' => 'propal', ); + if (!getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) { + // Special cases: both use the same module. $arrayconv['supplier_order'] = 'fournisseur'; $arrayconv['supplier_invoice'] = 'fournisseur'; } + + $module_alt = $module; if (!empty($arrayconv[$module])) { - $module = $arrayconv[$module]; + $module_alt = $arrayconv[$module]; } - return !empty($conf->modules[$module]); + return !empty($conf->modules[$module]) || !empty($conf->modules[$module_alt]); //return !empty($conf->$module->enabled); }