CC-3150 : Editor box still open with show details for a deleted show
This commit is contained in:
parent
60299ff789
commit
36d9b15435
|
@ -141,15 +141,19 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||||
$user = new Application_Model_User($userInfo->id);
|
$user = new Application_Model_User($userInfo->id);
|
||||||
|
|
||||||
if($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) {
|
if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) {
|
||||||
try{
|
|
||||||
|
try {
|
||||||
$showInstance = new Application_Model_ShowInstance($showInstanceId);
|
$showInstance = new Application_Model_ShowInstance($showInstanceId);
|
||||||
}catch(Exception $e){
|
}
|
||||||
|
catch(Exception $e){
|
||||||
$this->view->show_error = true;
|
$this->view->show_error = true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$showInstance->delete();
|
$showInstance->delete();
|
||||||
|
|
||||||
|
$this->view->show_id = $showInstance->getShowId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -801,15 +805,18 @@ class ScheduleController extends Zend_Controller_Action
|
||||||
if($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) {
|
if($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) {
|
||||||
$showInstanceId = $this->_getParam('id');
|
$showInstanceId = $this->_getParam('id');
|
||||||
|
|
||||||
try{
|
try {
|
||||||
$showInstance = new Application_Model_ShowInstance($showInstanceId);
|
$showInstance = new Application_Model_ShowInstance($showInstanceId);
|
||||||
}catch(Exception $e){
|
}
|
||||||
|
catch(Exception $e){
|
||||||
$this->view->show_error = true;
|
$this->view->show_error = true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$show = new Application_Model_Show($showInstance->getShowId());
|
$show = new Application_Model_Show($showInstance->getShowId());
|
||||||
|
|
||||||
$show->cancelShow($showInstance->getShowInstanceStart());
|
$show->cancelShow($showInstance->getShowInstanceStart());
|
||||||
|
|
||||||
|
$this->view->show_id = $showInstance->getShowId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,14 @@ function scheduleRefetchEvents(json) {
|
||||||
if(json.show_error == true){
|
if(json.show_error == true){
|
||||||
alert("The show instance doesn't exist anymore!")
|
alert("The show instance doesn't exist anymore!")
|
||||||
}
|
}
|
||||||
|
if(json.show_id) {
|
||||||
|
var dialog_id = parseInt($("#add_show_id").val(), 10);
|
||||||
|
|
||||||
|
//if you've deleted the show you are currently editing, close the add show dialog.
|
||||||
|
if (dialog_id === json.show_id) {
|
||||||
|
$("#add-show-close").click();
|
||||||
|
}
|
||||||
|
}
|
||||||
$("#schedule_calendar").fullCalendar( 'refetchEvents' );
|
$("#schedule_calendar").fullCalendar( 'refetchEvents' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue