public function consultaAction()
 {
     $get = Zend_Registry::get('get');
     $CpfCnpj = $get->CpfCnpj;
     if (empty($CpfCnpj)) {
         parent::message("Por favor informe o CPF ou CNPJ.", "/Rastrearagente", "ERROR");
     }
     $CpfCnpj = str_replace(array(".", "-", "/"), array("", "", ""), $CpfCnpj);
     //removendo mascara de CPF e CNPJ
     $agente = ManterAgentesDAO::buscarAgentes($CpfCnpj);
     if (count($agente) < 1) {
         parent::message("Nenhum agente encontrado com o CPF/CNPJ {$get->CpfCnpj}", "/Rastrearagente", "ALERT");
     }
     $visoes = VisaoDAO::buscarVisao($agente[0]->idAgente);
     $projeto = new Projetos();
     $projetos = null;
     $projetos = $projeto->buscarTodosDadosProjeto(null, $CpfCnpj);
     $projetos2 = null;
     $projetos2 = $projeto->buscarTodosDadosProjeto(null, $CpfCnpj)->toArray();
     $preprojeto = new Proposta();
     $preprojetos = $preprojeto->buscar(array("idAgente = ? " => $agente[0]->idAgente));
     $preprojetos = empty($preprojetos) ? array() : $preprojetos;
     $vinculo = new Vinculacao();
     $vinculos = $vinculo->BuscarVinculos($agente[0]->idAgente);
     $vinculos = empty($vinculos) ? array() : $vinculos;
     $proposta = new Proposta();
     $propostas = $proposta->propostastransformadas($agente[0]->idAgente);
     $propostas = empty($propostas) ? array() : $propostas;
     $inabilitado = new Inabilitado();
     $inabilitados = $inabilitado->listainabilitados($CpfCnpj);
     $inabilitados = empty($inabilitados) ? array() : $inabilitados;
     $capitacaoMEC = new Captacao();
     $captacaoQuotas = new CaptacaoQuotas();
     $captacaoguia = new CaptacaoGuia();
     $captacaoconversao = new CaptacaoConversao();
     for ($i = 0; $i < count($projetos2); $i++) {
         $val1 = null;
         $val2 = null;
         $val3 = null;
         $val4 = 0;
         $where = array("AnoProjeto = ?" => substr($projetos2[$i]['pronac'], 0, 2), "Sequencial = ?" => substr($projetos2[$i]['pronac'], 2));
         $val1 = $capitacaoMEC->CapitacaoTotalMEC(substr($projetos2[$i]['pronac'], 0, 2), substr($projetos2[$i]['pronac'], 2))->current();
         $val2 = $captacaoQuotas->CapitacaoArt1(substr($projetos2[$i]['pronac'], 0, 2), substr($projetos2[$i]['pronac'], 2))->current();
         $val3 = $captacaoguia->BuscarTotalCaptacaoGuia(false, $where);
         $val3 = count($val3) > 0 ? $val3[0]->Art3 : 0;
         $val4 = $captacaoconversao->BuscarTotalCaptacaoConversao(false, $where);
         $val4 = count($val4) > 0 ? $val4[0]->Conv : 0;
         $projetos2[$i]['TotalCaptado'] = $val1->Mec + $val2->Art1 + $val3 + $val4;
     }
     $this->view->agente = $agente;
     $this->view->visoes = $visoes;
     $this->view->projetos = $projetos;
     $this->view->projetos2 = $projetos2;
     $this->view->preprojetos = $preprojetos;
     $this->view->vinculos = $vinculos;
     $this->view->propostastrasformadas = $propostas;
     $this->view->inabilitados = $inabilitados;
 }
 * Licença Pública Geral GNU/GPL em português para maiores detalhes.
 * Você deve ter recebido uma cópia da Licença Pública Geral GNU, sob o título "LICENCA.txt",
 * junto com este programa, se não, acesse o Portal do Software Público Brasileiro no endereço
 * www.softwarepublico.gov.br ou escreva para a Fundação do Software Livre(FSF)
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA
 * */
/**
 * Manter o fundo branco...
 */
$DONT_RENDER_BACKGROUND = TRUE;
include_once "function/auto_load_statics.php";
include __BASE_PATH__ . '/extensoes/pr_snas/1.0/interfaces/detalhar_documentos.php';
$urlManager = __APPMODELS__ . "arvores/listar_documentos_associados.php";
$digital = $_GET['digital'];
$arvore = new Arvore();
$vinculacao = new Vinculacao();
$root = $vinculacao->setDocumentoRoot($digital, 3);
$arvore->setRootId($root);
$elementos = $arvore->getVinculacaoDocumento($root, $urlManager, 3);
?>


<html>
    <head>
        <title>Anexos/Apensos</title>
        <style type="text/css">
            body{
                margin: 0px;
                padding: 0px;
            }
            .ausente{
 /**
  * Método vincularpropostas()
  * UC 89 - Fluxo FA6 - Vincular Propostas
  * @access public
  * @param void
  * @return void
  */
 public function vincularpropostasAction()
 {
     $tbVinculo = new TbVinculo();
     $propostas = new PreProjeto();
     //        $proposta = new Proposta();
     $agentes = new Agentes();
     $dadosCombo = array();
     $rsVinculo = $agentes->listarVincularPropostaCombo($this->idResponsavel);
     $i = 0;
     foreach ($rsVinculo as $rs) {
         $dadosCombo[$i]['idResponsavel'] = $rs->idUsuarioResponsavel;
         $dadosCombo[$i]['idVinculo'] = $rs->idVinculo;
         $dadosCombo[$i]['NomeResponsavel'] = $rs->NomeResponsavel;
         $i++;
     }
     //ADICIONA AO ARRAY O IDAGENTE DO USUARIO LOGADO
     $dadosIdAgentes = array($this->idAgenteProponente);
     //VERIFICA SE O USUARIO LOGADO EH DIRIGENTE DE ALGUMA EMPRESA
     $Vinculacao = new Vinculacao();
     $rsVinculucao = $Vinculacao->verificarDirigenteIdAgentes($this->cpfLogado);
     //CASO RETORNE ALGUM RESULTADO, ADICIONA OS IDAGENTE'S DE CADA UM AO ARRAY
     if (count($rsVinculucao) > 0) {
         foreach ($rsVinculucao as $value) {
             $dadosIdAgentes[] = $value->idAgente;
         }
     }
     //        $whereResponsavel['VI.idAgenteProponente in (?)'] = $dadosIdAgentes;
     //        $whereResponsavel['VI.siVinculo = ?'] = 2;
     //        $buscaResponsavel = $tbVinculo->buscarResponsaveis($whereResponsavel, $this->idAgenteProponente);
     //PROCURA AS PROPOSTAS DE TODOS OS IDAGENTE'S
     $listaPropostas = $propostas->buscarVinculadosProponenteDirigentes($dadosIdAgentes);
     $wherePropostaD['pp.idAgente = ?'] = $this->idAgenteProponente;
     $wherePropostaD['pr.idProjeto IS NULL'] = '';
     $wherePropostaD['pp.idUsuario <> ?'] = $this->idResponsavel;
     $listaPropostasD = $propostas->buscarPropostaProjetos($wherePropostaD);
     $this->view->responsaveis = $dadosCombo;
     $this->view->propostas = $listaPropostas;
     $this->view->propostasD = $listaPropostasD;
 }
示例#4
0
 * */
try {
    $out = array();
    switch ($_REQUEST['acao']) {
        case 'carregar-passiveis':
            $digitais = Vinculacao::getDocumentosPassiveisVinculacao($_REQUEST['digital']);
            foreach ($digitais as $key => $value) {
                $out[] = array($value['DIGITAL'] => $value['DIGITAL']);
            }
            break;
        case 'carregar-vinculados':
            $digitais = Vinculacao::getDocumentosVinculados($_REQUEST['pai'], $_REQUEST['vinculacao']);
            foreach ($digitais as $key => $value) {
                $out[] = array($value['FILHO'] => $value['FILHO']);
            }
            break;
        case 'vincular':
            $vinculacao = new Vinculacao();
            $out = $vinculacao->vincularDocumento($_REQUEST['pai'], $_REQUEST['filho'], $_REQUEST['vinculacao'])->toArray();
            break;
        case 'desvincular':
            $vinculacao = new Vinculacao();
            $out = $vinculacao->desvincularDocumento($_REQUEST['pai'], $_REQUEST['filho'], $_REQUEST['vinculacao'])->toArray();
            break;
        default:
            break;
    }
    print json_encode($out);
} catch (PDOException $e) {
    echo $e->getMessage();
}
    $documento->data_documento = $processo['dt_autuacao'];
    $documento->data_entrada = $processo['dt_autuacao'];
    $documento->origem = $processo['nm_origem'];
    $documento->tipo = "DIGITALIZACAO DE PROCESSO";
    $documento->assunto = 2;
    // Abertura de Processo
    $documento->interessado = $processo['nm_interessado'];
    $documento->id_unid_area_trabalho = $processo['id_unid_area_trabalho'];
    $documento->assunto_complementar = $processo['assunto_complementar'];
    $documento->procedencia = $processo['procedencia'];
    $unique = DaoDocumento::uniqueDocumento($documento)->toArray();
    if ($unique['success'] == 'false') {
        $unique['error'] .= "\nFavor alterar o tipo de vinculação para adicionar um novo anexo ou volume,\n ou altere o número do volume/anexo.";
        print json_encode($unique);
        exit;
    }
    $out = DaoDocumento::salvarDocumento($documento)->toArray();
    if ($out['success'] == 'true') {
        // Cadastrou documento, agora adicionar como peça
        $id_documento = $out['id'];
        $id_classificacao = $_POST['classificacao'];
        // Alterar classificacao do documento
        $out = DaoClassificacao::alterarClassificacaoDocumento($id_documento, $id_classificacao);
        $vinculacao = new Vinculacao();
        // Vincula documento ao processo, sem checar se o processo encontra-se na área de trabalho
        $out = $vinculacao->adicionarPecaProcesso($numero_processo, $documento->digital)->toArray();
    }
    print json_encode($out);
} catch (Exception $e) {
    print $e->getMessage();
}
 * Você deve ter recebido uma cópia da Licença Pública Geral GNU, sob o título "LICENCA.txt",
 * junto com este programa, se não, acesse o Portal do Software Público Brasileiro no endereço
 * www.softwarepublico.gov.br ou escreva para a Fundação do Software Livre(FSF)
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA
 * */
/**
 * Manter o fundo branco...
 */
$DONT_RENDER_BACKGROUND = TRUE;
include __BASE_PATH__ . '/extensoes/pr_snas/1.6/classes/Arvore.php';
include "function/auto_load_statics.php";
include "interfaces/detalhar_processos.php";
$urlManager = __APPMODELS__ . "arvores/listar_apensos_processos.php";
$numero_processo = $_GET['numero_processo'];
$arvore = new Arvore();
$vinculacao = new Vinculacao();
$root = $vinculacao->setProcessoRoot($numero_processo, 2);
$arvore->setRootId($root);
$elementos = $arvore->getVinculacaoProcesso($root, $urlManager, 2);
?>


<html>
    <head>
        <title>Apensos</title>
        <style type="text/css">
            body{
                margin: 0px;
                padding: 0px;
            }
            .ausente{
 /**
  * Método desvinculadirigente()
  * @access public
  * @param void
  * @return void
  */
 public function desvinculadirigenteAction()
 {
     $this->autenticacao();
     $Usuario = $this->getIdUsuario;
     // id do usuário logado
     $idAgenteGeral = $this->_request->getParam("id");
     $idDirigente = $this->_request->getParam("idDirigente");
     try {
         $vincular = new Vinculacao();
         $where = "Idcaptacao = " . $where;
         $where = array('idAgente = ' . $idDirigente, 'idVinculado = ' . $idAgenteGeral);
         $desvincula = $vincular->Desvincular($where);
         parent::message("Exclusão realizada com sucesso! ", "agentes/dirigentes/id/" . $idAgenteGeral, "CONFIRM");
     } catch (Exception $e) {
         parent::message("Erro ao vincular o dirigente: " . $e->getMessage(), "agentes/visualizadirigente/id/" . $idAgenteGeral . "/idDirigente/" . $idDirigente, "ERROR");
     }
 }
                            }
                            $iterator->next();
                        }
                        /* fim */
                        if (!empty($out)) {
                            $out['success'] = 'false';
                            $out['message'] = $stringOut['AP_ERROR_ANEXO_PROC'];
                        } else {
                            vincularProcessos($_POST);
                            $out = array('success' => 'true', 'processo' => $_POST['numero_processo'] . "&tipo_acao=" . $_POST['acao']);
                        }
                    }
                }
            }
        }
    } catch (Exception $e) {
        $out = array('success' => 'false', 'message' => $e->getMessage());
    }
    header('Content-type: application/json; charset=UTF-8');
    print json_encode($out);
}
/* * * PEGA LISTA DE PROCESSOS APENSADOS * */
if ($_GET) {
    if (isset($_GET['acao'])) {
        if ($_GET['acao'] == 'vinculados') {
            $out = Vinculacao::getProcessosVicunlados($_GET['numero_processo'], 2);
            header('Content-type: application/json; charset=UTF-8');
            print json_encode($out);
        }
    }
}
 public function verificarDirigenteAction()
 {
     $this->_helper->layout->disableLayout();
     // desabilita o Zend_Layout
     $cpfPropoenente = Mascara::delMaskCPFCNPJ($_POST['cpfProponente']);
     $cpfProcurador = Mascara::delMaskCPFCNPJ($_POST['cpfProcurador']);
     $Vinculacao = new Vinculacao();
     $result = $Vinculacao->verificarDirigente($cpfPropoenente, $cpfProcurador);
     if (count($result) > 0) {
         echo json_encode(array('resposta' => true));
     } else {
         echo json_encode(array('resposta' => false));
     }
     die;
 }
示例#10
0
 /**
  * @return array
  * @param string $numero_processo
  */
 public function recoverInformationDBByProcess($numero_processo)
 {
     $vinculacao = new Vinculacao();
     $stmt = Controlador::getInstance()->getConnection()->connection->prepare("\r\n            SELECT DC.DIGITAL\r\n            FROM TB_PROCESSOS_DOCUMENTOS PXD\r\n                INNER JOIN TB_PROCESSOS_CADASTRO PC ON PC.ID = PXD.ID_PROCESSOS_CADASTRO\r\n                INNER JOIN TB_DOCUMENTOS_CADASTRO DC ON DC.ID = PXD.ID_DOCUMENTOS_CADASTRO\r\n            WHERE PC.NUMERO_PROCESSO = ? ORDER BY PXD.ID\r\n        ");
     $stmt->bindParam(1, $numero_processo, PDO::PARAM_STR);
     $stmt->execute();
     $first = $stmt->fetchAll(PDO::FETCH_ASSOC);
     $list = $all = array();
     foreach ($first as $key => $digital) {
         $all[$digital['DIGITAL']] = $vinculacao->getDocumentosRelacionados($digital['DIGITAL']);
     }
     foreach ($all as $pai => $filhos) {
         $list[] = $pai;
         foreach ($filhos as $key => $xn) {
             if (in_array($key, $list) === false) {
                 $list[] = $key;
             }
             foreach ($xn as $ix => $jk) {
                 if (in_array($jk, $list) === false) {
                     $list[] = $jk;
                 }
             }
         }
     }
     $response = array();
     foreach ($list as $key => $digital) {
         $response = array_merge($response, $this->recoverInformationDBByDigital($digital));
     }
     return $response;
 }
