Example #1
0
 public function indexAction()
 {
     $this->autenticacao();
     $this->view->title = $this->t->_('Events');
     $tipoEventos = new Application_Model_TipoEvento();
     $this->view->tipoEvento = $tipoEventos->fetchAll();
 }
Example #2
0
 protected function _id_tipo_evento()
 {
     $e = new Zend_Form_Element_Select('id_tipo_evento');
     $e->setRequired(true)->setLabel(_('Event type:'));
     $e->setAttrib('class', 'form-control');
     $model = new Application_Model_TipoEvento();
     $rs = $model->fetchAll();
     foreach ($rs as $item) {
         $e->addMultiOption($item->id_tipo_evento, $item->nome_tipo_evento);
     }
     $e->setDecorators(array('ViewHelper', 'Description', 'Errors', array('HtmlTag', ''), array('Label', '')));
     return $e;
 }
Example #3
0
 public function interesseAction()
 {
     $this->autenticacao();
     $sessao = Zend_Auth::getInstance()->getIdentity();
     $cache = Zend_Registry::get('cache_common');
     $ps = $cache->load('prefsis');
     $idEncontro = (int) $ps->encontro["id_encontro"];
     $idPessoa = $sessao["idPessoa"];
     $eventos = new Application_Model_Evento();
     // usada para mostrar dias que possuem eventos
     $this->view->diasEncontro = $eventos->listarDiasDoEncontro($idEncontro);
     $this->view->idEncontro = $idEncontro;
     $this->view->idPessoa = $idPessoa;
     $tipoEventos = new Application_Model_TipoEvento();
     $this->view->tipoEvento = $tipoEventos->fetchAll();
     $model = new Application_Model_EventoRealizacao();
     $eventoRealizacao = $model->fetchAll();
     // TODO: refezer este trecho usando join ao invés de findDependentRowset
     $this->view->eventosTabela = array();
     foreach ($eventoRealizacao as $item) {
         $eventoItem = $item->findDependentRowset('Application_Model_Evento')->current();
         $tipoItem = $eventoItem->findDependentRowset('Application_Model_TipoEvento')->current();
         $this->view->eventosTabela[] = array_merge($item->toArray(), $eventoItem->toArray(), $tipoItem->toArray());
     }
 }