pari: trunk r912 - in /trunk/config: menus.html scripts/astman.js
timerules.html
asterisk-gui-commits at lists.digium.com
asterisk-gui-commits at lists.digium.com
Thu May 10 14:10:53 MST 2007
Author: pari
Date: Thu May 10 16:10:52 2007
New Revision: 912
URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=912
Log:
VoiceMenus - forward to a 'Time Based Rule'
Modified:
trunk/config/menus.html
trunk/config/scripts/astman.js
trunk/config/timerules.html
Modified: trunk/config/menus.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/menus.html?view=diff&rev=912&r1=911&r2=912
==============================================================================
--- trunk/config/menus.html (original)
+++ trunk/config/menus.html Thu May 10 16:10:52 2007
@@ -44,6 +44,17 @@
function format_step(this_step){
var temp = this_step.split(',');
+ if( temp[2].match("Goto") && this_step.match(TIMERULES_CATEGORY) ){
+ var tmp = this_step.split('Goto')[1].substr(1);
+ tmp = tmp.substr(0, tmp.length-1);
+
+ var m = _$('tbr');
+ for(var l=0; l < m.options.length; l++ ){
+ if(m.options[l].value == tmp){ return "Goto TimeBasedRule '"+ m.options[l].text + "'"; }
+ }
+ return "Goto '"+ tmp + "' (NOT FOUND)";
+ }
+
if( temp[2].match("Answer") )
return "Answer the Call";
if( temp[2].match("Authenticate") ){
@@ -93,7 +104,7 @@
return "Goto Menu '"+ tmp1[0] + "'";
}
}
-
+
if( temp[2].match("Goto") && !temp[2].match("voicemenu-") ){
var tmp = temp[2].split('(');
var tmp1 = tmp[1].split('|');
@@ -365,6 +376,9 @@
case 'GotoExtension':
action_string = "s,"+ newpriority+ ",Goto(default|" + _nsv.value + "|1)";
break;
+ case 'GotoTimeBasedRule':
+ action_string = "s,"+ newpriority+ ",Goto(" + _$('tbr').value + ")";
+ break;
case 'Hangup':
action_string = "s,"+ newpriority+ ",Hangup";
break;
@@ -684,6 +698,7 @@
_$('combodiv_sounds').style.display = "none" ;
_ane.style.display = "none";
_anm.style.display = "none";
+ _$('tbr').style.display = "none";
if( _nsa.value== "" || _nsa.value== "Answer" || _nsa.value== "Hangup" ){
@@ -698,7 +713,12 @@
}else if(_nsa.value== "GotoExtension" ){
_nsv.value = _ane.value;
_ane.style.display = "";
+ }else if(_nsa.value== "GotoTimeBasedRule" ){
+ _$('tbr').selectedIndex = -1;
+ _$('tbr').style.display = "";
}
+
+
}
@@ -950,6 +970,23 @@
extencallbacks.format = function(t, x) {
var res;
var qname;
+
+ if(t.name == TIMERULES_CATEGORY && t.fields[x].match("NoOp") ){
+ var m = t.fields[x].split('NoOp')[1].substr(1);
+ m = m.substr(0, m.length-1);
+
+ var l = document.createElement('option');
+ l.text = m ;
+ l.value = TIMERULES_CATEGORY + ","+ t.fields[x].split(',')[0] + ",1" ;
+
+ if(document.attachEvent){
+ _$('tbr').add(l);
+ }else{
+ _$('tbr').add(l,null);
+ }
+ return null ;
+ }
+
if ((t.name != specialcontext))
return null;
@@ -1153,6 +1190,7 @@
<option value="WaitExten">WaitExten</option>
<option value="GotoMenu">Goto Menu</option>
<option value="GotoExtension">Goto Extension</option>
+ <option value="GotoTimeBasedRule">Goto TimeBasedRule</option>
<option value="Hangup">Hangup</option>
</select>
<input type=text id="newstep_var" style="display:none" size=4 disabled class="input8">
@@ -1161,6 +1199,7 @@
<div id="combodiv_sounds">
<select size=5 id="combosel_sounds" style="font-family: Verdana, Arial, Helvetica, Sans-Serif;font-size: 11px;" class="input8"></select>
</div>
+ <select style="display:none" id="tbr" class="input8" onChange=" $('newstep_var').value = $('tbr').value;"></select>
<input type=text id="newstep_var_digit" size=3 style="display:none;" onChange=" $('newstep_var').value = $('newstep_var_digit').value;" pattern='^\d*$' class="input8">
<SCRIPT LANGUAGE="JavaScript">combo_box('newstep_var', "combodiv_sounds","combosel_sounds"); </SCRIPT>
<input type=button style='width:45' id='addstep' onclick="add_newstep()" value="Add" disabled class="buttonbold">
Modified: trunk/config/scripts/astman.js
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/scripts/astman.js?view=diff&rev=912&r1=911&r2=912
==============================================================================
--- trunk/config/scripts/astman.js (original)
+++ trunk/config/scripts/astman.js Thu May 10 16:10:52 2007
@@ -41,6 +41,7 @@
var sortbynames = false;
var dragdata = new Object;
var asterisk_guiTDPrefix = "DID_";
+var TIMERULES_CATEGORY = 'timebasedrules';
function gui_feedback(a,b,c){
// a is msg, b is color (optional ), c is display time in milliseconds(optional, default to asterisk_guifbt)
Modified: trunk/config/timerules.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/timerules.html?view=diff&rev=912&r1=911&r2=912
==============================================================================
--- trunk/config/timerules.html (original)
+++ trunk/config/timerules.html Thu May 10 16:10:52 2007
@@ -23,7 +23,6 @@
<link href="stylesheets/rico.css" media="all" rel="Stylesheet" type="text/css" />
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
<script>
-var TIMERULES_CATEGORY = 'timebasedrules';
var timebasedrules = {};
var voicemenus = [];
var user_extens = [];
More information about the asterisk-gui-commits
mailing list