コード例 #1
0
 public function LoadBlackout()
 {
     $id = $this->page->GetBlackoutId();
     $session = ServiceLocator::GetServer()->GetUserSession();
     Log::Debug('Loading blackout for editing. Id=%s', $id);
     $series = $this->manageBlackoutsService->LoadBlackout($id, $session->UserId);
     if ($series != null) {
         $this->page->BindResources($this->resourceRepository->GetResourceList());
         $this->page->SetBlackoutResources($series->ResourceIds());
         $this->page->SetBlackoutId($id);
         $this->page->SetBlackoutStartDate($series->CurrentBlackout()->StartDate()->ToTimezone($session->Timezone));
         $this->page->SetBlackoutEndDate($series->CurrentBlackout()->EndDate()->ToTimezone($session->Timezone));
         $this->page->SetTitle($series->Title());
         $this->page->SetIsRecurring($series->RepeatType() != RepeatType::None);
         $repeatConfiguration = $series->RepeatConfiguration();
         $this->page->SetRepeatInterval($repeatConfiguration->Interval);
         $this->page->SetRepeatMonthlyType($repeatConfiguration->MonthlyType);
         if ($repeatConfiguration->TerminationDate != null) {
             $this->page->SetRepeatTerminationDate($repeatConfiguration->TerminationDate->ToTimezone($session->Timezone));
         }
         $this->page->SetRepeatType($repeatConfiguration->Type);
         $this->page->SetRepeatWeekdays($repeatConfiguration->Weekdays);
         $this->page->SetWasBlackoutFound(true);
     } else {
         $this->page->SetWasBlackoutFound(false);
     }
     $this->page->ShowBlackout();
 }