2
0
forked from Wavyzz/dolibarr

Use isModEnabled

This commit is contained in:
Alexandre SPANGARO
2022-09-25 06:09:29 +02:00
parent 2a8b32ff98
commit 49f1afccca
5 changed files with 8 additions and 8 deletions

View File

@@ -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);

View File

@@ -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 .= '

View File

@@ -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';

View File

@@ -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);

View File

@@ -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);