bkruse: branch asterisknow r1268 - in /branches/asterisknow: ./ config/ confi...
SVN commits to the Asterisk-GUI project
asterisk-gui-commits at lists.digium.com
Sat Jul 28 22:22:19 CDT 2007
Author: bkruse
Date: Sat Jul 28 22:22:18 2007
New Revision: 1268
URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=1268
Log:
Merged revisions 1090,1119,1136,1144,1201-1208,1210-1211,1264,1266-1267 via svnmerge from
https://origsvn.digium.com/svn/asterisk-gui/trunk
........
r1090 | pari | 2007-06-18 15:35:32 -0500 (Mon, 18 Jun 2007) | 1 line
Bug introduced in 'makerequest'
........
r1119 | bkruse | 2007-06-19 15:39:55 -0500 (Tue, 19 Jun 2007) | 1 line
Updated to include a 1 second wait on each system call, then exist cleanly.
........
r1136 | bkruse | 2007-06-20 14:18:55 -0500 (Wed, 20 Jun 2007) | 1 line
updated todo.txt: To fix call parking, give it an option to allow if the user wants people to be able to access the parking lot per numberplan
........
r1144 | pari | 2007-06-21 17:01:34 -0500 (Thu, 21 Jun 2007) | 1 line
updating todo
........
r1201 | pari | 2007-07-03 14:05:14 -0500 (Tue, 03 Jul 2007) | 1 line
reverting changes done by bkruse in the last few commits for supporting bandwidth.com
........
r1202 | pari | 2007-07-03 14:40:14 -0500 (Tue, 03 Jul 2007) | 5 lines
[*] cleanup to CPU graphs
[*] SIP & IAX pages - autoadjust to available screen size
[*] Display FullNames along with technologies in RingGroups
........
r1203 | pari | 2007-07-03 14:48:55 -0500 (Tue, 03 Jul 2007) | 8 lines
[*] 'allowblank' attribute to allow blank values in the config files for some fields
[*] Fix for - RIngGroup Extensions being listed as Custom
[*] Fixed the Active Channels Page. Problems: [1] We were calling astmanEngine instead of parent.astmanEngine. [2] We were calling an invalid callback. [3] We were trying to reference channelsCallback in the if statement, which does not exist. Its all fixed now :] - by bkruse
........
r1204 | pari | 2007-07-03 15:27:25 -0500 (Tue, 03 Jul 2007) | 6 lines
[*] detailed alert messages for invalid RingGroup options in menus.html
[*] Now parked calls will work correctly. All number numberplans include the parkedcalls context.
In the future, we should make this an option to include it.
........
r1205 | pari | 2007-07-03 15:33:27 -0500 (Tue, 03 Jul 2007) | 4 lines
[*] Fix: Not able to drag dialog boxes around in the setup wizard
........
r1206 | pari | 2007-07-03 15:39:54 -0500 (Tue, 03 Jul 2007) | 7 lines
[*] Fix for GUI allowing multiple ring groups with the same name
[*] Fix for Ring Groups- Gui populates all new ring groups with old ring groups information
........
r1207 | pari | 2007-07-03 15:56:43 -0500 (Tue, 03 Jul 2007) | 9 lines
[*] Bug Fix: Unable Edit RingGroups , if one of the ringgroup users has been deleted from the users panel
[*] Bug Fix: when editing trunk details, context was being set to DID_ instead of DID_trunk_x
[*] FIX - Force user to specify number of seconds
[*] FIX - RingGroup not being completely deleted
........
r1208 | pari | 2007-07-03 16:47:48 -0500 (Tue, 03 Jul 2007) | 11 lines
[*] Apply Changes at the End of the setup wizard
[*] Check whether AgentLogin and AgentCallBackLogin extensions are same
[*] Added tooltip saying that the operator extension has to be configured first from the options panel
[*] Fix: Unable to edit service providers
........
r1210 | pari | 2007-07-03 17:24:10 -0500 (Tue, 03 Jul 2007) | 10 lines
[*] Added options to change httpport and httpbindaddr
[*] Removing unnecessary option - Room Override
[*] Zap Channels are now shown along with their user names
[*] the provided field is for 'Attach format(attachfmt)' and not for 'Message Format(format)'
........
r1211 | pari | 2007-07-04 05:46:25 -0500 (Wed, 04 Jul 2007) | 1 line
Forgot to add http_options.html in previous commit
........
r1264 | pari | 2007-07-27 09:54:09 -0500 (Fri, 27 Jul 2007) | 10 lines
Merging some changes from sx00i/aadk branches
** IE will now chop long GET requests into two or more smaller requests
* Hide record option in Conference Panel
* Voicemenus will show only file name only once - even is there are more than
one file with the same extension
........
r1266 | pari | 2007-07-27 11:04:05 -0500 (Fri, 27 Jul 2007) | 1 line
Fix: some tool tips in the users tab are not present.
........
r1267 | bkruse | 2007-07-28 21:32:56 -0500 (Sat, 28 Jul 2007) | 1 line
Fixing 2.html, since it should be left blank, and updating for trunk specific settings instead of the aadk. [1] Now the next button not being set will not kill the gui in direct access, (eg referencing 1.html instead of install.html) [2] Making them go to 3.html instead of 2.html, as 2 is ONLY used for the GUI
........
Added:
branches/asterisknow/config/http_options.html
- copied unchanged from r1267, trunk/config/http_options.html
Removed:
branches/asterisknow/config/images/bandwidth.gif
Modified:
branches/asterisknow/ (props changed)
branches/asterisknow/config/callparking.html
branches/asterisknow/config/cfgbasic.html
branches/asterisknow/config/graphs.html
branches/asterisknow/config/graphs/graph_cpu.svgz
branches/asterisknow/config/iax.html
branches/asterisknow/config/localexts.html
branches/asterisknow/config/meetme.html
branches/asterisknow/config/menus.html
branches/asterisknow/config/numberplan.html
branches/asterisknow/config/ringgroups.html
branches/asterisknow/config/scripts/astman.js
branches/asterisknow/config/scripts/tooltip.js
branches/asterisknow/config/setup/1.html
branches/asterisknow/config/setup/10.html
branches/asterisknow/config/setup/2.html
branches/asterisknow/config/setup/4.html
branches/asterisknow/config/setup/5.html
branches/asterisknow/config/setup/7.html
branches/asterisknow/config/setup/8.html
branches/asterisknow/config/sip.html
branches/asterisknow/config/trunks.html
branches/asterisknow/config/users.html
branches/asterisknow/config/voicemail.html
branches/asterisknow/todo.txt
Propchange: branches/asterisknow/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sat Jul 28 22:22:18 2007
@@ -1,1 +1,1 @@
-/trunk:1-449,489-540,542-557,559,561-577,580-586,588-1080,1085,1094,1097,1100,1103,1116,1120,1124,1141
+/trunk:1-449,489-540,542-557,559,561-577,580-586,588-1267
Modified: branches/asterisknow/config/callparking.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/callparking.html?view=diff&rev=1268&r1=1267&r2=1268
==============================================================================
--- branches/asterisknow/config/callparking.html (original)
+++ branches/asterisknow/config/callparking.html Sat Jul 28 22:22:18 2007
@@ -25,7 +25,7 @@
<script>
var phonecallbacks = new Object;
var widgets = {};
-var fieldnames = ['save','cancel','parkext','parkpos','parkingtime','pickupexten','atxfernoanswertimeout'];
+var fieldnames = ['save','cancel','parkext','parkpos','parkingtime'];
phonecallbacks.format = function(t) {
if(t.name.match('general'))
@@ -73,12 +73,6 @@
<tr> <td align=right>Number of seconds a call can be parked for:</td>
<td> <input size=2 type='text' id='parkingtime' class="input8" dfalt="45"></td>
</tr>
- <tr> <td align=right>Pickup Extension:</td>
- <td> <input size=2 type='text' id='pickupexten' class="input8" dfalt="*8"></td>
- </tr>
- <tr> <td align=right>Timeout for answer on attended transfer:</td>
- <td> <input size=2 type='text' id='atxfernoanswertimeout' class="input8" dfalt="15"></td>
- </tr>
<tr><td colspan=2 align=center height=40 valign=bottom>
<input type='button' id='save' value='Save' class="buttonbold">
<input type='button' id='cancel' value='Cancel' class="buttonbold">
Modified: branches/asterisknow/config/cfgbasic.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/cfgbasic.html?view=diff&rev=1268&r1=1267&r2=1268
==============================================================================
--- branches/asterisknow/config/cfgbasic.html (original)
+++ branches/asterisknow/config/cfgbasic.html Sat Jul 28 22:22:18 2007
@@ -37,7 +37,7 @@
function fit_toScreen(){
var t = ASTGUI.displayHeight();
- var minimumheight = 60;
+ var minimumheight = 150;
var c =_$('configpanel');
c.WIH = t;
_$('TOP_MAINTABLE').rows[1].cells[0].height = (t - 70) ;
@@ -178,6 +178,7 @@
newpanel( ["Asterisk Logs", "syslog.html", "Asterisk Log messages."]);
newpanel( ["File Editor", "feditor.html", "Edit Asterisk Config Files"]);
newpanel( ["Asterisk CLI", "cli.html", "Asterisk Command Line Interface"]);
+ newpanel( ["GUI Access", "http_options.html", "GUI Access settings."]);
newpanel( ["Backup", "backup.html", "Backup Management."]);
newpanel( ["Options", "localexts.html", "Admin Settings"]);
return panels;
Modified: branches/asterisknow/config/graphs.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/graphs.html?view=diff&rev=1268&r1=1267&r2=1268
==============================================================================
--- branches/asterisknow/config/graphs.html (original)
+++ branches/asterisknow/config/graphs.html Sat Jul 28 22:22:18 2007
@@ -29,33 +29,6 @@
var tabs = new Array('tab1');
var divs_tohide = new Array('cpu_div');
-function update_graph(graph) {
- var tmp_command = "sh " + asterisk_scriptsFolder + "graphs.sh cpu > /var/lib/asterisk/static-http/config/graphs/data_cpu.html";
- parent.astmanEngine.run_tool(tmp_command);
- return true;
- }
-
-function load_graphs() {
- var _sm = _$('status_message').style ;
- _sm.display = "" ;
-
- var opt = {
- method: 'get',
- asynchronous: true,
- onComplete: function(originalRequest){
- _sm.display = 'none' ;
- _$('todaylog').innerHTML = (originalRequest.responseText) ? "<PRE>"+originalRequest.responseText.escapeHTML() +"</PRE>" : "No log messages found on this Day" ;
-
- },
- onFailure: function(t) {
- _sm.display = 'none' ;
- gui_alert("Config Error: " + t.status + ": " + t.statusText);
- }
- };
- opt.parameters="";
- var tmp = new Ajax.Request("graphs/cpu_data", opt);
- return true;
-}
function show_window(x){
for(i=0; i < tabs.length ; i++){
@@ -65,14 +38,15 @@
document.getElementById(tabs[x-1]).className = "tabselected";
document.getElementById(tabs[x-1]).blur();
- clearInterval(interval_handler); /*stop our other real-time refreshers... */
+ //clearInterval(interval_handler); /*stop our other real-time refreshers... */
switch(x){
case 1:
var divs_toshow = new Array('cpu_div');
- var interval_handler = setInterval("update_graph()",5000);
+ //var interval_handler = setInterval(update_graph,5000);
break;
}
+
for(var i=0; i < divs_tohide.length; i++ )
_$(divs_tohide[i]).style.display = "none";
for(var i=0; i < divs_toshow.length; i++ )
@@ -111,8 +85,8 @@
<div id="information" style=" border: solid 0px black; background: transparent; padding: 4px; height:440px; width:95%;">
<BR>
<div id="cpu_div" style="display:none">
- <div id="cpu" style="font-family:courier; font-size:10pt;"></div><BR>
- <embed id="cpu_embed" type="image/svg+xml" src="graphs/graph_cpu.svgz"
+ <div id="cpu" style="font-family:courier; font-size:10pt;"></div><BR>
+ <embed id="cpu_embed" type="image/svg+xml" src="graphs/graph_cpu.svgz"
width="500" height="250" />
</div>
</div>
Modified: branches/asterisknow/config/graphs/graph_cpu.svgz
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/graphs/graph_cpu.svgz?view=diff&rev=1268&r1=1267&r2=1268
==============================================================================
--- branches/asterisknow/config/graphs/graph_cpu.svgz (original)
+++ branches/asterisknow/config/graphs/graph_cpu.svgz Sat Jul 28 22:22:18 2007
@@ -107,7 +107,7 @@
}
}
-
+var TESTVAR = "FFRDDDDD";
var SVGDoc = null;
var last_cpu_total = 0;
var last_cpu_idle = 0;
@@ -121,16 +121,31 @@
function init(evt) {
SVGDoc = evt.target.ownerDocument;
fetch_data();
- setInterval('fetch_data()', 5000);
-}
+ setInterval(fetch_data, 5000);
+ //setInterval(update_graph,5000);
+}
+
function fetch_data() {
- if (fetch_url) {
- getURL(fetch_url, plot_cpu_data);
- } else {
- handle_error();
- }
-}
+ var tmp_command = "sh " + top.asterisk_scriptsFolder + "graphs.sh cpu > /var/lib/asterisk/static-http/config/graphs/data_cpu.html";
+
+ top.astmanEngine.setURL('../'+top.asterisk_rawmanPath);
+ top.astmanEngine.run_tool(
+ tmp_command,
+ function(){
+ top.astmanEngine.setURL(top.asterisk_rawmanPath);
+ if (fetch_url) {
+ getURL(fetch_url, plot_cpu_data);
+ } else {
+ handle_error();
+ }
+
+ }
+ );
+ return true;
+}
+
+
function plot_cpu_data(obj) {
if (!obj.success || ''==obj.content) {
Modified: branches/asterisknow/config/iax.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/iax.html?view=diff&rev=1268&r1=1267&r2=1268
==============================================================================
--- branches/asterisknow/config/iax.html (original)
+++ branches/asterisknow/config/iax.html Sat Jul 28 22:22:18 2007
@@ -44,6 +44,10 @@
}
function localajaxinit(){
+ var adjust_toScreen = function(){
+ _$('iaxsettings_form').style.height= ASTGUI.displayHeight() - 70 ;
+ };
+ ASTGUI.events.add( window , 'resize', adjust_toScreen);
setWindowTitle("IAX");
parent.loadscreen(this);
for (var x =0; x< fieldnames.length; x++ ) {
@@ -169,7 +173,7 @@
<span style="cursor: pointer; cursor: hand;" onclick="window.location.href=window.location.href;" > <img src="images/refresh.png" title=" Refresh " border=0 > </span>
</div>
<div class="mainscreenContentBox" id="userscontent">
-<div style="height :425px;width : 530px ; overflow :auto;">
+<div style="height :425px;width : 530px ; overflow :auto;" id='iaxsettings_form'>
<table class="field_text" align="center" width="100%" cellpadding=3 cellspacing=0 border=0>
<tr> <td align=right colspan=2> </td> </tr>
<tr> <td align=right>Bind Port:</td>
Modified: branches/asterisknow/config/localexts.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/localexts.html?view=diff&rev=1268&r1=1267&r2=1268
==============================================================================
--- branches/asterisknow/config/localexts.html (original)
+++ branches/asterisknow/config/localexts.html Sat Jul 28 22:22:18 2007
@@ -81,6 +81,10 @@
usercallbacks.beforeSaving= function(){
if( _$('localextenlength').value != "0" && _$('localextenlength').value != _$('userbase').value.length ){
gui_feedback("'length of Local Extensions' does not match <BR> the length of 'First Extension number'");
+ return false;
+ }
+ if( _$('login_exten').value != "" && _$('login_exten').value == _$('login_callback_exten').value ){
+ gui_alert("You can not use the same extension for 'Agent Login' and 'Agent Callback Login' ");
return false;
}
@@ -214,6 +218,9 @@
<tr> <td tip="en,users,19" class="field_text" align=right>Agent Callback Login Extension : </td>
<td><input type=text id="login_callback_exten" size=5 class="input9"></td>
</tr>
+ <tr> <td tip="en,users,20" class="field_text" align=right>Agent Logout : </td>
+ <td tip="en,users,20"> See Tooltip</td>
+ </tr>
</table>
</fieldset><BR>
<fieldset style="width: 420px">
Modified: branches/asterisknow/config/meetme.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/meetme.html?view=diff&rev=1268&r1=1267&r2=1268
==============================================================================
--- branches/asterisknow/config/meetme.html (original)
+++ branches/asterisknow/config/meetme.html Sat Jul 28 22:22:18 2007
@@ -65,8 +65,6 @@
flags += 'A';
if (subfields['quiet'] != 'no')
flags += 'q';
- if (subfields['room'].length > 0)
- room = subfields['room'];
return _$('name').value + ",1,MeetMe(" + room + "|" + flags + ")";
}
@@ -145,7 +143,7 @@
tmp['music'] = 'yes';
tmp['menu'] = 'no';
tmp['announce'] = 'yes';
- tmp['room'] = '';
+ tmp['room'] = '${EXTEN}';
tmp['>'] = true;
return new Array(specialcontext, 'exten', tmp);
}
@@ -404,10 +402,9 @@
<td align=center cellspacing='0' cellpadding='0' width=305 border=0>
<table cellspacing='2' cellpadding='1' width=200 border=0>
<tr> <td class="field_text" tip="en,meetme,0">Extension:</td>
- <td> <input size='5' id='name' pattern='^\d*$' class="input8"></td>
- </tr>
- <tr> <td class="field_text" tip="en,meetme,7">Room Override:</td>
- <td> <input size='5' id='room' pattern='^\d*$' class="input8"></td>
+ <td> <input size='5' id='name' pattern='^\d*$' class="input8">
+ <input id='room' type="hidden">
+ </td>
</tr>
<tr> <td colspan='2' height=15></td> </tr>
</table>
@@ -443,7 +440,7 @@
<tr> <td align=right tip="en,meetme,5"><input type='checkbox' id='announce'> </td>
<td class="field_text">Announce callers</td>
</tr>
- <tr> <td align=right tip="en,meetme,11"><input type='checkbox' id='record'> </td>
+ <tr style="display:none"> <td align=right tip="en,meetme,11"><input type='checkbox' id='record'> </td>
<td class="field_text">Record conference</td>
</tr>
<tr> <td align=right tip="en,meetme,8"><input type='checkbox' id='quiet'> </td>
Modified: branches/asterisknow/config/menus.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/menus.html?view=diff&rev=1268&r1=1267&r2=1268
==============================================================================
--- branches/asterisknow/config/menus.html (original)
+++ branches/asterisknow/config/menus.html Sat Jul 28 22:22:18 2007
@@ -1,5 +1,5 @@
<!--
- * Asterisk-GUI - an Asterisk configuration interface
+ * Asterisk-GUI - an Asterisk configuration interface
*
* Create/Manage IVR Menus
*
@@ -297,6 +297,16 @@
}
if( _nsa.value != "Answer" && _nsa.value != "GotoDirecotry" && _nsa.value != "Busy" && _nsa.value != "Hangup" && _nsa.value != "Congestion" && !_nsv .value ){
+
+ if( _nsa.value.toLowerCase() == "dialringgroup" ){
+ if(!_$('rgrp').options.length ){
+ gui_alert("No Ring Groups exist. <BR> Please create a Ring Group before selecting this option.");
+ }else{
+ gui_alert("Please select a RingGroup");
+ }
+ return;
+ }
+
gui_alert("Please enter a value for '" + _nsa.value +"'");
_nsv.focus();
return;
@@ -1036,16 +1046,15 @@
var opt = { method: 'get', asynchronous: true,
onComplete: function(originalRequest){
var sndfiles = originalRequest.responseText.split("\n") ;
- var opt_temp = document.createElement('option');
- var ie; if(document.attachEvent){ ie=1;}else{ie=0;}
var el = _$('combosel_sounds');
- var h = opt_temp.cloneNode(true);
+ var h = document.createElement('option');
h.text = "Default Sounds" ;
h.value = "" ;
h.style.fontWeight = "bold";
- if(ie){el.add(h);} else{ el.add(h,null);}
+ ASTGUI.selectbox.append_option(el,h);
var file_name;
+ var listof_DefaultSounds = {};
for( var i =0 ; i < sndfiles.length ; i++){
if( typeof sndfiles[i] == "undefined" || sndfiles[i] == "" ){
continue;
@@ -1054,10 +1063,12 @@
if( sndfiles[i] == "" ){ continue; }
file_name = sndfiles[i].stripTags() ;
file_name = file_name.replace(/\..*/,""); /* Replace .ulaw .gsm .whatever with nothing so its just the sound file */
- h = opt_temp.cloneNode(true);
- h.text = file_name ;
- h.value = asterisk_Sounds_path + file_name ;
- if(ie){el.add(h);} else{ el.add(h,null);}
+ listof_DefaultSounds[file_name] = true;
+ }
+ for(var i in listof_DefaultSounds){
+ if( listof_DefaultSounds.hasOwnProperty(i) ){
+ ASTGUI.selectbox.append(el , i, i);
+ }
}
load_recordedfiles();
},
@@ -1217,7 +1228,7 @@
<option value="GotoMenu">Goto Menu</option>
<option value="GotoDirecotry">Goto Directory</option>
<option value="GotoExtension">Goto Extension</option>
- <option value="GotoTimeBasedRule">Goto TimeBasedRule</option>
+ <!--<option value="GotoTimeBasedRule">Goto TimeBasedRule</option>-->
<option value="DialRingGroup">Dial RingGroup</option>
<option value="Hangup">Hangup</option>
</select>
Modified: branches/asterisknow/config/numberplan.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/numberplan.html?view=diff&rev=1268&r1=1267&r2=1268
==============================================================================
--- branches/asterisknow/config/numberplan.html (original)
+++ branches/asterisknow/config/numberplan.html Sat Jul 28 22:22:18 2007
@@ -481,10 +481,12 @@
if( c < tmp[2] ){ break; }
c++ ;
}
- gen = _extns.stored_config.catbyname[_extns.value];
- temp = objcopy(gen);
- temp.name = "numberplan-custom-" + c ;
- temp.fieldbyname['plancomment'] = "DialPlan" + c;
+ var nnp = {};
+ nnp.name = "numberplan-custom-" + c ;
+ nnp.fieldbyname = {};
+ nnp.fieldbyname['plancomment'] = "DialPlan" + c;
+ nnp.fieldbyname['include'] = "default";
+ temp = objcopy(nnp);
_$('plancomment').value = "DialPlan" + c;
return temp;
}
@@ -584,6 +586,7 @@
var uri = build_action('newcat', 0, default_planname ,"", "");
uri += build_action('append', 1, default_planname,"plancomment", "DialPlan1");
uri += build_action('append', 2, default_planname,"include", "default");
+ uri += build_action('append', 3, default_planname,"include", "parkedcalls");
makerequest('u','extensions.conf', uri, function(t){gui_feedback("Created Default DialPlan",'green'); location.reload(); } );
}
Modified: branches/asterisknow/config/ringgroups.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/ringgroups.html?view=diff&rev=1268&r1=1267&r2=1268
==============================================================================
--- branches/asterisknow/config/ringgroups.html (original)
+++ branches/asterisknow/config/ringgroups.html Sat Jul 28 22:22:18 2007
@@ -88,15 +88,23 @@
var r = _$('select_ringthesechannels');
var s = _$('select_listofchannels');
+ var cn ;
+
ASTGUI.selectbox.clear(s);
ASTGUI.selectbox.clear(r);
- for (var y=0; y < this_ringgroup.rgchannels.length ; y++ ){
- ASTGUI.selectbox.append(r,this_ringgroup.rgchannels[y], this_ringgroup.rgchannels[y]);
+ for (var y=0; y < this_ringgroup.rgchannels.length ; y++ ){
+ if(LISTOFCHANNELS[this_ringgroup.rgchannels[y]]){
+ cn = LISTOFCHANNELS[this_ringgroup.rgchannels[y]]['ChannelName'];
+ }else{
+ cn = this_ringgroup.rgchannels[y];
+ }
+ ASTGUI.selectbox.append(r,cn,this_ringgroup.rgchannels[y]);
}
for( var u in LISTOFCHANNELS ){ if(LISTOFCHANNELS.hasOwnProperty(u)) {
if( !InArray(this_ringgroup.rgchannels, u) ){
- ASTGUI.selectbox.append(s,u,u);
+ //ASTGUI.selectbox.append(s,u,u);
+ ASTGUI.selectbox.append( s, LISTOFCHANNELS[u]['ChannelName'] , u);
}
}}
@@ -138,8 +146,8 @@
if(!confirm("Are you sure ?")){ return true; }
var uri = build_action('delcat', 0, RG_FORMAT+g, "", "");
/* If we made a goto extension in default, delete the reference. */
- if(ringgroups[RG_EDITING].rgExten){
- var rlex = ringgroups[RG_EDITING].rgExten + ',1,Goto(' + RG_FORMAT+RG_EDITING + '|s|1)' ;
+ if(ringgroups[g].rgExten){
+ var rlex = ringgroups[g].rgExten + ',1,Goto(' + RG_FORMAT+g+ '|s|1)' ;
uri += build_action('delete', 1, specialcontext, "exten", "", rlex);
}
makerequest('u','extensions.conf', uri, function(t){
@@ -157,8 +165,22 @@
if( !_$('text_rgname').value.strip()){
gui_alert("Please enter a name for the ring group"); return false;
}
+ if( isNaN(_$('text_ringTime').value) || Number(_$('text_ringTime').value) <= 0 ){
+ gui_alert("Please enter the number of seconds"); _$('text_ringTime').focus(); return false;
+ }
if(isNewRG){
+ var check4duplicatename = function(){ //Check for duplicate names
+ var rgn = _$('text_rgname').value ;
+ for( var t in ringgroups ){ if(ringgroups.hasOwnProperty(t)){
+ if( rgn == ringgroups[t].rgname )return false;
+ }}
+ return true;
+ };
+ if(!check4duplicatename()){
+ gui_alert("A Ring Group with this name already Exists. Please choose a different name.");
+ return false;
+ }
var getnewringgroupcontext = function(){
var t=1;
while(ringgroups[t]){ t++; }
@@ -298,7 +320,8 @@
//
// so we need to load users.conf and extensions.conf
//
- config2json('users.conf', 1, get_users) ;
+ //config2json('users.conf', 1, get_users) ;
+ config2json('zapscan.conf', 1, read_zapchannels) ;
parent.loadscreen(this);
}
@@ -315,8 +338,21 @@
if( !n[l]['trunkstyle'] ){ // all entries from users.conf other than trunks
UserExtensions.push(l);
- if( n[l]['hassip']=='yes'){LISTOFCHANNELS['SIP/' + l] = true;}
- if( n[l]['hasiax']=='yes'){LISTOFCHANNELS['IAX2/' + l] = true;}
+ if( n[l]['hassip']=='yes'){
+ LISTOFCHANNELS['SIP/' + l] = {};
+ LISTOFCHANNELS['SIP/' + l]['ChannelName'] = 'SIP/' + l + " -- " + n[l]['fullname'];
+ }
+ if( n[l]['hasiax']=='yes'){
+ LISTOFCHANNELS['IAX2/' + l] = {};
+ LISTOFCHANNELS['IAX2/' + l]['ChannelName'] = 'IAX2/' + l + " -- " + n[l]['fullname'];
+ }
+ if( n[l]['zapchan'] ){
+ var m = n[l]['zapchan'];
+ if( LISTOFCHANNELS[ 'Zap/' + m ] ){
+ LISTOFCHANNELS['Zap/'+m]['ChannelName'] = "Analog Phone -- " + n[l]['fullname'];
+ }
+ }
+
ASTGUI.selectbox.append(el, l + " -- " + n[l]['fullname'] , 'Voicemail(' + l + ',b)');
}
}}
@@ -367,19 +403,22 @@
ASTGUI.selectbox.append(el,get_menuname(n[l]), 'Goto('+ n[l] + '|s|1)' );
}
}}
- config2json('zapscan.conf', 1, read_zapchannels) ;
+
+ clear_table();
+ showlist_of_rules();
+ //config2json('zapscan.conf', 1, read_zapchannels) ;
}
function read_zapchannels(c){
for( var d in c ){
if ( c.hasOwnProperty(d) && c[d]['port'] && (c[d]['port'] == 'fxo' ) ) {
- LISTOFCHANNELS['Zap/'+d] = true;
- }
- }
-
- clear_table();
- showlist_of_rules();
+ LISTOFCHANNELS['Zap/'+d] = {};
+ LISTOFCHANNELS['Zap/'+d]['ChannelName'] = 'Analog Phone ' + d;
+ }
+ }
+
+ config2json('users.conf', 1, get_users) ;
}
@@ -428,11 +467,6 @@
}
-
-
-
-
-
function add_rg(){
var u;
isNewRG = 1;
@@ -440,7 +474,8 @@
_$('select_voicemails').style.display = "none";
_$('select_vmenus').style.display = "none";
_$('radio_fbhgp').checked = true;
-
+ _$('text_rgname').value = '';
+ _$('text_rgExten').value = '';
_$('ringgroup_editdiv').style.display = '';
_$('text_ringTime').value = "20";
@@ -451,12 +486,11 @@
ASTGUI.selectbox.clear(y);
for( var u in LISTOFCHANNELS ){ if(LISTOFCHANNELS.hasOwnProperty(u)) {
- ASTGUI.selectbox.append(y,u,u);
+ ASTGUI.selectbox.append( y, LISTOFCHANNELS[u]['ChannelName'], u );
}}
}
function cancel_rg(){ _$('ringgroup_editdiv').style.display = 'none'; }
-
</script>
<body onload="localajaxinit()" bgcolor="FFFFFF">
Modified: branches/asterisknow/config/scripts/astman.js
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/scripts/astman.js?view=diff&rev=1268&r1=1267&r2=1268
==============================================================================
--- branches/asterisknow/config/scripts/astman.js (original)
+++ branches/asterisknow/config/scripts/astman.js Sat Jul 28 22:22:18 2007
@@ -44,6 +44,51 @@
if(document.attachEvent){ isIE= true; }
var ASTGUI = { // the idea is to eventually move all the global variables and functions into this one object so that the global name space is not as cluttered as it is now.
+ dialog : {
+ load_iframe : function(msg){
+ top.alertframename = "alertiframe";
+ top.alertmsg = msg ;
+ var h,_hs;
+ if( !top.document.getElementById(top.alertframename)){
+ h= top.document.createElement("IFRAME");
+ h.setAttribute("id", top.alertframename );
+ h.setAttribute("ALLOWTRANSPARENCY", "true");
+ _hs = h.style ;
+ _hs.position="absolute";
+ _hs.left= 0;
+ _hs.top= 0;
+ _hs.width= '100%';
+ _hs.height= '100%';
+ _hs.zIndex = 9999 ;
+ h.src = "guialert.html" ;
+ h.frameBorder="0";
+ h.scrolling="no";
+ _hs.filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=90)';
+ //h.style.MozOpacity = .90;
+ top.document.body.appendChild(h);
+ }else{
+ top.document.getElementById( top.alertframename ).contentWindow.update( );
+ top.document.getElementById( top.alertframename ).style.display = "";
+ }
+ },
+
+ waitWhile : function(msg){
+ top.alertmsgtype = 2 ;
+ this.load_iframe(msg);
+ },
+
+ alertmsg : function(msg){
+ top.alertmsgtype = 1 ;
+ this.load_iframe(msg);
+ },
+
+ hide : function(){
+ try{top.document.getElementById( top.alertframename ).style.display = "none";}catch(err){}
+ }
+ },
+
+
+
startDrag : function(event, movethis ){
var initialcursorX, initialcursorY, initialwindowleft, initialwindowtop, maxleft, maxtop ;
var stopDrag = function(){
@@ -100,6 +145,12 @@
}
},
+ domActions: {
+ removeAllChilds: function(x){
+ while(x.firstChild){ x.removeChild(x.firstChild); }
+ }
+ },
+
displayHeight: function(){
if(isIE){return document.body.clientHeight;}else{return window.innerHeight;}
},
@@ -124,6 +175,19 @@
}else{
return q.split(',')[1];
}
+ },
+
+ getApp: function(q){
+ var y = ASTGUI.parseContextLine.getAction(q);
+ return y.split('(')[0];
+ },
+
+ getArgs: function(q){
+ var y = ASTGUI.parseContextLine.getAction(q);
+ if( y.charAt(y.length-1) ==')' ){ y = y.substr(0, (y.length-1) ); }
+ var t = y.split('(');
+ t.splice(0,1);
+ return t.join('(');
},
getAction: function(q){ // q can be the the whole contextLine or just 'parseContextLine.read(contextline)[1]'
@@ -345,8 +409,9 @@
_hs.borderWidth= "1px";
_hs.borderColor= "#7E5538";
_hs.borderStyle= "solid";
- h.innerHTML = '<BR><BR><TABLE border=0 cellpadding=0 cellspacing=3 align=center><TR><TD><img src=images/loading.gif></TD>'+
- '<TD valign=middle align=center> <div id=message_text></div></TD></TR></TABLE> ';
+ h.innerHTML = '<BR><BR><TABLE border=0 cellpadding=0 cellspacing=3 align=center>' +
+ '<TR><TD><img src="/static/config/images/loading.gif"></TD>' +
+ '<TD valign=middle align=center> <div id=message_text></div></TD></TR></TABLE>';
document.body.appendChild(h);
}
@@ -990,8 +1055,14 @@
return;
}
}
- uri = box.engine.fields2changes(box.widgets, box.stored_config, cattmp);
- if (uri.length) {
+ var treq;
+ if(isIE){
+ treq = box.engine.fields2changes(box.widgets, box.stored_config, cattmp, true);
+ }else{
+ uri = box.engine.fields2changes(box.widgets, box.stored_config, cattmp);
+ }
+
+ if (uri.length || (isIE && !!treq['act_1']) ) {
if (box.callbacks.format) {
tmp = box.callbacks.format(box.stored_config.catbyname[cattmp.catname]);
box.options[box.selectedIndex].value = cattmp.catname;
@@ -1017,18 +1088,34 @@
box.remove(box.selectedIndex);
}
}
+ }
+
+ if (uri.length) {
opt.parameters="action=updateconfig&srcfilename=" + encodeURIComponent(box.config_file) + "&dstfilename=" + encodeURIComponent(box.config_file) + uri;
temp = new Ajax.Request(box.engine.url, opt);
}
- }
- if (!uri.length) {
- if (!box.callbacks.savechanges || !box.callbacks.savechanges()) {
- gui_feedback('No changes made!','green');
- }
- if (box.widgets['save']){ box.widgets['save'].disabled = true; }
- if (box.widgets['cancel']) { box.widgets['cancel'].disabled = true; }
- }
-}
+
+ if ( isIE && !!treq['act_1'] ) {
+ var pre_uri = "action=updateconfig&srcfilename=" + encodeURIComponent(box.config_file) + "&dstfilename=" + encodeURIComponent(box.config_file);
+ var start_sqreqs = function(st){
+ var f = treq[ 'act_' + st ];
+ if(f){ makerequest("","",pre_uri + f, start_sqreqs(st-1)); }else{ opt.onSuccess(); }
+ };
+ var e = 0;
+ for (var r in treq) { if( treq.hasOwnProperty(r) ){ e++; }}
+ start_sqreqs(e);
+ }
+
+ if(!uri || (isIE && !treq['act_1']) ){
+ if (!box.callbacks.savechanges || !box.callbacks.savechanges()) {
+ gui_feedback('No changes made!','green');
+ }
+ if (box.widgets['save']){ box.widgets['save'].disabled = true; }
+ if (box.widgets['cancel']){ box.widgets['cancel'].disabled = true; }
+ }
+ }
+}
+
function ast_true(s){
if ( s == 'yes' || s == 'true' || s == 'y' || s == 't' || s == '1' || s == 'on' ){
@@ -1122,6 +1209,7 @@
target=target.parentNode;
me.selecttarget = target.id;
target.className = "chanlistselected";
+
me.chancallback(target.id);
};
@@ -1302,13 +1390,39 @@
callback(msgs, userdata);
};
- this.fields2changes = function(widgets, config, cattmp) {
+ this.fields2changes = function(widgets, config, cattmp, chop_changes) {
var thevalue;
var changes="";
var count = 0;
var override=0;
var tmp;
var cat;
+ var chopped_changes={};
+ chopped_changes.current_batch = 1 ;
+ chopped_changes.current_batch_actionnumber = 0;
+ chopped_changes.actions = {};
+ chopped_changes.getacn = function(nc){
+ return this.current_batch_actionnumber;
+ };
+ chopped_changes.addNewChange = function(nc){
+ var t = 'act_' + this.current_batch;
+ if(!this.current_batch_actionnumber){
+ this.actions[t] = nc;
+ }else{
+ this.actions[t] = this.actions[t] + nc;
+ }
+ if( this.current_batch_actionnumber == 5 ){
+ this.current_batch++;
+ this.current_batch_actionnumber = 0;
+ }else{
+ this.current_batch_actionnumber++;
+ }
+ };
+ chopped_changes.build_action = function(a,x,b,c,d,e){
+ var z = this.getacn();
+ var nc = e?build_action(a, z, b, c, d, e):build_action(a, z, b, c, d) ;
+ this.addNewChange(nc);
+ };
tmp = cattmp.catname.split(']');
if (tmp.length > 1)
@@ -1320,8 +1434,14 @@
if (cat.name != widgets['name'].value) {
if (cat.name.length) {
changes += build_action('renamecat', count++, cat.name, "", widgets['name'].value);
+ if(chop_changes){
+ chopped_changes.build_action('renamecat', count++, cat.name, "", widgets['name'].value);
+ }
} else {
changes += build_action('newcat', count++, widgets['name'].value, "", "");
+ if(chop_changes){
+ chopped_changes.build_action('newcat', count++, widgets['name'].value, "", "");
+ }
override = 1;
}
cat.name = widgets['name'].value;
@@ -1358,8 +1478,12 @@
cat.fieldbyname[src] = widgets[x].value;
else
cat[src] = widgets[x].value;
- if (cat.fieldbyname)
+ if (cat.fieldbyname){
changes += build_action('update', count++, cat.name, src, cat.fieldbyname[src]);
+ if(chop_changes){
+ chopped_changes.build_action('update', count++, cat.name, src, cat.fieldbyname[src]);
+ }
+ }
}
}
} else if (widgets[x].type == 'checkbox') {
@@ -1373,8 +1497,12 @@
cat.fieldbyname[src] = 'no';
else
cat[src] = 'no';
- if (cat.fieldbyname)
+ if (cat.fieldbyname){
changes += build_action('update', count++, cat.name, src, cat.fieldbyname[src]);
+ if(chop_changes){
+ chopped_changes.build_action('update', count++, cat.name, src, cat.fieldbyname[src]);
+ }
+ }
}
} else if (widgets[x].options && widgets[x].multiple && widgets[x].splitchar) {
var answers = new Array;
@@ -1384,25 +1512,40 @@
}
if (cat.fieldbyname) {
cat.fieldbyname[src] = answers.join(widgets[x].splitchar);
- if (thevalue != cat.fieldbyname[src])
+ if (thevalue != cat.fieldbyname[src]){
changes += build_action('update', count++, cat.name, src, cat.fieldbyname[src]);
+ if(chop_changes){
+ chopped_changes.build_action('update', count++, cat.name, src, cat.fieldbyname[src]);
+ }
+ }
} else
cat[src] = answers.join(widgets[x].splitchar);
} else if (override || (widgets[x].value != thevalue)) {
if (cat.fieldbyname) {
cat.fieldbyname[src] = widgets[x].value;
- if(widgets[x].hasAttribute('noblank') && !widgets[x].value){
+ if( !widgets[x].value && !widgets[x].hasAttribute('allowblank') ){
changes += build_action('delete', count++, cat.name, src, "", thevalue);
+ if(chop_changes){
+ chopped_changes.build_action('delete', count++, cat.name, src, "", thevalue);
+ }
}else{
changes += build_action('update', count++, cat.name, src, cat.fieldbyname[src]);
+ if(chop_changes){
+ chopped_changes.build_action('update', count++, cat.name, src, cat.fieldbyname[src]);
+ }
}
} else
cat[src] = widgets[src].value;
}
}
}}
+
+ if(chop_changes){
+ return chopped_changes.actions;
+ }
return changes;
};
+
this.cat2fields = function(widgets, cat) {
var thevalue;
@@ -1760,96 +1903,50 @@
/* Extension handling below */
var specialcontext = "default";
- Special = Class.create();
- Special.prototype = {
- initialize: function(name, macro, label) {
- this.name = name;
- this.macro = macro;
- this.label = label;
- }
- };
-
- Extension = Class.create();
- Extension.prototype = {
- initialize: function(priority, label, app, appdata) {
- this.priority = priority;
- this.label = label;
- this.app = app;
- this.appdata = appdata;
- }
- }
-
- specials = new Array;
- specials.push(
- new Special("VoiceMailMain", null, "Check Voicemail"),
- new Special("MeetMe", null, "Conference Bridge"),
- new Special("Queue", null, "Call Queue")
- );
-
function app2label(app) {
- var appo;
- if ((appo = findapp(app)))
- return appo.label;
+ var apps = {}
+ apps["VoiceMailMain"] = "Check Voicemail";
+ apps["MeetMe"] = "Conference Bridge";
+ apps["Queue"] = "Call Queue";
+
+ if( apps[app] )return apps[app];
return "Custom";
};
-
- function findapp(app) {
- for (x=0;x<specials.length;x++) {
- if (specials[x].name.toLowerCase() == app.toLowerCase())
- return specials[x];
- }
- return null;
- }
-
+
function format_extension(box, t, x, multipriority) {
- var tmp;
- var exten, app, rest, args, label, priority;
- if ((t.names[x] != 'exten'))
+ var priority, exten, app, args, label ;
+
+ if ( t.names[x] != 'exten' )
return null;
- tmp = t.fields[x].split(',');
- priority = tmp[1];
-
- // if it is a Voicemenu alias .. return "extension -- Voicemenu"
- if ( tmp[2].match("Goto") && tmp[2].match("voicemenu-custom-" ) ){
- t.subfields[x]['context'] = t.name;
- t.subfields[x]['name'] = tmp[0];
- t.subfields[x]['app'] = "Goto";
- t.subfields[x]['label'] = "Voice Menu";
- t.subfields[x]['args'] = "";
- t.subfields[x]['priority'] = priority;
-
- box.calcname = tmp[0];
- box.calccontext = t.name;
- box.calcpriority = priority;
- return tmp[0] + " -- Voice Menu" ;
- }
- //
-
- if (!multipriority && (tmp[1] != '1'))
+ var this_line = t.fields[x];
+
+ priority = ASTGUI.parseContextLine.getPriority(this_line);
+ exten = ASTGUI.parseContextLine.getExten(this_line);
+ app = ASTGUI.parseContextLine.getApp(this_line);
+ args = ASTGUI.parseContextLine.getArgs(this_line);
+ label = app2label(app);
+
+ if (!multipriority && ( priority != '1'))
return null;
- exten = tmp[0];
- tmp.splice(0,2);
- rest = tmp.join(',');
- tmp = rest.split('(');
- if (!tmp[0])
- return null;
- app = tmp[0];
- label = app2label(app);
- tmp.splice(0,1);
- args = tmp.join('(');
-
- tmp = args.split(')');
- if ((tmp.length > 1) && (!tmp[tmp.length-1].length))
- tmp.splice(tmp.length-1, 1);
- args = tmp.join(')');
-
+
t.subfields[x]['context'] = t.name;
t.subfields[x]['name'] = exten;
t.subfields[x]['app'] = app;
t.subfields[x]['label'] = label;
t.subfields[x]['args'] = args;
t.subfields[x]['priority'] = priority;
-
+
+ if( app.toLowerCase() == "goto" && args.match("voicemenu-custom-") ){
+ label = "Voice Menu";
+ t.subfields[x]['label'] = label;
+ t.subfields[x]['args'] = "";
+ }
[... 754 lines stripped ...]
More information about the asterisk-gui-commits
mailing list