pari: branch asterisknow r554 - in /branches: aadk/
aadk/config/setup/ asteri...
asterisk-gui-commits at lists.digium.com
asterisk-gui-commits at lists.digium.com
Thu Mar 29 16:03:35 MST 2007
Author: pari
Date: Thu Mar 29 18:03:35 2007
New Revision: 554
URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=554
Log:
Merged revisions 553 via svnmerge from
https://origsvn.digium.com/svn/asterisk-gui/trunk
........
r553 | pari | 2007-03-29 18:00:05 -0500 (Thu, 29 Mar 2007) | 1 line
cleanup setup wizard
........
Modified:
branches/aadk/ (props changed)
branches/aadk/config/setup/7.html
branches/asterisknow/ (props changed)
branches/asterisknow/config/setup/7.html
Propchange: branches/aadk/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Mar 29 18:03:35 2007
@@ -1,1 +1,1 @@
-/trunk:1-430,433-448,501,505,512,519,532,536,538,543,545,547,549,551
+/trunk:1-430,433-448,501,505,512,519,532,536,538,543,545,547,549,551,553
Modified: branches/aadk/config/setup/7.html
URL: http://svn.digium.com/view/asterisk-gui/branches/aadk/config/setup/7.html?view=diff&rev=554&r1=553&r2=554
==============================================================================
--- branches/aadk/config/setup/7.html (original)
+++ branches/aadk/config/setup/7.html Thu Mar 29 18:03:35 2007
@@ -20,17 +20,16 @@
*
-->
<HTML>
-<HEAD>
- <TITLE> Asterisk GUI Setup Wizard</TITLE>
+<HEAD> <TITLE> Asterisk GUI Setup Wizard</TITLE>
<link href="setup.css" media="all" rel="Stylesheet" type="text/css" />
</HEAD>
<script src="../scripts/prototype.js"></script>
<script src="../scripts/astman.js"></script>
-<SCRIPT LANGUAGE="JavaScript">
-<!--
+<SCRIPT>
+
var rawman_url;
var origwidth;
-var widgets = new Array;
+var widgets = {} ;
var adstatus;
var callbacks = new Object;
var phonecallbacks = new Object;
@@ -49,7 +48,6 @@
}
return null;
}
- //if (t.name.substring(0,6) == 'trunk_')
if ( t.fieldbyname['context'] == asterisk_guiTDPrefix + t.name )
return null;
if (t.fieldbyname['fullname'] && t.fieldbyname['fullname'].length) {
@@ -72,12 +70,9 @@
callbacks.loaded = function() {
- $('devices').contentEditable = 'true';
- $('devices').disabled = 0;
- //
- //$('cancel').addEventListener("click", hideuserdetails, false);
- //$('save').addEventListener("click", saveuserdetails, false);
- $('new').addEventListener("click", showuserdetails, false);
+ _$('devices').contentEditable = 'true';
+ _$('devices').disabled = 0;
+ _$('new').addEventListener("click", showuserdetails, false);
parent.astmanEngine.pollEvents();
loadusersintotable();
}
@@ -87,50 +82,50 @@
}
callbacks.checkparams = function(box) {
- $('mailbox').value = $('name').value;
- $('group').value = '';
+ _$('mailbox').value = _$('name').value;
+ _$('group').value = '';
return false;
}
callbacks.newcategory = function() {
var tmp = null;
var x;
- if ($('devices').stored_config.catbyname['general'])
- tmp = objcopy($('devices').stored_config.catbyname['general']);
+ if (_$('devices').stored_config.catbyname['general'])
+ tmp = objcopy(_$('devices').stored_config.catbyname['general']);
if (tmp) {
x = tmp.fieldbyname['userbase'];
if (x) {
- tmp.name = first_free_exten($('devices'), x);
+ tmp.name = first_free_exten(_$('devices'), x);
}
}
return tmp;
}
callbacks.identifier = "extension";
callbacks.beforeSaving = function(){
- if(!$('fullname').value.length){
- alert("Sorry, a User Name must be specified !");
- $('fullname').focus();
+ if(!_$('fullname').value.length){
+ alert("Sorry, a User Name must be specified !");
+ _$('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;
- }
- // 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!");
+ }
+ }
+
+ 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(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;
@@ -153,18 +148,17 @@
phonecallbacks.loaded = function() {
- if( $('zapchan').options.length == 0) {
- $('zapchan').style.display="none";
- $('noanaloglines').style.display="";
+ if( _$('zapchan').options.length == 0) {
+ _$('zapchan').style.display="none";
+ _$('noanaloglines').style.display="";
}
var noneopt = document.createElement("OPTION");
- $('zapchan').options.add(noneopt,0);
+ _$('zapchan').options.add(noneopt,0);
noneopt.value = "";
noneopt.innerText = "None";
-
- parent.astmanEngine.config2list("extensions.conf", $('context'), new Array(), numcallbacks);
+ parent.astmanEngine.config2list("extensions.conf", _$('context'), new Array(), numcallbacks);
}
numcallbacks.format = function(t) {
@@ -176,114 +170,106 @@
}
numcallbacks.loaded = function() {
- parent.astmanEngine.config2list("extensions.conf", $('extensions'), new Array(), extencallbacks);
+ 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);
+ return format_extension(_$('extensions'), t, x);
}
extencallbacks.loaded = function() {
- parent.astmanEngine.config2list("users.conf", $('devices'), widgets, callbacks);
+ parent.astmanEngine.config2list("users.conf", _$('devices'), widgets, callbacks);
}
extencallbacks.eachline = true;
-
-
function localinit(){
//parent.$('next').disabled = true;
- parent.$('next').onclick = function(){ window.location.href="8.html"; };
- parent.$('back').disabled = false;
- parent.$('back').onclick = function(){ window.location.href="6.html"; };
+ parent._$('next').onclick = function(){ window.location.href="8.html"; };
+ parent._$('back').disabled = false;
+ parent._$('back').onclick = function(){ window.location.href="6.html"; };
rawman_url = parent.rawman_url ;
parent.astmanEngine.setURL(rawman_url);
ping();
}
function ping(){
- var opt = {
- method: 'get',
- asynchronous: true,
- onComplete: isloggedin
- };
- opt.parameters="action=ping" ;
- var tmp = new Ajax.Request(rawman_url , opt);
+ var opt = {
+ method: 'get',
+ asynchronous: true,
+ onComplete: isloggedin
+ };
+ opt.parameters="action=ping" ;
+ var tmp = new Ajax.Request(rawman_url , opt);
}
function isloggedin(originalRequest){
- if ( originalRequest.responseText.match("Error") ) {
- // User is not logged in , show him the login screen
- parent.window.location.href = parent.window.location.href ;
- }
-
- if ( originalRequest.responseText.match("Pong") ) {
- // start here
- for (var x in fieldnames) {
- widgets[fieldnames[x]] = $(fieldnames[x]);
- widgets[fieldnames[x]].disabled = true;
- }
- parent.astmanEngine.config2list("zapscan.conf", $('zapchan'), new Array(), phonecallbacks);
- }
-}
-
+ if ( originalRequest.responseText.match("Error") ) {
+ // User is not logged in , show him the login screen
+ parent.window.location.href = parent.window.location.href ;
+ }
+
+ if ( originalRequest.responseText.match("Pong") ) {
+ // start here
+ for (var x in fieldnames) {
+ widgets[fieldnames[x]] = $(fieldnames[x]);
+ widgets[fieldnames[x]].disabled = true;
+ }
+ parent.astmanEngine.config2list("zapscan.conf", _$('zapchan'), new Array(), phonecallbacks);
+ }
+}
function addrow_totable(username, extension){
- var sno = $('userstable').rows.length + 1;
- var newRow = $('userstable').insertRow(-1);
- newRow.id = "row" + extension;
-
- var newCell0 = newRow.insertCell(0);
- newCell0 .innerHTML = sno ;
- newCell0 .style.width = 40;
-
- var newCell1 = newRow.insertCell(1);
- newCell1 .innerHTML = extension ;
- newCell1 .style.width = 80;
- newCell1 .align = "center";
-
- var newCell2 = newRow.insertCell(2);
- newCell2 .innerHTML = username ;
-
- var newCell3 = newRow.insertCell(3);
- newCell3 .innerHTML = " <A href=\"#\" onclick=\"edituser("+ extension +");\">Edit</A> <A href=\"#\" onclick=\"deleteuser("+ extension +");\">Delete</A>" ;
- newCell3 .style.width = 120;
- newCell3 .align = "center";
-
-}
-
-
+ var sno = _$('userstable').rows.length + 1;
+ var newRow = _$('userstable').insertRow(-1);
+ newRow.id = "row" + extension;
+
+ var newCell0 = newRow.insertCell(0);
+ newCell0 .innerHTML = sno ;
+ newCell0 .style.width = 40;
+
+ var newCell1 = newRow.insertCell(1);
+ newCell1 .innerHTML = extension ;
+ newCell1 .style.width = 80;
+ newCell1 .align = "center";
+
+ var newCell2 = newRow.insertCell(2);
+ newCell2 .innerHTML = username ;
+
+ var newCell3 = newRow.insertCell(3);
+ newCell3 .innerHTML = " <A href=\"#\" onclick=\"edituser("+ extension +");\">Edit</A> <A href=\"#\" onclick=\"deleteuser("+ extension +");\">Delete</A>" ;
+ newCell3 .style.width = 120;
+ newCell3 .align = "center";
+
+}
function edituser(extension){
- for(var i=0; i< $('devices').length; i++){
- //get username and get extension
- var tmp = $('devices').options[i].text.split(" -- ");
- if(tmp[0] == extension){
- $('devices').selectitem(i);
- showuserdetails();
- break;
- }
- }
-}
-
+ for(var i=0; i< _$('devices').length; i++){
+ //get username and get extension
+ var tmp = _$('devices').options[i].text.split(" -- ");
+ if(tmp[0] == extension){
+ _$('devices').selectitem(i);
+ showuserdetails();
+ break;
+ }
+ }
+}
function saveuserdetails(){
- hideuserdetails();
- loadusersintotable();
-}
-
+ hideuserdetails();
+ loadusersintotable();
+}
function hideuserdetails(){
- $('usersettings').style.display = "none";
- $('bg_transparent').style.display='none';
+ _$('usersettings').style.display = "none";
+ _$('bg_transparent').style.display='none';
}
function showuserdetails(){
- $('cancel').disabled = false;
- $('usersettings').style.display = "block";
- $('bg_transparent').style.display='';
-}
-
+ _$('cancel').disabled = false;
+ _$('usersettings').style.display = "";
+ _$('bg_transparent').style.display='';
+}
callbacks.delchanges = function(a,b,c){
deleteuser_fromui(b);
@@ -291,160 +277,152 @@
function deleteuser(extension){
// delete from users.conf
- for(var i=0; i< $('devices').length; i++){
- //get username and get extension
- var tmp = $('devices').options[i].text.split(" -- ");
- if(tmp[0] == extension){
- $('devices').selectedIndex = i ;
- $('delete').disabled = 0;
- if( !$('delete').click() ){
- return;
- }
- break;
- }
+ for(var i=0; i< _$('devices').length; i++){
+ //get username and get extension
+ var tmp = _$('devices').options[i].text.split(" -- ");
+ if(tmp[0] == extension){
+ _$('devices').selectedIndex = i ;
+ _$('delete').disabled = 0;
+ if( !_$('delete').click() ){
+ return;
+ }
+ break;
+ }
}
}
function deleteuser_fromui(extension){
- // delete from UI
- var delete_id = "row" + extension;
- for( var i=0; i < $('userstable'). rows.length; i++){
- if ( $('userstable'). rows[i].id == delete_id ){
- $('userstable').deleteRow(i);
- loadusersintotable();
- break;
- }
- }
-}
-
+ // delete from UI
+ var delete_id = "row" + extension;
+ for( var i=0; i < _$('userstable'). rows.length; i++){
+ if ( _$('userstable'). rows[i].id == delete_id ){
+ _$('userstable').deleteRow(i);
+ loadusersintotable();
+ break;
+ }
+ }
+}
function loadusersintotable(){
- for( var i=0; i < $('userstable').rows.length; ){
- $('userstable').deleteRow(i);
- }
-
- for(i=0; i< $('devices').length; i++){
+ for( var i=0; i < _$('userstable').rows.length; ){
+ _$('userstable').deleteRow(i);
+ }
+
+ for(i=0; i< _$('devices').length; i++){
//get username and get extension
- var tmp = $('devices').options[i].text.split(" -- ");
+ var tmp = _$('devices').options[i].text.split(" -- ");
addrow_totable(tmp[1], tmp[0]);
}
}
-//-->
</SCRIPT>
<BODY bgcolor="#FFFFFF" onload="localinit()" topmargin=0 leftmargin=0>
<table width="100%" height="100%" border=0 cellpadding=0 cellspacing=0>
- <tr><td width="170" valign=top align=left>
- <div id="menu">
- <table cellpadding=3 cellspacing=2 border=0 id="sidelist">
- <tr><td width=3></td><td>Start</td></tr>
- <tr><td></td><td>Verify Analog Ports</td></tr>
- <!-- <tr><td></td><td>Date & Time</td></tr> -->
- <tr><td></td><td>Local Extension Settings</td></tr>
- <tr><td></td><td>Service Providers</td></tr>
- <tr><td></td><td>Calling Rules</td></tr>
- <tr><td></td><td>VoiceMail Settings</td></tr>
- <tr><td></td><td class="slselected">User Extensions</td></tr>
- <tr><td></td><td>Incoming Calls</td></tr>
- <!-- <tr><td></td><td>VoiceMenus</td></tr> -->
- <tr><td></td><td>Finish</td></tr>
- </table>
- </div>
- </td>
- <td valign=top align=center>
- <!-- this page -->
- <div style="display:none">
- <select id="devices" ></select>
- <select id='extensions' style="display:none" ></select>
- <input type='button' id='delete' value='Delete'>
- </div>
- <div ID="usersettings" STYLE="display:none; position: absolute; left: 240; top: 40; width:530; height:250; background-color:#F4EFE5; border-width: 1px; border-color: #7E5538; border-style: solid; z-index:5">
- <table width="100%" cellpadding=0 cellspacing=0 onmousedown="startDrag(event , 'usersettings');">
- <TR bgcolor="#7E5538" ><TD Height="20" align="right" style="cursor: move">
- <A href="#" onclick="$('cancel').click();"><font style="color:#FFFFFF; font-size: 12px; font-weight:bold;">X</font></A>
- </TD>
- <TD width=4></TD>
- </TR>
- </table>
- <TABLE cellpadding=0 cellspacing=2 border=0 class="userdetails">
- <TR>
- <TD>User Extension</TD>
- <TD><input size='5' id='name' pattern='^\d*$' class="input8"></TD>
- <TD>Full Name:</TD>
- <TD><input size='20' id='fullname' pattern='^[a-zA-Z_0-9 ]*$' class="input8"></TD>
- </TR>
- <TR>
- <TD>Password:</TD>
- <TD><input size='5' id='secret' pattern='^[a-zA-Z_0-9 ]*$' class="input8"></TD>
- <TD>Email:</TD>
- <TD><input size='20' id='email' pattern='^[0-9a-zA-Z\.\-\_\@]*$' class="input8"></TD>
- </TR>
- <TR>
- <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>
- <span id="noanaloglines" style="display:none"><I> No Analog lines installed.</I></span>
- </TD>
- </TR>
- <TR>
- <TD>Calling Rule:</TD>
- <TD><select size='1' id='context' style='width:120px' class="input8"></select>
- <input type='hidden' id='mailbox'><input type='hidden' id='group'>
- </TD>
- <TD>VoiceMail:</TD>
- <TD><input type='checkbox' id='hasvoicemail'></TD>
- </TR>
- <TR>
- <TD>In Directory:</TD>
- <TD><input type='checkbox' id='hasdirectory'></TD>
- <TD>SIP:</TD>
- <TD><input type='checkbox' id='hassip'></TD>
- </TR>
- <TR>
- <TD>CTI:</TD>
- <TD><input type='checkbox' id='hasmanager'></TD>
- <TD>IAX:</TD>
- <TD><input type='checkbox' id='hasiax'></TD>
- </TR>
- <TR>
- <TD>CallWaiting:</TD>
- <TD><input type='checkbox' id='callwaiting'></TD>
- <TD>3-Way Calling:</TD>
- <TD><input type='checkbox' id='threewaycalling'></TD>
- </TR>
- <TR>
- <TD>Is Agent:</TD>
- <TD><input type='checkbox' id='hasagent'><input type='hidden' dfalt='dynamic' id='host'></TD>
- <TD></TD>
- <TD></TD>
- </TR>
- <TR>
- <TD colspan=4 align=center>
- <input type='button' id='save' value='Save' class="buttonbold">
- <input type='button' id='cancel' value='Cancel' class="buttonbold">
- </TD>
- </TR>
- </TABLE>
- </div>
- <div class="heading">Step 6 of <script>document.write(parent.numberofsteps);</script> - User Extensions </div>
- <div class="subheading">List of User Extensions</div>
- <table class="table_black" cellpadding=2 cellspacing=2 border=0 align=center width=600>
- <tr> <td width=40>S.no</td>
- <td width="80">Extension</td>
- <td>Name</td>
- <td width="120" align=center>Options</td>
- </tr>
- </table>
- <table id="userstable" cellpadding=2 cellspacing=1 border=0 align=center width=600>
- </table>
- <div style="height:25px"></div>
- <input type='button' id='new' value='Add User Extension'>
- <!-- this page -->
- </td>
+<tr>
+<td width="170" valign=top align=left>
+ <div id="menu">
+ <table cellpadding=3 cellspacing=2 border=0 id="sidelist">
+ <tr><td width=3></td><td>Start</td></tr>
+ <tr><td></td><td>Verify Analog Ports</td></tr>
+ <tr><td></td><td>Date & Time</td></tr>
+ <tr><td></td><td>Local Extension Settings</td></tr>
+ <tr><td></td><td>Service Providers</td></tr>
+ <tr><td></td><td>Calling Rules</td></tr>
+ <tr><td></td><td>VoiceMail Settings</td></tr>
+ <tr><td></td><td class="slselected">User Extensions</td></tr>
+ <tr><td></td><td>Incoming Calls</td></tr>
+ <!-- <tr><td></td><td>VoiceMenus</td></tr> -->
+ <tr><td></td><td>Finish</td></tr>
+ </table>
+ </div>
+</td>
+<td valign=top align=center>
+<!-- this page -->
+ <div style="display:none">
+ <select id="devices" ></select>
+ <select id='extensions' style="display:none" ></select>
+ <input type='button' id='delete' value='Delete'>
+ </div>
+ <div ID="usersettings" STYLE="display:none; position: absolute; left: 240; top: 40; width:530; height:250; background-color:#F4EFE5; border-width: 1px; border-color: #7E5538; border-style: solid; z-index:5">
+ <table width="100%" cellpadding=0 cellspacing=0 onmousedown="startDrag(event , 'usersettings');">
+ <TR bgcolor="#7E5538" >
+ <TD Height="20" align="right" style="cursor: move">
+ <A href="#" onclick="$('cancel').click();"><font style="color:#FFFFFF; font-size: 12px; font-weight:bold;">X</font></A>
+ </TD>
+ <TD width=4></TD>
+ </TR>
+ </table>
+
+ <TABLE cellpadding=0 cellspacing=2 border=0 class="userdetails">
+ <TR> <TD>User Extension</TD>
+ <TD><input size='5' id='name' pattern='^\d*$' class="input8"></TD>
+ <TD>Full Name:</TD>
+ <TD><input size='20' id='fullname' pattern='^[a-zA-Z_0-9 ]*$' class="input8"></TD>
+ </TR>
+ <TR> <TD>Password:</TD>
+ <TD><input size='5' id='secret' pattern='^[a-zA-Z_0-9 ]*$' class="input8"></TD>
+ <TD>Email:</TD>
+ <TD><input size='20' id='email' pattern='^[0-9a-zA-Z\.\-\_\@]*$' class="input8"></TD>
+ </TR>
+ <TR> <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>
+ <span id="noanaloglines" style="display:none"><I> No Analog lines installed.</I></span>
+ </TD>
+ </TR>
+ <TR> <TD>Calling Rule:</TD>
+ <TD><select size='1' id='context' style='width:120px' class="input8"></select>
+ <input type='hidden' id='mailbox'><input type='hidden' id='group'>
+ </TD>
+ <TD>VoiceMail:</TD>
+ <TD><input type='checkbox' id='hasvoicemail'></TD>
+ </TR>
+ <TR> <TD>In Directory:</TD>
+ <TD><input type='checkbox' id='hasdirectory'></TD>
+ <TD>SIP:</TD>
+ <TD><input type='checkbox' id='hassip'></TD>
+ </TR>
+ <TR> <TD>CTI:</TD>
+ <TD><input type='checkbox' id='hasmanager'></TD>
+ <TD>IAX:</TD>
+ <TD><input type='checkbox' id='hasiax'></TD>
+ </TR>
+ <TR> <TD>CallWaiting:</TD>
+ <TD><input type='checkbox' id='callwaiting'></TD>
+ <TD>3-Way Calling:</TD>
+ <TD><input type='checkbox' id='threewaycalling'></TD>
+ </TR>
+ <TR> <TD>Is Agent:</TD>
+ <TD><input type='checkbox' id='hasagent'><input type='hidden' dfalt='dynamic' id='host'></TD>
+ <TD></TD>
+ <TD></TD>
+ </TR>
+ <TR> <TD colspan=4 align=center>
+ <input type='button' id='save' value='Save' class="buttonbold">
+ <input type='button' id='cancel' value='Cancel' class="buttonbold">
+ </TD>
+ </TR>
+ </TABLE>
+ </div>
+ <div class="heading">Step 6 of <script>document.write(parent.numberofsteps);</script> - User Extensions </div>
+ <div class="subheading">List of User Extensions</div>
+ <table class="table_black" cellpadding=2 cellspacing=2 border=0 align=center width=600>
+ <tr> <td width=40>S.no</td>
+ <td width="80">Extension</td>
+ <td>Name</td>
+ <td width="120" align=center>Options</td>
</tr>
+ </table>
+ <table id="userstable" cellpadding=2 cellspacing=1 border=0 align=center width=600>
+ </table>
+ <div style="height:25px"></div>
+ <input type='button' id='new' value='Add User Extension'>
+<!-- this page -->
+</td>
+</tr>
</table>
<div id="bg_transparent" STYLE="display:none; position: absolute; left: 0; top: 0; width:100%; height:100%; background-color:#FFFFFF; filter:alpha(opacity=50); -moz-opacity:.50;opacity:.50; border-width: 0px; z-index:4">
</div>
</BODY>
-</HTML>
+</HTML>
Propchange: branches/asterisknow/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Mar 29 18:03:35 2007
@@ -1,1 +1,1 @@
-/trunk:1-448,501-505,507,511-512,519,532,536,538,543,545,547,549,551
+/trunk:1-448,501-505,507,511-512,519,532,536,538,543,545,547,549,551,553
Modified: branches/asterisknow/config/setup/7.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/setup/7.html?view=diff&rev=554&r1=553&r2=554
==============================================================================
--- branches/asterisknow/config/setup/7.html (original)
+++ branches/asterisknow/config/setup/7.html Thu Mar 29 18:03:35 2007
@@ -20,17 +20,16 @@
*
-->
<HTML>
-<HEAD>
- <TITLE> Asterisk GUI Setup Wizard</TITLE>
+<HEAD> <TITLE> Asterisk GUI Setup Wizard</TITLE>
<link href="setup.css" media="all" rel="Stylesheet" type="text/css" />
</HEAD>
<script src="../scripts/prototype.js"></script>
<script src="../scripts/astman.js"></script>
-<SCRIPT LANGUAGE="JavaScript">
-<!--
+<SCRIPT>
+
var rawman_url;
var origwidth;
-var widgets = new Array;
+var widgets = {} ;
var adstatus;
var callbacks = new Object;
var phonecallbacks = new Object;
@@ -49,7 +48,6 @@
}
return null;
}
- //if (t.name.substring(0,6) == 'trunk_')
if ( t.fieldbyname['context'] == asterisk_guiTDPrefix + t.name )
return null;
if (t.fieldbyname['fullname'] && t.fieldbyname['fullname'].length) {
@@ -72,12 +70,9 @@
callbacks.loaded = function() {
- $('devices').contentEditable = 'true';
- $('devices').disabled = 0;
- //
- //$('cancel').addEventListener("click", hideuserdetails, false);
- //$('save').addEventListener("click", saveuserdetails, false);
- $('new').addEventListener("click", showuserdetails, false);
+ _$('devices').contentEditable = 'true';
+ _$('devices').disabled = 0;
+ _$('new').addEventListener("click", showuserdetails, false);
parent.astmanEngine.pollEvents();
loadusersintotable();
}
@@ -87,50 +82,50 @@
}
callbacks.checkparams = function(box) {
- $('mailbox').value = $('name').value;
- $('group').value = '';
+ _$('mailbox').value = _$('name').value;
+ _$('group').value = '';
return false;
}
callbacks.newcategory = function() {
var tmp = null;
var x;
- if ($('devices').stored_config.catbyname['general'])
- tmp = objcopy($('devices').stored_config.catbyname['general']);
+ if (_$('devices').stored_config.catbyname['general'])
+ tmp = objcopy(_$('devices').stored_config.catbyname['general']);
if (tmp) {
x = tmp.fieldbyname['userbase'];
if (x) {
- tmp.name = first_free_exten($('devices'), x);
+ tmp.name = first_free_exten(_$('devices'), x);
}
}
return tmp;
}
callbacks.identifier = "extension";
callbacks.beforeSaving = function(){
- if(!$('fullname').value.length){
- alert("Sorry, a User Name must be specified !");
- $('fullname').focus();
+ if(!_$('fullname').value.length){
+ alert("Sorry, a User Name must be specified !");
+ _$('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;
- }
- // 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!");
+ }
+ }
+
+ 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(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;
@@ -153,18 +148,17 @@
phonecallbacks.loaded = function() {
- if( $('zapchan').options.length == 0) {
- $('zapchan').style.display="none";
- $('noanaloglines').style.display="";
+ if( _$('zapchan').options.length == 0) {
+ _$('zapchan').style.display="none";
+ _$('noanaloglines').style.display="";
}
var noneopt = document.createElement("OPTION");
- $('zapchan').options.add(noneopt,0);
+ _$('zapchan').options.add(noneopt,0);
noneopt.value = "";
noneopt.innerText = "None";
-
- parent.astmanEngine.config2list("extensions.conf", $('context'), new Array(), numcallbacks);
+ parent.astmanEngine.config2list("extensions.conf", _$('context'), new Array(), numcallbacks);
}
numcallbacks.format = function(t) {
@@ -176,114 +170,106 @@
}
numcallbacks.loaded = function() {
- parent.astmanEngine.config2list("extensions.conf", $('extensions'), new Array(), extencallbacks);
+ 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);
+ return format_extension(_$('extensions'), t, x);
}
extencallbacks.loaded = function() {
- parent.astmanEngine.config2list("users.conf", $('devices'), widgets, callbacks);
+ parent.astmanEngine.config2list("users.conf", _$('devices'), widgets, callbacks);
}
extencallbacks.eachline = true;
-
-
function localinit(){
//parent.$('next').disabled = true;
- parent.$('next').onclick = function(){ window.location.href="8.html"; };
- parent.$('back').disabled = false;
- parent.$('back').onclick = function(){ window.location.href="6.html"; };
+ parent._$('next').onclick = function(){ window.location.href="8.html"; };
+ parent._$('back').disabled = false;
+ parent._$('back').onclick = function(){ window.location.href="6.html"; };
rawman_url = parent.rawman_url ;
parent.astmanEngine.setURL(rawman_url);
ping();
}
function ping(){
- var opt = {
- method: 'get',
- asynchronous: true,
- onComplete: isloggedin
- };
- opt.parameters="action=ping" ;
- var tmp = new Ajax.Request(rawman_url , opt);
+ var opt = {
+ method: 'get',
+ asynchronous: true,
+ onComplete: isloggedin
+ };
+ opt.parameters="action=ping" ;
+ var tmp = new Ajax.Request(rawman_url , opt);
}
function isloggedin(originalRequest){
- if ( originalRequest.responseText.match("Error") ) {
- // User is not logged in , show him the login screen
- parent.window.location.href = parent.window.location.href ;
- }
-
- if ( originalRequest.responseText.match("Pong") ) {
- // start here
- for (var x in fieldnames) {
- widgets[fieldnames[x]] = $(fieldnames[x]);
- widgets[fieldnames[x]].disabled = true;
- }
- parent.astmanEngine.config2list("zapscan.conf", $('zapchan'), new Array(), phonecallbacks);
- }
-}
-
+ if ( originalRequest.responseText.match("Error") ) {
+ // User is not logged in , show him the login screen
+ parent.window.location.href = parent.window.location.href ;
+ }
+
+ if ( originalRequest.responseText.match("Pong") ) {
+ // start here
+ for (var x in fieldnames) {
+ widgets[fieldnames[x]] = $(fieldnames[x]);
+ widgets[fieldnames[x]].disabled = true;
+ }
+ parent.astmanEngine.config2list("zapscan.conf", _$('zapchan'), new Array(), phonecallbacks);
+ }
+}
function addrow_totable(username, extension){
- var sno = $('userstable').rows.length + 1;
- var newRow = $('userstable').insertRow(-1);
- newRow.id = "row" + extension;
-
- var newCell0 = newRow.insertCell(0);
- newCell0 .innerHTML = sno ;
- newCell0 .style.width = 40;
-
- var newCell1 = newRow.insertCell(1);
- newCell1 .innerHTML = extension ;
- newCell1 .style.width = 80;
- newCell1 .align = "center";
-
- var newCell2 = newRow.insertCell(2);
- newCell2 .innerHTML = username ;
-
- var newCell3 = newRow.insertCell(3);
- newCell3 .innerHTML = " <A href=\"#\" onclick=\"edituser("+ extension +");\">Edit</A> <A href=\"#\" onclick=\"deleteuser("+ extension +");\">Delete</A>" ;
- newCell3 .style.width = 120;
- newCell3 .align = "center";
-
-}
-
-
+ var sno = _$('userstable').rows.length + 1;
+ var newRow = _$('userstable').insertRow(-1);
+ newRow.id = "row" + extension;
+
+ var newCell0 = newRow.insertCell(0);
+ newCell0 .innerHTML = sno ;
+ newCell0 .style.width = 40;
+
+ var newCell1 = newRow.insertCell(1);
+ newCell1 .innerHTML = extension ;
+ newCell1 .style.width = 80;
+ newCell1 .align = "center";
+
+ var newCell2 = newRow.insertCell(2);
+ newCell2 .innerHTML = username ;
+
+ var newCell3 = newRow.insertCell(3);
+ newCell3 .innerHTML = " <A href=\"#\" onclick=\"edituser("+ extension +");\">Edit</A> <A href=\"#\" onclick=\"deleteuser("+ extension +");\">Delete</A>" ;
+ newCell3 .style.width = 120;
+ newCell3 .align = "center";
+
+}
function edituser(extension){
- for(var i=0; i< $('devices').length; i++){
- //get username and get extension
- var tmp = $('devices').options[i].text.split(" -- ");
- if(tmp[0] == extension){
- $('devices').selectitem(i);
- showuserdetails();
- break;
- }
- }
-}
-
+ for(var i=0; i< _$('devices').length; i++){
+ //get username and get extension
+ var tmp = _$('devices').options[i].text.split(" -- ");
+ if(tmp[0] == extension){
+ _$('devices').selectitem(i);
+ showuserdetails();
+ break;
+ }
+ }
+}
function saveuserdetails(){
- hideuserdetails();
- loadusersintotable();
-}
-
+ hideuserdetails();
+ loadusersintotable();
+}
function hideuserdetails(){
- $('usersettings').style.display = "none";
- $('bg_transparent').style.display='none';
+ _$('usersettings').style.display = "none";
+ _$('bg_transparent').style.display='none';
}
function showuserdetails(){
- $('cancel').disabled = false;
- $('usersettings').style.display = "block";
- $('bg_transparent').style.display='';
-}
-
+ _$('cancel').disabled = false;
+ _$('usersettings').style.display = "";
+ _$('bg_transparent').style.display='';
+}
callbacks.delchanges = function(a,b,c){
deleteuser_fromui(b);
@@ -291,158 +277,150 @@
function deleteuser(extension){
// delete from users.conf
- for(var i=0; i< $('devices').length; i++){
- //get username and get extension
- var tmp = $('devices').options[i].text.split(" -- ");
- if(tmp[0] == extension){
- $('devices').selectedIndex = i ;
- $('delete').disabled = 0;
- if( !$('delete').click() ){
- return;
- }
- break;
- }
+ for(var i=0; i< _$('devices').length; i++){
+ //get username and get extension
+ var tmp = _$('devices').options[i].text.split(" -- ");
+ if(tmp[0] == extension){
+ _$('devices').selectedIndex = i ;
+ _$('delete').disabled = 0;
+ if( !_$('delete').click() ){
+ return;
+ }
+ break;
+ }
}
}
function deleteuser_fromui(extension){
- // delete from UI
- var delete_id = "row" + extension;
- for( var i=0; i < $('userstable'). rows.length; i++){
- if ( $('userstable'). rows[i].id == delete_id ){
- $('userstable').deleteRow(i);
- loadusersintotable();
- break;
- }
- }
-}
-
+ // delete from UI
+ var delete_id = "row" + extension;
+ for( var i=0; i < _$('userstable'). rows.length; i++){
+ if ( _$('userstable'). rows[i].id == delete_id ){
+ _$('userstable').deleteRow(i);
+ loadusersintotable();
+ break;
+ }
+ }
+}
function loadusersintotable(){
- for( var i=0; i < $('userstable').rows.length; ){
- $('userstable').deleteRow(i);
- }
-
- for(i=0; i< $('devices').length; i++){
+ for( var i=0; i < _$('userstable').rows.length; ){
+ _$('userstable').deleteRow(i);
+ }
+
+ for(i=0; i< _$('devices').length; i++){
//get username and get extension
- var tmp = $('devices').options[i].text.split(" -- ");
+ var tmp = _$('devices').options[i].text.split(" -- ");
addrow_totable(tmp[1], tmp[0]);
}
}
-//-->
</SCRIPT>
<BODY bgcolor="#FFFFFF" onload="localinit()" topmargin=0 leftmargin=0>
<table width="100%" height="100%" border=0 cellpadding=0 cellspacing=0>
- <tr><td width="170" valign=top align=left>
- <div id="menu">
- <table cellpadding=3 cellspacing=2 border=0 id="sidelist">
- <tr><td width=3></td><td>Start</td></tr>
- <tr><td></td><td>Verify Analog Ports</td></tr>
- <!-- <tr><td></td><td>Date & Time</td></tr> -->
- <tr><td></td><td>Local Extension Settings</td></tr>
- <tr><td></td><td>Service Providers</td></tr>
- <tr><td></td><td>Calling Rules</td></tr>
- <tr><td></td><td>VoiceMail Settings</td></tr>
- <tr><td></td><td class="slselected">User Extensions</td></tr>
- <tr><td></td><td>Incoming Calls</td></tr>
- <!-- <tr><td></td><td>VoiceMenus</td></tr> -->
- <tr><td></td><td>Finish</td></tr>
- </table>
- </div>
- </td>
- <td valign=top align=center>
- <!-- this page -->
- <div style="display:none">
- <select id="devices" ></select>
- <select id='extensions' style="display:none" ></select>
- <input type='button' id='delete' value='Delete'>
- </div>
- <div ID="usersettings" STYLE="display:none; position: absolute; left: 240; top: 40; width:530; height:250; background-color:#F4EFE5; border-width: 1px; border-color: #7E5538; border-style: solid; z-index:5">
- <table width="100%" cellpadding=0 cellspacing=0 onmousedown="startDrag(event , 'usersettings');">
- <TR bgcolor="#7E5538" ><TD Height="20" align="right" style="cursor: move">
- <A href="#" onclick="$('cancel').click();"><font style="color:#FFFFFF; font-size: 12px; font-weight:bold;">X</font></A>
- </TD>
- <TD width=4></TD>
- </TR>
- </table>
- <TABLE cellpadding=0 cellspacing=2 border=0 class="userdetails">
- <TR>
- <TD>User Extension</TD>
- <TD><input size='5' id='name' pattern='^\d*$' class="input8"></TD>
- <TD>Full Name:</TD>
- <TD><input size='20' id='fullname' pattern='^[a-zA-Z_0-9 ]*$' class="input8"></TD>
- </TR>
- <TR>
- <TD>Password:</TD>
- <TD><input size='5' id='secret' pattern='^[a-zA-Z_0-9 ]*$' class="input8"></TD>
- <TD>Email:</TD>
- <TD><input size='20' id='email' pattern='^[0-9a-zA-Z\.\-\_\@]*$' class="input8"></TD>
- </TR>
- <TR>
- <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>
- <span id="noanaloglines" style="display:none"><I> No Analog lines installed.</I></span>
- </TD>
- </TR>
- <TR>
- <TD>Calling Rule:</TD>
- <TD><select size='1' id='context' style='width:120px' class="input8"></select>
- <input type='hidden' id='mailbox'><input type='hidden' id='group'>
- </TD>
- <TD>VoiceMail:</TD>
- <TD><input type='checkbox' id='hasvoicemail'></TD>
- </TR>
- <TR>
- <TD>In Directory:</TD>
- <TD><input type='checkbox' id='hasdirectory'></TD>
- <TD>SIP:</TD>
- <TD><input type='checkbox' id='hassip'></TD>
- </TR>
- <TR>
- <TD>CTI:</TD>
- <TD><input type='checkbox' id='hasmanager'></TD>
- <TD>IAX:</TD>
- <TD><input type='checkbox' id='hasiax'></TD>
- </TR>
- <TR>
- <TD>CallWaiting:</TD>
- <TD><input type='checkbox' id='callwaiting'></TD>
- <TD>3-Way Calling:</TD>
- <TD><input type='checkbox' id='threewaycalling'></TD>
- </TR>
- <TR>
- <TD>Is Agent:</TD>
- <TD><input type='checkbox' id='hasagent'><input type='hidden' dfalt='dynamic' id='host'></TD>
- <TD></TD>
- <TD></TD>
- </TR>
- <TR>
- <TD colspan=4 align=center>
- <input type='button' id='save' value='Save' class="buttonbold">
[... 127 lines stripped ...]
More information about the asterisk-gui-commits
mailing list