Use isModEnabled

This commit is contained in:
Alexandre SPANGARO 2022-09-25 06:13:41 +02:00
parent 5eaffd64e7
commit 86163ff430
5 changed files with 6 additions and 6 deletions

View File

@ -58,7 +58,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
if (isModEnabled('contrat')) {
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
}
if (!empty($conf->ficheinter->enabled)) {
if (isModEnabled('ficheinter')) {
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
}
if (isModEnabled('deplacement')) {

View File

@ -59,7 +59,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
if (isModEnabled('contrat')) {
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
}
if (!empty($conf->ficheinter->enabled)) {
if (isModEnabled('ficheinter')) {
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
}
if (isModEnabled('deplacement')) {

View File

@ -433,7 +433,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
if ($action == 'TICKET_CREATE') {
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
// Auto link contract
if (!empty($conf->contract->enabled) && !empty($conf->ticket->enabled) && !empty($conf->ficheinter->enabled) && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_TICKET_LINK_CONTRACT) && !empty($conf->global->TICKET_PRODUCT_CATEGORY) && !empty($object->fk_soc)) {
if (!empty($conf->contract->enabled) && !empty($conf->ticket->enabled) && isModEnabled('ficheinter') && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_TICKET_LINK_CONTRACT) && !empty($conf->global->TICKET_PRODUCT_CATEGORY) && !empty($object->fk_soc)) {
$societe = new Societe($this->db);
$company_ids = (empty($conf->global->WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS)) ? [$object->fk_soc] : $societe->getParentsForCompany($object->fk_soc, [$object->fk_soc]);
@ -463,7 +463,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
}
}
// Automatically create intervention
if (!empty($conf->ficheinter->enabled) && !empty($conf->ticket->enabled) && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_TICKET_CREATE_INTERVENTION)) {
if (isModEnabled('ficheinter') && !empty($conf->ticket->enabled) && !empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_TICKET_CREATE_INTERVENTION)) {
$fichinter = new Fichinter($this->db);
$fichinter->socid = (int) $object->fk_soc;
$fichinter->fk_project = $projectid;

View File

@ -352,7 +352,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
$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)) {
if (isModEnabled('ficheinter')) {
$langs->load("interventions");
$rowspan++; $sectionauto[] = array('position'=>150, 'level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions")));
}

View File

@ -147,7 +147,7 @@ if (isModEnabled('tax')) {
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)) {
if (isModEnabled('ficheinter')) {
$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")));
}
if (isModEnabled('expensereport')) {