diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index cf0ad445c92..5779fe036d9 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -271,7 +271,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! $action = 'addsubscription'; } else { // If an amount has been provided, we check also fields that becomes mandatory when amount is not null. - if (!empty($conf->banque->enabled) && GETPOST("paymentsave") != 'none') { + if (isModEnabled('banque') && GETPOST("paymentsave") != 'none') { if (GETPOST("subscription")) { if (!GETPOST("label")) { $errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")); @@ -475,7 +475,7 @@ if ($rowid > 0) { if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { $rowspan++; } - if (!empty($conf->societe->enabled)) { + if (isModEnabled('societe')) { $rowspan++; } @@ -571,7 +571,7 @@ if ($rowid > 0) { print ''; // Tags / Categories - if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) { print ''; print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_MEMBER, 1); @@ -589,7 +589,7 @@ if ($rowid > 0) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; // Third party Dolibarr - if (!empty($conf->societe->enabled)) { + if (isModEnabled('societe')) { print '
'; print '\n"; @@ -753,7 +753,7 @@ if ($rowid > 0) { print '\n"; print '\n"; print ''; - if (!empty($conf->banque->enabled)) { + if (isModEnabled('banque')) { print ''; @@ -797,7 +797,7 @@ if ($rowid > 0) { if (($action != 'addsubscription' && $action != 'create_thirdparty')) { // Shon 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) { print '
'; @@ -831,11 +831,11 @@ if ($rowid > 0) { $bankviainvoice = 1; } } else { - if (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && isModEnabled('facture')) { + if (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && isModEnabled('banque') && isModEnabled('societe') && isModEnabled('facture')) { $bankviainvoice = 1; - } elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && !empty($conf->banque->enabled)) { + } elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && isModEnabled('banque')) { $bankdirect = 1; - } elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && !empty($conf->banque->enabled) && !empty($conf->societe->enabled) && isModEnabled('facture')) { + } elseif (!empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && isModEnabled('banque') && isModEnabled('societe') && isModEnabled('facture')) { $invoiceonly = 1; } } @@ -982,7 +982,7 @@ if ($rowid > 0) { print '">'; // Complementary action - if ((!empty($conf->banque->enabled) || isModEnabled('facture')) && empty($conf->global->ADHERENT_SUBSCRIPTION_HIDECOMPLEMENTARYACTIONS)) { + if ((isModEnabled('banque') || isModEnabled('facture')) && empty($conf->global->ADHERENT_SUBSCRIPTION_HIDECOMPLEMENTARYACTIONS)) { $company = new Societe($db); if ($object->fk_soc) { $result = $company->fetch($object->fk_soc); @@ -998,12 +998,12 @@ if ($rowid > 0) { print ''; print '
'; // Add entry into bank accoun - if (!empty($conf->banque->enabled)) { + if (isModEnabled('banque')) { print '
'; } // Add invoice with no payments - if (!empty($conf->societe->enabled) && isModEnabled('facture')) { + if (isModEnabled('societe') && isModEnabled('facture')) { print 'fk_soc)) print ' disabled'; print '>
'; } // Add invoice with payments - if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && isModEnabled('facture')) { + if (isModEnabled('banque') && isModEnabled('societe') && isModEnabled('facture')) { print 'fk_soc)) print ' disabled'; print '>
'; print $langs->trans("LinkedToDolibarrThirdParty"); @@ -718,7 +718,7 @@ if ($rowid > 0) { print_liste_field_titre('DateStart', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre('DateEnd', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre('Amount', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); - if (!empty($conf->banque->enabled)) { + if (isModEnabled('banque')) { print_liste_field_titre('Account', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); } print "
'.dol_print_date($db->jdate($objp->dateh), 'day')."'.dol_print_date($db->jdate($objp->datef), 'day')."'.price($objp->subscription).''; if ($objp->bid) { $accountstatic->label = $objp->label; @@ -762,7 +762,7 @@ if ($rowid > 0) { $accountstatic->account_number = $objp->account_number; $accountstatic->currency_code = $objp->currency_code; - if (!empty($conf->accounting->enabled) && $objp->fk_accountancy_journal > 0) { + if (isModEnabled('accounting') && $objp->fk_accountancy_journal > 0) { $accountingjournal = new AccountingJournal($db); $accountingjournal->fetch($objp->fk_accountancy_journal); @@ -782,7 +782,7 @@ if ($rowid > 0) { if (empty($num)) { $colspan = 6; - if (!empty($conf->banque->enabled)) { + if (isModEnabled('banque')) { $colspan++; } print '
'.$langs->trans("None").'