pari: branch asterisknow r984 - in /branches/asterisknow: ./ config/ config/s...

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Fri May 25 08:57:59 MST 2007


Author: pari
Date: Fri May 25 10:57:58 2007
New Revision: 984

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=984
Log:
Merged revisions 489-500,506,508-510,513-518,520-531,533-535,537,539-540,542,544,546,548,550,552,554,556-557,559,562,564-566,569,571,573-577,580-586,589-604,606-611,614-616,618-619,621-622,624-625,633-634,636,638-640,648-650,660-676,678-679,682-684,687-688,695-696,698-702,704-712,714-716,718-719,721-722,724-725,727-746,749-750,752-753,757-767,769-771,774-780,782-783,785-786,788-789,791-792,794-795,797-800,802-803,808-810,812-816,821-825,827-835,837,839-840,842-847,849-850,853-855,862-864,867,869-870,873-878,880,884-886,889-898,900-903,906-909,911,917,939-940,946,948,950-983 via svnmerge from 
https://origsvn.digium.com/svn/asterisk-gui/trunk

........
  r951 | pari | 2007-05-16 20:08:11 -0500 (Wed, 16 May 2007) | 1 line
  
  removing Rico from FileEditor
........
  r952 | pari | 2007-05-17 10:35:55 -0500 (Thu, 17 May 2007) | 1 line
  
  todo document for the gui project
........
  r953 | qwell | 2007-05-17 12:29:36 -0500 (Thu, 17 May 2007) | 4 lines
  
  Add support for update and uninstall targets.
  
  Issue 9732.
........
  r954 | pari | 2007-05-17 12:34:28 -0500 (Thu, 17 May 2007) | 1 line
  
  reverting the stupid hack in r570 and handling 0 or more digits the proper way (usin !)
........
  r955 | pari | 2007-05-17 12:38:08 -0500 (Thu, 17 May 2007) | 1 line
  
  !(zero or more digits) instead of .(one or more digits)
........
  r961 | pari | 2007-05-18 18:10:06 -0500 (Fri, 18 May 2007) | 1 line
  
  moving 'makerequest()' from timerules into astman.js
........
  r964 | pari | 2007-05-21 10:26:19 -0500 (Mon, 21 May 2007) | 1 line
  
  updating to latest protoype version - 1.5.1 
