pari: trunk r271 - in /trunk/config: ./ setup/

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Fri Jan 19 13:46:28 MST 2007


Author: pari
Date: Fri Jan 19 14:46:27 2007
New Revision: 271

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=271
Log:
tweaks: display no calling rules message in outgoing calls  and incoming calling rules pages

Modified:
    trunk/config/incoming.html
    trunk/config/numberplan.html
    trunk/config/setup/5.html
    trunk/config/trunks.html

Modified: trunk/config/incoming.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/incoming.html?view=diff&rev=271&r1=270&r2=271
==============================================================================
--- trunk/config/incoming.html (original)
+++ trunk/config/incoming.html Fri Jan 19 14:46:27 2007
@@ -113,6 +113,16 @@
 					addrowtotable( j, i, didtrunks[i][j].action, didtrunks[i][j].priority);
 			}
 	}
+
+	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>An <I>incoming Calling Rule</I> is not defined<BR><BR> Please click on 'Add a Incoming Rule' button<BR> to add a new incoming call rule.<BR><BR>" ;
+		return true;
+	}
+
 }
 
 function addrowtotable(a,b,c,d){	// a is pattern, b is DID_trunk, c is action, d is priority

Modified: trunk/config/numberplan.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/numberplan.html?view=diff&rev=271&r1=270&r2=271
==============================================================================
--- trunk/config/numberplan.html (original)
+++ trunk/config/numberplan.html Fri Jan 19 14:46:27 2007
@@ -142,6 +142,7 @@
 	}
 	// now show this object in a table.
 	var rules_nosp = new Array ;
+
 	for( var x in  default_np_data ){	// x is the pattern
 			// sort the priorities
 			if ( x == "extend"){ break;}
@@ -153,6 +154,7 @@
 			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;
@@ -180,6 +182,15 @@
 	if(rules_nosp.length > 0 ){
 		$('status').innerHTML = "Note: A Service Provider is not defined for the Rules <BR>" + rules_nosp ;
 		$('trunks').selectedIndex = -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>" ;
+		return true;
 	}
 }
 

Modified: trunk/config/setup/5.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/setup/5.html?view=diff&rev=271&r1=270&r2=271
==============================================================================
--- trunk/config/setup/5.html (original)
+++ trunk/config/setup/5.html Fri Jan 19 14:46:27 2007
@@ -189,9 +189,17 @@
 				}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);
+		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>" ;
+		return true;
+	}
 }
 
 numplan_callbacks.eachline = true;

Modified: trunk/config/trunks.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/trunks.html?view=diff&rev=271&r1=270&r2=271
==============================================================================
--- trunk/config/trunks.html (original)
+++ trunk/config/trunks.html Fri Jan 19 14:46:27 2007
@@ -197,6 +197,10 @@
 
 	callbacks.beforeSaving = function(){
 			if(isnewtrunk ==1){
+				provider = $('provider').stored_config.catbyname[$('provider').value];		
+				if( typeof provider.fieldbyname['trunk_username'] != "undefined" ){
+					$('name').value = provider.fieldbyname['trunk_username'];
+				}
 				dids_array.push($('name').value );
 			}else{
 					old_trunkname = $('devices').value ;
@@ -579,6 +583,12 @@
 		$('cancel').disabled = false;
 		$('userscontent').style.display = "block";
 		$('bg_transparent').style.display ='';
+		if ( isnewtrunk == 0){
+			$('trunkstyleanalog').disabled = true;
+			$('trunkstylevoip').disabled = true;
+			$('trunkstylecustomvoip').disabled = true;
+			$('provider').disabled = true;
+		}
 }
 
 function deleteSP(trunk){
@@ -662,10 +672,11 @@
 				<LABEL FOR="trunkstyleanalog"><input name='trunkstyle' type='radio' id='trunkstyleanalog' onclick='activateanalogvoip()' value='analog'>Analog</LABEL><BR>
 				<LABEL FOR="trunkstylevoip"><input name='trunkstyle' type='radio' id='trunkstylevoip' onclick='activateanalogvoip()' value='voip'>VoIP</LABEL><BR>
 				<LABEL FOR="trunkstylecustomvoip"><input name='trunkstyle' type='radio' id='trunkstylecustomvoip' onclick='activateanalogvoip()' value='customvoip'>Custom VoIP</LABEL>
-
+				<div id="div_providername" style="display:none">
 				<BR><BR>
 				<B>Provider Name:</B><BR>
 				<input id="name" size=10 class='input8'>
+				</div>
 <!-- Provider type -->
 </td>
 <td>
@@ -685,7 +696,7 @@
 						<table align="center">
 						<tr  onmouseover="show_tooltip('en', 'trunks', 1);"><td style='width:80px' valign='top' class="field_text">Provider:</td><td><select size='6' id='provider' style='width:200px' altonchange='selectprovider()' class="input8"></select></td></tr>
 						<tr><td colspan='2' align='center'><div style="height:15px" id='status'></div></td></tr>
-						<tr><td colspan='2' align='center'><img id='providerlogo' style='visibility:hidden;width:214px;height:46px'></td></tr>
+						<tr><td colspan='2' align='center'><img id='providerlogo' style='visibility:hidden;'></td></tr>
 						<tr><td colspan='2' align='center'><div id='providerdesc' align='left' style='width:230px;height:100px; font-size:10px'></div></td></tr>
 						<tr onmouseover="show_tooltip('en', 'trunks', 3);"><td class="field_text">Username:</td><td><input size='20' id='username' class="input8"></td></tr>
 						<tr onmouseover="show_tooltip('en', 'trunks', 4);"><td class="field_text">Password:</td><td><input size='20' id='secret' class="input8"></td></tr>



More information about the asterisk-gui-commits mailing list