Happy New Year! Remove Christmas special holiday timetable support.
--- a/include/common-transit.inc.php
+++ b/include/common-transit.inc.php
@@ -18,8 +18,7 @@
$service_periods = Array(
'sunday',
'saturday',
- 'weekday',
- "Christmas2011","EndOfYearHolidays"
+ 'weekday'
);
function service_period($date = "") {
@@ -33,16 +32,8 @@
return strtolower($override['service_id']);
}
$date = ($date != "" ? $date : time());
-// christmas special cases
- $ymd = date('Ymd', $date);
$dow = date('w', $date);
- if ($ymd == "20111225") {
- return "Christmas2011";
- } if ($ymd == "20111228" || $ymd == "20111229" || $ymd == "20111230") {
- return "EndOfYearHolidays";
- } else if (intval($ymd) < "20120203" && $dow != 0 && $dow != 6) {
- return "Weekday-SchoolVacation";
- } else {
+
switch ($dow) {
case 0:
return 'sunday';
@@ -51,7 +42,6 @@
default:
return 'weekday';
}
- }
}
function service_ids($service_period) {
@@ -60,21 +50,14 @@
return Array("Sunday", "Sunday");
case 'saturday':
return Array("Saturday", "Saturday");
- case "Christmas2011":
- return Array("Christmas2011", "Christmas2011");
- case "EndOfYearHolidays":
- return Array("Weekday-EndOfYearHolidays", "Weekday-EndOfYearHolidays");
- case "Weekday-SchoolVacation":
- return Array("Weekday", "Weekday-SchoolVacation");
default:
//return 'weekday';
- return Array("Weekday", "Weekday");
+ return Array("Weekday", "Weekday-SchoolVacation");
}
}
function valid_service_ids() {
- return array_merge(service_ids(""), service_ids('saturday'), service_ids('sunday'),
- Array("Christmas2011","Weekday-EndOfYearHolidays","Weekday-SchoolVacation"));
+ return array_merge(service_ids(""), service_ids('saturday'), service_ids('sunday'));
}
function midnight_seconds($time = "") {
--- a/stop.php
+++ b/stop.php
@@ -133,7 +133,7 @@
echo '<li>';
$destination = getTripDestination($trip['trip_id']);
- echo '<a href="trip.php?stopid=' . $stopid . '&tripid=' . $trip['trip_id'] . '"><h3>'. (service_period() == "Christmas2011" ? $trip['route_long_name'] : "") . $trip['route_short_name'] . " towards " . $destination['stop_name'] . "</h3><p>";
+ echo '<a href="trip.php?stopid=' . $stopid . '&tripid=' . $trip['trip_id'] . '"><h3>'. $trip['route_short_name'] . " towards " . $destination['stop_name'] . "</h3><p>";
$viaPoints = viaPointNames($trip['trip_id'], $trip['stop_sequence']);
if ($viaPoints != "")
echo '<br><span class="viaPoints">Via: ' . $viaPoints . '</span>';