diff --git a/application/models/Nowplaying.php b/application/models/Nowplaying.php index 884b5cd05..7536f1044 100644 --- a/application/models/Nowplaying.php +++ b/application/models/Nowplaying.php @@ -93,6 +93,27 @@ class Application_Model_Nowplaying 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){ if ($viewType == "now"){ @@ -111,14 +132,13 @@ class Application_Model_Nowplaying $endCutoff = $date->getNowDayEndDiff(); } - $rows = Show_DAL::GetShowsInRange($timeNow, $startCutoff, $endCutoff); $rows = Application_Model_Nowplaying::FindBeginningOfShow($rows); + $rows = Application_Model_Nowplaying::HandleRebroadcastShows($rows); $rows = Application_Model_Nowplaying::FindGapAtEndOfShow($rows); - //$rows = FindGapsBetweenShows + //$rows = FindGapsBetweenShows() $data = Application_Model_Nowplaying::FilterRowsByDate($rows, $date, $startCutoff, $endCutoff); - $date = new Application_Model_DateHelper; $timeNow = $date->getDate(); return array("currentShow"=>Show_DAL::GetCurrentShow($timeNow), "rows"=>$data); diff --git a/application/models/Shows.php b/application/models/Shows.php index 492885f40..54af288d6 100644 --- a/application/models/Shows.php +++ b/application/models/Shows.php @@ -271,7 +271,7 @@ class Show { { 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 FROM cc_show_instances 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["record"] = intval($show["record"]); $event["rebroadcast"] = intval($show["rebroadcast"]); + $event["soundcloud_id"] = (is_null($show["soundcloud_id"]) ? -1 : $show["soundcloud_id"]); foreach($options as $key=>$value) { $event[$key] = $value; @@ -1010,6 +1011,7 @@ class Show_DAL { $sql = "SELECT" ." si.starts as show_starts," ." si.ends as show_ends," + ." si.rebroadcast as rebroadcast," ." st.starts as item_starts," ." st.ends as item_ends," ." st.clip_length as clip_length," diff --git a/public/js/airtime/schedule/full-calendar-functions.js b/public/js/airtime/schedule/full-calendar-functions.js index ce01e4583..ab8eb34c9 100644 --- a/public/js/airtime/schedule/full-calendar-functions.js +++ b/public/js/airtime/schedule/full-calendar-functions.js @@ -149,7 +149,7 @@ function viewDisplay( view ) { function eventRender(event, element, view) { //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 .height('5px') @@ -184,7 +184,16 @@ function eventRender(event, element, view) { if(view.name === 'month' && event.rebroadcast === 1) { $(element).find(".fc-event-title").after(''); - } + } + + if((view.name === 'agendaDay' || view.name === 'agendaWeek') && event.soundcloud_id != -1 && event.record === 1) { + + $(element).find(".fc-event-time").after(''); + } + if(view.name === 'month' && event.soundcloud_id != -1 && event.record === 1) { + + $(element).find(".fc-event-title").after(''); + } if(event.backgroundColor !== "") { $(element)