From afce73281e4c049e7d24c726aa9cb0fe5c444f3b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 16:57:52 +0200 Subject: [PATCH 01/32] FIX php8 compatibility --- htdocs/index.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/index.php b/htdocs/index.php index e5eb356c0ef..7d330f61ffa 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -255,19 +255,19 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { // Number of cheque to send if (isModEnabled('banque') && empty($conf->global->MAIN_DISABLE_BLOCK_BANK) && $user->hasRight('banque', 'lire') && !$user->socid) { if (empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT)) { - include_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php'; + include_once DOL_DOCUMENT_ROOT . '/compta/paiement/cheque/class/remisecheque.class.php'; $board = new RemiseCheque($db); $dashboardlines[$board->element] = $board->load_board($user); } - if (!empty($conf->prelevement->enabled)) { - include_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; + if (isModEnabled('prelevement')) { + include_once DOL_DOCUMENT_ROOT . '/compta/prelevement/class/bonprelevement.class.php'; $board = new BonPrelevement($db); - $dashboardlines[$board->element.'_direct_debit'] = $board->load_board($user, 'direct_debit'); + $dashboardlines[$board->element . '_direct_debit'] = $board->load_board($user, 'direct_debit'); } - if (!empty($conf->paymentbybanktransfer->enabled)) { - include_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; + if (isModEnabled('paymentbybanktransfer')) { + include_once DOL_DOCUMENT_ROOT . '/compta/prelevement/class/bonprelevement.class.php'; $board = new BonPrelevement($db); - $dashboardlines[$board->element.'_credit_transfer'] = $board->load_board($user, 'credit_transfer'); + $dashboardlines[$board->element . '_credit_transfer'] = $board->load_board($user, 'credit_transfer'); } } From 6e4dfdade887c013cd81f76ace29085258240e91 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:01:07 +0200 Subject: [PATCH 02/32] FIX php8 compatibility --- htdocs/accountancy/admin/accountmodel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index 9f873195465..201898dedd1 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; -if (!empty($conf->accounting->enabled)) { +if (isModEnabled('accounting')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; } @@ -126,7 +126,7 @@ $tabrowid[31] = ""; // Condition to show dictionary in setup page $tabcond = array(); -$tabcond[31] = !empty($conf->accounting->enabled); +$tabcond[31] = isModEnabled('accounting'); // List of help for fields $tabhelp = array(); From a9aad4300171c96de9df0ec07600cde52b0fd88d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:04:24 +0200 Subject: [PATCH 03/32] FIX php8 compatibility --- htdocs/accountancy/admin/defaultaccounts.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index 895437ab58b..afd7724713d 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -81,22 +81,22 @@ $list_account[] = '---Others---'; $list_account[] = 'ACCOUNTING_VAT_BUY_ACCOUNT'; $list_account[] = 'ACCOUNTING_VAT_SOLD_ACCOUNT'; $list_account[] = 'ACCOUNTING_VAT_PAY_ACCOUNT'; -if (!empty($conf->banque->enabled)) { +if (isModEnabled('banque')) { $list_account[] = 'ACCOUNTING_ACCOUNT_TRANSFER_CASH'; } -if (!empty($conf->don->enabled)) { +if (isModEnabled('don')) { $list_account[] = 'DONATION_ACCOUNTINGACCOUNT'; } -if (!empty($conf->adherent->enabled)) { +if (isModEnabled('adherent')) { $list_account[] = 'ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT'; } -if (!empty($conf->loan->enabled)) { +if (isModEnabled('loan')) { $list_account[] = 'LOAN_ACCOUNTING_ACCOUNT_CAPITAL'; $list_account[] = 'LOAN_ACCOUNTING_ACCOUNT_INTEREST'; $list_account[] = 'LOAN_ACCOUNTING_ACCOUNT_INSURANCE'; } $list_account[] = 'ACCOUNTING_ACCOUNT_SUSPENSE'; -if (!empty($conf->societe->enabled)) { +if (isModEnabled('societe')) { $list_account[] = '---Deposits---'; } @@ -266,7 +266,7 @@ print $formaccounting->select_account(getDolGlobalString('ACCOUNTING_ACCOUNT_CUS print ''; print ''; -if (!empty($conf->societe->enabled) && getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT') && getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT') != '-1') { +if (isModEnabled('societe') && getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT') && getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT') != '-1') { print ''; print '' . img_picto('', 'bill', 'class="pictofixedwidth"') . $langs->trans("UseAuxiliaryAccountOnCustomerDeposit") . ''; if (getDolGlobalInt('ACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT')) { From ce89faace2753e032a18bf8b0cb4268c052a5402 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:06:36 +0200 Subject: [PATCH 04/32] FIX php8 compatibility --- htdocs/accountancy/admin/categories_list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index c0439445261..ea613ea38cd 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -111,7 +111,7 @@ $tabrowid[32] = ""; // Condition to show dictionary in setup page $tabcond = array(); -$tabcond[32] = !empty($conf->accounting->enabled); +$tabcond[32] = isModEnabled('accounting'); // List of help for fields $tabhelp = array(); @@ -875,7 +875,7 @@ function fieldListAccountingCategories($fieldlist, $obj = '', $tabname = '', $co $formadmin = new FormAdmin($db); $formcompany = new FormCompany($db); - if (!empty($conf->accounting->enabled)) { + if (isModEnabled('accounting')) { $formaccounting = new FormAccounting($db); } From ea8f70c73a8b4898d7494a89ef5ace45ca484d8b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:07:35 +0200 Subject: [PATCH 05/32] FIX php8 compatibility --- htdocs/accountancy/admin/journals_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index 39300579d5f..3ea90e283ce 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -123,7 +123,7 @@ $tabrowid[35] = ""; // Condition to show dictionary in setup page $tabcond = array(); -$tabcond[35] = !empty($conf->accounting->enabled); +$tabcond[35] = isModEnabled('accounting'); // List of help for fields $tabhelp = array(); From 44e8c99b82da7c943feeed5bc43f3d44169275d7 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:08:42 +0200 Subject: [PATCH 06/32] FIX php8 compatibility --- htdocs/accountancy/bookkeeping/balance.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 7a65fa0ffaa..2e91cea39b8 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -142,7 +142,7 @@ if (!empty($search_ledger_code)) { } } -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { From 919408f9d159a4a89c1343b8ff4d9d0f9581b917 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:09:40 +0200 Subject: [PATCH 07/32] FIX php8 compatibility --- htdocs/accountancy/bookkeeping/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 7c8c0dca547..c2071e76cea 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -79,7 +79,7 @@ if (!empty($update)) { $object = new BookKeeping($db); // Security check -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { From fc440f90a0e7b12b42d8e9154a4cee8c8ecbf2f7 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:10:41 +0200 Subject: [PATCH 08/32] FIX php8 compatibility --- htdocs/accountancy/bookkeeping/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index bc229dd69f7..aa5e8dfc257 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -214,7 +214,7 @@ if (empty($listofformat[$formatexportset])) { $error = 0; -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { From f3ee3319dd344445a8a8c9a9552c239474a1baab Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:11:21 +0200 Subject: [PATCH 09/32] FIX php8 compatibility --- htdocs/accountancy/bookkeeping/listbyaccount.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index bb864fc39e3..0bd1c06aab8 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -187,7 +187,7 @@ if ($search_date_end && empty($search_date_endyear)) { $search_date_endday = $tmparray['mday']; } -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { From 7e9547c76223d099fb8035a7155bd7c7f0faf4e3 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:12:27 +0200 Subject: [PATCH 10/32] FIX php8 compatibility --- htdocs/accountancy/class/accountingjournal.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php index c8948b05012..3c83e03ee55 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/htdocs/accountancy/class/accountingjournal.class.php @@ -429,7 +429,7 @@ class AccountingJournal extends CommonObject { global $conf, $langs; - if (empty($conf->asset->enabled)) { + if (!isModEnabled('asset')) { return array(); } From bf013aad633a4672acc550d4fba1d217fb6024aa Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:13:02 +0200 Subject: [PATCH 11/32] FIX php8 compatibility --- htdocs/accountancy/closure/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/closure/index.php b/htdocs/accountancy/closure/index.php index 999e2ce5bd1..c4b5540fcc8 100644 --- a/htdocs/accountancy/closure/index.php +++ b/htdocs/accountancy/closure/index.php @@ -57,7 +57,7 @@ $search_date_end = dol_get_last_day($year_end, $month_end); $year_current = $year_start; // Security check -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { From ee193d766a455015eb708712adf6687db2d9cbef Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:13:43 +0200 Subject: [PATCH 12/32] FIX php8 compatibility --- htdocs/accountancy/customer/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index 296d6729301..0b3435ecb92 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -38,7 +38,7 @@ $codeventil = GETPOST('codeventil', 'int'); $id = GETPOST('id', 'int'); // Security check -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { From debeb04f282b6c1050bad6d88a30c290d6fed52e Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:15:23 +0200 Subject: [PATCH 13/32] FIX php8 compatibility --- htdocs/accountancy/customer/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 0eca61c72c1..06db5cedd0e 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -40,7 +40,7 @@ $validatemonth = GETPOST('validatemonth', 'int'); $validateyear = GETPOST('validateyear', 'int'); // Security check -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { @@ -77,7 +77,7 @@ $action = GETPOST('action', 'aZ09'); $chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); // Security check -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { @@ -622,7 +622,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange print ''; - if (!empty($conf->margin->enabled)) { + if (isModEnabled('margin')) { print "
\n"; print '
'; print ''; From 1742a8bebd40aa9374a3caba94215b7de6a3f56b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:16:02 +0200 Subject: [PATCH 14/32] FIX php8 compatibility --- htdocs/accountancy/customer/lines.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 4a8080ab8b4..469f29ad3c7 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -85,7 +85,7 @@ if (!$sortorder) { } // Security check -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { From a7c8960e2f2610cc4df95d1215d9046542046c2c Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:16:30 +0200 Subject: [PATCH 15/32] FIX php8 compatibility --- htdocs/accountancy/customer/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index b2a127e86a4..4038bb4b5bc 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -104,7 +104,7 @@ $accountingAccount = new AccountingAccount($db); $chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); // Security check -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { From bab68b179bf1af46b37d7042b57f7725e3d1dc22 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:17:01 +0200 Subject: [PATCH 16/32] FIX php8 compatibility --- htdocs/accountancy/expensereport/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/expensereport/card.php b/htdocs/accountancy/expensereport/card.php index 7c2310ccce4..0255e019138 100644 --- a/htdocs/accountancy/expensereport/card.php +++ b/htdocs/accountancy/expensereport/card.php @@ -42,7 +42,7 @@ $codeventil = GETPOST('codeventil', 'int'); $id = GETPOST('id', 'int'); // Security check -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { From 46abe5bea06c318c955eb46d302f4532a3efbd9a Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:17:29 +0200 Subject: [PATCH 17/32] FIX php8 compatibility --- htdocs/accountancy/expensereport/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php index 08657fe7a62..d0b25bdffd2 100644 --- a/htdocs/accountancy/expensereport/index.php +++ b/htdocs/accountancy/expensereport/index.php @@ -58,7 +58,7 @@ $year_current = $year_start; $action = GETPOST('action', 'aZ09'); // Security check -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { From 42459ea7b91b10b6a3bae81261075bbc714e88c3 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:17:54 +0200 Subject: [PATCH 18/32] FIX php8 compatibility --- htdocs/accountancy/expensereport/lines.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index 005783ed7a8..926d03f9235 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -79,7 +79,7 @@ if (!$sortorder) { } // Security check -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { From 709d6732ae504593de086da421018ef3f6b7b24a Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:18:24 +0200 Subject: [PATCH 19/32] FIX php8 compatibility --- htdocs/accountancy/expensereport/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index 880af769183..7a02d0b4564 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -97,7 +97,7 @@ $accounting = new AccountingAccount($db); $chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); // Security check -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { From a8a5ed00ecce5cec044af6718f0456a9319ca1dd Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:19:01 +0200 Subject: [PATCH 20/32] FIX php8 compatibility --- htdocs/accountancy/journal/bankjournal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 27ffb681ae0..f3049206389 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -83,7 +83,7 @@ $now = dol_now(); $action = GETPOST('action', 'aZ09'); // Security check -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { From aea9cc7f93d559ca069d6b818bd64e193fed69ba Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:19:30 +0200 Subject: [PATCH 21/32] FIX php8 compatibility --- htdocs/accountancy/journal/expensereportsjournal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index dbd1c892086..d38e49c390e 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -58,7 +58,7 @@ if ($in_bookkeeping == '') { $now = dol_now(); // Security check -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { From b6170450d01492d5ff30bc30e29deccd6abf464d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:20:03 +0200 Subject: [PATCH 22/32] FIX php8 compatibility --- htdocs/accountancy/journal/purchasesjournal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index e4c292d2670..70741aca5d1 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -61,7 +61,7 @@ $hookmanager->initHooks(array('purchasesjournal')); $parameters = array(); // Security check -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { From f94e2b3fe96b77f5d2b378566540b23da24efdc3 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:20:38 +0200 Subject: [PATCH 23/32] FIX php8 compatibility --- htdocs/accountancy/journal/sellsjournal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 599eeb627b5..107dda05f4a 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -63,7 +63,7 @@ $hookmanager->initHooks(array('sellsjournal')); $parameters = array(); // Security check -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { From 8bdff211c45b7dbee6c7e94005fd21b73f84b858 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:21:18 +0200 Subject: [PATCH 24/32] FIX php8 compatibility --- htdocs/accountancy/journal/variousjournal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/journal/variousjournal.php b/htdocs/accountancy/journal/variousjournal.php index af32b85d8fa..d737925f2c3 100644 --- a/htdocs/accountancy/journal/variousjournal.php +++ b/htdocs/accountancy/journal/variousjournal.php @@ -83,7 +83,7 @@ if (!is_array($journal_data)) { } // Security check -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { From b2c0dae216fe838e8004e234d4e9c0e2f0a1cade Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:21:49 +0200 Subject: [PATCH 25/32] FIX php8 compatibility --- htdocs/accountancy/supplier/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index 05d32d0cec5..306b88d11ea 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -42,7 +42,7 @@ $codeventil = GETPOST('codeventil', 'int'); $id = GETPOST('id', 'int'); // Security check -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { From 653ce5271394937fabb81b3c1aedb5847e0ba2ab Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:22:13 +0200 Subject: [PATCH 26/32] FIX php8 compatibility --- htdocs/accountancy/supplier/lines.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index c142361155d..1edbe83eefb 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -89,7 +89,7 @@ if (!$sortorder) { $formaccounting = new FormAccounting($db); // Security check -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { From 710b66cd0282f26e4f5bb698a5c3d4ed57cb36c8 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:22:41 +0200 Subject: [PATCH 27/32] FIX php8 compatibility --- htdocs/accountancy/supplier/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index f274a5432dc..d14beb84cc2 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -106,7 +106,7 @@ $accountingAccount = new AccountingAccount($db); $chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); // Security check -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { From 04130f0e9141849df691b49eaa07d5c648cb5ce6 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:24:32 +0200 Subject: [PATCH 28/32] FIX php8 compatibility --- htdocs/adherents/agenda.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index 5aeb3a281cf..204ba1b8f20 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -130,7 +130,7 @@ if ($object->id > 0) { llxHeader("", $title, $help_url); - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } $head = member_prepare_head($object); From 4ad7598eafcd4616b91b2fbae46b0dc30076f220 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:25:07 +0200 Subject: [PATCH 29/32] FIX php8 compatibility --- htdocs/adherents/document.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index 3dcab7a9c4c..c8282179fe5 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -128,7 +128,7 @@ if ($id > 0) { $totalsize += $file['size']; } - if (!empty($conf->notification->enabled)) { + if (isModEnabled('notification')) { $langs->load("mails"); } From 5be27cd2cae106e212c1795e6ef190b4bf600567 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:26:05 +0200 Subject: [PATCH 30/32] FIX php8 compatibility --- htdocs/adherents/htpasswd.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/htpasswd.php b/htdocs/adherents/htpasswd.php index 60639193295..0a7073f96b0 100644 --- a/htdocs/adherents/htpasswd.php +++ b/htdocs/adherents/htpasswd.php @@ -33,7 +33,7 @@ $sortfield = GETPOST('sortfield', 'alphanohtml'); $sortorder = GETPOST('sortorder', 'aZ09'); // Security check -if (empty($conf->adherent->enabled)) { +if (!isModEnabled('adherent')) { accessforbidden(); } if (empty($user->rights->adherent->export)) { From 4645b19084ef8d1459d7712a4baf1438cf9b6ef9 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:27:12 +0200 Subject: [PATCH 31/32] FIX php8 compatibility --- htdocs/adherents/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 1995485eb4e..f9208daf70d 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -659,7 +659,7 @@ if ($sall) { // Filter on categories $moreforfilter = ''; -if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { +if (isModEnabled('categorie') && $user->rights->categorie->lire) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedlength"').$formother->select_categories(Categorie::TYPE_MEMBER, $search_categ, 'search_categ', 1); From 805d91314cbd68c8d20f888495da027549cd53fb Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 16 Aug 2022 17:28:09 +0200 Subject: [PATCH 32/32] FIX php8 compatibility --- htdocs/adherents/partnership.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/partnership.php b/htdocs/adherents/partnership.php index a01e7d28ed2..bc21d4b6333 100644 --- a/htdocs/adherents/partnership.php +++ b/htdocs/adherents/partnership.php @@ -88,7 +88,7 @@ $upload_dir = $conf->partnership->multidir_output[isset($object->entity) ? $o if (getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR') != 'member') { accessforbidden('Partnership module is not activated for members'); } -if (empty($conf->partnership->enabled)) { +if (!isModEnabled('partnership')) { accessforbidden(); } if (empty($permissiontoread)) {