From 3230f1423182f48c7d141916f0afd71b913a4cb0 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Mon, 20 Aug 2012 18:35:10 -0400 Subject: [PATCH] CC-1665: Scheduled stream rebroadcasting and recording -Fixed delete button on right side of library screen not working --- .../controllers/WebstreamController.php | 10 ++++++++ .../views/scripts/webstream/webstream.phtml | 6 +++-- airtime_mvc/public/js/airtime/library/spl.js | 23 ++++++++++++++++++- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/application/controllers/WebstreamController.php b/airtime_mvc/application/controllers/WebstreamController.php index 73ad7fc59..bf67e13bd 100644 --- a/airtime_mvc/application/controllers/WebstreamController.php +++ b/airtime_mvc/application/controllers/WebstreamController.php @@ -8,6 +8,7 @@ class WebstreamController extends Zend_Controller_Action $ajaxContext->addActionContext('new', 'json') ->addActionContext('save', 'json') ->addActionContext('edit', 'json') + ->addActionContext('delete', 'json') ->initContext(); //TODO //$this->pl_sess = new Zend_Session_Namespace(UI_PLAYLIST_SESSNAME); @@ -46,6 +47,15 @@ class WebstreamController extends Zend_Controller_Action $this->view->html = $this->view->render('webstream/webstream.phtml'); } + public function deleteAction() + { + $request = $this->getRequest(); + $id = $request->getParam("ids"); + + $webstream = CcWebstreamQuery::create()->findPK($id)->delete(); + + } + public function saveAction() { $request = $this->getRequest(); diff --git a/airtime_mvc/application/views/scripts/webstream/webstream.phtml b/airtime_mvc/application/views/scripts/webstream/webstream.phtml index d3660bfc4..939cfffde 100644 --- a/airtime_mvc/application/views/scripts/webstream/webstream.phtml +++ b/airtime_mvc/application/views/scripts/webstream/webstream.phtml @@ -4,9 +4,11 @@ ws)) : ?> - - + + ws->getLastModified('U'); ?>"> + +

diff --git a/airtime_mvc/public/js/airtime/library/spl.js b/airtime_mvc/public/js/airtime/library/spl.js index 92bf939c9..5a820bb32 100644 --- a/airtime_mvc/public/js/airtime/library/spl.js +++ b/airtime_mvc/public/js/airtime/library/spl.js @@ -6,7 +6,7 @@ var AIRTIME = (function(AIRTIME){ if (AIRTIME.playlist === undefined) { AIRTIME.playlist = {}; - } + } var mod = AIRTIME.playlist, viewport, @@ -802,6 +802,23 @@ var AIRTIME = (function(AIRTIME){ redrawLib(); }); }; + + mod.fnWsDelete = function(wsid) { + var url, id, lastMod; + + stopAudioPreview(); + id = (wsid === undefined) ? getId() : wsid; + lastMod = getModified(); + type = $('#obj_type').val(); + url = '/Webstream/delete'; + + $.post(url, + {format: "json", ids: id, modified: lastMod, type: type}, + function(json){ + openPlaylist(json); + redrawLib(); + }); + }; mod.disableUI = function() { @@ -903,6 +920,10 @@ var AIRTIME = (function(AIRTIME){ $pl.delegate("#spl_delete", {"click": function(ev){ AIRTIME.playlist.fnDelete(); }}); + + $pl.delegate("#ws_delete", {"click": function(ev){ + AIRTIME.playlist.fnWsDelete(); + }}); setPlaylistEntryEvents(); setCueEvents();