CC-1848
-began progress, not complete yet. Show can be deleted from database while it is playing, need to notify pypo as well
This commit is contained in:
parent
bfbca3f724
commit
43a9b63fb5
|
@ -71,6 +71,7 @@
|
||||||
<actionMethod actionName="editShow"/>
|
<actionMethod actionName="editShow"/>
|
||||||
<actionMethod actionName="addShow"/>
|
<actionMethod actionName="addShow"/>
|
||||||
<actionMethod actionName="cancelShow"/>
|
<actionMethod actionName="cancelShow"/>
|
||||||
|
<actionMethod actionName="cancelCurrentShow"/>
|
||||||
</controllerFile>
|
</controllerFile>
|
||||||
<controllerFile controllerName="Api">
|
<controllerFile controllerName="Api">
|
||||||
<actionMethod actionName="index"/>
|
<actionMethod actionName="index"/>
|
||||||
|
@ -335,6 +336,9 @@
|
||||||
<viewControllerScriptsDirectory forControllerName="Recorder">
|
<viewControllerScriptsDirectory forControllerName="Recorder">
|
||||||
<viewScriptFile forActionName="getShowSchedule"/>
|
<viewScriptFile forActionName="getShowSchedule"/>
|
||||||
</viewControllerScriptsDirectory>
|
</viewControllerScriptsDirectory>
|
||||||
|
<viewControllerScriptsDirectory forControllerName="Schedule">
|
||||||
|
<viewScriptFile forActionName="cancelCurrentShow"/>
|
||||||
|
</viewControllerScriptsDirectory>
|
||||||
</viewScriptsDirectory>
|
</viewScriptsDirectory>
|
||||||
<viewHelpersDirectory/>
|
<viewHelpersDirectory/>
|
||||||
<viewFiltersDirectory enabled="false"/>
|
<viewFiltersDirectory enabled="false"/>
|
||||||
|
|
|
@ -153,6 +153,15 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/show-content-dialog'.$params, 'callback' => 'window["buildContentDialog"]'),
|
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/show-content-dialog'.$params, 'callback' => 'window["buildContentDialog"]'),
|
||||||
'title' => 'Show Content');
|
'title' => 'Show Content');
|
||||||
|
|
||||||
|
if (strtotime($show->getShowStart()) <= strtotime($today_timestamp) &&
|
||||||
|
strtotime($today_timestamp) < strtotime($show->getShowEnd())) {
|
||||||
|
$menu[] = array('action' => array('type' => 'fn',
|
||||||
|
//'url' => '/Schedule/cancel-current-show'.$params,
|
||||||
|
'callback' => "window['confirmCancelShow']($id)"),
|
||||||
|
'title' => 'Cancel Current Show');
|
||||||
|
}
|
||||||
|
|
||||||
if (strtotime($today_timestamp) < strtotime($show->getShowStart())) {
|
if (strtotime($today_timestamp) < strtotime($show->getShowStart())) {
|
||||||
if ($user->isAdmin()) {
|
if ($user->isAdmin()) {
|
||||||
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/delete-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'), 'title' => 'Delete This Instance');
|
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Schedule/delete-show'.$params, 'callback' => 'window["scheduleRefetchEvents"]'), 'title' => 'Delete This Instance');
|
||||||
|
@ -392,6 +401,19 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
$show->cancelShow($showInstance->getShowStart());
|
$show->cancelShow($showInstance->getShowStart());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function cancelCurrentShowAction()
|
||||||
|
{
|
||||||
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
|
$user = new User($userInfo->id);
|
||||||
|
|
||||||
|
if($user->isAdmin()) {
|
||||||
|
$showInstanceId = $this->_getParam('id');
|
||||||
|
$show = new ShowInstance($showInstanceId);
|
||||||
|
$show->clearShow();
|
||||||
|
$show->deleteShow();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
<br /><br /><center>View script for controller <b>Schedule</b> and script/action name <b>cancelCurrentShow</b></center>
|
|
@ -155,6 +155,16 @@ function makeScheduleDialog(dialog, json) {
|
||||||
setScheduleDialogEvents(dialog);
|
setScheduleDialogEvents(dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function confirmCancelShow(show_instance_id){
|
||||||
|
if(confirm('Erase current show and stop playback?')){
|
||||||
|
var url = "/Schedule/cancel-current-show/id/"+show_instance_id;
|
||||||
|
$.ajax({
|
||||||
|
url: url,
|
||||||
|
success: function(data){scheduleRefetchEvents();}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function buildContentDialog(json){
|
function buildContentDialog(json){
|
||||||
var dialog = $(json.dialog);
|
var dialog = $(json.dialog);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue