From 37b29231e47a0c4458dc1c15d98588f16f07e1e2 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Thu, 06 Aug 2015 03:18:44 -0400
Subject: [PATCH] - don't set password via remoting if field is empty

---
 interface/web/client/form/client.tform.php |   36 ++++++++++++++++++++++++++++++------
 1 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/interface/web/client/form/client.tform.php b/interface/web/client/form/client.tform.php
index 7507c18..eab4e02 100644
--- a/interface/web/client/form/client.tform.php
+++ b/interface/web/client/form/client.tform.php
@@ -116,7 +116,10 @@
 			'maxlength' => '255',
 			'rows'  => '',
 			'cols'  => '',
-			'searchable' => 1
+			'searchable' => 1,
+			'filters'   => array( 0 => array( 'event' => 'SAVE',
+												'type' => 'TRIM'),
+			),
 		),
 		'contact_name' => array (
 			'datatype' => 'VARCHAR',
@@ -131,7 +134,10 @@
 			'maxlength' => '255',
 			'rows'  => '',
 			'cols'  => '',
-			'searchable' => 1
+			'searchable' => 1,
+			'filters'   => array( 0 => array( 'event' => 'SAVE',
+												'type' => 'TRIM'),
+			),
 		),
 		'customer_no' => array (
 			'datatype' => 'VARCHAR',
@@ -322,9 +328,12 @@
 				2 => array( 'event' => 'SAVE',
 					'type' => 'TOLOWER')
 			),
-			'validators' => array (  0 => array ( 'type' => 'REGEX',
+			'validators' => array (  
+				0 => array ( 'type' => 'REGEX',
 					'regex' => '/^(\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,10}){0,1}$/i',
 					'errmsg'=> 'email_error_isemail'),
+				1 => array ( 'type' => 'NOTEMPTY',
+					'errmsg'=> 'email_error_empty'),
 			),
 			'default' => '',
 			'value'  => '',
@@ -372,7 +381,12 @@
 					'class' => 'validate_client',
 					'function' => 'check_vat_id',
 					'errmsg'=> 'invalid_vat_id'),
-				),
+			),
+			'filters'   => array( 0 => array( 	'event' => 'SAVE',
+												'type' => 'TRIM'),
+								1 => array( 	'event' => 'SAVE',
+												'type' => 'TOUPPER')
+			),
 		),
 		'company_id' => array (
 			'datatype' => 'VARCHAR',
@@ -438,7 +452,12 @@
 			'width'  => '30',
 			'maxlength' => '255',
 			'rows'  => '',
-			'cols'  => ''
+			'cols'  => '',
+			'filters'   => array( 0 => array( 	'event' => 'SAVE',
+												'type' => 'TRIM'),
+								1 => array( 	'event' => 'SAVE',
+												'type' => 'TOUPPER')
+			),
 		),
 		'bank_account_swift' => array (
 			'datatype' => 'VARCHAR',
@@ -449,7 +468,12 @@
 			'width'  => '30',
 			'maxlength' => '255',
 			'rows'  => '',
-			'cols'  => ''
+			'cols'  => '',
+			'filters'   => array( 0 => array( 	'event' => 'SAVE',
+												'type' => 'TRIM'),
+								1 => array( 	'event' => 'SAVE',
+												'type' => 'TOUPPER')
+			),
 		),
 		'notes' => array (
 			'datatype' => 'TEXT',

--
Gitblit v1.9.1