From ab7da1ce90c2c01ea2589583cfbab0a09f44a270 Mon Sep 17 00:00:00 2001 From: James Date: Wed, 4 Apr 2012 15:44:52 -0400 Subject: [PATCH] CC-3581: Calendar->It should not be possible to change the duration for the recorded show - "When" section is disabled when editting rebroadcasting show --- .../controllers/ScheduleController.php | 18 +++++++++++++++--- .../public/js/airtime/schedule/schedule.js | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index f806b8ff5..ac023a68c 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -263,7 +263,11 @@ class ScheduleController extends Zend_Controller_Action $menu["edit"]["items"]["instance"] = array("name"=> "Edit Show Instance", "icon" => "edit", "url" => "/Schedule/edit-show"); $menu["edit"]["items"]["all"] = array("name"=> "Edit Show", "icon" => "edit", "url" => "/Schedule/edit-show"); }else{ - $menu["edit"] = array("name"=> "Edit Show", "icon" => "edit", "url" => "/Schedule/edit-show"); + if($instance->isRebroadcast()){ + $menu["edit"] = array("name"=> "Edit Show", "icon" => "edit", "_type"=>"rebroadcast", "url" => "/Schedule/edit-show"); + }else{ + $menu["edit"] = array("name"=> "Edit Show", "icon" => "edit", "_type"=>"all", "url" => "/Schedule/edit-show"); + } } if($isAdminOrPM){ $menu["cancel"] = array("name"=> "Cancel Current Show", "icon" => "delete"); @@ -280,7 +284,11 @@ class ScheduleController extends Zend_Controller_Action $menu["edit"]["items"]["instance"] = array("name"=> "Edit Show Instance", "icon" => "edit", "url" => "/Schedule/edit-show"); $menu["edit"]["items"]["all"] = array("name"=> "Edit Show", "icon" => "edit", "url" => "/Schedule/edit-show"); }else{ - $menu["edit"] = array("name"=> "Edit Show", "icon" => "edit", "url" => "/Schedule/edit-show"); + if($instance->isRebroadcast()){ + $menu["edit"] = array("name"=> "Edit Show", "icon" => "edit", "_type"=>"rebroadcast", "url" => "/Schedule/edit-show"); + }else{ + $menu["edit"] = array("name"=> "Edit Show", "icon" => "edit", "_type"=>"all", "url" => "/Schedule/edit-show"); + } } if ($instance->getShow()->isRepeating() && $isAdminOrPM) { @@ -433,7 +441,7 @@ class ScheduleController extends Zend_Controller_Action $showInstanceId = $this->_getParam('id'); // $type is used to determine if this edit is for the specific instance or for all - // repeating shows. It's value is either "instance" or "all" + // repeating shows. It's value is either "instance","rebroadcast", or "all" $type = $this->_getParam('type'); try{ @@ -586,6 +594,10 @@ class ScheduleController extends Zend_Controller_Action $formRepeats->disable(); $formStyle->disable(); } + + if($type == "rebroadcast"){ + $formWhen->disable(); + } $this->view->newForm = $this->view->render('schedule/add-show-form.phtml'); $this->view->entries = 5; diff --git a/airtime_mvc/public/js/airtime/schedule/schedule.js b/airtime_mvc/public/js/airtime/schedule/schedule.js index e5a47e00c..f132d5c3a 100644 --- a/airtime_mvc/public/js/airtime/schedule/schedule.js +++ b/airtime_mvc/public/js/airtime/schedule/schedule.js @@ -317,7 +317,7 @@ $(document).ready(function() { edit.all.callback = callback; }else{ callback = function() { - $.get(oItems.edit.url, {format: "json", id: data.id, type: "all"}, function(json){ + $.get(oItems.edit.url, {format: "json", id: data.id, type: oItems.edit._type}, function(json){ beginEditShow(json); }); };