diff --git a/airtime_mvc/application/controllers/PlaylistController.php b/airtime_mvc/application/controllers/PlaylistController.php index bfaf938de..c7da627f6 100644 --- a/airtime_mvc/application/controllers/PlaylistController.php +++ b/airtime_mvc/application/controllers/PlaylistController.php @@ -173,6 +173,7 @@ class PlaylistController extends Zend_Controller_Action $this->view->html = $this->view->render('playlist/update.phtml'); $this->view->name = $pl->getName(); $this->view->length = $pl->getLength(); + $this->view->pl_id = $pl->getid(); unset($this->view->pl); return; @@ -218,8 +219,11 @@ class PlaylistController extends Zend_Controller_Action $this->view->html = $this->view->render('playlist/update.phtml'); $this->view->name = $pl->getName(); $this->view->length = $pl->getLength(); + $this->view->pl_id = $pl->getid(); unset($this->view->pl); + + return; } public function setCueAction() diff --git a/airtime_mvc/application/models/Playlist.php b/airtime_mvc/application/models/Playlist.php index 826977be6..0fe12b71d 100644 --- a/airtime_mvc/application/models/Playlist.php +++ b/airtime_mvc/application/models/Playlist.php @@ -371,7 +371,7 @@ class Playlist { ->computeLength(); if(is_null($res)) - return '00:00:00.000000'; + return '00:00:00'; return $res; } diff --git a/airtime_mvc/public/js/airtime/library/library.js b/airtime_mvc/public/js/airtime/library/library.js index b7eae6079..2e22a8a97 100644 --- a/airtime_mvc/public/js/airtime/library/library.js +++ b/airtime_mvc/public/js/airtime/library/library.js @@ -94,6 +94,9 @@ function dtRowCallback( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { } $(nRow).attr("id", type+'_'+id); + + // insert id on lenth field + $('td:eq(4)', nRow).attr("id", "length"); $('td:eq(5) img', nRow).qtip({ diff --git a/airtime_mvc/public/js/airtime/library/spl.js b/airtime_mvc/public/js/airtime/library/spl.js index 89203600d..916471de7 100644 --- a/airtime_mvc/public/js/airtime/library/spl.js +++ b/airtime_mvc/public/js/airtime/library/spl.js @@ -258,6 +258,10 @@ function setSPLContent(json) { $(".spl_fade_control").click(openFadeEditor); //$(".spl_playlength").click(openCueEditor); $(".spl_cue").click(openCueEditor); + + //Update length on library list + $("#pl_"+json.pl_id).children("#length").empty().append(json.length); + //var pos = dt.fnGetPosition($("#pl_"+json.pl_id)); return false; } @@ -360,6 +364,10 @@ function createPlaylistMetaForm(json) { $.post(url, data, function(json){ openDiffSPL(json); }) + + //redraw the library list + dt = $("#library_display").dataTable(); + dt.fnDraw(); }); $("#side_playlist")