Selaa lähdekoodia

use isModEnabled

Frédéric FRANCE 2 vuotta sitten
vanhempi
commit
d55ae5dbd2

+ 1 - 1
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'));
 }
 

+ 3 - 3
htdocs/admin/system/security.php

@@ -539,14 +539,14 @@ print '<br>';
 print '<br>';
 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')."<br>\n";
 		print '<br>';
 	}
-	if (!empty($conf->api->enabled)) {
+	if (isModEnabled('api')) {
 		print '<strong>API_ENDPOINT_RULES</strong> = '.getDolGlobalString('API_ENDPOINT_RULES', '<span class="opacitymedium">'.$langs->trans("Undefined").' &nbsp; ('.$langs->trans("Example").': login:0,users:0,setup:1,status:1,tickets:1,...)</span>')."<br>\n";
 		print '<br>';
 	}

+ 1 - 1
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;
 			}

+ 1 - 1
htdocs/fourn/facture/paiement.php

@@ -723,7 +723,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
 
 							print '<td class="right">';
 							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";