Author: pari
Date: Thu Mar 29 16:06:42 2007
New Revision: 550
URL: http://svn.digium.com/view/asterisk-gui?view=rev&
;rev=550
Log:
Merged revisions 549 via svnmerge from
htt
ps://origsvn.digium.com/svn/asterisk-gui/trunk
........
r549 | pari | 2007-03-29 16:04:33 -0500 (Thu, 29 Mar 2007) |
1 line
cleanup setup/5
........
Modified:
branches/aadk/ (props changed)
branches/aadk/config/setup/5.html
branches/asterisknow/ (props changed)
branches/asterisknow/config/setup/5.html
Propchange: branches/aadk/
------------------------------------------------------------
------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Mar 29 16:06:42 2007
 -1,1
+1,1 
-/trunk:1-430,433-448,501,505,512,519,532,536,538,543,545,54
7
+/trunk:1-430,433-448,501,505,512,519,532,536,538,543,545,54
7,549
Modified: branches/aadk/config/setup/5.html
URL: http://svn.digium.com/view/asterisk-gui/branches/aadk/c
onfig/setup/5.html?view=diff&rev=550&r1=549&r2=5
50
============================================================
==================
--- branches/aadk/config/setup/5.html (original)
+++ branches/aadk/config/setup/5.html Thu Mar 29 16:06:42
2007
 -20,14
+20,12 
*
-->
<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 trunks_desc = new Object;
var trunkcallbacks = new Object;
 -43,47
