diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index 2a4a442ea..4b2cf044e 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -1005,7 +1005,7 @@ SQL; ->filterByDbId($instanceId) ->findOne(); } - if ($update && (!$ccShowInstance || $ccShowInstance->getDbModifiedInstance() == true)) { + if ($update && ($ccShowInstance && $ccShowInstance->getDbModifiedInstance() == true)) { return false; } diff --git a/airtime_mvc/application/services/CalendarService.php b/airtime_mvc/application/services/CalendarService.php index 04cf9776b..41ad7c17c 100644 --- a/airtime_mvc/application/services/CalendarService.php +++ b/airtime_mvc/application/services/CalendarService.php @@ -82,15 +82,26 @@ class Application_Service_CalendarService // Show content can be modified from the calendar if: // the user is admin or hosting the show, // the show is not recorded - - if ($now < $end && ($isAdminOrPM || $isHostOfShow) && - !$this->ccShowInstance->isRecorded() ) { - - $menu["schedule"] = array( - "name"=> _("Add / Remove Content"), - "icon" => "add-remove-content", - "url" => $baseUrl."showbuilder/builder-dialog/"); - + $currentShow = Application_Model_Show::getCurrentShow(); + $currentShowId = count($currentShow) == 1 ? $currentShow[0]["id"] : null; + $showIsLinked = $this->ccShow->isLinked(); + if ($now < $end && ($isAdminOrPM || $isHostOfShow) && !$this->ccShowInstance->isRecorded()) { + //if the show is not linked the user can add/remove content + if (!$showIsLinked) { + + $menu["schedule"] = array( + "name"=> _("Add / Remove Content"), + "icon" => "add-remove-content", + "url" => $baseUrl."showbuilder/builder-dialog/"); + //if the show is linked and it's not currently playing the user can add/remove content + } elseif ($showIsLinked && $currentShowId != $this->ccShow->getDbId()) { + + $menu["schedule"] = array( + "name"=> _("Add / Remove Content"), + "icon" => "add-remove-content", + "url" => $baseUrl."showbuilder/builder-dialog/"); + } + } if ($now < $start && ($isAdminOrPM || $isHostOfShow) &&