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);
 }
 public function testGetsReservationListForDateRangeAndUser()
 {
     $startDate = Date::Parse('2011-01-01');
     $endDate = Date::Parse('2011-01-01');
     $referenceNumber1 = "ref1";
     $resource1 = "resource1";
     $start1 = Date::Parse('2011-08-09', 'UTC');
     $end1 = Date::Parse('2011-08-10', 'UTC');
     $resourceId = 929;
     $instanceId = 1000;
     $userLevelId = 2;
     $title = 'title';
     $description = 'description';
     $scheduleId = 213;
     $fname = 'fn';
     $lname = 'ln';
     $userId = 111;
     $phone = 'phone';
     $organization = 'organization';
     $position = 'position';
     $participant_list = '100=p 1!sep!200=p 2!sep!500=p 3';
     $invitee_list = '700=i 1!sep!800=1 2';
     $attributes = 'a1=av1,a2=av2';
     $preferences = 'p1=pv1,p2=pv2';
     $bufferTime = 3600;
     $rows[] = $this->GetReservationListRow($referenceNumber1, $resource1, $start1, $end1, $resourceId, $instanceId, $userLevelId, $title, $description, $scheduleId, $fname, $lname, $userId, $phone, $organization, $position, $participant_list, $invitee_list, $attributes, $preferences, $bufferTime);
     $rows[] = $this->GetReservationListRow("2", "resource", Date::Now(), Date::Now(), 1, 1, 1, null, null, 1, null, null, null, null, null, null);
     $this->db->SetRows($rows);
     $expectedCommand = new GetReservationListCommand($startDate, $endDate, $userId, ReservationUserLevel::OWNER, $scheduleId, $resourceId);
     $reservations = $this->repository->GetReservationList($startDate, $endDate, $userId, null, $scheduleId, $resourceId);
     $actualCommand = $this->db->_LastCommand;
     $this->assertEquals($expectedCommand, $actualCommand);
     $this->assertEquals(count($rows), count($reservations));
     $expectedItem1 = ReservationItemView::Populate($rows[0]);
     $this->assertEquals($expectedItem1, $reservations[0]);
 }