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
|
@ -552,23 +552,26 @@ class Application_Model_Scheduler {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$instance = CcShowInstancesQuery::create()->findPK($p_id);
|
$instance = CcShowInstancesQuery::create()->findPK($p_id);
|
||||||
|
|
||||||
$items = CcScheduleQuery::create()
|
|
||||||
->filterByDbInstanceId($p_id)
|
|
||||||
->filterByDbEnds($this->nowDT, Criteria::GREATER_THAN)
|
|
||||||
->find($this->con);
|
|
||||||
|
|
||||||
$remove = array();
|
if (!$instance->getDbRecord()) {
|
||||||
$ts = $this->nowDT->format('U');
|
|
||||||
|
$items = CcScheduleQuery::create()
|
||||||
for($i = 0; $i < count($items); $i++) {
|
->filterByDbInstanceId($p_id)
|
||||||
$remove[$i]["instance"] = $p_id;
|
->filterByDbEnds($this->nowDT, Criteria::GREATER_THAN)
|
||||||
$remove[$i]["timestamp"] = $ts;
|
->find($this->con);
|
||||||
$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->setDbEnds($this->nowDT);
|
||||||
$instance->save($this->con);
|
$instance->save($this->con);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue