From 28bd92d07338b5a54967082340fbc384e4754e2e Mon Sep 17 00:00:00 2001 From: Naomi Date: Thu, 16 Dec 2010 16:24:16 -0500 Subject: [PATCH] added visual icon to event to show if a show has content scheduled. --- application/models/Playlist.php | 10 +++++----- application/models/Shows.php | 16 ++++++++++++++++ public/js/campcaster/schedule/schedule.js | 5 +++++ 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/application/models/Playlist.php b/application/models/Playlist.php index b79b41a0f..00e856d8c 100644 --- a/application/models/Playlist.php +++ b/application/models/Playlist.php @@ -126,12 +126,12 @@ class Playlist { } public static function Delete($id) { - $pl = CcPlaylistQuery::create()->findPK($id); - if($pl === NULL) - return FALSE; + $pl = CcPlaylistQuery::create()->findPK($id); + if($pl === NULL) + return FALSE; - $pl->delete(); - return TRUE; + $pl->delete(); + return TRUE; } diff --git a/application/models/Shows.php b/application/models/Shows.php index 0caf05ce6..e6da17940 100644 --- a/application/models/Shows.php +++ b/application/models/Shows.php @@ -202,6 +202,16 @@ class Show { } } + public function showHasContent($start_timestamp, $end_timestamp) { + + $con = Propel::getConnection("campcaster"); + $sql = "SELECT TIMESTAMP '{$end_timestamp}' - TIMESTAMP '{$start_timestamp}'"; + $r = $con->query($sql); + $length = $r->fetchColumn(0); + + return !Schedule::isScheduleEmptyInRange($start_timestamp, $length); + } + public function deleteShow($showId, $dayId=NULL) { $groups = CcShowScheduleQuery::create()->filterByDbShowId($showId)->find(); @@ -357,6 +367,12 @@ class Show { $event["isHost"] = true; } + $start = $date." ".$show["start_time"]; + $end = $date." ".$show["end_time"]; + if($this->showHasContent($start, $end)) { + $event["hasContent"] = true; + } + return $event; } } diff --git a/public/js/campcaster/schedule/schedule.js b/public/js/campcaster/schedule/schedule.js index 39dd33d45..91671e721 100644 --- a/public/js/campcaster/schedule/schedule.js +++ b/public/js/campcaster/schedule/schedule.js @@ -271,6 +271,11 @@ function eventRender(event, element, view) { //element.qtip({ // content: event.description // }); + + if(event.hasContent) { + var span = $('').addClass("ui-icon ui-icon-check"); + $(element).find(".fc-event-title").after(span); + } }