CC-2123: Rebroadcast: Show status of upload in the calendar and show content

-Changes for full calendar implemented
This commit is contained in:
martin 2011-04-02 13:30:04 -04:00
parent d664108a47
commit 8cc161ce71
3 changed files with 37 additions and 6 deletions

View file

@ -93,6 +93,27 @@ class Application_Model_Nowplaying
return $data; return $data;
} }
public static function HandleRebroadcastShows($rows){
$newCopy = array();
$numRows = count($rows);
for ($i=0; $i<$numRows; $i++){
$currentRow = $rows[$i];
if ($currentRow["rebroadcast"] == 1 && !array_key_exists("group", $currentRow)){
$newRow = $currentRow;
unset($newRow['group']);
$newRow['item_starts'] = $newRow['show_starts'];
$newRow['item_ends'] = $newRow['show_ends'];
array_push($newCopy, $newRow);
} else {
array_push($newCopy, $currentRow);
}
}
return $newCopy;
}
public static function GetDataGridData($viewType, $dateString){ public static function GetDataGridData($viewType, $dateString){
if ($viewType == "now"){ if ($viewType == "now"){
@ -111,14 +132,13 @@ class Application_Model_Nowplaying
$endCutoff = $date->getNowDayEndDiff(); $endCutoff = $date->getNowDayEndDiff();
} }
$rows = Show_DAL::GetShowsInRange($timeNow, $startCutoff, $endCutoff); $rows = Show_DAL::GetShowsInRange($timeNow, $startCutoff, $endCutoff);
$rows = Application_Model_Nowplaying::FindBeginningOfShow($rows); $rows = Application_Model_Nowplaying::FindBeginningOfShow($rows);
$rows = Application_Model_Nowplaying::HandleRebroadcastShows($rows);
$rows = Application_Model_Nowplaying::FindGapAtEndOfShow($rows); $rows = Application_Model_Nowplaying::FindGapAtEndOfShow($rows);
//$rows = FindGapsBetweenShows //$rows = FindGapsBetweenShows()
$data = Application_Model_Nowplaying::FilterRowsByDate($rows, $date, $startCutoff, $endCutoff); $data = Application_Model_Nowplaying::FilterRowsByDate($rows, $date, $startCutoff, $endCutoff);
$date = new Application_Model_DateHelper; $date = new Application_Model_DateHelper;
$timeNow = $date->getDate(); $timeNow = $date->getDate();
return array("currentShow"=>Show_DAL::GetCurrentShow($timeNow), "rows"=>$data); return array("currentShow"=>Show_DAL::GetCurrentShow($timeNow), "rows"=>$data);

View file

@ -271,7 +271,7 @@ class Show {
{ {
global $CC_DBC; global $CC_DBC;
$sql = "SELECT starts, ends, record, rebroadcast, instance_id, show_id, name, description, $sql = "SELECT starts, ends, record, rebroadcast, soundcloud_id, instance_id, show_id, name, description,
color, background_color, cc_show_instances.id AS instance_id color, background_color, cc_show_instances.id AS instance_id
FROM cc_show_instances FROM cc_show_instances
LEFT JOIN cc_show ON cc_show.id = cc_show_instances.show_id"; LEFT JOIN cc_show ON cc_show.id = cc_show_instances.show_id";
@ -562,6 +562,7 @@ class Show {
$event["showId"] = $show["show_id"]; $event["showId"] = $show["show_id"];
$event["record"] = intval($show["record"]); $event["record"] = intval($show["record"]);
$event["rebroadcast"] = intval($show["rebroadcast"]); $event["rebroadcast"] = intval($show["rebroadcast"]);
$event["soundcloud_id"] = (is_null($show["soundcloud_id"]) ? -1 : $show["soundcloud_id"]);
foreach($options as $key=>$value) { foreach($options as $key=>$value) {
$event[$key] = $value; $event[$key] = $value;
@ -1010,6 +1011,7 @@ class Show_DAL {
$sql = "SELECT" $sql = "SELECT"
." si.starts as show_starts," ." si.starts as show_starts,"
." si.ends as show_ends," ." si.ends as show_ends,"
." si.rebroadcast as rebroadcast,"
." st.starts as item_starts," ." st.starts as item_starts,"
." st.ends as item_ends," ." st.ends as item_ends,"
." st.clip_length as clip_length," ." st.clip_length as clip_length,"

View file

@ -149,7 +149,7 @@ function viewDisplay( view ) {
function eventRender(event, element, view) { function eventRender(event, element, view) {
//only put progress bar on shows that aren't being recorded and are not a rebroadcast. //only put progress bar on shows that aren't being recorded and are not a rebroadcast.
if((view.name === 'agendaDay' || view.name === 'agendaWeek') && event.record === 0 && event.rebroadcast === 0) { if((view.name === 'agendaDay' || view.name === 'agendaWeek') && event.record === 0 /* && event.rebroadcast === 0 */) {
var div = $('<div/>'); var div = $('<div/>');
div div
.height('5px') .height('5px')
@ -186,6 +186,15 @@ function eventRender(event, element, view) {
$(element).find(".fc-event-title").after('<span class="small-icon rebroadcast"></span>'); $(element).find(".fc-event-title").after('<span class="small-icon rebroadcast"></span>');
} }
if((view.name === 'agendaDay' || view.name === 'agendaWeek') && event.soundcloud_id != -1 && event.record === 1) {
$(element).find(".fc-event-time").after('<span class="small-icon soundcloud"></span>');
}
if(view.name === 'month' && event.soundcloud_id != -1 && event.record === 1) {
$(element).find(".fc-event-title").after('<span class="small-icon soundcloud"></span>');
}
if(event.backgroundColor !== "") { if(event.backgroundColor !== "") {
$(element) $(element)
.css({'border-color': '#'+event.backgroundColor}) .css({'border-color': '#'+event.backgroundColor})