rbrindley: branch rbrindley/astman_revamp r4622 - /team/rbrindley/astman_reva...

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Thu Mar 12 10:06:38 CDT 2009


Author: rbrindley
Date: Thu Mar 12 10:06:35 2009
New Revision: 4622

URL: http://svn.digium.com/svn-view/asterisk-gui?view=rev&rev=4622
Log:

- value -> val, $().val() is the correct func for jQuery
- using an object to store timeinterval vars instead of random varnames
- added feedback and a reload on timeinterval add success


Modified:
    team/rbrindley/astman_revamp/config/js/timeintervals.js

Modified: team/rbrindley/astman_revamp/config/js/timeintervals.js
URL: http://svn.digium.com/svn-view/asterisk-gui/team/rbrindley/astman_revamp/config/js/timeintervals.js?view=diff&rev=4622&r1=4621&r2=4622
==============================================================================
--- team/rbrindley/astman_revamp/config/js/timeintervals.js (original)
+++ team/rbrindley/astman_revamp/config/js/timeintervals.js Thu Mar 12 10:06:35 2009
@@ -44,7 +44,7 @@
 	},
 
 	update_TI : function(){ // ti_miscFunctions.update_TI();
-		var newname = $('#edit_ti_name').value();
+		var newname = $('#edit_ti_name').val();
 
 		if (newname === '') {
 			ASTGUI.highlightField('edit_ti_name', 'Time Interval name is empty');
@@ -74,30 +74,30 @@
 
 		/* if 'Entire Day' isn't checked */
 		if (!$('#edit_ti_entireday:checked').length) {
-			var start = $('#edit_ti_starttime').value();
-			var end = $('#edit_ti_endtime').value();
+			var start = $('#edit_ti_starttime').val();
+			var end = $('#edit_ti_endtime').val();
 
 			var starttime = ASTGUI.miscFunctions.AMPM_to_asteriskTime(start) || '00:00';
 			var endtime = ASTGUI.miscFunctions.AMPM_to_asteriskTime(end) || '24:00';
 
 			if (starttime !== '00:00' || endtime !== '24:00') {
-				var timerange = starttime + '-' + endttime;
-			}
-		}
-
-		if ($('#edit_ti_byDayofWeek:checked').length) {
-			interval.weekdays = $('#edit_ti_dayofweek_start').value() + '-' + $('#edit_ti_dayofweek_end').value();
-		}
-
-		if ($('#ti_type_byGroupofDates:checked').length) {
-			interval.days = $('#edit_ti_from_date').value();
+				interval.time = starttime + '-' + endttime;
+			}
+		}
+
+		if (!$('#edit_ti_byDayofWeek:selected').length) {
+			interval.weekdays = $('#edit_ti_dayofweek_start').val() + '-' + $('#edit_ti_dayofweek_end').val();
+		}
+
+		if ($('#ti_type_byGroupofDates:selected').length) {
+			interval.days = $('#edit_ti_from_date').val();
 
 			if (!interval.days.valiDate()) {
 				ASTGUI.highlightField('edit_ti_from_date', 'Invalid Date Range!');
 				return;
 			}
 
-			interval.months = $('#edit_ti_month').value();
+			interval.months = $('#edit_ti_month').val();
 		}
 
 		if (isNewTI) {
@@ -109,7 +109,12 @@
 		if (!resp) {
 			top.log.error('Error updating Time Interval');
 			ASTGUI.feedback({ msg: 'ERROR UPDATING!', showfor: 3, color: 'red', bgcolor: '#ffffff'});
-		}
+			return;
+		}
+
+		ASTGUI.feedback({ msg: "Created time interval '" + newname + "'!", showfor: 3, color:'green', bgcolor:'#FFFFFF'});
+		window.location.reload();
+
 	},
 
 	delete_TI : function(a){ // ti_miscFunctions.delete_TI




More information about the asterisk-gui-commits mailing list