From e0f7637bb316dfec30c2d07f39fdba1fa5b14d05 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Feb 2012 22:54:34 +0100 Subject: [PATCH] Fix: Restore barcode management --- htdocs/core/class/conf.class.php | 15 ++++++++------- htdocs/product/fiche.php | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index f8e698e09fb..1a1354d4cdd 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -152,8 +152,8 @@ class Conf // If this is constant for a sms engine elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_SMS$/i',$key,$reg)) { - $module=strtolower($reg[1]); - $this->sms_engine_modules[$module]=$module; // Add this module in list of modules that provide SMS + $modulename=strtolower($reg[1]); + $this->sms_engine_modules[$modulename]=$modulename; // Add this module in list of modules that provide SMS } // If this is constant for all generic part activated by a module elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_([A-Z]+)$/i',$key,$reg)) @@ -164,17 +164,18 @@ class Conf if (! is_array($this->$varname)) { $this->$varname = array(); } $arrValue = @unserialize($value); if (is_array($arrValue) && ! empty($arrValue)) $value = $arrValue; - else if ($partname == 'models' && $value == 1) $value = dol_buildpath('/'.$modulename); + else if ($partname == 'barcode') $value = '/'.$modulename.'/core/modules/'.$partname.'/'; + else if ($partname == 'models') $value = $modulename.'/'; else $value = ($value == 1 ? '/'.$modulename.'/core/'.$partname.'/' : $value); $this->$varname = array_merge($this->$varname, array($modulename => $value)); } // If this is a module constant (must be at end) elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)$/i',$key,$reg)) { - $module=strtolower($reg[1]); - $this->$module=(object) array(); - $this->$module->enabled=true; - $this->modules[]=$module; // Add this module in list of enabled modules + $modulename=strtolower($reg[1]); + $this->$modulename=(object) array(); + $this->$modulename->enabled=true; + $this->modules[]=$modulename; // Add this module in list of enabled modules } } } diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index d6360b1dd6f..60139ab2c37 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -735,7 +735,7 @@ else print ''; } - //Duration + // Duration if ($_GET["type"] == 1) { print ''.$langs->trans("Duration").'  '; @@ -1083,7 +1083,7 @@ else else { $object->fetch_barcode(); - print $object->barcode_type_label?$object->barcode_type_label:'
'.$langs->trans("SetDefaultBarcodeType").'
'; + print $object->barcode_type_label?$object->barcode_type_label:($object->barcode?'
'.$langs->trans("SetDefaultBarcodeType").'
':''); } print ''."\n";