........
  r965 | pari | 2007-05-21 21:33:35 -0500 (Mon, 21 May 2007) | 16 lines
  
  
  
  This is actually a fix for 
  Removing a step in voicemenus breaks numbering.
  (http://bugs.digium.com/view.php?id=9756)
  
  But this fix also changes the numbering of Voicemenus steps from 
    s,1,xxxx
    s,2,xxxx
    s,3,xxxx
  to 
    s,1,xxxx
    s,n,xxxx
    s,n,xxxx
........
  r966 | pari | 2007-05-21 22:32:54 -0500 (Mon, 21 May 2007) | 1 line
  
  Operator Extension
........
  r968 | pari | 2007-05-22 22:09:08 -0500 (Tue, 22 May 2007) | 1 line
  
  BusyTone in voicemenus
........
  r969 | pari | 2007-05-22 22:20:13 -0500 (Tue, 22 May 2007) | 1 line
  
  Congestion in VoiceMenus
........
  r970 | pari | 2007-05-22 22:43:18 -0500 (Tue, 22 May 2007) | 1 line
  
  DISA in voicemenus - as of now its upto the user to make sure that there is a [disa] context
........
  r977 | pari | 2007-05-23 21:30:38 -0500 (Wed, 23 May 2007) | 1 line
  
  minor performance fix
........
  r978 | pari | 2007-05-24 12:54:52 -0500 (Thu, 24 May 2007) | 1 line
  
  RingGroups - Not complete yet - but commiting what I got so far, will put a link in advanced menus when the rest of it is done
........
  r979 | pari | 2007-05-24 16:00:36 -0500 (Thu, 24 May 2007) | 1 line
  
  updating todo
........
  r980 | pari | 2007-05-24 23:40:30 -0500 (Thu, 24 May 2007) | 1 line
  
  Edit and delete in ringgroups
........
  r981 | pari | 2007-05-25 09:59:18 -0500 (Fri, 25 May 2007) | 1 line
  
  zap channels into ringgroups
........
  r982 | pari | 2007-05-25 10:12:16 -0500 (Fri, 25 May 2007) | 1 line
  
  requests from Andrew Latham
........
  r983 | pari | 2007-05-25 10:48:20 -0500 (Fri, 25 May 2007) | 1 line
  
  'Dial RingGroups' in IVRs
........

Added:
    branches/asterisknow/config/ringgroups.html
      - copied unchanged from r983, trunk/config/ringgroups.html
    branches/asterisknow/todo.txt
      - copied unchanged from r983, trunk/todo.txt
Modified:
    branches/asterisknow/   (props changed)
    branches/asterisknow/Makefile
    branches/asterisknow/config/cfgbasic.html
    branches/asterisknow/config/feditor.html
    branches/asterisknow/config/incoming.html
    branches/asterisknow/config/localexts.html
    branches/asterisknow/config/meetme.html
    branches/asterisknow/config/menus.html
    branches/asterisknow/config/numberplan.html
    branches/asterisknow/config/options.html
    branches/asterisknow/config/queues.html
    branches/asterisknow/config/record.html
    branches/asterisknow/config/scripts/astman.js
    branches/asterisknow/config/scripts/prototype.js
    branches/asterisknow/config/setup/5.html
    branches/asterisknow/config/timerules.html
    branches/asterisknow/config/trunks.html

Propchange: branches/asterisknow/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri May 25 10:57:58 2007
@@ -1,1 +1,1 @@
-/trunk:1-449,489-540,542-557,559,561-577,580-586,588-949
+/trunk:1-449,489-540,542-557,559,561-577,580-586,588-983

Modified: branches/asterisknow/Makefile
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/Makefile?view=diff&rev=984&r1=983&r2=984
==============================================================================
--- branches/asterisknow/Makefile (original)
+++ branches/asterisknow/Makefile Fri May 25 10:57:58 2007
@@ -271,6 +271,24 @@
 distclean: clean
 	-rm -f makeopts config.log config.status
 	-rm -rf autom4te.cache
+
+uninstall:
+	rm -rf $(CONFIGDIR)
+	rm -rf $(ASTVARLIBDIR)/scripts
+
+update: 
+	@if [ -d .svn ]; then \
+		echo "Updating from Subversion..." ; \
+		svn update | tee update.out; \
+		rm -f .version; \
+		if [ `grep -c ^C update.out` -gt 0 ]; then \
+			echo ; echo "The following files have conflicts:" ; \
+			grep ^C update.out | cut -b4- ; \
+		fi ; \
+		rm -f update.out; \
+	else \
+		echo "Not under version control";  \
+	fi
 
 samples:
 	mkdir -p $(ASTETCDIR)

Modified: branches/asterisknow/config/cfgbasic.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/cfgbasic.html?view=diff&rev=984&r1=983&r2=984
==============================================================================
--- branches/asterisknow/config/cfgbasic.html (original)
+++ branches/asterisknow/config/cfgbasic.html Fri May 25 10:57:58 2007
@@ -161,19 +161,7 @@
 }
 
 function makeping(){
-	var tmp;
-	var opt = {
-		method: 'get',
-		parameters: "action=ping",
-		asynchronous: true,
-		onComplete: function(t){
-			if( t.responseText.match(asterisk_guipingerror) ){
-				window.location.href=window.location.href;
-			}
-			
-		}
-	};
-	tmp = new Ajax.Request( asterisk_rawmanPath, opt);
+	makerequest("","","action=ping", function(t){ if( t.match(asterisk_guipingerror) ){ window.location.href=window.location.href;} } );
 }
 
 eventeater.eventcb = function(msgs) {
@@ -226,18 +214,7 @@
 
 function Logoff() {
 	if(!confirm("Are you sure ?")){ return true; }
-	var opt2 = {
-		method: 'get',
-		asynchronous: true,
-		onSuccess: function() {	 
-			window.location.href=window.location.href;
-		},
-		onFailure: function(t) {
-			gui_alert("Config Error: " + t.status + ": " + t.statusText);
-		}
-	};
-	opt2.parameters ="action=logoff";
-	var tmp2 = new Ajax.Request(asterisk_rawmanPath , opt2);
+	makerequest("","","action=logoff", function(t){ window.location.href=window.location.href; } );
 }
 
 function system_link(){
@@ -248,15 +225,10 @@
 function reloadConfig(){
 	_$('reloadconfig').style.display = 'none'; 
 	window.setTimeout( function(){ _$('reloadconfig').style.display=""; }, asterisk_guifbt );
-	var opt = { 
-		method: 'get', 
-		asynchronous: true, 
-		onSuccess: function(t) { gui_feedback("Restarted Asterisk !!",'blue'); } ,
-		onFailure: function(t) { gui_alert("Config Error: " + t.status + ": " + t.statusText); }
-	};
-	var uri = parent.build_action('renamecat', 0, "","", "", ""); 
-	opt.parameters="action=updateconfig&reload=yes&srcfilename=" + encodeURIComponent("extensions.conf") + "&dstfilename=" + encodeURIComponent("extensions.conf") + uri;
-	var tmp = new Ajax.Request(asterisk_rawmanPath , opt);
+
+	var uri = parent.build_action('renamecat', 0, "","", "", "");
+	var r = "action=updateconfig&reload=yes&srcfilename=" + encodeURIComponent("extensions.conf") + "&dstfilename=" + encodeURIComponent("extensions.conf") + uri;
+	makerequest("","",r, function(t){ gui_feedback("Restarted Asterisk !!",'blue'); } );
 }
 
 
@@ -357,6 +329,7 @@
 				<option value="cli.html">Asterisk CLI</option>
 				<option value="moh.html">Music on Hold</option>
 				<option value="timerules.html">Time Based Rules</option>
+				<option value="ringgroups.html">Ring Groups</option>
 				<option value="emailsettings.html">VM Email settings</option>
 				<option value="sip.html">Global SIP Settings</option>
 				<option value="iax.html">Global IAX Settings</option>
@@ -372,4 +345,4 @@
 		</tr>
 	</table>
 </div>
-</body>
+</body>

Modified: branches/asterisknow/config/feditor.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/feditor.html?view=diff&rev=984&r1=983&r2=984
==============================================================================
--- branches/asterisknow/config/feditor.html (original)
+++ branches/asterisknow/config/feditor.html Fri May 25 10:57:58 2007
@@ -19,7 +19,6 @@
  *
 -->
 <script src="scripts/prototype.js"></script>
-<script src="scripts/rico.js"></script>
 <script src="scripts/astman.js"></script>
 <link href="stylesheets/rico.css" media="all" rel="Stylesheet" type="text/css" />
 <link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
@@ -79,25 +78,14 @@
 
 function delete_context(){
 	if(!confirm("Are you sure you want to delete the selected context ?")){ return true; }
-
 	var uri = build_action('delcat', 0, global_contextBeingEdited ,"", "");
-	var opt = {
-		method: 'get',
-		asynchronous: true,
-		onSuccess: function() {
+	makerequest('u', global_fileBeingEdited, uri , function(t) {
 			_$('AddContext').style.display = "none";
 			_$('div_editcontext').style.display = "none"; 
 			global_contextBeingEdited = "";
 			gui_feedback('Context Deleted','blue');
 			config2json( global_fileBeingEdited, 0, fileparsed );
-		},
-		onFailure: function(t) {
-			gui_alert("Config Error: " + t.status + ": " + t.statusText);
-			gui_alert("Failed to Rename the DID context for " + old_didcontext );
-		}
-	};
-	opt.parameters= "action=updateconfig&srcfilename=" + encodeURIComponent(global_fileBeingEdited) + "&dstfilename=" + encodeURIComponent(global_fileBeingEdited) + uri;
-	var tmp = new Ajax.Request(asterisk_rawmanPath, opt);
+		});
 }
 
 
@@ -109,23 +97,13 @@
 
 function update_context(){ // rename from global_contextBeingEdited to $('context_edited').value
 	var uri = build_action('renamecat', 0, global_contextBeingEdited ,"", _$('context_edited').value );
-	var opt = {
-		method: 'get',
-		asynchronous: true,
-		onSuccess: function() {
+	makerequest('u',global_fileBeingEdited, uri, function(t) {
 			_$('AddContext').style.display = "none";
 			_$('div_editcontext').style.display = "none"; 
 			global_contextBeingEdited = "";
 			gui_feedback('Context Updated','blue');
 			config2json( global_fileBeingEdited, 0, fileparsed );
-		},
-		onFailure: function(t) {
-			gui_alert("Config Error: " + t.status + ": " + t.statusText);
-			gui_alert("Failed to Rename the DID context for " + old_didcontext );
-		}
-	};
-	opt.parameters= "action=updateconfig&srcfilename=" + encodeURIComponent(global_fileBeingEdited) + "&dstfilename=" + encodeURIComponent(global_fileBeingEdited) + uri;
-	var tmp = new Ajax.Request(asterisk_rawmanPath, opt);
+		});
 }
 
 
@@ -259,23 +237,12 @@
 		uri += build_action('append', c, global_contextBeingEdited, firstpart, secondpart ); c++;
 	}
 
-	var opt = {
-		method: 'get',
-		asynchronous: true,
-		onSuccess: function() {
+	makerequest('u',global_fileBeingEdited, uri, function(t){
 			_$('div_editcontextContent').style.display = "none"; 
 			global_contextBeingEdited = "";
 			gui_feedback('Context Content Updated','blue');
 			config2json( global_fileBeingEdited, 0, fileparsed );
-		},
-		onFailure: function(t) {
-			gui_alert("Config Error: " + t.status + ": " + t.statusText);
-			gui_alert("Failed to Rename the DID context for " + old_didcontext );
-		}
-	};
-	opt.parameters= "action=updateconfig&srcfilename=" + encodeURIComponent(global_fileBeingEdited) + "&dstfilename=" + encodeURIComponent(global_fileBeingEdited) + uri;
-	var tmp = new Ajax.Request(asterisk_rawmanPath, opt);
-
+	});
 }
 
 
