From 6229ca46d5442f5d7d94ac42a06d2220f191f969 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 15 Nov 2011 16:27:23 -0500 Subject: [PATCH 1/3] CC-2959: Stream Setting: Status box design for each stream - integrated new status boxes --- airtime_mvc/application/forms/StreamSettingSubForm.php | 2 +- .../views/scripts/form/stream-setting-form.phtml | 5 +---- airtime_mvc/public/css/styles.css | 6 +++++- airtime_mvc/public/js/airtime/preferences/streamsetting.js | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/airtime_mvc/application/forms/StreamSettingSubForm.php b/airtime_mvc/application/forms/StreamSettingSubForm.php index 70e28a7ba..ad12ebe67 100644 --- a/airtime_mvc/application/forms/StreamSettingSubForm.php +++ b/airtime_mvc/application/forms/StreamSettingSubForm.php @@ -155,7 +155,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm{ } $this->addElement($user); - $liquidsopa_error_msg = "Getting infomation from the server.."; + $liquidsopa_error_msg = '

Getting information from the server...

'; $this->setDecorators(array( array('ViewScript', array('viewScript' => 'form/stream-setting-form.phtml', "stream_number"=>$stream_number, "liquidsoap_error_msg"=>$liquidsopa_error_msg)) diff --git a/airtime_mvc/application/views/scripts/form/stream-setting-form.phtml b/airtime_mvc/application/views/scripts/form/stream-setting-form.phtml index 07f8bf9bc..5417b35a6 100644 --- a/airtime_mvc/application/views/scripts/form/stream-setting-form.phtml +++ b/airtime_mvc/application/views/scripts/form/stream-setting-form.phtml @@ -5,10 +5,7 @@
stream_number != '1'?'style="display: none;':''?> id="-config">
-
- -
-
+
liquidsoap_error_msg?>
diff --git a/airtime_mvc/public/css/styles.css b/airtime_mvc/public/css/styles.css index 04fc58027..45078cbed 100644 --- a/airtime_mvc/public/css/styles.css +++ b/airtime_mvc/public/css/styles.css @@ -1095,6 +1095,10 @@ h2#scheduled_playlist_name span { width:60%; } +.simple-formblock .liquidsoap_status{ + width: 95%; +} + .simple-formblock dd.block-display { width: 100%; } @@ -2425,4 +2429,4 @@ dd .stream-status { } .status-disabled h3 { color:#646664; -} \ No newline at end of file +} diff --git a/airtime_mvc/public/js/airtime/preferences/streamsetting.js b/airtime_mvc/public/js/airtime/preferences/streamsetting.js index 09cc06529..bf29514c2 100644 --- a/airtime_mvc/public/js/airtime/preferences/streamsetting.js +++ b/airtime_mvc/public/js/airtime/preferences/streamsetting.js @@ -90,9 +90,9 @@ function checkLiquidsoapStatus(){ } var html if(status == "OK"){ - html = '

Streaming server connection is working

' + html = '

Connected to the streaming server

' }else if(status == "N/A"){ - html = '

Cannot connect to the streaming server

This stream is disabled

' + html = '

The stream is disabled

' }else{ html = '

Can not connect to the streaming server

'+status+'

' } From 46a87ea534b135bbe7c058bc01424a332662df9f Mon Sep 17 00:00:00 2001 From: Yuchen Wang Date: Tue, 15 Nov 2011 16:37:41 -0500 Subject: [PATCH 2/3] CC-2992: 404 "Help" link doesnt work Somehow my last change disappeared...submit again --- airtime_mvc/application/views/scripts/error/error.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/application/views/scripts/error/error.phtml b/airtime_mvc/application/views/scripts/error/error.phtml index e84196941..f3c889b1c 100644 --- a/airtime_mvc/application/views/scripts/error/error.phtml +++ b/airtime_mvc/application/views/scripts/error/error.phtml @@ -10,7 +10,7 @@

Page not found!

Looks like the page you were looking for doesn't exist!

