From 665dfb48e44a2b5339edb13a765773ead8467baf Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 22 Aug 2021 11:40:32 +0200 Subject: [PATCH 01/12] fix : Undefined property: stdClass:: in C:\wamp64\www\dolibarr-140\htdocs\comm\propal\card.php on line 125 --- htdocs/comm/propal/card.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 163581221a8..e77910d784d 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -6,7 +6,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2010-2016 Juanjo Menent - * Copyright (C) 2010-2018 Philippe Grand + * Copyright (C) 2010-2021 Philippe Grand * Copyright (C) 2012-2013 Christophe Battarel * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2013-2014 Florian Henry @@ -121,7 +121,9 @@ $usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights-> $usercancreateorder = $user->rights->commande->creer; $usercancreateinvoice = $user->rights->facture->creer; $usercancreatecontract = $user->rights->contrat->creer; -$usercancreateintervention = $user->rights->ficheinter->creer; +if (!empty($conf->ficheinter->enabled)) { + $usercancreateintervention = $user->rights->ficheinter->creer; +} $usercancreatepurchaseorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); $permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php From 6619099be9518de92b6c02f53b11515e8308e1ef Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 22 Aug 2021 12:05:30 +0200 Subject: [PATCH 02/12] fix : Undefined property: stdClass:: in C:\wamp64\www\dolibarr-140\htdocs\core\actions_builddoc.inc.php on line 69 --- htdocs/core/actions_builddoc.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/actions_builddoc.inc.php b/htdocs/core/actions_builddoc.inc.php index 63cac253976..7cde7e6f886 100644 --- a/htdocs/core/actions_builddoc.inc.php +++ b/htdocs/core/actions_builddoc.inc.php @@ -66,13 +66,13 @@ if ($action == 'builddoc' && $permissiontoadd) { $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && isset($object->thirdparty->default_lang)) { + if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($object->thirdparty->default_lang)) { $newlang = $object->thirdparty->default_lang; // for proposal, order, invoice, ... } - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && isset($object->default_lang)) { + if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($object->default_lang)) { $newlang = $object->default_lang; // for thirdparty } if (!empty($newlang)) { From 2e3b9fce49ddcbbc8301d35ae91b20d2b6feb9ea Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 22 Aug 2021 12:18:26 +0200 Subject: [PATCH 03/12] fix : Undefined array key 4 in C:\wamp64\www\dolibarr-140\htdocs\core\class\extrafields.class.php on line 1721 --- htdocs/core/class/extrafields.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index f6a5ba93d61..f64a1b44eb0 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1718,7 +1718,7 @@ class ExtraFields $sql = 'SELECT '.$keyList; $sql .= ' FROM '.MAIN_DB_PREFIX.$InfoFieldList[0]; - if (strpos($InfoFieldList[4], 'extra') !== false) { + if (!empty($InfoFieldList[4]) && strpos($InfoFieldList[4], 'extra') !== false) { $sql .= ' as main'; } if ($selectkey == 'rowid' && empty($value)) { From 538b2e2a5f1a780973d4102690ba0a40f36556af Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 22 Aug 2021 19:47:06 +0200 Subject: [PATCH 04/12] fix : Undefined property: stdClass:: in C:\wamp64\www\dolibarr-140\htdocs\core\class\commonobject.class.php on line 1705 --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 4d3c39027ac..00306939cdb 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1701,7 +1701,7 @@ abstract class CommonObject $idtype = $this->barcode_type; if (empty($idtype) && $idtype != '0') { // If type of barcode no set, we try to guess. If set to '0' it means we forced to have type remain not defined - if ($this->element == 'product') { + if ($this->element == 'product' && !empty($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE)) { $idtype = $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE; } elseif ($this->element == 'societe') { $idtype = $conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY; From 16f2a53fb8e3e94b6bdec4ffea3b52d3fe7880e5 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 22 Aug 2021 21:52:57 +0200 Subject: [PATCH 05/12] fix : Undefined property: stdClass:: in C:\wamp64\www\dolibarr-140\htdocs\product\class\propalmergepdfproduct.class.php on line 236 --- htdocs/product/class/propalmergepdfproduct.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php index 67c24ac37c8..a37ca09101b 100644 --- a/htdocs/product/class/propalmergepdfproduct.class.php +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -233,7 +233,7 @@ class Propalmergepdfproduct extends CommonObject $sql .= " FROM ".MAIN_DB_PREFIX."propal_merge_pdf_product as t"; $sql .= " WHERE t.fk_product = ".((int) $product_id); - if ($conf->global->MAIN_MULTILANGS && !empty($lang)) { + if (!empty($conf->global->MAIN_MULTILANGS) && !empty($lang)) { $sql .= " AND t.lang = '".$this->db->escape($lang)."'"; } From e439e0f14dd1d85cc5d99dfbbc36191a3e92ef36 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 22 Aug 2021 21:55:00 +0200 Subject: [PATCH 06/12] fix : Undefined property: stdClass:: in C:\wamp64\www\dolibarr-140\htdocs\product\class\propalmergepdfproduct.class.php on line 251 --- htdocs/product/class/propalmergepdfproduct.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php index a37ca09101b..6d15968af83 100644 --- a/htdocs/product/class/propalmergepdfproduct.class.php +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -248,7 +248,7 @@ class Propalmergepdfproduct extends CommonObject $line->fk_product = $obj->fk_product; $line->file_name = $obj->file_name; - if ($conf->global->MAIN_MULTILANGS) { + if (!empty($conf->global->MAIN_MULTILANGS)) { $line->lang = $obj->lang; } $line->fk_user_author = $obj->fk_user_author; From ba9ede39bfa08ed26b425b0c6d6da8d854ed235d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 22 Aug 2021 22:28:53 +0200 Subject: [PATCH 07/12] fix : Undefined property: stdClass:: in C:\wamp64\www\dolibarr-140\htdocs\comm\propal\card.php on line 265 --- htdocs/comm/propal/card.php | 4 ++-- htdocs/product/class/propalmergepdfproduct.class.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index e77910d784d..f69f41400c7 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -262,10 +262,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { + if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { $newlang = $object->thirdparty->default_lang; } if (!empty($newlang)) { diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php index 6d15968af83..5892a4fe810 100644 --- a/htdocs/product/class/propalmergepdfproduct.class.php +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -258,7 +258,7 @@ class Propalmergepdfproduct extends CommonObject $line->import_key = $obj->import_key; - if ($conf->global->MAIN_MULTILANGS) { + if (!empty($conf->global->MAIN_MULTILANGS)) { $this->lines[$obj->file_name.'_'.$obj->lang] = $line; } else { $this->lines[$obj->file_name] = $line; From 7baf98dbfa8d43b93fff85e12d2e9eb8748daac0 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 22 Aug 2021 23:15:36 +0200 Subject: [PATCH 08/12] fix : Undefined property: Conf:: in C:\wamp64\www\dolibarr-140\htdocs\core\class\html.form.class.php on line 7957 --- htdocs/core/class/html.form.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 07abdb4b465..f452216d93f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -10,7 +10,7 @@ * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2007 Patrick Raguin * Copyright (C) 2010 Juanjo Menent - * Copyright (C) 2010-2019 Philippe Grand + * Copyright (C) 2010-2021 Philippe Grand * Copyright (C) 2011 Herve Prot * Copyright (C) 2012-2016 Marcos GarcĂ­a * Copyright (C) 2012 Cedric Salvador @@ -7855,6 +7855,11 @@ class Form if (empty($conf->expedition->enabled)) { continue; // Do not show if module disabled } + } elseif ($objecttype == 'ficheinter') { + $tplpath = 'fichinter'; + if (empty($conf->ficheinter->enabled)) { + continue; // Do not show if module disabled + } } elseif ($objecttype == 'invoice_supplier') { $tplpath = 'fourn/facture'; } elseif ($objecttype == 'order_supplier') { From f88fdbe71d89b6007c212ccf6e55b192ddde00e0 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 23 Aug 2021 10:12:28 +0200 Subject: [PATCH 09/12] FIX : for php8 compliance --- htdocs/core/modules/modFicheinter.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/core/modules/modFicheinter.class.php b/htdocs/core/modules/modFicheinter.class.php index af99e6f646f..c8f9add05f6 100644 --- a/htdocs/core/modules/modFicheinter.class.php +++ b/htdocs/core/modules/modFicheinter.class.php @@ -77,6 +77,11 @@ class modFicheinter extends DolibarrModules $this->const = array(); $r = 0; + if (!isset($conf->ficheinter) || !isset($conf->ficheinter->enabled)) { + $conf->ficheinter = new stdClass(); + $conf->ficheinter->enabled = 0; + } + $this->const[$r][0] = "FICHEINTER_ADDON_PDF"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "soleil"; From 7c2d19ffafac11cc9afa0dc31d70eafcfc3fed67 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Mon, 23 Aug 2021 10:20:22 +0200 Subject: [PATCH 10/12] FIX : indentation --- htdocs/core/modules/modBlockedLog.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modBlockedLog.class.php b/htdocs/core/modules/modBlockedLog.class.php index 9a90fa945bb..0c645099f56 100644 --- a/htdocs/core/modules/modBlockedLog.class.php +++ b/htdocs/core/modules/modBlockedLog.class.php @@ -170,9 +170,9 @@ class modBlockedLog extends DolibarrModules $sql = array(); // If already used, we add an entry to show we enable module - require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php'; + require_once DOL_DOCUMENT_ROOT . '/blockedlog/class/blockedlog.class.php'; - $object = new stdClass(); + $object = new stdClass(); $object->id = 1; $object->element = 'module'; $object->ref = 'systemevent'; From 0286a2e75d0fa6069212a506061685bb82eaa2a6 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Tue, 24 Aug 2021 16:42:04 +0200 Subject: [PATCH 11/12] Update card.php --- htdocs/comm/propal/card.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index f69f41400c7..239e6124ea9 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -121,9 +121,7 @@ $usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights-> $usercancreateorder = $user->rights->commande->creer; $usercancreateinvoice = $user->rights->facture->creer; $usercancreatecontract = $user->rights->contrat->creer; -if (!empty($conf->ficheinter->enabled)) { - $usercancreateintervention = $user->rights->ficheinter->creer; -} +$user->hasRight('ficheinter', 'creer'); $usercancreatepurchaseorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); $permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php From ff47bf522633762fa517b738a16a608fd5fb2610 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Tue, 24 Aug 2021 16:46:21 +0200 Subject: [PATCH 12/12] Update card.php --- htdocs/comm/propal/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 239e6124ea9..61b7eb0015d 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -121,7 +121,7 @@ $usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights-> $usercancreateorder = $user->rights->commande->creer; $usercancreateinvoice = $user->rights->facture->creer; $usercancreatecontract = $user->rights->contrat->creer; -$user->hasRight('ficheinter', 'creer'); +$usercancreateintervention = $user->hasRight('ficheinter', 'creer'); $usercancreatepurchaseorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); $permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php