fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [9818] property: numeric as datatype in generic


From: Sigurd Nes
Subject: [Fmsystem-commits] [9818] property: numeric as datatype in generic
Date: Tue, 31 Jul 2012 09:29:06 +0000

Revision: 9818
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9818
Author:   sigurdne
Date:     2012-07-31 09:29:05 +0000 (Tue, 31 Jul 2012)
Log Message:
-----------
property: numeric as datatype in generic

Modified Paths:
--------------
    trunk/property/inc/class.sogeneric.inc.php
    trunk/property/inc/class.uigeneric.inc.php
    trunk/property/templates/base/generic.xsl

Modified: trunk/property/inc/class.sogeneric.inc.php
===================================================================
--- trunk/property/inc/class.sogeneric.inc.php  2012-07-31 09:10:29 UTC (rev 
9817)
+++ trunk/property/inc/class.sogeneric.inc.php  2012-07-31 09:29:05 UTC (rev 
9818)
@@ -2357,7 +2357,7 @@
                                                        (
                                                                'name'          
=> 'value',
                                                                'descr'         
=> lang('value'),
-                                                               'type'          
=> 'int',
+                                                               'type'          
=> 'numeric',
                                                                'nullable'      
=> false,
                                                                'size'          
=> 4,
                                                                'sortable'      
=> true

Modified: trunk/property/inc/class.uigeneric.inc.php
===================================================================
--- trunk/property/inc/class.uigeneric.inc.php  2012-07-31 09:10:29 UTC (rev 
9817)
+++ trunk/property/inc/class.uigeneric.inc.php  2012-07-31 09:29:05 UTC (rev 
9818)
@@ -654,6 +654,14 @@
                                                                
$receipt['error'][]=array('msg'=> "{$field_info['descr']}: " . lang('Please 
enter an integer !'));
                                                        }
                                                }
+                                               else if ($field_info['type'] == 
'numeric')
+                                               {
+                                                       
$values[$field_info['name']] = str_replace(',', '.', 
$values[$field_info['name']]);
+                                                       if( 
$values[$field_info['name']] && ! is_numeric($values[$field_info['name']]) )
+                                                       {
+                                                               
$receipt['error'][]=array('msg'=> "{$field_info['descr']}: " . lang('Please 
enter a numeric value !'));
+                                                       }
+                                               }
                                        }
 
                                        if($values['id'] && 
$this->location_info['id']['type'] == 'int' && !ctype_digit($values['id']))

Modified: trunk/property/templates/base/generic.xsl
===================================================================
--- trunk/property/templates/base/generic.xsl   2012-07-31 09:10:29 UTC (rev 
9817)
+++ trunk/property/templates/base/generic.xsl   2012-07-31 09:29:05 UTC (rev 
9818)
@@ -85,7 +85,7 @@
                                                                                
                        <xsl:value-of select="value"/>
                                                                                
                </textarea>
                                                                                
        </xsl:when>
-                                                                               
        <xsl:when test="type='varchar' or type='integer' or type='int'">
+                                                                               
        <xsl:when test="type='varchar' or type='integer' or type='int' or 
type='numeric'">
                                                                                
                <input type="text" name="values[{name}]" value="{value}" 
size="{size}">
                                                                                
                        <xsl:attribute name="title">
                                                                                
                                <xsl:value-of select="descr"/>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]