From 69ccd4f7d14a22a30c5c63b4283dc06d6b86ef3a Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 27 Aug 2022 19:35:30 +0200 Subject: [PATCH 001/114] FIX php8 compatibility --- htdocs/adherents/admin/website.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index 884c6e67be2..3c7775dc6b8 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -223,13 +223,13 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) { $listofval = array(); $listofval['-1'] = $langs->trans('No'); $listofval['all'] = $langs->trans('Yes').' ('.$langs->trans("VisitorCanChooseItsPaymentMode").')'; - if (!empty($conf->paybox->enabled)) { + if (isModEnabled('paybox')) { $listofval['paybox'] = 'Paybox'; } - if (!empty($conf->paypal->enabled)) { + if (isModEnabled('paypal')) { $listofval['paypal'] = 'PayPal'; } - if (!empty($conf->stripe->enabled)) { + if (isModEnabled('stripe')) { $listofval['stripe'] = 'Stripe'; } print $form->selectarray("MEMBER_NEWFORM_PAYONLINE", $listofval, (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE) ? $conf->global->MEMBER_NEWFORM_PAYONLINE : ''), 0); @@ -253,7 +253,7 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) { print '
'; //print $langs->trans('FollowingLinksArePublic').'
'; print img_picto('', 'globe').' '.$langs->trans('BlankSubscriptionForm').'
'; - if (!empty($conf->multicompany->enabled)) { + if (isModEnabled('multicompany')) { $entity_qr = '?entity='.$conf->entity; } else { $entity_qr = ''; From 5aef3a48fb079fddd904f7d45d600566200ffed0 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 27 Aug 2022 19:38:11 +0200 Subject: [PATCH 002/114] FIX php8 compatibility --- htdocs/admin/mails_ticket.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/mails_ticket.php b/htdocs/admin/mails_ticket.php index a439bdabcf0..b4f9ee23179 100644 --- a/htdocs/admin/mails_ticket.php +++ b/htdocs/admin/mails_ticket.php @@ -275,7 +275,7 @@ if ($action == 'edit') { } print ''; // SuperAdministrator access only - if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) { + if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { print ''; print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; @@ -305,7 +305,7 @@ if ($action == 'edit') { } print ''; // SuperAdministrator access only - if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) { + if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { print ''; print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; @@ -323,7 +323,7 @@ if ($action == 'edit') { $mainstmpid = (!empty($conf->global->MAIN_MAIL_SMTPS_ID_TICKET) ? $conf->global->MAIN_MAIL_SMTPS_ID_TICKET : ''); print ''.$langs->trans("MAIN_MAIL_SMTPS_ID").''; // SuperAdministrator access only - if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) { + if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { print ''; } else { $htmltext = $langs->trans("ContactSuperAdminForChange"); @@ -338,7 +338,7 @@ if ($action == 'edit') { $mainsmtppw = (!empty($conf->global->MAIN_MAIL_SMTPS_PW_TICKET) ? $conf->global->MAIN_MAIL_SMTPS_PW_TICKET : ''); print ''.$langs->trans("MAIN_MAIL_SMTPS_PW").''; // SuperAdministrator access only - if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) { + if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { print ''; } else { $htmltext = $langs->trans("ContactSuperAdminForChange"); @@ -496,7 +496,7 @@ if ($action == 'edit') { print ''.$langs->trans("DoTestSend").''; - if (!empty($conf->fckeditor->enabled)) { + if (isModEnabled('fckeditor')) { print ''.$langs->trans("DoTestSendHTML").''; } } From 1a73974de6057858c5eef6d5c4f9352f59383ad2 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 27 Aug 2022 19:39:58 +0200 Subject: [PATCH 003/114] FIX php8 compatibility --- htdocs/admin/mails.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 0504315075d..94c396f049d 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -404,7 +404,7 @@ if ($action == 'edit') { } print ''; // SuperAdministrator access only - if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) { + if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { print ''; print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; @@ -435,7 +435,7 @@ if ($action == 'edit') { } print ''; // SuperAdministrator access only - if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) { + if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { print ''; print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; @@ -453,7 +453,7 @@ if ($action == 'edit') { $mainstmpid = (!empty($conf->global->MAIN_MAIL_SMTPS_ID) ? $conf->global->MAIN_MAIL_SMTPS_ID : ''); print ''.$langs->trans("MAIN_MAIL_SMTPS_ID").''; // SuperAdministrator access only - if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) { + if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { print ''; } else { $htmltext = $langs->trans("ContactSuperAdminForChange"); @@ -467,7 +467,7 @@ if ($action == 'edit') { // OAUTH if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))) { print ''.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").''; - if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) { + if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { print ' '; print ''; print '            '; @@ -489,7 +489,7 @@ if ($action == 'edit') { print $form->textwithpicto($langs->trans("MAIN_MAIL_SMTPS_PW"), $langs->trans("WithGMailYouCanCreateADedicatedPassword")); print ''; // SuperAdministrator access only - if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) { + if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { print ''; } else { $htmltext = $langs->trans("ContactSuperAdminForChange"); @@ -911,7 +911,7 @@ if ($action == 'edit') { print ''.$langs->trans("DoTestSend").''; - if (!empty($conf->fckeditor->enabled)) { + if (isModEnabled('fckeditor')) { print ''.$langs->trans("DoTestSendHTML").''; } } From baa65a7af435976506eb2a9a719a995490feea89 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 27 Aug 2022 19:41:47 +0200 Subject: [PATCH 004/114] FIX php8 compatibility --- htdocs/admin/modules.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index d04039aefdf..05f7ed441f7 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -786,14 +786,14 @@ if ($mode == 'common' || $mode == 'commonkanban') { if (!empty($objMod->disabled)) { $codeenabledisable .= $langs->trans("Disabled"); - } elseif (!empty($objMod->always_enabled) || ((!empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity != 1))) { + } elseif (!empty($objMod->always_enabled) || ((isModEnabled('multicompany') && $objMod->core_enabled) && ($user->entity || $conf->entity != 1))) { if (method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) { $codeenabledisable .= $langs->trans("Used"); } else { $codeenabledisable .= img_picto($langs->trans("Required"), 'switch_on', '', false, 0, 0, '', 'opacitymedium valignmiddle'); //print $langs->trans("Required"); } - if (!empty($conf->multicompany->enabled) && $user->entity) { + if (isModEnabled('multicompany') && $user->entity) { $disableSetup++; } } else { @@ -1279,7 +1279,7 @@ if ($mode == 'develop') { print ''; print ''.$langs->trans("TryToUseTheModuleBuilder", $langs->transnoentitiesnoconv("ModuleBuilder")).''; print ''; - if (!empty($conf->modulebuilder->enabled)) { + if (isModEnabled('modulebuilder')) { print $langs->trans("SeeTopRightMenu"); } else { print ''.$langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("ModuleBuilder")).''; From c1f35695f47b692bdb0787797c6fa6b4e06e9e7a Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 27 Aug 2022 19:43:19 +0200 Subject: [PATCH 005/114] FIX php8 compatibility --- htdocs/admin/pdf.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 41215f98402..f534ff881da 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -108,7 +108,7 @@ if ($action == 'update') { dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", GETPOST("MAIN_TVAINTRA_NOT_IN_ADDRESS"), 'chaine', 0, '', $conf->entity); } - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { if (GETPOST('PDF_SHOW_PROJECT_REF_OR_LABEL') == 'no') { dolibarr_del_const($db, "PDF_SHOW_PROJECT", $conf->entity); dolibarr_del_const($db, "PDF_SHOW_PROJECT_TITLE", $conf->entity); @@ -486,7 +486,7 @@ print ''; // Show project -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { print ''.$langs->trans("PDF_SHOW_PROJECT").''; $tmparray = array('no' => 'No', 'showprojectref' => 'RefProject', 'showprojectlabel' => 'ShowProjectLabel'); $showprojectref = empty($conf->global->PDF_SHOW_PROJECT) ? (empty($conf->global->PDF_SHOW_PROJECT_TITLE) ? 'no' : 'showprojectlabel') : 'showprojectref'; From 64c92eda24add68b4eedf77605a800faa8009f9a Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 27 Aug 2022 19:44:59 +0200 Subject: [PATCH 006/114] FIX php8 compatibility --- htdocs/admin/propal.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index a83e08ba4cf..eea567ea27c 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -515,7 +515,7 @@ print ''; print ''; print $langs->trans("PaymentMode").''; print ''; -if (empty($conf->facture->enabled)) { +if (!isModEnabled('facture')) { print ''; } print ''; @@ -524,7 +524,7 @@ print "\n"; print ''; print "".$langs->trans("SuggestPaymentByRIBOnAccount").""; print ""; -if (empty($conf->facture->enabled)) { +if (!isModEnabled('facture')) { if (isModEnabled("banque")) { $sql = "SELECT rowid, label"; $sql .= " FROM ".MAIN_DB_PREFIX."bank_account"; @@ -563,7 +563,7 @@ print ""; print ''; print "".$langs->trans("SuggestPaymentByChequeToAddress").""; print ""; -if (empty($conf->facture->enabled)) { +if (!isModEnabled('facture')) { print ''; // Limit to superadmin - /*if (! empty($conf->multicompany->enabled) && !$user->entity) + /*if (isModEnabled('multicompany') && !$user->entity) { print ''; print ''; @@ -525,7 +525,7 @@ if ($mode == 'searchkey') { print_liste_field_titre("Language_en_US_es_MX_etc", $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder); print_liste_field_titre("Key", $_SERVER["PHP_SELF"], 'transkey', '', $param, '', $sortfield, $sortorder); print_liste_field_titre("CurrentTranslationString", $_SERVER["PHP_SELF"], 'transvalue', '', $param, '', $sortfield, $sortorder); - //if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,transkey', '', $param, '', $sortfield, $sortorder); + //if (isModEnabled('multicompany') && !$user->entity) print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,transkey', '', $param, '', $sortfield, $sortorder); print ''; print "\n"; @@ -609,7 +609,7 @@ if ($mode == 'searchkey') { $htmltext = $langs->trans("TransKeyWithoutOriginalValue", $key); print $form->textwithpicto('', $htmltext, 1, 'warning'); } - /*if (! empty($conf->multicompany->enabled) && !$user->entity) + /*if (isModEnabled('multicompany') && !$user->entity) { print ''.$val.''; }*/ From 41ed2967c54d5ad0ad9dfb80b93f0cc4126a5da0 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 13:36:26 +0200 Subject: [PATCH 009/114] FIX php8 compatibility --- htdocs/admin/system/constall.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/system/constall.php b/htdocs/admin/system/constall.php index 9a27feb3d7a..fee82d89958 100644 --- a/htdocs/admin/system/constall.php +++ b/htdocs/admin/system/constall.php @@ -205,7 +205,7 @@ print ''; print ''; print ''; print ''; -if (empty($conf->multicompany->enabled) || !$user->entity) { +if (!isModEnabled('multicompany') || !$user->entity) { print ''; // If superadmin or multicompany disabled } print "\n"; @@ -218,7 +218,7 @@ $sql .= ", type"; $sql .= ", note"; $sql .= ", entity"; $sql .= " FROM ".MAIN_DB_PREFIX."const"; -if (empty($conf->multicompany->enabled)) { +if (!isModEnabled('multicompany')) { // If no multicompany mode, admins can see global and their constantes $sql .= " WHERE entity IN (0,".$conf->entity.")"; } else { @@ -239,7 +239,7 @@ if ($resql) { print ''; print ''."\n"; print ''."\n"; - if (empty($conf->multicompany->enabled) || !$user->entity) { + if (!isModEnabled('multicompany') || !$user->entity) { print ''."\n"; // If superadmin or multicompany disabled } print "\n"; From 2900c7aaf71f7fb926f5bc8d4a415ab759fd96a0 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 13:38:02 +0200 Subject: [PATCH 010/114] FIX php8 compatibility --- htdocs/admin/system/dolibarr.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 8a982f6e0bd..31fa647f403 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -382,7 +382,7 @@ foreach ($configfileparameters as $key => $value) { $newkey = preg_replace('/^\?/', '', $key); if (preg_match('/^\?/', $key) && empty(${$newkey})) { - if ($newkey != 'multicompany_transverse_mode' || empty($conf->multicompany->enabled)) { + if ($newkey != 'multicompany_transverse_mode' || !isModEnabled('multicompany')) { continue; // We discard parameters starting with ? } } @@ -483,7 +483,7 @@ print '
'.$langs->trans("Parameter").''.$langs->trans("Value").''.$langs->trans("Entity").'
'.$obj->name.''.$obj->value.''.$obj->entity.'
'; print ''; print ''; print ''; -if (empty($conf->multicompany->enabled) || !$user->entity) { +if (!isModEnabled('multicompany') || !$user->entity) { print ''; // If superadmin or multicompany disabled } print "\n"; @@ -496,7 +496,7 @@ $sql .= ", type"; $sql .= ", note"; $sql .= ", entity"; $sql .= " FROM ".MAIN_DB_PREFIX."const"; -if (empty($conf->multicompany->enabled)) { +if (!isModEnabled('multicompany')) { // If no multicompany mode, admins can see global and their constantes $sql .= " WHERE entity IN (0,".$conf->entity.")"; } else { @@ -526,7 +526,7 @@ if ($resql) { print dol_escape_htmltag($obj->value); } print ''."\n"; - if (empty($conf->multicompany->enabled) || !$user->entity) { + if (!isModEnabled('multicompany') || !$user->entity) { print ''."\n"; // If superadmin or multicompany disabled } print "\n"; From f2069d0c5f378e6a8aa6d91268734f26742d5cf3 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 13:39:12 +0200 Subject: [PATCH 011/114] FIX php8 compatibility --- htdocs/admin/tools/listevents.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index 6d6a8edb10f..da7ae901766 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -418,7 +418,7 @@ if ($result) { $userstatic->status = $obj->status; print $userstatic->getLoginUrl(1); - if (!empty($conf->multicompany->enabled) && $userstatic->admin && !$userstatic->entity) { + if (isModEnabled('multicompany') && $userstatic->admin && !$userstatic->entity) { print img_picto($langs->trans("SuperAdministrator"), 'redstar', 'class="valignmiddle paddingleft"'); } elseif ($userstatic->admin) { print img_picto($langs->trans("Administrator"), 'star', 'class="valignmiddle paddingleft"'); From 1ec7f640a71be26c4caede435a9a5d137494b627 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 13:40:32 +0200 Subject: [PATCH 012/114] FIX php8 compatibility --- htdocs/bom/class/bom.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 50d97150d6a..576d8f5fb09 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -239,7 +239,7 @@ class BOM extends CommonObject if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { $this->fields['rowid']['visible'] = 0; } - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { $this->fields['entity']['enabled'] = 0; } @@ -1525,7 +1525,7 @@ class BOMLine extends CommonObjectLine if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { $this->fields['rowid']['visible'] = 0; } - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { $this->fields['entity']['enabled'] = 0; } From 3bb1a2387b829d6dd2e4f1cc1db9c9ca2e9b0956 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 13:42:27 +0200 Subject: [PATCH 013/114] FIX php8 compatibility --- htdocs/comm/remx.php | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index db1cc06c504..a47a865fc45 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -424,12 +424,12 @@ if ($socid > 0) { print ''; print ''; print ''; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicompany')) { print ''; } print ''; print ''; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicompany')) { print ''; } print ''; @@ -474,12 +474,12 @@ if ($socid > 0) { } print ''; print ''; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicompany')) { print ''; } print ''; print ''; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicompany')) { print ''; } print ''; @@ -562,12 +562,12 @@ if ($socid > 0) { print ''; print ''; print ''; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicompany')) { print ''; } print ''; print ''; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicompany')) { print ''; } print ''; @@ -612,12 +612,12 @@ if ($socid > 0) { } print ''; print ''; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicompany')) { print ''; } print ''; print ''; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicompany')) { print ''; } print ''; @@ -735,12 +735,12 @@ if ($socid > 0) { print ''; print ''; print ''; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicompany')) { print ''; } print ''; print ''; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicompany')) { print ''; } print ''; @@ -808,12 +808,12 @@ if ($socid > 0) { } print ''; print ''; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicompany')) { print ''; } print ''; print ''; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicompany')) { print ''; } print ''; @@ -896,12 +896,12 @@ if ($socid > 0) { print ''; print ''; print ''; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicompany')) { print ''; } print ''; print ''; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicompany')) { print ''; } print ''; @@ -969,12 +969,12 @@ if ($socid > 0) { } print ''; print ''; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicompany')) { print ''; } print ''; print ''; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicompany')) { print ''; } print ''; From 5c6f9281c9b80ade432f8a22bb66b3d9d595ce58 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 13:43:12 +0200 Subject: [PATCH 014/114] FIX php8 compatibility --- htdocs/comm/action/peruser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index b30ef8f7ba9..f28a3b2f719 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -901,7 +901,7 @@ while ($currentdaytoshow < $lastdaytoshow) { /* Use this list to have for all users */ $sql = "SELECT DISTINCT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; - if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { + if (isModEnabled('multicompany') && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { $sql .= ", ".MAIN_DB_PREFIX."usergroup_user as ug"; $sql .= " WHERE ug.entity IN (".getEntity('usergroup').")"; $sql .= " AND ug.fk_user = u.rowid "; From 3d64296992373ad827aeebd330a745a1fee8339e Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 13:43:50 +0200 Subject: [PATCH 015/114] FIX php8 compatibility --- htdocs/comm/action/class/actioncommreminder.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/class/actioncommreminder.class.php b/htdocs/comm/action/class/actioncommreminder.class.php index ff242430b0a..eb0d464777a 100644 --- a/htdocs/comm/action/class/actioncommreminder.class.php +++ b/htdocs/comm/action/class/actioncommreminder.class.php @@ -149,7 +149,7 @@ class ActionCommReminder extends CommonObject if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) { $this->fields['rowid']['visible'] = 0; } - if (empty($conf->multicompany->enabled)) { + if (!isModEnabled('multicompany')) { $this->fields['entity']['enabled'] = 0; } } From 42073e394abe9c123e9e686260c07fc8731f2360 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 13:45:14 +0200 Subject: [PATCH 016/114] FIX php8 compatibility --- htdocs/knowledgemanagement/class/knowledgerecord.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index d48be5e2a21..f063db604e0 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -187,7 +187,7 @@ class KnowledgeRecord extends CommonObject if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { $this->fields['rowid']['visible'] = 0; } - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { $this->fields['entity']['enabled'] = 0; } From 3b0b7ec1ee8bead9a9bfc5913d0691c3997457b4 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 13:45:54 +0200 Subject: [PATCH 017/114] FIX php8 compatibility --- htdocs/asset/class/asset.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 16306e73441..55d2bc07593 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -195,7 +195,7 @@ class Asset extends CommonObject if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { $this->fields['rowid']['visible'] = 0; } - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { $this->fields['entity']['enabled'] = 0; } From 480e99b19271ae4ac76cc25de354464bea73ba59 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 13:46:30 +0200 Subject: [PATCH 018/114] FIX php8 compatibility --- htdocs/asset/class/assetmodel.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/asset/class/assetmodel.class.php b/htdocs/asset/class/assetmodel.class.php index 6b75702278d..fb574e6ea18 100644 --- a/htdocs/asset/class/assetmodel.class.php +++ b/htdocs/asset/class/assetmodel.class.php @@ -160,7 +160,7 @@ class AssetModel extends CommonObject if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { $this->fields['rowid']['visible'] = 0; } - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { $this->fields['entity']['enabled'] = 0; } From 5f1d6b406fc2c9fb752f41ab9602519dc032dfc1 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 13:47:36 +0200 Subject: [PATCH 019/114] FIX php8 compatibility --- htdocs/comm/mailing/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 748c5fabf10..eb1b50cee1b 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -258,7 +258,7 @@ if (empty($reshook)) { } } if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) { - $substitutionarray['__PUBLICLINK_NEWMEMBERFORM__'] = ''.$langs->trans('BlankSubscriptionForm'). ''; + $substitutionarray['__PUBLICLINK_NEWMEMBERFORM__'] = ''.$langs->trans('BlankSubscriptionForm'). ''; } /* For backward compatibility, deprecated */ if (!empty($conf->paypal->enabled) && !empty($conf->global->PAYPAL_SECURITY_TOKEN)) { From 87c7ffc4edd6927adc20350346bf9334848c0cbd Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 13:48:32 +0200 Subject: [PATCH 020/114] FIX php8 compatibility --- htdocs/compta/accounting-files.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 5e6ef3bbedf..f2f9d6e3f56 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -117,7 +117,7 @@ if ($user->socid > 0) { // Define $arrayofentities if multientity is set. $arrayofentities = array(); -if (!empty($conf->multicompany->enabled) && is_object($mc)) { +if (isModEnabled('multicompany') && is_object($mc)) { $arrayofentities = $mc->getEntitiesList(); } @@ -696,14 +696,14 @@ if (!empty($date_start) && !empty($date_stop)) { print ''; print ''; print ''; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicompany')) { print ''; } print ''; if (empty($TData)) { print ''; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicompany')) { print ''; } print ''; @@ -833,7 +833,7 @@ if (!empty($date_start) && !empty($date_stop)) { $totalVAT_debit -= $data['amount_vat']; } - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicompany')) { print '\n"; } @@ -847,7 +847,7 @@ if (!empty($date_start) && !empty($date_stop)) { print ''; print ''; print ''; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicompany')) { print ''; } print "\n"; @@ -858,7 +858,7 @@ if (!empty($date_start) && !empty($date_stop)) { print ''; print ''; print ''; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicompany')) { print ''; } print "\n"; @@ -869,7 +869,7 @@ if (!empty($date_start) && !empty($date_stop)) { print ''; print ''; print ''; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicompany')) { print ''; } print "\n"; From c0154f4ac8fe6b292197c3b9cdc916dd8d9c92ea Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 13:49:41 +0200 Subject: [PATCH 021/114] FIX php8 compatibility --- htdocs/compta/accounting-files.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index f2f9d6e3f56..30d2bedcf14 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -122,7 +122,7 @@ if (isModEnabled('multicompany') && is_object($mc)) { } $entity = (GETPOSTISSET('entity') ? GETPOST('entity', 'int') : (GETPOSTISSET('search_entity') ? GETPOST('search_entity', 'int') : $conf->entity)); -if (!empty($conf->multicompany->enabled) && is_object($mc)) { +if (isModEnabled('multicompany') && is_object($mc)) { if (empty($entity) && !empty($conf->global->MULTICOMPANY_ALLOW_EXPORT_ACCOUNTING_DOC_FOR_ALL_ENTITIES)) { $entity = '0,'.join(',', array_keys($arrayofentities)); } @@ -456,7 +456,7 @@ if ($result && $action == "dl" && !$error) { dol_mkdir($dirfortmpfile); $log = $langs->transnoentitiesnoconv("Type"); - if (!empty($conf->multicompany->enabled) && is_object($mc)) { + if (isModEnabled('multicompany') && is_object($mc)) { $log .= ','.$langs->transnoentitiesnoconv("Entity"); } $log .= ','.$langs->transnoentitiesnoconv("Date"); @@ -498,7 +498,7 @@ if ($result && $action == "dl" && !$error) { } $log .= '"'.$langs->trans($file['item']).'"'; - if (!empty($conf->multicompany->enabled) && is_object($mc)) { + if (isModEnabled('multicompany') && is_object($mc)) { $log .= ',"'.(empty($arrayofentities[$file['entity']]) ? $file['entity'] : $arrayofentities[$file['entity']]).'"'; } $log .= ','.dol_print_date($file['date'], 'dayrfc'); @@ -583,7 +583,7 @@ print "\n"; // Export is for current company only $socid = 0; -if (!empty($conf->multicompany->enabled) && is_object($mc)) { +if (isModEnabled('multicompany') && is_object($mc)) { $mc->getInfo($conf->entity); print '('.$langs->trans("Entity").' : '; print "'; print ''; print ''; - if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED)) { + if (isModEnabled('multicompany') && !empty($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED)) { print ''; } print ''; From b886210df3b365d358be1755989b9f9260627461 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 13:51:29 +0200 Subject: [PATCH 024/114] FIX php8 compatibility --- htdocs/compta/paiement/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 235b0a0af4f..f163041a43a 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -462,7 +462,7 @@ if ($resql) { print ''; // Expected to pay - if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED)) { + if (isModEnabled('multicompany') && !empty($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED)) { print ' -multicompany->enabled)) { ?> + From f43ebf040cc8a0f434fb7fa1cddd129f44bba19f Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:06:52 +0200 Subject: [PATCH 044/114] FIX php8 compatibility --- htdocs/core/tpl/admin_extrafields_edit.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index a512222aca2..8dcc1edf017 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -296,7 +296,7 @@ if (in_array($type, array_keys($typewecanchangeinto))) { -multicompany->enabled)) { ?> + From accd5a74a2693d59fe6bc4d7c0e6c595b010e901 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:07:20 +0200 Subject: [PATCH 045/114] FIX php8 compatibility --- htdocs/core/tpl/admin_extrafields_view.tpl.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/tpl/admin_extrafields_view.tpl.php b/htdocs/core/tpl/admin_extrafields_view.tpl.php index da1d2d58558..285b7eb30a4 100644 --- a/htdocs/core/tpl/admin_extrafields_view.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_view.tpl.php @@ -65,7 +65,7 @@ print ''; print ''; print ''; print ''; -if (!empty($conf->multicompany->enabled)) { +if (isModEnabled('multicompany')) { print ''; } print ''; @@ -113,7 +113,7 @@ if (isset($extrafields->attributes[$elementtype]['type']) && is_array($extrafiel print '\n"; // Summable print '\n"; - if (!empty($conf->multicompany->enabled)) { + if (isModEnabled('multicompany')) { print '"; - if (!empty($conf->multicompany->enabled)) { + if (isModEnabled('multicompany')) { print ''; print ''; print ''; print ''; print ''; print ''; From f943ea4ccc3683416a3dc7b586ae8dd29c59c987 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:18:51 +0200 Subject: [PATCH 065/114] FIX php8 compatibility --- htdocs/install/upgrade2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index a9e48c96bf3..a7216b6ad72 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -420,7 +420,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ $afterversionarray = explode('.', '5.0.9'); $beforeversionarray = explode('.', '6.0.9'); if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) { - if (!empty($conf->multicompany->enabled)) { + if (isModEnabled('multicompany')) { global $multicompany_transverse_mode; // Only if the transverse mode is not used From a58fe2e8961bfeb998de9623e30c1d40d45b9ec1 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:19:25 +0200 Subject: [PATCH 066/114] FIX php8 compatibility --- htdocs/modulebuilder/template/class/myobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index f3538d65cfa..94f57bdd776 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -253,7 +253,7 @@ class MyObject extends CommonObject if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid']) && !empty($this->fields['ref'])) { $this->fields['rowid']['visible'] = 0; } - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { $this->fields['entity']['enabled'] = 0; } From 4250625e3872a163aa44bd89a11360b58e98a6d5 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:20:24 +0200 Subject: [PATCH 067/114] FIX php8 compatibility --- htdocs/mrp/class/mo.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index d186c6e533b..4a3a6bc8dd8 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -224,7 +224,7 @@ class Mo extends CommonObject if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { $this->fields['rowid']['visible'] = 0; } - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { $this->fields['entity']['enabled'] = 0; } @@ -1637,7 +1637,7 @@ class MoLine extends CommonObjectLine if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { $this->fields['rowid']['visible'] = 0; } - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { $this->fields['entity']['enabled'] = 0; } From 629c40b0dfb4b62b357e916dcf5d44a798555312 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:20:47 +0200 Subject: [PATCH 068/114] FIX php8 compatibility --- htdocs/partnership/admin/website.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/partnership/admin/website.php b/htdocs/partnership/admin/website.php index 49fd7ff91df..2b1a6d4d365 100644 --- a/htdocs/partnership/admin/website.php +++ b/htdocs/partnership/admin/website.php @@ -220,7 +220,7 @@ if (!empty($conf->global->PARTNERSHIP_ENABLE_PUBLIC)) { print '
'; //print $langs->trans('FollowingLinksArePublic').'
'; print img_picto('', 'globe').' '.$langs->trans('BlankSubscriptionForm').'
'; - if (!empty($conf->multicompany->enabled)) { + if (isModEnabled('multicompany')) { $entity_qr = '?entity='.$conf->entity; } else { $entity_qr = ''; From 84ff7e364849d5748dd4e4e302e3fd417a5634ad Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:21:23 +0200 Subject: [PATCH 069/114] FIX php8 compatibility --- htdocs/partnership/class/partnership_type.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/partnership/class/partnership_type.class.php b/htdocs/partnership/class/partnership_type.class.php index e0163ba4dfc..32162ae0b97 100644 --- a/htdocs/partnership/class/partnership_type.class.php +++ b/htdocs/partnership/class/partnership_type.class.php @@ -90,7 +90,7 @@ class PartnershipType extends CommonObject if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { $this->fields['rowid']['visible'] = 0; } - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { $this->fields['entity']['enabled'] = 0; } From c0239b95ea9b3a1990ad1d47d7d87405e848c565 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:22:17 +0200 Subject: [PATCH 070/114] FIX php8 compatibility --- htdocs/partnership/class/partnership.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 38d8c333749..8b1ede66506 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -204,7 +204,7 @@ class Partnership extends CommonObject if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid']) && !empty($this->fields['ref'])) { $this->fields['rowid']['visible'] = 0; } - // if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + // if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { // $this->fields['entity']['enabled'] = 0; // } From 30891769d81a21530a1c7b1d30debe1e984a14ed Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:22:57 +0200 Subject: [PATCH 071/114] FIX php8 compatibility --- htdocs/product/admin/product.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 24b34dc5ccc..8696b27e521 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -338,7 +338,7 @@ foreach ($dirproduct as $dirroot) { print "\n"; } else { $disabled = false; - if (!empty($conf->multicompany->enabled) && (is_object($mc) && !empty($mc->sharings['referent']) && $mc->sharings['referent'] == $conf->entity) ? false : true) { + if (isModEnabled('multicompany') && (is_object($mc) && !empty($mc->sharings['referent']) && $mc->sharings['referent'] == $conf->entity) ? false : true) { } print '
'; // Rule for price print ''; -if (empty($conf->multicompany->enabled)) { +if (!isModEnabled('multicompany')) { print ''; } else { print ''; From 9d7e025d455d591b4af7e5422b83c3a9c97250ec Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:23:27 +0200 Subject: [PATCH 072/114] FIX php8 compatibility --- htdocs/product/class/productfournisseurprice.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/productfournisseurprice.class.php b/htdocs/product/class/productfournisseurprice.class.php index 8f166f702b1..4cbd998a0f6 100644 --- a/htdocs/product/class/productfournisseurprice.class.php +++ b/htdocs/product/class/productfournisseurprice.class.php @@ -178,7 +178,7 @@ class ProductFournisseurPrice extends CommonObject $this->db = $db; if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0; - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0; + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0; // Unset fields that are disabled foreach ($this->fields as $key => $val) { From 76dd110bc3cbd1b5d669c7fcb72327a9c552376e Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:23:54 +0200 Subject: [PATCH 073/114] FIX php8 compatibility --- htdocs/product/inventory/class/inventory.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index d7d167035a7..1ce464d31d6 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -236,7 +236,7 @@ class Inventory extends CommonObject if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) { $this->fields['rowid']['visible'] = 0; } - if (empty($conf->multicompany->enabled)) { + if (!isModEnabled('multicompany')) { $this->fields['entity']['enabled'] = 0; } } From 18d6a95a7db7a21b72dd27119112bdcbfa04dbe2 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:24:26 +0200 Subject: [PATCH 074/114] FIX php8 compatibility --- .../product/stock/stocktransfer/class/stocktransfer.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php index 80e3f73b646..d164ad858b9 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php @@ -197,7 +197,7 @@ class StockTransfer extends CommonObject $this->origin_type = 'StockTransfer@product/stock/stocktransfer'; if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0; - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0; + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0; // Example to show how to set values of fields definition dynamically /*if ($user->rights->stocktransfer->stocktransfer->read) { From 45248e1dbdf722f55203450fb5b5f10c575c6cd9 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:24:54 +0200 Subject: [PATCH 075/114] FIX php8 compatibility --- .../stock/stocktransfer/class/stocktransferline.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php b/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php index 427d577b436..0495dada008 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php @@ -165,7 +165,7 @@ class StockTransferLine extends CommonObjectLine $this->db = $db; if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0; - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0; + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0; // Example to show how to set values of fields definition dynamically /*if ($user->rights->stocktransfer->stocktransferline->read) { From 445d160fda8164aa29f5c90fd5286d0ae306e4f7 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:25:16 +0200 Subject: [PATCH 076/114] FIX php8 compatibility --- htdocs/projet/admin/website.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/admin/website.php b/htdocs/projet/admin/website.php index 37b858757ca..eead379c804 100644 --- a/htdocs/projet/admin/website.php +++ b/htdocs/projet/admin/website.php @@ -158,7 +158,7 @@ if (!empty($conf->global->PROJECT_ENABLE_PUBLIC)) { print '
'; //print $langs->trans('FollowingLinksArePublic').'
'; print img_picto('', 'globe').' '.$langs->trans('BlankSubscriptionForm').'
'; - if (!empty($conf->multicompany->enabled)) { + if (isModEnabled('multicompany')) { $entity_qr = '?entity='.$conf->entity; } else { $entity_qr = ''; From 492229b48c5047073c907bd7e5f2abc7f9b7f893 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:25:43 +0200 Subject: [PATCH 077/114] FIX php8 compatibility --- htdocs/public/onlinesign/newonlinesign.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index e698c20c4f0..0988feec5a2 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -139,7 +139,7 @@ if ($source == 'proposal') { $securekeyseed = getDolGlobalString('PROPOSAL_ONLINE_SIGNATURE_SECURITY_TOKEN'); } -if (!dol_verifyHash($securekeyseed.$type.$ref.(empty($conf->multicompany->enabled) ? '' : $entity), $SECUREKEY, '0')) { +if (!dol_verifyHash($securekeyseed.$type.$ref.(!isModEnabled('multicompany') ? '' : $entity), $SECUREKEY, '0')) { http_response_code(403); print 'Bad value for securitykey. Value provided '.dol_escape_htmltag($SECUREKEY).' does not match expected value for ref='.dol_escape_htmltag($ref); exit(-1); From decf806a068e9d18e4d7b4980aac1546e71a64bc Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:26:42 +0200 Subject: [PATCH 078/114] FIX php8 compatibility --- htdocs/public/onlinesign/newonlinesign.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 0988feec5a2..c7264ade568 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -193,7 +193,7 @@ $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; llxHeader($head, $langs->trans("OnlineSignature"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea, 1); if ($action == 'refusepropal') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?ref='.urlencode($ref).'&securekey='.urlencode($SECUREKEY).($conf->multicompany->enabled?'&entity='.$entity:''), $langs->trans('RefusePropal'), $langs->trans('ConfirmRefusePropal', $object->ref), 'confirm_refusepropal', '', '', 1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?ref='.urlencode($ref).'&securekey='.urlencode($SECUREKEY).(isModEnabled('multicompany')?'&entity='.$entity:''), $langs->trans('RefusePropal'), $langs->trans('ConfirmRefusePropal', $object->ref), 'confirm_refusepropal', '', '', 1); } // Check link validity for param 'source' to avoid use of the examples as value @@ -429,7 +429,7 @@ if ($action == "dosign" && empty($cancel)) { success: function(response) { if(response == "success"){ console.log("Success on saving signature"); - window.location.replace("'.$_SERVER["PHP_SELF"].'?ref='.urlencode($ref).'&message=signed&securekey='.urlencode($SECUREKEY).($conf->multicompany->enabled?'&entity='.$entity:'').'"); + window.location.replace("'.$_SERVER["PHP_SELF"].'?ref='.urlencode($ref).'&message=signed&securekey='.urlencode($SECUREKEY).(isModEnabled('multicompany')?'&entity='.$entity:'').'"); }else{ console.error(response); } From a37fed87b3d3cea20bfb54e3fe6163525aada9bf Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:27:28 +0200 Subject: [PATCH 079/114] FIX php8 compatibility --- htdocs/public/stripe/ipn.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index 6674ce9c6de..29e22c72de7 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -126,7 +126,7 @@ try { $langs->load("main"); -if (!empty($conf->multicompany->enabled) && !empty($conf->stripeconnect->enabled) && is_object($mc)) { +if (isModEnabled('multicompany') && !empty($conf->stripeconnect->enabled) && is_object($mc)) { $sql = "SELECT entity"; $sql .= " FROM ".MAIN_DB_PREFIX."oauth_token"; $sql .= " WHERE service = '".$db->escape($service)."' and tokenstring LIKE '%".$db->escape($event->account)."%'"; From 65c05a374f46c9c3549c8fdcbd723b42d1637f7d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:27:54 +0200 Subject: [PATCH 080/114] FIX php8 compatibility --- htdocs/public/ticket/create_ticket.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index 1c302c33b2e..33b3b8bdccd 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -425,7 +425,7 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('save', 'alpha')) { $messagetoshow = str_replace(array('{s1}', '{s2}'), array(''.$object->track_id.'', ''.$object->ref.''), $messagetoshow); setEventMessages($messagetoshow, null, 'warnings'); setEventMessages($langs->trans('PleaseRememberThisId'), null, 'warnings'); - header("Location: index.php".(!empty($entity) && !empty($conf->multicompany->enabled)?'?entity='.$entity:'')); + header("Location: index.php".(!empty($entity) && isModEnabled('multicompany')?'?entity='.$entity:'')); exit; } } else { From 466284f260833a9f021211216515ab200706b0fe Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:28:22 +0200 Subject: [PATCH 081/114] FIX php8 compatibility --- htdocs/public/ticket/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/public/ticket/index.php b/htdocs/public/ticket/index.php index f7abe746832..4ea314c8149 100644 --- a/htdocs/public/ticket/index.php +++ b/htdocs/public/ticket/index.php @@ -84,9 +84,9 @@ llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss); print ''; From c2c13d41eff8edc8d21e9f5e82de6a788fbe5bfd Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:28:52 +0200 Subject: [PATCH 082/114] FIX php8 compatibility --- htdocs/public/ticket/list.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index a15beff2856..9e156b341a0 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -221,7 +221,7 @@ if ($action == "view_ticketlist") { $filter = array(); $param = '&action=view_ticketlist'; - if (!empty($entity) && !empty($conf->multicompany->enabled)) { + if (!empty($entity) && isModEnabled('multicompany')) { $param .= '&entity='.$entity; } @@ -401,7 +401,7 @@ if ($action == "view_ticketlist") { print_barre_liste($langs->trans('TicketList'), $page, '/public/ticket/list.php', $param, $sortfield, $sortorder, '', $num, $num_total, 'ticket'); // Search bar - print '
'."\n"; + print ''."\n"; print ''; print ''; print ''; @@ -688,7 +688,7 @@ if ($action == "view_ticketlist") { print '
'.$langs->trans("Parameters").' '.$langs->trans("Database").''.$langs->trans("Value").''.$langs->trans("Entity").'
'.$obj->entity.'
'.$langs->trans("ReasonDiscount").''.$langs->trans("ConsumedBy").''.$langs->trans("AmountHT").''.$langs->trans("MulticurrencyAmountHT").''.$langs->trans("VATRate").''.$langs->trans("AmountTTC").''.$langs->trans("MulticurrencyAmountTTC").''.$langs->trans("DiscountOfferedBy").''.$langs->trans("NotConsumed").''.price($obj->amount_ht).''.price($obj->multicurrency_amount_ht).''.vatrate($obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''), true).''.price($obj->amount_ttc).''.price($obj->multicurrency_amount_ttc).''; @@ -503,7 +503,7 @@ if ($socid > 0) { } } else { $colspan = 8; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicompany')) { $colspan += 2; } print '
'.$langs->trans("None").'
'.$langs->trans("ReasonDiscount").''.$langs->trans("ConsumedBy").''.$langs->trans("AmountHT").''.$langs->trans("MulticurrencyAmountHT").''.$langs->trans("VATRate").''.$langs->trans("AmountTTC").''.$langs->trans("MulticurrencyAmountTTC").''.$langs->trans("DiscountOfferedBy").''.$langs->trans("NotConsumed").''.price($obj->amount_ht).''.price($obj->multicurrency_amount_ht).''.vatrate($obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''), true).''.price($obj->amount_ttc).''.price($obj->multicurrency_amount_ttc).''; @@ -641,7 +641,7 @@ if ($socid > 0) { } } else { $colspan = 8; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicompany')) { $colspan += 2; } print '
'.$langs->trans("None").'
'.$langs->trans("ReasonDiscount").''.$langs->trans("ConsumedBy").''.$langs->trans("AmountHT").''.$langs->trans("MulticurrencyAmountHT").''.$langs->trans("VATRate").''.$langs->trans("AmountTTC").''.$langs->trans("MulticurrencyAmountTTC").''.$langs->trans("Author").''.price($obj->amount_ht).''.price($obj->multicurrency_amount_ht).''.vatrate($obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''), true).''.price($obj->amount_ttc).''.price($obj->multicurrency_amount_ttc).''; @@ -825,7 +825,7 @@ if ($socid > 0) { } } else { $colspan = 8; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicompany')) { $colspan += 2; } print '
'.$langs->trans("None").'
'.$langs->trans("ReasonDiscount").''.$langs->trans("ConsumedBy").''.$langs->trans("AmountHT").''.$langs->trans("MulticurrencyAmountHT").''.$langs->trans("VATRate").''.$langs->trans("AmountTTC").''.$langs->trans("MulticurrencyAmountTTC").''.$langs->trans("Author").''.price($obj->amount_ht).''.price($obj->multicurrency_amount_ht).''.vatrate($obj->tva_tx.($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''), true).''.price($obj->amount_ttc).''.price($obj->multicurrency_amount_ttc).''; @@ -986,7 +986,7 @@ if ($socid > 0) { } } else { $colspan = 8; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicompany')) { $colspan += 2; } print '
'.$langs->trans("None").'
'.$langs->trans("Code").''.$langs->trans("Country").''.$langs->trans("VATIntra").''.$langs->trans("Currency").'
'.$langs->trans("NoRecordFound").'
'.$data['currency']."'.price(price2num($totalIT_credit, 'MT')).''.price(price2num($totalVAT_credit, 'MT')).'
'.price(price2num($totalIT_debit, 'MT')).''.price(price2num($totalVAT_debit, 'MT')).'
'.price(price2num($totalIT_credit + $totalIT_debit, 'MT')).''.price(price2num($totalVAT_credit + $totalVAT_debit, 'MT')).'
"; From ee1392b3470511712464d5878da390a18003d4e1 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 13:50:25 +0200 Subject: [PATCH 022/114] FIX php8 compatibility --- htdocs/core/multicompany_page.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/multicompany_page.php b/htdocs/core/multicompany_page.php index 4a3bcba51fb..690c971fd23 100644 --- a/htdocs/core/multicompany_page.php +++ b/htdocs/core/multicompany_page.php @@ -92,7 +92,7 @@ print '
'; //print '
'; -if (empty($conf->multicompany->enabled)) { +if (!isModEnabled('multicompany')) { $langs->load("admin"); $bookmarkList .= '
'.$langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("MultiCompany")).''; $bookmarkList .= '

