Use isModEnabled
This commit is contained in:
parent
b6aeacfb05
commit
9772bbeff3
@ -227,13 +227,13 @@ if (empty($reshook)) {
|
|||||||
$substitutionarray['__UNSUBSCRIBE_URL__'] = DOL_MAIN_URL_ROOT.'/public/emailing/mailing-unsubscribe.php?tag='.urlencode($obj->tag).'&unsuscrib=1&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'&email='.urlencode($obj->email).'&mtid='.$obj->rowid;
|
$substitutionarray['__UNSUBSCRIBE_URL__'] = DOL_MAIN_URL_ROOT.'/public/emailing/mailing-unsubscribe.php?tag='.urlencode($obj->tag).'&unsuscrib=1&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'&email='.urlencode($obj->email).'&mtid='.$obj->rowid;
|
||||||
|
|
||||||
$onlinepaymentenabled = 0;
|
$onlinepaymentenabled = 0;
|
||||||
if (!empty($conf->paypal->enabled)) {
|
if (isModEnabled('paypal')) {
|
||||||
$onlinepaymentenabled++;
|
$onlinepaymentenabled++;
|
||||||
}
|
}
|
||||||
if (!empty($conf->paybox->enabled)) {
|
if (isModEnabled('paybox')) {
|
||||||
$onlinepaymentenabled++;
|
$onlinepaymentenabled++;
|
||||||
}
|
}
|
||||||
if (!empty($conf->stripe->enabled)) {
|
if (isModEnabled('stripe')) {
|
||||||
$onlinepaymentenabled++;
|
$onlinepaymentenabled++;
|
||||||
}
|
}
|
||||||
if ($onlinepaymentenabled && !empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
|
if ($onlinepaymentenabled && !empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
|
||||||
@ -263,7 +263,7 @@ if (empty($reshook)) {
|
|||||||
$substitutionarray['__PUBLICLINK_NEWMEMBERFORM__'] = '<a target="_blank" rel="noopener noreferrer" href="'.DOL_MAIN_URL_ROOT.'/public/members/new.php'.((isModEnabled('multicompany')) ? '?entity='.$conf->entity : '').'">'.$langs->trans('BlankSubscriptionForm'). '</a>';
|
$substitutionarray['__PUBLICLINK_NEWMEMBERFORM__'] = '<a target="_blank" rel="noopener noreferrer" href="'.DOL_MAIN_URL_ROOT.'/public/members/new.php'.((isModEnabled('multicompany')) ? '?entity='.$conf->entity : '').'">'.$langs->trans('BlankSubscriptionForm'). '</a>';
|
||||||
}
|
}
|
||||||
/* For backward compatibility, deprecated */
|
/* For backward compatibility, deprecated */
|
||||||
if (!empty($conf->paypal->enabled) && !empty($conf->global->PAYPAL_SECURITY_TOKEN)) {
|
if (isModEnabled('paypal') && !empty($conf->global->PAYPAL_SECURITY_TOKEN)) {
|
||||||
$substitutionarray['__SECUREKEYPAYPAL__'] = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2);
|
$substitutionarray['__SECUREKEYPAYPAL__'] = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2);
|
||||||
|
|
||||||
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) {
|
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) {
|
||||||
|
|||||||
@ -5802,7 +5802,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
|
|
||||||
// Show online payment link
|
// 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 ($object->statut != Facture::STATUS_DRAFT && $useonlinepayment) {
|
if ($object->statut != Facture::STATUS_DRAFT && $useonlinepayment) {
|
||||||
print '<br><!-- Link to pay -->'."\n";
|
print '<br><!-- Link to pay -->'."\n";
|
||||||
|
|||||||
@ -1619,13 +1619,13 @@ class FormMail extends Form
|
|||||||
//,'__PERSONALIZED__' => 'Personalized' // Hidden because not used yet in mass emailing
|
//,'__PERSONALIZED__' => 'Personalized' // Hidden because not used yet in mass emailing
|
||||||
|
|
||||||
$onlinepaymentenabled = 0;
|
$onlinepaymentenabled = 0;
|
||||||
if (!empty($conf->paypal->enabled)) {
|
if (isModEnabled('paypal')) {
|
||||||
$onlinepaymentenabled++;
|
$onlinepaymentenabled++;
|
||||||
}
|
}
|
||||||
if (!empty($conf->paybox->enabled)) {
|
if (isModEnabled('paybox')) {
|
||||||
$onlinepaymentenabled++;
|
$onlinepaymentenabled++;
|
||||||
}
|
}
|
||||||
if (!empty($conf->stripe->enabled)) {
|
if (isModEnabled('stripe')) {
|
||||||
$onlinepaymentenabled++;
|
$onlinepaymentenabled++;
|
||||||
}
|
}
|
||||||
if ($onlinepaymentenabled && !empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
|
if ($onlinepaymentenabled && !empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
|
||||||
|
|||||||
@ -27,7 +27,7 @@
|
|||||||
$supportedoauth2array = array(
|
$supportedoauth2array = array(
|
||||||
'OAUTH_GOOGLE_NAME'=>array('callbackfile' => 'google', 'picto' => 'google', 'urlforapp' => 'OAUTH_GOOGLE_DESC', 'name'=>'Google', 'urlforcredentials'=>'https://console.developers.google.com/', 'availablescopes'=> 'userinfo_email,userinfo_profile,openid,email,profile,cloud_print,admin_directory_user,gmail_full'),
|
'OAUTH_GOOGLE_NAME'=>array('callbackfile' => 'google', 'picto' => 'google', 'urlforapp' => 'OAUTH_GOOGLE_DESC', 'name'=>'Google', 'urlforcredentials'=>'https://console.developers.google.com/', 'availablescopes'=> 'userinfo_email,userinfo_profile,openid,email,profile,cloud_print,admin_directory_user,gmail_full'),
|
||||||
);
|
);
|
||||||
if (!empty($conf->stripe->enabled)) {
|
if (isModEnabled('stripe')) {
|
||||||
$supportedoauth2array['OAUTH_STRIPE_TEST_NAME'] = array('callbackfile' => 'stripetest', 'picto' => 'stripe', 'urlforapp' => '', 'name'=>'StripeTest', 'urlforcredentials'=>'', 'availablescopes'=>'read_write');
|
$supportedoauth2array['OAUTH_STRIPE_TEST_NAME'] = array('callbackfile' => 'stripetest', 'picto' => 'stripe', 'urlforapp' => '', 'name'=>'StripeTest', 'urlforcredentials'=>'', 'availablescopes'=>'read_write');
|
||||||
$supportedoauth2array['OAUTH_STRIPE_LIVE_NAME'] = array('callbackfile' => 'stripelive', 'picto' => 'stripe', 'urlforapp' => '', 'name'=>'StripeLive', 'urlforcredentials'=>'', 'availablescopes'=>'read_write');
|
$supportedoauth2array['OAUTH_STRIPE_LIVE_NAME'] = array('callbackfile' => 'stripelive', 'picto' => 'stripe', 'urlforapp' => '', 'name'=>'StripeLive', 'urlforcredentials'=>'', 'availablescopes'=>'read_write');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -150,15 +150,15 @@ function getValidOnlinePaymentMethods($paymentmethod = '')
|
|||||||
|
|
||||||
$validpaymentmethod = array();
|
$validpaymentmethod = array();
|
||||||
|
|
||||||
if ((empty($paymentmethod) || $paymentmethod == 'paypal') && !empty($conf->paypal->enabled)) {
|
if ((empty($paymentmethod) || $paymentmethod == 'paypal') && isModEnabled('paypal')) {
|
||||||
$langs->load("paypal");
|
$langs->load("paypal");
|
||||||
$validpaymentmethod['paypal'] = 'valid';
|
$validpaymentmethod['paypal'] = 'valid';
|
||||||
}
|
}
|
||||||
if ((empty($paymentmethod) || $paymentmethod == 'paybox') && !empty($conf->paybox->enabled)) {
|
if ((empty($paymentmethod) || $paymentmethod == 'paybox') && isModEnabled('paybox')) {
|
||||||
$langs->load("paybox");
|
$langs->load("paybox");
|
||||||
$validpaymentmethod['paybox'] = 'valid';
|
$validpaymentmethod['paybox'] = 'valid';
|
||||||
}
|
}
|
||||||
if ((empty($paymentmethod) || $paymentmethod == 'stripe') && !empty($conf->stripe->enabled)) {
|
if ((empty($paymentmethod) || $paymentmethod == 'stripe') && isModEnabled('stripe')) {
|
||||||
$langs->load("stripe");
|
$langs->load("stripe");
|
||||||
$validpaymentmethod['stripe'] = 'valid';
|
$validpaymentmethod['stripe'] = 'valid';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user