pari: branch asterisknow r2543 - /branches/asterisknow/config/numberplan.html

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Thu Mar 13 09:13:48 CDT 2008


Author: pari
Date: Thu Mar 13 09:13:46 2008
New Revision: 2543

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=2543
Log:

* FIX for BE-335
 'Allow Parked Calls' checkbox not working properly in the Calling Rules tab


Modified:
    branches/asterisknow/config/numberplan.html

Modified: branches/asterisknow/config/numberplan.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/numberplan.html?view=diff&rev=2543&r1=2542&r2=2543
==============================================================================
--- branches/asterisknow/config/numberplan.html (original)
+++ branches/asterisknow/config/numberplan.html Thu Mar 13 09:13:46 2008
@@ -29,7 +29,7 @@
 var trunks_desc = { };
 var numplan_callbacks = { };
 var numberplansdata = { };
-var fieldnames = ['cancel', 'delete', 'include', 'name', 'new', 'plancomment', 'save', 'parked'];
+var fieldnames = ['cancel', 'delete', 'include', 'name', 'new', 'plancomment', 'save'];
 
 //var default_numberplan = 0;
 var isnewrule ;
@@ -52,13 +52,13 @@
 
 	if(_$("parked").checked) {
 		gui_feedback("Parking lots now added for Dialplan: " + _exten + " context: " + _context, 'blue');
-		var uri = build_action('append', 0, _exten, "include", "parkedcalls");   	
+		var uri = build_action('append', 0, _context , "include", "parkedcalls");	
 		makerequest('u', 'extensions.conf', uri, function(t) { return true;});
 		setTimeout( function(){ _bg_s.display = 'none'; _sm_s.display = 'none'; } , 1000 ); // add an unnecessary delay - for user perception, BE-335
 	} 
 	if(!_$("parked").checked) {
 		gui_feedback("Parking lots now deleted for Dialplan: " + _exten + " context: " + _context);
-		var uri = build_action('delete', 0, _exten, "include", "", "parkedcalls");   	
+		var uri = build_action('delete', 0, _context , "include", "", "parkedcalls");
 		makerequest('u', 'extensions.conf', uri, function(t) { return true;});
 		setTimeout( function(){ _bg_s.display = 'none'; _sm_s.display = 'none'; } , 1000 ); // add an unnecessary delay - for user perception, BE-335
 	}
@@ -479,7 +479,13 @@
 	this.plancomment = "";
 	this.nprules = [ ];
 	this.npcomments = [ ];
-	this.npdata = { }; 
+	this.npdata = { };
+	this.parkedcalls = false ;
+}
+
+numplan_callbacks.postselect = function(box, val) {
+	if(!box.value){ return; }
+	_$("parked").checked = (numberplansdata[box.value]['parkedcalls'] == true ) ? true : false ;
 }
 
 numplan_callbacks.format = function(t, x) {
@@ -501,8 +507,10 @@
 		if( tmp.length > 1 ){
 			numberplansdata[t.name]['npcomments'].push( t.fields[x] ) ; 
 		}
-	}
-	
+	}else if( t.names[x]=='include' && t.fields[x] == 'parkedcalls') {
+		numberplansdata[t.name]['parkedcalls'] = true ;
+	}
+
 	return null;
 }
 
@@ -658,7 +666,7 @@
 	uri += build_action('append', 1, default_planname,"plancomment", "Default DialPlan"); 
 	uri += build_action('append', 2, default_planname,"include", "default"); 
 	uri += build_action('append', 3, default_planname,"include", "parkedcalls"); 
-	makerequest('u','extensions.conf', uri, function(t){gui_feedback("Created a Default DialPlan",'green',3000); location.reload(); }   );
+	makerequest('u','extensions.conf', uri, function(t){gui_feedback("Created a Default DialPlan",'green',3000); window.location.reload(); }   );
 }
 
 




More information about the asterisk-gui-commits mailing list