/** * Mapeada como * /mobile/e/:id */ public function verAction() { $menu = new Sige_Mobile_Menu($this->view, "programacao"); $this->view->menu = $menu; try { $idEvento = $this->_request->getParam('id', 0); $evento = new Application_Model_Evento(); $data = $evento->buscaEventoPessoa($idEvento); if (empty($data)) { $this->_helper->flashMessenger->addMessage(array('warning' => 'Evento não encontrado.')); } else { $this->view->evento = $data[0]; $this->view->outros = $evento->buscarOutrosPalestrantes($idEvento); $modelTags = new Application_Model_EventoTags(); $this->view->tags = $modelTags->listarPorEvento($idEvento); } } catch (Exception $e) { $this->_helper->flashMessenger->addMessage(array('danger' => 'Ocorreu um erro inesperado.<br/>Detalhes: ' . $e->getMessage())); } }
public function ajaxDeletarTagAction() { if (!$this->autenticacao(true)) { return; } $model = new Application_Model_EventoTags(); try { $id = $this->_getParam('id', 0); $id_evento = $this->_getParam('id_evento', 0); $where = $model->getAdapter()->quoteInto("id_tag = ?", $id); $where .= $model->getAdapter()->quoteInto("AND id_evento = ?", $id_evento); $affected = $model->delete($where); if ($affected > 0) { $this->view->ok = true; $this->view->msg = _("Tag removed successfully."); } else { $this->view->error = _("Tag not found."); $this->view->ok = false; } } catch (Exception $e) { $this->view->error = _("An unexpected error ocurred while saving <b>tag</b>. Details: ") . $e->getMessage(); $this->view->ok = false; } }