pari: trunk r74 - in /trunk/config: menus.html numberplan.html options.html

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Mon Oct 16 17:45:53 MST 2006


Author: pari
Date: Mon Oct 16 19:45:52 2006
New Revision: 74

URL: http://svn.digium.com/view/asterisk-gui?rev=74&view=rev
Log:
minor bug fix in VoiceMenus

Modified:
    trunk/config/menus.html
    trunk/config/numberplan.html
    trunk/config/options.html

Modified: trunk/config/menus.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/menus.html?rev=74&r1=73&r2=74&view=diff
==============================================================================
--- trunk/config/menus.html (original)
+++ trunk/config/menus.html Mon Oct 16 19:45:52 2006
@@ -281,7 +281,7 @@
 					$('cancel').disabled = true;
 					
 					if( $('vmenus').options[$('vmenus').selectedIndex].innerHTML=='New Entry' ){ // (if new Voicemenu 
-							voicemenusdata[current_vmenu] = new Object();
+							voicemenusdata[current_vmenu] = new Object();	
 							voicemenusdata[current_vmenu].comment =  $('comment').value;
 							voicemenusdata[current_vmenu].extensions = new Object();
 							// add the "s,1,Answer" data to voicemenus data
@@ -324,8 +324,9 @@
 			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;
-			if( $('allowexten').checked)
+			if( $('allowexten').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
@@ -334,15 +335,15 @@
 					uri += build_action('update', p, current_vmenu ,"comment", $('comment').value ); p = p+1;
 			}
 			
-			 if( typeof ($('vmenus').stored_config.catbyname[current_vmenu].fieldbyname['include']) == "string" && $('vmenus').stored_config.catbyname[current_vmenu].fieldbyname['include']=="default" && !$('allowexten').checked ){
+			 if( voicemenusdata[current_vmenu].include =="default" && !$('allowexten').checked ){
 						uri += build_action('delete', p, current_vmenu ,"include",""); p = p+1;
-						$('vmenus').stored_config.catbyname[current_vmenu].fieldbyname['include'] = "" ;
-			}else if ( typeof ($('vmenus').stored_config.catbyname[current_vmenu].fieldbyname['include']) == "string" && $('vmenus').stored_config.catbyname[current_vmenu].fieldbyname['include']!="default" && $('allowexten').checked ){
+						voicemenusdata[current_vmenu].include = "" ;
+			}else if ( voicemenusdata[current_vmenu].include !="default"  && $('allowexten').checked ){
+						uri += build_action('append', p, current_vmenu,"include", "default"); p = p+1;
+						voicemenusdata[current_vmenu].include = "default" ;
+			}else if ( !voicemenusdata[current_vmenu].include && $('allowexten').checked ){
 						uri += build_action('append', p, current_vmenu ,"include", "default"); p = p+1;
-						$('vmenus').stored_config.catbyname[current_vmenu].fieldbyname['include'] = "default" ;
-			}else if ( typeof ($('vmenus').stored_config.catbyname[current_vmenu].fieldbyname['include']) != 'string' && $('allowexten').checked ){
-						uri += build_action('append', p, current_vmenu ,"include", "default"); p = p+1;
-						$('vmenus').stored_config.catbyname[current_vmenu].fieldbyname['include'] = "default" ;
+						voicemenusdata[current_vmenu].include = "default" ;
 			}
 
 			for (var k=0; k< keys.length; k++){
@@ -547,7 +548,7 @@
 	
 	$('allowexten').checked = false;
 
-	if ( typeof  $('vmenus').stored_config.catbyname[current_context].fieldbyname['include'] == "string" && $('vmenus').stored_config.catbyname[current_context].fieldbyname['include'] == "default" ){
+	if ( voicemenusdata[current_context].include == "default" ){
 			$('allowexten').checked = true;
 	}
 
@@ -593,6 +594,7 @@
 	$('deletestep').disabled = true;
 	$('stepDown').disabled = true;
 	$('stepUp').disabled = true;
+	$('delete').disabled = false;
 
 	for (y=0; y<keys.length ; y++ ){
 			current_key_action='keypress_'+ keys[y] + '_action';
@@ -658,6 +660,10 @@
 				if (t.names[x]=='comment'){
 					voicemenusdata[current_context].comment =  t.fields[x];
 					voicemenusdata[current_context].extensions = new Object();
+					return false;
+				}
+				if (t.names[x]=='include'){
+					voicemenusdata[current_context].include=  t.fields[x];
 					return false;
 				}
 				if (t.names[x]=='exten'){

Modified: trunk/config/numberplan.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/numberplan.html?rev=74&r1=73&r2=74&view=diff
==============================================================================
--- trunk/config/numberplan.html (original)
+++ trunk/config/numberplan.html Mon Oct 16 19:45:52 2006
@@ -336,7 +336,7 @@
 		} else {
 			adstatus = "shown";
 			$('advancedw').style.visibility = "visible";
-			new Rico.Effect.Size('advancedw', null, 200, 120, 8 );
+			new Rico.Effect.Size('advancedw', null, 160, 120, 8 );
 		}
 	}
 
@@ -505,9 +505,8 @@
 						//-->
 						</SCRIPT>
 				</td></tr>
-				<tr><td>Trunk:</td><td><select id='trunk'></select></td></tr>
-				<tr><td>Priority:</td><td><input size='4' id='priority' pattern='^\d*$'></td></tr>
-				<tr><td>Real Priority:</td><td><input size='4' id='realpriority' pattern='^\d*$'></td></tr>
+				<tr><td>Trunk:</td><td><select id='trunk'></select><input size='4' id='priority' pattern='^\d*$' type=hidden><input size='4' id='realpriority' pattern='^\d*$'  type=hidden></td></tr>
+
 				<tr><td colspan='2' align='center'><div style="height:15px" id='status'></div></td></tr>
 				<tr><td colspan='2'></td></tr>
 				</table>
@@ -519,10 +518,10 @@
 			<tr><td>
 				<div style="background-image:url(images/slice-v.png)" id='advancedw'>
 				<table id='advancedi' align='center'><tr><td>
-				<tr><td>Customize Plans</td><td><input type='checkbox' id='modplan' onClick='updateplandel()'></td></tr>
-				<tr><td>Plan Ident</td><td><input size='15' type='text' id='planident'></td></tr>
-				<tr><td>Plan Comment</td><td><input size='15' type='text' id='comment' disabled='yes'></td></tr>
-				<tr><td>Builds On</td><td><input size='15' type='text' id='include'></td></tr>
+				<tr><td><NOBR>Customize Plans</NOBR></td><td><input type='checkbox' id='modplan' onClick='updateplandel()'></td></tr>
+				<tr><td>Plan Ident</td><td><input size='14' type='text' id='planident'></td></tr>
+				<tr><td>Plan Comment</td><td><input size='14' type='text' id='comment' disabled='yes'></td></tr>
+				<tr><td>Builds On</td><td><input size='14' type='text' id='include'></td></tr>
 				<tr><td colspan='2' align='center'><input style='width:80' type='button' id='new' value='New Plan'></td></tr>
 				</table>
 				</div>

Modified: trunk/config/options.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/options.html?rev=74&r1=73&r2=74&view=diff
==============================================================================
--- trunk/config/options.html (original)
+++ trunk/config/options.html Mon Oct 16 19:45:52 2006
@@ -28,12 +28,15 @@
 var options = new Object;
 var options_fields = new Array('pwdbutton', 'currentpass', 'newpass','newpass_rep');
 var widgets = new Array;
-var fieldnames = new Array('status','bindaddr','bindport','save','cancel');
+var fieldnames = new Array('bindaddr','bindport');
 var widgets2  = new Array;
-var fieldnames2 = new Array('status','httptimeout','save','cancel');
-
+var fieldnames2 = new Array('httptimeout');
 var httpconf_callbacks = new Object;
 var managerconf_callbacks = new Object;
+var default_bindaddress, default_port, default_httptimeout;
+
+
+
 function loggedOff() {
 			for(var x=0; x< options_fields.length; x++){
 				$(options_fields[x]).disabled = true;
@@ -80,6 +83,49 @@
 		var tmp = new Ajax.Request("../../rawman", opt);
 		return;
 }
+
+
+
+function	update_guisettings_manager(){
+	var opt = {
+			method: 'get',
+			asynchronous: true,
+			onSuccess: function() { 
+				$('status').innerHTML = " <I> Configuration Saved ! </I>";
+				$('save').disabled=true;
+				$('cancel').disabled=true;
+				default_bindaddress = $('bindaddr').value; default_port = $('bindport').value ; default_httptimeout = $('httptimeout').value;
+			},
+			onFailure: function(t) {
+				alert("Config Error: " + t.status + ": " + t.statusText);
+			},
+		};
+		opt.parameters ="action=updateconfig&reload=yes&srcfilename=manager.conf&dstfilename=manager.conf&Action-000000=update&Cat-000000=general&Var-000000=httptimeout&Value-000000="+ encodeURIComponent($('httptimeout').value);
+		var tmp = new Ajax.Request("../../rawman", opt);
+		return;
+}
+
+
+
+function update_guisettings_http(){
+	var opt = {
+			method: 'get',
+			asynchronous: true,
+			onSuccess: function() { 
+				update_guisettings_manager();
+			},
+			onFailure: function(t) {
+				alert("Config Error: " + t.status + ": " + t.statusText);
+			},
+		};
+		opt.parameters ="action=updateconfig&reload=yes&srcfilename=http.conf&dstfilename=http.conf&Action-000000=update&Cat-000000=general&Var-000000=bindport&Value-000000="+ encodeURIComponent($('bindport').value) + "&Action-000001=update&Cat-000001=general&Var-000001=bindaddr&Value-000001=" + encodeURIComponent($('bindaddr').value );
+		var tmp = new Ajax.Request("../../rawman", opt);
+		return;
+}
+
+
+
+
 
 function showResponse(originalRequest)	{
 		var v = originalRequest.responseText.split("Success");
@@ -147,8 +193,19 @@
 
 managerconf_callbacks.loaded = function() {
 	$('hiddenfield2').selectitem(0);
-		parent.loadscreen(this);
-}
+	parent.loadscreen(this);
+	default_bindaddress = $('bindaddr').value; default_port = $('bindport').value ; default_httptimeout = $('httptimeout').value;
+	$('save').disabled=true;
+	$('cancel').disabled=true;
+}
+
+function cancel_guisettings(){
+	$('bindaddr').value = default_bindaddress ; $('bindport').value =default_port ; $('httptimeout').value = default_httptimeout ;
+	$('save').disabled=true;
+	$('cancel').disabled=true;
+}
+
+
 </script>
 <body id="foo" onload="localajaxinit()">
 <div class="mainscreenTitleBar"><span style="margin-left: 4px;font-weight:bold">Admin Options</span></div>
@@ -170,11 +227,11 @@
 	<tr>	<td align="center" valign="top" height=170>
 					<div id="channellist" class="chanlist">
 					<table>	<tr>	<td colspan=2 height=18></td></tr>
-									<tr  onmouseover="show_tooltip('en', 'options', 3);"><td>Bind Address:</td>		<td><input size=14 id='bindaddr' dfalt="127.0.0.1"></td></tr>
-									<tr  onmouseover="show_tooltip('en', 'options', 4);"><td>Port:</td>						<td><input size=14 id='bindport' dfalt=80></td></tr>
-									<tr  onmouseover="show_tooltip('en', 'options', 5);"><td>HTTP Timeout:</td>	<td><input size=14 id='httptimeout'></td></tr>
+									<tr  onmouseover="show_tooltip('en', 'options', 3);"><td>Bind Address:</td>		<td><input size=14 id='bindaddr' dfalt="127.0.0.1" onkeydown="$('save').disabled=false; $('cancel').disabled=false;"></td></tr>
+									<tr  onmouseover="show_tooltip('en', 'options', 4);"><td>Port:</td>						<td><input size=14 id='bindport' dfalt=80  onkeydown="$('save').disabled=false; $('cancel').disabled=false;"></td></tr>
+									<tr  onmouseover="show_tooltip('en', 'options', 5);"><td>HTTP Timeout:</td>	<td><input size=14 id='httptimeout'  onkeydown="$('save').disabled=false; $('cancel').disabled=false;"></td></tr>
 									<tr><td colspan=2><BR></td></tr>
-									<tr><td colspan=2 align=center><input type=button id=save value="Save">&nbsp;<input type=button id=cancel value="Cancel"></td></tr>
+									<tr><td colspan=2 align=center><input type=button id=save value="Save"  onclick="update_guisettings_http()">&nbsp;<input type=button id=cancel value="Cancel" onclick="cancel_guisettings()"></td></tr>
 					</table>
 					<select  size="5" id="hiddenfield" style="display:none;"></select>
 					<select  size="5" id="hiddenfield2" style="display:none; width:220px"></select>



More information about the asterisk-gui-commits mailing list