Allow filtering of events in index view

This commit is contained in:
Kyle Johnson 2015-01-05 14:08:09 -05:00
parent 040094e984
commit 648252cf50
1 changed files with 5 additions and 1 deletions

View File

@ -22,6 +22,9 @@ class EventsController extends AppController {
*/ */
public function index() { public function index() {
$this->Event->recursive = -1; $this->Event->recursive = -1;
$this->FilterComponent = $this->Components->load('Filter');
$conditions = $this->FilterComponent->buildFilter($this->request->params['named']);
// How many events to return // How many events to return
$this->loadModel('Config'); $this->loadModel('Config');
@ -32,7 +35,8 @@ class EventsController extends AppController {
$this->Paginator->settings = array( $this->Paginator->settings = array(
'limit' => $limit['ZM_WEB_EVENTS_PER_PAGE'], 'limit' => $limit['ZM_WEB_EVENTS_PER_PAGE'],
'order' => array('StartTime', 'MaxScore'), 'order' => array('StartTime', 'MaxScore'),
'paramType' => 'querystring' 'paramType' => 'querystring',
'conditions' => $conditions
); );
$events = $this->Paginator->paginate('Event'); $events = $this->Paginator->paginate('Event');