示例#1
0
 public function PageLoad()
 {
     if ($this->page->GetUserId() != null) {
         $userList = $this->userRepository->GetList(1, 1, null, null, new SqlFilterEquals(ColumnNames::USER_ID, $this->page->GetUserId()));
     } else {
         $userList = $this->userRepository->GetList($this->page->GetPageNumber(), $this->page->GetPageSize(), null, null, null, $this->page->GetFilterStatusId());
     }
     $this->page->BindUsers($userList->Results());
     $this->page->BindPageInfo($userList->PageInfo());
     $groups = $this->groupViewRepository->GetList();
     $this->page->BindGroups($groups->Results());
     $resources = array();
     $user = $this->userRepository->LoadById(ServiceLocator::GetServer()->GetUserSession()->UserId);
     $allResources = $this->resourceRepository->GetResourceList();
     foreach ($allResources as $resource) {
         if ($user->IsResourceAdminFor($resource)) {
             $resources[] = $resource;
         }
     }
     $this->page->BindResources($resources);
     $userIds = array();
     /** @var $user UserItemView */
     foreach ($userList->Results() as $user) {
         $userIds[] = $user->Id;
     }
     $attributeList = $this->attributeService->GetAttributes(CustomAttributeCategory::USER, $userIds);
     $this->page->BindAttributeList($attributeList);
 }
 public function PageLoad()
 {
     if ($this->page->GetUserId() != null) {
         $userList = $this->userRepository->GetList(1, 1, null, null, new SqlFilterEquals(ColumnNames::USER_ID, $this->page->GetUserId()));
     } else {
         $userList = $this->userRepository->GetList($this->page->GetPageNumber(), $this->page->GetPageSize(), null, null, null, $this->page->GetFilterStatusId());
     }
     $this->page->BindUsers($userList->Results());
     $this->page->BindPageInfo($userList->PageInfo());
     $groups = $this->groupViewRepository->GetList();
     $this->page->BindGroups($groups->Results());
     $user = $this->userRepository->LoadById(ServiceLocator::GetServer()->GetUserSession()->UserId);
     $resources = $this->GetResourcesThatCurrentUserCanAdminister($user);
     $this->page->BindResources($resources);
     $attributeList = $this->attributeService->GetByCategory(CustomAttributeCategory::USER);
     $this->page->BindAttributeList($attributeList);
 }