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

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Wed Jan 17 16:59:33 MST 2007


Author: jlyons
Date: Wed Jan 17 17:59:32 2007
New Revision: 270

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=270
Log:
Merged revisions 260-269 via svnmerge from 
https://origsvn.digium.com/svn/asterisk-gui/trunk

........
r260 | pari | 2007-01-16 19:12:38 -0600 (Tue, 16 Jan 2007) | 1 line

BugFix: Clicking on the 'Home' panel while logged in is triggering two pollevents.
........
r261 | pari | 2007-01-16 19:50:52 -0600 (Tue, 16 Jan 2007) | 1 line

tweak- 0008726: Dynamically Generate list of sound files
........
r262 | pari | 2007-01-16 21:16:36 -0600 (Tue, 16 Jan 2007) | 1 line

Fix for -- 0008771: System happy to assign multiple extensions to the same analog line
........
r263 | pari | 2007-01-16 21:38:22 -0600 (Tue, 16 Jan 2007) | 1 line

bugfix: in setup wizard, service provider context is being set to 'default' instead of DID_context 
........
r264 | pari | 2007-01-16 22:10:24 -0600 (Tue, 16 Jan 2007) | 1 line

Bug Fix: During setup wizard - User Extensions page is not checking whether an entered user extension has been assinged to a Voicemail, voicemenu, queues or conferencing 
........
r265 | pari | 2007-01-16 22:15:19 -0600 (Tue, 16 Jan 2007) | 1 line

Bug fix: check for duplicate extensions before saving
........
r266 | pari | 2007-01-17 12:50:44 -0600 (Wed, 17 Jan 2007) | 1 line

if the localextenlength is changed the userbase will automatically be recalculated
........
r267 | pari | 2007-01-17 13:06:23 -0600 (Wed, 17 Jan 2007) | 1 line

Removing the onunload and onbeforeunload events as they are causing trouble while refreshing (F5)
........
r268 | pari | 2007-01-17 17:13:19 -0600 (Wed, 17 Jan 2007) | 1 line

lots of minor changes and fixes
........
r269 | pari | 2007-01-17 17:21:49 -0600 (Wed, 17 Jan 2007) | 1 line

that was stupid
........

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/homeapp.html
    branches/asterisknow/config/localexts.html
    branches/asterisknow/config/meetme.html
    branches/asterisknow/config/menus.html
    branches/asterisknow/config/options.html
    branches/asterisknow/config/queues.html
    branches/asterisknow/config/setup/1.html
    branches/asterisknow/config/setup/2.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/setup/7.html
    branches/asterisknow/config/users.html
    branches/asterisknow/config/voicemail.html

Propchange: branches/asterisknow/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Jan 17 17:59:32 2007
@@ -1,1 +1,1 @@
-/trunk:1-256
+/trunk:1-269

