diff options
| author | Björn Geiger | 2011-04-05 17:36:08 +0200 |
|---|---|---|
| committer | Björn Geiger | 2011-04-05 17:36:08 +0200 |
| commit | 58dfe1b55ef3ead11117e19b4abb84c6b83814c1 (patch) | |
| tree | a6f253d0c939f64628bb87ad280ad6f68b7f9c3f /application/modules/user/controllers/PersonController.php | |
| parent | Merge branch 'master' of ssh://git.openslx.org/lsfks/master-teamprojekt/pbs2 (diff) | |
| download | pbs2-58dfe1b55ef3ead11117e19b4abb84c6b83814c1.tar.gz pbs2-58dfe1b55ef3ead11117e19b4abb84c6b83814c1.tar.xz pbs2-58dfe1b55ef3ead11117e19b4abb84c6b83814c1.zip | |
Paging bei Person, Group und Role
Diffstat (limited to 'application/modules/user/controllers/PersonController.php')
| -rw-r--r-- | application/modules/user/controllers/PersonController.php | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/application/modules/user/controllers/PersonController.php b/application/modules/user/controllers/PersonController.php index 08add21..201b452 100644 --- a/application/modules/user/controllers/PersonController.php +++ b/application/modules/user/controllers/PersonController.php @@ -50,7 +50,16 @@ class user_PersonController extends Zend_Controller_Action $this->_redirect('/user'); } $this->view->person = $this->person; - $this->view->groups = $this->groups; + // Pagination + $pagination = new Pbs_Pagination(); + $pagination->setPerPage(1); + $pagination->setElement($this->groups); + $pagination->setRequestPage($this->_request->getParam('page')); + $pagination->setPageUrl('/user/person/index' .((isset($this->view->search))?'/search/'.$this->view->search:'')); + + $this->view->groups = $pagination->getElements(); + $this->view->pagination = $pagination->pagination($pageurl); + $this->view->page = $pagination->getRequestPage(); $this->view->groupRequestRight = Pbs_Acl::checkRight('grm'); $this->view->editRight = Pbs_Acl::checkRight('peoa'); $this->view->leaveRight = Pbs_Acl::checkRight('gl'); @@ -266,7 +275,17 @@ class user_PersonController extends Zend_Controller_Action $this->view->editOtherRight = Pbs_Acl::checkRight('peoa'); $this->view->deleteOtherRight = Pbs_Acl::checkRight('pdo'); $this->view->userIDsNamespace = $this->userIDsNamespace; - $this->view->personList = $this->personmapper->fetchAll(); + + // Pagination + $pagination = new Pbs_Pagination(); + $pagination->setPerPage(5); + $pagination->setElement($this->personmapper->fetchAll()); + $pagination->setRequestPage($this->_request->getParam('page')); + $pagination->setPageUrl('/user/person/showall'.((isset($this->view->search))?'/search/'.$this->view->search:'')); + + $this->view->personList = $pagination->getElements(); + $this->view->pagination = $pagination->pagination($pageurl); + $this->view->page = $pagination->getRequestPage(); } public function showAction() @@ -290,7 +309,17 @@ class user_PersonController extends Zend_Controller_Action } } $this->view->person = $person; - $this->view->groups = $groups; + + // Pagination + $pagination = new Pbs_Pagination(); + $pagination->setPerPage(2); + $pagination->setElement($groups); + $pagination->setRequestPage($this->_request->getParam('page')); + $pagination->setPageUrl('/user/person/show/personID/' . $personID .((isset($this->view->search))?'/search/'.$this->view->search:'')); + + $this->view->groups = $pagination->getElements(); + $this->view->pagination = $pagination->pagination($pageurl); + $this->view->page = $pagination->getRequestPage(); $this->view->personID = $personID; $this->view->editRight = Pbs_Acl::checkRight('peoa'); $this->view->deleteRight = Pbs_Acl::checkRight('pd'); |
