コード例 #1
0
 public function ProcessPageLoad()
 {
     $this->presenter->PageLoad();
     $this->Set('priorities', range(1, 10));
     $this->Set('timezone', ServiceLocator::GetServer()->GetUserSession()->Timezone);
     $this->Display('Admin/manage_announcements.tpl');
 }
コード例 #2
0
 public function PageLoad()
 {
     $this->Set('DefaultTitle', Resources::GetInstance()->GetString('NoTitleLabel'));
     $this->presenter->SetSearchCriteria(ServiceLocator::GetServer()->GetUserSession()->UserId, ReservationUserLevel::ALL);
     $this->presenter->PageLoad();
     $this->Display('upcoming_reservations.tpl');
 }
コード例 #3
0
ファイル: SlotLabelFactory.php プロジェクト: ksdtech/booked
 public function __construct($user = null)
 {
     $this->user = $user;
     if ($this->user == null) {
         $this->user = ServiceLocator::GetServer()->GetUserSession();
     }
 }
コード例 #4
0
 public function __construct()
 {
     parent::__construct();
     $userRepository = new UserRepository();
     $this->presenter = new ManageReservationsPresenter($this, new ScheduleAdminManageReservationsService(new ReservationViewRepository(), $userRepository, new ReservationAuthorization(PluginManager::Instance()->LoadAuthorization())), new ScheduleAdminScheduleRepository($userRepository, ServiceLocator::GetServer()->GetUserSession()), new ResourceAdminResourceRepository($userRepository, ServiceLocator::GetServer()->GetUserSession()), new AttributeService(new AttributeRepository()), new UserPreferenceRepository());
     $this->SetPageId('manage-reservations-schedule-admin');
 }
コード例 #5
0
 public function __construct()
 {
     parent::__construct();
     $userRepository = new UserRepository();
     $user = ServiceLocator::GetServer()->GetUserSession();
     $this->_presenter = new ManageSchedulesPresenter($this, new ScheduleAdminManageScheduleService(new ScheduleAdminScheduleRepository($userRepository, $user), new ScheduleRepository(), new ResourceAdminResourceRepository($userRepository, $user)), new GroupRepository());
 }
コード例 #6
0
 public function PageLoad()
 {
     ob_clean();
     $this->presenter->PageLoad();
     $config = Configuration::Instance();
     $feed = new FeedWriter(ATOM);
     $title = $config->GetKey(ConfigKeys::APP_TITLE);
     $feed->setTitle("{$title} Reservations");
     $url = $config->GetScriptUrl();
     $feed->setLink($url);
     $feed->setChannelElement('updated', date(DATE_ATOM, time()));
     $feed->setChannelElement('author', array('name' => $title));
     foreach ($this->reservations as $reservation) {
         /** @var FeedItem $item */
         $item = $feed->createNewItem();
         $item->setTitle($reservation->Summary);
         $item->setLink($reservation->ReservationUrl);
         $item->setDate($reservation->DateCreated->Timestamp());
         $item->setDescription($this->FormatReservationDescription($reservation, ServiceLocator::GetServer()->GetUserSession()));
         //			sprintf('<div><span>Start</span> %s</div>
         //										  <div><span>End</span> %s</div>
         //										  <div><span>Organizer</span> %s</div>
         //										  <div><span>Description</span> %s</div>',
         //										  $reservation->DateStart->ToString(),
         //										  $reservation->DateEnd->ToString(),
         //										  $reservation->Organizer,
         //										  $reservation->Description));
         $feed->addItem($item);
     }
     $feed->genarateFeed();
 }