@@ -310,9 +277,10 @@
 			h.style.width = '95%';
 			h.style.fontFamily = "'trebuchet ms',helvetica,sans-serif";
 			h.style.fontSize = '10pt' ;
+			h.style.padding = '2px 2px 3px 3px' ;
 			h.innerHTML = "&nbsp;&nbsp;[" + d + "]";
 			zz.appendChild(h);
-			Rico.Corner.round(h_id, {compact:true});
+			//Rico.Corner.round(h_id, {compact:true});
 			add_event( _$(h_id) , 'click', showeditcontext );
 
 			var i = document.createElement("div");
@@ -324,6 +292,7 @@
 			i.style.marginTop = '5px' ;
 			i.style.width = '95%';
 			i.style.fontSize = '9pt' ;
+			i.style.padding = '2px 2px 3px 3px' ;
 			i.style.fontFamily = 'courier' ;
 
 			var temp_contextContent = "" ;
@@ -339,7 +308,7 @@
 			i.CONTEXTCONTENT = temp_contextContent ;
 			i.CONTEXTCONTENT_ROWS = rows ;
 			zz.appendChild(i);
-			Rico.Corner.round("contextContent_" + d, {compact:true});
+			//Rico.Corner.round("contextContent_" + d, {compact:true});
 			add_event( _$(i_id) , 'click', showeditcontextContent );
 
 		}
@@ -384,23 +353,12 @@
 
 function add_context(){
 	var uri = build_action('newcat', 0, _$('New_ContextName').value ,"", "");
-
-	var opt = {
-		method: 'get',
-		asynchronous: true,
-		onSuccess: function() {
+	makerequest('u',global_fileBeingEdited,uri, function(){
 			cancel_addcontext(); 
 			global_contextBeingEdited = "";
 			gui_feedback('New Context Added','blue');
 			config2json( global_fileBeingEdited, 0, fileparsed );
-		},
-		onFailure: function(t) {
-			gui_alert("Config Error: " + t.status + ": " + t.statusText);
-			gui_alert("Failed to Add New context ");
-		}
-	};
-	opt.parameters= "action=updateconfig&srcfilename=" + encodeURIComponent(global_fileBeingEdited) + "&dstfilename=" + encodeURIComponent(global_fileBeingEdited) + uri;
-	var tmp = new Ajax.Request(asterisk_rawmanPath, opt);
+	});
 }
 </script>
 <body id="foo" onload="localajaxinit()"  bgcolor="FFFFFF" onunload="resetmainscreen();">

Modified: branches/asterisknow/config/incoming.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/incoming.html?view=diff&rev=984&r1=983&r2=984
==============================================================================
--- branches/asterisknow/config/incoming.html (original)
+++ branches/asterisknow/config/incoming.html Fri May 25 10:57:58 2007
@@ -307,13 +307,10 @@
 		gui_feedback("An incoming call rule is already defined <BR> on this trunk for the selcted pattern !! ");
 		return false;
 	}
-	
-	var opt = {
-		method: 'get',
-		asynchronous: true,
-		onSuccess: function(t) { 									
-			// add this to the global object
-			didtrunks[temp_provider][newpattern] = new Object();
+
+	makerequest('u','extensions.conf', uri,
+		function(t){
+			didtrunks[temp_provider][newpattern] = new Object(); // add this to the global object
 			didtrunks[temp_provider][newpattern].priority = temp_priority;
 			didtrunks[temp_provider][newpattern].action = temp_action ;
 			//addrowtotable(newpattern,temp_provider,temp_action,temp_priority) ; // a is pattern, b is DID_trunk, c is action, d is priority
@@ -321,15 +318,10 @@
 			_$('userscontent').style.display = "none";
 			_$('bg_transparent').style.display ='none';
 			gui_feedback("Added Incoming Rule",'blue');
-		},
-		onFailure: function(t) {
-			gui_alert("Config Error: " + t.status + ": " + t.statusText);
-		}
-	};
-
-	opt.parameters="action=updateconfig&srcfilename=" + encodeURIComponent("extensions.conf") + "&dstfilename=" + encodeURIComponent("extensions.conf") + uri;
-	var tmp = new Ajax.Request(asterisk_rawmanPath , opt);
-	// 
+		}
+	);
+
+
 }
 
 
