added visual icon to event to show if a show has content scheduled.

This commit is contained in:
Naomi 2010-12-16 16:24:16 -05:00
parent d95c4ab0fc
commit 28bd92d073
3 changed files with 26 additions and 5 deletions

View file

@ -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) { public function deleteShow($showId, $dayId=NULL) {
$groups = CcShowScheduleQuery::create()->filterByDbShowId($showId)->find(); $groups = CcShowScheduleQuery::create()->filterByDbShowId($showId)->find();
@ -357,6 +367,12 @@ class Show {
$event["isHost"] = true; $event["isHost"] = true;
} }
$start = $date." ".$show["start_time"];
$end = $date." ".$show["end_time"];
if($this->showHasContent($start, $end)) {
$event["hasContent"] = true;
}
return $event; return $event;
} }
} }

View file

@ -272,6 +272,11 @@ function eventRender(event, element, view) {
// content: event.description // content: event.description
// }); // });
if(event.hasContent) {
var span = $('<span/>').addClass("ui-icon ui-icon-check");
$(element).find(".fc-event-title").after(span);
}
} }
function eventAfterRender( event, element, view ) { function eventAfterRender( event, element, view ) {