Merge branch '2.1.x' into devel

This commit is contained in:
denise 2012-07-03 14:57:16 -04:00
commit 598bf8942c
3 changed files with 21 additions and 13 deletions

View file

@ -277,20 +277,27 @@ class ApiController extends Zend_Controller_Action
if($type == "endofday") {
// make GetNextShows use end of day
$utcTimeEnd = Application_Common_DateHelper::GetDayEndTimestampInUtc();
$result = array("env"=>APPLICATION_ENV,
"schedulerTime"=>gmdate("Y-m-d H:i:s"),
"nextShow"=>Application_Model_Show::GetNextShows($utcTimeNow, 5, $utcTimeEnd));
Application_Model_Show::ConvertToLocalTimeZone($result["nextShow"], array("starts", "ends", "start_timestamp", "end_timestamp"));
}else{
$limit = $request->getParam('limit');
if($limit == "" || !is_numeric($limit)) {
$limit = "5";
}
$result = Application_Model_Schedule::GetPlayOrderRange();
//Convert from UTC to localtime for user.
Application_Model_Show::ConvertToLocalTimeZone($result["currentShow"], array("starts", "ends", "start_timestamp", "end_timestamp"));
Application_Model_Show::ConvertToLocalTimeZone($result["nextShow"], array("starts", "ends", "start_timestamp", "end_timestamp"));
}
$limit = $request->getParam('limit');
if($limit == "" || !is_numeric($limit)) {
$limit = "5";
}
$result = Application_Model_Schedule::GetPlayOrderRange();
$result['AIRTIME_API_VERSION'] = AIRTIME_API_VERSION; //used by caller to determine if the airtime they are running or widgets in use is out of date.
//Convert from UTC to localtime for user.
Application_Model_Show::ConvertToLocalTimeZone($result["currentShow"], array("starts", "ends", "start_timestamp", "end_timestamp"));
Application_Model_Show::ConvertToLocalTimeZone($result["nextShow"], array("starts", "ends", "start_timestamp", "end_timestamp"));
//echo json_encode($result);
header("Content-type: text/javascript");
echo $_GET['callback'].'('.json_encode($result).')';