@@ -384,10 +376,8 @@
 	}
 
 	// delete old entry and add new entry
-	var opt = {
-		method: 'get',
-		asynchronous: true,
-		onSuccess: function(t) { 									
+	makerequest('u','extensions.conf', uri,
+		function(t){
 			delete didtrunks[edit_DIDtrunk][edit_pattern] ;
 			didtrunks[temp_provider][newpattern] = new Object();
 			didtrunks[temp_provider][newpattern].priority = temp_priority;
@@ -396,13 +386,9 @@
 			_$('bg_transparent').style.display ='none';
 			refreshtable();
 			gui_feedback("Updated Incoming Rule",'blue');
-		},
-		onFailure: function(t) {
-			gui_alert("Config Error: " + t.status + ": " + t.statusText);
-		}
-	};
-	opt.parameters="action=updateconfig&srcfilename=" + encodeURIComponent("extensions.conf") + "&dstfilename=" + encodeURIComponent("extensions.conf") + uri;
-	var tmp = new Ajax.Request(asterisk_rawmanPath , opt);
+		}
+	);
+
 }
 
 
@@ -434,28 +420,19 @@
 
 function delete_incomingrule(a,b,c,d){ // a is pattern, b is DID_trunk, c is action, d is priority
 	if( !confirm("Are you sure you want to delete this Incoming Calling Rule?") ){ return true; }
-
 	var tmp_match = a+","+d+","+c ;
-	var opt = {
-		method: 'get',
-		asynchronous: true,
-		onSuccess: function(t) { 									
-			// add this to the global object
-			delete didtrunks[b][a];
-			refreshtable();
-			gui_feedback("Deleted 'Incoming Rule'",'default');
-		},
-		onFailure: function(t) {
-			gui_alert("Config Error: " + t.status + ": " + t.statusText);
-		}
-	};
 	var uri = build_action('delete',0, b, "exten" ,"", tmp_match);
 	if( a == "_X." ){
 		var tmp2_match = "s," + d + "," + c ;
 		uri += build_action('delete',1,b,"exten","", tmp2_match);
 	}
-	opt.parameters="action=updateconfig&srcfilename=" + encodeURIComponent("extensions.conf") + "&dstfilename=" + encodeURIComponent("extensions.conf") + uri;
-	var tmp = new Ajax.Request(asterisk_rawmanPath , opt);
+	makerequest('u','extensions.conf', uri,
+		function(t){
+			delete didtrunks[b][a];
+			refreshtable();
+			gui_feedback("Deleted 'Incoming Rule'",'default');
+		}
+	);
 }
 
 

Modified: branches/asterisknow/config/localexts.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/localexts.html?view=diff&rev=984&r1=983&r2=984
==============================================================================
--- branches/asterisknow/config/localexts.html (original)
+++ branches/asterisknow/config/localexts.html Fri May 25 10:57:58 2007
@@ -26,12 +26,22 @@
 <link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
 <script>
 var usercallbacks = new Object;
-var fieldnames = ['allow_aliasextns', 'allow_an_extns', 'callwaiting', 'cancel', 'hasagent', 'hasdirectory', 'hasiax', 'hasmanager', 'hassip', 'hasvoicemail', 'localextenlength', 'save', 'threewaycalling', 'userbase', 'vmsecret', 'login_exten', 'login_callback_exten'];
+var fieldnames = ['allow_aliasextns', 'allow_an_extns', 'callwaiting', 'cancel', 'hasagent', 'hasdirectory', 'hasiax', 'hasmanager', 'hassip', 'hasvoicemail', 'localextenlength', 'save', 'threewaycalling', 'userbase', 'vmsecret', 'login_exten', 'login_callback_exten','operatorExtension'];
 var widgets = {};
 var agent_extens={};
+var OPE; // Operator extension before changes
 
 usercallbacks.format =  function(t) {
 	if(t.name == "general" ){ return t.name; }
+
+	if( !t.fieldbyname['trunkstyle'] ){ // all entries from users.conf other than trunks
+		var ie = (document.attachEvent)? 1:0;
+		h = document.createElement('option');
+		h.text = (t.fieldbyname['fullname'])? unescape(t.fieldbyname['fullname'])+" ("+t.name+")" : "Local Extension ("+t.name+")";
+		h.value = t.name;
+		if(ie){ _$('operatorExtension').add(h);} else{ _$('operatorExtension').add(h,null);}
+	}
+
 	return null;
 }
 
@@ -57,18 +67,18 @@
 		}
 	} 
 	
+	if( _$('operatorExtension').value != OPE ){ 
+		if(OPE){
+			uri += build_action('delete', p, specialcontext ,'exten', "",'o,1,Goto(default,'+OPE+',1)' ); p++;
+		}
+		if(_$('operatorExtension').value.length){
+			uri += build_action('append', p, specialcontext ,'exten', 'o,1,Goto(default,' + _$('operatorExtension').value + ',1)' );p++;
+		}
+	}
+
+
 	if(uri!=""){
-		var opt = {
-			method: 'get',
-			asynchronous: true,
-			onSuccess: function() {},
-			onFailure: function(t) {
-				gui_alert("Config Error: " + t.status + ": " + t.statusText);
-				return false;
-			}
-		};
-		opt.parameters="action=updateconfig&srcfilename=" + encodeURIComponent("extensions.conf") + "&dstfilename=" + encodeURIComponent("extensions.conf") + uri;
-		var tmp = new Ajax.Request(asterisk_rawmanPath, opt);
+		makerequest('u','extensions.conf', uri,function(t){});
 	}
 }
 
