-started adding show list-view
This commit is contained in:
parent
e52d566b83
commit
844baeeae6
13 changed files with 347 additions and 255 deletions
|
@ -65,6 +65,8 @@
|
||||||
<actionMethod actionName="findPlaylists"/>
|
<actionMethod actionName="findPlaylists"/>
|
||||||
<actionMethod actionName="removeGroup"/>
|
<actionMethod actionName="removeGroup"/>
|
||||||
<actionMethod actionName="scheduleShowDialog"/>
|
<actionMethod actionName="scheduleShowDialog"/>
|
||||||
|
<actionMethod actionName="showList"/>
|
||||||
|
<actionMethod actionName="getShowData"/>
|
||||||
</controllerFile>
|
</controllerFile>
|
||||||
<controllerFile controllerName="Api">
|
<controllerFile controllerName="Api">
|
||||||
<actionMethod actionName="index"/>
|
<actionMethod actionName="index"/>
|
||||||
|
@ -262,6 +264,12 @@
|
||||||
<viewControllerScriptsDirectory forControllerName="Nowplaying">
|
<viewControllerScriptsDirectory forControllerName="Nowplaying">
|
||||||
<viewScriptFile forActionName="livestream"/>
|
<viewScriptFile forActionName="livestream"/>
|
||||||
</viewControllerScriptsDirectory>
|
</viewControllerScriptsDirectory>
|
||||||
|
<viewControllerScriptsDirectory forControllerName="Schedule">
|
||||||
|
<viewScriptFile forActionName="showList"/>
|
||||||
|
</viewControllerScriptsDirectory>
|
||||||
|
<viewControllerScriptsDirectory forControllerName="Schedule">
|
||||||
|
<viewScriptFile forActionName="getShowData"/>
|
||||||
|
</viewControllerScriptsDirectory>
|
||||||
</viewScriptsDirectory>
|
</viewScriptsDirectory>
|
||||||
<viewHelpersDirectory/>
|
<viewHelpersDirectory/>
|
||||||
<viewFiltersDirectory enabled="false"/>
|
<viewFiltersDirectory enabled="false"/>
|
||||||
|
|
|
@ -29,10 +29,8 @@ class NowplayingController extends Zend_Controller_Action
|
||||||
public function livestreamAction()
|
public function livestreamAction()
|
||||||
{
|
{
|
||||||
//use bare bones layout (no header bar or menu)
|
//use bare bones layout (no header bar or menu)
|
||||||
$this->_helper->layout->setLayout('bare');
|
$this->_helper->layout->setLayout('bare');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,176 +2,178 @@
|
||||||
|
|
||||||
class ScheduleController extends Zend_Controller_Action
|
class ScheduleController extends Zend_Controller_Action
|
||||||
{
|
{
|
||||||
protected $sched_sess = null;
|
|
||||||
|
protected $sched_sess = null;
|
||||||
|
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
if(!Zend_Auth::getInstance()->hasIdentity())
|
if(!Zend_Auth::getInstance()->hasIdentity())
|
||||||
{
|
{
|
||||||
$this->_redirect('login/index');
|
$this->_redirect('login/index');
|
||||||
}
|
}
|
||||||
|
|
||||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||||
$ajaxContext->addActionContext('event-feed', 'json')
|
$ajaxContext->addActionContext('event-feed', 'json')
|
||||||
->addActionContext('add-show-dialog', 'json')
|
->addActionContext('add-show-dialog', 'json')
|
||||||
->addActionContext('add-show', 'json')
|
->addActionContext('add-show', 'json')
|
||||||
->addActionContext('move-show', 'json')
|
->addActionContext('move-show', 'json')
|
||||||
->addActionContext('resize-show', 'json')
|
->addActionContext('resize-show', 'json')
|
||||||
->addActionContext('delete-show', 'json')
|
->addActionContext('delete-show', 'json')
|
||||||
->addActionContext('schedule-show', 'json')
|
->addActionContext('schedule-show', 'json')
|
||||||
->addActionContext('schedule-show-dialog', 'json')
|
->addActionContext('schedule-show-dialog', 'json')
|
||||||
->addActionContext('clear-show', 'json')
|
->addActionContext('clear-show', 'json')
|
||||||
->addActionContext('get-current-playlist', 'json')
|
->addActionContext('get-current-playlist', 'json')
|
||||||
->addActionContext('find-playlists', 'html')
|
->addActionContext('find-playlists', 'html')
|
||||||
->addActionContext('remove-group', 'json')
|
->addActionContext('remove-group', 'json')
|
||||||
->initContext();
|
->addActionContext('get-show-data', 'json')
|
||||||
|
->initContext();
|
||||||
$this->sched_sess = new Zend_Session_Namespace("schedule");
|
|
||||||
|
$this->sched_sess = new Zend_Session_Namespace("schedule");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
$this->view->headScript()->appendFile('/js/fullcalendar/fullcalendar.min.js','text/javascript');
|
$this->view->headScript()->appendFile('/js/fullcalendar/fullcalendar.min.js','text/javascript');
|
||||||
$this->view->headScript()->appendFile('/js/contextmenu/jquery.contextMenu.js','text/javascript');
|
$this->view->headScript()->appendFile('/js/contextmenu/jquery.contextMenu.js','text/javascript');
|
||||||
//$this->view->headScript()->appendFile('/js/qtip/jquery.qtip-1.0.0.min.js','text/javascript');
|
//$this->view->headScript()->appendFile('/js/qtip/jquery.qtip-1.0.0.min.js','text/javascript');
|
||||||
$this->view->headScript()->appendFile('/js/airtime/schedule/full-calendar-functions.js','text/javascript');
|
$this->view->headScript()->appendFile('/js/airtime/schedule/full-calendar-functions.js','text/javascript');
|
||||||
$this->view->headScript()->appendFile('/js/airtime/schedule/schedule.js','text/javascript');
|
$this->view->headScript()->appendFile('/js/airtime/schedule/schedule.js','text/javascript');
|
||||||
|
|
||||||
$this->view->headLink()->appendStylesheet('/css/jquery.contextMenu.css');
|
$this->view->headLink()->appendStylesheet('/css/jquery.contextMenu.css');
|
||||||
$this->view->headLink()->appendStylesheet('/css/fullcalendar.css');
|
$this->view->headLink()->appendStylesheet('/css/fullcalendar.css');
|
||||||
$this->view->headLink()->appendStylesheet('/css/schedule.css');
|
$this->view->headLink()->appendStylesheet('/css/schedule.css');
|
||||||
$this->view->headLink()->appendStylesheet('/css/pro_dropdown_3.css');
|
$this->view->headLink()->appendStylesheet('/css/pro_dropdown_3.css');
|
||||||
$this->view->headLink()->appendStylesheet('/css/styles.css');
|
$this->view->headLink()->appendStylesheet('/css/styles.css');
|
||||||
|
|
||||||
$eventDefaultMenu = array();
|
$eventDefaultMenu = array();
|
||||||
//$eventDefaultMenu[] = array('action' => '/Schedule/delete-show', 'text' => 'Delete');
|
//$eventDefaultMenu[] = array('action' => '/Schedule/delete-show', 'text' => 'Delete');
|
||||||
|
|
||||||
$this->view->eventDefaultMenu = $eventDefaultMenu;
|
$this->view->eventDefaultMenu = $eventDefaultMenu;
|
||||||
|
|
||||||
$eventHostMenu[] = array('action' => '/Schedule/delete-show', 'text' => 'Delete');
|
$eventHostMenu[] = array('action' => '/Schedule/delete-show', 'text' => 'Delete');
|
||||||
$eventHostMenu[] = array('action' => '/Schedule/schedule-show', 'text' => 'Schedule');
|
$eventHostMenu[] = array('action' => '/Schedule/schedule-show', 'text' => 'Schedule');
|
||||||
$eventHostMenu[] = array('action' => '/Schedule/clear-show', 'text' => 'Clear');
|
$eventHostMenu[] = array('action' => '/Schedule/clear-show', 'text' => 'Clear');
|
||||||
|
|
||||||
$this->view->eventHostMenu = $eventHostMenu;
|
$this->view->eventHostMenu = $eventHostMenu;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function eventFeedAction()
|
public function eventFeedAction()
|
||||||
{
|
{
|
||||||
$start = $this->_getParam('start', null);
|
$start = $this->_getParam('start', null);
|
||||||
$end = $this->_getParam('end', null);
|
$end = $this->_getParam('end', null);
|
||||||
$weekday = $this->_getParam('weekday', null);
|
$weekday = $this->_getParam('weekday', null);
|
||||||
|
|
||||||
if(!is_null($weekday)) {
|
if(!is_null($weekday)) {
|
||||||
$weekday = array($weekday);
|
$weekday = array($weekday);
|
||||||
}
|
}
|
||||||
|
|
||||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
|
|
||||||
$show = new Show(new User($userInfo->id, $userInfo->type));
|
$show = new Show(new User($userInfo->id, $userInfo->type));
|
||||||
|
|
||||||
$this->view->events = $show->getFullCalendarEvents($start, $end, $weekday);
|
$this->view->events = $show->getFullCalendarEvents($start, $end, $weekday);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addShowDialogAction()
|
public function addShowDialogAction()
|
||||||
{
|
{
|
||||||
$this->view->headScript()->appendFile('/js/fullcalendar/fullcalendar.min.js','text/javascript');
|
$this->view->headScript()->appendFile('/js/fullcalendar/fullcalendar.min.js','text/javascript');
|
||||||
$this->view->headScript()->appendFile('/js/colorpicker/js/colorpicker.js','text/javascript');
|
$this->view->headScript()->appendFile('/js/colorpicker/js/colorpicker.js','text/javascript');
|
||||||
$this->view->headScript()->appendFile('/js/airtime/schedule/full-calendar-functions.js','text/javascript');
|
$this->view->headScript()->appendFile('/js/airtime/schedule/full-calendar-functions.js','text/javascript');
|
||||||
$this->view->headScript()->appendFile('/js/airtime/schedule/add-show.js','text/javascript');
|
$this->view->headScript()->appendFile('/js/airtime/schedule/add-show.js','text/javascript');
|
||||||
|
|
||||||
$this->view->headLink()->appendStylesheet('/css/fullcalendar.css');
|
$this->view->headLink()->appendStylesheet('/css/fullcalendar.css');
|
||||||
$this->view->headLink()->appendStylesheet('/css/colorpicker/css/colorpicker.css');
|
$this->view->headLink()->appendStylesheet('/css/colorpicker/css/colorpicker.css');
|
||||||
$this->view->headLink()->appendStylesheet('/css/add-show.css');
|
$this->view->headLink()->appendStylesheet('/css/add-show.css');
|
||||||
$this->view->headLink()->appendStylesheet('/css/pro_dropdown_3.css');
|
$this->view->headLink()->appendStylesheet('/css/pro_dropdown_3.css');
|
||||||
$this->view->headLink()->appendStylesheet('/css/styles.css');
|
$this->view->headLink()->appendStylesheet('/css/styles.css');
|
||||||
|
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
$formWhat = new Application_Form_AddShowWhat();
|
$formWhat = new Application_Form_AddShowWhat();
|
||||||
$formWhat->removeDecorator('DtDdWrapper');
|
$formWhat->removeDecorator('DtDdWrapper');
|
||||||
$formWho = new Application_Form_AddShowWho();
|
$formWho = new Application_Form_AddShowWho();
|
||||||
$formWho->removeDecorator('DtDdWrapper');
|
$formWho->removeDecorator('DtDdWrapper');
|
||||||
$formWhen = new Application_Form_AddShowWhen();
|
$formWhen = new Application_Form_AddShowWhen();
|
||||||
$formWhen->removeDecorator('DtDdWrapper');
|
$formWhen->removeDecorator('DtDdWrapper');
|
||||||
$formRepeats = new Application_Form_AddShowRepeats();
|
$formRepeats = new Application_Form_AddShowRepeats();
|
||||||
$formRepeats->removeDecorator('DtDdWrapper');
|
$formRepeats->removeDecorator('DtDdWrapper');
|
||||||
$formStyle = new Application_Form_AddShowStyle();
|
$formStyle = new Application_Form_AddShowStyle();
|
||||||
$formStyle->removeDecorator('DtDdWrapper');
|
$formStyle->removeDecorator('DtDdWrapper');
|
||||||
|
|
||||||
if ($request->isPost()) {
|
if ($request->isPost()) {
|
||||||
|
|
||||||
$data = $request->getPost();
|
$data = $request->getPost();
|
||||||
|
|
||||||
$what = $formWhat->isValid($data);
|
$what = $formWhat->isValid($data);
|
||||||
$when = $formWhen->isValid($data);
|
$when = $formWhen->isValid($data);
|
||||||
$repeats = $formRepeats->isValid($data);
|
$repeats = $formRepeats->isValid($data);
|
||||||
$who = $formWho->isValid($data);
|
$who = $formWho->isValid($data);
|
||||||
$style = $formStyle->isValid($data);
|
$style = $formStyle->isValid($data);
|
||||||
|
|
||||||
if ($what && $when && $repeats && $who && $style) {
|
if ($what && $when && $repeats && $who && $style) {
|
||||||
|
|
||||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
|
|
||||||
$show = new Show(new User($userInfo->id, $userInfo->type));
|
$show = new Show(new User($userInfo->id, $userInfo->type));
|
||||||
$overlap = $show->addShow($data);
|
$overlap = $show->addShow($data);
|
||||||
|
|
||||||
if(isset($overlap)) {
|
if(isset($overlap)) {
|
||||||
$this->view->overlap = $overlap;
|
$this->view->overlap = $overlap;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$this->_redirect('Schedule');
|
$this->_redirect('Schedule');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->view->what = $formWhat;
|
$this->view->what = $formWhat;
|
||||||
$this->view->when = $formWhen;
|
$this->view->when = $formWhen;
|
||||||
$this->view->repeats = $formRepeats;
|
$this->view->repeats = $formRepeats;
|
||||||
$this->view->who = $formWho;
|
$this->view->who = $formWho;
|
||||||
$this->view->style = $formStyle;
|
$this->view->style = $formStyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function moveShowAction()
|
public function moveShowAction()
|
||||||
{
|
{
|
||||||
$deltaDay = $this->_getParam('day');
|
$deltaDay = $this->_getParam('day');
|
||||||
$deltaMin = $this->_getParam('min');
|
$deltaMin = $this->_getParam('min');
|
||||||
$showId = $this->_getParam('showId');
|
$showId = $this->_getParam('showId');
|
||||||
|
|
||||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
|
|
||||||
$show = new Show(new User($userInfo->id, $userInfo->type));
|
$show = new Show(new User($userInfo->id, $userInfo->type));
|
||||||
|
|
||||||
$overlap = $show->moveShow($showId, $deltaDay, $deltaMin);
|
$overlap = $show->moveShow($showId, $deltaDay, $deltaMin);
|
||||||
|
|
||||||
if(isset($overlap))
|
if(isset($overlap))
|
||||||
$this->view->overlap = $overlap;
|
$this->view->overlap = $overlap;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function resizeShowAction()
|
public function resizeShowAction()
|
||||||
{
|
{
|
||||||
$deltaDay = $this->_getParam('day');
|
$deltaDay = $this->_getParam('day');
|
||||||
$deltaMin = $this->_getParam('min');
|
$deltaMin = $this->_getParam('min');
|
||||||
$showId = $this->_getParam('showId');
|
$showId = $this->_getParam('showId');
|
||||||
|
|
||||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
|
|
||||||
$show = new Show(new User($userInfo->id, $userInfo->type));
|
$show = new Show(new User($userInfo->id, $userInfo->type));
|
||||||
|
|
||||||
$overlap = $show->resizeShow($showId, $deltaDay, $deltaMin);
|
$overlap = $show->resizeShow($showId, $deltaDay, $deltaMin);
|
||||||
|
|
||||||
if(isset($overlap))
|
if(isset($overlap))
|
||||||
$this->view->overlap = $overlap;
|
$this->view->overlap = $overlap;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deleteShowAction()
|
public function deleteShowAction()
|
||||||
{
|
{
|
||||||
$showId = $this->_getParam('showId');
|
$showId = $this->_getParam('showId');
|
||||||
$date = $this->_getParam('date');
|
$date = $this->_getParam('date');
|
||||||
|
|
||||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
|
|
||||||
$user = new User($userInfo->id, $userInfo->type);
|
$user = new User($userInfo->id, $userInfo->type);
|
||||||
$show = new Show($user, $showId);
|
$show = new Show($user, $showId);
|
||||||
$show->deleteShow($date);
|
$show->deleteShow($date);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function makeContextMenuAction()
|
public function makeContextMenuAction()
|
||||||
|
@ -180,51 +182,51 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
|
|
||||||
public function scheduleShowAction()
|
public function scheduleShowAction()
|
||||||
{
|
{
|
||||||
$start_timestamp = $this->sched_sess->showStart;
|
$start_timestamp = $this->sched_sess->showStart;
|
||||||
$end_timestamp = $this->sched_sess->showEnd;
|
$end_timestamp = $this->sched_sess->showEnd;
|
||||||
$showId = $this->sched_sess->showId;
|
$showId = $this->sched_sess->showId;
|
||||||
$search = $this->_getParam('search', null);
|
$search = $this->_getParam('search', null);
|
||||||
$plId = $this->_getParam('plId');
|
$plId = $this->_getParam('plId');
|
||||||
|
|
||||||
if($search == "") {
|
if($search == "") {
|
||||||
$search = null;
|
$search = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
|
|
||||||
$user = new User($userInfo->id, $userInfo->type);
|
$user = new User($userInfo->id, $userInfo->type);
|
||||||
$show = new Show($user, $showId);
|
$show = new Show($user, $showId);
|
||||||
|
|
||||||
$show->scheduleShow($start_timestamp, array($plId));
|
$show->scheduleShow($start_timestamp, array($plId));
|
||||||
|
|
||||||
$this->view->playlists = $show->searchPlaylistsForShow($start_timestamp, $search);
|
$this->view->playlists = $show->searchPlaylistsForShow($start_timestamp, $search);
|
||||||
$this->view->showContent = $show->getShowContent($start_timestamp);
|
$this->view->showContent = $show->getShowContent($start_timestamp);
|
||||||
|
|
||||||
$this->view->timeFilled = $show->getTimeScheduled($start_timestamp, $end_timestamp);
|
$this->view->timeFilled = $show->getTimeScheduled($start_timestamp, $end_timestamp);
|
||||||
$this->view->showLength = $show->getShowLength($start_timestamp, $end_timestamp);
|
$this->view->showLength = $show->getShowLength($start_timestamp, $end_timestamp);
|
||||||
$this->view->percentFilled = Schedule::getPercentScheduledInRange($start_timestamp, $end_timestamp);
|
$this->view->percentFilled = Schedule::getPercentScheduledInRange($start_timestamp, $end_timestamp);
|
||||||
|
|
||||||
$this->view->choice = $this->view->render('schedule/find-playlists.phtml');
|
$this->view->choice = $this->view->render('schedule/find-playlists.phtml');
|
||||||
$this->view->chosen = $this->view->render('schedule/scheduled-content.phtml');
|
$this->view->chosen = $this->view->render('schedule/scheduled-content.phtml');
|
||||||
|
|
||||||
unset($this->view->showContent);
|
unset($this->view->showContent);
|
||||||
unset($this->view->playlists);
|
unset($this->view->playlists);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function clearShowAction()
|
public function clearShowAction()
|
||||||
{
|
{
|
||||||
$start = $this->_getParam('start');
|
$start = $this->_getParam('start');
|
||||||
$showId = $this->_getParam('showId');
|
$showId = $this->_getParam('showId');
|
||||||
|
|
||||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
$user = new User($userInfo->id, $userInfo->type);
|
$user = new User($userInfo->id, $userInfo->type);
|
||||||
|
|
||||||
if($user->isHost($showId)) {
|
if($user->isHost($showId)) {
|
||||||
|
|
||||||
$show = new Show($user, $showId);
|
$show = new Show($user, $showId);
|
||||||
$show->clearShow($start);
|
$show->clearShow($start);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCurrentPlaylistAction()
|
public function getCurrentPlaylistAction()
|
||||||
|
@ -235,70 +237,89 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
public function findPlaylistsAction()
|
public function findPlaylistsAction()
|
||||||
{
|
{
|
||||||
$search = $this->_getParam('search');
|
$search = $this->_getParam('search');
|
||||||
$show_id = $this->sched_sess->showId;
|
$show_id = $this->sched_sess->showId;
|
||||||
$start_timestamp = $this->sched_sess->showStart;
|
$start_timestamp = $this->sched_sess->showStart;
|
||||||
|
|
||||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
$show = new Show(new User($userInfo->id, $userInfo->type), $show_id);
|
$show = new Show(new User($userInfo->id, $userInfo->type), $show_id);
|
||||||
$this->view->playlists = $show->searchPlaylistsForShow($start_timestamp, $search);
|
$this->view->playlists = $show->searchPlaylistsForShow($start_timestamp, $search);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function removeGroupAction()
|
public function removeGroupAction()
|
||||||
{
|
{
|
||||||
$group_id = $this->_getParam('groupId');
|
$group_id = $this->_getParam('groupId');
|
||||||
$start_timestamp = $this->sched_sess->showStart;
|
$start_timestamp = $this->sched_sess->showStart;
|
||||||
$end_timestamp = $this->sched_sess->showEnd;
|
$end_timestamp = $this->sched_sess->showEnd;
|
||||||
$show_id = $this->sched_sess->showId;
|
$show_id = $this->sched_sess->showId;
|
||||||
$search = $this->_getParam('search', null);
|
$search = $this->_getParam('search', null);
|
||||||
|
|
||||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
$show = new Show(new User($userInfo->id, $userInfo->type), $show_id);
|
$show = new Show(new User($userInfo->id, $userInfo->type), $show_id);
|
||||||
|
|
||||||
$show->removeGroupFromShow($start_timestamp, $group_id);
|
$show->removeGroupFromShow($start_timestamp, $group_id);
|
||||||
|
|
||||||
$this->view->playlists = $show->searchPlaylistsForShow($start_timestamp, $search);
|
$this->view->playlists = $show->searchPlaylistsForShow($start_timestamp, $search);
|
||||||
$this->view->showContent = $show->getShowContent($start_timestamp);
|
$this->view->showContent = $show->getShowContent($start_timestamp);
|
||||||
|
|
||||||
$this->view->timeFilled = $show->getTimeScheduled($start_timestamp, $end_timestamp);
|
$this->view->timeFilled = $show->getTimeScheduled($start_timestamp, $end_timestamp);
|
||||||
$this->view->showLength = $show->getShowLength($start_timestamp, $end_timestamp);
|
$this->view->showLength = $show->getShowLength($start_timestamp, $end_timestamp);
|
||||||
$this->view->percentFilled = Schedule::getPercentScheduledInRange($start_timestamp, $end_timestamp);
|
$this->view->percentFilled = Schedule::getPercentScheduledInRange($start_timestamp, $end_timestamp);
|
||||||
|
|
||||||
$this->view->choice = $this->view->render('schedule/find-playlists.phtml');
|
$this->view->choice = $this->view->render('schedule/find-playlists.phtml');
|
||||||
$this->view->chosen = $this->view->render('schedule/scheduled-content.phtml');
|
$this->view->chosen = $this->view->render('schedule/scheduled-content.phtml');
|
||||||
|
|
||||||
unset($this->view->showContent);
|
unset($this->view->showContent);
|
||||||
unset($this->view->playlists);
|
unset($this->view->playlists);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function scheduleShowDialogAction()
|
public function scheduleShowDialogAction()
|
||||||
{
|
{
|
||||||
$start_timestamp = $this->_getParam('start');
|
$start_timestamp = $this->_getParam('start');
|
||||||
$end_timestamp = $this->_getParam('end');
|
$end_timestamp = $this->_getParam('end');
|
||||||
$showId = $this->_getParam('showId');
|
$showId = $this->_getParam('showId');
|
||||||
|
|
||||||
|
$this->sched_sess->showId = $showId;
|
||||||
|
$this->sched_sess->showStart = $start_timestamp;
|
||||||
|
$this->sched_sess->showEnd = $end_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->timeFilled = $show->getTimeScheduled($start_timestamp, $end_timestamp);
|
||||||
|
$this->view->showLength = $show->getShowLength($start_timestamp, $end_timestamp);
|
||||||
|
$this->view->percentFilled = Schedule::getPercentScheduledInRange($start_timestamp, $end_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-dialog.phtml');
|
||||||
|
|
||||||
|
unset($this->view->showContent);
|
||||||
|
unset($this->view->playlists);
|
||||||
|
}
|
||||||
|
|
||||||
$this->sched_sess->showId = $showId;
|
public function showListAction()
|
||||||
$this->sched_sess->showStart = $start_timestamp;
|
{
|
||||||
$this->sched_sess->showEnd = $end_timestamp;
|
$this->view->headScript()->appendFile('/js/datatables/js/jquery.dataTables.min.js','text/javascript');
|
||||||
|
$this->view->headScript()->appendFile('/js/contextmenu/jjmenu.js','text/javascript');
|
||||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
$this->view->headScript()->appendFile('/js/playlist/showlistview.js','text/javascript');
|
||||||
|
$this->view->headLink()->appendStylesheet('/css/contextmenu.css');
|
||||||
|
$this->view->headLink()->appendStylesheet('/css/pro_dropdown_3.css');
|
||||||
|
$this->view->headLink()->appendStylesheet('/css/styles.css');
|
||||||
|
}
|
||||||
|
|
||||||
$user = new User($userInfo->id, $userInfo->type);
|
public function getShowDataAction()
|
||||||
$show = new Show($user, $showId);
|
{
|
||||||
|
$this->view->data = Show::getShows("2011-01-27");
|
||||||
$this->view->playlists = $show->searchPlaylistsForShow($start_timestamp);
|
|
||||||
$this->view->showContent = $show->getShowContent($start_timestamp);
|
|
||||||
|
|
||||||
$this->view->timeFilled = $show->getTimeScheduled($start_timestamp, $end_timestamp);
|
|
||||||
$this->view->showLength = $show->getShowLength($start_timestamp, $end_timestamp);
|
|
||||||
$this->view->percentFilled = Schedule::getPercentScheduledInRange($start_timestamp, $end_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-dialog.phtml');
|
|
||||||
|
|
||||||
unset($this->view->showContent);
|
|
||||||
unset($this->view->playlists);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,6 @@
|
||||||
|
|
||||||
<?php echo $this->navigation()->menu() ?>
|
<?php echo $this->navigation()->menu() ?>
|
||||||
|
|
||||||
<div id="content"><?php echo $this->layout()->content ?></div>
|
<div class="wrapper" id="content"><?php echo $this->layout()->content ?></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -17,9 +17,9 @@
|
||||||
|
|
||||||
<?php echo $this->navigation()->menu() ?>
|
<?php echo $this->navigation()->menu() ?>
|
||||||
|
|
||||||
<div id="side_playlist" class="ui-widget ui-widget-content block-shadow alpha-block"><?php echo $this->layout()->spl ?></div>
|
<div class="wrapper">
|
||||||
|
<div id="side_playlist" class="ui-widget ui-widget-content block-shadow alpha-block"><?php echo $this->layout()->spl ?></div>
|
||||||
<div id="library_content" class="tabs ui-widget ui-widget-content block-shadow omega-block padded"><?php echo $this->layout()->library ?></div>
|
<div id="library_content" class="tabs ui-widget ui-widget-content block-shadow omega-block padded"><?php echo $this->layout()->library ?></div>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -11,11 +11,11 @@
|
||||||
<div id="nowplayingbar"><?= $this->partial('partialviews/header.phtml') ?></div>
|
<div id="nowplayingbar"><?= $this->partial('partialviews/header.phtml') ?></div>
|
||||||
<div id="nav"><?php echo $this->navigation()->menu()->setRenderInvisible(true) ?></div>
|
<div id="nav"><?php echo $this->navigation()->menu()->setRenderInvisible(true) ?></div>
|
||||||
|
|
||||||
|
<div class="wrapper">
|
||||||
<div id="search"><?php echo $this->layout()->search ?></div>
|
<div id="search"><?php echo $this->layout()->search ?></div>
|
||||||
|
|
||||||
<div id="library_content"><?php echo $this->layout()->library ?></div>
|
<div id="library_content"><?php echo $this->layout()->library ?></div>
|
||||||
|
|
||||||
<div id="side_playlist"><?php echo $this->layout()->spl ?></div>
|
<div id="side_playlist"><?php echo $this->layout()->spl ?></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -478,7 +478,8 @@ class Show {
|
||||||
}
|
}
|
||||||
if(!is_null($start) && is_null($end)) {
|
if(!is_null($start) && is_null($end)) {
|
||||||
$sql_range = "(first_show <= '{$start}' AND last_show IS NULL)
|
$sql_range = "(first_show <= '{$start}' AND last_show IS NULL)
|
||||||
OR (first_show <= '{$start}' AND last_show > '{$start}')";
|
OR (first_show <= '{$start}' AND last_show > '{$start}')
|
||||||
|
OR (first_show >= '{$start}')";
|
||||||
|
|
||||||
$sql = $sql_gen ." WHERE ". $sql_range;
|
$sql = $sql_gen ." WHERE ". $sql_range;
|
||||||
}
|
}
|
||||||
|
|
3
application/views/scripts/schedule/get-show-data.phtml
Normal file
3
application/views/scripts/schedule/get-show-data.phtml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<?php
|
||||||
|
echo $this->data;
|
||||||
|
?>
|
2
application/views/scripts/schedule/show-list.phtml
Normal file
2
application/views/scripts/schedule/show-list.phtml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
<div id='json-string'></div>
|
||||||
|
<div id='demo'></div>
|
|
@ -228,10 +228,6 @@ $command = __DIR__."/../utils/airtime-import --copy ../audio_samples/ > /dev/nul
|
||||||
|
|
||||||
$command = "python ".__DIR__."/../pypo/install/pypo-install.py";
|
$command = "python ".__DIR__."/../pypo/install/pypo-install.py";
|
||||||
|
|
||||||
$output = array();
|
system($command);
|
||||||
@exec($command, $output, $results);
|
|
||||||
foreach ($output as $value){
|
|
||||||
echo $value."\n";
|
|
||||||
}
|
|
||||||
echo "******************************* Install Complete *******************************\n";
|
echo "******************************* Install Complete *******************************\n";
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -225,10 +225,6 @@ airtime_uninstall_delete_files($CC_CONFIG['storageDir']);
|
||||||
|
|
||||||
|
|
||||||
$command = "python ".__DIR__."/../pypo/install/pypo-uninstall.py";
|
$command = "python ".__DIR__."/../pypo/install/pypo-uninstall.py";
|
||||||
$output = array();
|
system($command);
|
||||||
@exec($command, $output, $results);
|
|
||||||
foreach ($output as $value){
|
|
||||||
echo $value."\n";
|
|
||||||
}
|
|
||||||
echo "****************************** Uninstall Complete ******************************\n";
|
echo "****************************** Uninstall Complete ******************************\n";
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -111,10 +111,10 @@ function updateProgressBarValue(){
|
||||||
|
|
||||||
function updatePlaybar(){
|
function updatePlaybar(){
|
||||||
/* Column 0 update */
|
/* Column 0 update */
|
||||||
$('#previous').text("Prev Song: N/A");
|
$('#previous').empty();
|
||||||
$('#prev-length').text("n/a,");
|
$('#prev-length').empty();
|
||||||
$('#current').text("Current Song: N/A");
|
$('#current').text("Current:");
|
||||||
$('#next').text("Next Song: N/A");
|
$('#next').empty();
|
||||||
$('#next-length').empty();
|
$('#next-length').empty();
|
||||||
if (previousSongs.length > 0){
|
if (previousSongs.length > 0){
|
||||||
$('#previous').text(getTrackInfo(previousSongs[previousSongs.length-1]));
|
$('#previous').text(getTrackInfo(previousSongs[previousSongs.length-1]));
|
||||||
|
@ -133,8 +133,6 @@ function updatePlaybar(){
|
||||||
$('#time-elapsed').empty();
|
$('#time-elapsed').empty();
|
||||||
$('#time-remaining').empty();
|
$('#time-remaining').empty();
|
||||||
$('#song-length').empty();
|
$('#song-length').empty();
|
||||||
$('#showposition').empty();
|
|
||||||
$('#showlength').empty();
|
|
||||||
for (var i=0; i<currentSong.length; i++){
|
for (var i=0; i<currentSong.length; i++){
|
||||||
$('#start').text(currentSong[i].starts.substring(currentSong[i].starts.indexOf(" ")+1));
|
$('#start').text(currentSong[i].starts.substring(currentSong[i].starts.indexOf(" ")+1));
|
||||||
$('#end').text(currentSong[i].ends.substring(currentSong[i].starts.indexOf(" ")+1));
|
$('#end').text(currentSong[i].ends.substring(currentSong[i].starts.indexOf(" ")+1));
|
||||||
|
@ -150,7 +148,7 @@ function updatePlaybar(){
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Column 1 update */
|
/* Column 1 update */
|
||||||
$('#playlist').text("Current Show: N/A");
|
$('#playlist').text("Current Show:");
|
||||||
for (var i=0; i<currentSong.length; i++){
|
for (var i=0; i<currentSong.length; i++){
|
||||||
$('#playlist').text(currentSong[i].name);
|
$('#playlist').text(currentSong[i].name);
|
||||||
}
|
}
|
||||||
|
|
69
public/js/playlist/showlistview.js
Normal file
69
public/js/playlist/showlistview.js
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
function createDataGrid(datagridData){
|
||||||
|
|
||||||
|
var columnHeaders = [
|
||||||
|
{ "sTitle": "name" },
|
||||||
|
{ "sTitle": "date" },
|
||||||
|
{ "sTitle": "start time" },
|
||||||
|
{ "sTitle": "end time" }
|
||||||
|
];
|
||||||
|
|
||||||
|
$('#demo').html( '<table cellpadding="0" cellspacing="0" border="0" width="100%" id="nowplayingtable"></table>' );
|
||||||
|
$('#nowplayingtable').dataTable( {
|
||||||
|
"bSort" : false,
|
||||||
|
"bJQueryUI": true,
|
||||||
|
"bFilter": false,
|
||||||
|
"bInfo": false,
|
||||||
|
"bLengthChange": false,
|
||||||
|
"aaData": datagridData.rows,
|
||||||
|
"aoColumns": columnHeaders
|
||||||
|
} );
|
||||||
|
|
||||||
|
|
||||||
|
var options1 = [
|
||||||
|
|
||||||
|
{title:"Menu Item 1 - Go TO www.google.com", action:{type:"gourl",url:"http://www.google.com/"}},
|
||||||
|
{title:"Menu Item 2 - do <b style='color:red;'>nothing</b>"},
|
||||||
|
{title:"Menu Item 3 - submenu", type:"sub", src:[{title:"Submenu 1"},{title:"Submenu 2"},{title:"Submenu 3"}, {title:"Submenu 4 - submenu", type:"sub", src:[{title:"SubSubmenu 1"},{title:"SubSubmenu 2"}]}]},
|
||||||
|
{title:"Menu Item 4 - Js function", action:{type:"fn",callback:"(function(){ alert('THIS IS THE TEST'); })"}}
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
var userData = {};
|
||||||
|
|
||||||
|
var effects = {
|
||||||
|
show:"default", //type of show effect
|
||||||
|
orientation: "auto", //type of menu orientation - to top, to bottom, auto (to bottom, if doesn't fit on screen - to top)
|
||||||
|
xposition:"mouse", // position of menu (left side or right side of trigger element)
|
||||||
|
yposition:"mouse"
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#demo').jjmenu('both', options1, userData, effects );
|
||||||
|
}
|
||||||
|
|
||||||
|
function initShowListView(){
|
||||||
|
|
||||||
|
|
||||||
|
$.ajax({ url: "/Schedule/get-show-data/format/json", dataType:"text", success:function(data){
|
||||||
|
$('#json-string').text(data);
|
||||||
|
}});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$.ajax({ url: "/Schedule/get-show-data/format/json", dataType:"json", success:function(data){
|
||||||
|
var temp = data.data;
|
||||||
|
var rows = new Array();
|
||||||
|
for (var i=0; i<temp.length; i++){
|
||||||
|
rows[i] = [temp[i].name.toString(), temp[i].first_show.toString(), temp[i].start_time.toString(), temp[i].end_time.toString()];
|
||||||
|
var datagridData = {rows:rows};
|
||||||
|
createDataGrid(datagridData);
|
||||||
|
}
|
||||||
|
}});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//setTimeout(initShowListView, 5000);
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
initShowListView();
|
||||||
|
});
|
Loading…
Add table
Add a link
Reference in a new issue