';
@@ -450,7 +450,7 @@ if (!isset($_SERVER['WINDIR'])) {
}
// Module products
-if (!empty($conf->product->enabled)) {
+if (isModEnabled('product')) {
print '
'."\n";
// Barcode
-if (!empty($conf->barcode->enabled)) {
+if (isModEnabled('barcode')) {
print '
| ';
print ' | ';
print '';
diff --git a/htdocs/barcode/codeinit.php b/htdocs/barcode/codeinit.php
index ff0ecbf0d01..fe8ff50cf96 100644
--- a/htdocs/barcode/codeinit.php
+++ b/htdocs/barcode/codeinit.php
@@ -355,7 +355,7 @@ if (isModEnabled('societe')) {
// For products
-if ($conf->product->enabled || $conf->product->service) {
+if (isModEnabled('product') || isModEnabled('service')) {
print ' |
';
// Barcode
- if (!empty($conf->barcode->enabled)) {
+ if (isModEnabled('barcode')) {
$formbarcode = new FormBarCode($db);
// Barcode type
@@ -913,10 +913,10 @@ END;
'pfp.multicurrency_unitprice'=>array('label'=>$langs->trans("UnitPriceHTCurrency"), 'enabled' => (!empty($conf->multicurrency->enabled)), 'checked'=>0, 'position'=>10),
'pfp.delivery_time_days'=>array('label'=>$langs->trans("NbDaysToDelivery"), 'checked'=>1, 'position'=>13),
'pfp.supplier_reputation'=>array('label'=>$langs->trans("ReputationForThisProduct"), 'checked'=>1, 'position'=>14),
- 'pfp.fk_barcode_type'=>array('label'=>$langs->trans("BarcodeType"), 'enabled' => !empty($conf->barcode->enabled), 'checked'=>0, 'position'=>15),
- 'pfp.barcode'=>array('label'=>$langs->trans("BarcodeValue"), 'enabled' => !empty($conf->barcode->enabled), 'checked'=>0, 'position'=>16),
+ 'pfp.fk_barcode_type'=>array('label'=>$langs->trans("BarcodeType"), 'enabled' => isModEnabled('barcode'), 'checked'=>0, 'position'=>15),
+ 'pfp.barcode'=>array('label'=>$langs->trans("BarcodeValue"), 'enabled' => isModEnabled('barcode'), 'checked'=>0, 'position'=>16),
'pfp.packaging'=>array('label'=>$langs->trans("PackagingForThisProduct"), 'enabled' => !empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING), 'checked'=>0, 'position'=>17),
- 'pfp.tms'=>array('label'=>$langs->trans("DateModification"), 'enabled' => !empty($conf->barcode->enabled), 'checked'=>1, 'position'=>18),
+ 'pfp.tms'=>array('label'=>$langs->trans("DateModification"), 'enabled' => isModEnabled('barcode'), 'checked'=>1, 'position'=>18),
);
// fetch optionals attributes and labels
diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php
index 00523c6bf3d..cdcfe74cb73 100644
--- a/htdocs/product/inventory/inventory.php
+++ b/htdocs/product/inventory/inventory.php
@@ -608,7 +608,7 @@ if ($object->id > 0) {
if (!empty($conf->use_javascript_ajax)) {
if ($permissiontoadd) {
// Link to launch scan tool
- if (!empty($conf->barcode->enabled) || !empty($conf->productbatch->enabled)) {
+ if (isModEnabled('barcode') || !empty($conf->productbatch->enabled)) {
print '
';
}
diff --git a/htdocs/product/list.php b/htdocs/product/list.php
index 8f2eed18829..4cc79472ada 100644
--- a/htdocs/product/list.php
+++ b/htdocs/product/list.php
@@ -179,7 +179,7 @@ if (!empty($conf->global->MAIN_MULTILANGS)) {
$fieldstosearchall['pl.description'] = 'ProductDescriptionTranslated';
$fieldstosearchall['pl.note'] = 'ProductNoteTranslated';
}
-if (!empty($conf->barcode->enabled)) {
+if (isModEnabled('barcode')) {
$fieldstosearchall['p.barcode'] = 'Gencod';
$fieldstosearchall['pfp.barcode'] = 'GencodBuyPrice';
}
@@ -207,7 +207,7 @@ $arrayfields = array(
'thumbnail'=>array('label'=>'Photo', 'checked'=>0, 'position'=>10),
'p.label'=>array('label'=>"Label", 'checked'=>1, 'position'=>10),
'p.fk_product_type'=>array('label'=>"Type", 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && !empty($conf->service->enabled)), 'position'=>11),
- 'p.barcode'=>array('label'=>"Gencod", 'checked'=>1, 'enabled'=>(!empty($conf->barcode->enabled)), 'position'=>12),
+ 'p.barcode'=>array('label'=>"Gencod", 'checked'=>1, 'enabled'=>(isModEnabled('barcode')), 'position'=>12),
'p.duration'=>array('label'=>"Duration", 'checked'=>($contextpage != 'productlist'), 'enabled'=>(!empty($conf->service->enabled) && (string) $type == '1'), 'position'=>13),
'p.finished'=>array('label'=>"Nature", 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && $type != '1'), 'position'=>19),
'p.weight'=>array('label'=>'Weight', 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && $type != '1'), 'position'=>20),
diff --git a/htdocs/societe/canvas/company/tpl/card_create.tpl.php b/htdocs/societe/canvas/company/tpl/card_create.tpl.php
index 2deb1dba8b1..58752a1bc7b 100644
--- a/htdocs/societe/canvas/company/tpl/card_create.tpl.php
+++ b/htdocs/societe/canvas/company/tpl/card_create.tpl.php
@@ -105,7 +105,7 @@ if (empty($conf) || !is_object($conf)) {
barcode->enabled)) { ?>
+if (isModEnabled('barcode')) { ?>
';
// Barcode
- if (!empty($conf->barcode->enabled)) {
+ if (isModEnabled('barcode')) {
print '
\n";
// Barcode rule to insert product
-if (!empty($conf->barcode->enabled)) {
+if (isModEnabled('barcode')) {
print '