@@ -78,6 +88,7 @@
 		return false;
 	}
 
+	OPE = _$('devices').stored_config.catbyname['general'].fieldbyname['operatorExtension'] ;
 	agent_extens.login_exten_old = _$('devices').stored_config.catbyname['general'].fieldbyname['login_exten'] ;
 	agent_extens.login_callback_exten_old = _$('devices').stored_config.catbyname['general'].fieldbyname['login_callback_exten'] ;
 
@@ -89,21 +100,15 @@
 	d.selectitem(0);
 
 	if ( typeof d.stored_config.catbyname['general'].fieldbyname['localextenlength'] == "undefined" ){ 
-		var opt = {
-			method: 'get',
-			asynchronous: true,
-			onSuccess: function(t) { 
+		makerequest('u','users.conf','&Action-000000=update&Cat-000000=general&Var-000000=localextenlength&Value-000000=4',
+			function(t){ 
 				_$('localextenlength').selectedIndex = 2 ;
 				parent.loadscreen(this);
-			},
-			onFailure: function(t) {
-				gui_alert("Config Error: " + t.status + ": " + t.statusText);
 			}
-		};
-		opt.parameters="action=updateconfig&srcfilename=" + encodeURIComponent("users.conf") + "&dstfilename=" + encodeURIComponent("users.conf") + "&Action-000000=update&Cat-000000=general&Var-000000=localextenlength&Value-000000=4"; ;
-		var tmp = new Ajax.Request(asterisk_rawmanPath , opt);
-		return;
-	}
+		);
+		return;
+	}
+
 	parent.loadscreen(this);
 }
 
@@ -180,10 +185,9 @@
 <tr>	
 <td align="center" valign="top">
 	<select id="devices" style="display:none"></select>
-	<BR> 
-	<fieldset  style="width: 400px">
+	<fieldset  style="width: 420px; padding : 3px 0px 0px 0px;">
 		<legend>&nbsp;Local Extension Settings:&nbsp;</legend>
-		<table align='center'  width='390'  cellpadding=2 cellspacing=1>
+		<table align='center' cellpadding=2 cellspacing=1>
 		<tr ><td class="field_text" align=left>
 			Local Extensions are 
 			<select id="localextenlength" class="input9">
@@ -195,13 +199,18 @@
 			</select>&nbsp;</td>
 		</tr>
 		<tr><td class="field_text" align=left>First Extension Number : <input type=text id="userbase" size=5  class="input9"></td></tr>
+		<tr ><td class="field_text" align=left>
+			Operator Extension : <select id="operatorExtension" class="input9"></select>&nbsp;</td>
+		</tr>
+
+
 		<tr><td class="field_text" align="left"><input type=checkbox id="allow_aliasextns">Allow analog phones to be assigned to multiple extensions</td></tr>
 		<tr><td class="field_text" align="left"><input type=checkbox id="allow_an_extns">Allow extensions to be AlphaNumeric (SIP/IAX users)</td></tr>
 		</table>
 	</fieldset><BR>
-	<fieldset  style="width: 400px">
+	<fieldset  style="width: 420px">
 		<legend>&nbsp;Agent Login Settings:&nbsp;</legend>
-		<table align='center'  width='390'  cellpadding=2 cellspacing=1>
+		<table align='center' cellpadding=2 cellspacing=1>
 			<tr>	<td onmouseover="show_tooltip('en', 'users', 18);" class="field_text" align=right>Agent Login Extension : </td>
 				<td><input type=text id="login_exten" size=5  class="input9"></td>
 			</tr>
@@ -210,9 +219,9 @@
 			</tr>
 		</table>
 	</fieldset><BR>
-	<fieldset style="width: 400px">
+	<fieldset style="width: 420px">
 		<legend>&nbsp;Default Settings for a New User:&nbsp;</legend>
-		<table align='center'  width='390'  cellpadding=2 cellspacing=1>
+		<table align='center' cellpadding=2 cellspacing=1>
 		<tr>	<td onmouseover="show_tooltip('en', 'users', 15);" class="field_text" align="right"><input type='checkbox' id='hasagent'></td>
 			<td onmouseover="show_tooltip('en', 'users', 15);" class="field_text" >Is Agent</td>
 			<td onmouseover="show_tooltip('en', 'users', 8);" align=right><input type='checkbox' id='hasvoicemail'></td>

Modified: branches/asterisknow/config/meetme.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/meetme.html?view=diff&rev=984&r1=983&r2=984
==============================================================================
--- branches/asterisknow/config/meetme.html (original)
+++ branches/asterisknow/config/meetme.html Fri May 25 10:57:58 2007
@@ -285,18 +285,18 @@
 			uri +=  build_action('delete', p, "rooms" ,"conf", "", oldvalue );  p++;
 		}
 		uri += build_action('append', p, "rooms","conf", newvalue );  p++;
-		var opt = { method: 'get', asynchronous: true, onComplete: function(){ 
+
+		makerequest('u','extensions.conf',uri,
+			function(t){
 				if( temp_rooms_r ==  -1 ){ // add
 					f.stored_config.catbyname.rooms.fields.push( newvalue );
 				}else{  // update
 					f.stored_config.catbyname.rooms.fields[temp_rooms_r] =  newvalue ;
 				}
-			_$('save').disabled = true; 
-			_$('cancel').disabled = true;
-			} 
-		};
-		opt.parameters="action=updateconfig&srcfilename=" + encodeURIComponent("meetme.conf") + "&dstfilename=" + encodeURIComponent("meetme.conf") + uri;
-		var tmp = new Ajax.Request(asterisk_rawmanPath , opt);
+				_$('save').disabled = true; 
+				_$('cancel').disabled = true;	
+			}
+		);
 		return true;
 	}
 }
