Fix: Restore barcode management

This commit is contained in:
Laurent Destailleur 2012-02-29 22:54:34 +01:00
parent 18a7cd1e33
commit e0f7637bb3
2 changed files with 10 additions and 9 deletions

View File

@ -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
}
}
}

View File

@ -735,7 +735,7 @@ else
print '</td></tr>';
}
//Duration
// Duration
if ($_GET["type"] == 1)
{
print '<tr><td>'.$langs->trans("Duration").'</td><td><input name="duration_value" size="6" maxlength="5" value="'.$product->duree.'"> &nbsp;';
@ -1083,7 +1083,7 @@ else
else
{
$object->fetch_barcode();
print $object->barcode_type_label?$object->barcode_type_label:'<div class="warning">'.$langs->trans("SetDefaultBarcodeType").'<div>';
print $object->barcode_type_label?$object->barcode_type_label:($object->barcode?'<div class="warning">'.$langs->trans("SetDefaultBarcodeType").'<div>':'');
}
print '</td></tr>'."\n";