From d753b0bb02d40d038791864ce141289961de81bd Mon Sep 17 00:00:00 2001 From: Yuchen Wang Date: Fri, 13 Jan 2012 16:46:37 -0500 Subject: [PATCH] CC-3226: Record cancel dialog says "stop playback?" instead of "stop recording?" Done --- .../application/controllers/ScheduleController.php | 6 ++++++ airtime_mvc/public/js/airtime/schedule/schedule.js | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index 0df70a6b4..c78dcb270 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -235,9 +235,15 @@ class ScheduleController extends Zend_Controller_Action if ($showStartDateHelper->getTimestamp() <= $epochNow && $epochNow < $showEndDateHelper->getTimestamp() && $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) { + if ($show->isRecorded()) { + $menu[] = array('action' => array('type' => 'fn', + 'callback' => "window['confirmCancelRecordedShow']($id)"), + 'title' => 'Cancel Current Show'); + } else { $menu[] = array('action' => array('type' => 'fn', 'callback' => "window['confirmCancelShow']($id)"), 'title' => 'Cancel Current Show'); + } } if ($epochNow < $showStartDateHelper->getTimestamp()) { diff --git a/airtime_mvc/public/js/airtime/schedule/schedule.js b/airtime_mvc/public/js/airtime/schedule/schedule.js index f32a11dc4..9d6d085e1 100644 --- a/airtime_mvc/public/js/airtime/schedule/schedule.js +++ b/airtime_mvc/public/js/airtime/schedule/schedule.js @@ -184,6 +184,16 @@ function confirmCancelShow(show_instance_id){ } } +function confirmCancelRecordedShow(show_instance_id){ + if(confirm('Erase current show and stop recording?')){ + var url = "/Schedule/cancel-current-show/id/"+show_instance_id; + $.ajax({ + url: url, + success: function(data){scheduleRefetchEvents(data);} + }); + } +} + function uploadToSoundCloud(show_instance_id){ var url = "/Schedule/upload-to-sound-cloud";