@@ -307,14 +307,10 @@
 	for ( var r=0; r < f.stored_config.catbyname.rooms.fields.length; r++ ) {
 		var k = f.stored_config.catbyname.rooms.fields[r].split(",");
 		if(k[0] == temp_selectedexten ){
-			var uri =  build_action('delete', 0, "rooms" ,"conf", "", f.stored_config.catbyname.rooms.fields[r] );  
-			var opt = { 	
-				method: 'get', 
-				asynchronous: true, 
-				onComplete: function(){ f.stored_config.catbyname.rooms.fields.splice(r ,1); } 
-			};
-			opt.parameters="action=updateconfig&srcfilename=" + encodeURIComponent("meetme.conf") + "&dstfilename=" + encodeURIComponent("meetme.conf") + uri;
-			var tmp = new Ajax.Request(asterisk_rawmanPath , opt);
+			var uri =  build_action('delete', 0, "rooms" ,"conf", "", f.stored_config.catbyname.rooms.fields[r] );
+			makerequest('u','meetme.conf', uri ,
+				function(t){ f.stored_config.catbyname.rooms.fields.splice(r ,1); }
+			);
 			break;
 		}
 	}

Modified: branches/asterisknow/config/menus.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/menus.html?view=diff&rev=984&r1=983&r2=984
==============================================================================
--- branches/asterisknow/config/menus.html (original)
+++ branches/asterisknow/config/menus.html Fri May 25 10:57:58 2007
@@ -54,6 +54,17 @@
 		return "Goto '"+  tmp + "' (NOT FOUND)";
 	}
 
+	if( temp[2].match("Goto") && this_step.match('ringroups-custom-')  ){
+		var tmp = this_step.split('Goto')[1].substr(1);
+		tmp = tmp.substr(0, tmp.length-1);
+
+		var m = _$('rgrp');
+		for(var l=0; l < m.options.length; l++ ){
+			if(m.options[l].value == tmp){ return "Goto RingGroup '"+  m.options[l].text + "'"; }
+		}
+		return "Goto '"+  tmp + "' (NOT FOUND)";
+	}
+
 	if( temp[2].match("Answer") )
 		return "Answer the Call";
 	if( temp[2].match("Authenticate") ){
@@ -61,6 +72,12 @@
 		temp[2] = temp[2].replace(/Authenticate\(/, "");
 		temp[2] = temp[2].replace(/\)/, "");
 		return "Authenticate for Password '" + temp[2] + "'";
+	}
+	if( temp[2].match("DISA") ){
+		// Background('') - whatever in the brackets
+		temp[2] = temp[2].replace(/DISA\(/, "");
+		temp[2] = temp[2].replace(/\)/, "");
+		return "DISA ***********";
 	}
 	if( temp[2].match("Background") ){
 		// Background('') - whatever in the brackets
@@ -112,6 +129,12 @@
 	
 	if( temp[2].match("Hangup") )
 		return "Hangup";
+
+	if( temp[2].match("Busy") )
+		return "Busy Tone";
+
+	if( temp[2].match("Congestion") )
+		return "Congestion";
 
 	if( temp[2].match("Directory") && temp[2].match("default"))
 		return "Goto Directory";
@@ -214,20 +237,9 @@
 	}
 	// use the deleted_voicmenu to delete the alias (if it exists) in the default
 	if(_$('alias_exten').value.length > 0){
-		var opt = {
-			method: 'get',
-			asynchronous: true,
-			onSuccess: function(t) { 									
-				delete voicemenusdata[deleted_voicmenu];
-			},
-			onFailure: function(t) {
-				gui_alert("Config Error: " + t.status + ": " + t.statusText);
-			}
-		};
 		var existing_alias_string = voicemenusdata[deleted_voicmenu].alias_exten + ",1,Goto(" + deleted_voicmenu + "|s|1)"  ;
 		var uri = build_action('delete', 0, specialcontext ,"exten", "", existing_alias_string ); 
-		opt.parameters="action=updateconfig&srcfilename=" + encodeURIComponent("extensions.conf") + "&dstfilename=" + encodeURIComponent("extensions.conf") + uri;
-		var tmp = new Ajax.Request(asterisk_rawmanPath, opt);
+		makerequest('u','extensions.conf', uri, function(t){ } );
 	}
 	delete voicemenusdata[deleted_voicmenu];
 }
@@ -285,7 +297,7 @@
 		return;
 	}
 
