mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 16:03:47 +01:00
added precision to the float widget
This commit is contained in:
parent
5d29337843
commit
ddde44ea3c
@ -430,10 +430,11 @@ implement only a subset of XUL. Here are the main differences:</p>
|
||||
<b>a input-field to enter a float</b><br />
|
||||
In the html-UI this is rendered as <input ...>. <i>The input-validation is done at the moment only on server-side,
|
||||
clientside validation and input-restriction to only numbers is planed.</i><p>
|
||||
<b>Options</b> has 3 comma-separated fields:<br />
|
||||
<b>Options</b> has 4 comma-separated fields:<br />
|
||||
xml: <b>min</b>: minimum value, default none, empty values are Ok, as long as <b>needed</b> is not set<br />
|
||||
xml: <b>max</b>: maximum value, default none, empty values are Ok, as long as <b>needed</b> is not set<br />
|
||||
xml: <b>size</b>: the length in chars of the input-field, default 5
|
||||
xml: <b>precision</b>: precision of the float number, default maximum
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -893,13 +893,17 @@
|
||||
list($extra_link,$extra_link_target,$extra_link_popup) = explode(',',$cell_options);
|
||||
$html .= $value;
|
||||
break;
|
||||
case 'int': // size: [min][,[max][,len]]
|
||||
case 'int': // size: [min],[max],[len],[precission (only float)]
|
||||
case 'float':
|
||||
list($min,$max,$cell_options) = explode(',',$cell_options);
|
||||
list($min,$max,$cell_options,$pre) = explode(',',$cell_options);
|
||||
if ($cell_options == '')
|
||||
{
|
||||
$cell_options = $cell['type'] == 'int' ? 5 : 8;
|
||||
}
|
||||
if ($type == 'float' && $value && $pre)
|
||||
{
|
||||
$value = round($value,$pre);
|
||||
}
|
||||
$cell_options .= ',,'.($cell['type'] == 'int' ? '/^-?[0-9]*$/' : '/^-?[0-9]*[,.]?[0-9]*$/');
|
||||
// fall-through
|
||||
case 'text': // size: [length][,maxLength[,preg]]
|
||||
|
@ -79,7 +79,7 @@
|
||||
'float' => array(
|
||||
'.name' => 'textbox',
|
||||
'.set' => 'type=float',
|
||||
'size' => 'min,max,size'
|
||||
'size' => 'min,max,size,precision'
|
||||
),
|
||||
'select' => array(
|
||||
'.name' => 'menulist,menupopup',
|
||||
|
Loading…
Reference in New Issue
Block a user