jlyons: branch asterisknow r331 - in /branches/asterisknow: ./ config/ config...

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Fri Feb 9 12:22:49 MST 2007


Author: jlyons
Date: Fri Feb  9 13:22:48 2007
New Revision: 331

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=331
Log:
Merged revisions 291-292,297-307,309-330 via svnmerge from 
https://origsvn.digium.com/svn/asterisk-gui/trunk

........
r291 | pari | 2007-01-23 19:42:57 -0600 (Tue, 23 Jan 2007) | 1 line

feature: Replacing the extension text box in 'IncomingCalls' with a select box that lists all extensions
........
r292 | pari | 2007-01-24 01:58:21 -0600 (Wed, 24 Jan 2007) | 1 line

typo
........
r297 | pari | 2007-01-29 18:00:23 -0600 (Mon, 29 Jan 2007) | 1 line

Field Validations in Service Providers - changed from callbacks.checkparams to callbacks.beforeSaving as callbacks.beforeSaving is extecuted first and also that it is better to do Field Validations before we update dids_array 
........
r298 | pari | 2007-01-29 18:06:01 -0600 (Mon, 29 Jan 2007) | 1 line

Always show 'Invalid' whether trunk is not defined or is invalid 
........
r299 | pari | 2007-01-29 18:16:55 -0600 (Mon, 29 Jan 2007) | 1 line

removed a link to an invalid include file
........
r300 | pari | 2007-01-30 10:20:31 -0600 (Tue, 30 Jan 2007) | 1 line

Making sure the iframe content is shown after everything is loaded
........
r301 | pari | 2007-01-30 10:28:12 -0600 (Tue, 30 Jan 2007) | 1 line

When a panel is being loaded using back button, open corresponding Accordion panel, could get it working fine - but causing the current page to load twice - so commiting the code so that others any give it a shot or may be i'll work on it somepoint in future 
........
r302 | pari | 2007-01-30 10:29:32 -0600 (Tue, 30 Jan 2007) | 1 line

When a panel is being loaded using back button, open corresponding Accordion panel, could get it working fine - but causing the current page to load twice - so commiting the code so that others can give it a shot or may be i'll work on it somepoint in future 
........
r303 | pari | 2007-01-30 11:04:03 -0600 (Tue, 30 Jan 2007) | 1 line

minor fixes for the sysinfo information not being properly displayed in netscape 
........
r304 | pari | 2007-01-30 11:14:57 -0600 (Tue, 30 Jan 2007) | 1 line

fix: Adding Options to the extnesions select box the proper way
........
r305 | pari | 2007-01-30 19:51:42 -0600 (Tue, 30 Jan 2007) | 1 line

Donot poll events for non Mozilla browsers
........
r306 | pari | 2007-01-30 20:05:54 -0600 (Tue, 30 Jan 2007) | 1 line

Fix for '0008749: Inactivity TimeOut => panel opens blank frame' - Now on each click on a panel a ping request is made and cross checked for a valid session 
........
r307 | pari | 2007-01-30 23:36:57 -0600 (Tue, 30 Jan 2007) | 1 line

minor CSS fixes for home.html
........
r309 | pari | 2007-01-31 18:44:27 -0600 (Wed, 31 Jan 2007) | 1 line

Just trying to make IE happy - you can expect a series of commits that make no sense at all
........
r310 | pari | 2007-01-31 22:23:16 -0600 (Wed, 31 Jan 2007) | 1 line

New Feature: If the GUI cannot Load a config file, stop going any futher, inform the user about the failure to load the corresponding file and redirect him to the main page 
........
r311 | pari | 2007-01-31 23:24:50 -0600 (Wed, 31 Jan 2007) | 1 line

Fix: In the first page of setup wizard, Show the end result even incase something fails during installguitools or scan_zapteldevices
........
r312 | pari | 2007-02-01 00:46:30 -0600 (Thu, 01 Feb 2007) | 1 line

Fix: When a 'New' Conference Bridge is clicked, the new Extension's number is not being calculated properly (always returning 6000)
........
r313 | pari | 2007-02-01 00:56:22 -0600 (Thu, 01 Feb 2007) | 1 line

Fix: When a 'New' Queue is clicked, the new Extension's number is not being calculated properly (always returning 6000)
........
r314 | pari | 2007-02-01 01:15:50 -0600 (Thu, 01 Feb 2007) | 1 line

tweak: A single document.write instead of multiple, slight performance improvement
........
r315 | pari | 2007-02-01 14:04:10 -0600 (Thu, 01 Feb 2007) | 1 line

tweak: in 'Record a Menu' panel, make the record a new voice menu as a modal window
........
r316 | pari | 2007-02-01 17:59:01 -0600 (Thu, 01 Feb 2007) | 1 line

Fix: on page load - key press extensions are being displayed in red, even when they are found in extensions.conf
........
r317 | pari | 2007-02-01 18:18:51 -0600 (Thu, 01 Feb 2007) | 1 line

Tweak: Show the current highlighted field in a different color
........
r318 | pari | 2007-02-01 20:38:26 -0600 (Thu, 01 Feb 2007) | 1 line

Fix: New user extension number
........
r319 | pari | 2007-02-02 09:41:04 -0600 (Fri, 02 Feb 2007) | 1 line

removing a firebug console log
........
r320 | pari | 2007-02-05 13:38:18 -0600 (Mon, 05 Feb 2007) | 1 line

