From f76bb5209ec9a1cb85e3fe353186ea6fe793e4db Mon Sep 17 00:00:00 2001 From: drigato Date: Fri, 19 Jul 2013 12:46:04 -0400 Subject: [PATCH 1/4] CC-5222: Calendar: Ends time of show is missed in Weekly view --- .../public/js/fullcalendar/AIRTIME_DEV_README | 27 ++++++++++++------- .../public/js/fullcalendar/fullcalendar.js | 2 +- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/airtime_mvc/public/js/fullcalendar/AIRTIME_DEV_README b/airtime_mvc/public/js/fullcalendar/AIRTIME_DEV_README index ffa4294a0..5b10a3157 100644 --- a/airtime_mvc/public/js/fullcalendar/AIRTIME_DEV_README +++ b/airtime_mvc/public/js/fullcalendar/AIRTIME_DEV_README @@ -3,14 +3,14 @@ in this file. Running a diff between the original fullcalendar.js and our modified one: -martin@Thinkpad-T410:~/workspace/airtime/airtime_mvc/public/js/fullcalendar$ diff -u fullcalendar_orig.js fullcalendar.js ---- fullcalendar_orig.js 2011-04-09 17:13:15.000000000 -0400 -+++ fullcalendar.js 2011-11-18 17:03:57.000000000 -0500 +denise@denise-desktop:~/airtime/airtime_mvc/public/js/fullcalendar$ diff -u fullcalendar_orig.js fullcalendar.js +--- fullcalendar_orig.js 2013-05-24 08:33:54.462735215 -0400 ++++ fullcalendar.js 2013-07-19 12:42:37.274284180 -0400 @@ -1,6 +1,6 @@ /** * @preserve -- * FullCalendar v1.5.1 -+ * FullCalendar v1.5.1-CUSTOM (Changes by Martin Konecny -added primitive support for timezones) +- * FullCalendar v1.5.3 ++ * FullCalendar v1.5.3-CUSTOM (Changes by Martin Konecny -added primitive support for timezones) * http://arshaw.com/fullcalendar/ * * Use fullcalendar.css for basic styling. @@ -23,7 +23,7 @@ martin@Thinkpad-T410:~/workspace/airtime/airtime_mvc/public/js/fullcalendar$ dif var events = []; var _dragElement; -@@ -2275,7 +2275,7 @@ +@@ -2277,7 +2277,7 @@ function updateCells(firstTime) { var dowDirty = firstTime || rowCnt == 1; // could the cells' day-of-weeks need updating? var month = t.start.getMonth(); @@ -32,7 +32,7 @@ martin@Thinkpad-T410:~/workspace/airtime/airtime_mvc/public/js/fullcalendar$ dif var cell; var date; var row; -@@ -3108,7 +3108,7 @@ +@@ -3110,7 +3110,7 @@ var headCell; var bodyCell; var date; @@ -41,9 +41,16 @@ martin@Thinkpad-T410:~/workspace/airtime/airtime_mvc/public/js/fullcalendar$ dif for (i=0; i Date: Tue, 23 Jul 2013 17:39:38 -0400 Subject: [PATCH 2/4] CC-5285: API Request: Get ON AIR light status --- .../application/controllers/ApiController.php | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index 63c24d14a..f8017eb43 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -209,6 +209,44 @@ class ApiController extends Zend_Controller_Action } } + public function onAirLightAction() + { + $this->view->layout()->disableLayout(); + $this->_helper->viewRenderer->setNoRender(true); + + $result = array(); + $result["on_air_light"] = false; + $result["on_air_light_expected_status"] = false; + $result["station_down"] = false; + + $range = Application_Model_Schedule::GetPlayOrderRange(); + + $isItemCurrentlyPlaying = !is_null($range["current"]) && + $range["current"]["media_item_played"] && + count($range["currentShow"]) > 0; + + if ($isItemCurrentlyPlaying || + Application_Model_Preference::GetSourceSwitchStatus("live_dj") == "on" || + Application_Model_Preference::GetSourceSwitchStatus("master_dj") == "on") + { + $result["on_air_light_expected_status"] = true; + } + + if (($isItemCurrentlyPlaying && + Application_Model_Preference::GetSourceSwitchStatus("scheduled_play") == "on")|| + Application_Model_Preference::GetSourceSwitchStatus("live_dj") == "on" || + Application_Model_Preference::GetSourceSwitchStatus("master_dj") == "on") + { + $result["on_air_light"] = true; + } + + if ($result["on_air_light_expected_status"] != $result["on_air_light"]) { + $result["station_down"] = true; + } + + echo isset($_GET['callback']) ? $_GET['callback'].'('.json_encode($result).')' : json_encode($result); + } + /** * Retrieve the currently playing show as well as upcoming shows. * Number of shows returned and the time interval in which to From d9859ff006081d5b2ee300749cc91d6ae946f32d Mon Sep 17 00:00:00 2001 From: drigato Date: Wed, 24 Jul 2013 15:17:10 -0400 Subject: [PATCH 3/4] CC-5285: API Request: Get ON AIR light status --- airtime_mvc/application/controllers/ApiController.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index f8017eb43..5246c323b 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -221,19 +221,18 @@ class ApiController extends Zend_Controller_Action $range = Application_Model_Schedule::GetPlayOrderRange(); - $isItemCurrentlyPlaying = !is_null($range["current"]) && - $range["current"]["media_item_played"] && - count($range["currentShow"]) > 0; + $isItemCurrentlyScheduled = !is_null($range["current"]) && count($range["currentShow"]) > 0 ? true : false; - if ($isItemCurrentlyPlaying || + $isCurrentItemPlaying = !isset($range["current"]["media_item_played"]) ? true : false; + + if ($isItemCurrentlyScheduled || Application_Model_Preference::GetSourceSwitchStatus("live_dj") == "on" || Application_Model_Preference::GetSourceSwitchStatus("master_dj") == "on") { $result["on_air_light_expected_status"] = true; } - if (($isItemCurrentlyPlaying && - Application_Model_Preference::GetSourceSwitchStatus("scheduled_play") == "on")|| + if (($isItemCurrentlyScheduled && $isCurrentItemPlaying) || Application_Model_Preference::GetSourceSwitchStatus("live_dj") == "on" || Application_Model_Preference::GetSourceSwitchStatus("master_dj") == "on") { From 4cbbd1145bc06a789e1895990ce3cd48ecdc4ed2 Mon Sep 17 00:00:00 2001 From: drigato Date: Wed, 24 Jul 2013 15:30:49 -0400 Subject: [PATCH 4/4] CC-5285: API Request: Get ON AIR light status --- airtime_mvc/application/controllers/ApiController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index 5246c323b..6c16dc07a 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -223,7 +223,7 @@ class ApiController extends Zend_Controller_Action $isItemCurrentlyScheduled = !is_null($range["current"]) && count($range["currentShow"]) > 0 ? true : false; - $isCurrentItemPlaying = !isset($range["current"]["media_item_played"]) ? true : false; + $isCurrentItemPlaying = $range["current"]["media_item_played"] ? true : false; if ($isItemCurrentlyScheduled || Application_Model_Preference::GetSourceSwitchStatus("live_dj") == "on" ||