CC-5634: Can add/remove content to a linked show while one instance is currently playing

This commit is contained in:
drigato 2014-06-09 12:07:27 -04:00
parent a07121787f
commit 66e6c23311
1 changed files with 16 additions and 17 deletions

View File

@ -85,32 +85,31 @@ class Application_Service_CalendarService
$currentShow = Application_Model_Show::getCurrentShow(); $currentShow = Application_Model_Show::getCurrentShow();
$currentShowId = count($currentShow) == 1 ? $currentShow[0]["id"] : null; $currentShowId = count($currentShow) == 1 ? $currentShow[0]["id"] : null;
$showIsLinked = $this->ccShow->isLinked(); $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( //user can add/remove content if the show has not ended
"name"=> _("Add / Remove Content"), if ($now < $end && ($isAdminOrPM || $isHostOfShow) && !$this->ccShowInstance->isRecorded()) {
"icon" => "add-remove-content", //if the show is not linked OR if the show is linked AND not the current playing show
"url" => $baseUrl."showbuilder/builder-dialog/"); //the user can add/remove content
//if the show is linked and it's not currently playing the user can add/remove content if (!$showIsLinked || ($showIsLinked && $currentShowId != $this->ccShow->getDbId())) {
} elseif ($showIsLinked && $currentShowId != $this->ccShow->getDbId()) {
$menu["schedule"] = array( $menu["schedule"] = array(
"name"=> _("Add / Remove Content"), "name"=> _("Add / Remove Content"),
"icon" => "add-remove-content", "icon" => "add-remove-content",
"url" => $baseUrl."showbuilder/builder-dialog/"); "url" => $baseUrl."showbuilder/builder-dialog/");
} }
} }
if ($now < $start && ($isAdminOrPM || $isHostOfShow) && //user can remove all content if the show has not started
!$this->ccShowInstance->isRecorded() ) { if ($now < $start && ($isAdminOrPM || $isHostOfShow) && !$this->ccShowInstance->isRecorded() ) {
//if the show is not linked OR if the show is linked AND not the current playing show
$menu["clear"] = array( //the user can remove all content
"name"=> _("Remove All Content"), if (!$showIsLinked || ($showIsLinked && $currentShowId != $this->ccShow->getDbId())) {
"icon" => "remove-all-content",
"url" => $baseUrl."schedule/clear-show"); $menu["clear"] = array(
"name"=> _("Remove All Content"),
"icon" => "remove-all-content",
"url" => $baseUrl."schedule/clear-show");
}
} }
//"Show Content" should be a menu item at all times except when //"Show Content" should be a menu item at all times except when