'; From 51fb06ed6752161b6e425e44a659ef593ed33a9d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 13:50:58 +0200 Subject: [PATCH 023/114] FIX php8 compatibility --- htdocs/compta/paiement/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 54b1e0e7bcd..235b0a0af4f 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -425,7 +425,7 @@ if ($resql) { print '
'.$langs->trans('Bill').''.$langs->trans('Company').''.$langs->trans('Entity').''.$langs->trans('ExpectedToPay').''; $mc->getInfo($objp->entity); print $mc->label; From 9d188a5c96834ed9f51211f4722ed7c6cc63a725 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 13:52:03 +0200 Subject: [PATCH 025/114] FIX php8 compatibility --- htdocs/core/ajax/onlineSign.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/ajax/onlineSign.php b/htdocs/core/ajax/onlineSign.php index 0f4d274cc0d..5f59abea0b5 100644 --- a/htdocs/core/ajax/onlineSign.php +++ b/htdocs/core/ajax/onlineSign.php @@ -73,7 +73,7 @@ if ($type == 'proposal') { $securekeyseed = getDolGlobalString('PROPOSAL_ONLINE_SIGNATURE_SECURITY_TOKEN'); } -if (empty($SECUREKEY) || !dol_verifyHash($securekeyseed.$type.$ref.(empty($conf->multicompany->enabled) ? '' : $entity), $SECUREKEY, '0')) { +if (empty($SECUREKEY) || !dol_verifyHash($securekeyseed.$type.$ref.(!isModEnabled('multicompany') ? '' : $entity), $SECUREKEY, '0')) { http_response_code(403); print 'Bad value for securitykey. Value provided '.dol_escape_htmltag($SECUREKEY).' does not match expected value for ref='.dol_escape_htmltag($ref); exit(-1); From b43527de8fa4cb8e327f9f651090cf5751dce6ed Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 13:52:48 +0200 Subject: [PATCH 026/114] FIX php8 compatibility --- htdocs/core/class/conf.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 626052551d5..234f8d80e0c 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -371,7 +371,7 @@ class Conf } // Object $mc - if (!defined('NOREQUIREMC') && !empty($this->multicompany->enabled)) { + if (!defined('NOREQUIREMC') && isModEnabled('multicompany')) { global $mc; $ret = @dol_include_once('/multicompany/class/actions_multicompany.class.php'); if ($ret) { @@ -425,7 +425,7 @@ class Conf $rootfordata = DOL_DATA_ROOT; $rootforuser = DOL_DATA_ROOT; // If multicompany module is enabled, we redefine the root of data - if (!empty($this->multicompany->enabled) && !empty($this->entity) && $this->entity > 1) { + if (isModEnabled('multicompany') && !empty($this->entity) && $this->entity > 1) { $rootfordata .= '/'.$this->entity; } // Set standard temporary folder name or global override @@ -987,7 +987,7 @@ class Conf } // Object $mc - if (!defined('NOREQUIREMC') && !empty($this->multicompany->enabled)) { + if (!defined('NOREQUIREMC') && isModEnabled('multicompany')) { if (is_object($mc)) { $mc->setValues($this); } From aca217a58572772151ccf2d1267962419fd989c1 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 13:53:31 +0200 Subject: [PATCH 027/114] FIX php8 compatibility --- htdocs/core/class/emailsenderprofile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index b5b1619443b..583dd7faca0 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -149,7 +149,7 @@ class EmailSenderProfile extends CommonObject if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) { $this->fields['rowid']['visible'] = 0; } - if (empty($conf->multicompany->enabled)) { + if (!isModEnabled('multicompany')) { $this->fields['entity']['enabled'] = 0; } } From 1c64cbec6c08ced9509fe5d9c2e62ba25f68f5f0 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 13:54:52 +0200 Subject: [PATCH 028/114] FIX php8 compatibility --- htdocs/core/class/html.form.class.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0f0a17fe365..7b46531e2a9 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1961,11 +1961,11 @@ class Form // Forge request to select users $sql = "SELECT DISTINCT u.rowid, u.lastname as lastname, u.firstname, u.statut as status, u.login, u.admin, u.entity, u.photo"; - if (!empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && !$user->entity) { + if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { $sql .= ", e.label"; } $sql .= " FROM ".$this->db->prefix()."user as u"; - if (!empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && !$user->entity) { + if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { $sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid = u.entity"; if ($force_entity) { $sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")"; @@ -1973,7 +1973,7 @@ class Form $sql .= " WHERE u.entity IS NOT NULL"; } } else { - if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { + if (isModEnabled('multicompany') && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { $sql .= " LEFT JOIN ".$this->db->prefix()."usergroup_user as ug"; $sql .= " ON ug.fk_user = u.rowid"; $sql .= " WHERE ug.entity = ".$conf->entity; @@ -2075,7 +2075,7 @@ class Form $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans('Disabled'); } } - if (!empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && !$user->entity) { + if (isModEnabled('multicompany') && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && !$user->entity) { if (!$obj->entity) { $moreinfo .= ($moreinfo ? ' - ' : ' (').$langs->trans("AllEntities"); } else { @@ -9030,7 +9030,7 @@ class Form /* $addadmin = ''; if (property_exists($object, 'admin')) { - if (!empty($conf->multicompany->enabled) && !empty($object->admin) && empty($object->entity)) { + if (isModEnabled('multicompany') && !empty($object->admin) && empty($object->entity)) { $addadmin .= img_picto($langs->trans("SuperAdministratorDesc"), "redstar", 'class="paddingleft"'); } elseif (!empty($object->admin)) { $addadmin .= img_picto($langs->trans("AdministratorDesc"), "star", 'class="paddingleft"'); @@ -9477,11 +9477,11 @@ class Form // On recherche les groupes $sql = "SELECT ug.rowid, ug.nom as name"; - if (!empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && !$user->entity) { + if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { $sql .= ", e.label"; } $sql .= " FROM ".$this->db->prefix()."usergroup as ug "; - if (!empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && !$user->entity) { + if (isModEnabled('multicompany') && $conf->entity == 1 && $user->admin && !$user->entity) { $sql .= " LEFT JOIN ".$this->db->prefix()."entity as e ON e.rowid=ug.entity"; if ($force_entity) { $sql .= " WHERE ug.entity IN (0, ".$force_entity.")"; @@ -9531,7 +9531,7 @@ class Form $out .= '>'; $out .= $obj->name; - if (!empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1) { + if (isModEnabled('multicompany') && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1) { $out .= " (".$obj->label.")"; } From 388299827bffcdc3acb4ffeb3f4445b457a75de2 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 13:55:20 +0200 Subject: [PATCH 029/114] FIX php8 compatibility --- htdocs/core/class/defaultvalues.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/defaultvalues.class.php b/htdocs/core/class/defaultvalues.class.php index 278b5d5e0e6..57939f307a7 100644 --- a/htdocs/core/class/defaultvalues.class.php +++ b/htdocs/core/class/defaultvalues.class.php @@ -148,7 +148,7 @@ class DefaultValues extends CommonObject if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { $this->fields['rowid']['visible'] = 0; } - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { $this->fields['entity']['enabled'] = 0; } From c278fdd7a6c21f8e37ac5ed00eff86b9ce4adb7d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 13:55:48 +0200 Subject: [PATCH 030/114] FIX php8 compatibility --- htdocs/core/class/html.formfile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index d5a887fd40b..98b1fbd6593 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -992,7 +992,7 @@ class FormFile $entity = 1; // Without multicompany // Get object entity - if (!empty($conf->multicompany->enabled)) { + if (isModEnabled('multicompany')) { $regs = array(); preg_match('/\/([0-9]+)\/[^\/]+\/'.preg_quote($modulesubdir, '/').'$/', $filedir, $regs); $entity = ((!empty($regs[1]) && $regs[1] > 1) ? $regs[1] : 1); // If entity id not found in $filedir this is entity 1 by default From 8c59c7f4be62f6e859796392e6c4aa57555ff608 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 13:56:41 +0200 Subject: [PATCH 031/114] FIX php8 compatibility --- htdocs/core/lib/files.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index d306990daaa..147938fb53a 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2421,7 +2421,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, return 'ErrorBadParameter'; } if (empty($entity)) { - if (empty($conf->multicompany->enabled)) { + if (!isModEnabled('multicompany')) { $entity = 1; } else { $entity = 0; From f98f0bbf6a6eb0a134e35b898b8745ece0934bfb Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 13:57:09 +0200 Subject: [PATCH 032/114] FIX php8 compatibility --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 71161d77c64..3174fb132cd 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7812,7 +7812,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, )); } - if (!empty($conf->multicompany->enabled)) { + if (isModEnabled('multicompany')) { $substitutionarray = array_merge($substitutionarray, array('__ENTITY_ID__' => $conf->entity)); } if (empty($exclude) || !in_array('system', $exclude)) { From 4e51fca845bfc81c1d93a6989d337bb01b85d316 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 13:57:34 +0200 Subject: [PATCH 033/114] FIX php8 compatibility --- htdocs/core/lib/payments.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 809b5f8dc73..5c9d9342b01 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -393,7 +393,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag } // For multicompany - if (!empty($out) && !empty($conf->multicompany->enabled)) { + if (!empty($out) && isModEnabled('multicompany')) { $out .= "&entity=".$conf->entity; // Check the entity because we may have the same reference in several entities } From f238597c2d478cf8e551d482c003a6a69ebee477 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 13:58:13 +0200 Subject: [PATCH 034/114] FIX php8 compatibility --- htdocs/core/lib/security.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index cffed35070d..79b020b4883 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -796,7 +796,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl if (in_array($feature, $check) && $objectid > 0) { // For $objectid = 0, no check $sql = "SELECT COUNT(dbt.".$dbt_select.") as nb"; $sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt"; - if (($feature == 'user' || $feature == 'usergroup') && !empty($conf->multicompany->enabled)) { // Special for multicompany + if (($feature == 'user' || $feature == 'usergroup') && isModEnabled('multicompany')) { // Special for multicompany if (!empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { if ($conf->entity == 1 && $user->admin && !$user->entity) { $sql .= " WHERE dbt.".$dbt_select." IN (".$db->sanitize($objectid, 1).")"; @@ -840,7 +840,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl $sql .= " AND sc.fk_user = ".((int) $user->id); $sql .= " AND sc.fk_soc = s.rowid"; $sql .= " AND s.entity IN (".getEntity($sharedelement, 1).")"; - } elseif (!empty($conf->multicompany->enabled)) { + } elseif (isModEnabled('multicompany')) { // If multicompany and internal users with all permissions, check user is in correct entity $sql = "SELECT COUNT(s.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; @@ -865,7 +865,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl $sql .= " WHERE dbt.".$dbt_select." IN (".$db->sanitize($objectid, 1).")"; $sql .= " AND (dbt.fk_soc IS NULL OR sc.fk_soc IS NOT NULL)"; // Contact not linked to a company or to a company of user $sql .= " AND dbt.entity IN (".getEntity($sharedelement, 1).")"; - } elseif (!empty($conf->multicompany->enabled)) { + } elseif (isModEnabled('multicompany')) { // If multicompany and internal users with all permissions, check user is in correct entity $sql = "SELECT COUNT(dbt.".$dbt_select.") as nb"; $sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt"; @@ -951,7 +951,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl $sql .= " AND dbt.entity IN (".getEntity($sharedelement, 1).")"; $sql .= " AND (sc.fk_user = ".((int) $user->id)." OR sc.fk_user IS NULL)"; } - } elseif (!empty($conf->multicompany->enabled)) { + } elseif (isModEnabled('multicompany')) { // If multicompany and internal users with all permissions, check user is in correct entity $sql = "SELECT COUNT(dbt.".$dbt_select.") as nb"; $sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt"; From 9998b11d576eccef1f1e9f78898eedd8943475a0 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:00:22 +0200 Subject: [PATCH 035/114] FIX php8 compatibility --- htdocs/core/lib/signature.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/signature.lib.php b/htdocs/core/lib/signature.lib.php index 1dbefb5719a..d2f0c64f463 100644 --- a/htdocs/core/lib/signature.lib.php +++ b/htdocs/core/lib/signature.lib.php @@ -90,7 +90,7 @@ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1) if ($mode == 1) { $out .= "hash('".$securekeyseed."' + '".$type."' + proposal_ref)"; } else { - $out .= '&securekey='.dol_hash($securekeyseed.$type.$ref.(empty($conf->multicompany->enabled) ? '' : $object->entity), '0'); + $out .= '&securekey='.dol_hash($securekeyseed.$type.$ref.(!isModEnabled('multicompany') ? '' : $object->entity), '0'); } /* if ($mode == 1) { @@ -119,7 +119,7 @@ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1) } // For multicompany - if (!empty($out) && !empty($conf->multicompany->enabled)) { + if (!empty($out) && isModEnabled('multicompany')) { $out .= "&entity=".$conf->entity; // Check the entity because we may have the same reference in several entities } From 352382bced470f9281b38472be683802e510597e Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:02:16 +0200 Subject: [PATCH 036/114] FIX php8 compatibility --- htdocs/core/login/functions_dolibarr.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/login/functions_dolibarr.php b/htdocs/core/login/functions_dolibarr.php index 610072aa35a..c4825998b3a 100644 --- a/htdocs/core/login/functions_dolibarr.php +++ b/htdocs/core/login/functions_dolibarr.php @@ -40,7 +40,7 @@ function check_user_password_dolibarr($usertotest, $passwordtotest, $entitytotes // Force master entity in transversal mode $entity = $entitytotest; - if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { + if (isModEnabled('multicompany') && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { $entity = 1; } @@ -134,11 +134,11 @@ function check_user_password_dolibarr($usertotest, $passwordtotest, $entitytotes } // We must check entity - if ($passok && !empty($conf->multicompany->enabled)) { // We must check entity + if ($passok && isModEnabled('multicompany')) { // We must check entity global $mc; if (!isset($mc)) { - $conf->multicompany->enabled = false; // Global not available, disable $conf->multicompany->enabled for safety + !isModEnabled('multicompany'); // Global not available, disable $conf->multicompany->enabled for safety } else { $ret = $mc->checkRight($obj->rowid, $entitytotest); if ($ret < 0) { From 5877a85284f27d4d771a6480568aac21c267bb2a Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:03:41 +0200 Subject: [PATCH 037/114] FIX php8 compatibility --- htdocs/core/login/functions_ldap.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/login/functions_ldap.php b/htdocs/core/login/functions_ldap.php index 022186b8de1..18800c3a19e 100644 --- a/htdocs/core/login/functions_ldap.php +++ b/htdocs/core/login/functions_ldap.php @@ -46,7 +46,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) // Force master entity in transversal mode $entity = $entitytotest; - if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { + if (isModEnabled('multicompany') && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { $entity = 1; } @@ -228,7 +228,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) unset($usertmp); } - if (!empty($conf->multicompany->enabled)) { // We must check entity (even if sync is not active) + if (isModEnabled('multicompany')) { // We must check entity (even if sync is not active) global $mc; $usertmp = new User($db); From c71ca44ff7542331cb490b253571f22fdbf79323 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:04:21 +0200 Subject: [PATCH 038/114] FIX php8 compatibility --- htdocs/core/modules/modCommande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index 70f06169394..4f2b58ff00d 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -221,7 +221,7 @@ class modCommande extends DolibarrModules // Add multicompany field if (!empty($conf->global->MULTICOMPANY_ENTITY_IN_EXPORT_IF_SHARED)) { $nbofallowedentities = count(explode(',', getEntity('commande'))); - if (!empty($conf->multicompany->enabled) && $nbofallowedentities > 1) { + if (isModEnabled('multicompany') && $nbofallowedentities > 1) { $this->export_fields_array[$r]['c.entity'] = 'Entity'; } } From 5333f9b656e70a352fd54f88a02386078d8ca562 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:04:45 +0200 Subject: [PATCH 039/114] FIX php8 compatibility --- htdocs/core/modules/modFacture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 3cea4f0ff92..a819dae666c 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -538,7 +538,7 @@ class modFacture extends DolibarrModules // Add multicompany field if (!empty($conf->global->MULTICOMPANY_ENTITY_IN_EXPORT_IF_SHARED)) { $nbofallowedentities = count(explode(',', getEntity('invoice'))); - if (!empty($conf->multicompany->enabled) && $nbofallowedentities > 1) { + if (isModEnabled('multicompany') && $nbofallowedentities > 1) { $this->export_fields_array[$r]['f.entity'] = 'Entity'; } } From de97379f3fbc0bbbd0fe20a1404aeeb5f56cd18d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:05:07 +0200 Subject: [PATCH 040/114] FIX php8 compatibility --- htdocs/core/modules/modProjet.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index ebfba5d95b9..5f1ad7d2099 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -246,7 +246,7 @@ class modProjet extends DolibarrModules // Add multicompany field if (!empty($conf->global->MULTICOMPANY_ENTITY_IN_EXPORT_IF_SHARED)) { $nbofallowedentities = count(explode(',', getEntity('project'))); // If project are shared, nb will be > 1 - if (!empty($conf->multicompany->enabled) && $nbofallowedentities > 1) { + if (isModEnabled('multicompany') && $nbofallowedentities > 1) { $this->export_fields_array[$r] += array('p.entity'=>'Entity'); } } From 9c53fe07a073a29e6889d5ae215a002000d5c70c Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:05:37 +0200 Subject: [PATCH 041/114] FIX php8 compatibility --- htdocs/core/modules/modPropale.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modPropale.class.php b/htdocs/core/modules/modPropale.class.php index f6443e6c992..13991cdcafa 100644 --- a/htdocs/core/modules/modPropale.class.php +++ b/htdocs/core/modules/modPropale.class.php @@ -207,7 +207,7 @@ class modPropale extends DolibarrModules // Add multicompany field if (!empty($conf->global->MULTICOMPANY_ENTITY_IN_EXPORT_IF_SHARED)) { $nbofallowedentities = count(explode(',', getEntity('propal'))); - if (!empty($conf->multicompany->enabled) && $nbofallowedentities > 1) { + if (isModEnabled('multicompany') && $nbofallowedentities > 1) { $this->export_fields_array[$r]['c.entity'] = 'Entity'; } } From 03298876434a0d2e6d064741e015918f98d59d26 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:06:04 +0200 Subject: [PATCH 042/114] FIX php8 compatibility --- htdocs/core/modules/modSociete.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index ff5edd3eeb4..c98dd06b488 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -295,7 +295,7 @@ class modSociete extends DolibarrModules // Add multicompany field if (!empty($conf->global->MULTICOMPANY_ENTITY_IN_EXPORT_IF_SHARED)) { $nbofallowedentities = count(explode(',', getEntity('societe'))); // If project are shared, nb will be > 1 - if (!empty($conf->multicompany->enabled) && $nbofallowedentities > 1) { + if (isModEnabled('multicompany') && $nbofallowedentities > 1) { $this->export_fields_array[$r] += array('s.entity'=>'Entity'); } } @@ -379,7 +379,7 @@ class modSociete extends DolibarrModules ); // Add multicompany field if (! empty($conf->global->MULTICOMPANY_ENTITY_IN_EXPORT_IF_SHARED)) { - if (!empty($conf->multicompany->enabled)) { + if (isModEnabled('multicompany')) { $nbofallowedentities = count(explode(',', getEntity('contact'))); if ($nbofallowedentities > 1) { $this->export_fields_array[$r]['c.entity'] = 'Entity'; From dce4773607af5b913ed89dea20c985b9551ea769 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:06:29 +0200 Subject: [PATCH 043/114] FIX php8 compatibility --- htdocs/core/tpl/admin_extrafields_add.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index 1dbc0861adb..97748290bd7 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -205,7 +205,7 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php
Contact:con
trans("Totalizable"); ?>>
textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?>
trans("AllEntities"); ?>>
textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?>
trans("AllEntities"); ?>>
'.$langs->trans("AlwaysEditable").''.$form->textwithpicto($langs->trans("Visible"), $langs->trans("VisibleDesc")).''.$form->textwithpicto($langs->trans("DisplayOnPdf"), $langs->trans("DisplayOnPdfDesc")).''.$form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")).''.$langs->trans("Entity").' '.dol_escape_htmltag($extrafields->attributes[$elementtype]['printable'][$key])."'.yn($extrafields->attributes[$elementtype]['totalizable'][$key])."'; if (empty($extrafields->attributes[$elementtype]['entityid'][$key])) { print $langs->trans("All"); @@ -139,7 +139,7 @@ if (isset($extrafields->attributes[$elementtype]['type']) && is_array($extrafiel } } else { $colspan = 14; - if (!empty($conf->multicompany->enabled)) { + if (isModEnabled('multicompany')) { $colspan++; } From 2d0537e8233cf02f86da4f06b80f8668e44a9121 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:07:47 +0200 Subject: [PATCH 046/114] FIX php8 compatibility --- htdocs/cron/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php index ed95546cd67..319c16c7d0c 100644 --- a/htdocs/cron/card.php +++ b/htdocs/cron/card.php @@ -612,7 +612,7 @@ if (($action == "create") || ($action == "edit")) { } print "
'; print $langs->trans('Entity').""; if (empty($object->entity)) { From d9b21380f6db3e9e09500f46332e7a55ab4c1873 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:08:27 +0200 Subject: [PATCH 047/114] FIX php8 compatibility --- htdocs/ecm/class/ecmfiles.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index d70f5c863d7..3f4df8b847b 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -407,7 +407,7 @@ class EcmFiles extends CommonObject $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; $sql .= ' WHERE 1 = 1'; /* Fetching this table depends on filepath+filename, it must not depends on entity because filesystem on disk does not know what is Dolibarr entities - if (! empty($conf->multicompany->enabled)) { + if (isModEnabled('multicompany')) { $sql .= " AND entity IN (" . getEntity('ecmfiles') . ")"; }*/ if ($relativepath) { @@ -546,7 +546,7 @@ class EcmFiles extends CommonObject } $sql .= ' WHERE 1 = 1'; /* Fetching this table depends on filepath+filename, it must not depends on entity - if (! empty($conf->multicompany->enabled)) { + if (isModEnabled('multicompany')) { $sql .= " AND entity IN (" . getEntity('ecmfiles') . ")"; }*/ if (count($sqlwhere) > 0) { From 66b2c63bc3bcf2a64bb3ec360f8db485d840324f Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:08:58 +0200 Subject: [PATCH 048/114] FIX php8 compatibility --- htdocs/emailcollector/class/emailcollector.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index a87c90a6dd9..50b7047b90d 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -251,7 +251,7 @@ class EmailCollector extends CommonObject if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { $this->fields['rowid']['visible'] = 0; } - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { $this->fields['entity']['enabled'] = 0; } From b7e027a097edf374eba8b9c9fafad78ee1b08f34 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:09:25 +0200 Subject: [PATCH 049/114] FIX php8 compatibility --- htdocs/emailcollector/class/emailcollectoraction.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/emailcollector/class/emailcollectoraction.class.php b/htdocs/emailcollector/class/emailcollectoraction.class.php index 37bd93926cb..46b787fc6fd 100644 --- a/htdocs/emailcollector/class/emailcollectoraction.class.php +++ b/htdocs/emailcollector/class/emailcollectoraction.class.php @@ -158,7 +158,7 @@ class EmailCollectorAction extends CommonObject if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { $this->fields['rowid']['visible'] = 0; } - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { $this->fields['entity']['enabled'] = 0; } From 9d3c1ddea5822af85d05c127f513490a9f0df515 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:09:52 +0200 Subject: [PATCH 050/114] FIX php8 compatibility --- htdocs/emailcollector/class/emailcollectorfilter.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/emailcollector/class/emailcollectorfilter.class.php b/htdocs/emailcollector/class/emailcollectorfilter.class.php index 6386ee3c27f..c19610f14ad 100644 --- a/htdocs/emailcollector/class/emailcollectorfilter.class.php +++ b/htdocs/emailcollector/class/emailcollectorfilter.class.php @@ -127,7 +127,7 @@ class EmailCollectorFilter extends CommonObject if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { $this->fields['rowid']['visible'] = 0; } - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { $this->fields['entity']['enabled'] = 0; } From 7641ec3fe3cc908c8962ed654ed800edf8150f57 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:12:05 +0200 Subject: [PATCH 051/114] FIX php8 compatibility --- htdocs/eventorganization/class/conferenceorbooth.class.php | 2 +- .../eventorganization/class/conferenceorboothattendee.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index a2eb140c789..2c22bfb77ab 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -152,7 +152,7 @@ class ConferenceOrBooth extends ActionComm if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { $this->fields['id']['visible'] = 0; } - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { $this->fields['entity']['enabled'] = 0; } diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 3dae278d3a1..158b29e4cf6 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -196,7 +196,7 @@ class ConferenceOrBoothAttendee extends CommonObject if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { $this->fields['rowid']['visible'] = 0; } - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { $this->fields['entity']['enabled'] = 0; } From a7697f6d9c6c60aad79f3f621a499cbec1c7ad6e Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:12:33 +0200 Subject: [PATCH 052/114] FIX php8 compatibility --- htdocs/expensereport/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 4110ba98e1b..05831c5dd97 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -83,7 +83,7 @@ if (! empty($conf->global->EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH)) { $rootfordata = DOL_DATA_ROOT; $rootforuser = DOL_DATA_ROOT; // If multicompany module is enabled, we redefine the root of data -if (!empty($conf->multicompany->enabled) && !empty($conf->entity) && $conf->entity > 1) { +if (isModEnabled('multicompany') && !empty($conf->entity) && $conf->entity > 1) { $rootfordata .= '/'.$conf->entity; } $conf->expensereport->dir_output = $rootfordata.'/expensereport'; From 2b96fbaee694fda93fc163414a1d31c001f449ac Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:13:03 +0200 Subject: [PATCH 053/114] FIX php8 compatibility --- htdocs/fourn/commande/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index 052876f0616..3d5a111ed03 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -219,12 +219,12 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO */ $sql = "SELECT"; -if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { +if (isModEnabled('multicompany') && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { $sql .= " DISTINCT"; } $sql .= " u.rowid, u.lastname, u.firstname, u.email, u.statut"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; -if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { +if (isModEnabled('multicompany') && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { $sql .= ",".MAIN_DB_PREFIX."usergroup_user as ug"; $sql .= " WHERE ((ug.fk_user = u.rowid"; $sql .= " AND ug.entity IN (".getEntity('usergroup')."))"; From dd00484a9cdb088f01443343e4a85258dc9ace38 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:13:33 +0200 Subject: [PATCH 054/114] FIX php8 compatibility --- htdocs/holiday/class/holiday.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 806f899df36..aa6fa6c8066 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1731,13 +1731,13 @@ class Holiday extends CommonObject if ($type) { // If user of Dolibarr $sql = "SELECT"; - if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { + if (isModEnabled('multicompany') && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { $sql .= " DISTINCT"; } $sql .= " u.rowid"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; - if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { + if (isModEnabled('multicompany') && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { $sql .= ", ".MAIN_DB_PREFIX."usergroup_user as ug"; $sql .= " WHERE ((ug.fk_user = u.rowid"; $sql .= " AND ug.entity IN (".getEntity('usergroup')."))"; @@ -1821,13 +1821,13 @@ class Holiday extends CommonObject if ($type) { // If we need users of Dolibarr $sql = "SELECT"; - if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { + if (isModEnabled('multicompany') && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { $sql .= " DISTINCT"; } $sql .= " u.rowid, u.lastname, u.firstname, u.gender, u.photo, u.employee, u.statut, u.fk_user"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; - if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { + if (isModEnabled('multicompany') && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { $sql .= ", ".MAIN_DB_PREFIX."usergroup_user as ug"; $sql .= " WHERE ((ug.fk_user = u.rowid"; $sql .= " AND ug.entity IN (".getEntity('usergroup')."))"; From 965cf60c7619a3b1bb0d240915758b4e5a85be25 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:13:57 +0200 Subject: [PATCH 055/114] FIX php8 compatibility --- htdocs/hrm/skill_tab.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/skill_tab.php b/htdocs/hrm/skill_tab.php index 52c45c72848..c48a7c405c6 100644 --- a/htdocs/hrm/skill_tab.php +++ b/htdocs/hrm/skill_tab.php @@ -259,7 +259,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; $addadmin = ''; if (property_exists($object, 'admin')) { - if (!empty($conf->multicompany->enabled) && !empty($object->admin) && empty($object->entity)) { + if (isModEnabled('multicompany') && !empty($object->admin) && empty($object->entity)) { $addadmin .= img_picto($langs->trans("SuperAdministratorDesc"), "redstar", 'class="paddingleft"'); } elseif (!empty($object->admin)) { $addadmin .= img_picto($langs->trans("AdministratorDesc"), "star", 'class="paddingleft"'); From 5671c03bd354398a949cf638d4c9eb39cc1df15b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:14:29 +0200 Subject: [PATCH 056/114] FIX php8 compatibility --- htdocs/hrm/class/evaluation.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index 77403631725..4915d44fb6f 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -189,7 +189,7 @@ class Evaluation extends CommonObject if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { $this->fields['rowid']['visible'] = 0; } - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { $this->fields['entity']['enabled'] = 0; } From a2a7f45100289a00c93e4cd93f3c6f9ced6a47b3 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:15:02 +0200 Subject: [PATCH 057/114] FIX php8 compatibility --- htdocs/hrm/class/evaluationdet.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/class/evaluationdet.class.php b/htdocs/hrm/class/evaluationdet.class.php index 8fd7d3b177a..239e66ee48f 100644 --- a/htdocs/hrm/class/evaluationdet.class.php +++ b/htdocs/hrm/class/evaluationdet.class.php @@ -178,7 +178,7 @@ class Evaluationline extends CommonObject if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { $this->fields['rowid']['visible'] = 0; } - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { $this->fields['entity']['enabled'] = 0; } From 45354e62aa039051de1fcd00fb6e982dd7c26809 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:15:28 +0200 Subject: [PATCH 058/114] FIX php8 compatibility --- htdocs/hrm/class/job.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index c21335f2df5..bc5af1f661d 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -177,7 +177,7 @@ class Job extends CommonObject if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { $this->fields['rowid']['visible'] = 0; } - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { $this->fields['entity']['enabled'] = 0; } From c51349256985589b4eac5cd234f33bfffcd0111b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:15:53 +0200 Subject: [PATCH 059/114] FIX php8 compatibility --- htdocs/hrm/class/position.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index 9416907b8ed..37a8300a1e2 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -188,7 +188,7 @@ class Position extends CommonObject if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { //$this->fields['rowid']['visible'] = 0; } - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { $this->fields['entity']['enabled'] = 0; } From f241a1fc67f82d84ca8e6e38f37014035ad416d9 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:16:24 +0200 Subject: [PATCH 060/114] FIX php8 compatibility --- htdocs/hrm/class/skill.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index d9f4073e11e..99dc0902f95 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -189,7 +189,7 @@ class Skill extends CommonObject if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { $this->fields['rowid']['visible'] = 0; } - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { $this->fields['entity']['enabled'] = 0; } From ca822e15f92c04f6f5ed0194c399605d4502031c Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:16:50 +0200 Subject: [PATCH 061/114] FIX php8 compatibility --- htdocs/hrm/class/skilldet.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php index 3c24ca78415..d1ae24b7efe 100644 --- a/htdocs/hrm/class/skilldet.class.php +++ b/htdocs/hrm/class/skilldet.class.php @@ -169,7 +169,7 @@ class Skilldet extends CommonObject if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { $this->fields['rowid']['visible'] = 0; } - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { $this->fields['entity']['enabled'] = 0; } From 66859f8624c58330fa0ba495e53bd89895849bc2 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:17:17 +0200 Subject: [PATCH 062/114] FIX php8 compatibility --- htdocs/hrm/class/skillrank.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index 6e2413c4f5f..c5f5ccb8ff7 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -177,7 +177,7 @@ class SkillRank extends CommonObject if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { $this->fields['rowid']['visible'] = 0; } - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + if (!isModEnabled('multicompany') && isset($this->fields['entity'])) { $this->fields['entity']['enabled'] = 0; } From 772a50fe0cb34a2e858f95ef68289e648bcb36dd Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:17:53 +0200 Subject: [PATCH 063/114] FIX php8 compatibility --- htdocs/hrm/establishment/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/hrm/establishment/card.php b/htdocs/hrm/establishment/card.php index 1fe67dd0bd1..396c158998c 100644 --- a/htdocs/hrm/establishment/card.php +++ b/htdocs/hrm/establishment/card.php @@ -178,7 +178,7 @@ if ($action == 'create') { // Entity /* - if (! empty($conf->multicompany->enabled)) { + if (isModEnabled('multicompany')) { print '
'.$form->editfieldkey('Parent', 'entity', '', $object, 0, 'string', '', 1).''; @@ -282,7 +282,7 @@ if (($id || $ref) && $action == 'edit') { // Entity /* - if (! empty($conf->multicompany->enabled)) { + if (isModEnabled('multicompany')) { print '
'.$form->editfieldkey('Parent', 'entity', '', $object, 0, 'string', '', 1).''; print $object->entity > 0 ? $object->entity : $conf->entity; From 11f92f9d7c34cc2846f15f6a7678da1cacf69a74 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 28 Aug 2022 14:18:24 +0200 Subject: [PATCH 064/114] FIX php8 compatibility --- htdocs/hrm/establishment/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/establishment/card.php b/htdocs/hrm/establishment/card.php index 396c158998c..1b30eed663a 100644 --- a/htdocs/hrm/establishment/card.php +++ b/htdocs/hrm/establishment/card.php @@ -371,7 +371,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Entity /* - if ($conf->multicompany->enabled) { + if (!isModEnabled('multicompany') { print '
'.$langs->trans("Entity").''.$object->entity.''; if (!$disabled) { @@ -556,7 +556,7 @@ print '
'.$langs->trans("PricingRule").''.$form->textwithpicto($langs->trans("PricingRule"), $langs->trans("SamePriceAlsoForSharedCompanies"), 1).'
'; print ''; - print '