NewFeature: Support for managing Multiple DialPlans 
........
r321 | pari | 2007-02-05 14:01:04 -0600 (Mon, 05 Feb 2007) | 1 line

minor fixes for previous commit
........
r322 | pari | 2007-02-05 14:51:21 -0600 (Mon, 05 Feb 2007) | 1 line

Fix: Voicemail Extension has to be undefined digits long -  http://forums.digium.com/viewtopic.php?t=13182 and at http://forums.digium.com/viewtopic.php?t=12806
........
r323 | pari | 2007-02-05 14:59:51 -0600 (Mon, 05 Feb 2007) | 1 line

Fix: Voicemail Extension has to be undefined digits long -  http://forums.digium.com/viewtopic.php?t=13182 and at http://forums.digium.com/viewtopic.php?t=12806
........
r324 | pari | 2007-02-06 14:54:21 -0600 (Tue, 06 Feb 2007) | 1 line

newfeature: 'Prepend digits' in dialing rules
........
r325 | pari | 2007-02-08 13:15:46 -0600 (Thu, 08 Feb 2007) | 1 line

tweaks: some stupid changes to make IE happy. If you find any thing broken in Firefox becuase of this update please report in our bug tracker - http://bugs.digium.com 
........
r326 | pari | 2007-02-08 13:19:09 -0600 (Thu, 08 Feb 2007) | 1 line

mistake in previous commit
........
r327 | pari | 2007-02-08 13:56:04 -0600 (Thu, 08 Feb 2007) | 1 line

BugFix: Getting a 'this analog phone has been already assigned to another user extension' message when it is not
........
r328 | pari | 2007-02-08 15:08:32 -0600 (Thu, 08 Feb 2007) | 1 line

tweaks: few more changes for IE compatibility
........
r329 | pari | 2007-02-08 15:13:12 -0600 (Thu, 08 Feb 2007) | 1 line

tweak: adding <PRE> in sysinfo_output.html 
........
r330 | pari | 2007-02-08 16:05:59 -0600 (Thu, 08 Feb 2007) | 1 line

Fix: commit 328 caused opera to display the select boxes rather big.
........

Modified:
    branches/asterisknow/   (props changed)
    branches/asterisknow/config/cfgadvanced.html
    branches/asterisknow/config/cfgappliance.html
    branches/asterisknow/config/cfgbasic.html
    branches/asterisknow/config/home.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/numberplan_advanced.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/setup/1.html
    branches/asterisknow/config/setup/3.html
    branches/asterisknow/config/setup/4.html
    branches/asterisknow/config/setup/5.html
    branches/asterisknow/config/setup/6.html
    branches/asterisknow/config/stylesheets/schwing.css
    branches/asterisknow/config/sysinfo.html
    branches/asterisknow/config/trunks.html
    branches/asterisknow/config/users.html
    branches/asterisknow/config/voicemail.html
    branches/asterisknow/gui_configs/gui_sysinfo

Propchange: branches/asterisknow/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Feb  9 13:22:48 2007
@@ -1,1 +1,1 @@
-/trunk:1-289
+/trunk:1-330