示例#11
0
 /**
  * 
  */
 public function resgatarProcesso($numero_processo)
 {
     try {
         /**
          * Objeto Vinculacao
          */
         $vinculacao = new Vinculacao();
         /**
          * Setar variaveis do recebimento
          */
         $this->tramite->nm_unidade = DaoUnidade::getUnidade(Zend_Auth::getInstance()->getIdentity()->ID_UNIDADE, 'nome');
         $this->tramite->dt_hoje = date("d/m/Y - H:i:s");
         $this->tramite->ultimo_tramite = "Processo resgatado da caixa de externos por " . $this->_usuario->nome . " - " . DaoUnidade::getUnidade(null, 'nome') . " em " . $this->tramite->dt_hoje;
         $this->tramite->acao = "Processo resgatado";
         $this->tramite->destino = "XXXXX";
         $this->tramite->origem = "XXXXX";
         $this->relacao = $vinculacao->setRelacaoProcessosTramitar($numero_processo);
         Controlador::getInstance()->getConnection()->connection->beginTransaction();
         /**
          * BugFix Notice
          */
         $id_usuario = $this->_usuario->id;
         $id_unidade = Zend_Auth::getInstance()->getIdentity()->ID_UNIDADE;
         $id_unidade_original = Zend_Auth::getInstance()->getIdentity()->ID_UNIDADE_ORIGINAL;
         $nome_usuario = Zend_Auth::getInstance()->getIdentity()->NOME;
         $nome_unidade = DaoUnidade::getUnidade($id_unidade_original, 'nome');
         /**
          * Tramitar Processos
          */
         foreach ($this->relacao as $key => $numero_processo) {
             $stmt = Controlador::getInstance()->getConnection()->connection->prepare("UPDATE TB_PROCESSOS_CADASTRO SET ID_UNID_AREA_TRABALHO = ? , ID_UNID_CAIXA_ENTRADA = NULL, ID_UNID_CAIXA_SAIDA = NULL, EXTERNO = NULL, ULTIMO_TRAMITE = ? WHERE NUMERO_PROCESSO = ?");
             $stmt->bindParam(1, $id_unidade, PDO::PARAM_INT);
             //area_trabalho
             $stmt->bindParam(2, $this->tramite->ultimo_tramite, PDO::PARAM_STR);
             //ultimo_tramite
             $stmt->bindParam(3, $numero_processo, PDO::PARAM_STR);
             //numero_processo
             $stmt->execute();
             /**
              * Inserir o historico de tramite do processo
              */
             $historico = Controlador::getInstance()->getConnection()->connection->prepare("INSERT INTO TB_HISTORICO_TRAMITE_PROCESSOS" . " (NUMERO_PROCESSO,USUARIO,ACAO,ORIGEM,DESTINO,DT_TRAMITE,ID_USUARIO,ID_UNIDADE,DIRETORIA)" . " VALUES (?,?,?,?,?,CLOCK_TIMESTAMP(),?,?,?)");
             $historico->bindParam(1, $numero_processo, PDO::PARAM_STR);
             //numero_processo
             $historico->bindParam(2, $nome_usuario, PDO::PARAM_STR);
             //nm_usuario
             $historico->bindParam(3, $this->tramite->acao, PDO::PARAM_STR);
             //acao
             $historico->bindParam(4, $this->tramite->origem, PDO::PARAM_STR);
             //origem
             $historico->bindParam(5, $this->tramite->destino, PDO::PARAM_STR);
             //destino
             $historico->bindParam(6, $id_usuario, PDO::PARAM_INT);
             //data
             $historico->bindParam(7, $id_unidade_original, PDO::PARAM_INT);
             //data
             $historico->bindParam(8, $nome_unidade, PDO::PARAM_STR);
             //data
             $historico->execute();
         }
         Controlador::getInstance()->getConnection()->connection->commit();
         return new Output(array('success' => 'true', 'message' => "Processo(s) regatado(s) com sucesso!"));
     } catch (BasePDOException $e) {
         Controlador::getInstance()->getConnection()->connection->rollback();
         return new Output(array('success' => 'false', 'error' => $e->getMessage()));
     }
     return $out;
 }
 /**
  * Carrega Documentos Relacionados
  * @param string $parDigital
  * @throws Exception
  */
 protected function _loadDocumentosRelacionados($parDigital = '')
 {
     if (!$parDigital) {
         throw new \Exception('BlocoDocumental::_loadDocumentosRelacionados() - Número da Digital não informado para carregamento dos Documentos Relacionados');
     }
     $vinculacao = new \Vinculacao();
     $documentosRelacionados = $vinculacao->getDocumentosRelacionados($parDigital);
     $this->_arrDigitaisRelacionadas = array();
     if (is_array($documentosRelacionados) && count($documentosRelacionados)) {
         $arrDocumentosRelacionados = $documentosRelacionados[$parDigital];
         foreach ($arrDocumentosRelacionados as $chave => $valor) {
             if ($chave !== 'this') {
                 $this->_arrDigitaisRelacionadas[] = $valor;
             }
         }
     }
 }
示例#13
0
             * Verificar se o processo esta na area de trabalho
             */
            if (!Processo::validarProcessoAreaDeTrabalho($_REQUEST['numero_processo'])) {
                print json_encode(array('success' => 'false', 'message' => 'Este processo não está na sua área de trabalho!'));
                exit;
            }
            /**
             * Verificar se o documento esta na area de trabalho
             */
            if (!Documento::validarDigitalDocumento($_REQUEST['digital'])) {
                print json_encode(array('success' => 'false', 'message' => 'Este documento não está na sua área de trabalho!'));
                exit;
            }
            $vinculacao = new Vinculacao();
            $out = $vinculacao->adicionarPecaProcesso($_REQUEST['numero_processo'], $_REQUEST['digital'])->toArray();
            break;
        case 'remover-peca':
            $vinculacao = new Vinculacao();
            $out = $vinculacao->removerPecaProcesso($_REQUEST['numero_processo'], $_REQUEST['digital'])->toArray();
            break;
        case 'desanexar':
            $vinculacao = new Vinculacao();
            $out = $vinculacao->removerAnexoProcesso($_REQUEST['numero_processo'], $_REQUEST['anexo'])->toArray();
            break;
        default:
            break;
    }
    print json_encode($out);
} catch (PDOException $e) {
    print $e->getMessage();
}