CC-1809 added a dialog to display show contents, anyone has access to this dialog. made sure only hosts can access schedule/clear/delete options on the context menu for future shows.
This commit is contained in:
parent
567335c72f
commit
2cdaf4b413
7 changed files with 97 additions and 58 deletions
|
@ -66,6 +66,7 @@
|
||||||
<actionMethod actionName="scheduleShowDialog"/>
|
<actionMethod actionName="scheduleShowDialog"/>
|
||||||
<actionMethod actionName="showList"/>
|
<actionMethod actionName="showList"/>
|
||||||
<actionMethod actionName="getShowData"/>
|
<actionMethod actionName="getShowData"/>
|
||||||
|
<actionMethod actionName="showContentDialog"/>
|
||||||
</controllerFile>
|
</controllerFile>
|
||||||
<controllerFile controllerName="Api">
|
<controllerFile controllerName="Api">
|
||||||
<actionMethod actionName="index"/>
|
<actionMethod actionName="index"/>
|
||||||
|
@ -266,6 +267,9 @@
|
||||||
<viewControllerScriptsDirectory forControllerName="Schedule">
|
<viewControllerScriptsDirectory forControllerName="Schedule">
|
||||||
<viewScriptFile forActionName="getShowData"/>
|
<viewScriptFile forActionName="getShowData"/>
|
||||||
</viewControllerScriptsDirectory>
|
</viewControllerScriptsDirectory>
|
||||||
|
<viewControllerScriptsDirectory forControllerName="Schedule">
|
||||||
|
<viewScriptFile forActionName="showContentDialog"/>
|
||||||
|
</viewControllerScriptsDirectory>
|
||||||
</viewScriptsDirectory>
|
</viewScriptsDirectory>
|
||||||
<viewHelpersDirectory/>
|
<viewHelpersDirectory/>
|
||||||
<viewFiltersDirectory enabled="false"/>
|
<viewFiltersDirectory enabled="false"/>
|
||||||
|
|
|
@ -22,6 +22,7 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
->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('show-content-dialog', 'json')
|
||||||
->addActionContext('clear-show', 'json')
|
->addActionContext('clear-show', 'json')
|
||||||
->addActionContext('get-current-playlist', 'json')
|
->addActionContext('get-current-playlist', 'json')
|
||||||
->addActionContext('find-playlists', 'json')
|
->addActionContext('find-playlists', 'json')
|
||||||
|
@ -34,6 +35,7 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
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/qtip/jquery.qtip-1.0.0.min.js','text/javascript');
|
||||||
$this->view->headScript()->appendFile('/js/contextmenu/jjmenu.js','text/javascript');
|
$this->view->headScript()->appendFile('/js/contextmenu/jjmenu.js','text/javascript');
|
||||||
$this->view->headScript()->appendFile('/js/datatables/js/jquery.dataTables.js','text/javascript');
|
$this->view->headScript()->appendFile('/js/datatables/js/jquery.dataTables.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');
|
||||||
|
@ -179,33 +181,38 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
{
|
{
|
||||||
$id = $this->_getParam('id');
|
$id = $this->_getParam('id');
|
||||||
$start_timestamp = $this->_getParam('start');
|
$start_timestamp = $this->_getParam('start');
|
||||||
|
|
||||||
$today_timestamp = date("Y-m-d H:i:s");
|
$today_timestamp = date("Y-m-d H:i:s");
|
||||||
|
|
||||||
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
|
$user = new User($userInfo->id, $userInfo->type);
|
||||||
|
|
||||||
$params = '/format/json/id/#id#/start/#start#/end/#end#';
|
$params = '/format/json/id/#id#/start/#start#/end/#end#';
|
||||||
|
|
||||||
if(strtotime($today_timestamp) < strtotime($start_timestamp)) {
|
if(strtotime($today_timestamp) < strtotime($start_timestamp)) {
|
||||||
|
|
||||||
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/delete-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'),
|
if($user->isHost($id)) {
|
||||||
'title' => 'Delete');
|
|
||||||
|
|
||||||
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/clear-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'),
|
|
||||||
'title' => 'Clear');
|
|
||||||
|
|
||||||
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/schedule-show-dialog'.$params, 'callback' => 'window["buildScheduleDialog"]'),
|
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/delete-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'),
|
||||||
'title' => 'Schedule');
|
'title' => 'Delete');
|
||||||
}
|
|
||||||
else {
|
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/clear-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'),
|
||||||
|
'title' => 'Clear');
|
||||||
|
|
||||||
|
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/schedule-show-dialog'.$params, 'callback' => 'window["buildScheduleDialog"]'),
|
||||||
|
'title' => 'Schedule');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/show-content-dialog'.$params, 'callback' => 'window["buildContentDialog"]'),
|
||||||
|
'title' => 'Show Contents');
|
||||||
|
|
||||||
//returns format jjmenu is looking for.
|
//returns format jjmenu is looking for.
|
||||||
die(json_encode($menu));
|
die(json_encode($menu));
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
||||||
|
@ -253,7 +260,7 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
|
|
||||||
public function findPlaylistsAction()
|
public function findPlaylistsAction()
|
||||||
{
|
{
|
||||||
$show_id = $this->sched_sess->showId;
|
$show_id = $this->sched_sess->showId;
|
||||||
$start_timestamp = $this->sched_sess->showStart;
|
$start_timestamp = $this->sched_sess->showStart;
|
||||||
$end_timestamp = $this->sched_sess->showEnd;
|
$end_timestamp = $this->sched_sess->showEnd;
|
||||||
$post = $this->getRequest()->getPost();
|
$post = $this->getRequest()->getPost();
|
||||||
|
@ -327,31 +334,24 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
unset($this->view->showContent);
|
unset($this->view->showContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Commented out for the 1.6 RC1 release.
|
public function showContentDialogAction()
|
||||||
public function showListAction()
|
|
||||||
{
|
{
|
||||||
$this->view->headScript()->appendFile('/js/datatables/js/jquery.dataTables.min.js','text/javascript');
|
$start_timestamp = $this->_getParam('start');
|
||||||
$this->view->headScript()->appendFile('/js/contextmenu/jjmenu.js','text/javascript');
|
$end_timestamp = $this->_getParam('end');
|
||||||
$this->view->headScript()->appendFile('/js/playlist/showlistview.js','text/javascript');
|
$showId = $this->_getParam('id');
|
||||||
$this->view->headLink()->appendStylesheet('/css/contextmenu.css');
|
|
||||||
$this->view->headLink()->appendStylesheet('/css/pro_dropdown_3.css');
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
$this->view->headLink()->appendStylesheet('/css/styles.css');
|
|
||||||
|
$user = new User($userInfo->id, $userInfo->type);
|
||||||
|
$show = new Show($user, $showId);
|
||||||
|
|
||||||
|
$this->view->showContent = $show->getShowListContent($start_timestamp);
|
||||||
|
$this->view->dialog = $this->view->render('schedule/show-content-dialog.phtml');
|
||||||
|
|
||||||
|
unset($this->view->showContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getShowDataAction()
|
|
||||||
{
|
|
||||||
$this->view->data = Show::getShows("2011-01-27");
|
|
||||||
$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->chosen = $this->view->render('schedule/scheduled-content.phtml');
|
|
||||||
$this->view->dialog = $this->view->render('schedule/schedule-show-dialog.phtml');
|
|
||||||
|
|
||||||
unset($this->view->showContent);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -353,14 +353,7 @@ class Schedule {
|
||||||
return $percent;
|
return $percent;
|
||||||
}
|
}
|
||||||
|
|
||||||
// public function onAddTrackToPlaylist($playlistId, $audioTrackId) {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public function onRemoveTrackFromPlaylist($playlistId, $audioTrackId) {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return TRUE if file is going to be played in the future.
|
* Return TRUE if file is going to be played in the future.
|
||||||
*
|
*
|
||||||
|
|
|
@ -330,10 +330,10 @@ class Show {
|
||||||
return !Schedule::isScheduleEmptyInRange($start_timestamp, $length);
|
return !Schedule::isScheduleEmptyInRange($start_timestamp, $length);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getShowContent($day) {
|
public function getShowListContent($start_timestamp) {
|
||||||
global $CC_DBC;
|
global $CC_DBC;
|
||||||
|
|
||||||
$timeinfo = explode(" ", $day);
|
$timeinfo = explode(" ", $start_timestamp);
|
||||||
|
|
||||||
$sql = "SELECT *
|
$sql = "SELECT *
|
||||||
FROM (cc_show_schedule AS ss LEFT JOIN cc_schedule AS s USING(group_id)
|
FROM (cc_show_schedule AS ss LEFT JOIN cc_schedule AS s USING(group_id)
|
||||||
|
@ -342,9 +342,15 @@ class Show {
|
||||||
|
|
||||||
WHERE ss.show_day = '{$timeinfo[0]}' AND ss.show_id = '{$this->_showId}' ORDER BY starts";
|
WHERE ss.show_day = '{$timeinfo[0]}' AND ss.show_id = '{$this->_showId}' ORDER BY starts";
|
||||||
|
|
||||||
$res = $CC_DBC->GetAll($sql);
|
return $CC_DBC->GetAll($sql);
|
||||||
|
}
|
||||||
|
|
||||||
if(count($res) <= 0) {
|
public function getShowContent($start_timestamp) {
|
||||||
|
global $CC_DBC;
|
||||||
|
|
||||||
|
$res = $this->getShowListContent($start_timestamp);
|
||||||
|
|
||||||
|
if(count($res) <= 0) {
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -429,14 +435,12 @@ class Show {
|
||||||
|
|
||||||
$sql = "DELETE FROM cc_show_days WHERE first_show >= '{$date}' AND show_id = '{$this->_showId}'";
|
$sql = "DELETE FROM cc_show_days WHERE first_show >= '{$date}' AND show_id = '{$this->_showId}'";
|
||||||
$CC_DBC->query($sql);
|
$CC_DBC->query($sql);
|
||||||
//echo $sql;
|
|
||||||
|
|
||||||
$sql = "UPDATE cc_show_days
|
$sql = "UPDATE cc_show_days
|
||||||
SET last_show = '{$date}'
|
SET last_show = '{$date}'
|
||||||
WHERE show_id = '{$this->_showId}' AND first_show <= '{$date}' ";
|
WHERE show_id = '{$this->_showId}' AND first_show <= '{$date}' ";
|
||||||
$CC_DBC->query($sql);
|
$CC_DBC->query($sql);
|
||||||
//echo $sql;
|
|
||||||
|
|
||||||
$sql = "SELECT group_id FROM cc_show_schedule WHERE show_day >= '{$date}' AND show_id = '{$this->_showId}'";
|
$sql = "SELECT group_id FROM cc_show_schedule WHERE show_day >= '{$date}' AND show_id = '{$this->_showId}'";
|
||||||
$rows = $CC_DBC->GetAll($sql);
|
$rows = $CC_DBC->GetAll($sql);
|
||||||
|
|
||||||
|
@ -449,11 +453,9 @@ class Show {
|
||||||
$sql = "DELETE FROM cc_show_schedule
|
$sql = "DELETE FROM cc_show_schedule
|
||||||
WHERE ($groups) AND show_id = '{$this->_showId}' AND show_day >= '{$date}' ";
|
WHERE ($groups) AND show_id = '{$this->_showId}' AND show_day >= '{$date}' ";
|
||||||
$CC_DBC->query($sql);
|
$CC_DBC->query($sql);
|
||||||
//echo $sql;
|
|
||||||
|
|
||||||
$sql = "DELETE FROM cc_schedule WHERE ($groups)";
|
$sql = "DELETE FROM cc_schedule WHERE ($groups)";
|
||||||
$CC_DBC->query($sql);
|
$CC_DBC->query($sql);
|
||||||
//echo $sql;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$groups = CcShowScheduleQuery::create()->filterByDbShowId($this->_showId)->find();
|
$groups = CcShowScheduleQuery::create()->filterByDbShowId($this->_showId)->find();
|
||||||
|
|
12
application/views/scripts/schedule/show-content-dialog.phtml
Normal file
12
application/views/scripts/schedule/show-content-dialog.phtml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<div id="show_content_dialog">
|
||||||
|
<?php foreach($this->showContent as $row): ?>
|
||||||
|
<div>
|
||||||
|
<span><?php echo $row["starts"] ?></span>
|
||||||
|
<span><?php echo $row["track_title"] ?></span>
|
||||||
|
<span><?php echo $row["artist_name"] ?></span>
|
||||||
|
<span><?php echo $row["album_title"] ?></span>
|
||||||
|
<span><?php echo $row["length"] ?></span>
|
||||||
|
<span><?php echo $row["genre"] ?></span>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</div>
|
|
@ -57,9 +57,6 @@ function viewDisplay( view ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function eventRender(event, element, view) {
|
function eventRender(event, element, view) {
|
||||||
//element.qtip({
|
|
||||||
// content: event.description
|
|
||||||
// });
|
|
||||||
|
|
||||||
if(view.name === 'agendaDay' || view.name === 'agendaWeek') {
|
if(view.name === 'agendaDay' || view.name === 'agendaWeek') {
|
||||||
var div = $('<div/>');
|
var div = $('<div/>');
|
||||||
|
@ -109,6 +106,19 @@ function eventAfterRender( event, element, view ) {
|
||||||
[{get:"/Schedule/make-context-menu/format/json/id/#id#/start/#start#/end/#end#"}],
|
[{get:"/Schedule/make-context-menu/format/json/id/#id#/start/#start#/end/#end#"}],
|
||||||
{id: event.id, start: getStartTS, end: getEndTS},
|
{id: event.id, start: getStartTS, end: getEndTS},
|
||||||
{xposition: "mouse", yposition: "mouse"});
|
{xposition: "mouse", yposition: "mouse"});
|
||||||
|
|
||||||
|
/*
|
||||||
|
$(element).qtip({
|
||||||
|
content: {
|
||||||
|
text: event.description,
|
||||||
|
title: { text: 'Show Description' }
|
||||||
|
},
|
||||||
|
position: {
|
||||||
|
target: 'mouse',
|
||||||
|
adjust: { mouse: true }
|
||||||
|
}
|
||||||
|
});
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
function eventClick(event, jsEvent, view) {
|
function eventClick(event, jsEvent, view) {
|
||||||
|
|
|
@ -165,6 +165,24 @@ function makeScheduleDialog(dialog, json) {
|
||||||
setScheduleDialogEvents(dialog);
|
setScheduleDialogEvents(dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function buildContentDialog(json){
|
||||||
|
var dialog = $(json.dialog);
|
||||||
|
|
||||||
|
dialog.dialog({
|
||||||
|
autoOpen: false,
|
||||||
|
title: 'Show Contents',
|
||||||
|
width: 1100,
|
||||||
|
height: 500,
|
||||||
|
modal: true,
|
||||||
|
close: closeDialog,
|
||||||
|
buttons: {"Ok": function() {
|
||||||
|
dialog.remove();
|
||||||
|
}}
|
||||||
|
});
|
||||||
|
|
||||||
|
dialog.dialog('open');
|
||||||
|
}
|
||||||
|
|
||||||
function buildScheduleDialog(json){
|
function buildScheduleDialog(json){
|
||||||
var dialog = $(json.dialog);
|
var dialog = $(json.dialog);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue