diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index f7cfbc1f24a..22b65d688fd 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -829,11 +829,11 @@ class ExtraFields
* @param string $moreparam To add more parametes on html input tag
* @param string $keysuffix Prefix string to add after name and id of field (can be used to avoid duplicate names)
* @param string $keyprefix Suffix string to add before name and id of field (can be used to avoid duplicate names)
- * @param mixed $showsize Value for css to define size. May also be a numeric.
+ * @param string $morecss More css (to defined size of field. Old behaviour: may also be a numeric)
* @param int $objectid Current object id
* @return string
*/
- function showInputField($key, $value, $moreparam='', $keysuffix='', $keyprefix='', $showsize=0, $objectid=0)
+ function showInputField($key, $value, $moreparam='', $keysuffix='', $keyprefix='', $morecss='', $objectid=0)
{
global $conf,$langs,$form;
@@ -866,45 +866,41 @@ class ExtraFields
else return '';
}
- if (empty($showsize))
+ if (empty($morecss))
{
if ($type == 'date')
{
- //$showsize=10;
- $showsize = 'minwidth100imp';
+ $morecss = 'minwidth100imp';
}
elseif ($type == 'datetime')
{
- //$showsize=19;
- $showsize = 'minwidth200imp';
+ $morecss = 'minwidth200imp';
}
elseif (in_array($type,array('int','integer','double','price')))
{
- //$showsize=10;
- $showsize = 'maxwidth75';
+ $morecss = 'maxwidth75';
}
elseif ($type == 'url')
{
- $showsize='minwidth400';
+ $morecss='minwidth400';
}
elseif ($type == 'boolean')
{
- $showsize='';
+ $morecss='';
}
else
{
if (round($size) < 12)
{
- $showsize = 'minwidth100';
+ $morecss = 'minwidth100';
}
else if (round($size) <= 48)
{
- $showsize = 'minwidth200';
+ $morecss = 'minwidth200';
}
else
{
- //$showsize=48;
- $showsize = 'minwidth400';
+ $morecss = 'minwidth400';
}
}
}
@@ -926,15 +922,15 @@ class ExtraFields
{
$tmp=explode(',',$size);
$newsize=$tmp[0];
- $out='';
+ $out='';
}
elseif (preg_match('/varchar/', $type))
{
- $out='';
+ $out='';
}
elseif (in_array($type, array('mail', 'phone', 'url')))
{
- $out='';
+ $out='';
}
elseif ($type == 'text')
{
@@ -946,7 +942,7 @@ class ExtraFields
}
else
{
- $out='';
+ $out='';
}
}
elseif ($type == 'boolean')
@@ -957,21 +953,21 @@ class ExtraFields
} else {
$checked=' value="1" ';
}
- $out='';
+ $out='';
}
elseif ($type == 'price')
{
if (!empty($value)) { // $value in memory is a php numeric, we format it into user number format.
$value=price($value);
}
- $out=' '.$langs->getCurrencySymbol($conf->currency);
+ $out=' '.$langs->getCurrencySymbol($conf->currency);
}
elseif ($type == 'double')
{
if (!empty($value)) { // $value in memory is a php numeric, we format it into user number format.
$value=price($value);
}
- $out=' ';
+ $out=' ';
}
elseif ($type == 'select')
{
@@ -982,7 +978,7 @@ class ExtraFields
$out.= ajax_combobox($keyprefix.$key.$keysuffix, array(), 0);
}
- $out.='