protected function _populateHandlers() { $this->_handlers = array(); $handler = new HealthStatusHandler(); $db = Zend_Registry::get('dbAdapter'); $dbSelect = $db->select()->from($handler->_table)->where('active = 1'); $handlerIterator = $handler->getIterator($dbSelect); foreach ($handlerIterator as $item) { $this->_evaluateCodes($item); $this->_handlers[] = $item; } }
public function listHandlersAction() { $handler = new HealthStatusHandler(); $handlerIterator = $handler->getIterator(); $listConditions = Handler::listConditions(); $rows = array(); foreach ($handlerIterator as $item) { $condition = 'Custom'; if (isset($listConditions[$item->condition]) && !strlen($item->handlerObject) > 0) { $condition = $listConditions[$item->condition]; } $tmp = array(); $tmp['id'] = $item->healthStatusHandlerId; $tmp['data'][] = $item->name; $tmp['data'][] = $condition; $tmp['data'][] = $item->timeframe; $tmp['data'][] = $item->active ? __('Yes') : __('No'); $tmp['data'][] = '<a href="javascript:void(0)" onclick="viewSubscribedPatients(' . $item->healthStatusHandlerId . ')" title="' . __('View Subscribed Patients') . '">' . __('View Patients') . '</a>'; $rows[] = $tmp; } $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json'); $json->suppressExit = true; $json->direct(array('rows' => $rows)); }