From 49f1afccca09cf94d6714eec63c0a6e33d8ac838 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 25 Sep 2022 06:09:29 +0200 Subject: [PATCH] Use isModEnabled --- htdocs/comm/propal/card.php | 4 ++-- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/lib/product.lib.php | 2 +- htdocs/fourn/commande/card.php | 4 ++-- htdocs/fourn/facture/card.php | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 3f21f89192b..84db90fd6e0 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -55,7 +55,7 @@ if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } -if (!empty($conf->variants->enabled)) { +if (isModEnabled('variants')) { require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php'; } @@ -976,7 +976,7 @@ if (empty($reshook)) { $error++; } - if (!$error && !empty($conf->variants->enabled) && $prod_entry_mode != 'free') { + if (!$error && isModEnabled('variants') && $prod_entry_mode != 'free') { if ($combinations = GETPOST('combinations', 'array')) { //Check if there is a product with the given combination $prodcomb = new ProductCombination($db); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 025bfcc8b34..d34b6cce69f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2313,7 +2313,7 @@ class Form } $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); - if (!empty($conf->variants->enabled) && is_array($selected_combinations)) { + if (isModEnabled('variants') && is_array($selected_combinations)) { // Code to automatically insert with javascript the select of attributes under the select of product // when a parent of variant has been selected. $out .= ' diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index cb79e006ba7..59373e39cd3 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -94,7 +94,7 @@ function product_prepare_head($object) $h++; } - if (!empty($conf->variants->enabled) && ($object->isProduct() || $object->isService())) { + if (isModEnabled('variants') && ($object->isProduct() || $object->isService())) { global $db; require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php'; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index d0a27b306ff..9303c6eaf31 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -58,7 +58,7 @@ if (isModEnabled('project')) { } require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP -if (!empty($conf->variants->enabled)) { +if (isModEnabled('variants')) { require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php'; } @@ -485,7 +485,7 @@ if (empty($reshook)) { $error++; } - if (!$error && !empty($conf->variants->enabled) && $prod_entry_mode != 'free') { + if (!$error && isModEnabled('variants') && $prod_entry_mode != 'free') { if ($combinations = GETPOST('combinations', 'array')) { //Check if there is a product with the given combination $prodcomb = new ProductCombination($db); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index b15e5ae0adc..4528c0cb0c2 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -55,7 +55,7 @@ if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } -if (!empty($conf->variants->enabled)) { +if (isModEnabled('variants')) { require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php'; } if (isModEnabled('accounting')) { @@ -1465,7 +1465,7 @@ if (empty($reshook)) { $error++; } - if (!$error && !empty($conf->variants->enabled) && $prod_entry_mode != 'free') { + if (!$error && isModEnabled('variants') && $prod_entry_mode != 'free') { if ($combinations = GETPOST('combinations', 'array')) { //Check if there is a product with the given combination $prodcomb = new ProductCombination($db);