diff --git a/htdocs/mrp/mo_note.php b/htdocs/mrp/mo_note.php index c32751b28d4..031018d0daa 100644 --- a/htdocs/mrp/mo_note.php +++ b/htdocs/mrp/mo_note.php @@ -107,7 +107,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 25c43e46920..24b3516684e 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -482,7 +482,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea }*/ $formquestion = array(); - if (!empty($conf->mrp->enabled)) { + if (isModEnabled('mrp')) { $langs->load("mrp"); require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; $formproduct = new FormProduct($db); @@ -525,7 +525,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index d28eca5252a..ca71ed3030b 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -313,7 +313,7 @@ if (empty($reshook)) { $error++; setEventMessages($object->error, $object->errors, 'errors'); } else { - if (!empty($conf->dynamicprices->enabled) && $price_expression !== '') { + if (isModEnabled('dynamicprices') && $price_expression !== '') { //Check the expression validity by parsing it $priceparser = new PriceParser($db); $object->fk_supplier_price_expression = $price_expression; @@ -323,7 +323,7 @@ if (empty($reshook)) { setEventMessages($priceparser->translatedError(), null, 'errors'); } } - if (!$error && !empty($conf->dynamicprices->enabled)) { + if (!$error && isModEnabled('dynamicprices')) { //Set the price expression for this supplier price $ret = $object->setSupplierPriceExpression($price_expression); if ($ret < 0) { @@ -635,7 +635,7 @@ if ($id > 0 || $ref) { print ''; print ''; - if (!empty($conf->dynamicprices->enabled)) { //Only show price mode and expression selector if module is enabled + if (isModEnabled('dynamicprices')) { //Only show price mode and expression selector if module is enabled // Price mode selector print ''.$langs->trans("PriceMode").''; $price_expression = new PriceExpression($db); @@ -803,7 +803,7 @@ END; // Option to define a transport cost on supplier price if (!empty($conf->global->PRODUCT_CHARGES)) { - if (!empty($conf->margin->enabled)) { + if (isModEnabled('margin')) { print ''; print ''.$langs->trans("Charges").''; print ''; diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 2eb281e734c..3561388709d 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -165,7 +165,7 @@ if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE) - || !empty($conf->mrp->enabled)) { + || isModEnabled('mrp')) { $virtualdiffersfromphysical = 1; // According to increase/decrease stock options, virtual and physical stock may differs. }