diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php
index 3c15fc9f48f..3c3cd731a7d 100644
--- a/htdocs/admin/fckeditor.php
+++ b/htdocs/admin/fckeditor.php
@@ -63,7 +63,7 @@ $conditions = array(
'NOTE_PRIVATE' => 1,
'SOCIETE' => 1,
'PRODUCTDESC' => (isModEnabled("product") || isModEnabled("service")),
- 'DETAILS' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande') || !empty($conf->supplier_proposal->enabled) || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")),
+ 'DETAILS' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande') || isModEnabled('supplier_proposal') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")),
'USERSIGN' => 1,
'MAILING' => !empty($conf->mailing->enabled),
'MAIL' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande')),
diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php
index a60f3f407d1..f53e8c6b0d0 100644
--- a/htdocs/admin/mails_templates.php
+++ b/htdocs/admin/mails_templates.php
@@ -209,7 +209,7 @@ if (isModEnabled("reception")) {
if (!empty($conf->ficheinter->enabled)) {
$elementList['fichinter_send'] = img_picto('', 'intervention', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendIntervention'));
}
-if (!empty($conf->supplier_proposal->enabled)) {
+if (isModEnabled('supplier_proposal')) {
$elementList['supplier_proposal_send'] = img_picto('', 'propal', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendSupplierRequestForQuotation'));
}
if ((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->commande->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_order") && !empty($user->rights->supplier_order->lire))) {
@@ -218,7 +218,7 @@ if ((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->commande-
if ((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->facture->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_invoice") && !empty($user->rights->supplier_invoice->lire))) {
$elementList['invoice_supplier_send'] = img_picto('', 'bill', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendSupplierInvoice'));
}
-if (!empty($conf->contrat->enabled) && !empty($user->rights->contrat->lire)) {
+if (isModEnabled('contrat') && !empty($user->rights->contrat->lire)) {
$elementList['contract'] = img_picto('', 'contract', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendContract'));
}
if (!empty($conf->ticket->enabled) && !empty($user->rights->ticket->read)) {
diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php
index c4a8790896e..e29a351a705 100644
--- a/htdocs/admin/workflow.php
+++ b/htdocs/admin/workflow.php
@@ -123,7 +123,7 @@ $workflowcodes = array(
'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL'=>array(
'family'=>'classify_supplier_proposal',
'position'=>60,
- 'enabled'=>(!empty($conf->supplier_proposal->enabled) && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))),
+ 'enabled'=>(isModEnabled('supplier_proposal') && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))),
'picto'=>'supplier_proposal',
'warning'=>''
),
diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index 6f6ddc5383e..0d7953db900 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -1362,7 +1362,7 @@ if ($action == 'create') {
$formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200');
print '';
- if (!empty($conf->categorie->enabled)) {
+ if (isModEnabled('categorie')) {
// Categories
print '
'.$langs->trans("CustomersCategoriesShort").' ';
print '';
@@ -1122,7 +1122,7 @@ if ($object->id > 0) {
/*
* Latest contracts
*/
- if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) {
+ if (isModEnabled('contrat') && $user->rights->contrat->lire) {
$sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut as contract_status, c.datec as dc, c.date_contrat as dcon, c.ref_customer as refcus, c.ref_supplier as refsup, c.entity,";
$sql .= " c.last_main_doc, c.model_pdf";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c";
diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php
index 419f85cb28f..c2852cd45c9 100644
--- a/htdocs/comm/index.php
+++ b/htdocs/comm/index.php
@@ -93,7 +93,7 @@ $companystatic = new Societe($db);
if (isModEnabled("propal")) {
$propalstatic = new Propal($db);
}
-if (!empty($conf->supplier_proposal->enabled)) {
+if (isModEnabled('supplier_proposal')) {
$supplierproposalstatic = new SupplierProposal($db);
}
if (isModEnabled('commande')) {
@@ -226,7 +226,7 @@ if (isModEnabled("propal") && $user->rights->propal->lire) {
* Draft supplier proposals
*/
-if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) {
+if (isModEnabled('supplier_proposal') && $user->rights->supplier_proposal->lire) {
$sql = "SELECT p.rowid, p.ref, p.total_ht, p.total_tva, p.total_ttc, p.fk_statut as status";
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client";
@@ -810,7 +810,7 @@ if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERM
/*
* Latest contracts
*/
-if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) { // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT
+if (isModEnabled('contrat') && $user->rights->contrat->lire && 0) { // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT
$staticcontrat = new Contrat($db);
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php
index bd052f4161e..8f0a2b38c7d 100644
--- a/htdocs/comm/mailing/advtargetemailing.php
+++ b/htdocs/comm/mailing/advtargetemailing.php
@@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
// Load translation files required by the page
$langs->loadLangs(array('mails', 'companies'));
-if (!empty($conf->categorie->enabled)) {
+if (isModEnabled('categorie')) {
$langs->load("categories");
}
diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php
index eb1b50cee1b..ed1fa3f523e 100644
--- a/htdocs/comm/mailing/card.php
+++ b/htdocs/comm/mailing/card.php
@@ -980,7 +980,7 @@ if ($action == 'create') {
}
if (($object->statut == 0 || $object->statut == 1 || $object->statut == 2) && $user->rights->mailing->creer) {
- if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_MAILING)) {
+ if (isModEnabled('fckeditor') && !empty($conf->global->FCKEDITOR_ENABLE_MAILING)) {
print ''.$langs->trans("EditWithEditor").' ';
} else {
print ''.$langs->trans("EditWithTextEditor").' ';
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index a0b181230fa..f0e1e57249e 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -2850,7 +2850,7 @@ if ($action == 'create') {
}
// Create contract
- if (!empty($conf->contrat->enabled) && $object->statut == Propal::STATUS_SIGNED) {
+ if (isModEnabled('contrat') && $object->statut == Propal::STATUS_SIGNED) {
$langs->load("contracts");
if ($usercancreatecontract) {
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index 6b717d3ea6f..31c4489d47f 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -1057,7 +1057,7 @@ if ($resql) {
$moreforfilter .= '';
}
// If the user can view products
- 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');
@@ -1065,7 +1065,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, (empty($conf->dol_optimize_smallscreen) ? 'maxwidth300 widthcentpercentminusx' : 'maxwidth250 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/commande/card.php b/htdocs/commande/card.php
index c5b00c3c41e..507a24fd758 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -2836,7 +2836,7 @@ if ($action == 'create' && $usercancreate) {
}
// Create contract
- if (!empty($conf->contrat->enabled) && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)) {
+ if (isModEnabled('contrat') && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)) {
$langs->load("contracts");
if ($user->hasRight('contrat', 'creer')) {
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index 84dafaba2e8..7acd7c78261 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -1343,7 +1343,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');
@@ -1351,7 +1351,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/compta/facture/card.php b/htdocs/compta/facture/card.php
index f9c6f4edd3e..04c6df7ff1e 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -5511,7 +5511,7 @@ if ($action == 'create') {
// Create contract
if (!empty($conf->global->CONTRACT_CREATE_FROM_INVOICE)) {
- if (!empty($conf->contrat->enabled) && $object->statut == Facture::STATUS_VALIDATED) {
+ if (isModEnabled('contrat') && $object->statut == Facture::STATUS_VALIDATED) {
$langs->load("contracts");
if ($usercancreatecontract) {
diff --git a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php
index 2a405ba870f..28e932dcb4a 100644
--- a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php
+++ b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php
@@ -587,7 +587,7 @@ if (count($amount)) {
// Other stats
print '
';
- if (!empty($conf->supplier_proposal->enabled) && $key > 0) {
+ if (isModEnabled('supplier_proposal') && $key > 0) {
print ' '.img_picto($langs->trans("ProposalStats"), "stats").' ';
}
if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) && $key > 0) {
diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php
index a0834139bd2..c4bfc127262 100644
--- a/htdocs/contact/canvas/actions_contactcard_common.class.php
+++ b/htdocs/contact/canvas/actions_contactcard_common.class.php
@@ -201,7 +201,7 @@ abstract class ActionsContactCardCommon
$this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_propal ? $this->object->ref_propal : $langs->trans("NoContactForAnyProposal");
$i++;
}
- if (!empty($conf->contrat->enabled)) {
+ if (isModEnabled('contrat')) {
$this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForContracts");
$this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_contrat ? $this->object->ref_contrat : $langs->trans("NoContactForAnyContract");
$i++;
diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php
index d3b050e5e0b..3028a3719f1 100644
--- a/htdocs/contact/card.php
+++ b/htdocs/contact/card.php
@@ -892,7 +892,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
// Categories
- if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
+ if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) {
print ' '.$form->editfieldkey('Categories', 'contcats', '', $object, 0).' ';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_CONTACT, null, 'parent', null, null, 1);
print img_picto('', 'category').$form->multiselectarray('contcats', $cate_arbo, GETPOST('contcats', 'array'), null, null, null, null, '90%');
@@ -1197,7 +1197,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print ' ';
// Categories
- if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
+ if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) {
$arrayselected = array();
print '
'.$form->editfieldkey('Categories', 'contcats', '', $object, 0).' ';
print '';
@@ -1237,7 +1237,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print ' ';
}
- if (!empty($conf->contrat->enabled)) {
+ if (isModEnabled('contrat')) {
print '
'.$langs->trans("ContactForContracts").' ';
print $object->ref_contrat ? $object->ref_contrat : (''.$langs->trans("NoContactForAnyContract").' ');
print ' ';
@@ -1471,7 +1471,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '
';
// Categories
- if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
+ if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) {
print ''.$langs->trans("Categories").' ';
print '';
print $form->showCategories($object->id, Categorie::TYPE_CONTACT, 1);
@@ -1514,7 +1514,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print ' ';
}
- if (!empty($conf->contrat->enabled)) {
+ if (isModEnabled('contrat')) {
print ''.$langs->trans("ContactForContracts").' ';
print $object->ref_contrat ? $object->ref_contrat : $langs->trans("NoContactForAnyContract");
print ' ';
diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php
index 569a155cc99..e4cc743159e 100644
--- a/htdocs/contact/consumption.php
+++ b/htdocs/contact/consumption.php
@@ -165,7 +165,7 @@ if ($object->thirdparty->client) {
if (isModEnabled('facture') && $user->rights->facture->lire) {
$elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices');
}
- if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) {
+ if (isModEnabled('contrat') && $user->rights->contrat->lire) {
$elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts');
}
}
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index 6d66f70ceeb..ec56b4f7c2a 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -734,7 +734,7 @@ if ($search_firstlast_only) {
}
$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('ContactCategoriesShort');
diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php
index 62b60d9a091..d537934a299 100644
--- a/htdocs/contrat/index.php
+++ b/htdocs/contrat/index.php
@@ -239,7 +239,7 @@ print "
";
// Draft contracts
-if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) {
+if (isModEnabled('contrat') && $user->rights->contrat->lire) {
$sql = "SELECT c.rowid, c.ref,";
$sql .= " s.nom as name, s.rowid as socid";
$sql .= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe as s";
diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php
index 5ceec0a4cb9..0630f664b8d 100644
--- a/htdocs/contrat/list.php
+++ b/htdocs/contrat/list.php
@@ -571,7 +571,7 @@ if ($user->rights->user->user->lire) {
$moreforfilter .= '';
}
// If the user can view categories of products
-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');
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 2c438fdd98c..a16881cd61e 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -6902,7 +6902,7 @@ abstract class CommonObject
} elseif (preg_match('/^html/', $type)) {
if (!preg_match('/search_/', $keyprefix)) { // If keyprefix is search_ or search_options_, we must just use a simple text field
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
- $doleditor = new DolEditor($keyprefix.$key.$keysuffix, $value, '', 200, 'dolibarr_notes', 'In', false, false, !empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, '90%');
+ $doleditor = new DolEditor($keyprefix.$key.$keysuffix, $value, '', 200, 'dolibarr_notes', 'In', false, false, isModEnabled('fckeditor') && $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, '90%');
$out = $doleditor->Create(1, '', true, '', '', $moreparam, $morecss);
} else {
$out = ' ';
diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php
index 2be0c36c56c..b529d23ebda 100644
--- a/htdocs/core/class/doleditor.class.php
+++ b/htdocs/core/class/doleditor.class.php
@@ -152,7 +152,7 @@ class DolEditor
$out .= htmlspecialchars($this->content);
$out .= '';
- if ($this->tool == 'ckeditor' && !empty($conf->use_javascript_ajax) && !empty($conf->fckeditor->enabled)) {
+ if ($this->tool == 'ckeditor' && !empty($conf->use_javascript_ajax) && isModEnabled('fckeditor')) {
if (!defined('REQUIRE_CKEDITOR')) {
define('REQUIRE_CKEDITOR', '1');
}
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index bbc5e8604ce..cea529726e5 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -1098,7 +1098,7 @@ class ExtraFields
} elseif ($type == 'html') {
if (!preg_match('/search_/', $keyprefix)) { // If keyprefix is search_ or search_options_, we must just use a simple text field
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
- $doleditor = new DolEditor($keyprefix.$key.$keysuffix, $value, '', 200, 'dolibarr_notes', 'In', false, false, !empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, '90%');
+ $doleditor = new DolEditor($keyprefix.$key.$keysuffix, $value, '', 200, 'dolibarr_notes', 'In', false, false, isModEnabled('fckeditor') && $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, '90%');
$out = $doleditor->Create(1);
} else {
$out = ' ';
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index c2f17314c81..1ecd05cc3a5 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -529,7 +529,7 @@ class Form
$savemethod = $tmp[4];
}
- if (!empty($conf->fckeditor->enabled)) {
+ if (isModEnabled('fckeditor')) {
$out .= ' '."\n";
} else {
$inputType = 'textarea';
@@ -8721,7 +8721,7 @@ class Form
'label'=>'LinkToIntervention',
'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('intervention').')'),
'supplier_proposal'=>array(
- 'enabled'=>(!empty($conf->supplier_proposal->enabled) ? $conf->supplier_proposal->enabled : 0),
+ 'enabled'=>(isModEnabled('supplier_proposal') ? $conf->supplier_proposal->enabled : 0),
'perms'=>1,
'label'=>'LinkToSupplierProposal',
'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('supplier_proposal').')'),
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index 0c5aa54b5ca..80e69a39532 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -1642,7 +1642,7 @@ class FormMail extends Form
if (isModEnabled('commande')) {
$tmparray['__SECUREKEYPAYMENT_ORDER__'] = 'SecureKeyPAYMENTUniquePerOrder';
}
- if (!empty($conf->contrat->enabled)) {
+ if (isModEnabled('contrat')) {
$tmparray['__SECUREKEYPAYMENT_CONTRACTLINE__'] = 'SecureKeyPAYMENTUniquePerContractLine';
}
@@ -1659,7 +1659,7 @@ class FormMail extends Form
if (isModEnabled('commande')) {
$tmparray['__ONLINEPAYMENTLINK_ORDER__'] = 'OnlinePaymentLinkUniquePerOrder';
}
- if (!empty($conf->contrat->enabled)) {
+ if (isModEnabled('contrat')) {
$tmparray['__ONLINEPAYMENTLINK_CONTRACTLINE__'] = 'OnlinePaymentLinkUniquePerContractLine';
}
}
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index 6ba3ca18094..9b1c46d7c53 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 ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_proposal->enabled) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
+ if ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_proposal') || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
$supplier_module_enabled = 1;
}
if ($supplier_module_enabled == 1 && $object->fournisseur && !empty($user->rights->fournisseur->lire)) {
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index a0e57c173c8..dcecd69769b 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -7405,7 +7405,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
/*$substitutionarray['__PROJECT_NOTE_PUBLIC__'] = '__PROJECT_NOTE_PUBLIC__';
$substitutionarray['__PROJECT_NOTE_PRIVATE__'] = '__PROJECT_NOTE_PRIVATE__';*/
}
- if (!empty($conf->contrat->enabled) && (!is_object($object) || $object->element == 'contract')) {
+ if (isModEnabled('contrat') && (!is_object($object) || $object->element == 'contract')) {
$substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATE__'] = 'Highest date planned for a service start';
$substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATETIME__'] = 'Highest date and hour planned for service start';
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATE__'] = 'Lowest data for planned expiration of service';
diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php
index ca9bfcfe0e4..91e0b382b44 100644
--- a/htdocs/core/lib/pdf.lib.php
+++ b/htdocs/core/lib/pdf.lib.php
@@ -1605,7 +1605,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
$libelleproduitservice = $prefix_prodserv.$ref_prodserv.$libelleproduitservice;
// Add an additional description for the category products
- if (!empty($conf->global->CATEGORY_ADD_DESC_INTO_DOC) && $idprod && !empty($conf->categorie->enabled)) {
+ if (!empty($conf->global->CATEGORY_ADD_DESC_INTO_DOC) && $idprod && isModEnabled('categorie')) {
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$categstatic = new Categorie($db);
// recovering the list of all the categories linked to product
diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php
index 710b2462afa..56cb195060b 100644
--- a/htdocs/core/lib/product.lib.php
+++ b/htdocs/core/lib/product.lib.php
@@ -398,7 +398,7 @@ function show_stats_for_company($product, $socid)
print '
';
}
// Supplier proposals
- if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) {
+ if (isModEnabled('supplier_proposal') && $user->rights->supplier_proposal->lire) {
$nblines++;
$ret = $product->load_stats_proposal_supplier($socid);
if ($ret < 0) {
@@ -513,7 +513,7 @@ function show_stats_for_company($product, $socid)
}
// Contracts
- if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) {
+ if (isModEnabled('contrat') && $user->rights->contrat->lire) {
$nblines++;
$ret = $product->load_stats_contrat($socid);
if ($ret < 0) {
diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php
index ba71d22b7f8..3d0ab7f083d 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -126,7 +126,7 @@ function project_prepare_head(Project $project, $moreparam = '')
if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))
|| isModEnabled("propal") || isModEnabled('commande')
- || isModEnabled('facture') || !empty($conf->contrat->enabled)
+ || isModEnabled('facture') || isModEnabled('contrat')
|| !empty($conf->ficheinter->enabled) || isModEnabled('agenda') || isModEnabled('deplacement') || !empty($conf->stock->enabled)) {
$nbElements = 0;
// Enable caching of thirdrparty count Contacts
@@ -150,7 +150,7 @@ function project_prepare_head(Project $project, $moreparam = '')
if (isModEnabled('facture')) {
$nbElements += $project->getElementCount('invoice_predefined', 'facture_rec');
}
- if (!empty($conf->supplier_proposal->enabled)) {
+ if (isModEnabled('supplier_proposal')) {
$nbElements += $project->getElementCount('proposal_supplier', 'supplier_proposal');
}
if (isModEnabled("supplier_order")) {
@@ -159,7 +159,7 @@ function project_prepare_head(Project $project, $moreparam = '')
if (isModEnabled("supplier_invoice")) {
$nbElements += $project->getElementCount('invoice_supplier', 'facture_fourn');
}
- if (!empty($conf->contrat->enabled)) {
+ if (isModEnabled('contrat')) {
$nbElements += $project->getElementCount('contract', 'contrat');
}
if (!empty($conf->ficheinter->enabled)) {
diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
index beec387020a..29050c6b780 100644
--- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
+++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
@@ -55,7 +55,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
}
-if (!empty($conf->contrat->enabled)) {
+if (isModEnabled('contrat')) {
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
}
if (!empty($conf->ficheinter->enabled)) {
diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
index 07bd3ee03ab..35f00912143 100644
--- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
+++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
@@ -56,7 +56,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
}
-if (!empty($conf->contrat->enabled)) {
+if (isModEnabled('contrat')) {
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
}
if (!empty($conf->ficheinter->enabled)) {
diff --git a/htdocs/core/tpl/advtarget.tpl.php b/htdocs/core/tpl/advtarget.tpl.php
index 86292ec0ff4..07595012466 100644
--- a/htdocs/core/tpl/advtarget.tpl.php
+++ b/htdocs/core/tpl/advtarget.tpl.php
@@ -15,7 +15,7 @@
* along with this program. If not, see '.$langs->trans("ContactCategoriesShort");
if (!empty($array_query['contact_categ'])) {
diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php
index e0f0c5d9142..1110e91b019 100644
--- a/htdocs/core/tpl/notes.tpl.php
+++ b/htdocs/core/tpl/notes.tpl.php
@@ -94,17 +94,17 @@ if ($module == 'propal') {
}
//else dol_print_error('','Bad value '.$module.' for param module');
-if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) {
+if (isModEnabled('fckeditor') && !empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) {
$typeofdata = 'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; // Rem: This var is for all notes, not only thirdparties note.
} else {
$typeofdata = 'textarea:12:95%';
}
-if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC)) {
+if (isModEnabled('fckeditor') && !empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC)) {
$typeofdatapub = 'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; // Rem: This var is for all notes, not only thirdparties note.
} else {
$typeofdatapub = 'textarea:12:95%';
}
-if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE)) {
+if (isModEnabled('fckeditor') && !empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE)) {
$typeofdatapriv = 'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; // Rem: This var is for all notes, not only thirdparties note.
} else {
$typeofdatapriv = 'textarea:12:95%';
diff --git a/htdocs/core/tpl/onlinepaymentlinks.tpl.php b/htdocs/core/tpl/onlinepaymentlinks.tpl.php
index 1615dbe87ed..611c556d98c 100644
--- a/htdocs/core/tpl/onlinepaymentlinks.tpl.php
+++ b/htdocs/core/tpl/onlinepaymentlinks.tpl.php
@@ -74,7 +74,7 @@ if (isModEnabled('facture')) {
}
print ' ';
}
-if (!empty($conf->contrat->enabled)) {
+if (isModEnabled('contrat')) {
print '
';
print img_picto('', 'globe').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnContractLine", $servicename).': ';
print ''.getOnlinePaymentUrl(1, 'contractline')." \n";
diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php
index 49f2873f472..73312ec52cf 100644
--- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php
+++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php
@@ -222,7 +222,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
}
// Secondly, we set to linked Proposal to "Billed" if WORKFLOW_INVOICE_CLASSIFY_BILLED_SUPPLIER_PROPOSAL is set.
- if (!empty($conf->supplier_proposal->enabled) && !empty($conf->global->WORKFLOW_INVOICE_CLASSIFY_BILLED_SUPPLIER_PROPOSAL)) {
+ if (isModEnabled('supplier_proposal') && !empty($conf->global->WORKFLOW_INVOICE_CLASSIFY_BILLED_SUPPLIER_PROPOSAL)) {
$object->fetchObjectLinked('', 'supplier_proposal', $object->id, $object->element);
if (!empty($object->linkedObjects)) {
$totalonlinkedelements = 0;
diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php
index c7a4a570a5c..70e22db92a2 100644
--- a/htdocs/ecm/index_auto.php
+++ b/htdocs/ecm/index_auto.php
@@ -319,7 +319,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
if (isModEnabled("propal")) {
$rowspan++; $sectionauto[] = array('position'=>30, 'level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals")));
}
- if (!empty($conf->contrat->enabled)) {
+ if (isModEnabled('contrat')) {
$rowspan++; $sectionauto[] = array('position'=>40, 'level'=>1, 'module'=>'contract', 'test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts")));
}
if (isModEnabled('commande')) {
@@ -328,7 +328,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
if (isModEnabled('facture')) {
$rowspan++; $sectionauto[] = array('position'=>60, 'level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices")));
}
- if (!empty($conf->supplier_proposal->enabled)) {
+ if (isModEnabled('supplier_proposal')) {
$langs->load("supplier_proposal");
$rowspan++; $sectionauto[] = array('position'=>70, 'level'=>1, 'module'=>'supplier_proposal', 'test'=>$conf->supplier_proposal->enabled, 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals")));
}
diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php
index ac986ad00f4..bb22566ef1e 100644
--- a/htdocs/ecm/search.php
+++ b/htdocs/ecm/search.php
@@ -122,7 +122,7 @@ if (isModEnabled("societe")) {
if (isModEnabled("propal")) {
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals")));
}
-if (!empty($conf->contrat->enabled)) {
+if (isModEnabled('contrat')) {
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'contract', 'test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts")));
}
if (isModEnabled('commande')) {
@@ -131,7 +131,7 @@ if (isModEnabled('commande')) {
if (isModEnabled('facture')) {
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices")));
}
-if (!empty($conf->supplier_proposal->enabled)) {
+if (isModEnabled('supplier_proposal')) {
$langs->load("supplier_proposal"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'supplier_proposal', 'test'=>$conf->supplier_proposal->enabled, 'label'=>$langs->trans("SupplierProposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SupplierProposals")));
}
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) {
diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php
index adc80e27b64..b693800e253 100644
--- a/htdocs/expedition/list.php
+++ b/htdocs/expedition/list.php
@@ -577,7 +577,7 @@ if ($user->rights->user->user->lire) {
$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');
@@ -588,7 +588,7 @@ if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($use
$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/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php
index 3f644b074bd..3d10693d4e1 100644
--- a/htdocs/fichinter/card-rec.php
+++ b/htdocs/fichinter/card-rec.php
@@ -41,7 +41,7 @@ if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
-if (!empty($conf->contrat->enabled)) {
+if (isModEnabled('contrat')) {
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcontract.class.php';
}
@@ -241,7 +241,7 @@ llxHeader('', $langs->trans("RepeatableIntervention"), $help_url);
$form = new Form($db);
$companystatic = new Societe($db);
-if (!empty($conf->contrat->enabled)) {
+if (isModEnabled('contrat')) {
$contratstatic = new Contrat($db);
}
if (!empty($conf->project->enabled)) {
@@ -275,7 +275,7 @@ if ($action == 'create') {
if (!empty($conf->project->enabled) && $object->fk_project > 0) {
$rowspan++;
}
- if (!empty($conf->contrat->enabled) && $object->fk_contrat > 0) {
+ if (isModEnabled('contrat') && $object->fk_contrat > 0) {
$rowspan++;
}
@@ -328,7 +328,7 @@ if ($action == 'create') {
}
// Contrat
- if (!empty($conf->contrat->enabled)) {
+ if (isModEnabled('contrat')) {
$formcontract = new FormContract($db);
print "
".$langs->trans("Contract")." ";
$contractid = GETPOST('contractid') ?GETPOST('contractid') : $object->fk_contract;
@@ -539,7 +539,7 @@ if ($action == 'create') {
print ' '.$langs->trans("Description").' '.nl2br($object->description)." ";
// Contract
- if (!empty($conf->contrat->enabled)) {
+ if (isModEnabled('contrat')) {
$langs->load('contracts');
print '
';
print '';
@@ -800,7 +800,7 @@ if ($action == 'create') {
print ' ';
print_liste_field_titre("Ref", $_SERVER['PHP_SELF'], "f.titre", "", "", 'width="200px"', $sortfield, $sortorder, 'left ');
print_liste_field_titre("Company", $_SERVER['PHP_SELF'], "s.nom", "", "", 'width="200px"', $sortfield, $sortorder, 'left ');
- if (!empty($conf->contrat->enabled)) {
+ if (isModEnabled('contrat')) {
print_liste_field_titre("Contract", $_SERVER['PHP_SELF'], "f.fk_contrat", "", "", 'width="100px"', $sortfield, $sortorder, 'left ');
}
if (!empty($conf->project->enabled)) {
@@ -834,7 +834,7 @@ if ($action == 'create') {
print ''.$langs->trans("None").' ';
}
- if (!empty($conf->contrat->enabled)) {
+ if (isModEnabled('contrat')) {
print '';
if ($objp->fk_contrat > 0) {
$contratstatic->fetch($objp->fk_contrat);
diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php
index e2d03790f78..1c83726f7e6 100644
--- a/htdocs/fichinter/card.php
+++ b/htdocs/fichinter/card.php
@@ -784,7 +784,7 @@ if (empty($reshook)) {
$form = new Form($db);
$formfile = new FormFile($db);
-if (!empty($conf->contrat->enabled)) {
+if (isModEnabled('contrat')) {
$formcontract = new FormContract($db);
}
if (!empty($conf->project->enabled)) {
@@ -1233,7 +1233,7 @@ if ($action == 'create') {
print ' ';
// Contract
- if (!empty($conf->contrat->enabled)) {
+ if (isModEnabled('contrat')) {
$langs->load('contracts');
print '
';
print '';
diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php
index d8bb62f6b5d..52af477741d 100644
--- a/htdocs/fichinter/list.php
+++ b/htdocs/fichinter/list.php
@@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
-if (!empty($conf->contrat->enabled)) {
+if (isModEnabled('contrat')) {
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
}
@@ -46,7 +46,7 @@ $langs->loadLangs(array('companies', 'bills', 'interventions'));
if (!empty($conf->project->enabled)) {
$langs->load("projects");
}
-if (!empty($conf->contrat->enabled)) {
+if (isModEnabled('contrat')) {
$langs->load("contracts");
}
@@ -205,7 +205,7 @@ $companystatic = new Societe($db);
if (!empty($conf->project->enabled)) {
$projetstatic = new Project($db);
}
-if (!empty($conf->contrat->enabled)) {
+if (isModEnabled('contrat')) {
$contratstatic = new Contrat($db);
}
@@ -237,7 +237,7 @@ $sql .= " s.nom as name, s.rowid as socid, s.client, s.fournisseur, s.email, s.s
if (!empty($conf->project->enabled)) {
$sql .= ", pr.rowid as projet_id, pr.ref as projet_ref, pr.title as projet_title";
}
-if (!empty($conf->contrat->enabled)) {
+if (isModEnabled('contrat')) {
$sql .= ", c.rowid as contrat_id, c.ref as contrat_ref, c.ref_customer as contrat_ref_customer, c.ref_supplier as contrat_ref_supplier";
}
// Add fields from extrafields
@@ -254,7 +254,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f";
if (!empty($conf->project->enabled)) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as pr on f.fk_projet = pr.rowid";
}
-if (!empty($conf->contrat->enabled)) {
+if (isModEnabled('contrat')) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."contrat as c on f.fk_contrat = c.rowid";
}
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php
index 9d5c5b70fe4..9a7a3d7dcc0 100644
--- a/htdocs/fourn/card.php
+++ b/htdocs/fourn/card.php
@@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
if (isModEnabled('adherent')) {
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
}
-if (!empty($conf->categorie->enabled)) {
+if (isModEnabled('categorie')) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
}
@@ -340,7 +340,7 @@ if ($object->id > 0) {
}
// Categories
- if (!empty($conf->categorie->enabled)) {
+ if (isModEnabled('categorie')) {
$langs->load("categories");
print ' '.$langs->trans("SuppliersCategoriesShort").' ';
print '';
@@ -387,7 +387,7 @@ if ($object->id > 0) {
$boxstat .= '';
$boxstat .= '';
- if (!empty($conf->supplier_proposal->enabled)) {
+ if (isModEnabled('supplier_proposal')) {
// Box proposals
$tmp = $object->getOutstandingProposals('supplier');
$outstandingOpened = $tmp['opened'];
@@ -842,7 +842,7 @@ if ($object->id > 0) {
print dolGetButtonAction($langs->trans('ThirdPartyIsClosed'), $langs->trans('ThirdPartyIsClosed'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
}
- if (!empty($conf->supplier_proposal->enabled) && !empty($user->rights->supplier_proposal->creer)) {
+ if (isModEnabled('supplier_proposal') && !empty($user->rights->supplier_proposal->creer)) {
$langs->load("supplier_proposal");
if ($object->status == 1) {
print dolGetButtonAction('', $langs->trans('AddSupplierProposal'), 'default', DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&socid='.$object->id, '');
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index 67ec98e3c96..769d8c451da 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
-if (!empty($conf->supplier_proposal->enabled)) {
+if (isModEnabled('supplier_proposal')) {
require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
}
if (isModEnabled("product")) {
diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php
index 5676cd4aae3..c6401b0a70a 100644
--- a/htdocs/fourn/commande/list.php
+++ b/htdocs/fourn/commande/list.php
@@ -1227,7 +1227,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');
diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php
index 47e6786f2f0..e7f1785cb95 100644
--- a/htdocs/fourn/facture/list.php
+++ b/htdocs/fourn/facture/list.php
@@ -900,7 +900,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');
@@ -909,7 +909,7 @@ if ($resql) {
$moreforfilter .= '
';
}
- if (!empty($conf->categorie->enabled)) {
+ if (isModEnabled('categorie')) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '';
$tmptitle = $langs->trans('SuppliersCategoriesShort');
diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php
index 66b7b0ca160..8da0dd34b92 100644
--- a/htdocs/knowledgemanagement/knowledgerecord_card.php
+++ b/htdocs/knowledgemanagement/knowledgerecord_card.php
@@ -189,7 +189,7 @@ if ($action == 'create') {
// Common attributes
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
- if (!empty($conf->categorie->enabled)) {
+ if (isModEnabled('categorie')) {
$cate_arbo = $form->select_all_categories(Categorie::TYPE_KNOWLEDGEMANAGEMENT, '', 'parent', 64, 0, 1);
if (count($cate_arbo)) {
@@ -236,7 +236,7 @@ if (($id || $ref) && $action == 'edit') {
// Common attributes
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
- if (!empty($conf->categorie->enabled)) {
+ if (isModEnabled('categorie')) {
$cate_arbo = $form->select_all_categories(Categorie::TYPE_KNOWLEDGEMANAGEMENT, '', 'parent', 64, 0, 1);
if (count($cate_arbo)) {
diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php
index 18ec0d67738..ff28b79a4ad 100644
--- a/htdocs/knowledgemanagement/knowledgerecord_list.php
+++ b/htdocs/knowledgemanagement/knowledgerecord_list.php
@@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/class/knowledgerecord.class.php';
// for other modules
-if (!empty($conf->categorie->enabled)) {
+if (isModEnabled('categorie')) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
}
//dol_include_once('/othermodule/class/otherobject.class.php');
@@ -475,7 +475,7 @@ $moreforfilter.= '
';*/
// Filter on categories
$moreforfilter = '';
-if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
+if (isModEnabled('categorie') && $user->rights->categorie->lire) {
$moreforfilter .= '';
$moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"');
$categoriesKnowledgeArr = $form->select_all_categories(Categorie::TYPE_KNOWLEDGEMANAGEMENT, '', '', 64, 0, 1);
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 989e856b690..a2098b11a8f 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -2481,7 +2481,7 @@ function printDropdownQuickadd()
"title" => "NewContractSubscription@contracts",
"name" => "Contract@contracts",
"picto" => "object_contract",
- "activation" => !empty($conf->contrat->enabled) && $user->hasRight("contrat", "write"), // vs hooking
+ "activation" => isModEnabled('contrat') && $user->hasRight("contrat", "write"), // vs hooking
"position" => 60,
),
array(
@@ -2489,7 +2489,7 @@ function printDropdownQuickadd()
"title" => "SupplierProposalNew@supplier_proposal",
"name" => "SupplierProposal@supplier_proposal",
"picto" => "supplier_proposal",
- "activation" => !empty($conf->supplier_proposal->enabled) && $user->hasRight("supplier_invoice", "write"), // vs hooking
+ "activation" => isModEnabled('supplier_proposal') && $user->hasRight("supplier_invoice", "write"), // vs hooking
"position" => 70,
),
array(
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index d9b943fb40f..fd107c06351 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -1615,7 +1615,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print "
";
//}
- if (!empty($conf->categorie->enabled)) {
+ if (isModEnabled('categorie')) {
// Categories
print ''.$langs->trans("Categories").' ';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 64, 0, 1);
diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php
index e6a3b3171bc..3018312cd0e 100644
--- a/htdocs/product/composition/card.php
+++ b/htdocs/product/composition/card.php
@@ -179,7 +179,7 @@ if ($action == 'search') {
}
$sql .= natural_search($params, $key);
}
- if (!empty($conf->categorie->enabled) && !empty($parent) && $parent != -1) {
+ if (isModEnabled('categorie') && !empty($parent) && $parent != -1) {
$sql .= " AND cp.fk_categorie ='".$db->escape($parent)."'";
}
$sql .= " ORDER BY p.ref ASC";
@@ -590,7 +590,7 @@ if ($id > 0 || !empty($ref)) {
print ' ';
$rowspan = 1;
- if (!empty($conf->categorie->enabled)) {
+ if (isModEnabled('categorie')) {
$rowspan++;
}
@@ -603,7 +603,7 @@ if ($id > 0 || !empty($ref)) {
print $langs->trans("KeywordFilter").': ';
print ' ';
print '';
- if (!empty($conf->categorie->enabled)) {
+ if (isModEnabled('categorie')) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
print ''.$langs->trans("CategoryFilter").': ';
print $form->select_all_categories(Categorie::TYPE_PRODUCT, $parent, 'parent').'
';
diff --git a/htdocs/product/index.php b/htdocs/product/index.php
index e976e176224..4e90371a3f4 100644
--- a/htdocs/product/index.php
+++ b/htdocs/product/index.php
@@ -215,7 +215,7 @@ if ((isModEnabled("product") || isModEnabled("service")) && ($user->rights->prod
}
-if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTATS_ON_PRODUCTS)) {
+if (isModEnabled('categorie') && !empty($conf->global->CATEGORY_GRAPHSTATS_ON_PRODUCTS)) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
print ' ';
print '';
diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php
index 553f4ed8baa..00f440f1990 100644
--- a/htdocs/product/inventory/list.php
+++ b/htdocs/product/inventory/list.php
@@ -27,7 +27,7 @@ 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';
require_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php';
-if (!empty($conf->categorie->enabled)) {
+if (isModEnabled('categorie')) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
}
@@ -464,7 +464,7 @@ $moreforfilter.= $langs->trans('MyFilter') . ':
';
$tmptitle = $langs->transnoentities('ProductsCategoriesShort');
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"');
diff --git a/htdocs/product/list.php b/htdocs/product/list.php
index dcea4f4b8f7..6028a0a871d 100644
--- a/htdocs/product/list.php
+++ b/htdocs/product/list.php
@@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
-if (!empty($conf->categorie->enabled)) {
+if (isModEnabled('categorie')) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
}
@@ -820,7 +820,7 @@ if ($resql) {
// Filter on categories
$moreforfilter = '';
- if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
+ if (isModEnabled('categorie') && $user->rights->categorie->lire) {
$moreforfilter .= '
';
$moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"');
$categoriesProductArr = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', '', 64, 0, 1);
diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php
index 10e70545af6..5585b8221a2 100644
--- a/htdocs/product/reassort.php
+++ b/htdocs/product/reassort.php
@@ -328,7 +328,7 @@ if ($resql) {
// Filter on categories
$moreforfilter = '';
- if (!empty($conf->categorie->enabled)) {
+ if (isModEnabled('categorie')) {
$moreforfilter .= '
';
$moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"');
$moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ', 1);
diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php
index a39dc246772..14d9815361d 100644
--- a/htdocs/product/reassortlot.php
+++ b/htdocs/product/reassortlot.php
@@ -481,7 +481,7 @@ if ($search_categ > 0) {
// Filter on categories
$moreforfilter = '';
-if (!empty($conf->categorie->enabled)) {
+if (isModEnabled('categorie')) {
$moreforfilter .= '
';
$moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"');
$moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ', 1);
diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php
index b4730778d32..43fb04b1ad3 100644
--- a/htdocs/product/stock/card.php
+++ b/htdocs/product/stock/card.php
@@ -378,7 +378,7 @@ if ($action == 'create') {
// Other attributes
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
- if (!empty($conf->categorie->enabled)) {
+ if (isModEnabled('categorie')) {
// Categories
print '
'.$langs->trans("Categories").' ';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_WAREHOUSE, '', 'parent', 64, 0, 1);
diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php
index cc94ae303ec..f182cf1847b 100644
--- a/htdocs/product/stock/list.php
+++ b/htdocs/product/stock/list.php
@@ -28,7 +28,7 @@
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
-if (!empty($conf->categorie->enabled)) {
+if (isModEnabled('categorie')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
}
@@ -53,7 +53,7 @@ $search_ref = GETPOST("sref", "alpha") ?GETPOST("sref", "alpha") : GETPOST("sear
$search_label = GETPOST("snom", "alpha") ?GETPOST("snom", "alpha") : GETPOST("search_label", "alpha");
$search_status = GETPOST("search_status", "int");
-if (!empty($conf->categorie->enabled)) {
+if (isModEnabled('categorie')) {
$search_category_list = GETPOST("search_category_".Categorie::TYPE_WAREHOUSE."_list", "array");
}
@@ -226,7 +226,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $obje
$sql .= $hookmanager->resPrint;
$sql = preg_replace('/,\s*$/', '', $sql);
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
-if (!empty($conf->categorie->enabled)) {
+if (isModEnabled('categorie')) {
$sql .= Categorie::getFilterJoinQuery(Categorie::TYPE_WAREHOUSE, "t.rowid");
}
if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
@@ -242,7 +242,7 @@ if ($separatedPMP) {
$sql .= " WHERE t.entity IN (".getEntity('stock').")";
-if (!empty($conf->categorie->enabled)) {
+if (isModEnabled('categorie')) {
$sql .= Categorie::getFilterSelectQuery(Categorie::TYPE_WAREHOUSE, "t.rowid", $search_category_list);
}
foreach ($search as $key => $val) {
@@ -419,7 +419,7 @@ if ($search_all) {
$moreforfilter = '';
-if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
+if (isModEnabled('categorie') && $user->rights->categorie->lire) {
$formcategory = new FormCategory($db);
$moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_WAREHOUSE, $search_category_list);
}
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index bc182efa3f2..8008ed4780f 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -714,7 +714,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
$doleditor->Create();
print ' ';
- if (!empty($conf->categorie->enabled)) {
+ if (isModEnabled('categorie')) {
// Categories
print '
'.$langs->trans("Categories").' ';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT, '', 'parent', 64, 0, 1);
@@ -1356,7 +1356,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
$langs->load("bills");
print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true));
}
- if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->creer) {
+ if (isModEnabled('supplier_proposal') && $user->rights->supplier_proposal->creer) {
$langs->load("supplier_proposal");
print dolGetButtonAction('', $langs->trans('AddSupplierProposal'), 'default', DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true));
}
@@ -1372,7 +1372,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
$langs->load("interventions");
print dolGetButtonAction('', $langs->trans('AddIntervention'), 'default', DOL_URL_ROOT.'/fichinter/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true));
}
- if (!empty($conf->contrat->enabled) && $user->rights->contrat->creer) {
+ if (isModEnabled('contrat') && $user->rights->contrat->creer) {
$langs->load("contracts");
print dolGetButtonAction('', $langs->trans('AddContract'), 'default', DOL_URL_ROOT.'/contrat/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', 1, array('isDropDown' => true));
}
diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php
index 57583a538fb..cf5c8fbde86 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -49,7 +49,7 @@ if (isModEnabled('facture')) {
if (isModEnabled('commande')) {
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
}
-if (!empty($conf->supplier_proposal->enabled)) {
+if (isModEnabled('supplier_proposal')) {
require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
}
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_invoice")) {
@@ -58,7 +58,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
}
-if (!empty($conf->contrat->enabled)) {
+if (isModEnabled('contrat')) {
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
}
if (!empty($conf->ficheinter->enabled)) {
@@ -95,7 +95,7 @@ if (isModEnabled("banque")) {
if (!empty($conf->salaries->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php';
}
-if (!empty($conf->categorie->enabled)) {
+if (isModEnabled('categorie')) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
}
if (!empty($conf->mrp->enabled)) {
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index 7cfb66288e1..7deaf0a1870 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
-if (!empty($conf->categorie->enabled)) {
+if (isModEnabled('categorie')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
}
@@ -148,7 +148,7 @@ if ($search_status == '') {
$search_status = -1; // -1 or 1
}
-if (!empty($conf->categorie->enabled)) {
+if (isModEnabled('categorie')) {
$search_category_array = GETPOST("search_category_".Categorie::TYPE_PROJECT."_list", "array");
}
@@ -413,7 +413,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $obje
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
$sql = preg_replace('/,\s*$/', '', $sql);
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as p";
-if (!empty($conf->categorie->enabled)) {
+if (isModEnabled('categorie')) {
$sql .= Categorie::getFilterJoinQuery(Categorie::TYPE_PROJECT, "p.rowid");
}
if (!empty($extrafields->attributes[$object->table_element]['label']) &&is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
@@ -436,7 +436,7 @@ if ($search_project_contact > 0) {
$sql .= ", ".MAIN_DB_PREFIX."element_contact as ecp_contact";
}
$sql .= " WHERE p.entity IN (".getEntity('project').')';
-if (!empty($conf->categorie->enabled)) {
+if (isModEnabled('categorie')) {
$sql .= Categorie::getFilterSelectQuery(Categorie::TYPE_PROJECT, "p.rowid", $search_category_array);
}
if (empty($user->rights->projet->all->lire)) {
@@ -859,7 +859,7 @@ if ($user->rights->user->user->lire) {
}
// Filter on categories
-if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
+if (isModEnabled('categorie') && $user->rights->categorie->lire) {
$formcategory = new FormCategory($db);
$moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PROJECT, $search_category_array);
}
diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php
index 018cb5c3408..de9bdf7855c 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
-if (!empty($conf->categorie->enabled)) {
+if (isModEnabled('categorie')) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
}
diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php
index 5a91f47dbd9..a25b44082a0 100644
--- a/htdocs/projet/tasks/list.php
+++ b/htdocs/projet/tasks/list.php
@@ -671,7 +671,7 @@ if ($search_all) {
$moreforfilter = '';
// Filter on categories
-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('ProjectCategories');
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index d803162afc4..c1152510cca 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -542,7 +542,7 @@ if ($action == 'confirm_generateinvoice') {
$arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm;
$arrayoftasks[$object->timespent_id]['note'] = $ftask->ref.' - '.$ftask->label.' - '.$username.($object->timespent_note ? ' - '.$object->timespent_note : ''); // TODO Add user name in note
if (!empty($withdetail)) {
- if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_DETAILS)) {
+ if (isModEnabled('fckeditor') && !empty($conf->global->FCKEDITOR_ENABLE_DETAILS)) {
$arrayoftasks[$object->timespent_id]['note'] .= " ";
} else {
$arrayoftasks[$object->timespent_id]['note'] .= "\n";
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index 331fb58ae9c..2467d9959bc 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -71,7 +71,7 @@ $langs->loadLangs(array("companies", "commercial", "bills", "banks", "users"));
if (isModEnabled('adherent')) {
$langs->load("members");
}
-if (!empty($conf->categorie->enabled)) {
+if (isModEnabled('categorie')) {
$langs->load("categories");
}
if (!empty($conf->incoterm->enabled)) {
@@ -1477,7 +1477,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '
';
if ((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_order") && !empty($user->rights->supplier_order->lire)) || (isModEnabled("supplier_invoice") && !empty($user->rights->supplier_invoice->lire))
- || (!empty($conf->supplier_proposal->enabled) && !empty($user->rights->supplier_proposal->lire))) {
+ || (isModEnabled('supplier_proposal') && !empty($user->rights->supplier_proposal->lire))) {
// Supplier
print '
';
print ''.$form->editfieldkey('Vendor', 'fournisseur', '', $object, 0, 'string', '', 1).' ';
@@ -1762,7 +1762,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
// Categories
- if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
+ if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) {
$langs->load('categories');
// Customer
@@ -2177,7 +2177,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Supplier
if (((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_order") && !empty($user->rights->supplier_order->lire)) || (isModEnabled("supplier_invoice") && !empty($user->rights->supplier_invoice->lire)))
- || (!empty($conf->supplier_proposal->enabled) && !empty($user->rights->supplier_proposal->lire))) {
+ || (isModEnabled('supplier_proposal') && !empty($user->rights->supplier_proposal->lire))) {
print ' ';
print ''.$form->editfieldkey('Supplier', 'fournisseur', '', $object, 0, 'string', '', 1).' ';
print '';
@@ -2463,7 +2463,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
// Categories
- if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
+ if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) {
// Customer
print ' '.$form->editfieldkey('CustomersCategoriesShort', 'custcats', '', $object, 0).' ';
print '';
@@ -2888,7 +2888,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)) {
// Customer
if ($object->prospect || $object->client || !empty($conf->global->THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT)) {
print ''.$langs->trans("CustomersCategoriesShort").' ';
diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php
index a8f250f29d5..58f568b6f6a 100644
--- a/htdocs/societe/consumption.php
+++ b/htdocs/societe/consumption.php
@@ -176,7 +176,7 @@ if ($object->client) {
if (isModEnabled('facture') && $user->rights->facture->lire) {
$elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices');
}
- if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) {
+ if (isModEnabled('contrat') && $user->rights->contrat->lire) {
$elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts');
}
}
diff --git a/htdocs/societe/contact.php b/htdocs/societe/contact.php
index 14c1347c98c..313947cbb0e 100644
--- a/htdocs/societe/contact.php
+++ b/htdocs/societe/contact.php
@@ -50,7 +50,7 @@ if (isModEnabled('adherent')) {
// Load translation files required by the page
$langs->loadLangs(array("companies", "commercial", "bills", "banks", "users"));
-if (!empty($conf->categorie->enabled)) {
+if (isModEnabled('categorie')) {
$langs->load("categories");
}
if (!empty($conf->incoterm->enabled)) {
diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php
index c90dc1537d1..1d0bdfe39a1 100644
--- a/htdocs/societe/index.php
+++ b/htdocs/societe/index.php
@@ -199,7 +199,7 @@ $thirdpartygraph .= '
';
$thirdpartygraph .= '';
$thirdpartycateggraph = '';
-if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTATS_ON_THIRDPARTIES)) {
+if (isModEnabled('categorie') && !empty($conf->global->CATEGORY_GRAPHSTATS_ON_THIRDPARTIES)) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$elementtype = 'societe';
diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php
index c8f0045d619..ff6de888284 100644
--- a/htdocs/societe/list.php
+++ b/htdocs/societe/list.php
@@ -979,7 +979,7 @@ if ($search_all) {
// Filter on categories
$moreforfilter = '';
if (empty($type) || $type == 'c' || $type == 'p') {
- 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('Categories');
@@ -990,7 +990,7 @@ if (empty($type) || $type == 'c' || $type == 'p') {
}
if (empty($type) || $type == 'f') {
- if (isModEnabled("fournisseur") && !empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
+ if (isModEnabled("fournisseur") && isModEnabled('categorie') && $user->rights->categorie->lire) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '
';
$tmptitle = $langs->trans('Categories');
diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php
index f22a5fb440b..02d58d0dfe3 100644
--- a/htdocs/societe/paymentmodes.php
+++ b/htdocs/societe/paymentmodes.php
@@ -797,7 +797,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
if (isModEnabled('facture') && $user->rights->facture->lire) {
$elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices');
}
- if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) {
+ if (isModEnabled('contrat') && $user->rights->contrat->lire) {
$elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts');
}
diff --git a/htdocs/supplier_proposal/index.php b/htdocs/supplier_proposal/index.php
index f151651d186..6fd6480105b 100644
--- a/htdocs/supplier_proposal/index.php
+++ b/htdocs/supplier_proposal/index.php
@@ -162,7 +162,7 @@ if ($resql) {
/*
* Draft askprice
*/
-if (!empty($conf->supplier_proposal->enabled)) {
+if (isModEnabled('supplier_proposal')) {
$sql = "SELECT c.rowid, c.ref, s.nom as socname, s.rowid as socid, s.canvas, s.client";
$sql .= " FROM ".MAIN_DB_PREFIX."supplier_proposal as c";
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
@@ -297,7 +297,7 @@ if ($resql) {
/*
* Opened askprice
*/
-if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) {
+if (isModEnabled('supplier_proposal') && $user->rights->supplier_proposal->lire) {
$langs->load("supplier_proposal");
$now = dol_now();
diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php
index 03de4f7ecca..6a8ad41dbd2 100644
--- a/htdocs/supplier_proposal/list.php
+++ b/htdocs/supplier_proposal/list.php
@@ -644,7 +644,7 @@ if ($resql) {
$moreforfilter .= '
';
}
// If the user can view products
- 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');
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index 7ae7bb70566..3b8b401f372 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -54,7 +54,7 @@ if (!empty($conf->ldap->enabled)) {
if (isModEnabled('adherent')) {
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
}
-if (!empty($conf->categorie->enabled)) {
+if (isModEnabled('categorie')) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
}
if (!empty($conf->stock->enabled)) {
@@ -1171,7 +1171,7 @@ if ($action == 'create' || $action == 'adduserldap') {
}
// Categories
- if (!empty($conf->categorie->enabled) && $user->hasRight("categorie", "read")) {
+ if (isModEnabled('categorie') && $user->hasRight("categorie", "read")) {
print '
'.$form->editfieldkey('Categories', 'usercats', '', $object, 0).' ';
$cate_arbo = $form->select_all_categories('user', null, 'parent', null, null, 1);
print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('usercats', $cate_arbo, GETPOST('usercats', 'array'), 0, 0, 'maxwdith300 widthcentpercentminusx', 0, '90%');
@@ -1627,7 +1627,7 @@ if ($action == 'create' || $action == 'adduserldap') {
}
// Categories
- if (!empty($conf->categorie->enabled) && $user->hasRight("categorie", "read")) {
+ if (isModEnabled('categorie') && $user->hasRight("categorie", "read")) {
print ' '.$langs->trans("Categories").' ';
print '';
print $form->showCategories($object->id, Categorie::TYPE_USER, 1);
@@ -2575,7 +2575,7 @@ if ($action == 'create' || $action == 'adduserldap') {
print ' ';
// Categories
- if (!empty($conf->categorie->enabled) && $user->hasRight("categorie", "read")) {
+ if (isModEnabled('categorie') && $user->hasRight("categorie", "read")) {
print '
'.$form->editfieldkey('Categories', 'usercats', '', $object, 0).' ';
print '';
print img_picto('', 'category', 'class="pictofixedwidth"');
diff --git a/htdocs/user/list.php b/htdocs/user/list.php
index e22f95d1055..858a46887ba 100644
--- a/htdocs/user/list.php
+++ b/htdocs/user/list.php
@@ -27,7 +27,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
-if (!empty($conf->categorie->enabled)) {
+if (isModEnabled('categorie')) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
}
@@ -658,7 +658,7 @@ $moreforfilter = '';
$moreforfilter.= '';*/
// Filter on categories
-if (!empty($conf->categorie->enabled) && $user->hasRight("categorie", "read")) {
+if (isModEnabled('categorie') && $user->hasRight("categorie", "read")) {
$moreforfilter .= '';
$tmptitle = $langs->trans('Category');
$moreforfilter .= img_picto($langs->trans("Category"), 'category', 'class="pictofixedwidth"').$formother->select_categories(Categorie::TYPE_USER, $search_categ, 'search_categ', 1, $tmptitle);
diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php
index 1df44179461..40c39ba3879 100644
--- a/htdocs/user/param_ihm.php
+++ b/htdocs/user/param_ihm.php
@@ -198,7 +198,7 @@ if (isModEnabled('holiday') || isModEnabled('expensereport')) {
if (isModEnabled("product") || isModEnabled("service")) {
$tmparray['product/index.php?mainmenu=products&leftmenu='] = 'ProductsAndServicesArea';
}
-if (isModEnabled("propal") || isModEnabled('commande') || !empty($conf->ficheinter->enabled) || !empty($conf->contrat->enabled)) {
+if (isModEnabled("propal") || isModEnabled('commande') || !empty($conf->ficheinter->enabled) || isModEnabled('contrat')) {
$tmparray['comm/index.php?mainmenu=commercial&leftmenu='] = 'CommercialArea';
}
if (!empty($conf->comptabilite->enabled) || !empty($conf->accounting->enabled)) {
diff --git a/htdocs/webservices/admin/index.php b/htdocs/webservices/admin/index.php
index 79d222f7e84..9214b4ad392 100644
--- a/htdocs/webservices/admin/index.php
+++ b/htdocs/webservices/admin/index.php
@@ -107,7 +107,7 @@ $webservices = array(
'invoice' => 'isModEnabled("facture")',
'supplier_invoice' => 'isModEnabled("fournisseur")',
'actioncomm' => 'isModEnabled('agenda')',
- 'category' => '!empty($conf->categorie->enabled)',
+ 'category' => 'isModEnabled('categorie')',
'project' => '!empty($conf->project->enabled)',
'other' => ''
);
diff --git a/htdocs/website/index.php b/htdocs/website/index.php
index 0b599ba640b..e83ea15a34d 100644
--- a/htdocs/website/index.php
+++ b/htdocs/website/index.php
@@ -2767,7 +2767,7 @@ if (!GETPOST('hide_websitemenu')) {
print dolButtonToOpenUrlInDialogPopup('file_manager', $langs->transnoentitiesnoconv("MediaFiles"), '
', '/website/index.php?action=file_manager&website='.urlencode($website->ref).'§ion_dir='.urlencode('image/'.$website->ref.'/'), $disabled);
- if (!empty($conf->categorie->enabled)) {
+ if (isModEnabled('categorie')) {
//print '
';
print dolButtonToOpenUrlInDialogPopup('categories', $langs->transnoentitiesnoconv("Categories"), '
', '/categories/index.php?leftmenu=website&nosearch=1&type=website_page&website='.urlencode($website->ref), $disabled);
}
@@ -3948,7 +3948,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties
print '
';
// Categories
- if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
+ if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) {
$langs->load('categories');
if (!GETPOSTISSET('categories')) {
@@ -4270,7 +4270,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction =
print '
';
// Categories
- if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
+ if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) {
print '
';
print '
';
print $langs->trans("Category");
@@ -4404,7 +4404,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction =
// Categories - Tags
print '
';
- if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
+ if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) {
// Get current categories
$existing = $c->containing($answerrecord->id, Categorie::TYPE_WEBSITE_PAGE, 'object');
if (is_array($existing)) {