diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index f8e8de04c20..1354f418967 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -186,12 +186,12 @@ print ''; print '
| '; print ' | '; // Limit to superadmin -if (!empty($conf->multicompany->enabled) && !$user->entity) { +if (isModEnabled('multicompany') && !$user->entity) { print ''; - print ''; + print ''; print ' | '; print ''; } else { print ' | '; - print ''; + print ''; } print ''; print " | \n"; @@ -281,7 +281,7 @@ if ($result) { print ''; // Entity limit to superadmin - if (!empty($conf->multicompany->enabled) && !$user->entity) { + if (isModEnabled('multicompany') && !$user->entity) { print ''; print ''; print ' | '; diff --git a/htdocs/admin/dav.php b/htdocs/admin/dav.php index 698bb187d67..d9825ad6886 100644 --- a/htdocs/admin/dav.php +++ b/htdocs/admin/dav.php @@ -185,13 +185,13 @@ $message .= ajax_autoselect('webdavpublicurl'); $message .= ''; - print ''; // We see environment, but to change it we must switch on other entity + print ''; // We see environment, but to change it we must switch on other entity print ' | '; } else { print ''; - print ''; + print ''; print ' | '; } print ''; diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 2ae77b03d07..af8fed1c197 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -172,7 +172,7 @@ if (!isset($conf->global->MAIN_DELAY_ORDERS_TO_PROCESS)) { if ($action == 'update') { foreach ($modules as $module => $delays) { - if (!empty($conf->$module->enabled)) { + if (isModEnabled('module')) { foreach ($delays as $delay) { if (GETPOST($delay['code']) != '') { dolibarr_set_const($db, $delay['code'], GETPOST($delay['code']), 'chaine', 0, '', $conf->entity); @@ -226,13 +226,13 @@ if ($action == 'edit') { print ' | '.$langs->trans("LateWarningAfter").' | '; foreach ($modules as $module => $delays) { - if (!empty($conf->$module->enabled)) { + if (isModEnabled('module')) { foreach ($delays as $delay) { - $value = (!empty($conf->global->{$delay['code']}) ? $conf->global->{$delay['code']}:0); + $value = (!empty($conf->global->{$delay['code']}) ? $conf->global->{$delay['code']} : 0); print '
| '.img_object('', $delay['img']).' | '; - print ''.$langs->trans('Delays_'.$delay['code']).' | '; - print ' '.$langs->trans("days").' | ' . img_object('', $delay['img']) . ' | '; + print '' . $langs->trans('Delays_' . $delay['code']) . ' | '; + print ' ' . $langs->trans("days") . ' | '; } } } @@ -260,13 +260,13 @@ if ($action == 'edit') { print '
| '.$langs->trans("DelaysOfToleranceBeforeWarning").' | '.$langs->trans("Value").' | |
| '.img_object('', $delay['img']).' | '; - print ''.$langs->trans('Delays_'.$delay['code']).' | '; - print ''.$value.' '.$langs->trans("days").' | ' . img_object('', $delay['img']) . ' | '; + print '' . $langs->trans('Delays_' . $delay['code']) . ' | '; + print '' . $value . ' ' . $langs->trans("days") . ' | '; } } } diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index e297ba02d61..e41777da9d9 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -37,7 +37,7 @@ include_once DOL_DOCUMENT_ROOT.'/emailcollector/lib/emailcollector.lib.php'; if (!$user->admin) { accessforbidden(); } -if (empty($conf->emailcollector->enabled)) { +if (!isModEnabled('emailcollector')) { accessforbidden(); } @@ -547,20 +547,21 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; $arrayoftypes = array( - 'loadthirdparty'=>$langs->trans('LoadThirdPartyFromName', $langs->transnoentities("ThirdPartyName")), - 'loadandcreatethirdparty'=>$langs->trans('LoadThirdPartyFromNameOrCreate', $langs->transnoentities("ThirdPartyName")), - 'recordjoinpiece'=>'AttachJoinedDocumentsToObject', - 'recordevent'=>'RecordEvent'); + 'loadthirdparty' => $langs->trans('LoadThirdPartyFromName', $langs->transnoentities("ThirdPartyName")), + 'loadandcreatethirdparty' => $langs->trans('LoadThirdPartyFromNameOrCreate', $langs->transnoentities("ThirdPartyName")), + 'recordjoinpiece' => 'AttachJoinedDocumentsToObject', + 'recordevent' => 'RecordEvent' + ); $arrayoftypesnocondition = $arrayoftypes; - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $arrayoftypes['project'] = 'CreateLeadAndThirdParty'; } $arrayoftypesnocondition['project'] = 'CreateLeadAndThirdParty'; - if (!empty($conf->ticket->enabled)) { + if (isModEnabled('ticket')) { $arrayoftypes['ticket'] = 'CreateTicketAndThirdParty'; } $arrayoftypesnocondition['ticket'] = 'CreateTicketAndThirdParty'; - if (!empty($conf->recruitment->enabled)) { + if (isModEnabled('recruitment')) { $arrayoftypes['candidature'] = 'CreateCandidature'; } $arrayoftypesnocondition['candidature'] = 'CreateCandidature'; diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index 64cf24ca6fa..2418ec3e26c 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -6,7 +6,7 @@ * Copyright (C) 2005-2014 Regis Houssin
| '; print $langs->trans('ProjectIsRequiredOnExpenseReports'); print ' | '; diff --git a/htdocs/admin/hrm.php b/htdocs/admin/hrm.php index 3bc1e3a12d4..c568e6de39c 100644 --- a/htdocs/admin/hrm.php +++ b/htdocs/admin/hrm.php @@ -492,14 +492,14 @@ if ($action == 'edit') { print ' | '; if ($val['type'] == 'textarea') { - print ' | ';
if ($val['type'] == 'textarea') {
- print ' | ';
// Synchro contact active
-if (isModEnabled("societe")) {
+if (isModEnabled('societe')) {
print '
| '.$langs->trans("LDAPDnContactActive").' | '; print $formldap->selectLdapDnSynchroActive(getDolGlobalInt('LDAP_CONTACT_ACTIVE'), 'activecontact', array(Ldap::SYNCHRO_LDAP_TO_DOLIBARR)); - print ' | '.$langs->trans("LDAPDnContactActiveExample").' | ' . $langs->trans("LDAPDnContactActiveExample") . ' | '; } // Synchro member active -if (!empty($conf->adherent->enabled)) { - print '
| '.$langs->trans("LDAPDnMemberActive").' | '; +if (isModEnabled('adherent')) { + print ' | |
| ' . $langs->trans("LDAPDnMemberActive") . ' | '; print $formldap->selectLdapDnSynchroActive(getDolGlobalInt('LDAP_MEMBER_ACTIVE'), 'activemembers', array(), 2); - print ' | '.$langs->trans("LDAPDnMemberActiveExample").' | ' . $langs->trans("LDAPDnMemberActiveExample") . ' | '; } // Synchro member type active -if (!empty($conf->adherent->enabled)) { - print '
| '.$langs->trans("LDAPDnMemberTypeActive").' | '; +if (isModEnabled('adherent')) { + print ' | |
| ' . $langs->trans("LDAPDnMemberTypeActive") . ' | '; print $formldap->selectLdapDnSynchroActive(getDolGlobalInt('LDAP_MEMBER_TYPE_ACTIVE'), 'activememberstypes', array(), 2); - print ' | '.$langs->trans("LDAPDnMemberTypeActiveExample").' | ' . $langs->trans("LDAPDnMemberTypeActiveExample") . ' | '; } // Fields from hook diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index 1209f41c48e..d644f2bd2f6 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -36,7 +36,7 @@ if (!$user->admin) { $action = GETPOST('action', 'aZ09'); $currencycode = GETPOST('currencycode', 'alpha'); -if (!empty($conf->multicurrency->enabled) && !empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) { +if (isModEnabled('multicompany') && !empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) { // When MULTICURRENCY_USE_LIMIT_BY_CURRENCY is on, we use always a defined currency code instead of '' even for default. $currencycode = (!empty($currencycode) ? $currencycode : $conf->currency); } @@ -105,12 +105,12 @@ print load_fiche_titre($title, '', 'title_setup'); $aCurrencies = array($conf->currency); // Default currency always first position -if (!empty($conf->multicurrency->enabled) && !empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/multicurrency.lib.php'; +if (isModEnabled('multicompany') && !empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) { + require_once DOL_DOCUMENT_ROOT . '/core/lib/multicurrency.lib.php'; - $sql = "SELECT rowid, code FROM ".MAIN_DB_PREFIX."multicurrency"; - $sql .= " WHERE entity = ".((int) $conf->entity); - $sql .= " AND code <> '".$db->escape($conf->currency)."'"; // Default currency always first position + $sql = "SELECT rowid, code FROM " . MAIN_DB_PREFIX . "multicurrency"; + $sql .= " WHERE entity = " . ((int) $conf->entity); + $sql .= " AND code <> '" . $db->escape($conf->currency) . "'"; // Default currency always first position $resql = $db->query($sql); if ($resql) { while ($obj = $db->fetch_object($resql)) { @@ -129,11 +129,11 @@ print ''.$langs->trans("LimitsDesc")."'; + print ' | '; // Value print ' | '; - if (!empty($conf->accounting->enabled)) { + if (isModEnabled('accounting')) { print $formaccounting->select_account(getDolGlobalString($key), $key, 1, '', 1, 1); } else { - print ''; + print ''; } print ' | '; } diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index 79ddda792e0..f7203d88474 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -294,16 +294,16 @@ if ($action == 'edit') { } print ''; // SuperAdministrator access only - if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) { - print ''; - print ''; - print ''.$langs->trans("SeeLocalSendMailSetup").''; - print ' '.$langs->trans("SeeLinkToOnlineDocumentation").''; + if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { + print ''; + print ''; + print '' . $langs->trans("SeeLocalSendMailSetup") . ''; + print ' ' . $langs->trans("SeeLinkToOnlineDocumentation") . ''; } else { $text = !empty($mainserver) ? $mainserver : $smtpserver; $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); - print ''; + print ''; } print ' | '; } @@ -326,15 +326,15 @@ if ($action == 'edit') { } print ''; // SuperAdministrator access only - if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) { - print ''; - print ''; - print ''.$langs->trans("SeeLocalSendMailSetup").''; + if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { + print ''; + print ''; + print '' . $langs->trans("SeeLocalSendMailSetup") . ''; } else { $text = (!empty($mainport) ? $mainport : $smtpport); $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); - print ''; + print ''; } } print ' | '; @@ -342,14 +342,14 @@ if ($action == 'edit') { // ID if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) { $mainstmpid = (!empty($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING) ? $conf->global->MAIN_MAIL_SMTPS_ID_EMAILING : ''); - print ''; } @@ -357,14 +357,14 @@ if ($action == 'edit') { // PW if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) { $mainsmtppw = (!empty($conf->global->MAIN_MAIL_SMTPS_PW_EMAILING) ? $conf->global->MAIN_MAIL_SMTPS_PW_EMAILING : ''); - print ''; } @@ -533,16 +533,16 @@ if ($action == 'edit') { if (!empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default') { if ($conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'mail' || !$linuxlike) { if (function_exists('fsockopen') && $port && $server) { - print ''.$langs->trans("DoTestServerAvailability").''; + print '' . $langs->trans("DoTestServerAvailability") . ''; } } else { - print ''.$langs->trans("DoTestServerAvailability").''; + print '' . $langs->trans("DoTestServerAvailability") . ''; } - print ''.$langs->trans("DoTestSend").''; + print '' . $langs->trans("DoTestSend") . ''; - if (!empty($conf->fckeditor->enabled)) { - print ''.$langs->trans("DoTestSendHTML").''; + if (isModEnabled('fckeditor')) { + print '' . $langs->trans("DoTestSendHTML") . ''; } }