Use IsModEnabled

This commit is contained in:
Alexandre SPANGARO
2022-08-29 10:47:07 +02:00
parent 6a0978580e
commit 5a2fb2c3f4

View File

@@ -34,12 +34,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.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.'/core/class/html.formprojet.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
}
if (!empty($conf->contrat->enabled)) {
if (isModEnabled('contrat')) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formcontract.class.php';
@@ -698,7 +698,7 @@ if (empty($reshook)) {
$userstat = new User($db);
$form = new Form($db);
$formticket = new FormTicket($db);
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$formproject = new FormProjets($db);
}
@@ -940,7 +940,7 @@ if ($action == 'create' || $action == 'presend') {
}
// Thirdparty
if (!empty($conf->societe->enabled)) {
if (isModEnabled('societe')) {
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' ';
if ($action != 'editcustomer' && $object->status < 8 && !$user->socid && $user->rights->ticket->write) {
$morehtmlref .= '<a class="editfielda" href="'.$url_page_current.'?action=editcustomer&token='.newToken().'&track_id='.$object->track_id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 0).'</a> : ';
@@ -953,7 +953,7 @@ if ($action == 'create' || $action == 'presend') {
}
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->ticket->write) {
@@ -1107,7 +1107,7 @@ if ($action == 'create' || $action == 'presend') {
print '</tr>';
// Timing (Duration sum of linked fichinter)
if (!empty($conf->ficheinter->enabled)) {
if (isModEnabled('ficheinter')) {
$object->fetchObjectLinked();
$num = count($object->linkedObjects);
$timing = 0;