- Help + Help
From 12172e5ad5ac1b2e99dd61a475ab72694aa83225 Mon Sep 17 00:00:00 2001 From: Naomi Aro Date: Wed, 16 Nov 2011 16:32:04 +0100 Subject: [PATCH 3/3] CC-3035 : Should be able to resize a show, have it affect all future instances of the show added a new resize function to Shows.php, should not use ShowInstance resize method, since you cannot resize just one instance currently. --- .../controllers/ScheduleController.php | 14 ++++----- airtime_mvc/application/models/Show.php | 29 +++++++++++++++++++ .../application/models/ShowInstance.php | 5 ++++ .../schedule/full-calendar-functions.js | 2 +- 4 files changed, 42 insertions(+), 8 deletions(-) diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index 89e88bbf6..f45ae2b9e 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -110,14 +110,14 @@ class ScheduleController extends Zend_Controller_Action { $deltaDay = $this->_getParam('day'); $deltaMin = $this->_getParam('min'); - $showInstanceId = $this->_getParam('showInstanceId'); + $showId = $this->_getParam('showId'); $userInfo = Zend_Auth::getInstance()->getStorage()->read(); $user = new Application_Model_User($userInfo->id); if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { try{ - $show = new Application_Model_ShowInstance($showInstanceId); + $show = new Application_Model_Show($showId); }catch(Exception $e){ $this->view->show_error = true; return false; @@ -296,12 +296,12 @@ class ScheduleController extends Zend_Controller_Action public function getCurrentPlaylistAction() { - + $range = Application_Model_Schedule::GetPlayOrderRange(); - + /* Convert all UTC times to localtime before sending back to user. */ if (isset($range["previous"])){ - $range["previous"]["starts"] = Application_Model_DateHelper::ConvertToLocalDateTimeString($range["previous"]["starts"]); + $range["previous"]["starts"] = Application_Model_DateHelper::ConvertToLocalDateTimeString($range["previous"]["starts"]); $range["previous"]["ends"] = Application_Model_DateHelper::ConvertToLocalDateTimeString($range["previous"]["ends"]); } if (isset($range["current"])){ @@ -312,10 +312,10 @@ class ScheduleController extends Zend_Controller_Action $range["next"]["starts"] = Application_Model_DateHelper::ConvertToLocalDateTimeString($range["next"]["starts"]); $range["next"]["ends"] = Application_Model_DateHelper::ConvertToLocalDateTimeString($range["next"]["ends"]); } - + Application_Model_Show::ConvertToLocalTimeZone($range["currentShow"], array("starts", "ends", "start_timestamp", "end_timestamp")); Application_Model_Show::ConvertToLocalTimeZone($range["nextShow"], array("starts", "ends", "start_timestamp", "end_timestamp")); - + $this->view->entries = $range; } diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index 20ed5e15d..f6e44fa6e 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -105,6 +105,35 @@ class Application_Model_Show { return $res; } + public function resizeShow($deltaDay, $deltaMin) + { + global $CC_DBC; + + $hours = $deltaMin/60; + if($hours > 0) + $hours = floor($hours); + else + $hours = ceil($hours); + + $mins = abs($deltaMin%60); + + //current timesamp in UTC. + $current_timestamp = Application_Model_DateHelper::ConvertToUtcDateTime(date("Y-m-d H:i:s"))->format("Y-m-d H:i:s"); + + //update all cc_show_instances that are in the future. + $sql = "UPDATE cc_show_instances SET ends = (ends + interval '{$deltaDay} days' + interval '{$hours}:{$mins}') + WHERE (show_id = {$this->_showId} AND starts > '$current_timestamp');"; + + //update cc_show_days so future shows can be created with the new duration. + $sql = $sql . " UPDATE cc_show_days SET duration = (CAST(duration AS interval) + interval '{$deltaDay} days' + interval '{$hours}:{$mins}') + WHERE show_id = {$this->_showId}"; + + //do both the queries at once. + $CC_DBC->query($sql); + + Application_Model_RabbitMq::PushSchedule(); + } + public function cancelShow($day_timestamp) { global $CC_DBC; diff --git a/airtime_mvc/application/models/ShowInstance.php b/airtime_mvc/application/models/ShowInstance.php index 865b5b71b..16f94a9e7 100644 --- a/airtime_mvc/application/models/ShowInstance.php +++ b/airtime_mvc/application/models/ShowInstance.php @@ -239,6 +239,11 @@ class Application_Model_ShowInstance { Application_Model_RabbitMq::PushSchedule(); } + /* + * FUNCTION SHOULD NOT BE CALLED + * - we are removing ability to resize just a single show instance + * -please use the resize method on the Show.php class. + */ public function resizeShow($deltaDay, $deltaMin) { global $CC_DBC; diff --git a/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js b/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js index 5a5627eee..9b21086d1 100644 --- a/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js +++ b/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js @@ -319,7 +319,7 @@ function eventResize( event, dayDelta, minuteDelta, revertFunc, jsEvent, ui, vie url = '/Schedule/resize-show/format/json'; $.post(url, - {day: dayDelta, min: minuteDelta, showInstanceId: event.id}, + {day: dayDelta, min: minuteDelta, showId: event.showId}, function(json){ if(json.show_error == true){ alertShowErrorAndReload();