/** * */ public function headerReportAction() { if ($this->getRequest()->isXMLHttpRequest()) { $this->_helper->layout()->disableLayout(); } $mapperCeop = new Register_Model_Mapper_Dec(); $this->view->ceop = $mapperCeop->fetchRow($this->_getParam('id')); }
/** * * @return int|bool */ public function save() { $dbAdapter = Zend_Db_Table_Abstract::getDefaultAdapter(); $dbAdapter->beginTransaction(); try { if (empty($this->_session->client_list)) { $this->_message->addMessage('Tenki tau Kliente sira', App_Message::ERROR); return false; } $history = 'KRIA LISTA IMPRESAUN CARTAUN EVIDENSIA: %s'; $mapperDec = new Register_Model_Mapper_Dec(); $ceop = $mapperDec->fetchRow($this->_data['fk_id_dec']); $this->_data['create_date'] = Zend_Date::now()->toString('yyyy-MM-dd'); $this->_data['list_name'] = $ceop->name_dec . ' - ' . Zend_Date::now()->toString('yyyy-MM-dd HH:mm:ss'); $this->_data['printed'] = 0; $id = parent::_simpleSave(); $history = sprintf($history, $id); $this->_sysAudit($history); $historyClient = 'KLIENTE %s SELECIONADO BA LISTA IMPRESAUN CARTAUN EVIDENSIA: %s'; $dbJobListPrintPerData = App_Model_DbTable_Factory::get('JOBListPrintHasPerdata'); foreach ($this->_session->client_list as $client) { $row = $dbJobListPrintPerData->createRow(); $row->fk_id_joblistprint = $id; $row->fk_id_perdata = $client; $row->printed = 0; $row->save(); $history = sprintf($historyClient, $client, $id); $this->_sysAudit($history); } $dbAdapter->commit(); return $id; } catch (Exception $e) { $dbAdapter->rollBack(); $this->_message->addMessage($this->_config->messages->error, App_Message::ERROR); return false; } }