pari: trunk r138 - /trunk/config/trunks.html

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Thu Nov 30 17:55:57 MST 2006


Author: pari
Date: Thu Nov 30 18:55:56 2006
New Revision: 138

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=138
Log:
Graceful handling of case where no analog lines are installed

Modified:
    trunk/config/trunks.html

Modified: trunk/config/trunks.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/trunks.html?view=diff&rev=138&r1=137&r2=138
==============================================================================
--- trunk/config/trunks.html (original)
+++ trunk/config/trunks.html Thu Nov 30 18:55:56 2006
@@ -189,6 +189,11 @@
 							$('group').value = '';
 		} else if ($('trunkstyleanalog').checked) {
 				// Analog
+						if( $('zapchan').options.length ==0){
+							alert("No analog line hardware installed on the system");
+							return true;
+						}
+
 						if (!$('zapchan').value) {
 							alert("When using Analog, at least one port must be selected.");
 							return true;
@@ -304,12 +309,17 @@
 				$('zapchan_analoglines').style.display = "block";
 				$('zapchan_analoglines').innerHTML ="";
 				$('customvoip').style.display = "none" ;
-				for (k=0;k< $('zapchan').length ;k++ ){
-						var selectedline = "selectedline" + k;
-						if($('zapchan').options[k].selected){
-							$('zapchan_analoglines').innerHTML += '<INPUT id="' + selectedline + '" TYPE="CHECKBOX" VALUE="'+ $('zapchan').options[k].value+ '" checked onclick="update_zapchan()">' + $('zapchan').options[k].text + '<BR>';
-						}else{
-							$('zapchan_analoglines').innerHTML += '<INPUT id="' + selectedline + '" TYPE="CHECKBOX" VALUE="'+ $('zapchan').options[k].value+ '" onclick="update_zapchan()">' + $('zapchan').options[k].text + '<BR>';
+
+				if($('zapchan').options.length ==0){
+					$('zapchan_analoglines').innerHTML = "No analog line hardware installed on the system";
+				}else{
+						for (k=0;k< $('zapchan').length ;k++ ){
+								var selectedline = "selectedline" + k;
+								if($('zapchan').options[k].selected){
+									$('zapchan_analoglines').innerHTML += '<INPUT id="' + selectedline + '" TYPE="CHECKBOX" VALUE="'+ $('zapchan').options[k].value+ '" checked onclick="update_zapchan()">' + $('zapchan').options[k].text + '<BR>';
+								}else{
+									$('zapchan_analoglines').innerHTML += '<INPUT id="' + selectedline + '" TYPE="CHECKBOX" VALUE="'+ $('zapchan').options[k].value+ '" onclick="update_zapchan()">' + $('zapchan').options[k].text + '<BR>';
+								}
 						}
 				}
 		}else if ($('trunkstylevoip').checked) {



More information about the asterisk-gui-commits mailing list