Modified: branches/asterisknow/config/cfgadvanced.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/cfgadvanced.html?view=diff&rev=331&r1=330&r2=331
==============================================================================
--- branches/asterisknow/config/cfgadvanced.html (original)
+++ branches/asterisknow/config/cfgadvanced.html Fri Feb  9 13:22:48 2007
@@ -143,8 +143,23 @@
 	function finishfade(page) {	$('mainscreen').style.display = "none"; 	}
 	function setstatus(status) {	$('status').innerHTML = copyright + status;	}
 	function showmainscreen(page) {
-		if (started) 
-			$('mainscreen').src = page.titleBar.id + ".html";
+		if (started) {
+			var opt = {
+				method: 'get',
+				asynchronous: true,
+				onComplete: function (originalRequest){
+						if ( originalRequest.responseText.match("Error") ) {
+							window.location.href=window.location.href;
+							return ;
+						}
+						if ( originalRequest.responseText.match("Pong") ) {
+								$('mainscreen').src = page.titleBar.id + ".html";
+						}
+					}
+			};
+			opt.parameters="action=ping" ;
+			var tmp = new Ajax.Request("../../rawman" , opt);
+		}
 	}
 
 	function fademainscreen(page, newpage) {

Modified: branches/asterisknow/config/cfgappliance.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/cfgappliance.html?view=diff&rev=331&r1=330&r2=331
==============================================================================
--- branches/asterisknow/config/cfgappliance.html (original)
+++ branches/asterisknow/config/cfgappliance.html Fri Feb  9 13:22:48 2007
@@ -134,8 +134,23 @@
 	function finishfade(page) {	$('mainscreen').style.display = "none"; 	}
 	function setstatus(status) {	$('status').innerHTML = copyright + status;	}
 	function showmainscreen(page) {
-		if (started) 
-			$('mainscreen').src = page.titleBar.id + ".html";
+		if (started){
+			var opt = {
+				method: 'get',
+				asynchronous: true,
+				onComplete: function (originalRequest){
+						if ( originalRequest.responseText.match("Error") ) {
+							window.location.href=window.location.href;
+							return ;
+						}
+						if ( originalRequest.responseText.match("Pong") ) {
+								$('mainscreen').src = page.titleBar.id + ".html";
+						}
+					}
+			};
+			opt.parameters="action=ping" ;
+			var tmp = new Ajax.Request("../../rawman" , opt);
+		}
 	}
 
 	function fademainscreen(page, newpage) {

Modified: branches/asterisknow/config/cfgbasic.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/cfgbasic.html?view=diff&rev=331&r1=330&r2=331
==============================================================================
--- branches/asterisknow/config/cfgbasic.html (original)
+++ branches/asterisknow/config/cfgbasic.html Fri Feb  9 13:22:48 2007
@@ -137,9 +137,27 @@
 	function finishfade(page) {	$('mainscreen').style.display = "none"; 	}
 	function setstatus(status) {	$('status').innerHTML = copyright + status;	}
 	function showmainscreen(page) {
-		if (started) 
-			$('mainscreen').src = page.titleBar.id + ".html";
-	}
+		if (started) {
+			var opt = {
+				method: 'get',
+				asynchronous: true,
+				onComplete: function (originalRequest){
+						if ( originalRequest.responseText.match("Error") ) {
+							window.location.href=window.location.href;
+							return ;
+						}
+						if ( originalRequest.responseText.match("Pong") ) {
+								$('mainscreen').src = page.titleBar.id + ".html";
+						}
+					}
+			};
+			opt.parameters="action=ping" ;
+			var tmp = new Ajax.Request("../../rawman" , opt);
+			//$('mainscreen').src = page.titleBar.id + ".html";
+		}
+	}
+
+	
 
 	function fademainscreen(page, newpage) {
 		// Confirm Discard Changes goes here 

Modified: branches/asterisknow/config/home.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/home.html?view=diff&rev=331&r1=330&r2=331
==============================================================================
--- branches/asterisknow/config/home.html (original)
+++ branches/asterisknow/config/home.html Fri Feb  9 13:22:48 2007
@@ -67,6 +67,8 @@
 		parent.setLoggedOn(1);
 		parent.loggedon = 1;
 		localloggedon = 1;
+		$('username').className  = "input9_disabled";
+		$('secret').className  = "input9_disabled";
 		updateButtons();
 		$('statusbar').innerHTML = "<img src='images/tick.gif'><i>Connected!</i>";
 		parent.document.getElementById('logoutlink').innerHTML = "Logout";
@@ -79,6 +81,8 @@
 		parent.setLoggedOn(0);
 		parent.document.getElementById('logoutlink').innerHTML = "&nbsp;";
 		localloggedon = 0;
+		$('username').className  = "input9";
+		$('secret').className  = "input9";
 		updateButtons();
 	}
 	
@@ -103,14 +107,12 @@
 		if (resp == "Pong") {
 			$('statusbar').innerHTML = "<i>Already connected...</i>";
 			loggedOn();
+			parent.loadscreen(this);
 		} else {
 			$('statusbar').innerHTML = "<i>Please login...</i>";
 			loggedOff();
-		}
-	}
-
-	function localajaxinit() {
-		parent.loadscreen(this);
+			parent.loadscreen(this);
+		}
 	}
 
 	function doLogin() {
@@ -132,6 +134,8 @@
 	}
 	
 	function doLogoff() {
+		if(confirm("Are you sure ?") == false)
+			return true;
 		$('statusbar').innerHTML = "<i>Logging off...</i>";
 		parent.astmanEngine.sendRequest('action=logoff', demo.logoffs);
 	}
@@ -139,7 +143,6 @@
 		parent.astmanEngine.sendRequest('action=ping', demo.pongs);
 	}
 	function localinit() {
-		localajaxinit();
 		localajaminit();
 	}
 

Modified: branches/asterisknow/config/incoming.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/incoming.html?view=diff&rev=331&r1=330&r2=331
==============================================================================
--- branches/asterisknow/config/incoming.html (original)
+++ branches/asterisknow/config/incoming.html Fri Feb  9 13:22:48 2007
@@ -30,6 +30,8 @@
 var editstatus ;
 var old_incomingrule, old_fromprovider ;
 var  edit_pattern, edit_DIDtrunk, edit_action, edit_priority ;
+var listOfExtensions = [] ;	// to store all the list of extensions to be displayed in the select menu
+var focus_fields = new Array('incomingrule','frompattern','fromprovider','toextension');
 
 user_callbacks.format = function(t, x) {
 	var tmp = asterisk_guiTDPrefix + t.name ; 
@@ -38,6 +40,9 @@
 		didtrunks[tmp].trunkname = t.fieldbyname['trunkname'] ; 
 		return t.name;
 	}
+	if (t.fieldbyname['fullname'] && t.fieldbyname['fullname'].length && x == undefined && t.name != "general" ) {
+		listOfExtensions.push( t.name + " -- " + t.fieldbyname['fullname'] );
+	}
 	/*
 	var tmp = 'DID_' + t.name;
 	if ( t.name.substring(0,6) == 'trunk_' && x == undefined){
@@ -60,6 +65,10 @@
 // parse all contexts in extensions.conf that look like [DID_trunk_x]
 // and show each entry in the table
 numplan_callbacks.format = function(t, x) {
+	if ((t.name == specialcontext && x != undefined )){
+		var p = format_extension( $('extensions'), t, x)  ;
+		if ( p != null ){ listOfExtensions.push(p); }
+	}
 	if (		( t.name.substring(0,asterisk_guiTDPrefix.length) == asterisk_guiTDPrefix ) && x == undefined){
 		if(typeof didtrunks[t.name] == "undefined"){
 			didtrunks[t.name] = new Object();
@@ -79,6 +88,20 @@
 }
 
 numplan_callbacks.loaded = function() {
+	listOfExtensions.sort();
+	for(var a =0; a < listOfExtensions.length ; a++ ){
+		var b = listOfExtensions[a].split(' -- ');
+		//$('toextension').innerHTML = $('toextension').innerHTML + "<option value='" + b[0] + "'>" + listOfExtensions[a] + "</option>";
+		  var New_OPTION = document.createElement('option');
+		  New_OPTION.text = listOfExtensions[a] ;
+		  New_OPTION.value = b[0] ;
+		  try {
+			$('toextension').add(New_OPTION, null); // W3C way
+		  }catch(ex) {
+			$('toextension').add(New_OPTION); // IE way
+		  }
+	}
+
 	// load list of trunks to 'fromprovider'
 	var t ;
 	for ( t in didtrunks){
@@ -94,9 +117,9 @@
 			b.add(a); 
 		  }
 	}
-	parent.loadscreen(this);
 	// load the object didtrunks into the table callingRulesTable
 	refreshtable();
+	parent.loadscreen(this);
 }
 
 numplan_callbacks.eachline = true;
@@ -167,7 +190,7 @@
 	$('fromprovider').selectedIndex = -1;
 	old_incomingrule = "allunmatched";
 	old_fromprovider = "";
-	$('toextension').value = "";
+	$('toextension').selectedIndex = -1;
 	$('frompattern').value = "";
 	$('save_a').disabled = true;
 	$('thatmatch').style.display = "none" ;
@@ -204,7 +227,13 @@
 	if( c.match("Goto") && !c.match("voicemenu-")  ){ 
 		var tmp = c.split('(');
 		var exten = tmp[1].split('|'); // extension is exten[1]
-		$('toextension').value = exten[1];
+		$('toextension').selectedIndex = -1 ;
+		for(var t=0; t < $('toextension').length ; t++ ){
+			if( $('toextension').options[t].value == exten[1] ){
+				$('toextension').selectedIndex = t;
+				break;
+			}
+		}
 	}
 
 	$('userscontent').style.display = "";
@@ -230,11 +259,11 @@
 		return false;
 	}
 	if( $('fromprovider').selectedIndex == -1 ){
-		alert("Please select a serive provider !");
+		alert("Please select a service provider !");
 		$('fromprovider').focus();
 		return false;
 	}
-	if( $('toextension').value == "" ){
+	if( $('toextension').selectedIndex == -1 ){
 		alert("Please select an extension to which an incoming call should be routed to !");
 		$('toextension').focus();
 		return false;
@@ -302,7 +331,7 @@
 		$('frompattern').select();
 		return false;
 	}
-	if( $('toextension').value == "" ){
+	if( $('toextension').selectedIndex == -1 ){
 		alert("Please select an extension to which an incoming call should be routed to !");
 		$('toextension').focus();
 		return false;
@@ -425,6 +454,10 @@
 
 
 function localajaxinit() {
+	for (var x =0; x < focus_fields.length; x++ ) {
+		$(focus_fields[x]).onfocus = function(){this.className = 'input9_hilight';}
+		$(focus_fields[x]).onblur = function(){this.className = 'input9';}
+	}
 	parent.astmanEngine.config2list("users.conf", $('users'), new Array(), user_callbacks);
 }
 </script>
@@ -463,17 +496,17 @@
 			</table>
 			<TABLE align=center cellpadding=2 cellspacing=2 border=0 width="100%">
 			<TR><TD height=10></TD></TR>
-			<TR><TD align=center>	<NOBR>Route <select id="incomingrule"  onclick="checksave(this)">
+			<TR><TD align=center>	<NOBR>Route <select id="incomingrule"  onclick="checksave(this)" class="input9">
 											<option value="allunmatched">All Unmatched incoming calls</option>
 											<option value="frompattern">incoming calls that match </option>
 										</select>
-										<span id="thatmatch">pattern <input type="text" id="frompattern" size=12  onchange="enablesave();"  onkeyup="enablesave();"></span>
+										<span id="thatmatch">pattern <input type="text" id="frompattern" size=12  onchange="enablesave();"  onkeyup="enablesave();"  class="input9"></span>
 										</NOBR>
 					</TD>
 			</TR>
-			<TR><TD align=center>from provider <select id="fromprovider" onclick="checksave(this)"></select></TD></TR>
+			<TR><TD align=center>from provider <select id="fromprovider" onclick="checksave(this)"  class="input9"></select></TD></TR>
 			<TR>
-				<TD align=center>to extension <input type="text" id="toextension" size=5 onchange="enablesave();"  onkeyup="enablesave();"></TD>
+				<TD align=center>to extension <select id="toextension" onchange="enablesave();"  onkeyup="enablesave();"  class="input9"></select></TD>
 			</TR>
 			<TR>
 				<TD align=center height=50 valign=middle>  
@@ -484,7 +517,7 @@
 			</TABLE>
 		</div>
 </div>
-<div id="bg_transparent" STYLE="display:none; position: absolute; left: 0; top: 24; width:100%; height:100%;  background-color:#FFFFFF; filter:alpha(opacity=50); -moz-opacity:.50;opacity:.50; border-width: 1px; border-color: #7E5538; border-style: solid; z-index:4">
+<div id="bg_transparent" STYLE="display:none; position: absolute; left: 0; top: 24; width:100%; height:100%;  background-color:#EFEFEF; -moz-opacity:.50;opacity:.50; border-width: 1px; border-color: #EFEFEF; border-style: solid; z-index:4">
 </div>
 <SCRIPT LANGUAGE="JavaScript">
 <!--

Modified: branches/asterisknow/config/localexts.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/localexts.html?view=diff&rev=331&r1=330&r2=331
==============================================================================
--- branches/asterisknow/config/localexts.html (original)
+++ branches/asterisknow/config/localexts.html Fri Feb  9 13:22:48 2007
@@ -28,6 +28,7 @@
 var usercallbacks = new Object;
 var fieldnames = new Array('status', 'save','userbase','localextenlength','allow_aliasextns');
 var widgets = new Array;
+var focus_fields = new Array('localextenlength','userbase');
 
 function tosetup(){
 	parent.window.location.href = "./setup/install.html";
@@ -83,7 +84,17 @@
 				widgets[fieldnames[x]] = $(fieldnames[x]);
 				widgets[fieldnames[x]].disabled = true;
 			}
-			$('localextenlength').addEventListener("change", update_spae, false);
+			for (var x =0; x < focus_fields.length; x++ ) {
+				widgets[focus_fields[x]].onfocus = function(){this.className = 'input9_hilight';}
+				widgets[focus_fields[x]].onblur = function(){this.className = 'input9';}
+			}
+
+			if ($('localextenlength').addEventListener){
+				  $('localextenlength').addEventListener('change', update_spae, false); 
+			} else if ($('localextenlength').attachEvent){
+				  $('localextenlength').attachEvent('onchange', update_spae);
+			}
+
 			parent.astmanEngine.config2list("users.conf", $('devices'),widgets, usercallbacks);
 }
 
@@ -116,8 +127,8 @@
 <table class="mainscreenTable" align="center">
 	<tr>	<td align="center" valign="top">
 					<select id="devices" style="display:none"></select> 
-					<p class="field_text">	Local Extensions are <select id="localextenlength"><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option></select> digits long&nbsp;</p>
-					<p class="field_text">	Starting point of Allocation of extensions : <input type=text id="userbase" size=5>	</p>
+					<p class="field_text">	Local Extensions are <select id="localextenlength" class="input9"><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option></select> digits long&nbsp;</p>
+					<p class="field_text">	Starting point of Allocation of extensions : <input type=text id="userbase" size=5  class="input9">	</p>
 					<p class="field_text"> <input type=checkbox id="allow_aliasextns">Allow analog phones to be assigned to multiple extensions</p>
 					<center>
 							<div style="height:15px" id='status'></div><BR>

Modified: branches/asterisknow/config/meetme.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/meetme.html?view=diff&rev=331&r1=330&r2=331
==============================================================================
--- branches/asterisknow/config/meetme.html (original)
+++ branches/asterisknow/config/meetme.html Fri Feb  9 13:22:48 2007
@@ -23,7 +23,6 @@
 <script src="scripts/rico.js"></script>
 <script src="scripts/astman.js"></script>
 <script src="scripts/tooltip.js"></script>
-<script src="scripts/extensions.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" />
 
@@ -41,7 +40,7 @@
 				'music','menu', 'announce',
 				'room','record','waitmarked','setmarked','quiet',
 				'pin', 'pinadmin', 'save', 'cancel');
-
+	var focus_fields = new Array('name','pin','pinadmin','room');
 	function changed_extension() {
 		var app;
 		tmp = $('extensions').value.split(']');
@@ -112,7 +111,7 @@
 	}
 	
 	callbacks.loaded = function() {
-		merge_users($('extensions'), $('hiddenusers'));
+		merge_extensions($('extensions'), $('hiddenusers'));
 		for (x=0;x<$('extensions').options.length;x++) {
 			var tmp;
 			tmp = $('extensions').options[x].value.split(']');
@@ -126,6 +125,12 @@
 		}
 		$('extensions').contentEditable = 'true';
 		$('extensions').disabled = 0;
+		if( navigator.userAgent.indexOf("MSIE") != -1){
+			$('advancedw').style.height=130;
+			togglefeatures = function(){ } ;
+		}else{
+			$('extensions').style.height = "415px";
+		}
 		parent.loadscreen(this);
 	}
 	callbacks.sortfunc = function(a,b) {
@@ -136,10 +141,21 @@
 		var x;
 		var gen;
 		gen = $('hiddenusers').stored_config.catbyname['general'];
-		if (gen)
+		if (gen){
 			x = gen.fieldbyname['userbase'];
-		if (x)
-			tmp['name'] = first_free_exten($('extensions'), x);
+			for( var f=0; f < $('extensions').options.length ; f++ ){
+					if( x < $('extensions').options[f].innerHTML.split(' -- ')[0] )
+						break;
+					x++;
+			}
+		}else{
+				try{ 
+					x = ( parseInt($('extensions').options[$('extensions').options.length - 1 ].innerHTML.split(' -- ')[0] ) ) + 1; 
+				}catch(err){
+					x = 6000; // a default value if one is not defined in users.conf's general context
+				}
+		}
+		tmp['name'] = x ;
 		tmp['pin'] = '';
 		tmp['pinadmin'] = '';
 		tmp['music'] = 'yes';
@@ -264,6 +280,10 @@
 			widgets[fieldnames[x]] = $(fieldnames[x]);
 			widgets[fieldnames[x]].disabled = true;
 		}
+		for (var x =0; x < focus_fields.length; x++ ) {
+			widgets[focus_fields[x]].onfocus = function(){this.className = 'input8_hilight';}
+			widgets[focus_fields[x]].onblur = function(){this.className = 'input8';}
+		}
 		parent.astmanEngine.config2list("users.conf", $('hiddenusers'), new Array(), usercallbacks);
 	}
 </script>
@@ -279,7 +299,7 @@
 <table class="mainscreenTable" align="center">
 	<tr valign="top"><td colspan='2'>Extensions:</td>	</tr>
 	<tr valign="top">
-		<td><select disabled size="28" id="extensions" style="width:220px;height: 415px" class="input10">	
+		<td><select disabled size="25" id="extensions" style="width:220px;" class="input10">	
 							<option>Loading...</option>	
 				</select>
 				<div style='visibility:hidden;overflow:hidden;width:0px;height:0px'>	<select id='hiddenusers'>	</select></div>

Modified: branches/asterisknow/config/menus.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/menus.html?view=diff&rev=331&r1=330&r2=331
==============================================================================
--- branches/asterisknow/config/menus.html (original)
+++ branches/asterisknow/config/menus.html Fri Feb  9 13:22:48 2007
@@ -130,19 +130,21 @@
 		}
 }
 
-function select_menu (my_field_options, menustring){
+function select_menu (my_field_options, menustring, a){
 		var tmp = menustring.split('(');
 		var tmp1 = tmp[1].split('|');
+		if(a == "ismenu"){var check_against = tmp1[0]; }
+		if(a == "isext"){ var check_against = tmp1[1] ;}
 		for(y=0; y < $(my_field_options).options.length; y++ ){
-			if( $(my_field_options).options[y].value == tmp1[0]){
+			if( $(my_field_options).options[y].value == check_against ){
 				$(my_field_options).options[y].selected = true;
 				return true;
 			}
 		}
 		// if not in the current list of voicemenus/extensions then add it to the menu
 		var newoption = document.createElement("option"); 
-		newoption.text = tmp1[1] ; 
-		newoption.value = tmp1[1] ;
+		newoption.text = check_against ; 
+		newoption.value = check_against ;
 		$(my_field_options).options.add(newoption);
 		$(my_field_options).options[y].style.fontWeight = 'bold';
 		$(my_field_options).options[y].selected = true;
@@ -523,16 +525,17 @@
 
 
 function generate_fields(key){
-			document.write('<select  class="input8" style="font-family: Verdana, Arial, Helvetica, Sans-Serif;font-size: 11px;"   id=\'keypress_'+ key + '_action\' onchange="key_action(this.value, \'' + key + '\')">\n');
-			document.write('<option value="disabled">Disabled</option>\n');
-			document.write('<option value="gotomenu">Goto Menu</option>\n');
-			document.write('<option value="gotoextension">Goto Extension</option>\n');
-			document.write('<option value="Custom">Custom</option>\n');
-			document.write('<option value="Hangup">Hangup</option>\n');
-			document.write('<option value="PlayInvalid">Play Invalid</option>\n');
-			document.write('</select>&nbsp;<input type="text" class="input8" size=16 style="display:none;font-family: Verdana, Arial, Helvetica, Sans-Serif;font-size: 11px;" id="keypress_' + key+ '_text" onchange="enable_savecancel()">\n');
-			document.write('<select  style="display:none; font-family: Verdana, Arial, Helvetica, Sans-Serif;font-size: 11px;"  id="keypress_'+ key + '_menus" onchange="enable_savecancel()" class="input8"></select>\n');
-			document.write('<select  style="display:none; font-family: Verdana, Arial, Helvetica, Sans-Serif;font-size: 11px;"  id="keypress_'+ key + '_exts" onchange="enable_savecancel()" class="input8"></select>\n');
+			var t = '<select  class="input8" style="font-family: Verdana, Arial, Helvetica, Sans-Serif;font-size: 11px;"   id=\'keypress_'+ key + '_action\' onchange="key_action(this.value, \'' + key + '\')">\n';
+			t += '<option value="disabled">Disabled</option>\n' ;
+			t += '<option value="gotomenu">Goto Menu</option>\n';
+			t += '<option value="gotoextension">Goto Extension</option>\n';
+			t += '<option value="Custom">Custom</option>\n';
+			t += '<option value="Hangup">Hangup</option>\n';
+			t += '<option value="PlayInvalid">Play Invalid</option>\n';
+			t += '</select>&nbsp;<input type="text" class="input8" size=16 style="display:none;font-family: Verdana, Arial, Helvetica, Sans-Serif;font-size: 11px;" id="keypress_' + key+ '_text" onchange="enable_savecancel()">\n';
+			t += '<select  style="display:none; font-family: Verdana, Arial, Helvetica, Sans-Serif;font-size: 11px;"  id="keypress_'+ key + '_menus" onchange="enable_savecancel()" class="input8"></select>\n';
+			t += '<select  style="display:none; font-family: Verdana, Arial, Helvetica, Sans-Serif;font-size: 11px;"  id="keypress_'+ key + '_exts" onchange="enable_savecancel()" class="input8"></select>\n';
+			return t;
 }
 
 function step_onselect(){
@@ -758,13 +761,13 @@
 							$(current_key_menus).style.display = "";
 							$(current_key_text).style.display = "none";
 							$(current_key_exts).style.display = "none";
-							select_menu (current_key_menus, tmp[2]);
+							select_menu (current_key_menus, tmp[2],"ismenu");
 					}else  if( tmp[2].match("Goto") && !tmp[2].match("voicemenu-") ){ // //  if "goto an extension " (no 'voicemenu-')
 							$(current_key_action).options[2].selected = true;
 							$(current_key_exts).style.display = "";
 							$(current_key_text).style.display = "none";
 							$(current_key_menus).style.display = "none";
-							select_menu(current_key_exts, tmp[2]); // select_menu common for exts and menus
+							select_menu(current_key_exts, tmp[2],"isext"); // select_menu common for exts and menus
 					}else if(tmp[2].match("Hangup") ){ // if HangUp
 							$(current_key_action).options[4].selected = true;
 							$(current_key_text).style.display = "none";
@@ -849,6 +852,7 @@
 			}
 			load_extensions('add_newstep_extensions');
 			load_menus('add_newstep_menus');
+			parent.loadscreen(this);
 }
 
 menuscallbacks.identifier = "extension";
@@ -934,7 +938,7 @@
 			widgets[fieldnames[x]] = $(fieldnames[x]);
 			widgets[fieldnames[x]].disabled = true;
 		}
-		parent.loadscreen(this);
+		//parent.loadscreen(this);
 		parent.astmanEngine.config2list("extensions.conf", $('extensions'), new Array(), extencallbacks);
 }
 
@@ -1031,12 +1035,12 @@
 	</tr>
 	<tr valign="top">
 		<td>
-			<select size="20" id="vmenus" style="width:180px; height: 415px" class="input10">
+			<select size="25" id="vmenus" style="width:180px;" class="input10">
 			<option>Loading...</option>
 			</select>
-			<div style='visibility:hidden;overflow:hidden;width:0px;height:0px'><select id='extensions'></select><select id='users'></select><select id='recorded_files'></select></div>
 		</td>
 		<td valign=top align="right" width=346 height=415>
+					<select id='extensions' style='display:none;width:0px;height:0px'></select><select id='users' style='display:none;width:0px;height:0px'></select><select id='recorded_files' style='display:none;width:0px;height:0px'></select>
 						<table align="center" width="346">
 						<tr>
 								<td width="50" align=left class="field_text" onmouseover="show_tooltip('en', 'menus', 0);">Name:</td>
@@ -1313,11 +1317,12 @@
 													<SCRIPT LANGUAGE="JavaScript">
 													<!--
 													for (var k=0; k< keys.length; k++){
-														document.write("<TR bgcolor='#FFFFFF'>\n");
-														document.write("<TD width=35 align=center><font style=\"font-size: 10pt\">"+keys[k]+"</font></TD>\n");
-														document.write("<TD>");
-														generate_fields( keys[k] ) ;
-														document.write("\n </TD></TR>\n\n");											
+														var p =  generate_fields( keys[k] )  ; 
+														document.write("<TR bgcolor='#FFFFFF'>\n"
+														+ "<TD width=35 align=center><font style=\"font-size: 10pt\">"+keys[k]+"</font></TD>\n"
+														+ "<TD>" 
+														+ p
+														+ "\n </TD></TR>\n\n" );
 													}
 													//-->
 													</SCRIPT>

Modified: branches/asterisknow/config/numberplan.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/numberplan.html?view=diff&rev=331&r1=330&r2=331
==============================================================================
--- branches/asterisknow/config/numberplan.html (original)
+++ branches/asterisknow/config/numberplan.html Fri Feb  9 13:22:48 2007
@@ -1,11 +1,12 @@
 <!--
  * Asterisk -- An open source telephony toolkit.
  *
- * Configuration for "MeetMe Extensions"
+ * Configuration for "NumberPlans"
  *
  * Copyright (C) 1999 - 2006, Digium, Inc.
  *
  * Mark Spencer <markster at digium.com>
+ * Pari Nannapaneni <pari at digium.com>
  *
  * See http://www.asterisk.org for more information about
  * the Asterisk project. Please do not directly contact
@@ -25,26 +26,573 @@
 <link href="stylesheets/rico.css" media="all" rel="Stylesheet" type="text/css" />
 <link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
 <script>
-var trunks_desc = new Object;
-var trunkcallbacks = new Object;
-var numplan_callbacks = new Object;
-var default_numberplan = 0;
-var default_np_rules = new Array;
-var default_np_comments = new Array;
-var default_np_data = new Object;
+var widgets = [ ] ;
+var trunkcallbacks = { };
+var trunks_desc = { };
+var numplan_callbacks = { };
+var numberplansdata = { };
+var fieldnames = new Array( 'new', 'delete', 'save', 'cancel', 'status','name','plancomment','include');
+var focus_fields = new Array('rulename','trunks','beginswith','followedby','strip','pattern','plancomment','prepend');
+//var default_numberplan = 0;
 var isnewrule ;
 var iscustom ;
 var pattern_beingedited ;
 var pattern_beingedited_priority ;
 var oldselect;
+var np_oldselect;
+
+function hackenablesave(){
+	if( oldselect != $('trunks').value ){
+		enablesave();
+	}
+}
+
+function ownpattern(){
+		iscustom = true;
+		$('define_advanced').style.display="";
+		$('define_usual').style.display="none";
+}
+
+function enablesave(){
+	$('save_a').disabled = 0;
+	return true;
+}
+
+function add_callingrule(){
+	isnewrule = true;
+	$('rulename').value = "";
+	$('trunks').selectedIndex = -1 ;
+	$('pattern').value = "";
+	$('prepend').value = "";
+	$('strip').value = "0" ;
+	$('save_a').disabled = 1;
+	$('define_advanced').style.display="none";
+	$('define_usual').style.display="";
+	$('userscontent').style.display="";
+	$('bg_transparent').style.display ='';
+	$('addrule').disabled =1;
+	$('beginswith').value = "";
+	$('followedby').value ="";
+	$('ormore').checked = false;
+}
+
+function checkfields(){
+	if( $('rulename').value.length == 0 ){
+		alert("Please enter a Rule Name");
+		$('rulename').focus();
+		return false;
+	}
+	if($('trunks').selectedIndex == -1){
+		alert("Please select a service provider to place this call through");
+		return false;
+	}
+	if($('define_advanced').style.display=="none" && $('beginswith').value.length==0 ){
+		alert("Please Enter the beginning pattern of the number");
+		$('beginswith').focus();
+		return false;
+	}
+	if($('define_usual').style.display=="none" && $('pattern').value.length == 0 ){
+		alert("Please Enter a custom pattern");
+		$('pattern').focus();
+		return false;
+	}
+return true;
+}
+
+function	buildpatternstring(){
+	var pattern = $('beginswith').value;
+	// Add an underscore
+	pattern = "_" + pattern;
+	// append 'followedby' number of X's 
+	for (var r=0; r < $('followedby').value ; r++){
+		pattern = pattern + "X" ;
+	}
+	// append a '.' if 'ormore' is checked
+	if( $('ormore').checked ){
+			pattern = pattern + "." ;
+	}
+	// assign this to the field 'pattern'
+	$('pattern').value = pattern;
+}
+
+function add_rule_fromeditform( this_priority, oncomplete ){
+					if(	iscustom ){ // custom - take pattern as is
+						var commentstring = "custom";
+					}else{
+						var commentstring = "standard";
+						//build a pattern into $('pattern').value
+						buildpatternstring();
+					}
+
+					var rule_string = $('pattern').value + ',' + this_priority + ',Macro(trunkdial,${' + $('trunks').value + '}/'+ $('prepend').value +'${EXTEN:' + $('strip').value + '})' ;
+					var uri = build_action('append', 0 , $('extensions').value  ,"exten", rule_string );
+					commentstring = $('pattern').value + ',' + this_priority + ',' + $('rulename').value + "," + commentstring ;
+					uri += build_action('append', 1 , $('extensions').value  ,"comment", commentstring );
+
+					var opt = {
+						method: 'get',
+						asynchronous: true,
+						onSuccess: function(t) { 
+									$('status_message').style.display="none";
+									var m = numberplansdata[$('extensions').value]['npdata'];
+									if ( typeof m[$('pattern').value] == 'undefined' ) {
+										m[$('pattern').value] = { };
+									}
+									m[$('pattern').value][this_priority] = new ruleinanpdata($('trunks').value, $('strip').value, $('prepend').value);
+									m[$('pattern').value][this_priority].rulename =  $('rulename').value ; 
+									m[$('pattern').value][this_priority].ruledesc = parsepattern($('pattern').value,0) ;
+									oncomplete(); 
+						},
+						onFailure: function(t) {
+							alert("Config Error: " + t.status + ": " + t.statusText);
+						}
+					};
+					opt.parameters= "action=updateconfig&reload=yes&srcfilename=" + encodeURIComponent("extensions.conf") + "&dstfilename=" + encodeURIComponent("extensions.conf") + uri;
+					$('userscontent').style.display="none";
+					$('bg_transparent').style.display ='none';
+					$('status_message').style.display="block";
+					var tmp = new Ajax.Request("../../rawman", opt);
+}
+
+function saverule(){
+	if ( !checkfields() ) return false;
+	 if(isnewrule){ 
+					var newpriority=1;
+					var m = numberplansdata[$('extensions').value]['npdata'];
+					if( typeof m[$('pattern').value] !="undefined" ){
+						for ( var y in m[$('pattern').value] ){
+							if ( y == "extend"){break;}
+							newpriority++;
+						}
+					}
+					add_rule_fromeditform( newpriority, oncomplete = function(){ show_npdata_table( $('extensions').value ); } );
+	 }else{	// update exiting rule
+			// delete existing rule
+			// add rule with new values
+					delete_callingrule(pattern_beingedited,pattern_beingedited_priority, oncomplete = function(){
+					add_rule_fromeditform( pattern_beingedited_priority, oncomplete = function(){ show_npdata_table( $('extensions').value ); } );
+				} 
+			) ;
+			//$('userscontent').style.display='none';
+			//$('addrule').disabled =0;
+			//return true;
+	 }
+}
+
+function parse_nprulesAndnpcomments(){
+	// for each element in numberplansdata[t.name]	{
+	//			create an object numberplansdata[t.name]['npdata']
+	//			parse "numberplansdata[t.name]['nprules']" and add to "numberplansdata[t.name]['npdata']"
+	//			parse "numberplansdata[t.name]['npcomments']" and add to "numberplansdata[t.name]['npdata']"
+	//	}
+	for(x in  numberplansdata){
+			if ( x == "extend"){ break;}
+			var z = numberplansdata[x];
+			var y = z['npdata'];
+			for ( k =0 ; k < z['nprules'].length ; k++ ){

[... 2411 lines stripped ...]


More information about the asterisk-gui-commits mailing list