summaryrefslogtreecommitdiffstats
path: root/application/modules/user/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'application/modules/user/controllers')
-rw-r--r--application/modules/user/controllers/FilterController.php3
-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/controllers/SessionController.php2
5 files changed, 56 insertions, 6 deletions
diff --git a/application/modules/user/controllers/FilterController.php b/application/modules/user/controllers/FilterController.php
index da42b76..ead81ab 100644
--- a/application/modules/user/controllers/FilterController.php
+++ b/application/modules/user/controllers/FilterController.php
@@ -48,7 +48,7 @@ class User_FilterController extends Zend_Controller_Action
$this->view->notification = $pbsNotifier->notify('modify',$result);
}
- $filters = $this->filterMapper->findBy(array('groupID' => $this->membership->getGroupID()),true,array('priority'=>'DESC'));
+ $filters = $this->filterMapper->findBy(array('groupID' => $this->membership->getGroupID(),'membershipID'=>null),true,array('priority'=>'DESC'));
$bootmenuMapper = new Application_Model_BootMenuMapper();
foreach($filters as $filter){
$ff = new Application_Model_Filter();
@@ -133,6 +133,7 @@ class User_FilterController extends Zend_Controller_Action
$filterentry = new Application_Model_FilterEntries();
$filterentry->setFilterID($id);
$filterentry->setFiltertypeID(6);
+ $filterentry->setCreated(time());
$filterentry->setFiltervalue($this->membership->getGroupID());
$filterentriesMapper->save($filterentry);
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/controllers/SessionController.php b/application/modules/user/controllers/SessionController.php
index 018e738..3768af9 100644
--- a/application/modules/user/controllers/SessionController.php
+++ b/application/modules/user/controllers/SessionController.php
@@ -62,7 +62,7 @@ class User_SessionController extends Zend_Controller_Action
// Sort after date/id
usort($mySessions, function($func_a, $func_b) {
if($func_a->getID() == $func_b->getID()) return 0;
- return ($func_a->getID() < $func_b->getID()) ? -1 : 1;
+ return ($func_a->getID() < $func_b->getID()) ? 1 : -1;
});
// Search