Modified: branches/asterisknow/config/cfgadvanced.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/cfgadvanced.html?view=diff&rev=270&r1=269&r2=270
==============================================================================
--- branches/asterisknow/config/cfgadvanced.html (original)
+++ branches/asterisknow/config/cfgadvanced.html Wed Jan 17 17:59:32 2007
@@ -159,22 +159,6 @@
 	}
 
 	function registerajax() {
-		window.onbeforeunload = 	function(){
-				if(loggedon == 1)
-				return "Doing so will terminate your Asterisk GUI session"; 
-		}
-
-		window.onunload = 	function(){
-				if(loggedon != 1) return true;
-				var opt2 = {
-						method: 'get',asynchronous: true,
-						onSuccess: function() {setLoggedOn(0);loggedon == -1;},
-						onFailure: function(t) {}
-				};
-				opt2.parameters ="action=logoff";
-				var tmp2 = new Ajax.Request("../../rawman", opt2);
-		}
-
 		var pnameheight = 22;
 		var pheight = (503  - (pnameheight*panels.length) ) ;
 		accordion = new Rico.Accordion( $('configpanel'), { panelHeight: pheight,onHideTab:fademainscreen,onShowTab:showmainscreen });
@@ -229,7 +213,7 @@
 							<a href="#" onclick=" system_link()">System Configuration</a>&nbsp;|&nbsp;
 							<a target='_extern' href="http://www.digium.com/en/company/profile/">About Digium</a>&nbsp;|&nbsp;
 							<a target='_extern' href="http://www.asterisknow.org/bugs">Report a Bug</a>&nbsp;|&nbsp;
-							<a href="#">Help</a>&nbsp;
+							<a target='_extern' href="http://www.asterisknow.org/help">Help</a>&nbsp;
 							<input type="hidden" id="login_name">
 							</td>
 </tr>

Modified: branches/asterisknow/config/cfgappliance.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/cfgappliance.html?view=diff&rev=270&r1=269&r2=270
==============================================================================
--- branches/asterisknow/config/cfgappliance.html (original)
+++ branches/asterisknow/config/cfgappliance.html Wed Jan 17 17:59:32 2007
@@ -150,22 +150,6 @@
 	}
 
 	function registerajax() {
-		window.onbeforeunload = 	function(){
-				if(loggedon == 1)
-				return "Doing so will terminate your Asterisk GUI session"; 
-		}
-
-		window.onunload = 	function(){
-				if(loggedon != 1) return true;
-				var opt2 = {
-						method: 'get',asynchronous: true,
-						onSuccess: function() {setLoggedOn(0);loggedon == -1;},
-						onFailure: function(t) {}
-				};
-				opt2.parameters ="action=logoff";
-				var tmp2 = new Ajax.Request("../../rawman", opt2);
-		}
-
 		var pnameheight = 22;
 		var pheight = (503  - (pnameheight*panels.length) )  ;
 		accordion = new Rico.Accordion( $('configpanel'), { panelHeight: pheight,onHideTab:fademainscreen,onShowTab:showmainscreen });
@@ -214,7 +198,7 @@
 <tr height=47><td valign="bottom" align='right' bgcolor='white' height=47><img align='left' src="images/digiumlogo.gif" align="left"></td>
 							<td valign='bottom' align='right' bgcolor='white' colspan=2><a target='_extern' href="http://www.digium.com/en/company/profile/">About Digium</a>&nbsp;|&nbsp;
 							<a target='_extern' href="http://www.asterisknow.org/bugs">Report a Bug</a>&nbsp;|&nbsp;
-							<a href="#">Help</a>&nbsp;
+							<a target='_extern' href="http://www.asterisknow.org/help">Help</a>&nbsp;
 							<input type="hidden" id="login_name">
 							</td>
 </tr>

Modified: branches/asterisknow/config/cfgbasic.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/cfgbasic.html?view=diff&rev=270&r1=269&r2=270
==============================================================================
--- branches/asterisknow/config/cfgbasic.html (original)
+++ branches/asterisknow/config/cfgbasic.html Wed Jan 17 17:59:32 2007
@@ -154,22 +154,6 @@
 
 
 	function registerajax() {
-		window.onbeforeunload = 	function(){
-				if(loggedon == 1)
-				return "Doing so will terminate your Asterisk GUI session"; 
-		}
-
-		window.onunload = 	function(){
-				if(loggedon != 1) return true;
-				var opt2 = {
-						method: 'get',asynchronous: true,
-						onSuccess: function() {setLoggedOn(0);loggedon == -1;},
-						onFailure: function(t) {}
-				};
-				opt2.parameters ="action=logoff";
-				var tmp2 = new Ajax.Request("../../rawman", opt2);
-		}
-
 		var pnameheight = 22;
 		var pheight = (503  - (pnameheight*panels.length) ) ;
 		accordion = new Rico.Accordion( $('configpanel'), { panelHeight: pheight,onHideTab:fademainscreen,onShowTab:showmainscreen });
@@ -228,7 +212,7 @@
 									<a href="#" onclick=" system_link()">System Configuration</a>&nbsp;|&nbsp;
 									<a target='_extern' href="http://www.digium.com/en/company/profile/">About Digium</a>&nbsp;|&nbsp;
 									<a target='_extern' href="http://www.asterisknow.org/bugs">Report a Bug</a>&nbsp;|&nbsp;
-									<a href="#">Help</a>&nbsp;
+									<a target='_extern' href="http://www.asterisknow.org/help">Help</a>&nbsp;
 									<input type="hidden" id="login_name">
 							</td>
 </tr>

Modified: branches/asterisknow/config/home.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/home.html?view=diff&rev=270&r1=269&r2=270
==============================================================================
--- branches/asterisknow/config/home.html (original)
+++ branches/asterisknow/config/home.html Wed Jan 17 17:59:32 2007
@@ -51,7 +51,6 @@
 			localloggedon = 1;
 			parent.document.getElementById('logoutlink').innerHTML = "Logout";
 			parent.document.getElementById('logoutlink').onclick = parent.Logoff ;
-			parent.astmanEngine.pollEvents();
 			alert("You are using the default password provided by AsteriskNOW !! \n\n It is strongly recommended that you chnage your default password ");
 			window.location.href="options.html";
 			return;
@@ -72,7 +71,6 @@
 		$('statusbar').innerHTML = "<img src='images/tick.gif'><i>Connected!</i>";
 		parent.document.getElementById('logoutlink').innerHTML = "Logout";
 		parent.document.getElementById('logoutlink').onclick = parent.Logoff ;
-		parent.astmanEngine.pollEvents();
 	}
 	
 	function loggedOff() {
@@ -94,6 +92,7 @@
 		resp = msgs[0].headers['response'];
 		if (resp == "Success" || msgs[0].headers['message'] == "Invalid/unknown command" ){
 			$('statusbar').innerHTML = "<img src='images/tick.gif'><i>Connected!</i>";
+			parent.astmanEngine.pollEvents();
 			loggedOn();
 		}else
 			loggedOff();

Modified: branches/asterisknow/config/homeapp.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/homeapp.html?view=diff&rev=270&r1=269&r2=270
==============================================================================
--- branches/asterisknow/config/homeapp.html (original)
+++ branches/asterisknow/config/homeapp.html Wed Jan 17 17:59:32 2007
@@ -58,7 +58,7 @@
 		$('statusbar').innerHTML = "<img src='images/tick.gif'><i>Connected!</i>";
 		parent.document.getElementById('logoutlink').innerHTML = "Logout";
 		parent.document.getElementById('logoutlink').onclick = parent.Logoff ;
-		parent.astmanEngine.pollEvents();
+		//parent.astmanEngine.pollEvents();
 	}
 	
 	function loggedOff() {
@@ -97,10 +97,12 @@
 	demo.logins = function(msgs) {
 		$('statusbar').innerHTML = msgs[0].headers['message'];
 		resp = msgs[0].headers['response'];
-		if (resp == "Success")
+		if (resp == "Success"){
+			parent.astmanEngine.pollEvents();
 			loggedOn();
-		else
+		}else{
 			loggedOff();
+		}
 	};
 	
 	demo.pongs  = function(msgs) {

Modified: branches/asterisknow/config/localexts.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/localexts.html?view=diff&rev=270&r1=269&r2=270
==============================================================================
--- branches/asterisknow/config/localexts.html (original)
+++ branches/asterisknow/config/localexts.html Wed Jan 17 17:59:32 2007
@@ -26,12 +26,10 @@
 <link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
 <script>
 var usercallbacks = new Object;
-var fieldnames = new Array('status', 'save','userbase','localextenlength');
+var fieldnames = new Array('status', 'save','userbase','localextenlength','allow_aliasextns');
 var widgets = new Array;
 
 function tosetup(){
-	parent.window.onbeforeunload = function(){ }
-	parent.window.onunload = function(){ }
 	parent.window.location.href = "./setup/install.html";
 }
 
@@ -85,8 +83,24 @@
 				widgets[fieldnames[x]] = $(fieldnames[x]);
 				widgets[fieldnames[x]].disabled = true;
 			}
+			$('localextenlength').addEventListener("change", update_spae, false);
 			parent.astmanEngine.config2list("users.conf", $('devices'),widgets, usercallbacks);
 }
+
+
+function update_spae(){
+		if(	$('localextenlength').value == $('userbase').value.length ) return;
+		if(	$('localextenlength').value < $('userbase').value.length ){
+				$('userbase').value = $('userbase').value.substr(0,$('localextenlength').value);
+				return;
+		}
+		if(	$('localextenlength').value > $('userbase').value.length ){
+				while ( $('localextenlength').value != $('userbase').value.length  ){
+					$('userbase').value = $('userbase').value + "0" ; 
+				}
+		}
+}
+
 </script>
 <body id="foo" onload="localajaxinit()" bgcolor="EFEFEF">
 <div class="mainscreenTitleBar"><span style="margin-left: 4px;font-weight:bold">Admin Options - Local Extension Settings</span></div>
@@ -104,6 +118,7 @@
 					<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"> <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>
 							<input type=button id="save" value="Save">

Modified: branches/asterisknow/config/meetme.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/meetme.html?view=diff&rev=270&r1=269&r2=270
==============================================================================
--- branches/asterisknow/config/meetme.html (original)
+++ branches/asterisknow/config/meetme.html Wed Jan 17 17:59:32 2007
@@ -35,6 +35,7 @@
 	var callbacks = new Object;
 	var usercallbacks = new Object;
 	var localextenlength;
+	var temp_selectedexten;
 	var fieldnames = new Array(
 				'name', 'delete', 'status', 'newitem', 
 				'music','menu', 'announce',
@@ -175,6 +176,7 @@
 				alert(" You can not edit the selected entry from here.\n Please click on the \'Users\' panel to edit the selected entry");
 				return true;
 		}
+		temp_selectedexten = $('name').value;
 	}
 	callbacks.newcategory = function() {
 		var tmp = null;
@@ -200,6 +202,17 @@
 		if (!check_patternonfields( ['name', 'pin' , 'pinadmin', 'room'] ) ){
 			return false;
 		}
+
+		if(temp_selectedexten != $('name').value ){
+			for(var k=0; k<$('extensions').length; k++ ){
+				var tmp = $('extensions').options[k].innerHTML.split(' -- '); 
+				if( tmp[0] ==  $('name').value   ){
+					alert("Sorry, an entry named " + $('name').value + " already exists!");
+					return false;
+				}
+			}
+		}
+
 		return true;
 	}
 	callbacks.identifier = "extension";

