Use isModEnabled

This commit is contained in:
Alexandre SPANGARO 2022-09-25 06:13:22 +02:00
parent bcd5043eb2
commit 5eaffd64e7
5 changed files with 6 additions and 6 deletions

View File

@ -2827,7 +2827,7 @@ if ($action == 'create' && $usercancreate) {
}
// Create intervention
if (!empty($conf->ficheinter->enabled)) {
if (isModEnabled('ficheinter')) {
$langs->load("interventions");
if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0) {

View File

@ -170,7 +170,7 @@ if ($object->thirdparty->client) {
}
}
if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire) {
if (isModEnabled('ficheinter') && $user->rights->ficheinter->lire) {
$elementTypeArray['fichinter'] = $langs->transnoentitiesnoconv('Interventions');
}

View File

@ -8614,7 +8614,7 @@ class Form
}
} elseif ($objecttype == 'ficheinter') {
$tplpath = 'fichinter';
if (empty($conf->ficheinter->enabled)) {
if (!isModEnabled('ficheinter')) {
continue; // Do not show if module disabled
}
} elseif ($objecttype == 'invoice_supplier') {

View File

@ -92,7 +92,7 @@ function contact_prepare_head(Contact $object)
}
// Related items
if (isModEnabled('commande') || isModEnabled("propal") || isModEnabled('facture') || !empty($conf->ficheinter->enabled) || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
if (isModEnabled('commande') || isModEnabled("propal") || isModEnabled('facture') || isModEnabled('ficheinter') || (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) {
$head[$tab][0] = DOL_URL_ROOT.'/contact/consumption.php?id='.$object->id;
$head[$tab][1] = $langs->trans("Referers");
$head[$tab][2] = 'consumption';

View File

@ -127,7 +127,7 @@ function project_prepare_head(Project $project, $moreparam = '')
if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))
|| isModEnabled("propal") || isModEnabled('commande')
|| isModEnabled('facture') || isModEnabled('contrat')
|| !empty($conf->ficheinter->enabled) || isModEnabled('agenda') || isModEnabled('deplacement') || isModEnabled('stock')) {
|| isModEnabled('ficheinter') || isModEnabled('agenda') || isModEnabled('deplacement') || isModEnabled('stock')) {
$nbElements = 0;
// Enable caching of thirdrparty count Contacts
$cachekey = 'count_elements_project_'.$project->id;
@ -162,7 +162,7 @@ function project_prepare_head(Project $project, $moreparam = '')
if (isModEnabled('contrat')) {
$nbElements += $project->getElementCount('contract', 'contrat');
}
if (!empty($conf->ficheinter->enabled)) {
if (isModEnabled('ficheinter')) {
$nbElements += $project->getElementCount('intervention', 'fichinter');
}
if (isModEnabled("expedition")) {