From eb8097d81c56e1cb415efffd00f517bc203c5f89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Wed, 31 Aug 2022 22:23:32 +0200 Subject: [PATCH] use isModEnabled --- htdocs/admin/delais.php | 12 ++++++++---- htdocs/admin/mails_templates.php | 2 +- htdocs/core/lib/functions.lib.php | 2 +- htdocs/ecm/index_auto.php | 2 +- htdocs/ecm/search.php | 2 +- htdocs/hrm/index.php | 4 ++-- htdocs/recruitment/index.php | 6 +++--- 7 files changed, 17 insertions(+), 13 deletions(-) diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index e64d1bda876..5c2f6e8b3ea 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -319,16 +319,20 @@ if (empty($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METE $cursor = 10; // By default //if (!empty($conf->global->MAIN_METEO_OFFSET)) $offset=$conf->global->MAIN_METEO_OFFSET; //if (!empty($conf->global->MAIN_METEO_GAP)) $cursor=$conf->global->MAIN_METEO_GAP; - $level0 = $offset; if (!empty($conf->global->MAIN_METEO_LEVEL0)) { + $level0 = $offset; + if (!empty($conf->global->MAIN_METEO_LEVEL0)) { $level0 = $conf->global->MAIN_METEO_LEVEL0; } - $level1 = $offset + 1 * $cursor; if (!empty($conf->global->MAIN_METEO_LEVEL1)) { + $level1 = $offset + 1 * $cursor; + if (!empty($conf->global->MAIN_METEO_LEVEL1)) { $level1 = $conf->global->MAIN_METEO_LEVEL1; } - $level2 = $offset + 2 * $cursor; if (!empty($conf->global->MAIN_METEO_LEVEL2)) { + $level2 = $offset + 2 * $cursor; + if (!empty($conf->global->MAIN_METEO_LEVEL2)) { $level2 = $conf->global->MAIN_METEO_LEVEL2; } - $level3 = $offset + 3 * $cursor; if (!empty($conf->global->MAIN_METEO_LEVEL3)) { + $level3 = $offset + 3 * $cursor; + if (!empty($conf->global->MAIN_METEO_LEVEL3)) { $level3 = $conf->global->MAIN_METEO_LEVEL3; } $text = ''; $options = 'class="valignmiddle" height="60px"'; diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index e9b36be353a..10c8ed29801 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -182,7 +182,7 @@ $elementList['user'] = img_picto('', 'user', 'class="pictofixedwidth"').dol_esca if (isModEnabled('adherent') && !empty($user->rights->adherent->lire)) { $elementList['member'] = img_picto('', 'object_member', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToMember')); } -if (!empty($conf->recruitment->enabled) && !empty($user->rights->recruitment->recruitmentjobposition->read)) { +if (isModEnabled('recruitment') && !empty($user->rights->recruitment->recruitmentjobposition->read)) { $elementList['recruitmentcandidature_send'] = img_picto('', 'recruitmentcandidature', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('RecruitmentCandidatures')); } if (isModEnabled("societe") && !empty($user->rights->societe->lire)) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 895dfe5b5cf..6c297a53bd9 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7393,7 +7393,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__TICKET_USER_ASSIGN__'] = '__TICKET_USER_ASSIGN__'; } - if (!empty($conf->recruitment->enabled) && (!is_object($object) || $object->element == 'recruitmentcandidature')) { + if (isModEnabled('recruitment') && (!is_object($object) || $object->element == 'recruitmentcandidature')) { $substitutionarray['__CANDIDATE_FULLNAME__'] = '__CANDIDATE_FULLNAME__'; $substitutionarray['__CANDIDATE_FIRSTNAME__'] = '__CANDIDATE_FIRSTNAME__'; $substitutionarray['__CANDIDATE_LASTNAME__'] = '__CANDIDATE_LASTNAME__'; diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index 70e22db92a2..c91882e5ab5 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -372,7 +372,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) { $langs->load("mrp"); $rowspan++; $sectionauto[] = array('position'=>200, 'level'=>1, 'module'=>'mrp-mo', 'test'=>$conf->mrp->enabled, 'label'=>$langs->trans("MOs"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ManufacturingOrders"))); } - if (!empty($conf->recruitment->enabled)) { + if (isModEnabled('recruitment')) { $langs->load("recruitment"); $rowspan++; $sectionauto[] = array('position'=>210, 'level'=>1, 'module'=>'recruitment-recruitmentcandidature', 'test'=>$conf->recruitment->enabled, 'label'=>$langs->trans("Candidatures"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("JobApplications"))); } diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index bb22566ef1e..2b284e43b0f 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -161,7 +161,7 @@ if (isModEnabled("banque")) { if (!empty($conf->mrp->enabled)) { $langs->load("mrp"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'mrp-mo', 'test'=>$conf->mrp->enabled, 'label'=>$langs->trans("MOs"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ManufacturingOrders"))); } -if (!empty($conf->recruitment->enabled)) { +if (isModEnabled('recruitment')) { $langs->load("recruitment"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'recruitment-recruitmentcandidature', 'test'=>$conf->recruitment->enabled, 'label'=>$langs->trans("Candidatures"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("JobApplications"))); } diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index a86783db2d3..cbbd66cec47 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -43,7 +43,7 @@ if (isModEnabled('deplacement')) { if (isModEnabled('expensereport')) { require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; } -if (!empty($conf->recruitment->enabled)) { +if (isModEnabled('recruitment')) { require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentcandidature.class.php'; require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentjobposition.class.php'; } @@ -342,7 +342,7 @@ if (isModEnabled('expensereport') && $user->rights->expensereport->lire) { // Last modified job position -if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitmentjobposition->read) { +if (isModEnabled('recruitment') && $user->rights->recruitment->recruitmentjobposition->read) { $staticrecruitmentcandidature = new RecruitmentCandidature($db); $staticrecruitmentjobposition = new RecruitmentJobPosition($db); $sql = "SELECT rc.rowid, rc.ref, rc.email, rc.lastname, rc.firstname, rc.date_creation, rc.tms, rc.status,"; diff --git a/htdocs/recruitment/index.php b/htdocs/recruitment/index.php index f34334c2df6..80ef1c9fbd9 100644 --- a/htdocs/recruitment/index.php +++ b/htdocs/recruitment/index.php @@ -242,7 +242,7 @@ print '
'; /* BEGIN MODULEBUILDER DRAFT MYOBJECT // Draft MyObject -if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->read) +if (isModEnabled('recruitment') && $user->rights->recruitment->read) { $langs->load("orders"); @@ -327,7 +327,7 @@ $NBMAX = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; // Last modified job position -if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitmentjobposition->read) { +if (isModEnabled('recruitment') && $user->rights->recruitment->recruitmentjobposition->read) { $sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms, s.status, COUNT(rc.rowid) as nbapplications"; $sql .= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as s"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rc ON rc.fk_recruitmentjobposition = s.rowid"; @@ -398,7 +398,7 @@ if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitme } // Last modified job position -if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitmentjobposition->read) { +if (isModEnabled('recruitment') && $user->rights->recruitment->recruitmentjobposition->read) { $sql = "SELECT rc.rowid, rc.ref, rc.email, rc.lastname, rc.firstname, rc.date_creation, rc.tms, rc.status"; $sql .= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rc"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as s ON rc.fk_recruitmentjobposition = s.rowid";