From 636a69e6d43388f3fb4eefea62ae001c38d77cc7 Mon Sep 17 00:00:00 2001 From: Scott Dale Date: Thu, 29 Mar 2007 20:05:00 +0000 Subject: more logic checks --- usr/local/www/firewall_schedule_edit.php | 136 +++++++++++++++++++------------ 1 file changed, 83 insertions(+), 53 deletions(-) (limited to 'usr/local') diff --git a/usr/local/www/firewall_schedule_edit.php b/usr/local/www/firewall_schedule_edit.php index ad50496..d92cedc 100644 --- a/usr/local/www/firewall_schedule_edit.php +++ b/usr/local/www/firewall_schedule_edit.php @@ -74,7 +74,7 @@ if ($_POST) { $input_errors[] = "Reserved word used for schedule name."; } else { if (is_validaliasname($_POST['name']) == false) - $input_errors[] = "The schedule name may only consist of the characters a-z, A-Z, 0-9, -"; + $input_errors[] = "The schedule name may only consist of the characters a-z, A-Z, 0-9"; } if (!$_POST['schedule0']) @@ -325,7 +325,7 @@ function update_month(){ function checkForRanges(){ if (daysSelected != "") { - alert("You have not saved the specified time range. Please click 'Add Time' button to save the time range"); + alert("You have not saved the specified time range. Please click 'Add Time' button to save the time range."); return false; } else @@ -547,7 +547,7 @@ function insertElements(tempFriendlyTime, starttimehour, starttimemin, stoptimeh tr.appendChild(td); td = d.createElement("td"); - td.innerHTML = ""; + td.innerHTML = ""; tr.appendChild(td); td = d.createElement("td"); @@ -597,56 +597,62 @@ function clearDescr(){ document.getElementById("timerangedescr").value = ""; } -function editRow(incTime) { - //reset calendar and time - clearCalendar(); - clearTime(); +function editRow(incTime, el) { + var check = checkForRanges(); - var starttimehour, descr, days, tempstr, starttimemin, hours, stoptimehour, stoptimemin = ""; - - tempArray = incTime.split ("||"); - - days = tempArray[0]; - hours = tempArray[1]; - descr = tempArray[2]; - - var tempdayArray = days.split(","); - var temphourArray = hours.split("-"); - tempstr = temphourArray[0]; - var temphourArray2 = tempstr.split(":"); - - document.getElementById("starttimehour").value = temphourArray2[0]; - document.getElementById("starttimemin").value = temphourArray2[1]; - - tempstr = temphourArray[1]; - temphourArray2 = tempstr.split(":"); + if (check){ + + //reset calendar and time + clearCalendar(); + clearTime(); + + var starttimehour, descr, days, tempstr, starttimemin, hours, stoptimehour, stoptimemin = ""; + + tempArray = incTime.split ("||"); + + days = tempArray[0]; + hours = tempArray[1]; + descr = tempArray[2]; + + var tempdayArray = days.split(","); + var temphourArray = hours.split("-"); + tempstr = temphourArray[0]; + var temphourArray2 = tempstr.split(":"); - document.getElementById("stoptimehour").value = temphourArray2[0]; - document.getElementById("stoptimemin").value = temphourArray2[1]; + document.getElementById("starttimehour").value = temphourArray2[0]; + document.getElementById("starttimemin").value = temphourArray2[1]; + + tempstr = temphourArray[1]; + temphourArray2 = tempstr.split(":"); + + document.getElementById("stoptimehour").value = temphourArray2[0]; + document.getElementById("stoptimemin").value = temphourArray2[1]; + + document.getElementById("timerangedescr").value = descr; - document.getElementById("timerangedescr").value = descr; - - //toggle the appropriate days - for (i=0; i EOD; ?> @@ -679,19 +700,28 @@ EOD; Schedule Name -
+ + + +

+ NOTE: This schedule is in use so the name may not be modified! +

+ +
- The name of the alias may only consist of the characters a-z, A-Z and 0-9, -, _ - + The name of the alias may only consist of the characters a-z, A-Z and 0-9 + + Description -
+
You may enter a description here for your reference (not parsed). - - + + + @@ -860,7 +890,7 @@ EOD; Time Range Description -
+
You may enter a description here for your reference (not parsed). @@ -997,7 +1027,7 @@ EOD; - /images/icons/icon_e.gif' onclick='editRow(""); removeRow(this); return false;' value='Edit'> + /images/icons/icon_e.gif' onclick='editRow("",this); return false;' value='Edit'> /images/icons/icon_x.gif' onclick='removeRow(this); return false;' value='Delete'> -- cgit v1.1