pari: trunk r356 - in /trunk/config: localexts.html users.html
asterisk-gui-commits at lists.digium.com
asterisk-gui-commits at lists.digium.com
Sat Feb 17 13:03:02 MST 2007
Author: pari
Date: Sat Feb 17 14:03:01 2007
New Revision: 356
URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=356
Log:
Allow Alphanumeric extensions for users who want to create SIP/IAX only extensions
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=356&r1=355&r2=356
==============================================================================
--- trunk/config/localexts.html (original)
+++ trunk/config/localexts.html Sat Feb 17 14:03:01 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','allow_aliasextns','vmsecret','hasvoicemail','hasdirectory','hassip','hasiax','hasmanager','callwaiting','threewaycalling','hasagent','cancel');
+var fieldnames = new Array('status', 'save','userbase','localextenlength','allow_aliasextns','vmsecret','hasvoicemail','hasdirectory','hassip','hasiax','hasmanager','callwaiting','threewaycalling','hasagent','cancel','allow_an_extns');
var widgets = new Array;
var focus_fields = new Array('localextenlength','userbase','vmsecret');
@@ -130,14 +130,15 @@
<fieldset style="width: 400px">
<legend> Local Extension Settings: </legend>
<table align='center' width='390' cellpadding=2 cellspacing=1>
- <tr ><td class="field_text">
+ <tr ><td class="field_text" align=left>
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 </td>
</tr>
- <tr ><td class="field_text">Starting point of Allocation of extensions : <input type=text id="userbase" size=5 class="input9"></td></tr>
- <tr ><td class="field_text" align="center"><input type=checkbox id="allow_aliasextns">Allow analog phones to be assigned to multiple extensions</td></tr>
+ <tr ><td class="field_text" align=left>Starting point of Allocation of extensions : <input type=text id="userbase" size=5 class="input9"></td></tr>
+ <tr ><td class="field_text" align="left"><input type=checkbox id="allow_aliasextns">Allow analog phones to be assigned to multiple extensions</td></tr>
+ <tr ><td class="field_text" align="left"><input type=checkbox id="allow_an_extns">Allow extensions to be AlphaNumeric (SIP/IAX users)</td></tr>
</table>
</fieldset><BR>
<fieldset style="width: 400px">
Modified: trunk/config/users.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/users.html?view=diff&rev=356&r1=355&r2=356
==============================================================================
--- trunk/config/users.html (original)
+++ trunk/config/users.html Sat Feb 17 14:03:01 2007
@@ -35,8 +35,9 @@
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','vmsecret');
var focus_fields = new Array( 'name','fullname','secret','email','cid_number','zapchan','context','vmsecret');
- var localextenlength;
- var allow_aliasextns;
+ var localextenlength = 4;
+ var allow_aliasextns = "no";
+ var allow_an_extns = "no" ;
extencallbacks.format = function(t, x) {
if ((t.name != specialcontext))
@@ -55,13 +56,15 @@
if ((t.name == 'general')){
if (t.fieldbyname['localextenlength'] && t.fieldbyname['localextenlength'].length){
localextenlength = t.fieldbyname['localextenlength'] ;
- }else{
- localextenlength = 4;
+ }
+ if ( t.fieldbyname['allow_an_extns'] && t.fieldbyname['allow_an_extns'].length ){
+ allow_an_extns = t.fieldbyname['allow_an_extns'] ;
+ if(allow_an_extns == "yes"){
+ $('name').setAttribute("pattern", '^[a-zA-Z0-9]*$');
+ }
}
if (t.fieldbyname['allow_aliasextns'] && t.fieldbyname['allow_aliasextns'].length){
allow_aliasextns = t.fieldbyname['allow_aliasextns'] ;
- }else{
- allow_aliasextns = 'no' ;
}
return null;
}
@@ -127,7 +130,7 @@
return false;
}
// check whether the length of extension is valid
- if( localextenlength != $('name').value.length){
+ if( allow_an_extns == "no" && localextenlength != $('name').value.length){
alert("Sorry, User Extension must be "+ localextenlength + " digits !");
$('name').focus();
return false;
More information about the asterisk-gui-commits
mailing list