From 648252cf50e8203436224b6baffb4c3a37792354 Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Mon, 5 Jan 2015 14:08:09 -0500 Subject: [PATCH] Allow filtering of events in index view --- web/api/app/Controller/EventsController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/api/app/Controller/EventsController.php b/web/api/app/Controller/EventsController.php index 41f309848..f180fc5fe 100644 --- a/web/api/app/Controller/EventsController.php +++ b/web/api/app/Controller/EventsController.php @@ -22,6 +22,9 @@ class EventsController extends AppController { */ public function index() { $this->Event->recursive = -1; + $this->FilterComponent = $this->Components->load('Filter'); + + $conditions = $this->FilterComponent->buildFilter($this->request->params['named']); // How many events to return $this->loadModel('Config'); @@ -32,7 +35,8 @@ class EventsController extends AppController { $this->Paginator->settings = array( 'limit' => $limit['ZM_WEB_EVENTS_PER_PAGE'], 'order' => array('StartTime', 'MaxScore'), - 'paramType' => 'querystring' + 'paramType' => 'querystring', + 'conditions' => $conditions ); $events = $this->Paginator->paginate('Event');