Use isModEnabled

This commit is contained in:
Alexandre SPANGARO 2022-09-25 06:13:14 +02:00
parent 8ca01513d5
commit bcd5043eb2
5 changed files with 10 additions and 10 deletions

View File

@ -207,7 +207,7 @@ if (isModEnabled("expedition")) {
if (isModEnabled("reception")) {
$elementList['reception_send'] = img_picto('', 'dollyrevert', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendReception'));
}
if (!empty($conf->ficheinter->enabled)) {
if (isModEnabled('ficheinter')) {
$elementList['fichinter_send'] = img_picto('', 'intervention', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendIntervention'));
}
if (isModEnabled('supplier_proposal')) {

View File

@ -75,7 +75,7 @@ $workflowcodes = array(
'WORKFLOW_TICKET_CREATE_INTERVENTION' => array (
'family'=>'create',
'position'=>25,
'enabled'=>(!empty($conf->ticket->enabled) && !empty($conf->ficheinter->enabled)),
'enabled'=>(!empty($conf->ticket->enabled) && isModEnabled('ficheinter')),
'picto'=>'ticket'
),

View File

@ -60,7 +60,7 @@ if (isModEnabled('contrat')) {
if (isModEnabled('adherent')) {
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
}
if (!empty($conf->ficheinter->enabled)) {
if (isModEnabled('ficheinter')) {
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
}
@ -82,7 +82,7 @@ if (isModEnabled('facture')) {
if (isModEnabled('project')) {
$langs->load("projects");
}
if (!empty($conf->ficheinter->enabled)) {
if (isModEnabled('ficheinter')) {
$langs->load("interventions");
}
if (!empty($conf->notification->enabled)) {
@ -1231,7 +1231,7 @@ if ($object->id > 0) {
/*
* Latest interventions
*/
if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire) {
if (isModEnabled('ficheinter') && $user->rights->ficheinter->lire) {
$sql = "SELECT s.nom, s.rowid, f.rowid as id, f.ref, f.fk_statut, f.duree as duration, f.datei as startdate, f.entity";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as f";
$sql .= " WHERE f.fk_soc = s.rowid";
@ -1564,7 +1564,7 @@ if ($object->id > 0) {
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddContract").'</a></div>';
}
if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer && $object->status == 1) {
if (isModEnabled('ficheinter') && $user->rights->ficheinter->creer && $object->status == 1) {
$langs->load("fichinter");
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/card.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddIntervention").'</a></div>';
}

View File

@ -40,7 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
if (!empty($conf->ficheinter->enabled)) {
if (isModEnabled('ficheinter')) {
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
}
@ -104,7 +104,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
$supplierorderstatic = new CommandeFournisseur($db);
}
if (!empty($conf->ficheinter->enabled)) {
if (isModEnabled('ficheinter')) {
$fichinterstatic = new Fichinter($db);
}
@ -519,7 +519,7 @@ if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO
/*
* Draft interventionals
*/
if (!empty($conf->ficheinter->enabled)) {
if (isModEnabled('ficheinter')) {
$sql = "SELECT f.rowid, f.ref, s.nom as name, f.fk_statut";
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client";

View File

@ -2880,7 +2880,7 @@ if ($action == 'create') {
}
// Create an intervention
if (isModEnabled("service") && !empty($conf->ficheinter->enabled) && $object->statut == Propal::STATUS_SIGNED) {
if (isModEnabled("service") && isModEnabled('ficheinter') && $object->statut == Propal::STATUS_SIGNED) {
if ($usercancreateintervention) {
$langs->load("interventions");
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddIntervention").'</a>';