Use isModEnabled

This commit is contained in:
Alexandre SPANGARO 2022-08-29 11:27:44 +02:00
parent dd7dece5e8
commit 3ccb87e1fb

View File

@ -33,7 +33,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/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.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';
} }
@ -101,7 +101,7 @@ if ($action == 'setlib' && $user->rights->tax->charges->creer) {
*/ */
$form = new Form($db); $form = new Form($db);
if (!empty($conf->project->enabled)) { if (isModEnabled('project')) {
$formproject = new FormProjets($db); $formproject = new FormProjets($db);
} }
@ -121,7 +121,7 @@ if ($object->id) {
$morehtmlref .= $form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1); $morehtmlref .= $form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1);
$morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1); $morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 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 (!empty($object->fk_project)) { if (!empty($object->fk_project)) {