pari: trunk r161 - in /trunk/config: ./ scripts/

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Mon Dec 11 10:19:58 MST 2006


Author: pari
Date: Mon Dec 11 11:19:57 2006
New Revision: 161

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=161
Log:
OnSave - Input field validation 

Modified:
    trunk/config/meetme.html
    trunk/config/menus.html
    trunk/config/queues.html
    trunk/config/scripts/astman.js
    trunk/config/users.html
    trunk/config/voicemail.html

Modified: trunk/config/meetme.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/meetme.html?view=diff&rev=161&r1=160&r2=161
==============================================================================
--- trunk/config/meetme.html (original)
+++ trunk/config/meetme.html Mon Dec 11 11:19:57 2006
@@ -196,6 +196,9 @@
 				alert("Sorry, An Extension must be  "+ localextenlength  + " digits !");
 				$('name').focus();
 				return false;
+		}
+		if (!check_patternonfields( ['name', 'pin' , 'pinadmin', 'room'] ) ){
+			return false;
 		}
 		return true;
 	}

Modified: trunk/config/menus.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/menus.html?view=diff&rev=161&r1=160&r2=161
==============================================================================
--- trunk/config/menus.html (original)
+++ trunk/config/menus.html Mon Dec 11 11:19:57 2006
@@ -367,6 +367,9 @@
 			alert("Sorry, An Extension must be  "+ localextenlength  + " digits !");
 			$('alias_exten').focus();
 			return false;
+	}
+	if (!check_patternonfields( [ 'comment', 'newstep_var_digit' ] ) ){
+		return false;
 	}
 
 	$('status_message').style.display="block";

Modified: trunk/config/queues.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/queues.html?view=diff&rev=161&r1=160&r2=161
==============================================================================
--- trunk/config/queues.html (original)
+++ trunk/config/queues.html Mon Dec 11 11:19:57 2006
@@ -179,6 +179,10 @@
 				alert("Sorry, An Extension must be  "+ localextenlength  + " digits !");
 				$('name').focus();
 				return ;
+		}
+		
+		if (!check_patternonfields( [ 'name', 'fullname','timeout','wrapuptime','maxlen' ] ) ){
+			return false;
 		}
 
 		$('status_message').style.display="block";

Modified: trunk/config/scripts/astman.js
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/scripts/astman.js?view=diff&rev=161&r1=160&r2=161
==============================================================================
--- trunk/config/scripts/astman.js (original)
+++ trunk/config/scripts/astman.js Mon Dec 11 11:19:57 2006
@@ -28,12 +28,14 @@
 function check_patternonfields(fields){
 	// for checking validity of field contents before form submitting 
 	for (var i=0; i < fields.length; i++){
-			x = document.getElementById(fields[i]);
+			var x = document.getElementById(fields[i]);
 			if( x.getAttribute('pattern') && !check_pattern(x.getAttribute('pattern') , x.value)   ){
 						alert("Invalid Characters in "+ fields[i]);
+						x.focus();
 						return false;
 			}
 	}
+	return true;
 }
 
 function showdiv_statusmessage(){

Modified: trunk/config/users.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/users.html?view=diff&rev=161&r1=160&r2=161
==============================================================================
--- trunk/config/users.html (original)
+++ trunk/config/users.html Mon Dec 11 11:19:57 2006
@@ -102,7 +102,6 @@
 	callbacks.identifier = "extension";
 
 	callbacks.beforeSaving = function(){
-		//check_patternonfields(fieldnames);
 		if(!$('fullname').value.length){
 				alert("Sorry, a User Name must be specified !");
 				$('fullname').focus();
@@ -113,6 +112,9 @@
 				alert("Sorry, User Extension must be  "+ localextenlength  + " digits !");
 				$('name').focus();
 				return false;
+		}
+		if (!check_patternonfields( ['name', 'fullname', 'secret','email', 'cid_number'] ) ){
+			return false;
 		}
 		return true;
 	}

Modified: trunk/config/voicemail.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/voicemail.html?view=diff&rev=161&r1=160&r2=161
==============================================================================
--- trunk/config/voicemail.html (original)
+++ trunk/config/voicemail.html Mon Dec 11 11:19:57 2006
@@ -66,6 +66,9 @@
 				alert("Sorry, An Extension must be  "+ localextenlength  + " digits !");
 				$('name').focus();
 				return false;
+		}
+		if (!check_patternonfields( ['name', 'maxgreet'] ) ){
+			return false;
 		}
 		return true;
 	}



More information about the asterisk-gui-commits mailing list