Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
Rudi Grinberg 2012-08-21 12:50:42 -04:00
commit e15d345b4f
10 changed files with 165 additions and 99 deletions

View File

@ -8,38 +8,38 @@
* the navigation container below. * the navigation container below.
*/ */
$pages = array( $pages = array(
array( array(
'label' => 'Now Playing', 'label' => 'Now Playing',
'module' => 'default', 'module' => 'default',
'controller' => 'Showbuilder', 'controller' => 'Showbuilder',
'action' => 'index', 'action' => 'index',
'resource' => 'showbuilder' 'resource' => 'showbuilder'
), ),
array( array(
'label' => 'Add Media', 'label' => 'Add Media',
'module' => 'default', 'module' => 'default',
'controller' => 'Plupload', 'controller' => 'Plupload',
'action' => 'index', 'action' => 'index',
'resource' => 'plupload' 'resource' => 'plupload'
), ),
array( array(
'label' => 'Library', 'label' => 'Library',
'module' => 'default', 'module' => 'default',
'controller' => 'Playlist', 'controller' => 'Library',
'action' => 'index', 'action' => 'index',
'resource' => 'playlist' 'resource' => 'playlist'
), ),
array( array(
'label' => 'Calendar', 'label' => 'Calendar',
'module' => 'default', 'module' => 'default',
'controller' => 'Schedule', 'controller' => 'Schedule',
'action' => 'index', 'action' => 'index',
'resource' => 'schedule' 'resource' => 'schedule'
), ),
array( array(
'label' => 'System', 'label' => 'System',
'uri' => '#', 'uri' => '#',
'resource' => 'preference', 'resource' => 'preference',
'pages' => array( 'pages' => array(
array( array(
'label' => 'Preferences', 'label' => 'Preferences',
@ -51,14 +51,14 @@ $pages = array(
'module' => 'default', 'module' => 'default',
'controller' => 'user', 'controller' => 'user',
'action' => 'add-user', 'action' => 'add-user',
'resource' => 'user' 'resource' => 'user'
), ),
array( array(
'label' => 'Media Folders', 'label' => 'Media Folders',
'module' => 'default', 'module' => 'default',
'controller' => 'Preference', 'controller' => 'Preference',
'action' => 'directory-config', 'action' => 'directory-config',
'id' => 'manage_folder' 'id' => 'manage_folder'
), ),
array( array(
'label' => 'Streams', 'label' => 'Streams',
@ -77,28 +77,28 @@ $pages = array(
'module' => 'default', 'module' => 'default',
'controller' => 'systemstatus', 'controller' => 'systemstatus',
'action' => 'index', 'action' => 'index',
'resource' => 'systemstatus' 'resource' => 'systemstatus'
), ),
array( array(
'label' => 'Playout History', 'label' => 'Playout History',
'module' => 'default', 'module' => 'default',
'controller' => 'playouthistory', 'controller' => 'playouthistory',
'action' => 'index', 'action' => 'index',
'resource' => 'playouthistory' 'resource' => 'playouthistory'
) )
) )
), ),
array( array(
'label' => 'Help', 'label' => 'Help',
'uri' => '#', 'uri' => '#',
'resource' => 'dashboard', 'resource' => 'dashboard',
'pages' => array( 'pages' => array(
array( array(
'label' => 'Getting Started', 'label' => 'Getting Started',
'module' => 'default', 'module' => 'default',
'controller' => 'dashboard', 'controller' => 'dashboard',
'action' => 'help', 'action' => 'help',
'resource' => 'dashboard' 'resource' => 'dashboard'
), ),
array( array(
'label' => 'User Manual', 'label' => 'User Manual',
@ -110,10 +110,10 @@ $pages = array(
'module' => 'default', 'module' => 'default',
'controller' => 'dashboard', 'controller' => 'dashboard',
'action' => 'about', 'action' => 'about',
'resource' => 'dashboard' 'resource' => 'dashboard'
) )
) )
) )
); );

View File

@ -27,6 +27,65 @@ class LibraryController extends Zend_Controller_Action
$this->search_sess = new Zend_Session_Namespace("search"); $this->search_sess = new Zend_Session_Namespace("search");
} }
public function indexAction()
{
global $CC_CONFIG;
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
$this->view->headScript()->appendFile($baseUrl.'/js/blockui/jquery.blockUI.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/contextmenu/jquery.contextMenu.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/js/jquery.dataTables.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.pluginAPI.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.fnSetFilteringDelay.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.ColVis.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.ColReorder.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.FixedColumns.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/buttons/buttons.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/utilities/utilities.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/library/library.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($this->view->baseUrl('/js/airtime/library/events/library_playlistbuilder.js'), 'text/javascript');
$this->view->headLink()->appendStylesheet($baseUrl.'/css/media_library.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'/css/jquery.contextMenu.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'/css/datatables/css/ColVis.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'/css/datatables/css/ColReorder.css?'.$CC_CONFIG['airtime_version']);
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/library/spl.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/playlist/smart_blockbuilder.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headLink()->appendStylesheet($baseUrl.'/css/playlist_builder.css?'.$CC_CONFIG['airtime_version']);
try {
if (isset($this->obj_sess->id)) {
$objInfo = Application_Model_Playlist::getObjInfo($this->obj_sess->type);
$obj = new $objInfo['className']($this->obj_sess->id);
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new Application_Model_User($userInfo->id);
$isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
if ($isAdminOrPM || $obj->getCreatorId() == $userInfo->id) {
$this->view->obj = $obj;
if ($this->obj_sess->type == "block") {
$form = new Application_Form_SmartBlockCriteria();
$form->startForm($this->obj_sess->id);
$this->view->form = $form;
}
}
$formatter = new LengthFormatter($obj->getLength());
$this->view->length = $formatter->format();
$this->view->type = $this->obj_sess->type;
}
} catch (PlaylistNotFoundException $e) {
$this->playlistNotFound($this->obj_sess->type);
} catch (Exception $e) {
$this->playlistUnknownError($e);
}
}
public function contextMenuAction() public function contextMenuAction()
{ {
$id = $this->_getParam('id'); $id = $this->_getParam('id');
@ -270,7 +329,7 @@ class LibraryController extends Zend_Controller_Action
Logging::log($data['MDATA_KEY_FILEPATH']); Logging::log($data['MDATA_KEY_FILEPATH']);
Application_Model_RabbitMq::SendMessageToMediaMonitor("md_update", $data); Application_Model_RabbitMq::SendMessageToMediaMonitor("md_update", $data);
$this->_redirect('Playlist'); $this->_redirect('Library');
} }
} }

View File

@ -39,7 +39,7 @@ class PlaylistController extends Zend_Controller_Action
{ {
$obj = null; $obj = null;
$objInfo = $this->getObjInfo($p_type); $objInfo = Application_Model_Playlist::getObjInfo($p_type);
if (isset($this->obj_sess->id)) { if (isset($this->obj_sess->id)) {
$obj = new $objInfo['className']($this->obj_sess->id); $obj = new $objInfo['className']($this->obj_sess->id);
@ -106,14 +106,13 @@ class PlaylistController extends Zend_Controller_Action
} else { } else {
$this->view->html = $this->view->render($viewPath); $this->view->html = $this->view->render($viewPath);
} }
}else{ } else {
$this->view->obj = $obj; $this->view->obj = $obj;
$this->view->id = $obj->getId(); $this->view->id = $obj->getId();
$this->view->html = $this->view->render($viewPath); $this->view->html = $this->view->render($viewPath);
unset($this->view->obj); unset($this->view->obj);
} }
} } else {
else {
$this->view->html = $this->view->render($viewPath); $this->view->html = $this->view->render($viewPath);
} }
} }
@ -138,7 +137,8 @@ class PlaylistController extends Zend_Controller_Action
$this->createFullResponse(null); $this->createFullResponse(null);
} }
private function playlistNoPermission($p_type){ private function playlistNoPermission($p_type)
{
$this->view->error = "You don't have permission to delete selected {$p_type}(s)."; $this->view->error = "You don't have permission to delete selected {$p_type}(s).";
} }
@ -151,12 +151,14 @@ class PlaylistController extends Zend_Controller_Action
Logging::log("{$e->getMessage()}"); Logging::log("{$e->getMessage()}");
} }
private function wrongTypeToBlock($obj) { private function wrongTypeToBlock($obj)
{
$this->view->error = "You can only add tracks to smart block."; $this->view->error = "You can only add tracks to smart block.";
$this->createFullResponse($obj); $this->createFullResponse($obj);
} }
private function wrongTypeToPlaylist($obj) { private function wrongTypeToPlaylist($obj)
{
$this->view->error = "You can only add tracks and smart blocks to playlists."; $this->view->error = "You can only add tracks and smart blocks to playlists.";
$this->createFullResponse($obj); $this->createFullResponse($obj);
} }
@ -168,40 +170,40 @@ class PlaylistController extends Zend_Controller_Action
$request = $this->getRequest(); $request = $this->getRequest();
$baseUrl = $request->getBaseUrl(); $baseUrl = $request->getBaseUrl();
$this->view->headScript()->appendFile($baseUrl.'/js/blockui/jquery.blockUI.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/blockui/jquery.blockUI.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/contextmenu/jquery.contextMenu.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/contextmenu/jquery.contextMenu.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/js/jquery.dataTables.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/datatables/js/jquery.dataTables.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.pluginAPI.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.pluginAPI.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.fnSetFilteringDelay.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.fnSetFilteringDelay.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.ColVis.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.ColVis.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.ColReorder.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.ColReorder.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.FixedColumns.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/datatables/plugin/dataTables.FixedColumns.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/buttons/buttons.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/airtime/buttons/buttons.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/utilities/utilities.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/airtime/utilities/utilities.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/library/library.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/airtime/library/library.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($this->view->baseUrl('/js/airtime/library/events/library_playlistbuilder.js'),'text/javascript'); $this->view->headScript()->appendFile($this->view->baseUrl('/js/airtime/library/events/library_playlistbuilder.js'), 'text/javascript');
$this->view->headLink()->appendStylesheet($baseUrl.'/css/media_library.css?'.$CC_CONFIG['airtime_version']); $this->view->headLink()->appendStylesheet($baseUrl.'/css/media_library.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'/css/jquery.contextMenu.css?'.$CC_CONFIG['airtime_version']); $this->view->headLink()->appendStylesheet($baseUrl.'/css/jquery.contextMenu.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'/css/datatables/css/ColVis.css?'.$CC_CONFIG['airtime_version']); $this->view->headLink()->appendStylesheet($baseUrl.'/css/datatables/css/ColVis.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'/css/datatables/css/ColReorder.css?'.$CC_CONFIG['airtime_version']); $this->view->headLink()->appendStylesheet($baseUrl.'/css/datatables/css/ColReorder.css?'.$CC_CONFIG['airtime_version']);
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/library/spl.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/airtime/library/spl.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/playlist/smart_blockbuilder.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/airtime/playlist/smart_blockbuilder.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headLink()->appendStylesheet($baseUrl.'/css/playlist_builder.css?'.$CC_CONFIG['airtime_version']); $this->view->headLink()->appendStylesheet($baseUrl.'/css/playlist_builder.css?'.$CC_CONFIG['airtime_version']);
try { try {
if (isset($this->obj_sess->id)) { if (isset($this->obj_sess->id)) {
$objInfo = $this->getObjInfo($this->obj_sess->type); $objInfo = Application_Model_Playlist::getObjInfo($this->obj_sess->type);
$obj = new $objInfo['className']($this->obj_sess->id); $obj = new $objInfo['className']($this->obj_sess->id);
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new Application_Model_User($userInfo->id); $user = new Application_Model_User($userInfo->id);
$isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); $isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
if($isAdminOrPM || $obj->getCreatorId() == $userInfo->id){ if ($isAdminOrPM || $obj->getCreatorId() == $userInfo->id) {
$this->view->obj = $obj; $this->view->obj = $obj;
if($this->obj_sess->type == "block"){ if ($this->obj_sess->type == "block") {
$form = new Application_Form_SmartBlockCriteria(); $form = new Application_Form_SmartBlockCriteria();
$form->startForm($this->obj_sess->id); $form->startForm($this->obj_sess->id);
$this->view->form = $form; $this->view->form = $form;
@ -225,7 +227,7 @@ class PlaylistController extends Zend_Controller_Action
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$type = $this->_getParam('type'); $type = $this->_getParam('type');
$objInfo = $this->getObjInfo($type); $objInfo = Application_Model_Playlist::getObjInfo($type);
$name = 'Untitled Playlist'; $name = 'Untitled Playlist';
if ($type == 'block') { if ($type == 'block') {
@ -244,7 +246,7 @@ class PlaylistController extends Zend_Controller_Action
{ {
$id = $this->_getParam('id', null); $id = $this->_getParam('id', null);
$type = $this->_getParam('type'); $type = $this->_getParam('type');
$objInfo = $this->getObjInfo($type); $objInfo = Application_Model_Playlist::getObjInfo($type);
Logging::log("editing {$type} {$id}"); Logging::log("editing {$type} {$id}");
if (!is_null($id)) { if (!is_null($id)) {
@ -269,7 +271,7 @@ class PlaylistController extends Zend_Controller_Action
$obj = null; $obj = null;
$objInfo = $this->getObjInfo($type); $objInfo = Application_Model_Playlist::getObjInfo($type);
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new Application_Model_User($userInfo->id); $user = new Application_Model_User($userInfo->id);
@ -283,6 +285,7 @@ class PlaylistController extends Zend_Controller_Action
Logging::log("Not deleting currently active {$type}"); Logging::log("Not deleting currently active {$type}");
$obj = new $objInfo['className']($this->obj_sess->id); $obj = new $objInfo['className']($this->obj_sess->id);
} }
if (strcmp($objInfo['className'], 'Application_Model_Playlist')==0) { if (strcmp($objInfo['className'], 'Application_Model_Playlist')==0) {
Application_Model_Playlist::deletePlaylists($ids, $userInfo->id); Application_Model_Playlist::deletePlaylists($ids, $userInfo->id);
} else { } else {
@ -310,7 +313,7 @@ class PlaylistController extends Zend_Controller_Action
try { try {
$obj = $this->getPlaylist($obj_type); $obj = $this->getPlaylist($obj_type);
if ($obj_type == 'playlist') { if ($obj_type == 'playlist') {
foreach($ids as $id) { foreach ($ids as $id) {
if (is_array($id) && isset($id[1])) { if (is_array($id) && isset($id[1])) {
if ($id[1] == 'playlist') { if ($id[1] == 'playlist') {
throw new WrongTypeToPlaylistException; throw new WrongTypeToPlaylistException;
@ -321,7 +324,7 @@ class PlaylistController extends Zend_Controller_Action
} else if ($obj->isStatic()) { } else if ($obj->isStatic()) {
// if the dest is a block object // if the dest is a block object
//check if any items are playlists //check if any items are playlists
foreach($ids as $id) { foreach ($ids as $id) {
if (is_array($id) && isset($id[1])) { if (is_array($id) && isset($id[1])) {
if ($id[1] != 'audioclip') { if ($id[1] != 'audioclip') {
throw new WrongTypeToBlockException; throw new WrongTypeToBlockException;
@ -333,11 +336,9 @@ class PlaylistController extends Zend_Controller_Action
throw new BlockDynamicException; throw new BlockDynamicException;
} }
$this->createUpdateResponse($obj); $this->createUpdateResponse($obj);
} } catch (PlaylistOutDatedException $e) {
catch (PlaylistOutDatedException $e) {
$this->playlistOutdated($e); $this->playlistOutdated($e);
} } catch (PlaylistNotFoundException $e) {
catch (PlaylistNotFoundException $e) {
$this->playlistNotFound($obj_type); $this->playlistNotFound($obj_type);
} }
catch (WrongTypeToBlockException $e) { catch (WrongTypeToBlockException $e) {
@ -553,14 +554,12 @@ class PlaylistController extends Zend_Controller_Action
$result = $bl->generateSmartBlock($params['data']); $result = $bl->generateSmartBlock($params['data']);
try { try {
die(json_encode(array("result"=>0, "html"=>$this->createFullResponse($bl, true)))); die(json_encode(array("result"=>0, "html"=>$this->createFullResponse($bl, true))));
} } catch (PlaylistNotFoundException $e) {
catch (PlaylistNotFoundException $e) {
$this->playlistNotFound('block'); $this->playlistNotFound('block');
} } catch (Exception $e) {
catch (Exception $e) {
$this->playlistUnknownError($e); $this->playlistUnknownError($e);
} }
}else{ } else {
$this->view->obj = $bl; $this->view->obj = $bl;
$this->view->id = $bl->getId(); $this->view->id = $bl->getId();
$this->view->form = $form; $this->view->form = $form;
@ -581,32 +580,16 @@ class PlaylistController extends Zend_Controller_Action
if ($result['result'] == 0) { if ($result['result'] == 0) {
try { try {
die(json_encode(array("result"=>0, "html"=>$this->createFullResponse($bl, true)))); die(json_encode(array("result"=>0, "html"=>$this->createFullResponse($bl, true))));
} } catch (PlaylistNotFoundException $e) {
catch (PlaylistNotFoundException $e) {
$this->playlistNotFound('block'); $this->playlistNotFound('block');
} }
catch (Exception $e) { } else {
$this->playlistUnknownError($e);
}
}else{
die(json_encode($result)); die(json_encode($result));
} }
} }
public function getObjInfo($p_type) public function getBlockInfoAction()
{ {
$info = array();
if (strcmp($p_type, 'playlist')==0) {
$info['className'] = 'Application_Model_Playlist';
} else {
$info['className'] = 'Application_Model_Block';
}
return $info;
}
public function getBlockInfoAction(){
$request = $this->getRequest(); $request = $this->getRequest();
$params = $request->getPost(); $params = $request->getPost();
$bl = new Application_Model_Block($params['id']); $bl = new Application_Model_Block($params['id']);

View File

@ -54,6 +54,10 @@ class WebstreamController extends Zend_Controller_Action
$webstream = CcWebstreamQuery::create()->findPK($id)->delete(); $webstream = CcWebstreamQuery::create()->findPK($id)->delete();
$this->view->ws = null;
$this->view->action = "delete";
$this->view->html = $this->view->render('webstream/webstream.phtml');
} }
public function saveAction() public function saveAction()

View File

@ -240,7 +240,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
$generate = new Zend_Form_Element_Button('generate_button'); $generate = new Zend_Form_Element_Button('generate_button');
$generate->setAttrib('class', 'ui-button ui-state-default sp-button'); $generate->setAttrib('class', 'ui-button ui-state-default sp-button');
$generate->setAttrib('title', 'Generate playlist content'); $generate->setAttrib('title', 'Generate playlist content and save criteria');
$generate->setIgnore(true); $generate->setIgnore(true);
$generate->setLabel('Generate'); $generate->setLabel('Generate');
$generate->setDecorators(array('viewHelper')); $generate->setDecorators(array('viewHelper'));

View File

@ -1141,6 +1141,14 @@ EOT;
// if the column is timestamp, convert it into UTC // if the column is timestamp, convert it into UTC
if ($column->getType() == PropelColumnTypes::TIMESTAMP) { if ($column->getType() == PropelColumnTypes::TIMESTAMP) {
$spCriteriaValue = Application_Common_DateHelper::ConvertToUtcDateTimeString($criteria['value']); $spCriteriaValue = Application_Common_DateHelper::ConvertToUtcDateTimeString($criteria['value']);
/* Check if only a date was supplied and trim
* the time after it is converted to UTC time
*/
if (strlen($criteria['value']) <= 10) {
//extract date only from timestamp in db
$spCriteria = 'date('.$spCriteria.')';
$spCriteriaValue = substr($spCriteriaValue, 0, 10);
}
} else if($spCriteria == "bit_rate") { } else if($spCriteria == "bit_rate") {
// multiply 1000 because we store only number value // multiply 1000 because we store only number value
// e.g 192kps is stored as 192000 // e.g 192kps is stored as 192000

View File

@ -899,6 +899,19 @@ SQL;
CcPlaylistcontentsQuery::create()->findByDbPlaylistId($this->id)->delete(); CcPlaylistcontentsQuery::create()->findByDbPlaylistId($this->id)->delete();
} }
public static function getObjInfo($p_type)
{
$info = array();
if (strcmp($p_type, 'playlist')==0) {
$info['className'] = 'Application_Model_Playlist';
} else {
$info['className'] = 'Application_Model_Block';
}
return $info;
}
} // class Playlist } // class Playlist
class PlaylistNotFoundException extends Exception {} class PlaylistNotFoundException extends Exception {}

View File

@ -458,7 +458,7 @@ function callback(data, type) {
if (type == 'shuffle') { if (type == 'shuffle') {
form.find('.success').text('Smart block shuffled'); form.find('.success').text('Smart block shuffled');
} else if (type == 'generate') { } else if (type == 'generate') {
form.find('.success').text('Smart block generated and saved'); form.find('.success').text('Smart block generated and criteria saved');
//redraw library table so the length gets updated //redraw library table so the length gets updated
dt.fnStandingRedraw(); dt.fnStandingRedraw();
} }

View File

@ -94,7 +94,6 @@ try:
#liq_path DNE, which is OK. #liq_path DNE, which is OK.
pass pass
os.symlink(liq_path, symlink_path) os.symlink(liq_path, symlink_path)
else: else:
print " * Liquidsoap binary not found!" print " * Liquidsoap binary not found!"