<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"></meta> <link rel="Stylesheet" type="text/css" href="~/css/bootstrap.css" /> <link rel="Stylesheet" type="text/css" href="~/css/bootstrap/bootstrap-responsive.css" /> <link rel="Stylesheet" type="text/css" href="~/css/960_12_col.css" /> <link rel="Stylesheet" type="text/css" href="~/css/style.css" /> <link rel="Stylesheet" type="text/css" href="~/css/select2.css" /> <link rel="Stylesheet" type="text/css" href="~/datepicker/css/datepicker.css" /> <script type="text/javascript" src="~/js/jquery-1.7.2.js"></script> <!-- <link rel="Stylesheet" type="text/css" href="~/js/ckeditor/skins/BootstrapCK-Skin/editor.css" /> <script type="text/javascript" src="~/js/ckeditor/config.js"></script> <script type="text/javascript" src="~/js/ckeditor/skins/BootstrapCK-Skin/skin.js"></script> <script type="text/javascript" src="~/js/ckeditor/lang/pt-br.js"></script> <script type="text/javascript" src="~/js/ckeditor/plugins/styles/styles/default.js"></script> --> <script type="text/javascript" src="~/datepicker/js/bootstrap-datepicker.js"></script> <script type="text/javascript" src="~/js/bootstrap.js"></script> <script type="text/javascript" src="~/js/select2.js"></script> <script type="text/javascript" src="~/js/js.js"></script> <script type="text/javascript" src="~/js/jquery.maskedinput-1.3.js"></script> <title>CI</title> <script type="text/javascript"> var root = '<?php echo root_virtual; ?> ';
public function visualizar($idCi) { $ci = Viewci::get($idCi); if (is_post) { $obs = $this->_data(new Observacao()); $obs->IdCi = (int) $idCi; $obs->IdUsuario = Session::get('usuario')->Id; $obs->Data = time(); $obs->Conteudo = trim($obs->Conteudo); try { Observacao::salvar($obs); $this->_flash('alert alert-success fade in', 'Observação salva com sucesso!'); } catch (ValidationException $e) { $this->_flash('alert alert-error fade in', $e->getMessage()); } catch (Exception $e) { //pre($e); $this->_flash('alert alert-error fade in', 'Ocorreu um erro ao salvar a observação'); } } if ($ci) { if (self::permissao($ci)) { $ci = Viewci::get($idCi); $observacoes = Viewobservacao::allByCi($ci->Id); $ci->NomeAtenciosamente = Usuario::get($ci->IdUsuarioAtenciosamente)->Nome; //Depois tem que adicionar na Viewci o Nome do Usuario $this->_set('ci', $ci); $this->_set('observacoes', $observacoes); } else { throw new AuthException("Sem permissão", 403); } } else { $this->_flash('erro', 'CI não encontrada!'); } return $this->_view(); }