Modified: branches/asterisknow/config/menus.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/menus.html?view=diff&rev=270&r1=269&r2=270
==============================================================================
--- branches/asterisknow/config/menus.html (original)
+++ branches/asterisknow/config/menus.html Wed Jan 17 17:59:32 2007
@@ -40,6 +40,8 @@
 	var extensions_array = new Array;
 	var answer_call_string = "s,1,Answer";
 	var localextenlength ;
+	var rfilescallbacks = new Object;
+	var custom_voicemenusfile = "gui_custommenus.conf";
 
 function format_step(this_step){
 	var temp = this_step.split(',');
@@ -960,8 +962,21 @@
 	return res;
 }
 
+
+rfilescallbacks.format = function(t) {
+		return t.name;
+}
+
+rfilescallbacks.loaded= function() {
+	for (var i=0; i < $('recorded_files').length; i++){
+		var tmp_fname = $('recorded_files').options[i].value.slice(0, -4);
+		$('combosel_sounds').innerHTML += '<option value="'+ tmp_fname + '">' + tmp_fname + "</option>" ;
+	}
+	parent.astmanEngine.config2list("users.conf", $('users'), new Array(), usercallbacks);
+}
+
 extencallbacks.loaded = function() {
-	parent.astmanEngine.config2list("users.conf", $('users'), new Array(), usercallbacks);
+	parent.astmanEngine.config2list(custom_voicemenusfile, $('recorded_files'), new Array, rfilescallbacks);
 }
 
 extencallbacks.eachline = true;
