From cc1715426f71b38dcb8d9e3431e6ac65f04a0a8b Mon Sep 17 00:00:00 2001 From: naomiaro Date: Fri, 10 Dec 2010 12:51:36 -0500 Subject: [PATCH] added case for non ending shows --- application/models/Shows.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/application/models/Shows.php b/application/models/Shows.php index dd493411c..d35ce4f9c 100644 --- a/application/models/Shows.php +++ b/application/models/Shows.php @@ -187,6 +187,12 @@ class Show { $sql = $sql_gen ." WHERE ". $sql_range; } + if(!is_null($start) && is_null($end)) { + $sql_range = "(last_show IS NULL) + OR (last_show > '{$start}')"; + + $sql = $sql_gen ." WHERE ". $sql_range; + } if(!is_null($days)){ $sql_opt = array(); @@ -262,6 +268,7 @@ class Show { $repeatDate = $CC_DBC->GetOne($diff); $repeat_epoch = strtotime($repeatDate); + //show has finite duration. if (isset($show_end_epoch) && $repeat_epoch < $show_end_epoch && $repeat_epoch < $end_epoch) { $shows[] = $this->makeFullCalendarEvent($row, $repeatDate); }