From 76df957c90765556cf67d4e5332efe7489748170 Mon Sep 17 00:00:00 2001 From: Laurent De Coninck Date: Mon, 25 Nov 2024 23:10:23 +0100 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9Bfix:=20the=20creation=20of=20th?= =?UTF-8?q?e=20add=20order=20-=20new=20mandatory=20param=20db?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + addOrder.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 57872d0..0dca145 100755 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /vendor/ +.idea diff --git a/addOrder.php b/addOrder.php index ea52e16..de4050b 100755 --- a/addOrder.php +++ b/addOrder.php @@ -16,7 +16,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; // Load object modCodeTiers -$module=(! empty($conf->global->SOCIETE_CODECLIENT_ADDON)?$conf->global->SOCIETE_CODECLIENT_ADDON:'mod_codeclient_leopard'); +$module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON', 'mod_codeclient_leopard'); if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { $module = substr($module, 0, dol_strlen($module)-4); @@ -29,7 +29,7 @@ } $modCodeClient = new $module; // Load object modCodeFournisseur -$module=(! empty($conf->global->SOCIETE_CODECLIENT_ADDON)?$conf->global->SOCIETE_CODECLIENT_ADDON:'mod_codeclient_leopard'); +$module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON', 'mod_codeclient_leopard'); if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { $module = substr($module, 0, dol_strlen($module)-4); From 1ab244dc559ca86256ab22215046c742c476bd13 Mon Sep 17 00:00:00 2001 From: Laurent De Coninck Date: Mon, 25 Nov 2024 23:12:38 +0100 Subject: [PATCH 2/2] add the db parameter, finally --- addOrder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addOrder.php b/addOrder.php index de4050b..2fdfb45 100755 --- a/addOrder.php +++ b/addOrder.php @@ -27,7 +27,7 @@ $res=dol_include_once($dirroot.$module.'.php'); if ($res) break; } -$modCodeClient = new $module; +$modCodeClient = new $module($db); // Load object modCodeFournisseur $module = getDolGlobalString('SOCIETE_CODECLIENT_ADDON', 'mod_codeclient_leopard'); if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') @@ -40,7 +40,7 @@ $res=dol_include_once($dirroot.$module.'.php'); if ($res) break; } -$modCodeFournisseur = new $module; +$modCodeFournisseur = new $module($db); // Load translation files required by the page $langs->load("mymodule@flightlog");