@@ -1019,7 +1034,7 @@
 			<select size="20" id="vmenus" style="width:180px; height: 415px" class="input10">
 			<option>Loading...</option>
 			</select>
-			<div style='visibility:hidden;overflow:hidden;width:0px;height:0px'><select id='extensions'></select><select id='users'></select></div>
+			<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>
 						<table align="center" width="346">
@@ -1270,6 +1285,7 @@
 																	<option value="vm-unknown-caller">vm-unknown-caller</option>
 																	<option value="vm-whichbox">vm-whichbox</option>
 																	<option value="vm-youhave">vm-youhave</option>
+															<option value="" style="font-weight: bold">Recorded Voicemenus</option>
 													</select>
 											</div>
 											<input type=text id="newstep_var_digit" size=3 style="display:none;" onChange=" $('newstep_var').value = $('newstep_var_digit').value;"  pattern='^\d*$' class="input8">&nbsp;

Modified: branches/asterisknow/config/options.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/options.html?view=diff&rev=270&r1=269&r2=270
==============================================================================
--- branches/asterisknow/config/options.html (original)
+++ branches/asterisknow/config/options.html Wed Jan 17 17:59:32 2007
@@ -210,8 +210,6 @@
 
 
 function tosetup(){
-	parent.window.onbeforeunload = function(){ }
-	parent.window.onunload = function(){ }
 	parent.window.location.href = "./setup/install.html";
 }
 

Modified: branches/asterisknow/config/queues.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/queues.html?view=diff&rev=270&r1=269&r2=270
==============================================================================
--- branches/asterisknow/config/queues.html (original)
+++ branches/asterisknow/config/queues.html Wed Jan 17 17:59:32 2007
@@ -156,8 +156,8 @@
 						return;
 					}
 
