Skip to content

Commit

Permalink
Merge pull request #1033 from FHenry/3.4
Browse files Browse the repository at this point in the history
Fix bug on extrafeild type price and double
  • Loading branch information
eldy committed Jun 9, 2013
2 parents 050819c + 4f43822 commit 5b23e82
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion htdocs/core/class/extrafields.class.php
Expand Up @@ -622,7 +622,7 @@ function showInputField($key,$value,$moreparam='')
$out = $formstat->select_date($value, 'options_'.$key, $showtime, $showtime, $required, '', 1, 1, 1, 0, 1);
//$out='<input type="text" name="options_'.$key.'" size="'.$showsize.'" maxlength="'.$newsize.'" value="'.$value.'"'.($moreparam?$moreparam:'').'>';
}
elseif (in_array($type,array('int','double')))
elseif (in_array($type,array('int')))
{
$tmp=explode(',',$size);
$newsize=$tmp[0];
Expand Down Expand Up @@ -660,6 +660,10 @@ function showInputField($key,$value,$moreparam='')
{
$out='<input type="text" name="options_'.$key.'" size="6" value="'.price($value).'"> '.$langs->getCurrencySymbol($conf->currency);
}
elseif ($type == 'double')
{
$out='<input type="text" name="options_'.$key.'" size="6" value="'.price($value).'"> ';
}
elseif ($type == 'select')
{
$out='<select name="options_'.$key.'">';
Expand Down Expand Up @@ -790,6 +794,10 @@ function showOutputField($key,$value,$moreparam='')
{
$showsize=10;
}
elseif ($type == 'double')
{
$value=price($value);
}
elseif ($type == 'boolean')
{
$checked='';
Expand Down Expand Up @@ -900,6 +908,11 @@ function setOptionalsFromPost($extralabels,&$object)
$value_arr=GETPOST("options_".$key);
$value_key=implode($value_arr,',');
}
else if (in_array($key_type,array('price','double')))
{
$value_arr=GETPOST("options_".$key);
$value_key=price2num($value_arr);
}
else
{
$value_key=GETPOST("options_".$key);
Expand Down

0 comments on commit 5b23e82

Please sign in to comment.