From: Steve Sutton Date: Fri, 20 Jun 2014 16:44:25 +0000 (-0400) Subject: Update Cruise Schedule app X-Git-Tag: v1.0^2~31^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=b716b993ac3dd7b0b2cd118ee88f52497160fc9f;p=web%2FSooLocks.git Update Cruise Schedule app set to use all months set output to only show months that have dates --- diff --git a/Toolkit/Schedule/Calendar.php b/Toolkit/Schedule/Calendar.php index 3a036b2..d6cf1a8 100644 --- a/Toolkit/Schedule/Calendar.php +++ b/Toolkit/Schedule/Calendar.php @@ -2,6 +2,7 @@ class Toolkit_Schedule_Calendar { + public $months = array(); /** * buildCalendar * @@ -153,6 +154,10 @@ class Toolkit_Schedule_Calendar ); $day->class = 'depart'.$row['departure_id']; $dates[$row['id']] = $day; + $month = $date->getMonth(); + if (!in_array($month, $this->months)) { + $this->months[] = $month; + } } } catch(PDOException $e){ Toolkit_Common::handleError($e); diff --git a/Toolkit/Schedule/DepartureCalendar.php b/Toolkit/Schedule/DepartureCalendar.php index 57038e0..9749da6 100644 --- a/Toolkit/Schedule/DepartureCalendar.php +++ b/Toolkit/Schedule/DepartureCalendar.php @@ -173,6 +173,8 @@ class Toolkit_Schedule_DepartureCalendar } } $selected = $cals->getDepartureDates($scheduleId); +// echo '
'.print_r($selected, true).'
'; +// exit; $year = ($year) ? $year @@ -181,7 +183,9 @@ class Toolkit_Schedule_DepartureCalendar $startingMonth = $this->config->months->start; $endingMonth = $this->config->months->end; for ($i = $startingMonth; $i <= $endingMonth; ++$i) { - $page->calendarsHtml .= $cals->buildCalendar($i, $year, $selected); + if (in_array($i, $cals->months)) { + $page->calendarsHtml .= $cals->buildCalendar($i, $year, $selected); + } } $tpl = new HTML_Template_Flexy($this->flexyOptions); $page->style = $style; diff --git a/Toolkit/Schedule/application.ini b/Toolkit/Schedule/application.ini index 2db38a8..4110284 100644 --- a/Toolkit/Schedule/application.ini +++ b/Toolkit/Schedule/application.ini @@ -9,7 +9,7 @@ flexy.options.templateDir = BASE "Toolkit/Schedule/templates/" flexy.options.compileDir = BASE "Toolkit/Schedule/templates/compiled/" ; the starting month to use in the multiple date picker -months.start = 4 +months.start = 1 ; the ending month to use in the multiple date picker months.end = 12 ; controls the width of the dialog box for the multiple date picker