-					for(k=0; k<$('queues').length; k++ ){
-						tmp = $('queues').options[k].innerHTML.split(' -- '); 
+					for(var k=0; k<$('queues').length; k++ ){
+						var tmp = $('queues').options[k].innerHTML.split(' -- '); 
 						if( tmp[0] ==  $('name').value   ){
 							alert("Sorry, an entry named " + $('name').value + " already exists!");
 							return;

Modified: branches/asterisknow/config/setup/1.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/setup/1.html?view=diff&rev=270&r1=269&r2=270
==============================================================================
--- branches/asterisknow/config/setup/1.html (original)
+++ branches/asterisknow/config/setup/1.html Wed Jan 17 17:59:32 2007
@@ -37,6 +37,7 @@
 		if ( originalRequest.responseText.match("Error") ) {
 			// User is not logged in , show him the login screen
 			$('loginform').style.display = "block";
+			$('username').focus();
 			return true;
 		}
 		if ( originalRequest.responseText.match("Pong") ) {
@@ -186,6 +187,14 @@
 		};
 		opt.parameters="action=login&reload=yes&username="+ $('username').value + "&secret=" + $('secret').value ;
 		var tmp = new Ajax.Request(rawman_url , opt);
+}
+
+
+function submitOnEnter(e){ 
+		if(e.keyCode == 13){ 
+			login();
+			return false;
+		}
 }
 
 //-->
@@ -215,7 +224,7 @@
 										<div class="heading">Pleae enter your admin Username and Password </div>
 										<table align="center">
 													<tr><td>Username:</td>										<td><input id="username"  size=12></td>							</tr>
-													<tr><td>Secret:</td>												<td><input type="password" id="secret" size=12></td>		</tr>
+													<tr><td>Password:</td>												<td><input type="password" id="secret" size=12 onKeyPress="submitOnEnter(event)"></td>		</tr>
 													<tr><td align='center' colspan='2' height=40 valign=bottom>
 																<input type="button" id="login" value="Login" onClick="login()" >
 															</td>

Modified: branches/asterisknow/config/setup/2.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/setup/2.html?view=diff&rev=270&r1=269&r2=270
==============================================================================
--- branches/asterisknow/config/setup/2.html (original)
+++ branches/asterisknow/config/setup/2.html Wed Jan 17 17:59:32 2007
@@ -219,7 +219,7 @@
 			<!--  this page -->
 				<div id='sysinfo' style="display:none"></div>
 				<div class="heading">Step 2 of <script>document.write(parent.numberofsteps);</script>&nbsp;&nbsp;- Date & Time Settings</div>
-				<div class="subheading">Current System Time </div>
+				<div class="subheading">Please configure the current local system time:</div>
 					 <TABLE cellpadding=6 cellspacing=1 border=0 class="timeinfo">
 					 <TR>
 					 	<TD>Day </TD>

Modified: branches/asterisknow/config/setup/3.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/setup/3.html?view=diff&rev=270&r1=269&r2=270
==============================================================================
--- branches/asterisknow/config/setup/3.html (original)
+++ branches/asterisknow/config/setup/3.html Wed Jan 17 17:59:32 2007
@@ -8,7 +8,7 @@
 <!--
 var rawman_url;
 var usercallbacks = new Object;
-var fieldnames = new Array( 'save','userbase','localextenlength');
+var fieldnames = new Array( 'save','userbase','localextenlength','allow_aliasextns');
 var widgets = new Array;
 var go = "";
 var nextpage = "4.html";
@@ -35,6 +35,7 @@
 	};
 	rawman_url = parent.rawman_url ;
 	parent.astmanEngine.setURL(rawman_url);
+	$('localextenlength').addEventListener("change", update_spae, false);
 	ping();
 }
 
@@ -109,7 +110,18 @@
 	parent.localextenlength = $('localextenlength').value ;
 }
 
-
+function update_spae(){
+		if(	$('localextenlength').value == $('userbase').value.length ) return;
+		if(	$('localextenlength').value < $('userbase').value.length ){
+				$('userbase').value = $('userbase').value.substr(0,$('localextenlength').value);
+				return;
+		}
+		if(	$('localextenlength').value > $('userbase').value.length ){
+				while ( $('localextenlength').value != $('userbase').value.length  ){
+					$('userbase').value = $('userbase').value + "0" ; 
+				}
+		}
+}
 //-->
 </SCRIPT>
 <BODY bgcolor="#FFFFFF" onload="localinit()" topmargin=0 leftmargin=0 onunload="store_extlength()">
@@ -137,7 +149,8 @@
 					<p class="subheading">	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="subheading">	Starting point of Allocation of extensions : <input type=text id="userbase" size=5>	</p>
+					<p class="subheading">Starting point of Allocation of extensions : <input type=text id="userbase" size=5>	</p>
+					<p class="subheading"><input type=checkbox id="allow_aliasextns"> Allow analog phones to be assigned to multiple extensions</p>
 			<!--  this page -->
 			</td>
 		</tr>

Modified: branches/asterisknow/config/setup/4.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/setup/4.html?view=diff&rev=270&r1=269&r2=270
==============================================================================
--- branches/asterisknow/config/setup/4.html (original)
+++ branches/asterisknow/config/setup/4.html Wed Jan 17 17:59:32 2007
@@ -305,10 +305,10 @@
 								$('port').value = provider.fieldbyname['port'];
 							else
 								$('port').value = '';
-							if (provider.fieldbyname['context'])
-								$('context').value = provider.fieldbyname['context'];
-							else
-								$('context').value = 'default';
+							//if (provider.fieldbyname['context'])
+							//	$('context').value = provider.fieldbyname['context'];
+							//else
+							//	$('context').value = 'default';
 							if (provider.fieldbyname['fromuser'])
 								$('fromuser').value = provider.fieldbyname['fromuser'];
 							else
@@ -390,7 +390,7 @@
 						$('callerid').value = '';
 						$('insecure').value = '';
 						$('port').value = '';
-						$('context').value = 'default';
+						//$('context').value = 'default';
 						$('fromuser').value = '';
 						$('fromdomain').value = '';
 						for (var x=0;x<$('zapchan').options.length;x++)
@@ -529,8 +529,11 @@
 		var newRow = $('serviceproviderstable').insertRow(-1);
 		var newCell0 = newRow.insertCell(0);
 		newCell0 .align = "center";
-		newCell0 .innerHTML = "<BR>You donot have any <I>Service Providers</I> defined<BR><BR> Please click on the 'Add Service Provider' button<BR> to add a service provider<BR><BR>" ;
+		$('new').style.display= "none";
+		newCell0 .innerHTML = "<BR>You do not have any <I>Service Providers</I> defined<BR><BR>  <Input type=button onclick=\"$('new').click()\" value=\"Add Service Provider\"><BR><BR>" ;
 		return true;
