pari: trunk r114 - in /trunk/config: ./ scripts/

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Mon Nov 6 13:13:21 MST 2006


Author: pari
Date: Mon Nov  6 14:13:20 2006
New Revision: 114

URL: http://svn.digium.com/view/asterisk-gui?rev=114&view=rev
Log:
An alert box pops up when the user selects an entry that is disabled

Modified:
    trunk/config/meetme.html
    trunk/config/queues.html
    trunk/config/scripts/astman.js
    trunk/config/users.html
    trunk/config/voicemail.html

Modified: trunk/config/meetme.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/meetme.html?rev=114&r1=113&r2=114&view=diff
==============================================================================
--- trunk/config/meetme.html (original)
+++ trunk/config/meetme.html Mon Nov  6 14:13:20 2006
@@ -116,7 +116,8 @@
 			tmp = $('extensions').options[x].value.split(']');
 			if (tmp.length > 1) {
 				if ($('extensions').stored_config.catbyname[tmp[0]].subfields[tmp[1]]['app'].toLowerCase() != "meetme") {
-					$('extensions').options[x].disabled = true;
+					//$('extensions').options[x].disabled = true;
+					$('extensions').options[x].style.color = "#ABABAB";
 					$('extensions').options[x].value= "reserved";
 				}
 			}
@@ -145,6 +146,28 @@
 		tmp['room'] = '';
 		tmp['>'] = true;
 		return new Array(specialcontext, 'exten', tmp);
