From 8568f66d42dbc3dcb23ab2ea2bfb74feb9b28747 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 31 Aug 2022 22:29:00 +0200 Subject: [PATCH] update code --- htdocs/fichinter/list.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index d8bb62f6b5d..733dac71987 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } if (!empty($conf->contrat->enabled)) { @@ -43,7 +43,7 @@ if (!empty($conf->contrat->enabled)) { // Load translation files required by the page $langs->loadLangs(array('companies', 'bills', 'interventions')); -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { $langs->load("projects"); } if (!empty($conf->contrat->enabled)) { @@ -120,7 +120,7 @@ $arrayfields = array( 'f.ref'=>array('label'=>'Ref', 'checked'=>1), 'f.ref_client'=>array('label'=>'RefCustomer', 'checked'=>1), 's.nom'=>array('label'=>'ThirdParty', 'checked'=>1), - 'pr.ref'=>array('label'=>'Project', 'checked'=>1, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1)), + 'pr.ref'=>array('label'=>'Project', 'checked'=>1, 'enabled'=>(!isModEnabled('project') ? 0 : 1)), 'c.ref'=>array('label'=>'Contract', 'checked'=>1, 'enabled'=>(empty($conf->contrat->enabled) ? 0 : 1)), 'f.description'=>array('label'=>'Description', 'checked'=>1), 'f.datec'=>array('label'=>'DateCreation', 'checked'=>0, 'position'=>500), @@ -202,7 +202,7 @@ $form = new Form($db); $formfile = new FormFile($db); $objectstatic = new Fichinter($db); $companystatic = new Societe($db); -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { $projetstatic = new Project($db); } if (!empty($conf->contrat->enabled)) { @@ -234,7 +234,7 @@ if (empty($conf->global->FICHINTER_DISABLE_DETAILS) && $atleastonefieldinlines) $sql .= " fd.rowid as lineid, fd.description as descriptiondetail, fd.date as dp, fd.duree,"; } $sql .= " s.nom as name, s.rowid as socid, s.client, s.fournisseur, s.email, s.status as thirdpartystatus"; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { $sql .= ", pr.rowid as projet_id, pr.ref as projet_ref, pr.title as projet_title"; } if (!empty($conf->contrat->enabled)) { @@ -251,7 +251,7 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f"; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as pr on f.fk_projet = pr.rowid"; } if (!empty($conf->contrat->enabled)) {