+	}else{
+		$('new').style.display= "";
 	}
 
 	$('table_one').style.display="";	
@@ -758,6 +761,9 @@
 										<td></td>
 									</tr>
 									<tr>
+										<td colspan=2>Please enter your Service Provider information:</td>
+									</tr>
+									<tr>
 										<td class="field_text">Comment:</td>
 										<td><input type="text" id="customvoip_name" size=14 onkeyup=" $('cancel').disabled= false;$('save').disabled= false;"  class="input8"></td>
 									</tr>

Modified: branches/asterisknow/config/setup/5.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/setup/5.html?view=diff&rev=270&r1=269&r2=270
==============================================================================
--- branches/asterisknow/config/setup/5.html (original)
+++ branches/asterisknow/config/setup/5.html Wed Jan 17 17:59:32 2007
@@ -468,7 +468,7 @@
 			<td valign=top align=center>
 			<!--  this page -->
 					<select id="extensions" style="display:none"></select>
-					<div class="heading">Step 5 of <script>document.write(parent.numberofsteps);</script>&nbsp;&nbsp;-  Calling Rules</div>
+					<div class="heading">Step 5 of <script>document.write(parent.numberofsteps);</script>&nbsp;&nbsp;-  Outbound Calling Rules</div>
 			<table class="table_blacksm" cellpadding=2 cellspacing=2 border=0 align=center width=500 id="table_one">
 				<tr>	<td width=35>S.No</td>
 						<td width=90>RuleName</td>

Modified: branches/asterisknow/config/setup/6.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/setup/6.html?view=diff&rev=270&r1=269&r2=270
==============================================================================
--- branches/asterisknow/config/setup/6.html (original)
+++ branches/asterisknow/config/setup/6.html Wed Jan 17 17:59:32 2007
@@ -26,9 +26,12 @@
 function localinit(){
 		//parent.$('next').disabled = true;
 		parent.$('next').onclick = function(){	 
+					if ( $('name').value.length==0 ){
+						alert("Looks like a default Voicemail Extension is not yet configured \n\n Please set an \'Extension for Checking messages\'");
+						return false;
+					}
 					if( parent.localextenlength != $('name').value.length ){
-						$('name').focus();
-						alert("The Extension must be " + parent.localextenlength + " digits long" );
+						alert("The Voicemail Extension has to be " + parent.localextenlength + " digits long" );
 						return false;
 					}
 					if( !$('save').disabled ){
@@ -176,7 +179,19 @@
 	$('name').onkeydown = newexten;
 	$('name').disabled = false;
 	if (whichexten.length ==0 ){
-		alert("Looks like a default Voicemail Extension is not yet configured \n\n Please set an \'Extension for Checking messages\'  and \n click on 'save' button");
+		alert("Looks like a default Voicemail Extension is not yet configured \n\n Please set an \'Extension for Checking messages\'");
+	}else{
+					if( parent.localextenlength != $('name').value.length ){
+							if(	parent.localextenlength < $('name').value.length ){
+									$('name').value = $('name').value.substr(0,parent.localextenlength);
+									$('save').disabled = false;
+							}else if(	parent.localextenlength > $('name').value.length ){
+									while ( parent.localextenlength != $('name').value.length  ){
+										$('name').value = $('name').value + "0" ; 
+										$('save').disabled = false;
+									}
+							}
+					}
 	}
 }
 
@@ -216,7 +231,7 @@
 					<select id='hiddenvoicemail' style="display:none"></select>
 					<select id="extensions" style="display:none"></select>
 
-					<div class="heading">Step 6 of <script>document.write(parent.numberofsteps);</script>&nbsp;&nbsp;-  Voicemail Settings</div>
+					<div class="heading">Step 6 of <script>document.write(parent.numberofsteps);</script>&nbsp;&nbsp;-  VoiceMail Settings</div>
 		<table cellpadding=2 cellspacing=2 border=0 align=center  class="subheading">
 					<tr><td>Extension for checking messages:</td><td>&nbsp;<input size='5' id='name' pattern='^\d*$' onKeyUp="$('cancel').disabled=false;"  class="input8" ></td></tr>
 					<tr><td>Attach recordings to e-mail:</td><td><input type='checkbox' id='attach'></td></tr>

Modified: branches/asterisknow/config/setup/7.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/setup/7.html?view=diff&rev=270&r1=269&r2=270
==============================================================================
--- branches/asterisknow/config/setup/7.html (original)
+++ branches/asterisknow/config/setup/7.html Wed Jan 17 17:59:32 2007
@@ -16,10 +16,17 @@
 var numcallbacks = new Object;
 var extencallbacks = new Object;
 var fieldnames = new Array( 'delete', 'status', 'new', 'save', 'cancel','name','fullname','secret','email','cid_number','zapchan','context','hasvoicemail','hasdirectory','hassip','hasiax','hasmanager','callwaiting','threewaycalling','mailbox','hasagent','group','host');
+var allow_aliasextns;
 
 callbacks.format = function(t) {
-	if ((t.name == 'general'))
+	if ((t.name == 'general')){
+		if (t.fieldbyname['allow_aliasextns'] && t.fieldbyname['allow_aliasextns'].length){
+			allow_aliasextns =  t.fieldbyname['allow_aliasextns'] ;
+		}else{
+			allow_aliasextns = 'no' ;
+		}
 		return null;
+	}
 	//if (t.name.substring(0,6) == 'trunk_')
 	if ( t.fieldbyname['context'] == asterisk_guiTDPrefix + t.name )
 		return null;
@@ -83,6 +90,27 @@
 			$('fullname').focus();
 			return false;
 	}
+	// check whether the extension entered matches with any of the - voicemail, queue, voicemenu, conference extensions
+	for(var k=0; k< $('extensions').length; k++ ){
+		var tmp = $('extensions').options[k].innerHTML.split(' -- '); 
+		if( tmp[0] ==  $('name').value   ){
+			alert("Sorry, an entry named " + $('name').value + " already exists!");
+			return false;
+		}
+	}
+
+	if(allow_aliasextns == "no"){	// check whether the selected analog line is assigned to another user extension
+			var tmp_usedanaloglines = [] ;
+			for ( var i=1; i < $('devices').stored_config.categories.length ; i++){
+					if ( $('devices').stored_config.categories[i].fieldbyname['zapchan'] && $('devices').stored_config.categories[i].fieldbyname.zapchan.length )
+						tmp_usedanaloglines.push($('devices').stored_config.categories[i].fieldbyname.zapchan);
+			}
+			if ( InArray(tmp_usedanaloglines,$('zapchan').value)){
+				alert("This Analog Phone has already been assigned to another user extension.\n Please select a different Phone");
+				return false;
+			}
+	}
+
 	return true;
 }
 
@@ -102,10 +130,18 @@
 }
 
 phonecallbacks.loaded = function() {
+	
+	if( $('zapchan').options.length == 0) {
+		$('zapchan').style.display="none";
+		$('noanaloglines').style.display="";
+	}
+
 	var noneopt = document.createElement("OPTION");
 	$('zapchan').options.add(noneopt,0);
 	noneopt.value = "";
 	noneopt.innerText = "None";
+
+
 	parent.astmanEngine.config2list("extensions.conf", $('context'), new Array(), numcallbacks);
 }
 
@@ -118,8 +154,20 @@
 }
 
 numcallbacks.loaded = function() {
+	parent.astmanEngine.config2list("extensions.conf", $('extensions'), new Array(), extencallbacks);
+}
+
+extencallbacks.format = function(t, x) {
+	if ((t.name != specialcontext))
+		return null;
+	return format_extension($('extensions'), t, x);
+}
+extencallbacks.loaded = function() {
 	parent.astmanEngine.config2list("users.conf", $('devices'), widgets, callbacks);
 }
+extencallbacks.eachline = true;
+
+
 
 function localinit(){
 	//parent.$('next').disabled = true;
@@ -312,7 +360,9 @@
 							<TD>Caller id:</TD>
 							<TD><input size='12' id='cid_number'  pattern='^[\d\-]*$' class="input8"></TD>
 							<TD>Analog Phone:</TD>
-							<TD><select size="1" id='zapchan' style='width:120px' class="input8"></select></TD>
+							<TD><select size="1" id='zapchan' style='width:120px' class="input8"></select>
+									<span id="noanaloglines" style="display:none"><I>&nbsp;No Analog lines installed.</I></span>
+							</TD>
 						</TR>
 						<TR>
 							<TD>Calling Rule:</TD>

Modified: branches/asterisknow/config/users.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/users.html?view=diff&rev=270&r1=269&r2=270
==============================================================================
--- branches/asterisknow/config/users.html (original)
+++ branches/asterisknow/config/users.html Wed Jan 17 17:59:32 2007
@@ -35,6 +35,7 @@
 	var numcallbacks = new Object;
 	var fieldnames = new Array( 'delete', 'status', 'new', 'save', 'cancel','name','fullname','secret','email','cid_number','zapchan','context', 'hasvoicemail','hasdirectory','hassip','hasiax','hasmanager','callwaiting','threewaycalling','mailbox','hasagent','group','host');
 	var localextenlength;
+	var allow_aliasextns;
 
 	extencallbacks.format = function(t, x) {
 		if ((t.name != specialcontext))
@@ -55,6 +56,11 @@
 							localextenlength =  t.fieldbyname['localextenlength'] ;
 						}else{
 							localextenlength = 4;
+						}
+						if (t.fieldbyname['allow_aliasextns'] && t.fieldbyname['allow_aliasextns'].length){
+							allow_aliasextns =  t.fieldbyname['allow_aliasextns'] ;
+						}else{
+							allow_aliasextns = 'no' ;
 						}
 				return null;
 			}
