Use isModEnabled
This commit is contained in:
parent
9772bbeff3
commit
da55ed782c
@ -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++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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 '<br><!-- Link to pay -->'."\n";
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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';
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user