backend mostly done for show, can remove a scheduled group from a show.
This commit is contained in:
parent
f2560a6aa6
commit
25c7d4cb90
5 changed files with 98 additions and 64 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
class ScheduleController extends Zend_Controller_Action
|
||||
{
|
||||
protected $sched_sess = null;
|
||||
|
||||
public function init()
|
||||
{
|
||||
|
@ -18,11 +19,14 @@ class ScheduleController extends Zend_Controller_Action
|
|||
->addActionContext('resize-show', 'json')
|
||||
->addActionContext('delete-show', 'json')
|
||||
->addActionContext('schedule-show', 'json')
|
||||
->addActionContext('schedule-show-dialog', 'json')
|
||||
->addActionContext('clear-show', 'json')
|
||||
->addActionContext('get-current-playlist', 'json')
|
||||
->addActionContext('find-playlists', 'html')
|
||||
->addActionContext('remove-group', 'json')
|
||||
->initContext();
|
||||
|
||||
$this->sched_sess = new Zend_Session_Namespace("schedule");
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
|
@ -127,7 +131,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
public function deleteShowAction()
|
||||
{
|
||||
$showId = $this->_getParam('showId');
|
||||
|
||||
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
|
||||
$show = new Show(new User($userInfo->id, $userInfo->type));
|
||||
|
@ -142,10 +146,11 @@ class ScheduleController extends Zend_Controller_Action
|
|||
public function scheduleShowAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
|
||||
$start_timestamp = $this->_getParam('start');
|
||||
$showId = $this->_getParam('showId');
|
||||
|
||||
$start_timestamp = $this->sched_sess->showStart;
|
||||
$showId = $this->sched_sess->showId;
|
||||
$search = $this->_getParam('search', null);
|
||||
$plId = $this->_getParam('plId');
|
||||
|
||||
if($search == "") {
|
||||
$search = null;
|
||||
|
@ -156,12 +161,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$user = new User($userInfo->id, $userInfo->type);
|
||||
$show = new Show($user, $showId);
|
||||
|
||||
if($request->isPost()) {
|
||||
|
||||
$plId = $this->_getParam('plId');
|
||||
|
||||
$show->scheduleShow($start_timestamp, array($plId));
|
||||
}
|
||||
$show->scheduleShow($start_timestamp, array($plId));
|
||||
|
||||
$this->view->playlists = $show->searchPlaylistsForShow($start_timestamp, $search);
|
||||
$this->view->showContent = $show->getShowContent($start_timestamp);
|
||||
|
@ -202,8 +202,8 @@ class ScheduleController extends Zend_Controller_Action
|
|||
public function findPlaylistsAction()
|
||||
{
|
||||
$search = $this->_getParam('search');
|
||||
$show_id = $this->_getParam('showId');
|
||||
$start_timestamp = $this->_getParam('start');
|
||||
$show_id = $this->sched_sess->showId;
|
||||
$start_timestamp = $this->sched_sess->showStart;
|
||||
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
$show = new Show(new User($userInfo->id, $userInfo->type), $show_id);
|
||||
|
@ -213,8 +213,8 @@ class ScheduleController extends Zend_Controller_Action
|
|||
public function removeGroupAction()
|
||||
{
|
||||
$group_id = $this->_getParam('groupId');
|
||||
$start_timestamp = $this->_getParam('start');
|
||||
$show_id = $this->_getParam('showId');
|
||||
$start_timestamp = $this->sched_sess->showStart;
|
||||
$show_id = $this->sched_sess->showId;
|
||||
$search = $this->_getParam('search', null);
|
||||
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
|
@ -232,6 +232,30 @@ class ScheduleController extends Zend_Controller_Action
|
|||
unset($this->view->playlists);
|
||||
}
|
||||
|
||||
public function scheduleShowDialogAction()
|
||||
{
|
||||
$start_timestamp = $this->_getParam('start');
|
||||
$showId = $this->_getParam('showId');
|
||||
|
||||
$this->sched_sess->showId = $showId;
|
||||
$this->sched_sess->showStart = $start_timestamp;
|
||||
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
|
||||
$user = new User($userInfo->id, $userInfo->type);
|
||||
$show = new Show($user, $showId);
|
||||
|
||||
$this->view->playlists = $show->searchPlaylistsForShow($start_timestamp);
|
||||
$this->view->showContent = $show->getShowContent($start_timestamp);
|
||||
|
||||
$this->view->choice = $this->view->render('schedule/find-playlists.phtml');
|
||||
$this->view->chosen = $this->view->render('schedule/scheduled-content.phtml');
|
||||
$this->view->dialog = $this->view->render('schedule/schedule-show.phtml');
|
||||
|
||||
unset($this->view->showContent);
|
||||
unset($this->view->playlists);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -254,6 +278,8 @@ class ScheduleController extends Zend_Controller_Action
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue