can add a playlist to the schedule table in a show. basic, need to make better.

This commit is contained in:
Naomi 2010-12-15 18:53:47 -05:00
parent 1b3186af50
commit 1d9aa778a6
17 changed files with 974 additions and 178 deletions

View file

@ -16,7 +16,8 @@ class ScheduleController extends Zend_Controller_Action
->addActionContext('add-show', 'json')
->addActionContext('move-show', 'json')
->addActionContext('resize-show', 'json')
->addActionContext('delete-show', 'json')
->addActionContext('delete-show', 'json')
->addActionContext('schedule-show', 'json')
->initContext();
}
@ -39,7 +40,7 @@ class ScheduleController extends Zend_Controller_Action
$this->view->eventDefaultMenu = $eventDefaultMenu;
$eventHostMenu[] = array('action' => '/Schedule/delete-show', 'text' => 'Delete');
$eventHostMenu[] = array('action' => '/Schedule/delete-show', 'text' => 'Schedule');
$eventHostMenu[] = array('action' => '/Schedule/schedule-show', 'text' => 'Schedule');
$this->view->eventHostMenu = $eventHostMenu;
}
@ -120,7 +121,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));
@ -132,6 +133,25 @@ class ScheduleController extends Zend_Controller_Action
// action body
}
public function scheduleShowAction()
{
$request = $this->getRequest();
if($request->isPost()) {
$plId = $this->_getParam('plId');
$start = $this->_getParam('start');
$sched = new ScheduleGroup();
$this->view->res = $sched->add($start, null, $plId);
}
else {
$showId = $this->_getParam('showId');
$length = $this->_getParam('length');
$this->view->playlists = Playlist::findPlaylistMaxLength($length);
}
}
}
@ -149,3 +169,5 @@ class ScheduleController extends Zend_Controller_Action