summaryrefslogtreecommitdiffstats
path: root/application
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
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')
-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
-rw-r--r--application/modules/user/views/scripts/group/showall.phtml3
-rw-r--r--application/modules/user/views/scripts/person/showall.phtml1
-rw-r--r--application/modules/user/views/scripts/role/index.phtml1
6 files changed, 57 insertions, 5 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'])) {
diff --git a/application/modules/user/views/scripts/group/showall.phtml b/application/modules/user/views/scripts/group/showall.phtml
index 34f3e11..356ebbc 100644
--- a/application/modules/user/views/scripts/group/showall.phtml
+++ b/application/modules/user/views/scripts/group/showall.phtml
@@ -1,4 +1,5 @@
<h1>Groups Overview</h1>
+<?php echo $this->searchform; ?>
<?php echo $this->formButton('addgroup', 'Add Group', array(
'onclick' => 'self.location="/user/group/add"',
'class' => 'addbutton'))
@@ -73,7 +74,7 @@
}
?>
</table>
-<?php echo $this->pagination; ?>
+ <?php echo $this->pagination; ?>
<?php echo $this->formButton('linkgroups', 'Link Groups', array(
'onclick' => 'self.location="/user/group/link"',
'class' => 'addbutton'))
diff --git a/application/modules/user/views/scripts/person/showall.phtml b/application/modules/user/views/scripts/person/showall.phtml
index d605f70..d9f4cf9 100644
--- a/application/modules/user/views/scripts/person/showall.phtml
+++ b/application/modules/user/views/scripts/person/showall.phtml
@@ -1,6 +1,7 @@
<h1>Persons Overview</h1>
<br />
<br />
+<?php echo $this->searchform; ?>
<table>
<tr>
<th>Title</th>
diff --git a/application/modules/user/views/scripts/role/index.phtml b/application/modules/user/views/scripts/role/index.phtml
index 8ca2bd6..2dbe77d 100644
--- a/application/modules/user/views/scripts/role/index.phtml
+++ b/application/modules/user/views/scripts/role/index.phtml
@@ -2,6 +2,7 @@
if($this->userIDsNamespace['groupID']) {
?>
<h1>Roles</h1>
+ <?php echo $this->searchform; ?>
<?php echo $this->formButton('addrole', 'Add Role', array(
'onclick' => 'self.location="/user/role/add"',
'class' => 'addbutton'))?>