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

@ -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;
}

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) {
$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;
}
}

View File

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