コード例 #7
0
ファイル: Page.php プロジェクト: ViraSoftware/booked
 protected function __construct($titleKey = '', $pageDepth = 0)
 {
     $this->SetSecurityHeaders();
     $this->path = str_repeat('../', $pageDepth);
     $this->server = ServiceLocator::GetServer();
     $resources = Resources::GetInstance();
     ExceptionHandler::SetExceptionHandler(new WebExceptionHandler(array($this, 'RedirectToError')));
     $this->smarty = new SmartyPage($resources, $this->path);
     $userSession = ServiceLocator::GetServer()->GetUserSession();
     $this->smarty->assign('Charset', $resources->Charset);
     $this->smarty->assign('CurrentLanguage', $resources->CurrentLanguage);
     $this->smarty->assign('HtmlLang', $resources->HtmlLang);
     $this->smarty->assign('HtmlTextDirection', $resources->TextDirection);
     $appTitle = Configuration::Instance()->GetKey(ConfigKeys::APP_TITLE);
     $pageTile = $resources->GetString($titleKey);
     $this->smarty->assign('Title', (empty($appTitle) ? 'Booked' : $appTitle) . (empty($pageTile) ? '' : ' - ' . $pageTile));
     $this->smarty->assign('CalendarJSFile', $resources->CalendarLanguageFile);
     $this->smarty->assign('LoggedIn', $userSession->IsLoggedIn());
     $this->smarty->assign('Version', Configuration::VERSION);
     $this->smarty->assign('Path', $this->path);
     $this->smarty->assign('ScriptUrl', Configuration::Instance()->GetScriptUrl());
     $this->smarty->assign('UserName', !is_null($userSession) ? $userSession->FirstName : '');
     $this->smarty->assign('DisplayWelcome', $this->DisplayWelcome());
     $this->smarty->assign('UserId', $userSession->UserId);
     $this->smarty->assign('CanViewAdmin', $userSession->IsAdmin);
     $this->smarty->assign('CanViewGroupAdmin', $userSession->IsGroupAdmin);
     $this->smarty->assign('CanViewResourceAdmin', $userSession->IsResourceAdmin);
     $this->smarty->assign('CanViewScheduleAdmin', $userSession->IsScheduleAdmin);
     $this->smarty->assign('CanViewResponsibilities', !$userSession->IsAdmin && ($userSession->IsGroupAdmin || $userSession->IsResourceAdmin || $userSession->IsScheduleAdmin));
     $allowAllUsersToReports = Configuration::Instance()->GetSectionKey(ConfigSection::REPORTS, ConfigKeys::REPORTS_ALLOW_ALL, new BooleanConverter());
     $this->smarty->assign('CanViewReports', $allowAllUsersToReports || $userSession->IsAdmin || $userSession->IsGroupAdmin || $userSession->IsResourceAdmin || $userSession->IsScheduleAdmin);
     $timeout = Configuration::Instance()->GetKey(ConfigKeys::INACTIVITY_TIMEOUT);
     if (!empty($timeout)) {
         $this->smarty->assign('SessionTimeoutSeconds', max($timeout, 1) * 60);
     }
     $this->smarty->assign('ShouldLogout', $this->GetShouldAutoLogout());
     $this->smarty->assign('CssExtensionFile', Configuration::Instance()->GetKey(ConfigKeys::CSS_EXTENSION_FILE));
     $this->smarty->assign('UseLocalJquery', Configuration::Instance()->GetKey(ConfigKeys::USE_LOCAL_JQUERY, new BooleanConverter()));
     $this->smarty->assign('EnableConfigurationPage', Configuration::Instance()->GetSectionKey(ConfigSection::PAGES, ConfigKeys::PAGES_ENABLE_CONFIGURATION, new BooleanConverter()));
     $this->smarty->assign('ShowParticipation', !Configuration::Instance()->GetSectionKey(ConfigSection::RESERVATION, ConfigKeys::RESERVATION_PREVENT_PARTICIPATION, new BooleanConverter()));
     $this->smarty->assign('LogoUrl', 'booked.png');
     if (file_exists($this->path . 'img/custom-logo.png')) {
         $this->smarty->assign('LogoUrl', 'custom-logo.png');
     }
     if (file_exists($this->path . 'img/custom-logo.gif')) {
         $this->smarty->assign('LogoUrl', 'custom-logo.gif');
     }
     if (file_exists($this->path . 'img/custom-logo.jpg')) {
         $this->smarty->assign('LogoUrl', 'custom-logo.jpg');
     }
     $this->smarty->assign('CssUrl', 'null-style.css');
     if (file_exists($this->path . 'css/custom-style.css')) {
         $this->smarty->assign('CssUrl', 'custom-style.css');
     }
     $logoUrl = Configuration::Instance()->GetKey(ConfigKeys::HOME_URL);
     if (empty($logoUrl)) {
         $logoUrl = $this->path . Pages::UrlFromId($userSession->HomepageId);
     }
     $this->smarty->assign('HomeUrl', $logoUrl);
 }
コード例 #8
0
 /**
  * @param IReservationViewRepository $reservationViewRepository
  * @param IReservationAuthorization $authorization
  * @param IReservationHandler $reservationHandler
  * @param IUpdateReservationPersistenceService $persistenceService
  */
 public function __construct(IReservationViewRepository $reservationViewRepository, $authorization = null, $reservationHandler = null, $persistenceService = null)
 {
     $this->reservationViewRepository = $reservationViewRepository;
     $this->reservationAuthorization = $authorization == null ? new ReservationAuthorization(PluginManager::Instance()->LoadAuthorization()) : $authorization;
     $this->persistenceService = $persistenceService == null ? new UpdateReservationPersistenceService(new ReservationRepository()) : $persistenceService;
     $this->reservationHandler = $reservationHandler == null ? ReservationHandler::Create(ReservationAction::Update, $this->persistenceService, ServiceLocator::GetServer()->GetUserSession()) : $reservationHandler;
 }
コード例 #9
0
ファイル: Registration.php プロジェクト: ajeshgeorge22/booked
 public function Register($username, $email, $firstName, $lastName, $password, $timezone, $language, $homepageId, $additionalFields = array(), $attributeValues = array(), $groups = null)
 {
     $encryptedPassword = $this->_passwordEncryption->EncryptPassword($password);
     $attributes = new UserAttribute($additionalFields);
     if ($this->CreatePending()) {
         $user = User::CreatePending($firstName, $lastName, $email, $username, $language, $timezone, $encryptedPassword->EncryptedPassword(), $encryptedPassword->Salt(), $homepageId);
     } else {
         $user = User::Create($firstName, $lastName, $email, $username, $language, $timezone, $encryptedPassword->EncryptedPassword(), $encryptedPassword->Salt(), $homepageId);
     }
     $user->ChangeAttributes($attributes->Get(UserAttribute::Phone), $attributes->Get(UserAttribute::Organization), $attributes->Get(UserAttribute::Position));
     $user->ChangeCustomAttributes($attributeValues);
     if ($groups != null) {
         $user->WithGroups($groups);
     }
     if (Configuration::Instance()->GetKey(ConfigKeys::REGISTRATION_AUTO_SUBSCRIBE_EMAIL, new BooleanConverter())) {
         foreach (ReservationEvent::AllEvents() as $event) {
             $user->ChangeEmailPreference($event, true);
         }
     }
     $userId = $this->_userRepository->Add($user);
     $this->AutoAssignPermissions($userId);
     if (Configuration::Instance()->GetKey(ConfigKeys::REGISTRATION_NOTIFY, new BooleanConverter())) {
         ServiceLocator::GetEmailService()->Send(new AccountCreationEmail($user, ServiceLocator::GetServer()->GetUserSession()));
     }
     return $user;
 }
コード例 #10
0
 /**
  * @param ReservationItemView $existingReservation
  * @return bool
  */
 public function Handle(ReservationItemView $existingReservation)
 {
     $reservation = $this->repository->LoadById($existingReservation->GetId());
     $reservation->ApplyChangesTo(SeriesUpdateScope::ThisInstance);
     $reservation->Delete(ServiceLocator::GetServer()->GetUserSession());
     $this->repository->Delete($reservation);
     return true;
 }
コード例 #11
0
ファイル: reservation_delete.php プロジェクト: hugutux/booked
 public static function Create()
 {
     if (ServiceLocator::GetServer()->GetQuerystring(QueryStringKeys::RESPONSE_TYPE) == 'json') {
         return new ReservationDeleteJsonPage();
     } else {
         return new ReservationDeletePage();
     }
 }
コード例 #12
0
 public function __construct()
 {
     parent::__construct();
     $this->_presenter->SetUserRepository(new GroupAdminUserRepository(new GroupRepository(), ServiceLocator::GetServer()->GetUserSession()));
     $groupRepository = new GroupAdminGroupRepository(new UserRepository(), ServiceLocator::GetServer()->GetUserSession());
     $this->_presenter->SetGroupRepository($groupRepository);
     $this->_presenter->SetGroupViewRepository($groupRepository);
 }
コード例 #13
0
ファイル: CalendarExportPage.php プロジェクト: Trideon/gigolo
 public function PageLoad()
 {
     $this->presenter->PageLoad(ServiceLocator::GetServer()->GetUserSession());
     header("Content-Type: text/Calendar");
     header("Content-Disposition: inline; filename=calendar.ics");
     $display = new CalendarExportDisplay();
     echo $display->Render($this->reservations);
 }
コード例 #14
0
ファイル: AdminPage.php プロジェクト: hugutux/booked
 public function __construct($titleKey = '', $pageDepth = 1)
 {
     parent::__construct($titleKey, $pageDepth);
     $user = ServiceLocator::GetServer()->GetUserSession();
     if (!$user->IsAdmin) {
         $this->RedirectResume(sprintf("%s%s?%s=%s", $this->path, Pages::LOGIN, QueryStringKeys::REDIRECT, urlencode($this->server->GetUrl())));
         die;
     }
 }
コード例 #15
0
ファイル: DashboardPresenter.php プロジェクト: hugutux/booked
 public function Initialize()
 {
     $announcement = new AnnouncementsControl(new SmartyPage());
     $upcomingReservations = new UpcomingReservations(new SmartyPage());
     $this->_page->AddItem($announcement);
     $this->_page->AddItem($upcomingReservations);
     if (ServiceLocator::GetServer()->GetUserSession()->IsAdmin) {
         $allUpcomingReservations = new AllUpcomingReservations(new SmartyPage());
         $this->_page->AddItem($allUpcomingReservations);
     }
 }
コード例 #16
0
 public function PageLoad()
 {
     $this->page->SetEmailEnabled(Configuration::Instance()->GetKey(ConfigKeys::ENABLE_EMAIL, new BooleanConverter()));
     $userSession = ServiceLocator::GetServer()->GetUserSession();
     $user = $this->userRepository->LoadById($userSession->UserId);
     if ($this->page->IsPostBack()) {
         $this->UpdateProfile($user);
         $this->page->SetPreferencesSaved(true);
     }
     $this->page->SetApproved($user->WantsEventEmail(new ReservationApprovedEvent()));
     $this->page->SetCreated($user->WantsEventEmail(new ReservationCreatedEvent()));
     $this->page->SetUpdated($user->WantsEventEmail(new ReservationUpdatedEvent()));
     $this->page->SetDeleted($user->WantsEventEmail(new ReservationDeletedEvent()));
 }
コード例 #17
0
 public function PageLoad()
 {
     try {
         $reservationAction = ReservationAction::Approve;
         $factory = new ReservationPersistenceFactory();
         $persistenceService = $factory->Create($reservationAction);
         $handler = ReservationHandler::Create($reservationAction, $persistenceService, ServiceLocator::GetServer()->GetUserSession());
         $auth = new ReservationAuthorization(PluginManager::Instance()->LoadAuthorization());
         $presenter = new ReservationApprovalPresenter($this, $persistenceService, $handler, $auth, ServiceLocator::GetServer()->GetUserSession());
         $presenter->PageLoad();
     } catch (Exception $ex) {
         Log::Error('ReservationApprovalPage - Critical error saving reservation: %s', $ex);
         $this->Display('Ajax/reservation/reservation_error.tpl');
     }
 }
コード例 #18
0
ファイル: SlotLabelFactory.php プロジェクト: JoseTfg/Booked
 public function __construct($user = null, $privacyFilter = null, $attributeRepository = null)
 {
     $this->user = $user;
     if ($this->user == null) {
         $this->user = ServiceLocator::GetServer()->GetUserSession();
     }
     $this->privacyFilter = $privacyFilter;
     if ($this->privacyFilter == null) {
         $this->privacyFilter = new PrivacyFilter(new ReservationAuthorization(PluginManager::Instance()->LoadAuthorization()));
     }
     $this->attributeRepository = $attributeRepository;
     if ($this->attributeRepository == null) {
         $this->attributeRepository = new AttributeRepository();
     }
 }
コード例 #19
0
 public function ChangeAnnouncement()
 {
     $user = ServiceLocator::GetServer()->GetUserSession();
     $id = $this->page->GetAnnouncementId();
     $text = $this->page->GetText();
     $start = Date::Parse($this->page->GetStart(), $user->Timezone);
     $end = Date::Parse($this->page->GetEnd(), $user->Timezone);
     $priority = $this->page->GetPriority();
     Log::Debug('Changing Announcement with id %s', $id);
     $announcement = $this->announcementRepository->LoadById($id);
     $announcement->SetText($text);
     $announcement->SetDates($start, $end);
     $announcement->SetPriority($priority);
     $this->announcementRepository->Update($announcement);
 }
コード例 #20
0
 public function PageLoad()
 {
     $user = ServiceLocator::GetServer()->GetUserSession();
     $timezone = $user->Timezone;
     $now = Date::Now();
     $today = $now->ToTimezone($timezone)->GetDate();
     $dayOfWeek = $today->Weekday();
     $lastDate = $now->AddDays(13 - $dayOfWeek - 1);
     $reservations = $this->repository->GetReservationList($now, $lastDate, $this->searchUserId, $this->searchUserLevel);
     $tomorrow = $today->AddDays(1);
     $startOfNextWeek = $today->AddDays(7 - $dayOfWeek);
     $todays = array();
     $tomorrows = array();
     $thisWeeks = array();
     $nextWeeks = array();
     /* @var $reservation ReservationItemView */
     /*foreach ($reservations as $reservation)
     		{
     			$start = $reservation->StartDate->ToTimezone($timezone);
     
     			if ($start->DateEquals($today))
     			{
     				$todays[] = $reservation;
     			}
     			else if ($start->DateEquals($tomorrow))
     			{
     				$tomorrows[] = $reservation;
     			}
     			else if ($start->LessThan($startOfNextWeek))
     			{
     				$thisWeeks[] = $reservation;
     			}
     			else
     			{
     				$nextWeeks[] = $reservation;
     			}
     		}*/
     $this->control->SetTotal(count($reservations));
     $this->control->SetTimezone($timezone);
     $this->control->SetUserId($user->UserId);
     $this->control->BindReservations($reservations);
     $this->control->BindExperiment($reservations->experiment);
     $this->control->BindTodayDate();
     /*$this->control->BindToday($todays);
     		$this->control->BindTomorrow($tomorrows);
     		$this->control->BindThisWeek($thisWeeks);
     		$this->control->BindNextWeek($nextWeeks);*/
 }
コード例 #21
0
 public function ShowUserAttributes()
 {
     // User attributes on Dashboard, Added by Burak C.
     $userId = ServiceLocator::GetServer()->GetUserSession()->UserId;
     $userRepository = new UserRepository();
     $this->user = $userRepository->LoadById($userId);
     $attributeService = new AttributeService(new AttributeRepository());
     $attributes = $attributeService->GetByCategory(CustomAttributeCategory::USER);
     $reservationViewRepository = new ReservationViewRepository();
     $startDate = Date::Now();
     $endDate = $startDate->AddDays(30);
     $reservations = $reservationViewRepository->GetReservationList($startDate, $endDate, $userId, ReservationUserLevel::INVITEE);
     $this->_page->Set("invitations", $reservations);
     $this->_page->Set("user", $this->user);
     $this->_page->Set("attributes", $attributes);
 }
コード例 #22
0
ファイル: CalendarExportPage.php プロジェクト: hugutux/booked
 public function PageLoad()
 {
     $this->presenter->PageLoad(ServiceLocator::GetServer()->GetUserSession());
     header("Content-Type: text/Calendar");
     header("Content-Disposition: inline; filename=calendar.ics");
     $config = Configuration::Instance();
     $this->Set('bookedVersion', $config->GetKey(ConfigKeys::VERSION));
     $this->Set('DateStamp', Date::Now());
     /**
      * ScriptUrl is used to generate iCal UID's. As a workaround to this bug
      * https://bugzilla.mozilla.org/show_bug.cgi?id=465853
      * we need to avoid using any slashes "/"
      */
     $url = $config->GetScriptUrl();
     $this->Set('ScriptUrl', parse_url($url, PHP_URL_HOST));
     $this->Display('Export/ical.tpl');
 }
コード例 #23
0
 /**
  * @see IReservationValidationRule::Validate()
  *
  * @param ReservationSeries $reservationSeries
  * @return ReservationRuleResult
  */
 public function Validate($reservationSeries)
 {
     $r = Resources::GetInstance();
     $resources = $reservationSeries->AllResources();
     foreach ($resources as $resource) {
         if ($resource->HasMaxNotice()) {
             $maxStartDate = Date::Now()->ApplyDifference($resource->GetMaxNotice()->Interval());
             /* @var $instance Reservation */
             foreach ($this->GetInstances($reservationSeries) as $instance) {
                 if ($instance->StartDate()->GreaterThan($maxStartDate)) {
                     return new ReservationRuleResult(false, $r->GetString("MaxNoticeError", $maxStartDate->ToTimezone(ServiceLocator::GetServer()->GetUserSession()->Timezone)->Format($r->GeneralDateTimeFormat())));
                 }
             }
         }
     }
     return new ReservationRuleResult();
 }
