rbrindley: branch rbrindley/astman_revamp r4667 - /team/rbrindley/astman_reva...

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Thu Mar 26 13:34:12 CDT 2009


Author: rbrindley
Date: Thu Mar 26 13:34:11 2009
New Revision: 4667

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

- lets get the selected <option> text instead of the <select> value
- New = new
- oops, need to reload window and hide dialog after we add the rules


Modified:
    team/rbrindley/astman_revamp/config/js/incoming.js

Modified: team/rbrindley/astman_revamp/config/js/incoming.js
URL: http://svn.digium.com/svn-view/asterisk-gui/team/rbrindley/astman_revamp/config/js/incoming.js?view=diff&rev=4667&r1=4666&r2=4667
==============================================================================
--- team/rbrindley/astman_revamp/config/js/incoming.js (original)
+++ team/rbrindley/astman_revamp/config/js/incoming.js Thu Mar 26 13:34:11 2009
@@ -352,7 +352,9 @@
 		var this_tiName = ASTGUI.getFieldValue('edit_itrl_tf') ;
 		var TMP_NEW_PATTERN = ASTGUI.getFieldValue('edit_itrl_pattern');
 		var dest = $('#edit_itrl_dest').val();
-		var local_dest = $('#edit_itrl_LocalDest_Pattern').val();
+		var local_dest = $('#edit_itrl_LocalDest_Pattern option:selected').text();
+		var time_int_name = $('#edit_itrl_tf option:selected').text();
+		time_int_name = (time_int_name.contains('no Time Intervals')) ? '' : time_int_name;
 
 		if( ASTGUI.getFieldValue('edit_itrl_dest') == 'ByDID' && parent.pbx.trunks.getType(this_trunk) == 'analog' ){
 			ASTGUI.feedback ({ msg: 'Local Extension by DID is not applicable for Analog Trunks !' , showfor:3,  color:'red' });
@@ -360,10 +362,15 @@
 		}
 
 		if( isNewIR == true ){ // create new Incoming Rule
-			top.log.debug("create New Incoming Rule");
+			top.log.debug("create new Incoming Rule");
 			parent.ASTGUI.dialog.waitWhile('Creating Incoming Rule ...');
 
-			parent.trunks.rules.add({trunk: this_trunk, name: this_tiName, dest: dest, pattern: TMP_NEW_PATTERN, digits: local_dest});
+			if (parent.pbx.trunks.rules.add({trunk: this_trunk, name: time_int_name, time_interval: time_int_name, dest: dest, pattern: TMP_NEW_PATTERN, digits: local_dest})) {
+				ASTGUI.feedback({ msg: 'Added!', showfor: 2, color: 'blue', bgcolor: '#ffffff'});
+				window.location.reload();
+			}
+
+			parent.ASTGUI.dialog.hide();
 		}else{ // edit/update existing incoming rule
 
 			var pp = ASTGUI.parseContextLine.getPriority(EDIT_CONTEXT_IR_LINE);




More information about the asterisk-gui-commits mailing list