From 6c848333e6cc22e5a7c9fa88e65b6f56eccf1c3d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 15:30:40 +0200 Subject: [PATCH] Use isModEnabled --- htdocs/fourn/class/fournisseur.product.class.php | 4 ++-- htdocs/fourn/facture/list.php | 2 +- htdocs/hrm/admin/admin_establishment.php | 2 +- htdocs/hrm/admin/admin_hrm.php | 2 +- htdocs/hrm/establishment/card.php | 2 +- htdocs/hrm/establishment/info.php | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 5524783e275..16bc43474d8 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -738,7 +738,7 @@ class ProductFournisseur extends Product $prodfourn->supplier_fk_barcode_type = $record["fk_barcode_type"]; } - if (!empty($conf->dynamicprices->enabled) && !empty($prodfourn->fk_supplier_price_expression)) { + if (isModEnabled('dynamicprices') && !empty($prodfourn->fk_supplier_price_expression)) { $priceparser = new PriceParser($this->db); $price_result = $priceparser->parseProductSupplier($prodfourn); if ($price_result >= 0) { @@ -844,7 +844,7 @@ class ProductFournisseur extends Product $fourn_unitprice = $record["unitprice"]; $fourn_unitprice_with_discount = $record["unitprice"] * (1 - $record["remise_percent"] / 100); - if (!empty($conf->dynamicprices->enabled) && !empty($record["fk_supplier_price_expression"])) { + if (isModEnabled('dynamicprices') && !empty($record["fk_supplier_price_expression"])) { $prod_supplier = new ProductFournisseur($this->db); $prod_supplier->product_fourn_price_id = $record["product_fourn_price_id"]; $prod_supplier->id = $prodid; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 413c2c3f853..6e006704a83 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -839,7 +839,7 @@ if ($resql) { //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); - if (!empty($conf->paymentbybanktransfer->enabled) && !empty($user->rights->paymentbybanktransfer->create)) { + if (isModEnabled('paymentbybanktransfer') && !empty($user->rights->paymentbybanktransfer->create)) { $langs->load('withdrawals'); $arrayofmassactions['banktransfertrequest'] = img_picto('', 'payment', 'class="pictofixedwidth"').$langs->trans("MakeBankTransferOrder"); } diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php index 00722526e9d..99212988488 100644 --- a/htdocs/hrm/admin/admin_establishment.php +++ b/htdocs/hrm/admin/admin_establishment.php @@ -40,7 +40,7 @@ $permissiontoadd = $user->admin; //if ($user->socid > 0) $socid = $user->socid; //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); //restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', 0); -if (empty($conf->hrm->enabled)) accessforbidden(); +if (!isModEnabled('hrm')) accessforbidden(); if (empty($permissiontoread)) accessforbidden(); $sortorder = GETPOST('sortorder', 'aZ09comma'); diff --git a/htdocs/hrm/admin/admin_hrm.php b/htdocs/hrm/admin/admin_hrm.php index dc8d20403a3..ece067ce072 100644 --- a/htdocs/hrm/admin/admin_hrm.php +++ b/htdocs/hrm/admin/admin_hrm.php @@ -46,7 +46,7 @@ $permissiontoadd = $user->admin; //if ($user->socid > 0) $socid = $user->socid; //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); //restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', 0); -if (empty($conf->hrm->enabled)) accessforbidden(); +if (!isModEnabled('hrm')) accessforbidden(); if (empty($permissiontoread)) accessforbidden(); diff --git a/htdocs/hrm/establishment/card.php b/htdocs/hrm/establishment/card.php index 14ae1364494..f1bddce44e4 100644 --- a/htdocs/hrm/establishment/card.php +++ b/htdocs/hrm/establishment/card.php @@ -61,7 +61,7 @@ $upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->enti //if ($user->socid > 0) $socid = $user->socid; //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); //restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', 0); -if (empty($conf->hrm->enabled)) accessforbidden(); +if (!isModEnabled('hrm')) accessforbidden(); if (empty($permissiontoread)) accessforbidden(); diff --git a/htdocs/hrm/establishment/info.php b/htdocs/hrm/establishment/info.php index d5f7f8a6b36..641c53e0f70 100644 --- a/htdocs/hrm/establishment/info.php +++ b/htdocs/hrm/establishment/info.php @@ -86,7 +86,7 @@ $upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->enti //if ($user->socid > 0) $socid = $user->socid; //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); //restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->hrm->enabled)) accessforbidden(); +if (!isModEnabled('hrm')) accessforbidden(); if (empty($permissiontoread)) accessforbidden();