-	if( _nsa.value != "Answer" && _nsa.value != "GotoDirecotry" && _nsa.value != "Hangup" && !_nsv .value ){
+	if( _nsa.value != "Answer" && _nsa.value != "GotoDirecotry" && _nsa.value != "Busy" && _nsa.value != "Hangup" && _nsa.value != "Congestion" && !_nsv .value ){
 		gui_alert("Please enter a value for '" + _nsa.value +"'");
 		_nsv.focus();
 		return;
@@ -293,10 +305,77 @@
 	_$('status_message').style.display = "";
 	// prepare a request to add the new step to the voicemenu
 	// make a request to append
-	var opt = {
-		method: 'get',
-		asynchronous: true,
-		onSuccess: function() { 
+
+	var uri = "";
+	var action_string = "";
+	var priorities = new Array;
+
+	if(voicemenusdata[_vmv].extensions['s'] && voicemenusdata[_vmv].extensions['s'].length > 0 ){
+		newpriority = 'n';
+	}else{
+		newpriority = 1;
+	}
+
+	switch ( _nsa.value ){
+	case 'Answer':
+		action_string = "s,"+ newpriority+ ",Answer";
+		break;
+	case 'Authenticate':
+		action_string = "s,"+ newpriority+ ",Authenticate(" + _nsv.value + ")";
+		break;
+	case 'DISA':
+		action_string = "s,"+ newpriority+ ",DISA(" + _nsv.value + ")";
+		break;
+	case 'Background':
+		action_string = "s,"+ newpriority+ ",Background(" + _nsv.value + ")";
+		break;
+	case 'Busy':
+		action_string = "s,"+ newpriority+ ",Busy";
+		break;
+	case 'Congestion':
+		action_string = "s,"+ newpriority+ ",Congestion";
+		break;
+	case 'DigitTimeout':
+		action_string = "s,"+ newpriority+ ",Set(TIMEOUT(digit)=" + _nsv.value + ")";
+		break;
+	case 'ResponseTimeout':
+		action_string = "s,"+ newpriority+ ",Set(TIMEOUT(response)=" + _nsv.value + ")";
+		break;
+	case 'Playback':
+		action_string = "s,"+ newpriority+ ",Playback(" + _nsv.value + ")";
+		break;
+	case 'Wait':
+		action_string = "s,"+ newpriority+ ",Wait(" + _nsv.value + ")";
+		break;
+	case 'WaitExten':
+		action_string = "s,"+ newpriority+ ",WaitExten(" + _nsv.value + ")";
+		break;
+	case 'GotoMenu':
+		action_string = "s,"+ newpriority+ ",Goto(" + _nsv.value + "|s|1)";
+		break;
+	case 'GotoExtension':
+		action_string = "s,"+ newpriority+ ",Goto(default|" + _nsv.value + "|1)";
+		break;
+	case 'GotoTimeBasedRule':
+		action_string = "s,"+ newpriority+ ",Goto(" + _$('tbr').value + ")";
+		break;
+	case 'DialRingGroup':
+		action_string = "s,"+ newpriority+ ",Goto(" + _$('rgrp').value + ")";
+		break;
+	case 'Hangup':
+		action_string = "s,"+ newpriority+ ",Hangup";
+		break;
+	case 'GotoDirecotry':
+		action_string = "s,"+ newpriority+ ",Directory(default)";
+		break;
+	default : 
+		action_string = "s,undefined,undefined"; 
+	}
+
+	uri += build_action('append', 0, _vmv,"exten", action_string ); 
+
+	makerequest('u','extensions.conf', uri,
+		function(t){
 			setTimeout(function(){ _$('status_message').style.display = 'none'; },sc_displaytime);
 			// if request successfull then add this to the steps select box
 			var newoption = document.createElement("option"); 
@@ -325,75 +404,8 @@
 			_nsvd = _$('newstep_var_digit'); 
 			_nsvd.value= "";
 			_nsvd.style.display= "none" ;
-		},
-		onFailure: function(t) {
-			_$('status_message').style.display = 'none';
-			gui_alert("Config Error: " + t.status + ": " + t.statusText);
-		}
-	};
-	var uri = "";
-	var action_string = "";
-	var priorities = new Array;
-
-	// algorithm 4 calculate new priority
-	if(voicemenusdata[_vmv].extensions['s'] && voicemenusdata[_vmv].extensions['s'].length > 0 ){
-		for( var p=0; p < voicemenusdata[_vmv].extensions['s'].length; p ++){
-			var temp  = voicemenusdata[_vmv].extensions['s'][p].split(',');
-			priorities.push(temp[1]);
-		}
-		priorities = priorities.sort(sortNumber);
-		newpriority = parseInt(priorities[priorities.length - 1]) + 1;
-	}else{
-		newpriority = 1;
-	}
-
-	switch ( _nsa.value ){
-	case 'Answer':
-		action_string = "s,"+ newpriority+ ",Answer";
-		break;
-	case 'Authenticate':
-		action_string = "s,"+ newpriority+ ",Authenticate(" + _nsv.value + ")";
-		break;
-	case 'Background':
-		action_string = "s,"+ newpriority+ ",Background(" + _nsv.value + ")";
-		break;
-	case 'DigitTimeout':
-		action_string = "s,"+ newpriority+ ",Set(TIMEOUT(digit)=" + _nsv.value + ")";
-		break;
-	case 'ResponseTimeout':
-		action_string = "s,"+ newpriority+ ",Set(TIMEOUT(response)=" + _nsv.value + ")";
-		break;
-	case 'Playback':
-		action_string = "s,"+ newpriority+ ",Playback(" + _nsv.value + ")";
-		break;
-	case 'Wait':
-		action_string = "s,"+ newpriority+ ",Wait(" + _nsv.value + ")";
-		break;
-	case 'WaitExten':
-		action_string = "s,"+ newpriority+ ",WaitExten(" + _nsv.value + ")";
-		break;
-	case 'GotoMenu':
-		action_string = "s,"+ newpriority+ ",Goto(" + _nsv.value + "|s|1)";
-		break;
-	case 'GotoExtension':
-		action_string = "s,"+ newpriority+ ",Goto(default|" + _nsv.value + "|1)";
-		break;
-	case 'GotoTimeBasedRule':
-		action_string = "s,"+ newpriority+ ",Goto(" + _$('tbr').value + ")";
-		break;
-	case 'Hangup':
-		action_string = "s,"+ newpriority+ ",Hangup";
-		break;
-	case 'GotoDirecotry':
-		action_string = "s,"+ newpriority+ ",Directory(default)";
-		break;
-	default : 
-		action_string = "s,undefined,undefined"; 
-	}
-
-	uri += build_action('append', 0, _vmv,"exten", action_string ); 
-	opt.parameters="action=updateconfig&srcfilename=" + encodeURIComponent("extensions.conf") + "&dstfilename=" + encodeURIComponent("extensions.conf") + uri;
-	tmp = new Ajax.Request(asterisk_rawmanPath, opt);
+		}
+	);
 
 }
 
@@ -421,11 +433,90 @@
 	}
 	_$('status_message').style.display ="" ;
 	var _cmv = _$('comment').value ;
