CC-3542 : When you delete the current show it takes all songs from that show out of the playout history
This commit is contained in:
parent
eeb7273909
commit
c5b761bff3
1 changed files with 18 additions and 15 deletions
|
@ -553,22 +553,25 @@ class Application_Model_Scheduler {
|
|||
|
||||
$instance = CcShowInstancesQuery::create()->findPK($p_id);
|
||||
|
||||
$items = CcScheduleQuery::create()
|
||||
->filterByDbInstanceId($p_id)
|
||||
->filterByDbEnds($this->nowDT, Criteria::GREATER_THAN)
|
||||
->find($this->con);
|
||||
if (!$instance->getDbRecord()) {
|
||||
|
||||
$remove = array();
|
||||
$ts = $this->nowDT->format('U');
|
||||
$items = CcScheduleQuery::create()
|
||||
->filterByDbInstanceId($p_id)
|
||||
->filterByDbEnds($this->nowDT, Criteria::GREATER_THAN)
|
||||
->find($this->con);
|
||||
|
||||
for($i = 0; $i < count($items); $i++) {
|
||||
$remove[$i]["instance"] = $p_id;
|
||||
$remove[$i]["timestamp"] = $ts;
|
||||
$remove[$i]["id"] = $items[$i]->getDbId();
|
||||
$remove = array();
|
||||
$ts = $this->nowDT->format('U');
|
||||
|
||||
for($i = 0; $i < count($items); $i++) {
|
||||
$remove[$i]["instance"] = $p_id;
|
||||
$remove[$i]["timestamp"] = $ts;
|
||||
$remove[$i]["id"] = $items[$i]->getDbId();
|
||||
}
|
||||
|
||||
$this->removeItems($remove, false);
|
||||
}
|
||||
|
||||
$this->removeItems($remove, false);
|
||||
|
||||
$instance->setDbEnds($this->nowDT);
|
||||
$instance->save($this->con);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue