Use isModEnabled

This commit is contained in:
Alexandre SPANGARO 2022-08-29 11:23:40 +02:00
parent d633576ed9
commit 6fd2bbe46c

View File

@ -34,7 +34,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
//include_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; //include_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
} }
@ -924,7 +924,7 @@ llxHeader('', $langs->trans("RepeatableInvoices"), $help_url);
$form = new Form($db); $form = new Form($db);
$formother = new FormOther($db); $formother = new FormOther($db);
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$formproject = new FormProjets($db); $formproject = new FormProjets($db);
} }
$companystatic = new Societe($db); $companystatic = new Societe($db);
@ -954,7 +954,7 @@ if ($action == 'create') {
print dol_get_fiche_head(null, '', '', 0); print dol_get_fiche_head(null, '', '', 0);
$rowspan = 4; $rowspan = 4;
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$rowspan++; $rowspan++;
} }
if ($object->fk_account > 0) { if ($object->fk_account > 0) {
@ -1047,7 +1047,7 @@ if ($action == 'create') {
} }
// Project // Project
if (!empty($conf->project->enabled) && is_object($object->thirdparty) && $object->thirdparty->id > 0) { if (isModEnabled('project') && is_object($object->thirdparty) && $object->thirdparty->id > 0) {
$projectid = GETPOST('projectid') ?GETPOST('projectid') : $object->fk_project; $projectid = GETPOST('projectid') ?GETPOST('projectid') : $object->fk_project;
$langs->load('projects'); $langs->load('projects');
print '<tr><td>'.$langs->trans('Project').'</td><td>'; print '<tr><td>'.$langs->trans('Project').'</td><td>';
@ -1203,7 +1203,7 @@ if ($action == 'create') {
// Thirdparty // Thirdparty
$morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project // Project
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$langs->load("projects"); $langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' '; $morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->facture->creer) { if ($user->rights->facture->creer) {