fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [17139] property: validating integer, allow negative


From: sigurdne
Subject: [Fmsystem-commits] [17139] property: validating integer, allow negative values
Date: Thu, 5 Oct 2017 08:35:01 -0400 (EDT)

Revision: 17139
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=17139
Author:   sigurdne
Date:     2017-10-05 08:35:00 -0400 (Thu, 05 Oct 2017)
Log Message:
-----------
property: validating integer, allow negative values

Modified Paths:
--------------
    trunk/phpgwapi/inc/class.custom_fields.inc.php
    trunk/phpgwapi/templates/base/attributes_form.xsl
    trunk/property/inc/class.uilocation.inc.php
    trunk/property/templates/base/attributes_form.xsl

Modified: trunk/phpgwapi/inc/class.custom_fields.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.custom_fields.inc.php      2017-10-05 09:36:41 UTC 
(rev 17138)
+++ trunk/phpgwapi/inc/class.custom_fields.inc.php      2017-10-05 12:35:00 UTC 
(rev 17139)
@@ -489,6 +489,10 @@
                                                $attrib['value'] = 
$attrib['value'][0];
                                                break;
 
+                                       case 'I':
+                                               $attrib['value'] = 
(int)$attrib['value'];
+                                               break;
+
                                        case 'N':
                                                $attrib['value'] = 
str_replace(',', '.', $attrib['value']);
                                                break;

Modified: trunk/phpgwapi/templates/base/attributes_form.xsl
===================================================================
--- trunk/phpgwapi/templates/base/attributes_form.xsl   2017-10-05 09:36:41 UTC 
(rev 17138)
+++ trunk/phpgwapi/templates/base/attributes_form.xsl   2017-10-05 12:35:00 UTC 
(rev 17139)
@@ -675,7 +675,7 @@
                                                </xsl:choose>
                                        </xsl:when>
                                        <xsl:when test="datatype='I'">
-                                               <input data-validation="number" 
id="id_{name}" type="text" name="values_attribute[{id}][value]" value="{value}" 
size="30">
+                                               <input data-validation="number" 
data-validation-allowing="negative" id="id_{name}" type="text" 
name="values_attribute[{id}][value]" value="{value}" size="30">
                                                        <xsl:choose>
                                                                <xsl:when 
test="disabled!=''">
                                                                        
<xsl:attribute name="disabled">

Modified: trunk/property/inc/class.uilocation.inc.php
===================================================================
--- trunk/property/inc/class.uilocation.inc.php 2017-10-05 09:36:41 UTC (rev 
17138)
+++ trunk/property/inc/class.uilocation.inc.php 2017-10-05 12:35:00 UTC (rev 
17139)
@@ -753,7 +753,7 @@
                                                $this->receipt['error'][] = 
array('msg' => lang('Please enter value for attribute %1', 
$attribute['input_text']));
                                        }
 
-                                       if ($attribute['datatype'] == 'I' && 
isset($attribute['value']) && $attribute['value'] && 
!ctype_digit($attribute['value']))
+                                       if ($attribute['datatype'] == 'I' && 
isset($attribute['value']) && $attribute['value'] && 
!is_int((int)($attribute['value'])))
                                        {
                                                $this->receipt['error'][] = 
array('msg' => lang('Please enter integer for attribute %1', 
$attribute['input_text']));
                                        }

Modified: trunk/property/templates/base/attributes_form.xsl
===================================================================
--- trunk/property/templates/base/attributes_form.xsl   2017-10-05 09:36:41 UTC 
(rev 17138)
+++ trunk/property/templates/base/attributes_form.xsl   2017-10-05 12:35:00 UTC 
(rev 17139)
@@ -663,7 +663,7 @@
                                                </xsl:choose>
                                        </xsl:when>
                                        <xsl:when test="datatype='I'">
-                                               <input data-validation="number" 
id="id_{name}" type="text" name="values_attribute[{id}][value]" value="{value}" 
size="30">
+                                               <input data-validation="number" 
data-validation-allowing="negative" id="id_{name}" type="text" 
name="values_attribute[{id}][value]" value="{value}" size="30">
                                                        <xsl:choose>
                                                                <xsl:when 
test="disabled!=''">
                                                                        
<xsl:attribute name="disabled">




reply via email to

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