pari: trunk r212 - in /trunk/config: setup/2.html setup/4.html trunks.html

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Thu Jan 4 11:28:17 MST 2007


Author: pari
Date: Thu Jan  4 12:28:16 2007
New Revision: 212

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=212
Log:
Service Providers -> minor fixes

Modified:
    trunk/config/setup/2.html
    trunk/config/setup/4.html
    trunk/config/trunks.html

Modified: trunk/config/setup/2.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/setup/2.html?view=diff&rev=212&r1=211&r2=212
==============================================================================
--- trunk/config/setup/2.html (original)
+++ trunk/config/setup/2.html Thu Jan  4 12:28:16 2007
@@ -86,7 +86,7 @@
 		var timeofday = temp[3]; // 23:59:59
 		var timezone = temp[4]; // CST
 		var year = temp[5]; // 2006
-		
+
 		for(var i=0; i < $('moy').length; i++){
 			if ( $('moy').options[i].value.toLowerCase() == monthofyear.toLowerCase() ){
 					$('moy').selectedIndex = i;
@@ -130,8 +130,6 @@
 						}
 				}
 		}
-
-
 		
 		for(var i=0; i < $('minute').length; i++){
 					if (  $('minute').options[i].value == parseFloat(temp[1])  ){
@@ -142,6 +140,12 @@
 		for(var i=0; i < $('second').length; i++){
 					if (  $('second').options[i].value == parseFloat(temp[2])  ){
 							$('second').selectedIndex = i;
+							break;
+					}
+		}
+		for(var i=0; i < $('year').length; i++){
+					if (  $('year').options[i].value == parseFloat(year)  ){
+							$('year').selectedIndex = i;
 							break;
 					}
 		}

Modified: trunk/config/setup/4.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/setup/4.html?view=diff&rev=212&r1=211&r2=212
==============================================================================
--- trunk/config/setup/4.html (original)
+++ trunk/config/setup/4.html Thu Jan  4 12:28:16 2007
@@ -22,7 +22,40 @@
 			'insecure', 'host', 'fromuser', 'fromdomain');
 			
 var provfieldnames = new Array('providerdesc', 'providerlogo');
-
+var isnewtrunk;
+
+	function add_didcontext(trunk){
+		var didcontext = "DID_" + trunk ;
+		var uri = build_action('newcat', 0, didcontext ,"", "");
+		uri += build_action('append', 1, didcontext ,"include", "default"); 
+		var opt = {
+			method: 'get',
+			asynchronous: true,
+			onSuccess: function(t) { },
+			onFailure: function(t) {
+				alert("Config Error: " + t.status + ": " + t.statusText);
+				alert("Failed to create a DID context for " + trunk);
+			}
+		};
+		opt.parameters= "action=updateconfig&reload=yes&srcfilename=" + encodeURIComponent("extensions.conf") + "&dstfilename=" + encodeURIComponent("extensions.conf") + uri;
+		var tmp = new Ajax.Request(rawman_url, opt);
+	}
+
+	function delete_didcontext(trunk){
+		var didcontext = "DID_" + trunk ;
+		var uri = build_action('delcat', 0, didcontext ,"", "");
+		var opt = {
+			method: 'get',
+			asynchronous: true,
+			onSuccess: function(t) { },
+			onFailure: function(t) {
+				alert("Config Error: " + t.status + ": " + t.statusText);
+				alert("Failed to delete DID context for " + trunk);
+			}
+		};
+		opt.parameters= "action=updateconfig&reload=yes&srcfilename=" + encodeURIComponent("extensions.conf") + "&dstfilename=" + encodeURIComponent("extensions.conf") + uri;
+		var tmp = new Ajax.Request(rawman_url, opt);
+	}
 
 
 
@@ -144,6 +177,7 @@
 
 	callbacks.delchanges = function(box, value) {
 		deletesp_fromui(value);
+		delete_didcontext(value);
 		var oldvalue = $('hiddenglobals').stored_config.catbyname['globals'].fieldbyname[value];
 		if (oldvalue) {
 			uri = build_action('delete', 0, 'globals', value, "");
@@ -160,6 +194,9 @@
 	}
 
 	callbacks.savechanges = function() {
+		if(isnewtrunk ==1){ //New Trunk created , add [DID_trunk_x] in extensions.conf
+			add_didcontext($('devices').value);
+		}
 		saveSPdetails();
 		var uri;
 		var newvalue;
@@ -317,7 +354,11 @@
 		$('customvoip_secret').value = "";
 		$('customvoip_protocol').selectedIndex = 0;
 		$('customvoip_host').value ="";
-
+		$('analog').style.display="none";
+		$('voip').style.display="none";
+		$('customvoip').style.display="none";
+		$('userscontent_title').innerHTML = "Add Service Provider";
+		isnewtrunk = 1;
 		return tmp;
 
 	}
@@ -351,14 +392,15 @@
 
 
 	function activateanalogvoip() {
+		$('analog').style.display = "none";
+		$('zapchan').style.display = "none";
+		$('zapchan_analoglines').style.display = "none";
+		$('zapchan_analoglines').innerHTML ="";
+		$('customvoip').style.display = "none" ;
+		$('voip').style.display= "none";
 		if ($('trunkstyleanalog').checked) {
 				$('analog').style.display = "block";
-				$('zapchan').style.display = "none";
 				$('zapchan_analoglines').style.display = "block";
-				$('zapchan_analoglines').innerHTML ="";
-				$('customvoip').style.display = "none" ;
-				$('voip').style.display= "none";
-
 				if($('zapchan').options.length ==0){
 					$('zapchan_analoglines').innerHTML = "No analog line hardware installed on the system";
 				}else{
@@ -373,20 +415,10 @@
 				}
 		}else if ($('trunkstylevoip').checked) {
 				$('voip').style.display = "block";
-				$('analog').style.display = 'none'; 
 				$('voip').style.height =350;
-				$('zapchan_analoglines').style.display = "none";
-				$('zapchan_analoglines').innerHTML ="";		
-				$('customvoip').style.display = "none" ;
 		}else if ($('trunkstylecustomvoip').checked) {
-				$('analog').style.display= "none";
-				$('voip').style.display= "none";
 				$('customvoip').style.display = "block" ;
-				$('zapchan_analoglines').style.display = "none";
-				$('zapchan_analoglines').innerHTML ="";
-		}
-
-			
+		}
 	}
 	
 	function localajaxinit() {
@@ -479,6 +511,8 @@
 }
 
 function editSP(sp_value){
+	isnewtrunk = 0;
+	$('userscontent_title').innerHTML = "Edit Service Provider";
 	for(var i=0; i< $('devices').length; i++){
 			if(sp_value == $('devices').options[i].value ){
 					$('devices').selectitem(i);
@@ -569,11 +603,10 @@
 </center>
 
 <div id="userscontent" STYLE="display:none; position: absolute; left: 230; top: 5; width:500; height:375;  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').click();"><font style="color:#FFFFFF; font-size: 12px; font-weight:bold;">X</font></A>
-				</TD>
-				<TD width=4></TD>
+	<table width="100%" cellpadding=0 cellspacing=0>
+		<TR bgcolor="#7E5538" >
+				<TD  onmousedown="startDrag(event , 'userscontent');" id="userscontent_title" style="cursor: move;color:#FFFFFF; font-size: 12px; font-weight:bold;" align="center"></TD>
+				<TD Height="20" width=15 align="center"  style="color:#FFFFFF; font-size: 12px; font-weight:bold;" onclick="$('cancel').click();">X</TD>
 		</TR>
 	</table>
 

Modified: trunk/config/trunks.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/trunks.html?view=diff&rev=212&r1=211&r2=212
==============================================================================
--- trunk/config/trunks.html (original)
+++ trunk/config/trunks.html Thu Jan  4 12:28:16 2007
@@ -326,6 +326,10 @@
 		$('customvoip_secret').value = "";
 		$('customvoip_protocol').selectedIndex = 0;
 		$('customvoip_host').value ="";
+		$('analog').style.display="none";
+		$('voip').style.display="none";
+		$('customvoip').style.display="none";
+		$('userscontent_title').innerHTML = "Add Service Provider";
 		isnewtrunk = 1;
 		return tmp;
 
@@ -360,14 +364,16 @@
 
 
 	function activateanalogvoip() {
+		$('analog').style.display = "none";
+		$('zapchan').style.display = "none";
+		$('zapchan_analoglines').style.display = "none";
+		$('zapchan_analoglines').innerHTML ="";
+		$('customvoip').style.display = "none" ;
+		$('voip').style.display= "none";
+
 		if ($('trunkstyleanalog').checked) {
 				$('analog').style.display = "block";
-				new Rico.Effect.Size('analog', null, 350, 120, 8);
-				$('zapchan').style.display = "none";
 				$('zapchan_analoglines').style.display = "block";
-				$('zapchan_analoglines').innerHTML ="";
-				$('customvoip').style.display = "none" ;
-
 				if($('zapchan').options.length ==0){
 					$('zapchan_analoglines').innerHTML = "No analog line hardware installed on the system";
 				}else{
@@ -382,20 +388,10 @@
 				}
 		}else if ($('trunkstylevoip').checked) {
 				$('voip').style.display = "block";
-				new Rico.Effect.Size('analog', null, 1, 120, 8, {complete:function() { $('analog').style.height = '0'; }});
 				$('voip').style.height =350;
-				$('zapchan_analoglines').style.display = "none";
-				$('zapchan_analoglines').innerHTML ="";		
-				$('customvoip').style.display = "none" ;
 		}else if ($('trunkstylecustomvoip').checked) {
-				$('analog').style.display= "none";
-				$('voip').style.display= "none";
 				$('customvoip').style.display = "block" ;
-				$('zapchan_analoglines').style.display = "none";
-				$('zapchan_analoglines').innerHTML ="";
-		}
-
-			
+		}
 	}
 	
 	function localajaxinit() {
@@ -489,6 +485,7 @@
 
 function editSP(sp_value){
 	isnewtrunk = 0;
+	$('userscontent_title').innerHTML = "Edit Service Provider";
 	for(var i=0; i< $('devices').length; i++){
 			if(sp_value == $('devices').options[i].value ){
 					$('devices').selectitem(i);
@@ -566,11 +563,10 @@
 </center>
 
 <div id="userscontent" STYLE="display:none; position: absolute; left: 20; top: 40; width:500; height:400;  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').click();"><font style="color:#FFFFFF; font-size: 12px; font-weight:bold;">X</font></A>
-				</TD>
-				<TD width=4></TD>
+	<table width="100%" cellpadding=0 cellspacing=0>
+		<TR bgcolor="#7E5538" >
+				<TD  onmousedown="startDrag(event , 'userscontent');" id="userscontent_title" style="cursor: move;color:#FFFFFF; font-size: 12px; font-weight:bold;" align="center"></TD>
+				<TD Height="20" width=15 align="center"  style="color:#FFFFFF; font-size: 12px; font-weight:bold;" onclick="$('cancel').click();">X</TD>
 		</TR>
 	</table>
 
@@ -578,7 +574,7 @@
 <tr>
 <td onmouseover="show_tooltip('en', 'trunks', 0);"  class="field_text" width=130 valign="top" align="left">
 <!-- Provider type -->
-				<div id='cabinet' style='height:0;width:0;overflow:hidden'><select id='hiddenglobals'></select></div>
+				<div id='cabinet' style='width:0;overflow:hidden'><select id='hiddenglobals'></select></div>
 				<B>Provider Type:</B><BR>
 				<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>
@@ -588,7 +584,7 @@
 <td>
 <!-- Provider options -->
 			<div id='analogvoipcontainer' style='height:350;overflow:hidden' align="center">
-			<div id='analog' style='height:0;overflow:hidden' align="center">
+			<div id='analog' style='overflow:hidden' align="center">
 							<table align="center">
 							<tr onmouseover="show_tooltip('en', 'trunks', 2);"><td style='width:80px' valign='top' class="field_text">Lines:</td>
 									<td><select size="12" multiple='true' id='zapchan' style='width:200px' class="input8"></select>



More information about the asterisk-gui-commits mailing list