+	}
+	callbacks.postselect = function(box, val) {
+		parent.$('tooltip').innerHTML = parent.tooltip_default ; 
+		if( box.selectedIndex == -1)
+				return true;
+		if(val == "reserved" ){
+				if( box.options[box.selectedIndex].text.toLowerCase().match("-- call queue")     ){
+					//parent.$('tooltip').innerHTML = " <font size=\"-2\" color=\"#FF0000\">Click on \'Call Queues\' panel to edit call queues </font>";
+					box.selectedIndex = -1;
+					alert(" You can not edit the selected entry from here.\n Please click on the \'Call Queues\' panel to edit the selected entry");
+					return true;
+				}
+				if( box.options[box.selectedIndex].text.toLowerCase().match("-- check voicemail")     ){
+					//parent.$('tooltip').innerHTML = " <font size=\"-2\" color=\"#FF0000\">Click on \'Voicemail\' panel to edit Voicemail Preferences</font>";
+					box.selectedIndex = -1;
+					alert(" You can not edit the selected entry from here.\n Please click on the \'Voicemail\' panel to edit the selected entry");
+					return true;
+				}
+				box.selectedIndex = -1;
+				alert(" You can not edit the selected entry from here.\n Please click on the \'Users\' panel to edit the selected entry");
+				return true;
+		}
 	}
 	callbacks.newcategory = function() {
 		var tmp = null;

Modified: trunk/config/queues.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/queues.html?rev=114&r1=113&r2=114&view=diff
==============================================================================
--- trunk/config/queues.html (original)
+++ trunk/config/queues.html Mon Nov  6 14:13:20 2006
@@ -275,6 +275,30 @@
 
 queuecallbacks.postselect = function(box, val ) {
 		if($('queues').selectedIndex	==-1){ 	$('save_q').disabled=true; 	return true; 	} 
+		// 
+		if(val == "reserved" ){
+				$('testmulti').innerHTML = "";
+				$('save_q').disabled=true;
+				$('cancel').disabled = true;
+				if( box.options[box.selectedIndex].text.toLowerCase().match("-- conference bridge")     ){
+					//parent.$('tooltip').innerHTML = " <font size=\"-2\" color=\"#FF0000\">Click on \'Conferencing\' panel to edit a Conference Bridge</font>";
+					box.selectedIndex = -1;
+					alert(" You can not edit the selected entry from here.\n Please click on the \'Conferencing\' panel to edit the selected entry");
+					return true;
+				}
+				if( box.options[box.selectedIndex].text.toLowerCase().match("-- check voicemail")     ){
+					//parent.$('tooltip').innerHTML = " <font size=\"-2\" color=\"#FF0000\">Click on \'Voicemail\' panel to edit Voicemail Preferences</font>";
+					box.selectedIndex = -1;
+					alert(" You can not edit the selected entry from here.\n Please click on the \'Voicemail\' panel to edit the selected entry");
+					return true;
+				}
+				box.selectedIndex = -1;
+				alert(" You can not edit the selected entry from here.\n Please click on the \'Users\' panel to edit the selected entry");
+				return true;
+		}
+
+
+
 		// show all member entires listed under the queue member - $('queues').value
 		for( k=0; k<queuenames.length; k++ ){
 				if( queuenames[k] == $('queues').value ){		j = k;	break;		}

Modified: trunk/config/scripts/astman.js
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/scripts/astman.js?rev=114&r1=113&r2=114&view=diff
==============================================================================
--- trunk/config/scripts/astman.js (original)
+++ trunk/config/scripts/astman.js Mon Nov  6 14:13:20 2006
@@ -1689,6 +1689,7 @@
 						var oOption = document.createElement("OPTION");
 						oOption.text=e.options[x].innerHTML;
 						oOption.value="reserved";
+						oOption.style.color = "#ABABAB";
 						var z = u.options.length;
 						for(var y=0; y < u.options.length; y++){
 									if(e.options[x].innerHTML  < u.options[y].innerHTML ){
@@ -1704,7 +1705,8 @@
 			while(e.options.length) {
 				opt = e.options[0];
 				opt.value = 'reserved';
-				opt.disabled = true;
+				//opt.disabled = true;
+				opt.style.color = "#ABABAB";
 				for (x=0;x<u.options.length + 1;x++) {
 					if (!u.options[x] || (opt.innerHTML < u.options[x].innerHTML)) {
 						u.options.add(opt, x);

Modified: trunk/config/users.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/users.html?rev=114&r1=113&r2=114&view=diff
==============================================================================
--- trunk/config/users.html (original)
+++ trunk/config/users.html Mon Nov  6 14:13:20 2006
@@ -95,6 +95,31 @@
 		return true;
 	}
 
+	callbacks.postselect = function(box, val) {
+		parent.$('tooltip').innerHTML = parent.tooltip_default ; 
+		if( box.selectedIndex == -1)
+			return true;
+		if(val == "reserved" ){
+				if( box.options[box.selectedIndex].text.toLowerCase().match("-- call queue")     ){
+					//parent.$('tooltip').innerHTML = " <font size=\"-2\" color=\"#FF0000\">Click on \'Call Queues\' panel to edit call queues </font>";
+					box.selectedIndex = -1;
+					alert(" You can not edit the selected entry from here.\n Please click on the \'Call Queues\' panel to edit the selected entry");
+					return true;
+				}
+				if( box.options[box.selectedIndex].text.toLowerCase().match("-- conference bridge")     ){
+					//parent.$('tooltip').innerHTML = " <font size=\"-2\" color=\"#FF0000\">Click on \'Conferencing\' panel to edit a Conference Bridge</font>";
+					box.selectedIndex = -1;
+					alert(" You can not edit the selected entry from here.\n Please click on the \'Conferencing\' panel to edit the selected entry");
+					return true;
+				}
+				if( box.options[box.selectedIndex].text.toLowerCase().match("-- check voicemail")     ){
+					box.selectedIndex = -1;
+					//parent.$('tooltip').innerHTML = " <font size=\"-2\" color=\"#FF0000\">Click on \'Voicemail\' panel to edit Voicemail Preferences</font>";
+					alert(" You can not edit the selected entry from here.\n Please click on the \'Voicemail\' panel to edit the selected entry");
+					return true;
+				}
+		}
+	}
 
 	phonecallbacks.format = function(t) {
 		if (t.fieldbyname['port'] == 'fxo')

Modified: trunk/config/voicemail.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/voicemail.html?rev=114&r1=113&r2=114&view=diff
==============================================================================
--- trunk/config/voicemail.html (original)
+++ trunk/config/voicemail.html Mon Nov  6 14:13:20 2006
@@ -66,7 +66,8 @@
 			tmp = $('extensions').options[x].value.split(']');
 			if (tmp.length > 1) {
 				if ($('extensions').stored_config.catbyname[tmp[0]].subfields[tmp[1]]['app'].toLowerCase() != "voicemailmain") {
-					$('extensions').options[x].disabled = true;
+					//$('extensions').options[x].disabled = true;
+					$('extensions').options[x].style.color = "#ABABAB";
 					$('extensions').options[x].value = "reserved";
 				} else {
 					whichexten = $('extensions').stored_config.catbyname[tmp[0]].subfields[tmp[1]]['name'];
@@ -98,6 +99,41 @@
 		return new Array(specialcontext, 'exten', tmp);
 	}
 	
+	callbacks.postselect = function(box, val) {
+		var fields_to_disable  = new Array(attach, saycid, sayduration, emailonly, maxmsg, maxmessage, minmessage, operator, attachfmt, review, envelope, maxgreet);
+		parent.$('tooltip').innerHTML = parent.tooltip_default ; 
+		if( box.selectedIndex == -1)
+			return true;
+		if(val == "reserved" ){
+				for( var i=0; i < fields_to_disable.length; i ++ ){
+						$(fields_to_disable[i]).disabled = true;
+				}
+				$('save').disabled = true;
+				$('cancel').disabled = true;
+
+				if( box.options[box.selectedIndex].text.toLowerCase().match("-- call queue")     ){
+					//parent.$('tooltip').innerHTML = " <font size=\"-2\" color=\"#FF0000\">Click on \'Call Queues\' panel to edit call queues </font>";
+					box.selectedIndex = -1;
+					alert(" You can not edit the selected entry from here.\n Please click on the \'Call Queues\' panel to edit the selected entry");
+					return true;
+				}
+				if( box.options[box.selectedIndex].text.toLowerCase().match("-- conference bridge")     ){
+					//parent.$('tooltip').innerHTML = " <font size=\"-2\" color=\"#FF0000\">Click on \'Conferencing\' panel to edit a Conference Bridge</font>";
+					box.selectedIndex = -1;
+					alert(" You can not edit the selected entry from here.\n Please click on the \'Conferencing\' panel to edit the selected entry");
+					return true;
+				}
+				box.selectedIndex = -1;
+				alert(" You can not edit the selected entry from here.\n Please click on the \'Users\' panel to edit the selected entry");
+				return true;
+		}
+
+		for( var i=0; i < fields_to_disable.length; i ++ ){
+				$(fields_to_disable[i]).disabled = false;
+		}
+		$('cancel').disabled = false;
+	}
+
 	callbacks.identifier = "extension";
 	callbacks.eachline = true;
 	callbacks.usesubfields = true;



More information about the asterisk-gui-commits mailing list