Merge pull request #804 from Robbt/fix-cancel-ongoing-linked-show
enables cancel show for currently playing linked shows to work
This commit is contained in:
commit
16bf731905
|
@ -84,7 +84,7 @@ final class Application_Model_Scheduler
|
||||||
*
|
*
|
||||||
* @param array $items, an array containing pks of cc_schedule items.
|
* @param array $items, an array containing pks of cc_schedule items.
|
||||||
*/
|
*/
|
||||||
private function validateRequest($items, $addRemoveAction=false)
|
private function validateRequest($items, $addRemoveAction=false, $cancelShow=false)
|
||||||
{
|
{
|
||||||
//$items is where tracks get inserted (they are schedule locations)
|
//$items is where tracks get inserted (they are schedule locations)
|
||||||
|
|
||||||
|
@ -168,8 +168,10 @@ final class Application_Model_Scheduler
|
||||||
* Does the afterItem belong to a show that is linked AND
|
* Does the afterItem belong to a show that is linked AND
|
||||||
* currently playing?
|
* currently playing?
|
||||||
* If yes, throw an exception
|
* If yes, throw an exception
|
||||||
|
* unless it is a cancel show action then we don't check because otherwise
|
||||||
|
* ongoing linked shows can't be cancelled
|
||||||
*/
|
*/
|
||||||
if ($addRemoveAction) {
|
if ($addRemoveAction && !$cancelShow) {
|
||||||
$ccShow = $instance->getCcShow();
|
$ccShow = $instance->getCcShow();
|
||||||
if ($ccShow->isLinked()) {
|
if ($ccShow->isLinked()) {
|
||||||
//get all the linked shows instances and check if
|
//get all the linked shows instances and check if
|
||||||
|
@ -1207,7 +1209,7 @@ final class Application_Model_Scheduler
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$this->validateRequest($scheduledItems, true);
|
$this->validateRequest($scheduledItems, true, true);
|
||||||
|
|
||||||
$scheduledIds = array();
|
$scheduledIds = array();
|
||||||
foreach ($scheduledItems as $item) {
|
foreach ($scheduledItems as $item) {
|
||||||
|
|
Loading…
Reference in New Issue