@@ -119,6 +125,29 @@
 		if (!check_patternonfields( ['name', 'fullname', 'secret','email', 'cid_number'] ) ){
 			return false;
 		}
+
+		if(allow_aliasextns == "no"){	// check whether the selected analog line is assigned to another user extension
+				var tmp_usedanaloglines = [] ;
+				for ( var i=1; i < $('devices').stored_config.categories.length ; i++){
+						if ( $('devices').stored_config.categories[i].fieldbyname['zapchan'] && $('devices').stored_config.categories[i].fieldbyname.zapchan.length )
+							tmp_usedanaloglines.push($('devices').stored_config.categories[i].fieldbyname.zapchan);
+				}
+				if ( InArray(tmp_usedanaloglines,$('zapchan').value)){
+					alert("This Analog Phone has already been assigned to another user extension.\n Please select a different Phone");
+					return false;
+				}
+		}
+
+		if($('devices').value != $('name').value){
+			for(var k=0; k<$('devices').length; k++ ){
+				var tmp = $('devices').options[k].innerHTML.split(' -- '); 
+				if( tmp[0] ==  $('name').value ){
+					alert("Sorry, an entry named " + $('name').value + " already exists!");
+					return false;
+				}
+			}
+		}
+
 		return true;
 	}
 
@@ -192,6 +221,10 @@
 	}
 
 	phonecallbacks.loaded = function() {
+		if( $('zapchan').options.length == 0) {
+			$('zapchan').style.display="none";
+			$('noanaloglines').style.display="";
+		}
 		var noneopt = document.createElement("OPTION");
 		//try {
 		$('zapchan').options.add(noneopt,0);
@@ -278,7 +311,8 @@
 												<tr onmouseover="show_tooltip('en', 'users', 2);"><td class="field_text">Password:</td><td><input size='5' id='secret' pattern='^[a-zA-Z_0-9]*$'  class="input8"></td></tr>
 												<tr onmouseover="show_tooltip('en', 'users', 3);"><td class="field_text">E-mail:</td><td><input size='20' id='email' pattern='^[0-9a-zA-Z\.\-\_\@]*$' class="input8"></td></tr>
 												<tr onmouseover="show_tooltip('en', 'users', 4);"><td class="field_text">Caller ID:</td><td><input size='12' id='cid_number'  pattern='^[\d\-]*$' class="input8"></td></tr>
-												<tr onmouseover="show_tooltip('en', 'users', 5);"><td class="field_text">Analog Phone:</td><td><select size="1" id='zapchan' style='width:120px' class="input8"></select></td></tr>
+												<tr onmouseover="show_tooltip('en', 'users', 5);"><td class="field_text">Analog Phone:</td><td><select size="1" id='zapchan' style='width:120px' class="input8"></select>
+												<span id="noanaloglines" style="display:none"><I>&nbsp;No Analog lines installed.</I></span></td></tr>
 												<tr onmouseover="show_tooltip('en', 'users', 6);"><td class="field_text">Dial Plan:</td><td><select size='1' id='context' style='width:120px' class="input8"></select></td></tr>
 												<tr><td colspan='2' align='center'><div style="height:15px" id='status'></div></td></tr>
 												<tr><td colspan='2' align='center'><input type='hidden' id='mailbox'><input type='hidden' id='group'></td></tr>

Modified: branches/asterisknow/config/voicemail.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/voicemail.html?view=diff&rev=270&r1=269&r2=270
==============================================================================
--- branches/asterisknow/config/voicemail.html (original)
+++ branches/asterisknow/config/voicemail.html Wed Jan 17 17:59:32 2007
@@ -70,6 +70,15 @@
 		if (!check_patternonfields( ['name', 'maxgreet'] ) ){
 			return false;
 		}
+
+		for(var k=0; k<$('extensions').length; k++ ){
+			var tmp = $('extensions').options[k].innerHTML.split(' -- '); 
+			if( tmp[0] ==  $('name').value   ){
+				alert("Sorry, an entry named " + $('name').value + " already exists!");
+				return false;
+			}
+		}
+
 		return true;
 	}
 
@@ -202,6 +211,18 @@
 		$('name').value = vmexten ; 
 	}
 
+	voicemailcallbacks.beforeSaving = function(){
+		// check whether the length of extension is valid
+		if( localextenlength !=  $('name').value.length){
+				alert("Sorry, An Extension must be  "+ localextenlength  + " digits !");
+				$('name').focus();
+				return false;
+		}
+		if (!check_patternonfields( ['name', 'maxgreet'] ) ){
+			return false;
+		}
+		return true;
+	}
 
 	voicemailcallbacks.savechanges = function() {
 		if (vmexten != $('name').value) {



More information about the asterisk-gui-commits mailing list