diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php
index 8682939f267..cf327158f5f 100644
--- a/htdocs/core/lib/admin.lib.php
+++ b/htdocs/core/lib/admin.lib.php
@@ -1665,7 +1665,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '', $text = 'Valu
print 'mymailmanlist
';
print 'mymailmanlist1,mymailmanlist2
';
print 'TYPE:Type1:mymailmanlist1,TYPE:Type2:mymailmanlist2
';
- if ($conf->categorie->enabled) {
+ if (isModEnabled('categorie')) {
print 'CATEG:Categ1:mymailmanlist1,CATEG:Categ2:mymailmanlist2
';
}
print '';
@@ -1697,7 +1697,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '', $text = 'Valu
print "\n";
} elseif ($obj->type == 'html') {
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
- $doleditor = new DolEditor('constvalue'.(empty($strictw3c) ? '' : ($strictw3c == 3 ? '_'.$const : '[]')), $obj->value, '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, ROWS_5, '90%');
+ $doleditor = new DolEditor('constvalue'.(empty($strictw3c) ? '' : ($strictw3c == 3 ? '_'.$const : '[]')), $obj->value, '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%');
$doleditor->Create();
} elseif ($obj->type == 'yesno') {
print $form->selectyesno('constvalue'.(empty($strictw3c) ? '' : ($strictw3c == 3 ? '_'.$const : '[]')), $obj->value, 1);
@@ -1944,14 +1944,14 @@ function email_admin_prepare_head()
$head[$h][2] = 'common';
$h++;
- if (!empty($conf->mailing->enabled)) {
+ if (isModEnabled('mailing')) {
$head[$h][0] = DOL_URL_ROOT."/admin/mails_emailing.php";
$head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing", $langs->transnoentitiesnoconv("EMailing"));
$head[$h][2] = 'common_emailing';
$h++;
}
- if (!empty($conf->ticket->enabled)) {
+ if (isModEnabled('ticket')) {
$head[$h][0] = DOL_URL_ROOT."/admin/mails_ticket.php";
$head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing", $langs->transnoentitiesnoconv("Ticket"));
$head[$h][2] = 'common_ticket';
diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php
index 6feee8c35d5..0f7334345fa 100644
--- a/htdocs/core/lib/agenda.lib.php
+++ b/htdocs/core/lib/agenda.lib.php
@@ -92,7 +92,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', !$canedit, '', '', '0', false, 'minwidth100 maxwidth500 widthcentpercentminusxx');
print '';
- if (!empty($conf->resource->enabled)) {
+ if (isModEnabled('resource')) {
include_once DOL_DOCUMENT_ROOT.'/resource/class/html.formresource.class.php';
$formresource = new FormResource($db);
@@ -104,14 +104,14 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
}
}
- if (!empty($conf->societe->enabled) && !empty($user->rights->societe->lire)) {
+ if (isModEnabled('societe') && !empty($user->rights->societe->lire)) {
print '
';
print img_picto($langs->trans("ThirdParty"), 'company', 'class="pictofixedwidth inline-block"');
print $form->select_company($socid, 'search_socid', '', ' ', 0, 0, null, 0, 'minwidth100 maxwidth500');
print '
';
}
- if (!empty($conf->projet->enabled) && !empty($user->rights->projet->lire)) {
+ if (isModEnabled('projet') && !empty($user->rights->projet->lire)) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
$formproject = new FormProjets($db);
@@ -423,7 +423,7 @@ function actions_prepare_head($object)
$h++;
// Tab to link resources
- if ($conf->resource->enabled) {
+ if (isModEnabled('resource')) {
include_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php';
$resource = new DolResource($db);
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index 4938d20c3c4..37d206f0361 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -128,7 +128,7 @@ function societe_prepare_head(Societe $object)
}
}
$supplier_module_enabled = 0;
- if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_proposal->enabled) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
+ if ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_proposal->enabled) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) {
$supplier_module_enabled = 1;
}
if ($supplier_module_enabled == 1 && $object->fournisseur && !empty($user->rights->fournisseur->lire)) {
@@ -171,7 +171,7 @@ function societe_prepare_head(Societe $object)
}
// Tab to link resources
- if (!empty($conf->resource->enabled) && !empty($conf->global->RESOURCE_ON_THIRDPARTIES)) {
+ if (isModEnabled('resource') && !empty($conf->global->RESOURCE_ON_THIRDPARTIES)) {
$head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=societe&element_id='.$object->id;
$head[$h][1] = $langs->trans("Resources");
$head[$h][2] = 'resources';
@@ -179,7 +179,7 @@ function societe_prepare_head(Societe $object)
}
// Related items
- if ((!empty($conf->commande->enabled) || !empty($conf->propal->enabled) || !empty($conf->facture->enabled) || !empty($conf->ficheinter->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))
+ if ((isModEnabled('commande') || isModEnabled('propal') || isModEnabled('facture') || isModEnabled('ficheinter') || (isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))
&& empty($conf->global->THIRDPARTIES_DISABLE_RELATED_OBJECT_TAB)) {
$head[$h][0] = DOL_URL_ROOT.'/societe/consumption.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Referers");
@@ -195,7 +195,7 @@ function societe_prepare_head(Societe $object)
$title = $langs->trans("PaymentModes");
- if (!empty($conf->stripe->enabled)) {
+ if (isModEnabled('stripe')) {
//$langs->load("stripe");
//$title = $langs->trans("BankAccountsAndGateways");
@@ -215,7 +215,7 @@ function societe_prepare_head(Societe $object)
$sql = "SELECT COUNT(n.rowid) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."societe_rib as n";
$sql .= " WHERE n.fk_soc = ".((int) $object->id);
- if (empty($conf->stripe->enabled)) {
+ if (!isModEnabled('stripe')) {
$sql .= " AND n.stripe_card_ref IS NULL";
} else {
$sql .= " AND (n.stripe_card_ref IS NULL OR (n.stripe_card_ref IS NOT NULL AND n.status = ".((int) $servicestatus)."))";
@@ -229,7 +229,7 @@ function societe_prepare_head(Societe $object)
dol_print_error($db);
}
- //if (! empty($conf->stripe->enabled) && $nbBankAccount > 0) $nbBankAccount = '...'; // No way to know exact number
+ //if (isModEnabled('stripe') && $nbBankAccount > 0) $nbBankAccount = '...'; // No way to know exact number
$head[$h][0] = DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.urlencode($object->id);
$head[$h][1] = $title;
@@ -242,7 +242,7 @@ function societe_prepare_head(Societe $object)
$h++;
}
- if (!empty($conf->website->enabled) && (!empty($conf->global->WEBSITE_USE_WEBSITE_ACCOUNTS)) && (!empty($user->rights->societe->lire))) {
+ if (isModEnabled('website') && (!empty($conf->global->WEBSITE_USE_WEBSITE_ACCOUNTS)) && (!empty($user->rights->societe->lire))) {
$head[$h][0] = DOL_URL_ROOT.'/societe/website.php?id='.urlencode($object->id);
$head[$h][1] = $langs->trans("WebSiteAccounts");
$nbNote = 0;
@@ -285,7 +285,7 @@ function societe_prepare_head(Societe $object)
if ($user->socid == 0) {
// Notifications
- if (!empty($conf->notification->enabled)) {
+ if (isModEnabled('notification')) {
$nbNotif = 0;
// Enable caching of thirdparty count notifications
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
@@ -361,7 +361,7 @@ function societe_prepare_head(Societe $object)
$head[$h][0] = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Events");
- if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
+ if (isModEnabled('agenda')&& (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$nbEvent = 0;
// Enable caching of thirdrparty count actioncomm
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
@@ -1283,7 +1283,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
print '';
// Add to agenda
- if (!empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) {
+ if (isModEnabled('agenda')&& $user->rights->agenda->myactions->create) {
print '';
print img_object($langs->trans("Event"), "action");
print ' ';
@@ -1665,7 +1665,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
}
}
- if (!empty($conf->agenda->enabled) || (!empty($conf->mailing->enabled) && !empty($objcon->email))) {
+ if (isModEnabled('agenda')|| (isModEnabled('mailing') && !empty($objcon->email))) {
$delay_warning = $conf->global->MAIN_DELAY_ACTIONS_TODO * 24 * 60 * 60;
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
@@ -2097,7 +2097,7 @@ function addMailingEventTypeSQL($actioncode, $objcon, $filterobj)
{
global $conf, $langs, $db;
// Add also event from emailings. TODO This should be replaced by an automatic event ? May be it's too much for very large emailing.
- if (!empty($conf->mailing->enabled) && !empty($objcon->email)
+ if (isModEnabled('mailing') && !empty($objcon->email)
&& (empty($actioncode) || $actioncode == 'AC_OTH_AUTO' || $actioncode == 'AC_EMAILING')) {
$langs->load("mails");
diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php
index fec64f931dc..6bfb7f717de 100644
--- a/htdocs/core/lib/fichinter.lib.php
+++ b/htdocs/core/lib/fichinter.lib.php
@@ -64,7 +64,7 @@ function fichinter_prepare_head($object)
complete_head_from_modules($conf, $langs, $object, $head, $h, 'intervention');
// Tab to link resources
- if ($conf->resource->enabled) {
+ if (isModEnabled('resource')) {
require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php';
$objectres = new Dolresource($db);
$linked_resources = $objectres->getElementResources('fichinter', $object->id);
|