/** * Component post initialization */ protected function postInitialize() { parent::postInitialize(); if ($sValue = $this->_oFilterComponent->getControl('identifer')->getValue()) { $this->selectSQL->where('device.identifer LIKE CONCAT("%", ?, "%")', $sValue); } if ($sValue = $this->_oFilterComponent->getControl('linked')->getValue()) { $this->selectSQL->where('device.user IS NOT NULL'); } }
/** * Device list action */ public function listAction() { $oComponentFilter = new AM_Component_Filter($this, 'filter', array('controls' => array('identifer' => array('title' => 'UDID'), 'linked' => array('title' => 'Only linked to users')))); if ($oComponentFilter->operation()) { return $this->_redirect($this->getHelper('Url')->url($oComponentFilter->getUrlParams(), null, true)); } $oComponentFilter->show(); $oGrid = new AM_Component_List_Devices($this, 'grid', $oComponentFilter); $oGrid->show(); $oPager = new AM_Component_Pager($this, 'pager', $oGrid); $oPager->show(); }