Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
Martin Konecny 2012-04-12 19:12:38 -04:00
commit 00c5ef4331
2 changed files with 9 additions and 5 deletions

View File

@ -39,9 +39,9 @@ class Application_Model_Schedule {
$utcTimeNow = $date->getUtcTimestamp(); $utcTimeNow = $date->getUtcTimestamp();
$shows = Application_Model_Show::getPrevCurrentNext($utcTimeNow); $shows = Application_Model_Show::getPrevCurrentNext($utcTimeNow);
$previousShowID = count($shows['previousShow'])>0?$shows['previousShow'][0]['id']:null; $previousShowID = count($shows['previousShow'])>0?$shows['previousShow'][0]['instance_id']:null;
$currentShowID = count($shows['currentShow'])>0?$shows['currentShow'][0]['id']:null; $currentShowID = count($shows['currentShow'])>0?$shows['currentShow'][0]['instance_id']:null;
$nextShowID = count($shows['nextShow'])>0?$shows['nextShow'][0]['id']:null; $nextShowID = count($shows['nextShow'])>0?$shows['nextShow'][0]['instance_id']:null;
$results = Application_Model_Schedule::GetPrevCurrentNext($previousShowID, $currentShowID, $nextShowID, $utcTimeNow); $results = Application_Model_Schedule::GetPrevCurrentNext($previousShowID, $currentShowID, $nextShowID, $utcTimeNow);
$range = array("env"=>APPLICATION_ENV, $range = array("env"=>APPLICATION_ENV,
@ -106,6 +106,7 @@ class Application_Model_Schedule {
$sql .= ' AND st.playout_status > 0 ORDER BY st.starts'; $sql .= ' AND st.playout_status > 0 ORDER BY st.starts';
$rows = $CC_DBC->GetAll($sql); $rows = $CC_DBC->GetAll($sql);
$numberOfRows = count($rows); $numberOfRows = count($rows);
$results['previous'] = null; $results['previous'] = null;

View File

@ -1767,8 +1767,7 @@ class Application_Model_Show {
." AND si.ends < TIMESTAMP '$p_timeNow' + INTERVAL '2 days'" ." AND si.ends < TIMESTAMP '$p_timeNow' + INTERVAL '2 days'"
." AND modified_instance != TRUE" ." AND modified_instance != TRUE"
." ORDER BY si.starts"; ." ORDER BY si.starts";
//Logging::log($sql);
// Convert back to local timezone // Convert back to local timezone
$rows = $CC_DBC->GetAll($sql); $rows = $CC_DBC->GetAll($sql);
$numberOfRows = count($rows); $numberOfRows = count($rows);
@ -1785,6 +1784,7 @@ class Application_Model_Show {
if ( $i - 1 >= 0){ if ( $i - 1 >= 0){
$results['previousShow'][0] = array( $results['previousShow'][0] = array(
"id"=>$rows[$i-1]['id'], "id"=>$rows[$i-1]['id'],
"instance_id"=>$rows[$i-1]['instance_id'],
"name"=>$rows[$i-1]['name'], "name"=>$rows[$i-1]['name'],
"start_timestamp"=>$rows[$i-1]['start_timestamp'], "start_timestamp"=>$rows[$i-1]['start_timestamp'],
"end_timestamp"=>$rows[$i-1]['end_timestamp'], "end_timestamp"=>$rows[$i-1]['end_timestamp'],
@ -1797,6 +1797,7 @@ class Application_Model_Show {
if ( isset($rows[$i+1])){ if ( isset($rows[$i+1])){
$results['nextShow'][0] = array( $results['nextShow'][0] = array(
"id"=>$rows[$i+1]['id'], "id"=>$rows[$i+1]['id'],
"instance_id"=>$rows[$i+1]['instance_id'],
"name"=>$rows[$i+1]['name'], "name"=>$rows[$i+1]['name'],
"start_timestamp"=>$rows[$i+1]['start_timestamp'], "start_timestamp"=>$rows[$i+1]['start_timestamp'],
"end_timestamp"=>$rows[$i+1]['end_timestamp'], "end_timestamp"=>$rows[$i+1]['end_timestamp'],
@ -1814,6 +1815,7 @@ class Application_Model_Show {
if (strtotime($rows[$i]['starts']) > $timeNowAsMillis) { if (strtotime($rows[$i]['starts']) > $timeNowAsMillis) {
$results['nextShow'][0] = array( $results['nextShow'][0] = array(
"id"=>$rows[$i]['id'], "id"=>$rows[$i]['id'],
"instance_id"=>$rows[$i]['instance_id'],
"name"=>$rows[$i]['name'], "name"=>$rows[$i]['name'],
"start_timestamp"=>$rows[$i]['start_timestamp'], "start_timestamp"=>$rows[$i]['start_timestamp'],
"end_timestamp"=>$rows[$i]['end_timestamp'], "end_timestamp"=>$rows[$i]['end_timestamp'],
@ -1827,6 +1829,7 @@ class Application_Model_Show {
if (count($results['previousShow']) == 0 && isset($previousShowIndex)) { if (count($results['previousShow']) == 0 && isset($previousShowIndex)) {
$results['previousShow'][0] = array( $results['previousShow'][0] = array(
"id"=>$rows[$previousShowIndex]['id'], "id"=>$rows[$previousShowIndex]['id'],
"instance_id"=>$rows[$previousShowIndex]['instance_id'],
"name"=>$rows[$previousShowIndex]['name'], "name"=>$rows[$previousShowIndex]['name'],
"start_timestamp"=>$rows[$previousShowIndex]['start_timestamp'], "start_timestamp"=>$rows[$previousShowIndex]['start_timestamp'],
"end_timestamp"=>$rows[$previousShowIndex]['end_timestamp'], "end_timestamp"=>$rows[$previousShowIndex]['end_timestamp'],