コード例 #24
0
 public function PageLoad()
 {
     try {
         $reservation = $this->_presenter->BuildReservation();
         $this->_presenter->HandleReservation($reservation);
         if ($this->_reservationSavedSuccessfully) {
             $this->Set('Resources', $reservation->AllResources());
             $this->Set('Instances', $reservation->Instances());
             $this->Set('Timezone', ServiceLocator::GetServer()->GetUserSession()->Timezone);
             $this->Display('Ajax/reservation/update_successful.tpl');
         } else {
             $this->Display('Ajax/reservation/save_failed.tpl');
         }
     } catch (Exception $ex) {
         Log::Error('ReservationUpdatePage - Critical error saving reservation: %s', $ex);
         $this->Display('Ajax/reservation/reservation_error.tpl');
     }
 }
コード例 #25
0
ファイル: ConfigurePresenter.php プロジェクト: hugutux/booked
 private function Configure()
 {
     if (!$this->securityGuard->IsAuthenticated()) {
         return;
     }
     $user = ServiceLocator::GetServer()->GetUserSession();
     Log::Debug('Editing configuration file. Email=%s, UserId=%s', $user->Email, $user->UserId);
     $configFile = ROOT_DIR . 'config/config.php';
     $configDistFile = ROOT_DIR . 'config/config.dist.php';
     $configurator = new Configurator();
     if ($configurator->CanOverwriteFile($configFile)) {
         $configurator->Merge($configFile, $configDistFile);
         $this->page->ShowConfigUpdateSuccess();
     } else {
         $manualConfig = $configurator->GetMergedString($configFile, $configDistFile);
         $this->page->ShowManualConfig($manualConfig);
     }
 }
コード例 #26
0
 public function PageLoad()
 {
     $invitationAction = $this->page->GetInvitationAction();
     if (!empty($invitationAction)) {
         $resultString = $this->HandleInvitationAction($invitationAction);
         if ($this->page->GetResponseType() == 'json') {
             $this->page->DisplayResult($resultString);
             return;
         }
         $this->page->SetResult($resultString);
     }
     $startDate = Date::Now();
     $endDate = $startDate->AddDays(30);
     $user = ServiceLocator::GetServer()->GetUserSession();
     $userId = $user->UserId;
     $reservations = $this->reservationViewRepository->GetReservationList($startDate, $endDate, $userId, ReservationUserLevel::INVITEE);
     $this->page->SetTimezone($user->Timezone);
     $this->page->BindReservations($reservations);
     $this->page->DisplayParticipation();
 }
コード例 #27
0
 public function UpdateAttribute()
 {
     $userSession = ServiceLocator::GetServer()->GetUserSession();
     $referenceNumber = $this->page->GetReferenceNumber();
     $attributeId = $this->page->GetAttributeId();
     $attributeValue = $this->page->GetAttributeValue();
     Log::Debug('Updating reservation attribute. UserId=%s, AttributeId=%s, AttributeValue=%s, ReferenceNumber=%s', $userSession->UserId, $attributeId, $attributeValue, $referenceNumber);
     $errors = $this->manageReservationsService->UpdateAttribute($referenceNumber, $attributeId, $attributeValue, $userSession);
     if (!empty($errors)) {
         $this->page->BindAttributeUpdateErrors($errors);
     }
 }
コード例 #28
0
ファイル: Configuration.php プロジェクト: hugutux/booked
 public function GetScriptUrl()
 {
     $url = $this->GetKey(ConfigKeys::SCRIPT_URL);
     if (BookedStringHelper::StartsWith($url, '//')) {
         $isHttps = ServiceLocator::GetServer()->GetIsHttps();
         if ($isHttps) {
             $url = "https:{$url}";
         } else {
             $url = "http:{$url}";
         }
     }
     return rtrim($url, '/');
 }
コード例 #29
0
 public function DisableSubscription()
 {
     $userId = ServiceLocator::GetServer()->GetUserSession()->UserId;
     Log::Debug('Disabling calendar subscription for userId: %s', $userId);
     $user = $this->userRepository->LoadById($userId);
     $user->DisableSubscription();
     $this->userRepository->Update($user);
 }
コード例 #30
0
ファイル: CommonReportsPage.php プロジェクト: Trideon/gigolo
 public function __construct()
 {
     parent::__construct('CommonReports', 1);
     $this->presenter = new CommonReportsPresenter($this, ServiceLocator::GetServer()->GetUserSession(), new ReportingService(new ReportingRepository()));
 }