From d55ae5dbd22d6b68bd447492d76e013f1223dae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 9 Jun 2023 13:53:58 +0200 Subject: [PATCH] use isModEnabled --- htdocs/admin/mails_templates.php | 2 +- htdocs/admin/system/security.php | 6 +++--- htdocs/compta/paiement.php | 2 +- htdocs/fourn/facture/paiement.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 6b7e40ce84a..8469814f919 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -236,7 +236,7 @@ if (isModEnabled('agenda')) { if (isModEnabled('eventorganization') && !empty($user->rights->eventorganization->read)) { $elementList['conferenceorbooth'] = img_picto('', 'action', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendEventOrganization')); } -if (!empty($conf->partnership->enabled) && !empty($user->rights->partnership->read)) { +if (isModEnabled('partnership') && !empty($user->rights->partnership->read)) { $elementList['partnership_send'] = img_picto('', 'partnership', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToPartnership')); } diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index cc564fdc5d4..7a64b89bccb 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -539,14 +539,14 @@ print '
'; print '
'; print load_fiche_titre($langs->trans("API"), '', 'folder'); -if (empty($conf->api->enabled) && empty($conf->webservices->enabled)) { +if (!isModEnabled('api') && !isModEnabled('webservices')) { print $langs->trans("APIsAreNotEnabled"); } else { - if (!empty($conf->webservices->enabled)) { + if (isModEnabled('webservices')) { print $langs->trans('YouEnableDeprecatedWSAPIsUseRESTAPIsInstead')."
\n"; print '
'; } - if (!empty($conf->api->enabled)) { + if (isModEnabled('api')) { print 'API_ENDPOINT_RULES = '.getDolGlobalString('API_ENDPOINT_RULES', ''.$langs->trans("Undefined").'   ('.$langs->trans("Example").': login:0,users:0,setup:1,status:1,tickets:1,...)')."
\n"; print '
'; } diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 1828c5d053b..a8675ceb018 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -360,7 +360,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie // Invoice with Paypal transaction // TODO add hook here - if (!empty($conf->paypalplus->enabled) && $conf->global->PAYPAL_ENABLE_TRANSACTION_MANAGEMENT && !empty($facture->ref_ext)) { + if (isModEnabled('paypalplus') && $conf->global->PAYPAL_ENABLE_TRANSACTION_MANAGEMENT && !empty($facture->ref_ext)) { if (!empty($conf->global->PAYPAL_BANK_ACCOUNT)) { $accountid = $conf->global->PAYPAL_BANK_ACCOUNT; } diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 4f49d0166e5..dce1b8c63b5 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -723,7 +723,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; print price($sign * $remaintopay); - if (!empty($conf->paymentbybanktransfer->enabled)) { + if (isModEnabled('paymentbybanktransfer')) { $numdirectdebitopen = 0; $totaldirectdebit = 0; $sql = "SELECT COUNT(pfd.rowid) as nb, SUM(pfd.amount) as amount";