コード例 #1
0
 /**
  * 
  */
 public function verificaTramite($idUnidade, $idReferencia)
 {
     //verifico se está selecionado via OO.
     $where = array();
     $where['ID_REFERENCIA'] = $idReferencia;
     $where['ID_UNIDADE'] = $idUnidade;
     $rsTramite = DaoTramite::getTramite($where);
     $success = false;
     if ($rsTramite->resultado == true) {
         $success = true;
     }
     return $success;
 }
コード例 #2
0
 case 'alterar-visibilidade':
     try {
         $out = Tramite::alterarVisibilidadeTramite($_REQUEST['id_unidade'], $_REQUEST['id_referencia'], $_REQUEST['status']);
     } catch (Exception $e) {
         $out = array('success' => 'false', 'error' => $e->getMessage());
     }
     break;
 case 'cadastrar':
     $unidade = new Unidade($_REQUEST);
     $out = DaoUnidade::inserirUnidade($unidade)->toArray();
     break;
 case 'alterar':
     $unidade = new Unidade($_REQUEST);
     $out = DaoUnidade::alterarUnidade($unidade)->toArray();
     if ($_REQUEST['tipo'] != $_REQUEST['clear']) {
         DaoTramite::clearAllTramitesByIdUnidade($_REQUEST['id']);
     }
     break;
 case 'pesquisar':
     try {
         unset($_SESSION['PESQUISAR_UNIDADES']);
         foreach ($_REQUEST as $key => $value) {
             if ($key != 'acao' && $value && strtolower($value) != 'null') {
                 $_SESSION['PESQUISAR_UNIDADES'][$key] = $value;
             }
         }
         $out = array('success' => 'true');
     } catch (Exception $e) {
         $out = array('success' => 'false', 'error' => $e->getMessage());
     }
     break;
コード例 #3
0
         /**
          * 
          */
         case 'salvar-todos-hierarquia':
             $checked = $_POST['checked'];
             $manterTramite['ID_UNIDADE'] = (int) $_POST['idUnidade'];
             if ($checked == 'false') {
                 $out = DaoTramite::deletarTramitePorUnidade($manterTramite);
             } else {
                 $idReferencias = $_POST['idReferencias'];
                 if (count($idReferencias) > 0) {
                     foreach ($idReferencias as $idReferencia) {
                         $manterTramite['ID_REFERENCIA'] = (int) $idReferencia;
                         $rsTramite = DaoTramite::getTramite($manterTramite);
                         if ($rsTramite->resultado == false) {
                             $out = DaoTramite::salvar($manterTramite);
                         } else {
                             $out = array('success' => 'true', 'message' => 'Trâmite cadastrado com sucesso!');
                         }
                     }
                 }
             }
             break;
         default:
             break;
     }
 } catch (Exception $e) {
     LogError::sendReport($e);
     //Código 0 não vai sair o dialog.
     $out = array('success' => 'false', 'error' => $e->getMessage(), 'code' => $e->getCode());
 }