From da55ed782c1faed7bd3eac12402728fdcf1f107d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 21:58:56 +0200 Subject: [PATCH] Use isModEnabled --- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 6 +++--- htdocs/core/modules/facture/doc/pdf_sponge.modules.php | 6 +++--- htdocs/don/card.php | 2 +- htdocs/partnership/admin/website.php | 6 +++--- htdocs/public/eventorganization/subscriptionok.php | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index ee4e43bb444..168e293cc90 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1180,13 +1180,13 @@ class pdf_crabe extends ModelePDFFactures if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CB' || $object->mode_reglement_code == 'VAD') { $useonlinepayment = 0; if (!empty($conf->global->PDF_SHOW_LINK_TO_ONLINE_PAYMENT)) { - if (!empty($conf->paypal->enabled)) { + if (isModEnabled('paypal')) { $useonlinepayment++; } - if (!empty($conf->stripe->enabled)) { + if (isModEnabled('stripe')) { $useonlinepayment++; } - if (!empty($conf->paybox->enabled)) { + if (isModEnabled('paybox')) { $useonlinepayment++; } } diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 1efca9070d0..5da53c41121 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1290,13 +1290,13 @@ class pdf_sponge extends ModelePDFFactures if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CB' || $object->mode_reglement_code == 'VAD') { $useonlinepayment = 0; if (!empty($conf->global->PDF_SHOW_LINK_TO_ONLINE_PAYMENT)) { - if (!empty($conf->paypal->enabled)) { + if (isModEnabled('paypal')) { $useonlinepayment++; } - if (!empty($conf->stripe->enabled)) { + if (isModEnabled('stripe')) { $useonlinepayment++; } - if (!empty($conf->paybox->enabled)) { + if (isModEnabled('paybox')) { $useonlinepayment++; } } diff --git a/htdocs/don/card.php b/htdocs/don/card.php index ae73fdfd15a..7c18073907e 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -914,7 +914,7 @@ if (!empty($id) && $action != 'edit') { $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); // Show online payment link - $useonlinepayment = (!empty($conf->paypal->enabled) || !empty($conf->stripe->enabled) || !empty($conf->paybox->enabled)); + $useonlinepayment = (isModEnabled('paypal') || isModEnabled('stripe') || isModEnabled('paybox')); if ($useonlinepayment) { //$object->statut != Facture::STATUS_DRAFT && print '
'."\n"; diff --git a/htdocs/partnership/admin/website.php b/htdocs/partnership/admin/website.php index b3bccf9fa00..bb86f95269b 100644 --- a/htdocs/partnership/admin/website.php +++ b/htdocs/partnership/admin/website.php @@ -189,13 +189,13 @@ if (!empty($conf->global->PARTNERSHIP_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("PARTNERSHIP_NEWFORM_PAYONLINE", $listofval, (!empty($conf->global->PARTNERSHIP_NEWFORM_PAYONLINE) ? $conf->global->PARTNERSHIP_NEWFORM_PAYONLINE : ''), 0); diff --git a/htdocs/public/eventorganization/subscriptionok.php b/htdocs/public/eventorganization/subscriptionok.php index 745c9885647..043e0e8d021 100644 --- a/htdocs/public/eventorganization/subscriptionok.php +++ b/htdocs/public/eventorganization/subscriptionok.php @@ -53,7 +53,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; -if (!empty($conf->paypal->enabled)) { +if (isModEnabled('paypal')) { require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypalfunctions.lib.php'; }