-
-	var opt = {
-		method: 'get',
-		asynchronous: true,
-		onSuccess: function() { 
+	var uri = "" ;
+	var p = 0 ;
+	var buildstring = new Object ;
+
+	if( _vms.options[_vms.selectedIndex].innerHTML=='New Entry' ){
+		var current_vmenu = next_freevmenu();
+		uri += build_action('newcat', p, current_vmenu,"", ""); p = p+1;
+		uri += build_action('append', p, current_vmenu,"comment", _cmv ); p = p+1;
+		uri += build_action('append', p, current_vmenu,"alias_exten", _ae.value); p = p+1;
+		if(_ae.value.length > 0){
+			// alias for this voicemenu in [default] section of extensions.conf
+			var alias_string = _ae.value + ",1,Goto(" + current_vmenu + "|s|1)"  ;
+			uri += build_action('append', p, specialcontext ,"exten", alias_string ); p = p+1;
+		}
+
+		if( _ale.checked){ uri += build_action('append', p, current_vmenu,"include", "default"); p = p+1; }
+		uri += build_action('append', p, current_vmenu,"exten", answer_call_string); p = p+1;
+	}else{
+		// Updating existing Voicemenu
+		var current_vmenu = _vms.value;
+		if(  voicemenusdata[current_vmenu].comment != _cmv ){
+			uri += build_action('update', p, current_vmenu ,"comment", _cmv); p = p+1;
+			change_vmenuname_inlistofmenus(voicemenusdata[current_vmenu].comment,_cmv);
+			voicemenusdata[current_vmenu].comment = _cmv;
+		}
+		
+		if(  voicemenusdata[current_vmenu].alias_exten != _ae.value ){
+			var existing_alias_string = voicemenusdata[current_vmenu].alias_exten + ",1,Goto(" + current_vmenu + "|s|1)"  ;
+			if( _ae.value.length > 0 ){
+				// change alias for this voicemenu in 'default' section of extensions.conf
+				var new_alias_string = _ae.value + ",1,Goto(" + current_vmenu + "|s|1)"  ;
+				uri += build_action('update', p, specialcontext ,"exten", new_alias_string,existing_alias_string); p = p+1;
+			}else{
+				// if the user is deleting the alias for this voicemenu, then delete the defined alias in the [default] extensions.conf
+				uri += build_action('delete', p, specialcontext ,"exten", "",existing_alias_string); p = p+1;
+			}
+
+			uri += build_action('update', p, current_vmenu ,"alias_exten", _ae.value ); p = p+1;
+			voicemenusdata[current_vmenu].alias_exten = _ae.value;
+		}
+		
+		if( voicemenusdata[current_vmenu].include =="default" && !_ale.checked ){
+			uri += build_action('delete', p, current_vmenu ,"include",""); p = p+1;
+			voicemenusdata[current_vmenu].include = "" ;
+		}else if ( voicemenusdata[current_vmenu].include !="default"  && _ale.checked ){
+			uri += build_action('append', p, current_vmenu,"include", "default"); p = p+1;
+			voicemenusdata[current_vmenu].include = "default" ;
+		}else if ( !voicemenusdata[current_vmenu].include && _ale.checked ){
+			uri += build_action('append', p, current_vmenu ,"include", "default"); p = p+1;
+			voicemenusdata[current_vmenu].include = "default" ;
+		}
+
+		for (var k=0; k< keys.length; k++){
+			if(voicemenusdata[current_vmenu].extensions[keys[k]]){
+				uri += build_action('delete', p, current_vmenu,"exten", "", voicemenusdata[current_vmenu].extensions[keys[k]][0] ); p = p+1;
+			}
+		}
+	}
+
+	// Build exten strings for enabled keys and append/update the 
+	for (var k=0; k< keys.length; k++){
+		var current_key_action='keypress_'+ keys[k] + '_action';
+		var current_key_text='keypress_'+ keys[k] + '_text';
+		var current_key_exts='keypress_'+ keys[k] + '_exts';
+		var current_key_menus='keypress_'+ keys[k] + '_menus';
+	
+		if( $(current_key_action).value == "disabled")
+			continue;
+		else if( $(current_key_action).value == "gotomenu" )
+				buildstring[keys[k]] = keys[k] + ",1,Goto("+ $(current_key_menus).value + "|s|1)" ;					
+		else if( $(current_key_action).value == "gotoextension" )
+				buildstring[keys[k]] = keys[k] + ",1,Goto(default|"+ $(current_key_exts).value + "|1)" ;					
+		else if( $(current_key_action).value == "Custom" ) 
+				buildstring[keys[k]] = keys[k] + ",1,"+ $(current_key_text).value ;
+		else if( $(current_key_action).value == "Hangup" )
+				buildstring[keys[k]] = keys[k] + ",1,"+ "Hangup" ;					
+		else if( $(current_key_action).value == "PlayInvalid" ) 
+				buildstring[keys[k]] = keys[k] + ",1,"+ "Playback(invalid)" ;
+					
+		uri += build_action('append', p, current_vmenu,"exten", buildstring[keys[k]]); p = p+1;
+	}
+
+	makerequest('u','extensions.conf', uri ,
+		function(t){
 			setTimeout( function(){_$('status_message').style.display="none"; },sc_displaytime );
 			gui_feedback('Updated.','blue');
 			_$('savevmenu').disabled = true;
@@ -465,98 +556,8 @@
 					}
 				}
 			}
-
-		},
-		onFailure: function(t) {
-			_$('status_message').style.display='none';
-			gui_alert("Config Error: " + t.status + ": " + t.statusText);
-		}
-	};
-	var uri = "" ;
-	var p = 0 ;
-	var buildstring = new Object ;
-
-	if( _vms.options[_vms.selectedIndex].innerHTML=='New Entry' ){
-		var current_vmenu = next_freevmenu();
-		uri += build_action('newcat', p, current_vmenu,"", ""); p = p+1;
-		uri += build_action('append', p, current_vmenu,"comment", _cmv ); p = p+1;
-		uri += build_action('append', p, current_vmenu,"alias_exten", _ae.value); p = p+1;
-		if(_ae.value.length > 0){
-			// alias for this voicemenu in [default] section of extensions.conf
-			var alias_string = _ae.value + ",1,Goto(" + current_vmenu + "|s|1)"  ;
-			uri += build_action('append', p, specialcontext ,"exten", alias_string ); p = p+1;
-		}
-
-		if( _ale.checked){ uri += build_action('append', p, current_vmenu,"include", "default"); p = p+1; }

[... 2949 lines stripped ...]


More information about the asterisk-gui-commits mailing list