diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index c311bf80d1d..63527452fe1 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -58,7 +58,7 @@ $userid = GETPOST('userid', 'int'); $socid = GETPOST('socid', 'int'); $ref = GETPOST('ref', 'alpha'); -if (!empty($conf->mailmanspip->enabled)) { +if (isModEnabled('mailmanspip')) { include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php'; $langs->load('mailmanspip'); @@ -475,7 +475,7 @@ if (empty($reshook)) { $object->phone_perso = $phone_perso; $object->phone_mobile = $phone_mobile; $object->socialnetworks = array(); - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if (GETPOSTISSET($key) && GETPOST($key, 'alphanohtml') != '') { $object->socialnetworks[$key] = GETPOST("member_".$key, 'alphanohtml'); @@ -1089,7 +1089,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.$langs->trans("PhoneMobile").''; print ''.img_picto('', 'object_phoning_mobile', 'class="pictofixedwidth"').''; - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if (!$value['active']) { break; @@ -1110,7 +1110,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print "\n"; // Categories - if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) { print ''.$form->editfieldkey("Categories", 'memcats', '', $object, 0).''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, 'parent', null, null, 1); print img_picto('', 'category').$form->multiselectarray('memcats', $cate_arbo, GETPOST('memcats', 'array'), null, null, 'quatrevingtpercent widthcentpercentminusx', 0, 0); @@ -1331,7 +1331,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.$langs->trans("PhoneMobile").''; print ''.img_picto('', 'object_phoning_mobile', 'class="pictofixedwidth"').'phone_mobile).'">'; - if (!empty($conf->socialnetworks->enabled)) { + if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if (!$value['active']) { break; @@ -1359,7 +1359,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print "\n"; // Categories - if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { + if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) { print ''.$form->editfieldkey("Categories", 'memcats', '', $object, 0).''; print ''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, null, null, null, 1); @@ -1376,7 +1376,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Third party Dolibarr - if (!empty($conf->societe->enabled)) { + if (isModEnabled('societe')) { print ''.$langs->trans("LinkedToDolibarrThirdParty").''; if ($object->socid) { $company = new Societe($db); @@ -1449,12 +1449,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $formquestion = array( array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login) ); - if (!empty($conf->societe->enabled) && $object->socid > 0) { + if (isModEnabled('societe') && $object->socid > 0) { $object->fetch_thirdparty(); $formquestion[] = array('label' => $langs->trans("UserWillBe"), 'type' => 'radio', 'name' => 'internalorexternal', 'default'=>'external', 'values' => array('external'=>$langs->trans("External").' - '.$langs->trans("LinkedToDolibarrThirdParty").' '.$object->thirdparty->getNomUrl(1, '', 0, 1), 'internal'=>$langs->trans("Internal"))); } $text = ''; - if (!empty($conf->societe->enabled) && $object->socid <= 0) { + if (isModEnabled('societe') && $object->socid <= 0) { $text .= $langs->trans("UserWillBeInternalUser").'
'; } $text .= $langs->trans("ConfirmCreateLogin"); @@ -1541,10 +1541,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($object->email) { $formquestion[] = array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => (getDolGlobalString('ADHERENT_DEFAULT_SENDINFOBYMAIL') ? true : false)); } - if (!empty($conf->mailman->enabled) && !empty($conf->global->ADHERENT_USE_MAILMAN)) { + if (isModEnabled('mailman') && !empty($conf->global->ADHERENT_USE_MAILMAN)) { $formquestion[] = array('type'=>'other', 'label'=>$langs->transnoentitiesnoconv("SynchroMailManEnabled"), 'value'=>''); } - if (!empty($conf->mailman->enabled) && !empty($conf->global->ADHERENT_USE_SPIP)) { + if (isModEnabled('mailman') && !empty($conf->global->ADHERENT_USE_SPIP)) { $formquestion[] = array('type'=>'other', 'label'=>$langs->transnoentitiesnoconv("SynchroSpipEnabled"), 'value'=>''); } print $form->formconfirm("card.php?rowid=".$id, $langs->trans("ValidateMember"), $langs->trans("ConfirmValidateMember"), "confirm_valid", $formquestion, 'yes', 1, 220); @@ -1692,7 +1692,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { $rowspan++; } - if (!empty($conf->societe->enabled)) { + if (isModEnabled('societe')) { $rowspan++; } @@ -1783,7 +1783,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { 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); @@ -1813,7 +1813,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; // Third party Dolibarr - if (!empty($conf->societe->enabled)) { + if (isModEnabled('societe')) { print '
'; $editenable = $user->rights->adherent->creer; print $form->editfieldkey('LinkedToDolibarrThirdParty', 'thirdparty', '', $object, $editenable); @@ -1951,7 +1951,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Create third party - if (!empty($conf->societe->enabled) && !$object->socid) { + if (isModEnabled('societe') && !$object->socid) { if ($user->rights->societe->creer) { if (Adherent::STATUS_DRAFT != $object->statut) { print ''.$langs->trans("CreateDolibarrThirdParty").''."\n"; @@ -1977,7 +1977,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Action SPIP - if (!empty($conf->mailmanspip->enabled) && !empty($conf->global->ADHERENT_USE_SPIP)) { + if (isModEnabled('mailmanspip') && !empty($conf->global->ADHERENT_USE_SPIP)) { $isinspip = $mailmanspip->is_in_spip($object); if ($isinspip == 1) { @@ -2034,7 +2034,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { */ // 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) { print '
';