From 7dcd6c78e5ba698913b06958db548d6b58ba7d8b Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 31 Mar 2011 12:39:12 -0400 Subject: [PATCH 1/6] CC-2031: Put extra 'Add this show' button at bottom of Add show box -Done. Just need Vladimir to fix up the css. --- application/views/scripts/schedule/add-show-form.phtml | 8 +++++++- public/js/airtime/schedule/add-show.js | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/application/views/scripts/schedule/add-show-form.phtml b/application/views/scripts/schedule/add-show-form.phtml index 9d8613d7d..bd34fb341 100644 --- a/application/views/scripts/schedule/add-show-form.phtml +++ b/application/views/scripts/schedule/add-show-form.phtml @@ -1,7 +1,7 @@
Close - @@ -30,5 +30,11 @@
style; ?>
+
+ +
diff --git a/public/js/airtime/schedule/add-show.js b/public/js/airtime/schedule/add-show.js index 329391086..0299754ce 100644 --- a/public/js/airtime/schedule/add-show.js +++ b/public/js/airtime/schedule/add-show.js @@ -181,7 +181,7 @@ function setAddShowEvents() { makeAddShowButton(); }); - form.find("#add-show-submit") + form.find(".add-show-submit") .click(function(event){ event.preventDefault(); From 4241e8341e0f9d0fa326741840d97613482086bb Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 31 Mar 2011 14:33:47 -0400 Subject: [PATCH 2/6] CC-2087: Pressing twice on "add this show" creates two instances of the show -Fixed on the client side only. Possibly create a ticket for next release to implement table locking on server side. --- public/js/airtime/schedule/add-show.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/public/js/airtime/schedule/add-show.js b/public/js/airtime/schedule/add-show.js index 0299754ce..480530e7e 100644 --- a/public/js/airtime/schedule/add-show.js +++ b/public/js/airtime/schedule/add-show.js @@ -183,6 +183,13 @@ function setAddShowEvents() { form.find(".add-show-submit") .click(function(event){ + var addShowButton = $(this); + if (!addShowButton.hasClass("disabled")){ + addShowButton.addClass("disabled"); + } else { + return; + } + event.preventDefault(); var data = $("form").serializeArray(); @@ -203,6 +210,7 @@ function setAddShowEvents() { var end_date = $("#add_show_end_date").val(); $.post("/Schedule/add-show", {format: "json", data: data, hosts: hosts, days: days}, function(json){ + addShowButton.removeClass("disabled"); if(json.form) { $("#add-show-form") .empty() From c34b25883f15134ef8ceeb42c55a6d3015e82cfe Mon Sep 17 00:00:00 2001 From: Paul Baranowski Date: Thu, 31 Mar 2011 14:40:55 -0400 Subject: [PATCH 3/6] CC-2137: Playlist builder doesnt work. Shows blank page Fixed bug with new return type from Playlist::create() in the PlaylistController. --- .../controllers/PlaylistController.php | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/application/controllers/PlaylistController.php b/application/controllers/PlaylistController.php index e32eb2e59..1540f0259 100644 --- a/application/controllers/PlaylistController.php +++ b/application/controllers/PlaylistController.php @@ -28,7 +28,7 @@ class PlaylistController extends Zend_Controller_Action private function getPlaylist() { $pl_sess = $this->pl_sess; - + if(isset($pl_sess->id)) { $pl = Playlist::Recall($pl_sess->id); @@ -43,7 +43,7 @@ class PlaylistController extends Zend_Controller_Action private function changePlaylist($pl_id) { $pl_sess = $this->pl_sess; - + if(isset($pl_sess->id)) { $pl = Playlist::Recall($pl_sess->id); @@ -51,13 +51,13 @@ class PlaylistController extends Zend_Controller_Action $this->closePlaylist($pl); } } - + $userInfo = Zend_Auth::getInstance()->getStorage()->read(); $pl = Playlist::Recall($pl_id); if($pl === FALSE) { return FALSE; - } + } $pl->lock($userInfo->id); $pl_sess->id = $pl_id; } @@ -78,7 +78,7 @@ class PlaylistController extends Zend_Controller_Action $this->view->headScript()->appendFile('/js/airtime/library/spl.js','text/javascript'); $this->view->headLink()->appendStylesheet('/css/playlist_builder.css'); - $this->_helper->viewRenderer->setResponseSegment('spl'); + $this->_helper->viewRenderer->setResponseSegment('spl'); $this->view->pl = $this->getPlaylist(); } @@ -88,10 +88,10 @@ class PlaylistController extends Zend_Controller_Action $userInfo = Zend_Auth::getInstance()->getStorage()->read(); $pl = new Playlist(); - $pl_id = $pl->create("Untitled Playlist"); + $pl->create("Untitled Playlist"); $pl->setPLMetaData('dc:creator', $userInfo->login); - $this->changePlaylist($pl_id); + $this->changePlaylist($pl->getId()); $form = new Application_Form_PlaylistMetadata(); $this->view->fieldset = $form; $this->view->form = $this->view->render('playlist/new.phtml'); @@ -105,25 +105,25 @@ class PlaylistController extends Zend_Controller_Action $pl_id = $this->_getParam('id', null); //not a new playlist if(!is_null($pl_id)) { - $this->changePlaylist($pl_id); - + $this->changePlaylist($pl_id); + $pl = $this->getPlaylist(); $title = $pl->getPLMetaData(UI_MDATA_KEY_TITLE); $desc = $pl->getPLMetaData(UI_MDATA_KEY_DESCRIPTION); - $data = array( 'title' => $title, 'description' => $desc); - $form->populate($data); + $data = array( 'title' => $title, 'description' => $desc); + $form->populate($data); } - + if ($request->isPost()) { $title = $this->_getParam('title', null); $description = $this->_getParam('description', null); $pl = $this->getPlaylist(); - + if($title) $pl->setName($title); - + if(isset($description)) { $pl->setPLMetaData(UI_MDATA_KEY_DESCRIPTION, $description); } @@ -132,7 +132,7 @@ class PlaylistController extends Zend_Controller_Action $this->view->html = $this->view->render('playlist/index.phtml'); unset($this->view->pl); } - + $this->view->fieldset = $form; $this->view->form = $this->view->render('playlist/new.phtml'); } @@ -140,13 +140,13 @@ class PlaylistController extends Zend_Controller_Action public function editAction() { $pl_id = $this->_getParam('id', null); - + if(!is_null($pl_id)) { - $this->changePlaylist($pl_id); + $this->changePlaylist($pl_id); } - + $pl = $this->getPlaylist(); - + $this->view->pl = $pl; $this->view->html = $this->view->render('playlist/index.phtml'); unset($this->view->pl); @@ -158,7 +158,7 @@ class PlaylistController extends Zend_Controller_Action $pos = $this->_getParam('pos', null); if (!is_null($id)) { - + $pl = $this->getPlaylist(); $res = $pl->addAudioClip($id, $pos); @@ -181,7 +181,7 @@ class PlaylistController extends Zend_Controller_Action { $oldPos = $this->_getParam('oldPos'); $newPos = $this->_getParam('newPos'); - + $pl = $this->getPlaylist(); $pl->moveAudioClip($oldPos, $newPos); @@ -197,7 +197,7 @@ class PlaylistController extends Zend_Controller_Action public function deleteItemAction() { $positions = $this->_getParam('pos', array()); - + if (!is_array($positions)) $positions = array($positions); @@ -208,7 +208,7 @@ class PlaylistController extends Zend_Controller_Action $pl = $this->getPlaylist(); foreach ($positions as $pos) { - $pl->delAudioClip($pos); + $pl->delAudioClip($pos); } $this->view->pl = $pl; @@ -274,7 +274,7 @@ class PlaylistController extends Zend_Controller_Action { $id = $this->_getParam('id', null); $pl = Playlist::Recall($id); - + if ($pl !== FALSE) { Playlist::Delete($id); @@ -291,7 +291,7 @@ class PlaylistController extends Zend_Controller_Action public function deleteActiveAction() { - $pl = $this->getPlaylist(); + $pl = $this->getPlaylist(); Playlist::Delete($pl->getId()); $pl_sess = $this->pl_sess; @@ -304,7 +304,7 @@ class PlaylistController extends Zend_Controller_Action { $pl = $this->getPlaylist(); $this->closePlaylist($pl); - + $this->view->html = $this->view->render('playlist/index.phtml'); } From fdc8a1398747587880635b231501bc01df2df8b6 Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 31 Mar 2011 14:51:34 -0400 Subject: [PATCH 4/6] -buttons are now back to their original size --- public/css/redmond/jquery-ui-1.8.8.custom.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/css/redmond/jquery-ui-1.8.8.custom.css b/public/css/redmond/jquery-ui-1.8.8.custom.css index 2c0fc66a3..aaef2c929 100644 --- a/public/css/redmond/jquery-ui-1.8.8.custom.css +++ b/public/css/redmond/jquery-ui-1.8.8.custom.css @@ -1085,7 +1085,7 @@ button.ui-button-icons-only { padding-right: 2.1em; } /* no icon support for input elements, provide padding by default */ -input.ui-button, button.ui-button { +input.ui-button { padding: .4em 1em; } /*button icon element(s) */ From d0035e8e4c3af11fb509f0ff9ac067602512bd34 Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 31 Mar 2011 16:39:32 -0400 Subject: [PATCH 5/6] CC-2119: "Show Content" should display what it is going to rebroadcast -done --- application/controllers/ScheduleController.php | 11 +++++++++++ .../views/scripts/schedule/show-content-dialog.phtml | 1 + 2 files changed, 12 insertions(+) diff --git a/application/controllers/ScheduleController.php b/application/controllers/ScheduleController.php index d1fa6cf90..9473cf90e 100644 --- a/application/controllers/ScheduleController.php +++ b/application/controllers/ScheduleController.php @@ -319,6 +319,17 @@ class ScheduleController extends Zend_Controller_Action $showInstanceId = $this->_getParam('id'); $show = new ShowInstance($showInstanceId); + $originalShowId = $show->isRebroadcast(); + if (!is_null($originalShowId)){ + $originalShow = new ShowInstance($originalShowId); + $originalShowName = $originalShow->getName(); + $originalShowStart = $originalShow->getShowStart(); + + $timestamp = strtotime($originalShowStart); + $this->view->additionalShowInfo = + "Rebroadcast of show \"$originalShowName\" from " + .date("l, F jS", $timestamp)." at ".date("G:i", $timestamp); + } $this->view->showContent = $show->getShowListContent(); $this->view->dialog = $this->view->render('schedule/show-content-dialog.phtml'); unset($this->view->showContent); diff --git a/application/views/scripts/schedule/show-content-dialog.phtml b/application/views/scripts/schedule/show-content-dialog.phtml index 59dab4fbe..4e5aac630 100644 --- a/application/views/scripts/schedule/show-content-dialog.phtml +++ b/application/views/scripts/schedule/show-content-dialog.phtml @@ -1,4 +1,5 @@
+
additionalShowInfo; ?>
From f74b0a562e8530344bd1af422968d6d7a4aae0b8 Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 31 Mar 2011 17:10:25 -0400 Subject: [PATCH 6/6] -removed "Cancel current show" option for Guest user. --- application/controllers/ScheduleController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/application/controllers/ScheduleController.php b/application/controllers/ScheduleController.php index 9473cf90e..31ce6d3f2 100644 --- a/application/controllers/ScheduleController.php +++ b/application/controllers/ScheduleController.php @@ -176,11 +176,11 @@ class ScheduleController extends Zend_Controller_Action if (strtotime($show->getShowStart()) <= strtotime($today_timestamp) && - strtotime($today_timestamp) < strtotime($show->getShowEnd())) { + strtotime($today_timestamp) < strtotime($show->getShowEnd()) && + $user->isAdmin()) { $menu[] = array('action' => array('type' => 'fn', - //'url' => '/Schedule/cancel-current-show'.$params, - 'callback' => "window['confirmCancelShow']($id)"), - 'title' => 'Cancel Current Show'); + 'callback' => "window['confirmCancelShow']($id)"), + 'title' => 'Cancel Current Show'); } if (strtotime($today_timestamp) < strtotime($show->getShowStart())) {
Start