diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index 98502c31a25..ff74273d744 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -511,7 +511,7 @@ $tabcond[25] = isModEnabled('website');
//$tabcond[26]= isModEnabled("product");
$tabcond[27] = isModEnabled("societe");
$tabcond[28] = isModEnabled('holiday');
-$tabcond[29] = !empty($conf->project->enabled);
+$tabcond[29] = isModEnabled('project');
$tabcond[30] = isModEnabled('label');
//$tabcond[31]= !empty($conf->accounting->enabled);
$tabcond[32] = (isModEnabled('holiday') || isModEnabled('hrm'));
diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php
index 4bc0de8ac84..d65bcefb11f 100644
--- a/htdocs/admin/mails_templates.php
+++ b/htdocs/admin/mails_templates.php
@@ -188,7 +188,7 @@ if (isModEnabled('recruitment') && !empty($user->rights->recruitment->recruitmen
if (isModEnabled("societe") && !empty($user->rights->societe->lire)) {
$elementList['thirdparty'] = img_picto('', 'company', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToThirdparty'));
}
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
$elementList['project'] = img_picto('', 'project', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToProject'));
}
if (isModEnabled("propal") && !empty($user->rights->propal->lire)) {
diff --git a/htdocs/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php
index 0c7c4fc3c8a..ac3f672ad33 100644
--- a/htdocs/bom/bom_agenda.php
+++ b/htdocs/bom/bom_agenda.php
@@ -150,7 +150,7 @@ if ($object->id > 0) {
// Thirdparty
$morehtmlref.=' '.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
- if (!empty($conf->project->enabled))
+ if (isModEnabled('project'))
{
$langs->load("projects");
$morehtmlref.=' '.$langs->trans('Project') . ' ';
diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php
index 25b7a8730dd..db58d8d5a33 100644
--- a/htdocs/bom/bom_card.php
+++ b/htdocs/bom/bom_card.php
@@ -457,7 +457,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Thirdparty
$morehtmlref.=' '.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1);
// Project
- if (!empty($conf->project->enabled))
+ if (isModEnabled('project'))
{
$langs->load("projects");
$morehtmlref.=' '.$langs->trans('Project') . ' ';
diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index 0d7953db900..14654914dd5 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -1411,7 +1411,7 @@ if ($action == 'create') {
}
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$langs->load("projects");
$projectid = GETPOST('projectid', 'int');
@@ -1914,7 +1914,7 @@ if ($id > 0) {
}
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$langs->load("projects");
print '
';
print ''.$langs->trans("Project").' ';
@@ -2267,7 +2267,7 @@ if ($action == 'create') {
$morehtmlref .= ' ('.$langs->trans("OtherProposals").' )';
}
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= ''.$langs->trans('Project').' ';
if ($usercancreate) {
diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index 51c07f15269..7997c948ea8 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -7,7 +7,7 @@
* Copyright (C) 2006 Andre Cianfarani
* Copyright (C) 2008 Raphael Bertrand
* Copyright (C) 2010-2020 Juanjo Menent
- * Copyright (C) 2010-2017 Philippe Grand
+ * Copyright (C) 2010-2022 Philippe Grand
* Copyright (C) 2012-2014 Christophe Battarel
* Copyright (C) 2012 Cedric Salvador
* Copyright (C) 2013 Florian Henry
@@ -297,7 +297,7 @@ class Propal extends CommonObject
'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>22),
'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'RefExt', 'enabled'=>1, 'visible'=>0, 'position'=>40),
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'position'=>23),
- 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>24),
+ 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>"isModEnabled('project')", 'visible'=>-1, 'position'=>24),
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25),
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>55),
'datep' =>array('type'=>'date', 'label'=>'Date', 'enabled'=>1, 'visible'=>-1, 'position'=>60),
@@ -1364,7 +1364,7 @@ class Propal extends CommonObject
$object->mode_reglement_id = (!empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0);
$object->fk_delivery_address = '';
- /*if (!empty($conf->project->enabled))
+ /*if (isModEnabled('project'))
{
$project = new Project($db);
if ($this->fk_project > 0 && $project->fetch($this->fk_project)) {
diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php
index 52318684f42..2497ba905a8 100644
--- a/htdocs/comm/propal/contact.php
+++ b/htdocs/comm/propal/contact.php
@@ -2,7 +2,7 @@
/* Copyright (C) 2005 Patrick Rouillon
* Copyright (C) 2005-2016 Destailleur Laurent
* Copyright (C) 2005-2012 Regis Houssin
- * Copyright (C) 2011-2015 Philippe Grand
+ * Copyright (C) 2011-2022 Philippe Grand
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -138,7 +138,7 @@ if ($object->id > 0) {
// Thirdparty
$morehtmlref .= ' '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->propal->creer) {
diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php
index 35ab2e28b49..6f17c655e82 100644
--- a/htdocs/comm/propal/document.php
+++ b/htdocs/comm/propal/document.php
@@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -136,7 +136,7 @@ if ($object->id > 0) {
// Thirdparty
$morehtmlref .= ' '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->propal->creer) {
diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php
index 92285183cf2..c67ec346ecb 100644
--- a/htdocs/comm/propal/info.php
+++ b/htdocs/comm/propal/info.php
@@ -28,7 +28,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -83,7 +83,7 @@ $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_cl
// Thirdparty
$morehtmlref .= ' '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->propal->creer) {
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index 31c4489d47f..d2bcf6186e2 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -204,8 +204,8 @@ $checkedtypetiers = 0;
$arrayfields = array(
'p.ref'=>array('label'=>"Ref", 'checked'=>1),
'p.ref_client'=>array('label'=>"RefCustomer", 'checked'=>1),
- 'pr.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1)),
- 'pr.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1)),
+ 'pr.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(!isModEnabled('project') ? 0 : 1)),
+ 'pr.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(!isModEnabled('project') ? 0 : 1)),
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1),
's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>-1),
's.town'=>array('label'=>"Town", 'checked'=>-1),
diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php
index 28819123cb0..2b007ab3fa0 100644
--- a/htdocs/comm/propal/note.php
+++ b/htdocs/comm/propal/note.php
@@ -29,7 +29,7 @@
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -108,7 +108,7 @@ if ($object->id > 0) {
// Thirdparty
$morehtmlref .= ' '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->propal->creer) {
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 73bf27c0cfd..27fddbb7dba 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -5,7 +5,7 @@
* Copyright (C) 2005-2015 Regis Houssin
* Copyright (C) 2006 Andre Cianfarani
* Copyright (C) 2010-2013 Juanjo Menent
- * Copyright (C) 2011-2019 Philippe Grand
+ * Copyright (C) 2011-2022 Philippe Grand
* Copyright (C) 2012-2013 Christophe Battarel
* Copyright (C) 2012-2016 Marcos García
* Copyright (C) 2012 Cedric Salvador
@@ -52,7 +52,7 @@ if (isModEnabled("propal")) {
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
}
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -1569,7 +1569,7 @@ $form = new Form($db);
$formfile = new FormFile($db);
$formorder = new FormOrder($db);
$formmargin = new FormMargin($db);
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
$formproject = new FormProjets($db);
}
@@ -1854,7 +1854,7 @@ if ($action == 'create' && $usercancreate) {
// TODO How record was recorded OrderMode (llx_c_input_method)
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$langs->load("projects");
print '';
print ''.$langs->trans("Project").' ';
@@ -2327,7 +2327,7 @@ if ($action == 'create' && $usercancreate) {
$morehtmlref .= ' ('.$langs->trans("OtherOrders").' )';
}
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($usercancreate) {
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index ca7d462a432..690fcb56bfb 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -314,7 +314,7 @@ class Commande extends CommonOrder
'ref_int' =>array('type'=>'varchar(255)', 'label'=>'RefInt', 'enabled'=>1, 'visible'=>0, 'position'=>27), // deprecated
'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>28),
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>20),
- 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>25),
+ 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>"isModEnabled('project')", 'visible'=>-1, 'position'=>25),
'date_commande' =>array('type'=>'date', 'label'=>'Date', 'enabled'=>1, 'visible'=>1, 'position'=>60),
'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>62),
'date_cloture' =>array('type'=>'datetime', 'label'=>'DateClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>65),
diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php
index c9ef518d1d0..1be1384df30 100644
--- a/htdocs/commande/contact.php
+++ b/htdocs/commande/contact.php
@@ -2,7 +2,7 @@
/* Copyright (C) 2005 Patrick Rouillon
* Copyright (C) 2005-2011 Laurent Destailleur
* Copyright (C) 2005-2012 Regis Houssin
- * Copyright (C) 2011-2015 Philippe Grand
+ * Copyright (C) 2011-2022 Philippe Grand
* Copyright (C) 2021 Frédéric France
*
* This program is free software; you can redistribute it and/or modify
@@ -131,7 +131,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty
$morehtmlref .= ' '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->commande->creer) {
diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php
index af04389b8d9..501a803b697 100644
--- a/htdocs/commande/document.php
+++ b/htdocs/commande/document.php
@@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -130,7 +130,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty
$morehtmlref .= ' '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->commande->creer) {
diff --git a/htdocs/commande/info.php b/htdocs/commande/info.php
index 93b80b80f1c..396052082c5 100644
--- a/htdocs/commande/info.php
+++ b/htdocs/commande/info.php
@@ -27,7 +27,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -83,7 +83,7 @@ $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_cl
// Thirdparty
$morehtmlref .= ' '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->commande->creer) {
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index 438a00bbb56..e194bda8e3a 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -174,8 +174,8 @@ $checkedtypetiers = 0;
$arrayfields = array(
'c.ref'=>array('label'=>"Ref", 'checked'=>1, 'position'=>5),
'c.ref_client'=>array('label'=>"RefCustomerOrder", 'checked'=>-1, 'position'=>10),
- 'p.ref'=>array('label'=>"ProjectRef", 'checked'=>-1, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1), 'position'=>20),
- 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1), 'position'=>25),
+ 'p.ref'=>array('label'=>"ProjectRef", 'checked'=>-1, 'enabled'=>(!isModEnabled('project') ? 0 : 1), 'position'=>20),
+ 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(!isModEnabled('project') ? 0 : 1), 'position'=>25),
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30),
's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>-1, 'position'=>31),
's.town'=>array('label'=>"Town", 'checked'=>-1, 'position'=>35),
diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php
index 934299377e5..2082e356797 100644
--- a/htdocs/commande/note.php
+++ b/htdocs/commande/note.php
@@ -28,7 +28,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -102,7 +102,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty
$morehtmlref .= ' '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->commande->creer) {
diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php
index 688b0fd544b..4e7ab4802b7 100644
--- a/htdocs/compta/accounting-files.php
+++ b/htdocs/compta/accounting-files.php
@@ -48,7 +48,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/loan/class/paymentloan.class.php';
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php
index 6644a81f62a..fe9bb032fa8 100644
--- a/htdocs/compta/bank/various_payment/list.php
+++ b/htdocs/compta/bank/various_payment/list.php
@@ -151,7 +151,7 @@ $arrayfields = array(
'datep' =>array('label'=>"DatePayment", 'checked'=>1, 'position'=>120),
'datev' =>array('label'=>"DateValue", 'checked'=>-1, 'position'=>130),
'type' =>array('label'=>"PaymentMode", 'checked'=>1, 'position'=>140),
- 'project' =>array('label'=>"Project", 'checked'=>1, 'position'=>200, "enabled"=>!empty($conf->project->enabled)),
+ 'project' =>array('label'=>"Project", 'checked'=>1, 'position'=>200, "enabled"=>isModEnabled('project')),
'bank' =>array('label'=>"BankAccount", 'checked'=>1, 'position'=>300, "enabled"=>isModEnabled("banque")),
'entry' =>array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>310, "enabled"=>isModEnabled("banque")),
'account' =>array('label'=>"AccountAccountingShort", 'checked'=>1, 'position'=>400, "enabled"=>isModEnabled('accounting')),
diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php
index 3001baca506..a2d675c3c73 100644
--- a/htdocs/compta/facture/class/facture-rec.class.php
+++ b/htdocs/compta/facture/class/facture-rec.class.php
@@ -181,7 +181,7 @@ class FactureRec extends CommonInvoice
'total_ht' =>array('type'=>'double(24,8)', 'label'=>'Total', 'enabled'=>1, 'visible'=>-1, 'position'=>70, 'isameasure'=>1),
'total_ttc' =>array('type'=>'double(24,8)', 'label'=>'Total ttc', 'enabled'=>1, 'visible'=>-1, 'position'=>75, 'isameasure'=>1),
'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>80),
- 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>85),
+ 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>"isModEnabled('project')", 'visible'=>-1, 'position'=>85),
'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'Fk cond reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>90),
'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'Fk mode reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>95),
'date_lim_reglement' =>array('type'=>'date', 'label'=>'Date lim reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>100),
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index 51257583ef7..5e8507e7229 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -215,8 +215,8 @@ $arrayfields = array(
'f.date_valid'=>array('label'=>"DateValidation", 'checked'=>0, 'position'=>22),
'f.date_lim_reglement'=>array('label'=>"DateDue", 'checked'=>1, 'position'=>25),
'f.date_closing'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>30),
- 'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1), 'position'=>40),
- 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1), 'position'=>41),
+ 'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(!isModEnabled('project') ? 0 : 1), 'position'=>40),
+ 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(!isModEnabled('project') ? 0 : 1), 'position'=>41),
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>50),
's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>1, 'position'=>51),
's.town'=>array('label'=>"Town", 'checked'=>-1, 'position'=>55),
diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php
index 520f074a0c1..f36694bb3b2 100644
--- a/htdocs/compta/sociales/list.php
+++ b/htdocs/compta/sociales/list.php
@@ -100,7 +100,7 @@ $arrayfields = array(
'cs.fk_type' =>array('label'=>"Type", 'checked'=>1, 'position'=>30),
'cs.date_ech' =>array('label'=>"Date", 'checked'=>1, 'position'=>40),
'cs.periode' =>array('label'=>"PeriodEndDate", 'checked'=>1, 'position'=>50),
- 'p.ref' =>array('label'=>"ProjectRef", 'checked'=>1, 'position'=>60, 'enable'=>(!empty($conf->project->enabled))),
+ 'p.ref' =>array('label'=>"ProjectRef", 'checked'=>1, 'position'=>60, 'enable'=>(isModEnabled('project'))),
'cs.fk_user' =>array('label'=>"Employee", 'checked'=>1, 'position'=>70),
'cs.fk_mode_reglement' =>array('checked'=>-1, 'position'=>80, 'label'=>"DefaultPaymentMode"),
'cs.amount' =>array('label'=>"Amount", 'checked'=>1, 'position'=>100),
diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php
index 29288708664..928dff1aea6 100644
--- a/htdocs/contrat/agenda.php
+++ b/htdocs/contrat/agenda.php
@@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@@ -110,7 +110,7 @@ if (empty($reshook)) {
$form = new Form($db);
$formfile = new FormFile($db);
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
$formproject = new FormProjets($db);
}
@@ -171,7 +171,7 @@ if ($id > 0) {
$morehtmlref .= ' ('.$langs->trans("OtherContracts").' )';
}
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->contrat->creer) {
diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php
index 564122f3137..9eafcb6ead0 100644
--- a/htdocs/contrat/card.php
+++ b/htdocs/contrat/card.php
@@ -44,7 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
if (isModEnabled("propal")) {
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
}
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@@ -1045,7 +1045,7 @@ llxHeader('', $langs->trans("Contract"), $help_url);
$form = new Form($db);
$formfile = new FormFile($db);
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
$formproject = new FormProjets($db);
}
@@ -1204,7 +1204,7 @@ if ($action == 'create') {
print " ";
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$langs->load('projects');
$formproject = new FormProjets($db);
@@ -1368,7 +1368,7 @@ if ($action == 'create') {
$morehtmlref .= ' ('.$langs->trans("OtherContracts").' )';
}
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->contrat->creer) {
diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php
index bc43c54a8ec..26d2d6b6bcb 100644
--- a/htdocs/contrat/class/contrat.class.php
+++ b/htdocs/contrat/class/contrat.class.php
@@ -233,7 +233,7 @@ class Contrat extends CommonObject
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>40),
'date_contrat' =>array('type'=>'datetime', 'label'=>'Date contrat', 'enabled'=>1, 'visible'=>-1, 'position'=>45),
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>70),
- 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>75),
+ 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>"isModEnabled('project')", 'visible'=>-1, 'position'=>75),
'fk_commercial_signature' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'SaleRepresentative Signature', 'enabled'=>1, 'visible'=>-1, 'position'=>80),
'fk_commercial_suivi' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'SaleRepresentative follower', 'enabled'=>1, 'visible'=>-1, 'position'=>85),
'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>90),
diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php
index 92a5a3f5999..d32a0464b02 100644
--- a/htdocs/contrat/contact.php
+++ b/htdocs/contrat/contact.php
@@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -154,7 +154,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty
$morehtmlref .= ' '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->contrat->creer) {
diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php
index bf1c83dccb3..19248769ef8 100644
--- a/htdocs/contrat/document.php
+++ b/htdocs/contrat/document.php
@@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -144,7 +144,7 @@ if ($object->id) {
$morehtmlref .= ' ('.$langs->trans("OtherContracts").' )';
}
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->contrat->creer) {
diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php
index 044d6e4941e..997ba94de3b 100644
--- a/htdocs/contrat/note.php
+++ b/htdocs/contrat/note.php
@@ -27,7 +27,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -111,7 +111,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty
$morehtmlref .= ' '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->contrat->creer) {
diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php
index 3f74ba7fdb2..2854a631e42 100644
--- a/htdocs/core/actions_massactions.inc.php
+++ b/htdocs/core/actions_massactions.inc.php
@@ -456,7 +456,7 @@ if (!$error && $massaction == 'confirm_presend') {
//var_dump($oneemailperrecipient); var_dump($listofqualifiedobj); var_dump($listofqualifiedref);
foreach ($looparray as $objectid => $objecttmp) { // $objecttmp is a real object or an empty object if we choose to send one email per thirdparty instead of one per object
// Make substitution in email content
- if (!empty($conf->project->enabled) && method_exists($objecttmp, 'fetch_projet') && is_null($objecttmp->project)) {
+ if (isModEnabled('project') && method_exists($objecttmp, 'fetch_projet') && is_null($objecttmp->project)) {
$objecttmp->fetch_projet();
}
$substitutionarray = getCommonSubstitutionArray($langs, 0, null, $objecttmp);
diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php
index 6cb152c943f..7d6beb89053 100644
--- a/htdocs/core/class/html.formticket.class.php
+++ b/htdocs/core/class/html.formticket.class.php
@@ -622,7 +622,7 @@ class FormTicket
}
if ($subelement != 'project') {
- if (!empty($conf->project->enabled) && !$this->ispublic) {
+ if (isModEnabled('project') && !$this->ispublic) {
$formproject = new FormProjets($this->db);
print ''.$langs->trans("Project").' ';
print img_picto('', 'project').$formproject->select_projects(-1, GETPOST('projectid', 'int'), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500');
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index 9b1c46d7c53..9cadb431ec5 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -138,7 +138,7 @@ function societe_prepare_head(Societe $object)
$h++;
}
- if (!empty($conf->project->enabled) && (!empty($user->rights->projet->lire))) {
+ if (isModEnabled('project') && (!empty($user->rights->projet->lire))) {
$nbProject = 0;
// Enable caching of thirdrparty count projects
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
@@ -781,11 +781,11 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel
$i = -1;
- if (!empty($conf->project->enabled) && $user->rights->projet->lire) {
+ if (isModEnabled('project') && $user->rights->projet->lire) {
$langs->load("projects");
$newcardbutton = '';
- if (!empty($conf->project->enabled) && $user->rights->projet->creer && empty($nocreatelink)) {
+ if (isModEnabled('project') && $user->rights->projet->creer && empty($nocreatelink)) {
$newcardbutton .= dolGetButtonTitle($langs->trans('AddProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage));
}
diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php
index ad5c07e9a7e..d7c89b1cf99 100644
--- a/htdocs/core/lib/contact.lib.php
+++ b/htdocs/core/lib/contact.lib.php
@@ -57,7 +57,7 @@ function contact_prepare_head(Contact $object)
$head[$tab][2] = 'perso';
$tab++;
- if (!empty($conf->project->enabled) && $user->hasRight('project', 'lire')) {
+ if (isModEnabled('project') && $user->hasRight('project', 'lire')) {
$nbProject = 0;
// Enable caching of thirdrparty count projects
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
@@ -170,11 +170,11 @@ function show_contacts_projects($conf, $langs, $db, $object, $backtopage = '', $
$i = -1;
- if (!empty($conf->project->enabled) && $user->rights->projet->lire) {
+ if (isModEnabled('project') && $user->rights->projet->lire) {
$langs->load("projects");
$newcardbutton = '';
- if (!empty($conf->project->enabled) && $user->rights->projet->creer && empty($nocreatelink)) {
+ if (isModEnabled('project') && $user->rights->projet->creer && empty($nocreatelink)) {
$newcardbutton .= dolGetButtonTitle($langs->trans('AddProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage));
}
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 6c297a53bd9..a5461f3b666 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -7398,7 +7398,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__CANDIDATE_FIRSTNAME__'] = '__CANDIDATE_FIRSTNAME__';
$substitutionarray['__CANDIDATE_LASTNAME__'] = '__CANDIDATE_LASTNAME__';
}
- if (!empty($conf->project->enabled)) { // Most objects
+ if (isModEnabled('project')) { // Most objects
$substitutionarray['__PROJECT_ID__'] = '__PROJECT_ID__';
$substitutionarray['__PROJECT_REF__'] = '__PROJECT_REF__';
$substitutionarray['__PROJECT_NAME__'] = '__PROJECT_NAME__';
diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php
index 0c591fd8193..47fb9b6f186 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -186,7 +186,7 @@ function project_prepare_head(Project $project, $moreparam = '')
if (isModEnabled('tax')) {
$nbElements += $project->getElementCount('chargesociales', 'chargesociales');
}
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$nbElements += $project->getElementCount('project_task', 'projet_task');
}
if (!empty($conf->stock->enabled)) {
diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php
index 79b020b4883..d0067d7575b 100644
--- a/htdocs/core/lib/security.lib.php
+++ b/htdocs/core/lib/security.lib.php
@@ -876,7 +876,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl
$checkonentitydone = 1;
}
if (in_array($feature, $checkproject) && $objectid > 0) {
- if (!empty($conf->project->enabled) && empty($user->rights->projet->all->lire)) {
+ if (isModEnabled('project') && empty($user->rights->projet->all->lire)) {
$projectid = $objectid;
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
@@ -897,7 +897,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl
$checkonentitydone = 1;
}
if (in_array($feature, $checktask) && $objectid > 0) {
- if (!empty($conf->project->enabled) && empty($user->rights->projet->all->lire)) {
+ if (isModEnabled('project') && empty($user->rights->projet->all->lire)) {
$task = new Task($db);
$task->fetch($objectid);
$projectid = $task->fk_project;
diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
index 380fb5b79a0..f6536cbb1df 100644
--- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
+++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
@@ -1,7 +1,7 @@
* Copyright (C) 2015 Alexandre Spangaro
- * Copyright (C) 2016-2021 Philippe Grand
+ * Copyright (C) 2016-2022 Philippe Grand
* Copyright (C) 2018-2020 Frédéric France
* Copyright (C) 2018 Francis Appels
* Copyright (C) 2019 Markus Welters
@@ -152,7 +152,7 @@ class pdf_standard extends ModeleExpenseReport
$this->posxqty = 150;
$this->postotalht = 160;
$this->postotalttc = 180;
- // if (empty($conf->project->enabled)) {
+ // if (!isModEnabled('project')) {
// $this->posxtva-=20;
// $this->posxup-=20;
// $this->posxqty-=20;
@@ -584,7 +584,7 @@ class pdf_standard extends ModeleExpenseReport
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) {
$nextColumnPosX = $this->posxtva;
}
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$nextColumnPosX = $this->posxprojet;
}
@@ -600,7 +600,7 @@ class pdf_standard extends ModeleExpenseReport
//$pdf->MultiCell($nextColumnPosX-$this->posxtype-0.8, 4, $expensereporttypecodetoshow, 0, 'C');
// Project
- //if (!empty($conf->project->enabled))
+ //if (isModEnabled('project'))
//{
// $pdf->SetFont('','', $default_font_size - 1);
// $pdf->SetXY($this->posxprojet, $curY);
@@ -958,7 +958,7 @@ class pdf_standard extends ModeleExpenseReport
// $pdf->MultiCell($this->posxprojet-$this->posxtype - 1, 2, $outputlangs->transnoentities("Type"), '', 'C');
//}
- //if (!empty($conf->project->enabled))
+ //if (isModEnabled('project'))
//{
// // Project
// $pdf->line($this->posxprojet - 1, $tab_top, $this->posxprojet - 1, $tab_top + $tab_height);
diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php
index 2cf66712716..78ed4d7b7ba 100644
--- a/htdocs/core/modules/modCategorie.class.php
+++ b/htdocs/core/modules/modCategorie.class.php
@@ -145,7 +145,7 @@ class modCategorie extends DolibarrModules
if (!empty($conf->bank->enabled)) {
$typeexample .= ($typeexample ? " / " : "")."5=Bank account";
}
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$typeexample .= ($typeexample ? " / " : "")."6=Project";
}
if (!empty($conf->user->enabled)) {
@@ -179,7 +179,7 @@ class modCategorie extends DolibarrModules
$this->export_code[$r] = $this->rights_class.'_0_'.Categorie::$MAP_ID_TO_CODE[0];
$this->export_label[$r] = 'CatProdList';
$this->export_icon[$r] = $this->picto;
- $this->export_enabled[$r] = 'isModEnabled("product") || !empty($conf->service->abled)';
+ $this->export_enabled[$r] = 'isModEnabled("product") || !empty($conf->service->enabled)';
$this->export_permission[$r] = array(array("categorie", "lire"), array("produit", "export"));
$this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'p.rowid'=>'ProductId', 'p.ref'=>'Ref', 'p.label'=>'Label');
$this->export_TypeFields_array[$r] = array('cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'List:categorie:label:rowid', 'p.ref'=>'Text', 'p.label'=>'Text');
@@ -379,7 +379,7 @@ class modCategorie extends DolibarrModules
$this->export_code[$r] = $this->rights_class.'_6_'.Categorie::$MAP_ID_TO_CODE[6];
$this->export_label[$r] = 'CatProjectsList';
$this->export_icon[$r] = $this->picto;
- $this->export_enabled[$r] = '!empty($conf->project->enabled)';
+ $this->export_enabled[$r] = "isModEnabled('project')";
$this->export_permission[$r] = array(array("categorie", "lire"), array("projet", "export"));
$this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'p.rowid'=>'ProjectId', 'p.ref'=>'Ref', 's.rowid'=>"IdThirdParty", 's.nom'=>"Name");
$this->export_TypeFields_array[$r] = array('cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'List:categorie:label:rowid', 'p.ref'=>'Text', 's.rowid'=>"Numeric", 's.nom'=>"Text");
@@ -568,7 +568,7 @@ class modCategorie extends DolibarrModules
// 5 Bank accounts, TODO ?
// 6 Projects
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$r++;
$this->import_code[$r] = $this->rights_class.'_6_'.Categorie::$MAP_ID_TO_CODE[6];
$this->import_label[$r] = "CatProjectsLinks"; // Translation key
diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php
index 40d73b0f298..2d829c79b25 100644
--- a/htdocs/delivery/card.php
+++ b/htdocs/delivery/card.php
@@ -43,7 +43,7 @@ if (!empty($conf->expedition_bon->enabled)) {
if (!empty($conf->stock->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
}
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@@ -328,7 +328,7 @@ if ($action == 'create') { // Create. Seems to no be used
// Thirdparty
$morehtmlref .= ' '.$langs->trans('ThirdParty').' : '.$expedition->thirdparty->getNomUrl(1);
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
if (0) { // Do not change on shipment
diff --git a/htdocs/don/card.php b/htdocs/don/card.php
index f3bfca6ee95..b3b1a517077 100644
--- a/htdocs/don/card.php
+++ b/htdocs/don/card.php
@@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmargin.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -382,7 +382,7 @@ llxHeader('', $title, $help_url);
$form = new Form($db);
$formfile = new FormFile($db);
$formcompany = new FormCompany($db);
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
$formproject = new FormProjets($db);
}
@@ -511,7 +511,7 @@ if ($action == 'create') {
print ' ';
}
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
print "".$langs->trans("Project")." ";
$formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500');
print " \n";
@@ -639,7 +639,7 @@ if (!empty($id) && $action == 'edit') {
print "".''.$langs->trans("Status").' '.$object->getLibStatut(4).' ';
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$formproject = new FormProjets($db);
$langs->load('projects');
@@ -700,7 +700,7 @@ if (!empty($id) && $action != 'edit') {
$morehtmlref = '';
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= $langs->trans('Project').' ';
if ($user->rights->don->creer) {
diff --git a/htdocs/don/document.php b/htdocs/don/document.php
index 1bb371c7812..53ca935e5ae 100644
--- a/htdocs/don/document.php
+++ b/htdocs/don/document.php
@@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/donation.lib.php';
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -99,7 +99,7 @@ if ($action == 'classin' && $user->rights->don->creer) {
*/
$form = new Form($db);
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
$formproject = new FormProjets($db);
}
@@ -129,7 +129,7 @@ if ($object->id) {
$morehtmlref = '
';
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= $langs->trans('Project').' ';
if ($user->rights->don->creer) {
diff --git a/htdocs/don/info.php b/htdocs/don/info.php
index 29d8f129036..b19826f9bcd 100644
--- a/htdocs/don/info.php
+++ b/htdocs/don/info.php
@@ -25,7 +25,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/donation.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -68,7 +68,7 @@ $help_url = 'EN:Module_Donations|FR:Module_Dons|ES:Módulo_Donaciones|DE:M
llxHeader('', $title, $help_url);
$form = new Form($db);
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
$formproject = new FormProjets($db);
}
@@ -82,7 +82,7 @@ $linkback = '
';
// Project
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= $langs->trans('Project').' ';
if ($user->rights->don->creer) {
diff --git a/htdocs/don/list.php b/htdocs/don/list.php
index 68f8ab0bbea..73314d9727c 100644
--- a/htdocs/don/list.php
+++ b/htdocs/don/list.php
@@ -27,7 +27,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -93,7 +93,7 @@ $fieldstosearchall = array(
$donationstatic = new Don($db);
$form = new Form($db);
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
$projectstatic = new Project($db);
}
@@ -219,7 +219,7 @@ if ($resql) {
print ' ';
print ' ';
print ' ';
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
print '
';
print ' ';
print ' ';
@@ -249,7 +249,7 @@ if ($resql) {
}
print_liste_field_titre("Name", $_SERVER["PHP_SELF"], "d.lastname", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "d.datedon", "", $param, '', $sortfield, $sortorder, 'center ');
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$langs->load("projects");
print_liste_field_titre("Project", $_SERVER["PHP_SELF"], "d.fk_projet", "", $param, "", $sortfield, $sortorder);
}
@@ -280,7 +280,7 @@ if ($resql) {
}
print "
".$donationstatic->getFullName($langs)." ";
print '
'.dol_print_date($db->jdate($objp->datedon), 'day').' ';
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
print "
";
if ($objp->pid) {
$projectstatic->id = $objp->pid;
diff --git a/htdocs/don/note.php b/htdocs/don/note.php
index 0b1c555e772..57ca862ad77 100644
--- a/htdocs/don/note.php
+++ b/htdocs/don/note.php
@@ -29,7 +29,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/donation.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@@ -86,7 +86,7 @@ $help_url = 'EN:Module_Donations|FR:Module_Dons|ES:Módulo_Donaciones|DE:M
llxHeader('', $title, $help_url);
$form = new Form($db);
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
$formproject = new FormProjets($db);
}
@@ -102,7 +102,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref = '';
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= $langs->trans('Project').' ';
if ($user->rights->don->creer) {
diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php
index c91882e5ab5..8014a4522bb 100644
--- a/htdocs/ecm/index_auto.php
+++ b/htdocs/ecm/index_auto.php
@@ -347,9 +347,9 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
$langs->load("compta");
$rowspan++; $sectionauto[] = array('position'=>120, 'level'=>1, 'module'=>'salaries', 'test'=>$conf->salaries->enabled, 'label'=>$langs->trans("Salaries"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Salaries")));
}
- if (!empty($conf->project->enabled)) {
- $rowspan++; $sectionauto[] = array('position'=>130, 'level'=>1, 'module'=>'project', 'test'=>$conf->project->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects")));
- $rowspan++; $sectionauto[] = array('position'=>140, 'level'=>1, 'module'=>'project_task', 'test'=>$conf->project->enabled, 'label'=>$langs->trans("Tasks"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Tasks")));
+ if (isModEnabled('project')) {
+ $rowspan++; $sectionauto[] = array('position'=>130, 'level'=>1, 'module'=>'project', 'test'=>isModEnabled('project'), 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects")));
+ $rowspan++; $sectionauto[] = array('position'=>140, 'level'=>1, 'module'=>'project_task', 'test'=>isModEnabled('project'), 'label'=>$langs->trans("Tasks"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Tasks")));
}
if (!empty($conf->ficheinter->enabled)) {
$langs->load("interventions");
diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php
index 2b284e43b0f..5f86c0e8c57 100644
--- a/htdocs/ecm/search.php
+++ b/htdocs/ecm/search.php
@@ -143,8 +143,8 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
if (isModEnabled('tax')) {
$langs->load("compta"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions")));
}
-if (!empty($conf->project->enabled)) {
- $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'project', 'test'=>$conf->project->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects")));
+if (isModEnabled('project')) {
+ $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'project', 'test'=>isModEnabled('project'), 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects")));
}
if (!empty($conf->ficheinter->enabled)) {
$langs->load("interventions"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions")));
diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php
index faddee08d29..cdb67a2c37b 100644
--- a/htdocs/eventorganization/class/conferenceorbooth.class.php
+++ b/htdocs/eventorganization/class/conferenceorbooth.class.php
@@ -107,7 +107,7 @@ class ConferenceOrBooth extends ActionComm
'ref' => array('type'=>'integer', 'label'=>'Ref', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>2, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'csslist'=>'tdoverflowmax125', 'help'=>"OrganizationEvenLabelName", 'showoncombobox'=>'1',),
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"OrganizationEventLinkToThirdParty", 'picto'=>'company', 'css'=>'tdoverflowmax150 maxwidth500'),
- 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:t.usage_organize_event=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'),
+ 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:t.usage_organize_event=1', 'label'=>'Project', 'enabled'=>"isModEnabled('project')", 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'),
'note' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1),
'fk_action' => array('type'=>'sellist:c_actioncomm:libelle:id::module LIKE (\'%@eventorganization\')', 'label'=>'Format', 'enabled'=>'1', 'position'=>60, 'notnull'=>1, 'visible'=>1, 'css'=>'width300'),
'datep' => array('type'=>'datetime', 'label'=>'DateStart', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'2',),
diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php
index 78fe18366b7..222a0c78946 100644
--- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php
+++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php
@@ -104,7 +104,7 @@ class ConferenceOrBoothAttendee extends CommonObject
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>2, 'index'=>1, 'comment'=>"Reference of object"),
'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>0, 'index'=>1, 'picto'=>'agenda'),
- 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'position'=>20, 'notnull'=>1, 'visible'=>0, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'),
+ 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>"isModEnabled('project')", 'position'=>20, 'notnull'=>1, 'visible'=>0, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'),
'email' => array('type'=>'mail', 'label'=>'EmailAttendee', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'autofocusoncreate'=>1, 'searchall'=>1),
'firstname' => array('type'=>'varchar(100)', 'label'=>'Firstname', 'enabled'=>'1', 'position'=>31, 'notnull'=>0, 'visible'=>1, 'index'=>1, 'searchall'=>1),
'lastname' => array('type'=>'varchar(100)', 'label'=>'Lastname', 'enabled'=>'1', 'position'=>32, 'notnull'=>0, 'visible'=>1, 'index'=>1, 'searchall'=>1),
diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php
index 9521bff2c01..62bd64441b5 100644
--- a/htdocs/eventorganization/conferenceorbooth_contact.php
+++ b/htdocs/eventorganization/conferenceorbooth_contact.php
@@ -396,7 +396,7 @@ if ($object->id) {
// Thirdparty
$morehtmlref.=' '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
// Project
- if (!empty($conf->project->enabled))
+ if (isModEnabled('project'))
{
$langs->load("projects");
$morehtmlref.=' '.$langs->trans('Project') . ' ';
diff --git a/htdocs/eventorganization/conferenceorboothattendee_note.php b/htdocs/eventorganization/conferenceorboothattendee_note.php
index b5e25872bf5..5739e19f0cc 100644
--- a/htdocs/eventorganization/conferenceorboothattendee_note.php
+++ b/htdocs/eventorganization/conferenceorboothattendee_note.php
@@ -151,7 +151,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty
$morehtmlref.=' '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
// Project
- if (!empty($conf->project->enabled))
+ if (isModEnabled('project'))
{
$langs->load("projects");
$morehtmlref.=' '.$langs->trans('Project') . ' ';
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index f947e86a66a..24489288554 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -56,7 +56,7 @@ if (isModEnabled("propal")) {
if (isModEnabled('productbatch')) {
require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php';
}
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@@ -819,7 +819,7 @@ if (empty($action)) {
$form = new Form($db);
$formfile = new FormFile($db);
$formproduct = new FormProduct($db);
-if (!empty($conf->project->enabled)) {
+if (isModEnabled('project')) {
$formproject = new FormProjets($db);
}
@@ -906,7 +906,7 @@ if ($action == 'create') {
print '
';
// Project
- if (!empty($conf->project->enabled)) {
+ if (isModEnabled('project')) {
$projectid = GETPOST('projectid', 'int') ?GETPOST('projectid', 'int') : 0;
if (empty($projectid) && !empty($object->fk_project)) {
$projectid = $object->fk_project;
@@ -1732,7 +1732,7 @@ if ($action == 'create') {
// Thirdparty
$morehtmlref .= '