diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php
index 78f7c687175..c0855371f6d 100644
--- a/htdocs/commande/list_det.php
+++ b/htdocs/commande/list_det.php
@@ -875,7 +875,7 @@ if ($resql) {
$moreforfilter .= '';
}
// If the user can view prospects other than his'
- if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) {
+ if (isModEnabled("categorie") && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) {
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '
';
$tmptitle = $langs->trans('IncludingProductWithTag');
@@ -883,7 +883,7 @@ if ($resql) {
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300 widthcentpercentminusx', 1);
$moreforfilter .= '
';
}
- if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
+ if (isModEnabled("categorie") && $user->rights->categorie->lire) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '';
$tmptitle = $langs->trans('CustomersProspectsCategoriesShort');
diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php
index a671297b0de..c51a4398cf1 100644
--- a/htdocs/contrat/list.php
+++ b/htdocs/contrat/list.php
@@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
-if (!empty($conf->categorie->enabled)) {
+if (isModEnabled("categorie")) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
}
@@ -701,7 +701,7 @@ if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->right
$moreforfilter .= '
';
}
// Filter on customer categories
-if (!empty($conf->global->MAIN_SEARCH_CATEGORY_CUSTOMER_ON_CONTRACT_LIST) && !empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
+if (!empty($conf->global->MAIN_SEARCH_CATEGORY_CUSTOMER_ON_CONTRACT_LIST) && isModEnabled("categorie") && $user->rights->categorie->lire) {
$moreforfilter .= '';
$tmptitle = $langs->transnoentities('CustomersProspectsCategoriesShort');
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"');
diff --git a/htdocs/core/modules/mailings/advthirdparties.modules.php b/htdocs/core/modules/mailings/advthirdparties.modules.php
index 6137bcca2ff..ced14b802a0 100644
--- a/htdocs/core/modules/mailings/advthirdparties.modules.php
+++ b/htdocs/core/modules/mailings/advthirdparties.modules.php
@@ -253,7 +253,7 @@ class mailing_advthirdparties extends MailingTargets
if ($resql) {
$num = $this->db->num_rows($resql);
- if (empty($conf->categorie->enabled)) {
+ if (!isModEnabled("categorie")) {
$num = 0; // Force empty list if category module is not enabled
}
diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php
index f34eb600228..53cba7c915f 100644
--- a/htdocs/core/modules/mailings/thirdparties.modules.php
+++ b/htdocs/core/modules/mailings/thirdparties.modules.php
@@ -295,7 +295,7 @@ class mailing_thirdparties extends MailingTargets
if ($resql) {
$num = $this->db->num_rows($resql);
- if (empty($conf->categorie->enabled)) {
+ if (!isModEnabled("categorie")) {
$num = 0; // Force empty list if category module is not enabled
}
diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php
index 67c27178987..01ae671bad7 100644
--- a/htdocs/core/modules/modTicket.class.php
+++ b/htdocs/core/modules/modTicket.class.php
@@ -157,7 +157,7 @@ class modTicket extends DolibarrModules
'tabfieldvalue' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public,fk_parent", "code,label,pos,use_default"),
'tabfieldinsert' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public,fk_parent", "code,label,pos,use_default"),
'tabrowid' => array("rowid", "rowid", "rowid", "rowid"),
- 'tabcond' => array($conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled && getDolGlobalString('TICKET_ENABLE_RESOLUTION')),
+ 'tabcond' => array(isModEnabled("ticket"), isModEnabled("ticket"), isModEnabled("ticket"), isModEnabled("ticket") && getDolGlobalString('TICKET_ENABLE_RESOLUTION')),
'tabhelp' => array(
array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1")),
array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1")),
@@ -238,7 +238,7 @@ class modTicket extends DolibarrModules
'url' => '/ticket/index.php',
'langs' => 'ticket', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position' => 88,
- 'enabled' => '$conf->ticket->enabled',
+ 'enabled' => 'isModEnabled("ticket")',
'perms' => '$user->rights->ticket->read', // Use 'perms'=>'$user->rights->ticket->level1->level2' if you want your menu with a permission rules
'target' => '',
'user' => 2); // 0=Menu for internal users, 1=external users, 2=both
@@ -253,7 +253,7 @@ class modTicket extends DolibarrModules
'url' => '/ticket/index.php',
'langs' => 'ticket',
'position' => 101,
- 'enabled' => '$conf->ticket->enabled',
+ 'enabled' => 'isModEnabled("ticket")',
'perms' => '$user->rights->ticket->read',
'target' => '',
'user' => 2);
@@ -266,7 +266,7 @@ class modTicket extends DolibarrModules
'url' => '/ticket/card.php?action=create',
'langs' => 'ticket',
'position' => 102,
- 'enabled' => '$conf->ticket->enabled',
+ 'enabled' => 'isModEnabled("ticket")',
'perms' => '$user->rights->ticket->write',
'target' => '',
'user' => 2);
@@ -280,7 +280,7 @@ class modTicket extends DolibarrModules
'url' => '/ticket/list.php?search_fk_status=non_closed',
'langs' => 'ticket',
'position' => 103,
- 'enabled' => '$conf->ticket->enabled',
+ 'enabled' => 'isModEnabled("ticket")',
'perms' => '$user->rights->ticket->read',
'target' => '',
'user' => 2);
@@ -294,7 +294,7 @@ class modTicket extends DolibarrModules
'url' => '/ticket/list.php?mode=mine&search_fk_status=non_closed',
'langs' => 'ticket',
'position' => 105,
- 'enabled' => '$conf->ticket->enabled',
+ 'enabled' => 'isModEnabled("ticket")',
'perms' => '$user->rights->ticket->read',
'target' => '',
'user' => 0);
@@ -307,7 +307,7 @@ class modTicket extends DolibarrModules
'url' => '/ticket/stats/index.php',
'langs' => 'ticket',
'position' => 107,
- 'enabled' => '$conf->ticket->enabled',
+ 'enabled' => 'isModEnabled("ticket")',
'perms' => '$user->rights->ticket->read',
'target' => '',
'user' => 0);
diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php
index 5438ea6e47f..9c4e47037c2 100644
--- a/htdocs/projet/activity/perday.php
+++ b/htdocs/projet/activity/perday.php
@@ -495,8 +495,7 @@ print '
';
$moreforfilter = '';
// Filter on categories
-/*if (!empty($conf->categorie->enabled))
-{
+/*if (isModEnabled("categorie")) {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$moreforfilter.='
';
$moreforfilter.=$langs->trans('ProjectCategories'). ': ';
diff --git a/htdocs/projet/activity/permonth.php b/htdocs/projet/activity/permonth.php
index e6226ca677c..bff135b713f 100644
--- a/htdocs/projet/activity/permonth.php
+++ b/htdocs/projet/activity/permonth.php
@@ -410,8 +410,7 @@ $moreforfilter = '';
// Filter on categories
/*
-if (!empty($conf->categorie->enabled))
-{
+if (isModEnabled("categorie")) {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$moreforfilter.='
';
$moreforfilter.=$langs->trans('ProjectCategories'). ': ';
diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php
index b3aa85e6226..1d3a6ef3c2c 100644
--- a/htdocs/projet/activity/perweek.php
+++ b/htdocs/projet/activity/perweek.php
@@ -546,8 +546,7 @@ $moreforfilter = '';
// Filter on categories
/*
- if (!empty($conf->categorie->enabled))
- {
+ if (isModEnabled("categorie")) {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$moreforfilter.='
';
$moreforfilter.=$langs->trans('ProjectCategories'). ': ';
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index 17f4d66168b..92cbda347ae 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -1006,7 +1006,7 @@ if (isModEnabled('categorie') && $user->rights->categorie->lire) {
$moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PROJECT, $search_category_array, 'minwidth300imp widthcentpercentminusx');
}
// Filter on customer categories
-if (!empty($conf->global->MAIN_SEARCH_CATEGORY_CUSTOMER_ON_PROJECT_LIST) && !empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
+if (!empty($conf->global->MAIN_SEARCH_CATEGORY_CUSTOMER_ON_PROJECT_LIST) && isModEnabled("categorie") && $user->rights->categorie->lire) {
$moreforfilter .= '
';
$tmptitle = $langs->transnoentities('CustomersProspectsCategoriesShort');
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"');
diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php
index adf86b7ac49..b922b1cbed6 100644
--- a/htdocs/projet/tasks/list.php
+++ b/htdocs/projet/tasks/list.php
@@ -806,7 +806,7 @@ $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form-
$moreforfilter .= '
';
// Filter on customer categories
-if (!empty($conf->global->MAIN_SEARCH_CATEGORY_CUSTOMER_ON_TASK_LIST) && !empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
+if (!empty($conf->global->MAIN_SEARCH_CATEGORY_CUSTOMER_ON_TASK_LIST) && isModEnabled("categorie") && $user->rights->categorie->lire) {
$moreforfilter .= '
';
$tmptitle = $langs->transnoentities('CustomersProspectsCategoriesShort');
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"');
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index cafb1ae847b..570b78f7604 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -353,7 +353,7 @@ if (empty($reshook)) {
setEventMessages($object->error, $object->errors, 'errors');
$action = "create"; // Go back to create page
} else {
- if (!empty($conf->categorie->enabled)) {
+ if (isModEnabled("categorie")) {
// Categories association
$usercats = GETPOST('usercats', 'array');
$object->setCategories($usercats);