pari: trunk r262 - in /trunk/config: localexts.html users.html

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Tue Jan 16 20:16:37 MST 2007


Author: pari
Date: Tue Jan 16 21:16:36 2007
New Revision: 262

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=262
Log:
Fix for -- 0008771: System happy to assign multiple extensions to the same analog line

Modified:
    trunk/config/localexts.html
    trunk/config/users.html

Modified: trunk/config/localexts.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/localexts.html?view=diff&rev=262&r1=261&r2=262
==============================================================================
--- trunk/config/localexts.html (original)
+++ trunk/config/localexts.html Tue Jan 16 21:16:36 2007
@@ -26,7 +26,7 @@
 <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','disallow_aliasextns');
 var widgets = new Array;
 
 function tosetup(){
@@ -104,6 +104,8 @@
 					<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="disallow_aliasextns"> Donot Allow analog phones assigned to multiple extensions</p>
+
 					<center>
 							<div style="height:15px" id='status'></div><BR>
 							<input type=button id="save" value="Save">

Modified: trunk/config/users.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/users.html?view=diff&rev=262&r1=261&r2=262
==============================================================================
--- trunk/config/users.html (original)
+++ trunk/config/users.html Tue Jan 16 21:16:36 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 disallow_aliasextns;
 
 	extencallbacks.format = function(t, x) {
 		if ((t.name != specialcontext))
@@ -55,6 +56,11 @@
 							localextenlength =  t.fieldbyname['localextenlength'] ;
 						}else{
 							localextenlength = 4;
+						}
+						if (t.fieldbyname['disallow_aliasextns'] && t.fieldbyname['disallow_aliasextns'].length){
+							disallow_aliasextns =  t.fieldbyname['disallow_aliasextns'] ;
+						}else{
+							disallow_aliasextns = 'no' ;
 						}
 				return null;
 			}
@@ -119,6 +125,19 @@
 		if (!check_patternonfields( ['name', 'fullname', 'secret','email', 'cid_number'] ) ){
 			return false;
 		}
+
+		if(disallow_aliasextns == "yes"){	// 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;
 	}
 



More information about the asterisk-gui-commits mailing list