CC-3174 : showbuilder

unsetting playlist id in the session properly.
This commit is contained in:
Naomi Aro 2012-02-07 18:42:34 +01:00
parent 529f3fa52f
commit 668e214371
2 changed files with 10 additions and 4 deletions

View file

@ -36,7 +36,12 @@ class PlaylistController extends Zend_Controller_Action
private function changePlaylist($pl_id) private function changePlaylist($pl_id)
{ {
$this->pl_sess->id = intval($pl_id); if (is_null($pl_id)) {
unset($this->pl_sess->id);
}
else {
$this->pl_sess->id = intval($pl_id);
}
} }
private function createUpdateResponse($pl) private function createUpdateResponse($pl)
@ -143,11 +148,11 @@ class PlaylistController extends Zend_Controller_Action
$this->changePlaylist(null); $this->changePlaylist(null);
} }
else { else {
$pl = $this->getPlaylist();
Logging::log("Not deleting currently active playlist"); Logging::log("Not deleting currently active playlist");
} }
Application_Model_Playlist::DeletePlaylists($ids); Application_Model_Playlist::DeletePlaylists($ids);
$pl = $this->getPlaylist();
} }
catch(PlaylistNotFoundException $e) { catch(PlaylistNotFoundException $e) {
Logging::log("Playlist not found"); Logging::log("Playlist not found");

View file

@ -593,8 +593,9 @@ var AIRTIME = (function(AIRTIME){
$(playlist).delegate("#spl_new", $(playlist).delegate("#spl_new",
{"click": AIRTIME.playlist.fnNew}); {"click": AIRTIME.playlist.fnNew});
$(playlist).delegate("#spl_delete", $(playlist).delegate("#spl_delete", {"click": function(ev){
{"click": AIRTIME.playlist.fnDelete}); AIRTIME.playlist.fnDelete();
}});
setPlaylistEntryEvents(playlist); setPlaylistEntryEvents(playlist);
setCueEvents(playlist); setCueEvents(playlist);