update code

This commit is contained in:
Philippe GRAND 2022-08-31 22:29:00 +02:00
parent ee0607ace2
commit 8568f66d42

View File

@ -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)) {