summaryrefslogtreecommitdiffstats
path: root/application/modules/user/controllers
diff options
context:
space:
mode:
authorBjörn Geiger2011-04-05 18:13:12 +0200
committerBjörn Geiger2011-04-05 18:13:12 +0200
commitea3400f39cd5ffae715562b2ae6403d3f0384b03 (patch)
tree642c4a9b0fd30248936572135f389266de88b8cb /application/modules/user/controllers
parentMerge branch 'master' of ssh://git.openslx.org/lsfks/master-teamprojekt/pbs2 (diff)
downloadpbs2-ea3400f39cd5ffae715562b2ae6403d3f0384b03.tar.gz
pbs2-ea3400f39cd5ffae715562b2ae6403d3f0384b03.tar.xz
pbs2-ea3400f39cd5ffae715562b2ae6403d3f0384b03.zip
Search in Group, Person und Role
Diffstat (limited to 'application/modules/user/controllers')
-rw-r--r--application/modules/user/controllers/GroupController.php19
-rw-r--r--application/modules/user/controllers/PersonController.php19
-rw-r--r--application/modules/user/controllers/RoleController.php19
3 files changed, 53 insertions, 4 deletions
diff --git a/application/modules/user/controllers/GroupController.php b/application/modules/user/controllers/GroupController.php
index 0eb32b6..064ca60 100644
--- a/application/modules/user/controllers/GroupController.php
+++ b/application/modules/user/controllers/GroupController.php
@@ -292,10 +292,23 @@ class User_GroupController extends Zend_Controller_Action
public function showallAction()
{
+ $this->view->groupList = $this->groupList;
+
+ // Search
+ $search = $this->_request->getParam('search');
+ $mySearch = new Pbs_Search();
+ $mySearch->setSearchTerm($search);
+ $mySearch->setModule('group');
+ if($search != ''){
+ $this->view->search = $mySearch->getSearchTerm();
+ $this->view->groupList = $mySearch->search($this->view->groupList);
+ }
+ $this->view->searchform = $mySearch->searchForm();
+
// Pagination
$pagination = new Pbs_Pagination();
$pagination->setPerPage(5);
- $pagination->setElement($this->groupList);
+ $pagination->setElement($this->view->groupList);
$pagination->setRequestPage($this->_request->getParam('page'));
$pagination->setPageUrl('/user/group/showall'.((isset($this->view->search))?'/search/'.$this->view->search:''));
@@ -305,6 +318,8 @@ class User_GroupController extends Zend_Controller_Action
$this->view->userIDsNamespace = $this->userIDsNamespace;
}
-
+ public function searchAction(){
+ $this->_redirect('/user/group/showall/search/'.($_GET['search']));
+ }
}
diff --git a/application/modules/user/controllers/PersonController.php b/application/modules/user/controllers/PersonController.php
index 201b452..71a8c7d 100644
--- a/application/modules/user/controllers/PersonController.php
+++ b/application/modules/user/controllers/PersonController.php
@@ -276,10 +276,23 @@ class user_PersonController extends Zend_Controller_Action
$this->view->deleteOtherRight = Pbs_Acl::checkRight('pdo');
$this->view->userIDsNamespace = $this->userIDsNamespace;
+ $this->view->personList = $this->personmapper->fetchAll();
+
+ // Search
+ $search = $this->_request->getParam('search');
+ $mySearch = new Pbs_Search();
+ $mySearch->setSearchTerm($search);
+ $mySearch->setModule('person');
+ if($search != ''){
+ $this->view->search = $mySearch->getSearchTerm();
+ $this->view->personList = $mySearch->search($this->view->personList);
+ }
+ $this->view->searchform = $mySearch->searchForm();
+
// Pagination
$pagination = new Pbs_Pagination();
$pagination->setPerPage(5);
- $pagination->setElement($this->personmapper->fetchAll());
+ $pagination->setElement($this->view->personList);
$pagination->setRequestPage($this->_request->getParam('page'));
$pagination->setPageUrl('/user/person/showall'.((isset($this->view->search))?'/search/'.$this->view->search:''));
@@ -288,6 +301,10 @@ class user_PersonController extends Zend_Controller_Action
$this->view->page = $pagination->getRequestPage();
}
+ public function searchAction(){
+ $this->_redirect('/user/person/showall/search/'.($_GET['search']));
+ }
+
public function showAction()
{
if(!Pbs_Acl::checkRight('psood')) {
diff --git a/application/modules/user/controllers/RoleController.php b/application/modules/user/controllers/RoleController.php
index 86872f0..4e0aa52 100644
--- a/application/modules/user/controllers/RoleController.php
+++ b/application/modules/user/controllers/RoleController.php
@@ -23,10 +23,23 @@ class User_RoleController extends Zend_Controller_Action
public function indexAction()
{
if(isset($this->userIDsNamespace['groupID'])) {
+ $this->view->roleList = $this->roleMapper->findBy(array('groupID' => $this->userIDsNamespace['groupID']),true);
+
+ // Search
+ $search = $this->_request->getParam('search');
+ $mySearch = new Pbs_Search();
+ $mySearch->setSearchTerm($search);
+ $mySearch->setModule('role');
+ if($search != ''){
+ $this->view->search = $mySearch->getSearchTerm();
+ $this->view->roleList = $mySearch->search($this->view->roleList);
+ }
+ $this->view->searchform = $mySearch->searchForm();
+
// Pagination
$pagination = new Pbs_Pagination();
$pagination->setPerPage(5);
- $pagination->setElement($this->roleMapper->findBy(array('groupID' => $this->userIDsNamespace['groupID']),true));
+ $pagination->setElement($this->view->roleList);
$pagination->setRequestPage($this->_request->getParam('page'));
$pagination->setPageUrl('/user/role/index'.((isset($this->view->search))?'/search/'.$this->view->search:''));
@@ -40,6 +53,10 @@ class User_RoleController extends Zend_Controller_Action
}
}
+ public function searchAction(){
+ $this->_redirect('/user/role/index/search/'.($_GET['search']));
+ }
+
public function addAction()
{
if(isset($this->userIDsNamespace['groupID'])) {