summaryrefslogtreecommitdiff
path: root/app/Controller/GroupListController.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Controller/GroupListController.php')
-rw-r--r--app/Controller/GroupListController.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/app/Controller/GroupListController.php b/app/Controller/GroupListController.php
index 11081e4a..9663638d 100644
--- a/app/Controller/GroupListController.php
+++ b/app/Controller/GroupListController.php
@@ -20,16 +20,26 @@ class GroupListController extends BaseController
*/
public function index()
{
+ $search = $this->request->getStringParam('search');
+ $query = $this->groupModel->getQuery();
+
+ if ($search !== '') {
+ $query->ilike('name', '%'.$search.'%');
+ }
+
$paginator = $this->paginator
->setUrl('GroupListController', 'index')
->setMax(30)
->setOrder(GroupModel::TABLE.'.name')
- ->setQuery($this->groupModel->getQuery())
+ ->setQuery($query)
->calculate();
$this->response->html($this->helper->layout->app('group/index', array(
'title' => t('Groups').' ('.$paginator->getTotal().')',
'paginator' => $paginator,
+ 'values' => array(
+ 'search' => $search
+ ),
)));
}