From 0b8179d7ef59e990f73d867e91bf703975b52d56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Thu, 9 Jun 2022 22:49:48 +0200 Subject: [PATCH] use isModEnabled function --- htdocs/accountancy/supplier/index.php | 4 ++-- htdocs/barcode/codeinit.php | 2 +- htdocs/hrm/index.php | 4 ++-- htdocs/product/stock/stocktransfer/stocktransfer_card.php | 2 +- htdocs/projet/card.php | 4 ++-- htdocs/recruitment/recruitmentindex.php | 8 ++++---- htdocs/ticket/class/ticket.class.php | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index e46b508512d..d350e2243a2 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -38,7 +38,7 @@ $validatemonth = GETPOST('validatemonth', 'int'); $validateyear = GETPOST('validateyear', 'int'); // Security check -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { @@ -75,7 +75,7 @@ $action = GETPOST('action', 'aZ09'); $chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); // Security check -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { diff --git a/htdocs/barcode/codeinit.php b/htdocs/barcode/codeinit.php index 1a5f99b27ee..b4e365fe018 100644 --- a/htdocs/barcode/codeinit.php +++ b/htdocs/barcode/codeinit.php @@ -188,7 +188,7 @@ print ''; print '
'; // For thirdparty -if ($conf->societe->enabled) { +if (isModEnabled('societe')) { $nbno = $nbtotal = 0; print load_fiche_titre($langs->trans("BarcodeInitForThirdparties"), '', 'company'); diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index c573b78ed51..1160ee0fc14 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -343,11 +343,11 @@ if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitme $sql.= " rp.rowid as jobid, rp.ref as jobref, rp.label"; $sql .= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rc"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as rp ON rc.fk_recruitmentjobposition = rp.rowid"; - if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) { + if (isModEnabled('societe') && empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE rc.entity IN (".getEntity($staticrecruitmentcandidature->element).")"; - if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) { + if (isModEnabled('societe') && empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND rp.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_card.php b/htdocs/product/stock/stocktransfer/stocktransfer_card.php index 84e87dd32f1..5c68a373c11 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_card.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_card.php @@ -592,7 +592,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref = '
'; // Thirdparty - if ($conf->societe->enabled) { + if (isModEnabled('societe')) { $morehtmlref .= $langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '').'
'; } // Project diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 65cf89c89da..6cc761d0ade 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -602,7 +602,7 @@ if ($action == 'create' && $user->rights->projet->creer) { } // Thirdparty - if ($conf->societe->enabled) { + if (isModEnabled('societe')) { print ''; print (empty($conf->global->PROJECT_THIRDPARTY_REQUIRED) ? '' : ''); print $langs->trans("ThirdParty"); @@ -898,7 +898,7 @@ if ($action == 'create' && $user->rights->projet->creer) { print ''; // Thirdparty - if ($conf->societe->enabled) { + if (isModEnabled('societe')) { print ''; print (empty($conf->global->PROJECT_THIRDPARTY_REQUIRED) ? '' : ''); print $langs->trans("ThirdParty"); diff --git a/htdocs/recruitment/recruitmentindex.php b/htdocs/recruitment/recruitmentindex.php index b4d943584cd..f028f2f8243 100644 --- a/htdocs/recruitment/recruitmentindex.php +++ b/htdocs/recruitment/recruitmentindex.php @@ -331,11 +331,11 @@ if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitme $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"; - if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) { + if (isModEnabled('societe') && empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE s.entity IN (".getEntity($staticrecruitmentjobposition->element).")"; - if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) { + if (isModEnabled('societe') && empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { @@ -402,11 +402,11 @@ if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitme $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"; - if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) { + if (isModEnabled('societe') && empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE rc.entity IN (".getEntity($staticrecruitmentjobposition->element).")"; - if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$socid) { + if (isModEnabled('societe') && empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index e267ffce6c1..c93def7b49a 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2860,7 +2860,7 @@ class Ticket extends CommonObject $sql = "SELECT p.rowid, p.ref, p.datec as datec"; $sql .= " FROM ".MAIN_DB_PREFIX."ticket as p"; - if ($conf->societe->enabled && empty($user->rights->societe->client->voir) && !$user->socid) { + if (isModEnabled('societe') && empty($user->rights->societe->client->voir) && !$user->socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON p.fk_soc = sc.fk_soc"; $sql .= " WHERE sc.fk_user = ".((int) $user->id); $clause = " AND";