+41,45 
var oldselect;
function localinit(){
+ showdiv_statusmessage();
//parent.$('next').disabled = true;
- parent.$('next').onclick = function(){
window.location.href="6.html"; };
- parent.$('back').disabled = false;
- parent.$('back').onclick = function(){
window.location.href="4.html"; };
+ parent._$('next').onclick = function(){
window.location.href="6.html"; };
+ parent._$('back').disabled = false;
+ parent._$('back').onclick = function(){
window.location.href="4.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") ) {
- $('message_text').innerHTML ="Saving
Changes...";
- parent.astmanEngine.config2list("users.conf",
$('trunks'), new Array(), trunkcallbacks);
- }
-}
-
-
-
+ 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")
) {
+ _$('message_text').innerHTML ="Saving
Changes...";
+ parent.astmanEngine.config2list("users.conf",
_$('trunks'), new Object(), trunkcallbacks);
+ }
+}
function addthe_default_callingplan(){
t=confirm("A default Dial Plan is not found. n"
+ " Do you want to create a default Dial Plan ");
if(t == false){
- $('status').innerHTML = "A default DialPlan is not
found !! "
+ _$('status').innerHTML = "A default DialPlan is not
found !! "
+ "<BR> <A href="#"
onclick="addthe_default_callingplan()">click
here</A> to create a default Dial plan";
- $('addrule').disabled = 1;
- return true;
+ _$('addrule').disabled = 1;
+ return true;
}
var default_planname = 'numberplan-custom-1' ;
var uri = build_action('newcat', 0, default_planname
,"", "");
 -101,12
+97,7 
var tmp = new Ajax.Request(rawman_url, opt);
}
-
-
-
trunkcallbacks.format = function(t) {
- //if (t.name.substr(0,6) != 'trunk_')
- // return null;
if ( t.fieldbyname['context'] != asterisk_guiTDPrefix +
t.name ) {
return null;
}
 -122,28
+113,28 
}
trunkcallbacks.loaded = function(){
- $('trunks').addEventListener('click',hackenablesave,false)
;
- parent.astmanEngine.config2list("extensions.conf"
;, $('extensions'), new Array(), numplan_callbacks);
+ _$('trunks').addEventListener('click',hackenablesave,false
);
+ parent.astmanEngine.config2list("extensions.conf"
;, _$('extensions'), new Object(), numplan_callbacks);
}
function hackenablesave(){
- if( oldselect != $('trunks').value ){
+ if( oldselect != _$('trunks').value ){
enablesave();
}
}
numplan_callbacks.format = function(t, x) {
- var exten_fields;
- if(t.name == "numberplan-custom-1" && x
== undefined ){
- default_numberplan = 1;
- }else if(t.name == "numberplan-custom-1"
&& t.names[x]=='exten' ){
- default_np_rules.push( t.fields[x] );
- }else if(t.name == "numberplan-custom-1"
&& t.names[x]=='comment' ){
- var tmp = t.fields[x].split(",");
- if( tmp.length > 1 ){
- default_np_comments.push( t.fields[x] );
- }
- }
+ var exten_fields;
+ if(t.name == "numberplan-custom-1" && x
== undefined ){
+ default_numberplan = 1;
+ }else if(t.name == "numberplan-custom-1"
&& t.names[x]=='exten' ){
+ default_np_rules.push( t.fields[x] );
+ }else if(t.name == "numberplan-custom-1"
&& t.names[x]=='comment' ){
+ var tmp = t.fields[x].split(",");
+ if( tmp.length > 1 ){
+ default_np_comments.push( t.fields[x] );
+ }
+ }
return false;
}
 -151,71
+142,72 
numplan_callbacks.loaded = function() {
parent.astmanEngine.pollEvents();
if(!default_numberplan){
- // Redirect To creating a default Number Plan
- addthe_default_callingplan();
- return true;
+ // Redirect To creating a default Number Plan
+ addthe_default_callingplan();
+ return true;
}
for( var i=0; i < default_np_rules.length; i++){
- var temp = default_np_rules[i].split(","); //
temp[0] is the pattern, temp[1] is the priority,temp[2] is
'Macro(trunkdial', temp[3] is $/${EXTEN:1})
- var temp1 = temp[3].split("{");
- var temp2 = temp1[1].split("}");
- var temp3 = temp1[2].split("}");
- var temp4 = temp3[0].split(":");
- temp[4] = temp2[0] ; // temp[4] is trunkname
- temp[5] = temp4[1] ; // temp[5] is the #digits to strip
in the front
- if ( typeof default_np_data[temp[0]] == 'undefined' )
{
- default_np_data[temp[0]] = new Object();
- }
- default_np_data[temp[0]][temp[1]] = new Object();
- default_np_data[temp[0]][temp[1]].trunk = temp[4] ;
- default_np_data[temp[0]][temp[1]].digits2strip =
temp[5] ;
+ var temp = default_np_rules[i].split(","); //
temp[0] is the pattern, temp[1] is the priority,temp[2] is
'Macro(trunkdial', temp[3] is $/${EXTEN:1})
+ var temp1 = temp[3].split("{");
+ var temp2 = temp1[1].split("}");
+ var temp3 = temp1[2].split("}");
+ var temp4 = temp3[0].split(":");
+ temp[4] = temp2[0] ; // temp[4] is trunkname
+ temp[5] = temp4[1] ; // temp[5] is the #digits to strip
in the front
+ if ( typeof default_np_data[temp[0]] == 'undefined' ) {
+ default_np_data[temp[0]] = new Object();
+ }
+ default_np_data[temp[0]][temp[1]] = new Object();
+ default_np_data[temp[0]][temp[1]].trunk = temp[4] ;
+ default_np_data[temp[0]][temp[1]].digits2strip = temp[5]
;
}
for ( var i =0; i < default_np_comments.length ; i++){
- var temp = default_np_comments[i].split(",");
- default_np_data[temp[0]][temp[1]].rulename = temp[2] ;
- if(temp[3] !="custom"){
- default_np_data[temp[0]][temp[1]].ruledesc =
parsepattern(temp[0],0) ;
- }else{
- default_np_data[temp[0]][temp[1]].ruledesc =
"custom" ;
- }
+ var temp = default_np_comments[i].split(",");
+ default_np_data[temp[0]][temp[1]].rulename = temp[2] ;
+ if(temp[3] !="custom"){
+ default_np_data[temp[0]][temp[1]].ruledesc =
parsepattern(temp[0],0) ;
+ }else{
+ default_np_data[temp[0]][temp[1]].ruledesc =
"custom" ;
+ }
}
// now show this object in a table.
- for( var x in default_np_data ){ // x is the pattern
- // sort the priorities
- if ( x == "extend"){ break;}
- var sorted_priorities = [];
- for ( var y in default_np_data[x] ){
- if ( y == "extend"){break;}
+ for( var x in default_np_data ){ // x is the pattern
+ // sort the priorities
+ if( !default_np_data.hasOwnProperty(x) ){ continue; }
+ var sorted_priorities = [];
+ for ( var y in default_np_data[x] ){
+ if( default_np_data[x].hasOwnProperty(y) ){
sorted_priorities.push(y);
}
- sorted_priorities.sort();
- // done sorting priorities
- // show fields in a table in the order of sorted
priorities
- for( var z=0; z < sorted_priorities.length ; z++ ){
- //check if the trunk defined is actually an existing
trunk
- var trunk_exists = 0;
- for(var i=0; i < $('trunks').length ; i++ ){
- if( $('trunks').options[i].value ==
default_np_data[x][sorted_priorities[z]].trunk ){
- trunk_exists = 1;
- break;
- }
- }
-
- if ( default_np_data[x][sorted_priorities[z]].trunk ==
"" ){
- $('trunks').selectedIndex = -1;
- addrowtotable( x , sorted_priorities[z] ,
"undefined" ,
default_np_data[x][sorted_priorities[z]].digits2strip );
- }else if(trunk_exists == 0){
- $('trunks').selectedIndex = -1;
- addrowtotable( x , sorted_priorities[z] ,
"invalid" ,
default_np_data[x][sorted_priorities[z]].digits2strip
);
- }else{
- addrowtotable( x , sorted_priorities[z] ,
default_np_data[x][sorted_priorities[z]].trunk ,
default_np_data[x][sorted_priorities[z]].digits2strip );
+ }
+ sorted_priorities.sort();
+ // done sorting priorities
+ // show fields in a table in the order of sorted
priorities
+ for( var z=0; z < sorted_priorities.length ; z++ ){
+ //check if the trunk defined is actually an existing
trunk
+ var trunk_exists = 0;
+ for(var i=0; i < _$('trunks').length ; i++ ){
+ if( _$('trunks').options[i].value ==
default_np_data[x][sorted_priorities[z]].trunk ){
+ trunk_exists = 1;
+ break;
}
}
+
+ if ( default_np_data[x][sorted_priorities[z]].trunk ==
"" ){
+ _$('trunks').selectedIndex = -1;
+ addrowtotable( x , sorted_priorities[z] ,
"undefined" ,
default_np_data[x][sorted_priorities[z]].digits2strip );
+ }else if(trunk_exists == 0){
+ _$('trunks').selectedIndex = -1;
+ addrowtotable( x , sorted_priorities[z] ,
"invalid" ,
default_np_data[x][sorted_priorities[z]].digits2strip );
+ }else{
+ addrowtotable( x , sorted_priorities[z] ,
default_np_data[x][sorted_priorities[z]].trunk ,
default_np_data[x][sorted_priorities[z]].digits2strip );
+ }
+ }
}
- if( $('callingRulesTable').rows.length == 0 ){
- $('table_one').style.display="none";
- var newRow = $('callingRulesTable').insertRow(-1);
+ if( _$('callingRulesTable').rows.length == 0 ){
+ _$('table_one').style.display="none";
+ var newRow = _$('callingRulesTable').insertRow(-1);
var newCell0 = newRow.insertCell(0);
newCell0 .align = "center";
newCell0 .innerHTML = "<BR>A <I>Calling
Rule</I> is not defined<BR><BR> Please
click on the 'Add a Calling Rule' button<BR> to add a
Calling Rule<BR><BR>" ;
 -228,109
+220,100 
function addrowtotable(a,b,c,d){ // a is pattern, b is
priority, c is trunk, d is digits2strip
- var sno = $('callingRulesTable').rows.length + 1;
- var newRow = $('callingRulesTable').insertRow(-1);
- newRow.id = "row" + sno;
-
- var newCell0 = newRow.insertCell(0);
- newCell0.innerHTML = sno ;
- newCell0.width=35;
- newCell0.align="center";
-
- var newCell1 = newRow.insertCell(1);
- newCell1.innerHTML = default_np_data[a][b].rulename ;
- newCell1.width=90;
-
- var newCell2 = newRow.insertCell(2);
- newCell2.innerHTML = default_np_data[a][b].ruledesc ;
-
- if(c == "invalid" || c== "undefined"
){
- var newCell3 = newRow.insertCell(3);
- newCell3.innerHTML = "<B><font
color=red>invalid trunk</font></B>" ;
- newCell3.width=85;
- }else{
- var newCell3 = newRow.insertCell(3);
- newCell3.innerHTML = trunks_desc[c].comment ;
- newCell3.width=85;
- }
-
- var newCell4 = newRow.insertCell(4);
- newCell4.innerHTML = "<A href="#"
onclick="editcallingrule('"+ a +"', '"+
b
+"')">Edit</A> <A
href="#"
onclick="deletecallingrule('"+ a +"',
'"+ b +"')">Delete</A>";
- newCell4.width=75;
- newCell4.align="center";
- return true;
+ var sno = _$('callingRulesTable').rows.length + 1;
+ var newRow = _$('callingRulesTable').insertRow(-1);
+ newRow.id = "row" + sno;
+
+ var newCell0 = newRow.insertCell(0);
+ newCell0.innerHTML = sno ;
+ newCell0.width=35;
+ newCell0.align="center";
+
+ var newCell1 = newRow.insertCell(1);
+ newCell1.innerHTML = default_np_data[a][b].rulename ;
+ newCell1.width=90;
+
+ var newCell2 = newRow.insertCell(2);
+ newCell2.innerHTML = default_np_data[a][b].ruledesc ;
+
+ if(c == "invalid" || c== "undefined"
){
+ var newCell3 = newRow.insertCell(3);
+ newCell3.innerHTML = "<B><font
color=red>invalid trunk</font></B>" ;
+ newCell3.width=85;
+ }else{
+ var newCell3 = newRow.insertCell(3);
+ newCell3.innerHTML = trunks_desc[c].comment ;
+ newCell3.width=85;
+ }
+
+ var newCell4 = newRow.insertCell(4);
+ newCell4.innerHTML = "<A href="#"
onclick="editcallingrule('"+ a +"', '"+
b
+"')">Edit</A> <A
href="#"
onclick="deletecallingrule('"+ a +"',
'"+ b +"')">Delete</A>";
+ newCell4.width=75;
+ newCell4.align="center";
+ return true;
}
function deletecallingrule(a,b){
- t=confirm("Are you sure ?")
- if(t == false)
- return true;
- delete_callingrule(a,b, oncomplete =
function(){location.reload();} ) ;
+ t=confirm("Are you sure ?")
+ if(t == false){ return true; }
+ delete_callingrule(a,b, oncomplete =
function(){location.reload();} ) ;
}
function delete_callingrule(a,b,oncomplete){
- if(default_np_data[a][b].ruledesc == 'custom'){
- var commentstring = "custom";
- }else{
- var commentstring = "standard";
- }
-
- var rule_string = a + ',' + b + ',Macro(trunkdial,${' +
default_np_data[a][b].trunk + '}/${EXTEN:' +
default_np_data[a][b].digits2strip + '})' ;
- var uri = build_action('delete', 0,
"numberplan-custom-1" ,"exten",
"", rule_string );
- commentstring = a + ',' + b + ',' +
default_np_data[a][b].rulename + ',' + commentstring ;
- uri += build_action('delete', 1 ,
"numberplan-custom-1"
,"comment","", commentstring );
-
- var opt = {
- method: 'get',
- asynchronous: true,
- onSuccess: function(t) { oncomplete(); },
- onFailure: function(t) {
- alert("Config Error: " + t.status + ":
" + t.statusText);
- }
- };
- opt.parameters=
"action=updateconfig&srcfilename=" +
encodeURIComponent("extensions.conf") +
"&dstfilename=" +
encodeURIComponent("extensions.conf") + uri;
- $('userscontent').style.display="none";
- $('bg_transparent').style.display='none';
- $('status_message').style.display="block";
- var tmp = new Ajax.Request(rawman_url, opt);
-}
-
-
-
+ var commentstring = (default_np_data[a][b].ruledesc ==
'custom')?"custom":"standard" ;
+ var rule_string = a + ',' + b + ',Macro(trunkdial,${' +
default_np_data[a][b].trunk + '}/${EXTEN:' +
default_np_data[a][b].digits2strip + '})' ;
+ var uri = build_action('delete', 0,
"numberplan-custom-1" ,"exten",
"", rule_string );
+ commentstring = a + ',' + b + ',' +
default_np_data[a][b].rulename + ',' + commentstring ;
+ uri += build_action('delete', 1 ,
"numberplan-custom-1"
,"comment","", commentstring );
+
+ var opt = {
+ method: 'get',
+ asynchronous: true,
+ onSuccess: function(t) { oncomplete(); },
+ onFailure: function(t) {
+ alert("Config Error: " + t.status + ":
" + t.statusText);
+ }
+ };
+ opt.parameters=
"action=updateconfig&srcfilename=" +
encodeURIComponent("extensions.conf") +
"&dstfilename=" +
encodeURIComponent("extensions.conf") + uri;
+ _$('userscontent').style.display="none";
+ _$('bg_transparent').style.display='none';
+ _$('status_message').style.display= "";
+ var tmp = new Ajax.Request(rawman_url, opt);
+}
function editcallingrule(a,b){
pattern_beingedited = a ;
pattern_beingedited_priority = b ;
- oldselect = $('trunks').value;
+ oldselect = _$('trunks').value;
isnewrule = false;
- $('rulename').value = default_np_data[a][b].rulename;
- $('trunks').selectedIndex = -1 ;
- for(var i=0; i < $('trunks').length ; i++ ){
- if( $('trunks').options[i].value ==
default_np_data[a][b].trunk ){
- $('trunks').selectedIndex = i ;
- break;
- }
- }
- $('pattern').value = a;
- $('strip').value = default_np_data[a][b].digits2strip;
- $('save_a').disabled = 1;
+ _$('rulename').value = default_np_data[a][b].rulename;
+ _$('trunks').selectedIndex = -1 ;
+ for(var i=0; i < _$('trunks').length ; i++ ){
+ if( _$('trunks').options[i].value ==
default_np_data[a][b].trunk ){
+ _$('trunks').selectedIndex = i ;
+ break;
+ }
+ }
+ _$('pattern').value = a;
+ _$('strip').value = default_np_data[a][b].digits2strip;
+ _$('save_a').disabled = 1;
if(default_np_data[a][b].ruledesc == 'custom' ){
// if this is a custom pattern then donot try to parse
the pattern
iscustom = true;
- $('define_advanced').style.display="";
- $('define_usual').style.display="none";
+ _$('define_advanced').style.display="";
+ _$('define_usual').style.display="none";
}else{
// if this is standard pattern then parse the pattern
into 'beginswith', 'followedby'
var temp = parsepattern(a,1);
iscustom = false;
- $('define_advanced').style.display="none";
- $('define_usual').style.display="";
- }
-
- $('userscontent').style.display="";
- $('bg_transparent').style.display='';
- $('addrule').disabled =1;
+ _$('define_advanced').style.display="none";
+ _$('define_usual').style.display="";
+ }
+
+ _$('userscontent').style.display="";
+ _$('bg_transparent').style.display='';
+ _$('addrule').disabled =1;
}
function parsepattern(a,e){
 -344,7
+327,7 
temp = temp.slice(0, -1);
returnstring = "or more";
if(e == 1)
- $('ormore').checked = true;
+ _$('ormore').checked = true;
}
var posofx = temp.indexOf('X');
//alert("position of X in " + temp + " is
" + posofx );
 -352,254
+335,254 
// if X happens somewhere then beginswith = string till
somewhere
// and followedby = length of string from somewhere till
end
if(posofx == -1){
- if(returnstring == "or more"){
- returnstring = "Begins with " + temp + "
and followed by 0 or more digits" ;
- }else{
- returnstring = "Exactly macthes " + temp ;
- }
- if(e == 1){
- $('beginswith').value = temp;
- $('followedby').value = 0;
- }
+ if(returnstring == "or more"){
+ returnstring = "Begins with " + temp + "
and followed by 0 or more digits" ;
+ }else{
+ returnstring = "Exactly macthes " + temp ;
+ }
+ if(e == 1){
+ _$('beginswith').value = temp;
+ _$('followedby').value = 0;
+ }
}else{
- if(returnstring == "or more"){
- returnstring = "Begins with " +
temp.substr(0,posofx) + " and followed by
"+(temp.length - posofx)+" or more digits" ;
- }else{
- returnstring = "Begins with " +
temp.substr(0,posofx) + " and followed by
"+(temp.length - posofx) + " digits";
- }
- if(e == 1){
- $('beginswith').value = temp.substr(0,posofx);
- $('followedby').value = (temp.length - posofx);
- }
+ if(returnstring == "or more"){
+ returnstring = "Begins with " +
temp.substr(0,posofx) + " and followed by
"+(temp.length - posofx)+" or more digits" ;
+ }else{
+ returnstring = "Begins with " +
temp.substr(0,posofx) + " and followed by
"+(temp.length - posofx) + " digits";
+ }
+ if(e == 1){
+ _$('beginswith').value = temp.substr(0,posofx);
+ _$('followedby').value = (temp.length - posofx);
+ }
}
return returnstring;
}
function ownpattern(){
- iscustom = true;
- $('define_advanced').style.display="";
- $('define_usual').style.display="none";
+ iscustom = true;
+ _$('define_advanced').style.display="";
+ _$('define_usual').style.display="none";
}
function enablesave(){
- $('save_a').disabled = 0;
+ _$('save_a').disabled = 0;
return true;
}
function add_callingrule(){
isnewrule = true;
- $('rulename').value = "";
- $('trunks').selectedIndex = -1 ;
- $('pattern').value = "";
- $('strip').value = "0" ;
- $('save_a').disabled = 1;
- $('define_advanced').style.display="none";
- $('define_usual').style.display="";
- $('userscontent').style.display="";
- $('bg_transparent').style.display='';
- $('addrule').disabled =1;
- $('beginswith').value = "";
- $('followedby').value ="";
- $('ormore').checked = false;
-}
-
-
+ _$('rulename').value = "";
+ _$('trunks').selectedIndex = -1 ;
+ _$('pattern').value = "";
+ _$('strip').value = "0" ;
+ _$('save_a').disabled = 1;
+ _$('define_advanced').style.display="none";
+ _$('define_usual').style.display="";
+ _$('userscontent').style.display="";
+ _$('bg_transparent').style.display='';
+ _$('addrule').disabled =1;
+ _$('beginswith').value = "";
+ _$('followedby').value ="";
+ _$('ormore').checked = false;
+}
function add_rule_fromeditform( this_priority, oncomplete
){
- if( iscustom ){ // custom - take pattern as is
- var commentstring = "custom";
- }else{
- var commentstring = "standard";
- //build a pattern into $('pattern').value
- buildpatternstring();
- }
-
- var rule_string = $('pattern').value + ',' +
this_priority + ',Macro(trunkdial,${' + $('trunks').value +
'}/${EXTEN:' + $('strip').value + '})' ;
- var uri = build_action('append', 0 ,
"numberplan-custom-1" ,"exten",
rule_string );
- commentstring = $('pattern').value + ',' +
this_priority + ',' + $('rulename').value + "," +
commentstring ;
- uri += build_action('append', 1 ,
"numberplan-custom-1" ,"comment",
commentstring );
-
- var opt = {
- method: 'get',
- asynchronous: true,
- onSuccess: function(t) { oncomplete(); },
- onFailure: function(t) {
- alert("Config Error: " + t.status +
": " + t.statusText);
- }
- };
- opt.parameters=
"action=updateconfig&srcfilename=" +
encodeURIComponent("extensions.conf") +
"&dstfilename=" +
encodeURIComponent("extensions.conf") + uri;
- $('userscontent').style.display="none";
- $('bg_transparent').style.display='none';
- $('status_message').style.display="block";
- var tmp = new Ajax.Request(rawman_url, opt);
+ if( iscustom ){ // custom - take pattern as is
+ var commentstring = "custom";
+ }else{
+ var commentstring = "standard";
+ //build a pattern into $('pattern').value
+ buildpatternstring();
+ }
+
+ var rule_string = _$('pattern').value + ',' +
this_priority + ',Macro(trunkdial,${' + $('trunks').value +
'}/${EXTEN:' + $('strip').value + '})' ;
+ var uri = build_action('append', 0 ,
"numberplan-custom-1" ,"exten",
rule_string );
+ commentstring = _$('pattern').value + ',' + this_priority
+ ',' + _$('rulename').value + "," + commentstring
;
+ uri += build_action('append', 1 ,
"numberplan-custom-1" ,"comment",
commentstring );
+
+ var opt = {
+ method: 'get',
+ asynchronous: true,
+ onSuccess: function(t) { oncomplete(); },
+ onFailure: function(t) {
+ alert("Config Error: " + t.status + ":
" + t.statusText);
+ }
+ };
+ opt.parameters=
"action=updateconfig&srcfilename=" +
encodeURIComponent("extensions.conf") +
"&dstfilename=" +
encodeURIComponent("extensions.conf") + uri;
+ _$('userscontent').style.display="none";
+ _$('bg_transparent').style.display='none';
+ _$('status_message').style.display='';
+ var tmp = new Ajax.Request(rawman_url, opt);
}
function saverule(){
if ( !checkfields() ) return false;
if(isnewrule){ // add this rule to the default plan and
reload the page
- var newpriority=1;
- if( typeof default_np_data[$('pattern').value]
!="undefined" ){
- for ( var y in default_np_data[$('pattern').value]
){
- if ( y == "extend"){break;}
- newpriority++;
- }
- }
- add_rule_fromeditform( newpriority, oncomplete =
function(){location.reload();} );
+ var newpriority=1;
+ if( typeof default_np_data[$('pattern').value]
!="undefined" ){
+ var t = _$('pattern').value;
+ for ( var y in default_np_data[t] ){
+ if(default_np_data[t].hasOwnProperty(y) ){
newpriority++; }
+ }
+ }
+ add_rule_fromeditform( newpriority, oncomplete =
function(){location.reload();} );
}else{ // update exiting rule
- // delete existing rule
- // add rule with new values
- delete_callingrule(pattern_beingedited,pattern_beingedit
ed_priority, oncomplete = function(){location.reload();} )
;
- add_rule_fromeditform( pattern_beingedited_priority,
oncomplete = function(){location.reload();} );
-
- //$('userscontent').style.display='none';
- //$('addrule').disabled =0;
- //return true;
+ // delete existing rule
+ // add rule with new values
+ delete_callingrule(pattern_beingedited,pattern_beingedite
d_priority, oncomplete = function(){location.reload();} );
+ add_rule_fromeditform( pattern_beingedited_priority,
oncomplete = function(){location.reload();} );
+
+ //$('userscontent').style.display='none';
+ //$('addrule').disabled =0;
+ //return true;
}
}
function buildpatternstring(){
- var pattern = $('beginswith').value;
+ var pattern = _$('beginswith').value;
// Add an underscore
pattern = "_" + pattern;
// append 'followedby' number of X's
- for (var r=0; r < $('followedby').value ; r++){
+ for (var r=0; r < _$('followedby').value ; r++){
pattern = pattern + "X" ;
}
// append a '.' if 'ormore' is checked
- if( $('ormore').checked ){
- pattern = pattern + "." ;
+ if( _$('ormore').checked ){
+ pattern = pattern + "." ;
}
// assign this to the field 'pattern'
- $('pattern').value = pattern;
+ _$('pattern').value = pattern;
}
function checkfields(){
- if( $('rulename').value.length == 0 ){
+ if( _$('rulename').value.length == 0 ){
alert("Please enter a Rule Name");
- $('rulename').focus();
+ _$('rulename').focus();
return false;
}
- if($('trunks').selectedIndex == -1){
+ if(_$('trunks').selectedIndex == -1){
alert("Please select a service provider to place
this call through");
return false;
}
- if($('define_advanced').style.display=="none"
&& $('beginswith').value.length==0 ){
+ if(_$('define_advanced').style.display=="none"
&& _$('beginswith').value.length==0 ){
alert("Please Enter the beginning pattern of the
number");
- $('beginswith').focus();
+ _$('beginswith').focus();
return false;
}
- if($('define_usual').style.display=="none"
&& $('pattern').value.length == 0 ){
+ if(_$('define_usual').style.display=="none"
&& _$('pattern').value.length == 0 ){
alert("Please Enter a custom pattern");
- $('pattern').focus();
+ _$('pattern').focus();
return false;
}
return true;
}
-//-->
+
</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
class="slselected">Calling
Rules</td></tr>
- <tr><td></td><td>VoiceMail
Settings</td></tr>
- <tr><td></td><td>User
Extensions</td></tr>
- <tr><td></td><td>Incoming
Calls</td></tr>
- <!--
<tr><td></td><td>VoiceMenus</td&g
t;</tr> -->
- <tr><td></td><td>Finish</t
d></tr>
- </table>
- </div>
- </td>
- <td valign=top align=center>
- <!-- this page -->
- <select id="extensions"
style="display:none"></select>
- <div class="heading">Step 4 of
<script>document.write(parent.numberofsteps);</scri
pt> - Outbound Calling
Rules</div>
- <table class="table_blacksm" cellpadding=2
cellspacing=2 border=0 align=center width=500
id="table_one">
- <tr> <td width=35>S.No</td>
- <td width=90>RuleName</td>
- <td>Dial Pattern</td>
- <td width=85 align=center>Call
Using</td>
- <td width=75 align=center>Options</td>
- </tr>
+<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
class="slselected">Calling
Rules</td></tr>
+ <tr><td></td><td>VoiceMail
Settings</td></tr>
+ <tr><td></td><td>User
Extensions</td></tr>
+ <tr><td></td><td>Incoming
Calls</td></tr>
+ <!--
<tr><td></td><td>VoiceMenus</td&g
t;</tr> -->
+ <tr><td></td><td>Finish</td>
;</tr>
+ </table>
+ </div>
+</td>
+<td valign=top align=center>
+<!-- this page -->
+ <select id="extensions"
style="display:none"></select>
+ <div class="heading">Step 4 of
<script>document.write(parent.numberofsteps);</scri
pt> - Outbound Calling
Rules</div>
+ <table class="table_blacksm" cellpadding=2
cellspacing=2 border=0 align=center width=500
id="table_one">
+ <tr> <td width=35>S.No</td>
+ <td width=90>RuleName</td>
+ <td>Dial Pattern</td>
+ <td width=85 align=center>Call Using</td>
+ <td width=75 align=center>Options</td>
+ </tr>
+ </table>
+
+ <div id="callingRulesTable_div"
style="height:250px;width=100%; overflow :auto; padding
: 0px 0px 0px 0px;">
+ <table id="callingRulesTable" cellpadding=2
cellspacing=1 border=0 align=center
width=500></table>
+ </div>
+
+ <center><div style="height:25px;color:
#FF0000;" id='status'
class="field_text9"></div></center>
+ <BR>
+ <center><input type="button"
id="addrule" value="Add a Calling Rule"
onclick="add_callingrule();"></center>
+
+ <div id="userscontent"
STYLE="display:none; position: absolute; left: 225;
top: 40; width:500; height:290; 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 ,
'userscontent');">
+ <TR bgcolor="#7E5538" >
+ <TD Height="20" align="right"
style="cursor: move">
+ <A href="#"
onclick="$('cancel_a').click();"><font
style="color:#FFFFFF; font-size: 12px;
font-weight:bold;">X</font></A>
+ </TD>
+ <TD width=4></TD>
+ </TR>
+ </table>
+
+ <TABLE align=center cellpadding=2 cellspacing=2
border=0 width="480">
+ <TR> <TD align="right" width=175
class="field_text">Rule Name:</TD>
+ <TD><input type="text"
id="rulename" size=""
onChange="enablesave();"
onkeyup="enablesave();"></TD>
+ </TR>
+ <TR> <TD align="right" height=40
class="field_text"> Place this call through
:</TD>
+ <TD><select
id="trunks"></select></TD>
+ </TR>
+ <TR id="define_usual" height=100>
+ <TD valign="top" align=right
class="field_text">Dialing Rules :</TD>
+ <TD valign="top"
class="field_text">
+ If the number begins with <input
id="beginswith" type='text' size=6
onChange="enablesave();"
onkeyup="enablesave();">
+ and followed by <input id="followedby"
type='text' size=1 onChange="enablesave();"
onkeyup="enablesave();">
+ digits <input type="checkbox"
id="ormore" onChange="enablesave();">
or more
+ <BR> <A href="#"
onclick="ownpattern();">(define a custom
pattern)</A>
+ </TD>
+ </TR>
+
+ <TR id="define_advanced" height=100>
+ <TD valign="top" align=right
class="field_text"> Custom Pattern:
</TD>
+ <TD valign=top>
+ <input type="text" id="pattern"
size="" onChange="enablesave();"
onkeyup="enablesave();"><BR>
+ <table align='left' cellpadding=0 cellspacing=0>
+ <tr> <td
class="field_text"><b>N &nbs
p;</b></td>
+ <td class="field_text">Any digit from 2
to 9</td>
+ </tr>
+ <tr> <td
class="field_text"><b>X &nbs
p;</b></td>
+ <td class="field_text">Any digit from 0
to 9</td>
+ </tr>
+ <tr> <td
class="field_text"><b>. &nbs
p;</b></td>
+ <td class="field_text">Any number of
additional digits</td>
+ </tr>
</table>
- <div id="callingRulesTable_div"
style="height:250px;width=100%; overflow :auto; padding
: 0px 0px 0px 0px;">
- <table id="callingRulesTable"
cellpadding=2 cellspacing=1 border=0 align=center
width=500></table>
- </div>
-
-<center><div style="height:25px;color:
#FF0000;" id='status'
class="field_text9"></div></center>
- <BR>
- <center><input type="button"
id="addrule" value="Add a Calling Rule"
onclick="add_callingrule();"></center>
-
- <div id="userscontent"
STYLE="display:none; position: absolute; left: 225;
top: 40; width:500; height:290; 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 ,
'userscontent');">
- <TR bgcolor="#7E5538" ><TD
Height="20" align="right"
style="cursor: move">
- <A href="#"
onclick="$('cancel_a').click();"><font
style="color:#FFFFFF; font-size: 12px;
font-weight:bold;">X</font></A>
- </TD>
- <TD width=4></TD>
- </TR>
- </table>
-
- <TABLE align=center cellpadding=2 cellspacing=2
border=0 width="480">
- <TR>
- <TD align="right" width=175
class="field_text">Rule Name:</TD>
- <TD><input type="text"
id="rulename" size=""
onChange="enablesave();"
onkeyup="enablesave();"></TD>
- </TR>
- <TR>
- <TD align="right" height=40
class="field_text"> Place this call through
:</TD>
- <TD><select
id="trunks"></select></TD>
- </TR>
- <TR id="define_usual" height=100>
- <TD valign="top" align=right
class="field_text">Dialing Rules :</TD>
- <TD valign="top"
class="field_text"> If the number begins with
<input id="beginswith" type='text' size=6
onChange="enablesave();"
onkeyup="enablesave();"> and
- followed by <input id="followedby"
type='text' size=1 onChange="enablesave();"
onkeyup="enablesave();"> digits <input
type="checkbox" id="ormore"
onChange="enablesave();"> or more <BR>
- <A href="#"
onclick="ownpattern();">(define a custom
pattern)</A>
- </TD>
- </TR>
-
- <TR id="define_advanced" height=100>
- <TD valign="top" align=right
class="field_text">
- Custom Pattern:
- </TD>
- <TD valign=top>
- <input type="text" id="pattern"
size="" onChange="enablesave();"
onkeyup="enablesave();"><BR>
- <table align='left' cellpadding=0
cellspacing=0>
- <tr><td
class="field_text"><b>N &nbs
p;</b></td><td
class="field_text">Any digit from 2 to
9</td></tr>
- <tr><td
class="field_text"><b>X &nbs
p;</b></td><td
class="field_text">Any digit from 0 to
9</td></tr>
- <tr><td
class="field_text"><b>. &nbs
p;</b></td><td
class="field_text">Any number of additional
digits</td></tr>
- </table>
- </TD>
- </TR>
-
- <TR>
- <TD colspan=2 align=center
class="field_text">Strip <input
type="text" id="strip"
size="1" onChange="enablesave();"
onkeyup="enablesave();"> digits from the front
before dialing:</TD>
- </TR>
- <TR>
- <TD colspan=2 align=center height=50
valign=middle>
- <input type="button"
id="save_a" value="Save"
onclick="saverule();">
- <input type="button"
id="cancel_a" value="Cancel"
onclick="$('userscontent').style.display='none';
$('bg_transparent').style.display='none';
$('addrule').disabled =0; " >
- </TD>
- </TR>
- </TABLE>
-
- </div>
- <!-- this page -->
- </td>
- </tr>
+ </TD>
+ </TR>
+
+ <TR> <TD colspan=2 align=center
class="field_text">
+ Strip <input type="text"
id="strip" size="1"
onChange="enablesave();"
onkeyup="enablesave();">
+ digits from the front before dialing:
+ </TD>
+ </TR>
+ <TR> <TD colspan=2 align=center height=50
valign=middle>
+ <input type="button" id="save_a"
value="Save"
onclick="saverule();">
+ <input type="button"
id="cancel_a" value="Cancel"
onclick="$('userscontent').style.display='none';
$('bg_transparent').style.display='none';
$('addrule').disabled =0; " >
+ </TD>
+ </TR>
+ </TABLE>
+ </div>
+<!-- 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>
-<SCRIPT LANGUAGE="JavaScript">
-<!--
-showdiv_statusmessage();
-//-->
-</SCRIPT>
</BODY>
-</HTML>
+</HTML>
Propchange: branches/asterisknow/
------------------------------------------------------------
------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Mar 29 16:06:42 2007
 -1,1
+1,1 
-/trunk:1-448,501-505,507,511-512,519,532,536,538,543,545,54
7
+/trunk:1-448,501-505,507,511-512,519,532,536,538,543,545,54
7,549
Modified: branches/asterisknow/config/setup/5.html
URL: http://svn.digium.com/view/asterisk-gui/branches
/asterisknow/config/setup/5.html?view=diff&rev=550&r
1=549&r2=550
============================================================
==================
--- branches/asterisknow/config/setup/5.html (original)
+++ branches/asterisknow/config/setup/5.html Thu Mar 29
16:06:42 2007
 -20,14
+20,12 
*
-->
<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 trunks_desc = new Object;
var trunkcallbacks = new Object;
 -43,47
+41,45 
var oldselect;
function localinit(){
+ showdiv_statusmessage();
//parent.$('next').disabled = true;
- parent.$('next').onclick = function(){
window.location.href="6.html"; };
- parent.$('back').disabled = false;
- parent.$('back').onclick = function(){
window.location.href="4.html"; };
+ parent._$('next').onclick = function(){
window.location.href="6.html"; };
+ parent._$('back').disabled = false;
+ parent._$('back').onclick = function(){
window.location.href="4.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") ) {
- $('message_text').innerHTML ="Saving
Changes...";
- parent.astmanEngine.config2list("users.conf",
$('trunks'), new Array(), trunkcallbacks);
- }
-}
-
-
-
+ 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")
) {
+ _$('message_text').innerHTML ="Saving
Changes...";
+ parent.astmanEngine.config2list("users.conf",
_$('trunks'), new Object(), trunkcallbacks);
+ }
+}
function addthe_default_callingplan(){
t=confirm("A default Dial Plan is not found. n"
+ " Do you want to create a default Dial Plan ");
if(t == false){
- $('status').innerHTML = "A default DialPlan is not
found !! "
+ _$('status').innerHTML = "A default DialPlan is not
found !! "
+ "<BR> <A href="#"
onclick="addthe_default_callingplan()">click
here</A> to create a default Dial plan";
- $('addrule').disabled = 1;
- return true;
[... 826 lines stripped ...]
_______________________________________________
asterisk-gui-commits mailing list
asterisk-gui-commits lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-g
ui-commits
|