CC-3153: When cancelling a show that is currently on-air, the show-instance is not removed.
-fixed
This commit is contained in:
parent
162f11022b
commit
73c0408315
|
@ -143,13 +143,13 @@ class ScheduleController extends Zend_Controller_Action
|
|||
|
||||
if($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) {
|
||||
try{
|
||||
$show = new Application_Model_ShowInstance($showInstanceId);
|
||||
$showInstance = new Application_Model_ShowInstance($showInstanceId);
|
||||
}catch(Exception $e){
|
||||
$this->view->show_error = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
$show->deleteShow();
|
||||
$showInstance->delete();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -821,13 +821,13 @@ class ScheduleController extends Zend_Controller_Action
|
|||
if($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) {
|
||||
$showInstanceId = $this->_getParam('id');
|
||||
try{
|
||||
$show = new Application_Model_ShowInstance($showInstanceId);
|
||||
$showInstance = new Application_Model_ShowInstance($showInstanceId);
|
||||
}catch(Exception $e){
|
||||
$this->view->show_error = true;
|
||||
return false;
|
||||
}
|
||||
$show->clearShow();
|
||||
$show->deleteShow();
|
||||
$showInstance->clearShow();
|
||||
$showInstance->delete();
|
||||
// send 'cancel-current-show' command to pypo
|
||||
Application_Model_RabbitMq::SendMessageToPypo("cancel_current_show", array());
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ class Application_Model_Show {
|
|||
}
|
||||
|
||||
//remove everything about this show.
|
||||
public function deleteShow()
|
||||
public function delete()
|
||||
{
|
||||
//usually we hide the show-instance, but in this case we are deleting the show template
|
||||
//so delete all show-instances as well.
|
||||
|
|
|
@ -435,10 +435,10 @@ class Application_Model_ShowInstance {
|
|||
$this->updateScheduledTime();
|
||||
}
|
||||
|
||||
public function deleteShow()
|
||||
public function delete()
|
||||
{
|
||||
global $CC_DBC;
|
||||
|
||||
|
||||
// see if it was recording show
|
||||
$recording = $this->isRecorded();
|
||||
// get show id
|
||||
|
@ -446,10 +446,9 @@ class Application_Model_ShowInstance {
|
|||
|
||||
$show = $this->getShow();
|
||||
|
||||
$current_timestamp = gmdate("Y-m-d H:i");
|
||||
|
||||
if ($current_timestamp < $this->getShowInstanceStart()) {
|
||||
$current_timestamp = gmdate("Y-m-d H:i:s");
|
||||
|
||||
if ($current_timestamp <= $this->getShowInstanceEnd()) {
|
||||
if ($show->isRepeating()) {
|
||||
|
||||
CcShowInstancesQuery::create()
|
||||
|
@ -486,8 +485,7 @@ class Application_Model_ShowInstance {
|
|||
}
|
||||
}
|
||||
else {
|
||||
|
||||
$show->deleteShow();
|
||||
$show->delete();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue