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

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Wed Nov 8 14:41:54 MST 2006


Author: pari
Date: Wed Nov  8 15:41:54 2006
New Revision: 118

URL: http://svn.digium.com/view/asterisk-gui?rev=118&view=rev
Log:
Voicemenus can now be assigned with an extension

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

Modified: trunk/config/jabber.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/jabber.html?rev=118&r1=117&r2=118&view=diff
==============================================================================
--- trunk/config/jabber.html (original)
+++ trunk/config/jabber.html Wed Nov  8 15:41:54 2006
@@ -106,7 +106,7 @@
 			</td>
 			</tr>
 			<tr><td align="center" class="field_text">
-						<img src="./images/jabber.gif" border=0><BR>
+						<!-- <img src="./images/jabber.gif" border=0> --><BR><BR>
 						<font size=-2>
 						Jabber&trade; is a collection of open, XML-based protocols for instant messaging and presence information.
 						</font><BR><font size=-2>Jabber&reg; is a registered trademark of Jabber, Inc.</font>

Modified: trunk/config/meetme.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/meetme.html?rev=118&r1=117&r2=118&view=diff
==============================================================================
--- trunk/config/meetme.html (original)
+++ trunk/config/meetme.html Wed Nov  8 15:41:54 2006
@@ -162,6 +162,12 @@
 					//parent.$('tooltip').innerHTML = " <font size=\"-2\" color=\"#FF0000\">Click on \'Voicemail\' panel to edit Voicemail Preferences</font>";
 					box.selectedIndex = -1;
 					alert(" You can not edit the selected entry from here.\n Please click on the \'Voicemail\' panel to edit the selected entry");
+					return true;
+				}
+				if( box.options[box.selectedIndex].text.toLowerCase().match("-- voice menu")     ){
+					box.selectedIndex = -1;
+					//parent.$('tooltip').innerHTML = " <font size=\"-2\" color=\"#FF0000\">Click on \'Voicemail\' panel to edit Voicemail Preferences</font>";
+					alert(" You can not edit the selected entry from here.\n Please click on the \'Voice Menus\' panel to edit the selected entry");
 					return true;
 				}
 				box.selectedIndex = -1;

Modified: trunk/config/menus.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/menus.html?rev=118&r1=117&r2=118&view=diff
==============================================================================
--- trunk/config/menus.html (original)
+++ trunk/config/menus.html Wed Nov  8 15:41:54 2006
@@ -168,17 +168,34 @@
 					for(var i=0; i< $(current_key_menus).options.length; i++){
 								if( $(current_key_menus).options[i].text == $('comment').value ){
 										// delete this option from the $(current_key_menus)
+										var deleted_voicmenu = $(current_key_menus).options[i].value ;
 										$(current_key_menus).remove(i);
 										break;
 								}
 					}
 	}
-					for(var i=0; i< $('add_newstep_menus').options.length; i++){
-								if( $('add_newstep_menus').options[i].text == $('comment').value ){
-										$('add_newstep_menus').remove(i);
-										break;
-								}
+	for(var i=0; i< $('add_newstep_menus').options.length; i++){
+				if( $('add_newstep_menus').options[i].text == $('comment').value ){
+						$('add_newstep_menus').remove(i);
+						break;
+				}
+	}
+	// 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) { 									
+					},
+					onFailure: function(t) {
+						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&reload=yes&srcfilename=" + encodeURIComponent("extensions.conf") + "&dstfilename=" + encodeURIComponent("extensions.conf") + uri;
+			var tmp = new Ajax.Request("../../rawman", opt);
+	}
 }
 
 function change_vmenuname_inlistofmenus(oldname,newname){
@@ -276,6 +293,8 @@
 				update_updown();
 				$('newstep_var').value= "";
 				$('newstep_var').style.display = "none" ;
+				$('add_newstep_extensions').style.display = "none";
+				$('add_newstep_menus').style.display = "none";
 				$('combodiv_sounds').style.display = "none" ;
 				$('newstep_var_digit').value= "";
 				$('newstep_var_digit').style.display= "none" ;
@@ -367,6 +386,7 @@
 					if( $('vmenus').options[$('vmenus').selectedIndex].innerHTML=='New Entry' ){ // (if new Voicemenu 
 							voicemenusdata[current_vmenu] = new Object();	
 							voicemenusdata[current_vmenu].comment =  $('comment').value;
+							voicemenusdata[current_vmenu].alias_exten =  $('alias_exten').value;
 							voicemenusdata[current_vmenu].extensions = new Object();
 							// add the "s,1,Answer" data to voicemenus data
 							voicemenusdata[current_vmenu].extensions['s'] = new Array();
@@ -411,6 +431,13 @@
 			var current_vmenu = next_freevmenu();
 			uri += build_action('newcat', p, current_vmenu,"", ""); p = p+1;
 			uri += build_action('append', p, current_vmenu,"comment", $('comment').value); p = p+1;
+			uri += build_action('append', p, current_vmenu,"alias_exten", $('alias_exten').value); p = p+1;
+			if($('alias_exten').value.length > 0){
+				// alias for this voicemenu in [default] section of extensions.conf
+				var alias_string = $('alias_exten').value + ",1,Goto(" + current_vmenu + "|s|1)"  ;
+				uri += build_action('append', p, specialcontext ,"exten", alias_string ); p = p+1;
+			}
+
 			if( $('allowexten').checked){
 				uri += build_action('append', p, current_vmenu,"include", "default"); p = p+1;
 			}
@@ -422,6 +449,21 @@
 					uri += build_action('update', p, current_vmenu ,"comment", $('comment').value ); p = p+1;
 					change_vmenuname_inlistofmenus(voicemenusdata[current_vmenu].comment,$('comment').value);
 					 voicemenusdata[current_vmenu].comment = $('comment').value;
+			}
+			
+			if(  voicemenusdata[current_vmenu].alias_exten != $('alias_exten').value ){
+					var existing_alias_string = voicemenusdata[current_vmenu].alias_exten + ",1,Goto(" + current_vmenu + "|s|1)"  ;
+					if( $('alias_exten').value.length > 0 ){
+						// change alias for this voicemenu in 'default' section of extensions.conf
+						var new_alias_string = $('alias_exten').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", $('alias_exten').value ); p = p+1;
+					 voicemenusdata[current_vmenu].alias_exten = $('alias_exten').value;
 			}
 			
 			 if( voicemenusdata[current_vmenu].include =="default" && !$('allowexten').checked ){
@@ -574,6 +616,7 @@
 
 
 
+
 function delete_step(){
 	// delete the selected step and update voicemenusdata and update 'select' object - steps
 	$('status_message').style.display="block";
@@ -647,6 +690,12 @@
 	//$('keypressoptions').innerHTML = "";
 	$('steps').options.length =0;
 	$('comment').value = voicemenusdata[current_context].comment;
+	$('alias_exten').disabled = false; 
+	if( voicemenusdata[current_context].alias_exten ){
+		$('alias_exten').value = voicemenusdata[current_context].alias_exten;
+	}else{
+		$('alias_exten').value = ""; 
+	}
 
 	if(voicemenusdata[current_context].extensions['s']){
 		for (x=0;x<voicemenusdata[current_context].extensions['s'].length ; x++ ){
@@ -758,6 +807,10 @@
 					voicemenusdata[current_context].extensions = new Object();
 					return false;
 				}
+				if (t.names[x]=='alias_exten'){
+					voicemenusdata[current_context].alias_exten =  t.fields[x];
+					return false;
+				}
 				if (t.names[x]=='include'){
 					voicemenusdata[current_context].include=  t.fields[x];
 					return false;
@@ -815,6 +868,8 @@
 	$('steps').disabled = true;
 	$('stepUp').disabled = true;
 	$('stepDown').disabled = true;
+	$('alias_exten').value = "";
+	$('alias_exten').disabled = true;
 }
 
 menuscallbacks.cancelchanges =function(){
@@ -855,9 +910,13 @@
 		$('steps').disabled = true;
 	//  4. Reset Comment
 		$('keypressoptions').style.display = "";
+		
+		$('alias_exten').disabled = false;
+		$('alias_exten').value = "";
 		$('comment').disabled = false;
 		$('comment').value = "";
 		$('comment').focus();
+
 }
 
 
@@ -881,21 +940,23 @@
 	var qname;
 	if ((t.name != specialcontext))
 		return null;
+
+		// check whether the extension is an alias to a custom voice menu
+		try{
+					var temp = t.fields[x].split(',') ;
+					if ( temp[2].match("Goto") && temp[2].match("voicemenu-custom-" )  ){
+							return null ;
+					}
+		}
+		catch(e){
+
+		}
+
 	res = format_extension($('extensions'), t, x);
-	//if (t.subfields[x]['app'] == 'Queue') {
-	//	return null;
-	//}
 	return res;
 }
 
 extencallbacks.loaded = function() {
-	// all extensions loaded will be in the format of "ext -- name" format
-	// but we need only ext
-	for (var p=0; p < $('extensions').length ; p++){
-		var tmp = $('extensions').options[p].text.split (" -- ");
-		$('extensions').options[p].text = tmp[0];
-	}
-
 	parent.astmanEngine.config2list("users.conf", $('users'), new Array(), usercallbacks);
 }
 
@@ -916,7 +977,8 @@
 
 usercallbacks.loaded = function (){
 	for(var p=0; p < $('extensions').length; p++){
-		extensions_array.push ($('extensions').options[p].text);
+		var tmp = $('extensions').options[p].text.split (" -- ");
+		extensions_array.push (tmp[0]);
 	}
 	for(var p=0; p < $('users').length; p++){
 		extensions_array.push ($('users').options[p].text);
@@ -947,7 +1009,13 @@
 		</td>
 		<td valign=top align="right" width=346 height=415>
 						<table align="center" width="346">
-						<tr onmouseover="show_tooltip('en', 'menus', 0);"><td width="50" align=left class="field_text">Name:</td><td align=left><input id='comment'  onKeyUp="enable_savecancel()"  pattern='^[a-zA-Z_0-9 ]*$' disabled  class="input8"></td></tr>
+						<tr onmouseover="show_tooltip('en', 'menus', 0);">
+								<td width="50" align=left class="field_text">Name:</td>
+								<td align=left class="field_text">
+										<input id='comment'  size=15 onKeyUp="enable_savecancel()"  pattern='^[a-zA-Z_0-9 ]*$' disabled  class="input8">&nbsp;
+										Extension: <input id="alias_exten"  onKeyUp="enable_savecancel()"  size=4 disabled class="input8">
+								</td>
+						</tr>
 						<tr onmouseover="show_tooltip('en', 'menus', 1);">
 									<td class="field_text">Steps:<BR>
 														<input  style='width:45'  type="button" id="stepUp" value="Up" disabled onClick="step_up()" class="buttonbold"><BR><BR>

Modified: trunk/config/options.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/options.html?rev=118&r1=117&r2=118&view=diff
==============================================================================
--- trunk/config/options.html (original)
+++ trunk/config/options.html Wed Nov  8 15:41:54 2006
@@ -214,6 +214,12 @@
 		widgets[fieldnames[x]] = $(fieldnames[x]);
 		widgets[fieldnames[x]].disabled = true;
 	}
+
+	// if not appliance - hide the gui_accesssettings DIV
+	if ( !parent.window.location.href.match("cfgappliance.html") ){
+		$('gui_accesssettings').style.display="none";
+	}
+
 	parent.astmanEngine.config2list("http.conf", $('hiddenfield'), widgets, httpconf_callbacks);
 	return;
 }
@@ -239,13 +245,11 @@
 			</td>
 	</tr>
 	<tr valign="top" height="18">	<td></td></tr>
-	<tr valign="top" height="18">	<td align="center">
-														<TABLE align="center" border=0 cellpadding=0 cellpadding=0 width=320><TR><TD align=left><B>GUI - access settings: </B></TD></TR></TABLE>
-														</td>
-	</tr>
 	<tr>	<td align="center" valign="top">
 					<div id="gui_accesssettings" class="chanlist_small"  style="width: 320px; height:120">
-					<table>	<tr>	<td colspan=2 height=5></td></tr>
+					<table>	
+					<TR><TD colspan=2 align=center><B>GUI - access settings: </B></TD></TR>
+					<tr>	<td colspan=2 height=5></td></tr>
 									<tr  onmouseover="show_tooltip('en', 'options', 3);">
 													<td class="field_text">Bind Address:</td>		<td><input size=14 id='bindaddr' dfalt="127.0.0.1" onkeydown="$('save').disabled=false; $('cancel').disabled=false;"  class="input8"></td>
 									</tr>

Modified: trunk/config/queues.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/queues.html?rev=118&r1=117&r2=118&view=diff
==============================================================================
--- trunk/config/queues.html (original)
+++ trunk/config/queues.html Wed Nov  8 15:41:54 2006
@@ -392,7 +392,7 @@
 </div>
 <div class="mainscreenContentBox" id="mailboxcontent">
 <table class="mainscreenTable" align="center">
-	<tr valign="top"><td colspan='2'>Call Queues:</td></tr>
+	<tr valign="top"><td colspan='2'>Extensions:</td></tr>
 	<tr valign="top">
 		<td>	<select size="28" id="queues"  style="width:220px; height: 415px" class="input10"><option>Loading...</option></select>
 					<div style='visibility:hidden;overflow:hidden;width:0px;height:0px'><select id='extensions'></select><select id='devices'></select><select id='finalextensions'></select></div>

Modified: trunk/config/scripts/astman.js
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/scripts/astman.js?rev=118&r1=117&r2=118&view=diff
==============================================================================
--- trunk/config/scripts/astman.js (original)
+++ trunk/config/scripts/astman.js Wed Nov  8 15:41:54 2006
@@ -1635,6 +1635,26 @@
 			return null;
 		tmp = t.fields[x].split(',');
 		priority = tmp[1];
+
+
+		// if it is a Voicemenu alias .. return "extension -- Voicemenu"
+		if ( tmp[2].match("Goto") && tmp[2].match("voicemenu-custom-" )  ){
+
+			t.subfields[x]['context'] = t.name;
+			t.subfields[x]['name'] = tmp[0];
+			t.subfields[x]['app'] = "Goto";
+			t.subfields[x]['label'] = "Voice Menu";
+			t.subfields[x]['args'] = "";
+			t.subfields[x]['priority'] = priority;
+
+				box.calcname = tmp[0];
+				box.calccontext = t.name;
+				box.calcpriority = priority;
+				return tmp[0] + " -- Voice Menu"  ;
+		}
+		//
+
+
 		if (!multipriority && (tmp[1] != '1'))
 			return null;
 		exten = tmp[0];
@@ -1661,7 +1681,7 @@
 		t.subfields[x]['label'] = label;
 		t.subfields[x]['args'] = args;
 		t.subfields[x]['priority'] = priority;
-
+		//alert( "t.name = " + t.name + "\n exten: " + exten + " \n app: " + app + " \n label:" + label + " \n args:" + args + " \n priority: " + priority );
 
 		if (priority == 'n') {
 			if ((box.calcname == exten) && (box.calccontext == t.name))

Modified: trunk/config/users.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/users.html?rev=118&r1=117&r2=118&view=diff
==============================================================================
--- trunk/config/users.html (original)
+++ trunk/config/users.html Wed Nov  8 15:41:54 2006
@@ -118,6 +118,13 @@
 					alert(" You can not edit the selected entry from here.\n Please click on the \'Voicemail\' panel to edit the selected entry");
 					return true;
 				}
+				if( box.options[box.selectedIndex].text.toLowerCase().match("-- voice menu")     ){
+					box.selectedIndex = -1;
+					//parent.$('tooltip').innerHTML = " <font size=\"-2\" color=\"#FF0000\">Click on \'Voicemail\' panel to edit Voicemail Preferences</font>";
+					alert(" You can not edit the selected entry from here.\n Please click on the \'Voice Menus\' panel to edit the selected entry");
+					return true;
+				}
+
 		}
 	}
 

Modified: trunk/config/voicemail.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/voicemail.html?rev=118&r1=117&r2=118&view=diff
==============================================================================
--- trunk/config/voicemail.html (original)
+++ trunk/config/voicemail.html Wed Nov  8 15:41:54 2006
@@ -121,6 +121,12 @@
 					//parent.$('tooltip').innerHTML = " <font size=\"-2\" color=\"#FF0000\">Click on \'Conferencing\' panel to edit a Conference Bridge</font>";
 					box.selectedIndex = -1;
 					alert(" You can not edit the selected entry from here.\n Please click on the \'Conferencing\' panel to edit the selected entry");
+					return true;
+				}
+				if( box.options[box.selectedIndex].text.toLowerCase().match("-- voice menu")     ){
+					box.selectedIndex = -1;
+					//parent.$('tooltip').innerHTML = " <font size=\"-2\" color=\"#FF0000\">Click on \'Voicemail\' panel to edit Voicemail Preferences</font>";
+					alert(" You can not edit the selected entry from here.\n Please click on the \'Voice Menus\' panel to edit the selected entry");
 					return true;
 				}
 				box.selectedIndex = -1;



More information about the asterisk-gui-commits mailing list