Commit 663847feec4939a29a9719fb3e526af4ca4112a2

Authored by Nei Jobson da Costa Carneiro
1 parent bd5ccb3b

Atualização geral dos arquivo da versão preliminar à 1.1

Showing 43 changed files with 2498 additions and 1167 deletions   Show diff stats
1 # Módulo Peticionamento e Intimação Eletrônicos 1 # Módulo Peticionamento e Intimação Eletrônicos
2 2
3 ## Requisitos: 3 ## Requisitos:
4 -- SEI 3.0.1 instalado ou atualizado (verificar valor da constante de versão do SEI no arquivo /sei/web/SEI.php). 4 +- SEI 3.0.2 instalado ou atualizado (verificar valor da constante de versão do SEI no arquivo /sei/web/SEI.php).
5 - **IMPORTANTE**, no caso de atualização do módulo: A atualização do SEI 2.6.0 para 3.0.0 alterou diversas tabelas que as tabelas do módulo relacionava. Dessa forma, alertamos que, imediatamente antes de executar o script de atualização do SEI é necessário executar o script abaixo no banco do SEI para que a atualização do SEI possa ser executada sem erro: 5 - **IMPORTANTE**, no caso de atualização do módulo: A atualização do SEI 2.6.0 para 3.0.0 alterou diversas tabelas que as tabelas do módulo relacionava. Dessa forma, alertamos que, imediatamente antes de executar o script de atualização do SEI é necessário executar o script abaixo no banco do SEI para que a atualização do SEI possa ser executada sem erro:
6 6
7 ALTER TABLE `md_pet_rel_tp_ctx_contato` DROP FOREIGN KEY `fk_md_pet_rel_tp_ctx_cont_1`; 7 ALTER TABLE `md_pet_rel_tp_ctx_contato` DROP FOREIGN KEY `fk_md_pet_rel_tp_ctx_cont_1`;
sei/web/SeiIntegracao.php
@@ -1,73 +0,0 @@ @@ -1,73 +0,0 @@
1 -<?  
2 -abstract class SeiIntegracao {  
3 -  
4 - //TAM = Tipo Acesso Modulo  
5 - public static $TAM_PERMITIDO = 'P';  
6 - public static $TAM_NEGADO = 'N';  
7 -  
8 - public abstract function getNome();  
9 - public abstract function getVersao();  
10 - public abstract function getInstituicao();  
11 - public function inicializar($strVersaoSEI) {return null;}  
12 - public function montarBotaoControleProcessos(){return null;}  
13 - public function montarIconeControleProcessos($arrObjProcedimentoAPI){return null;}  
14 - public function montarIconeAcompanhamentoEspecial($arrObjProcedimentoAPI){return null;}  
15 - public function montarBotaoProcesso(ProcedimentoAPI $objProcedimentoAPI){return null;}  
16 - public function montarIconeProcesso(ProcedimentoAPI $objProcedimentoAPI){return null;}  
17 - public function montarBotaoDocumento(ProcedimentoAPI $objProcedimentoAPI, $arrObjDocumentoAPI){return null;}  
18 - public function montarMensagemProcesso(ProcedimentoAPI $objProcedimentoAPI){return null;}  
19 - public function alterarIconeArvoreDocumento(ProcedimentoAPI $objProcedimentoAPI, $arrObjDocumentoAPI){return null;}  
20 - public function montarIconeDocumento(ProcedimentoAPI $objProcedimentoAPI, $arrObjDocumentoAPI){return null;}  
21 - public function atualizarConteudoDocumento(DocumentoAPI $objDocumentoAPI){return null;}  
22 - public function gerarProcesso(ProcedimentoAPI $objProcedimentoAPI){return null;}  
23 - public function concluirProcesso($arrObjProcedimentoAPI){return null;}  
24 - public function reabrirProcesso(ProcedimentoAPI $objProcedimentoAPI){return null;}  
25 - public function sobrestarProcesso(ProcedimentoAPI $objProcedimentoAPI, $objProcedimentoAPIVinculado){return null;}  
26 - public function removerSobrestamentoProcesso(ProcedimentoAPI $objProcedimentoAPI, $objProcedimentoAPIVinculado){return null;}  
27 - public function anexarProcesso(ProcedimentoAPI $objProcedimentoAPIPrincipal, ProcedimentoAPI $objProcedimentoAPIAnexado){return null;}  
28 - public function desanexarProcesso(ProcedimentoAPI $objProcedimentoAPIPrincipal, ProcedimentoAPI $objProcedimentoAPIAnexado){return null;}  
29 - public function relacionarProcesso(ProcedimentoAPI $objProcedimentoAPI1, ProcedimentoAPI $objProcedimentoAPI2){return null;}  
30 - public function removerRelacionamentoProcesso(ProcedimentoAPI $objProcedimentoAPI1, ProcedimentoAPI $objProcedimentoAPI2){return null;}  
31 - public function bloquearProcesso($arrObjProcedimentoAPI){return null;}  
32 - public function desbloquearProcesso($arrObjProcedimentoAPI){return null;}  
33 - public function excluirProcesso(ProcedimentoAPI $objProcedimentoAPI){return null;}  
34 - public function enviarProcesso($arrObjProcedimentoAPI, $arrObjUnidadeAPI){return null;}  
35 - public function gerarDocumento(DocumentoAPI $objDocumentoAPI){return null;}  
36 - public function excluirDocumento(DocumentoAPI $objDocumentoAPI){return null;}  
37 - public function moverDocumento(DocumentoAPI $objDocumentoAPI, ProcedimentoAPI $objProcedimentoAPIOrigem, ProcedimentoAPI $objProcedimentoAPIDestino){return null;}  
38 - public function cancelarDocumento(DocumentoAPI $objDocumentoAPI){return null;}  
39 - public function assinarDocumento($arrObjDocumentoAPI){return null;}  
40 - public function verificarAcessoProtocolo($arrObjProcedimentoAPI, $arrObjDocumentoAPI) {return null;}  
41 - public function verificarAcessoProtocoloExterno($arrObjProcedimentoAPI, $arrObjDocumentoAPI) {return null;}  
42 - public function permitirAndamentoConcluido(AndamentoAPI $objAndamentoAPI){return null;}  
43 - public function montarMenuPublicacoes(){return null;}  
44 - public function montarMenuUsuarioExterno(){return null;}  
45 - public function montarBotaoControleAcessoExterno(){return null;}  
46 - public function montarAcaoControleAcessoExterno($arrObjAcessoExternoAPI){return null;}  
47 - public function montarBotaoAcessoExternoAutorizado(ProcedimentoAPI $objProcedimentoAPI){return null;}  
48 - public function montarAcaoDocumentoAcessoExternoAutorizado($arrObjDocumentoAPI){return null;}  
49 - public function montarAcaoProcessoAnexadoAcessoExternoAutorizado($arrObjProcedimentAPI){return null;}  
50 - public function excluirUsuario($arrObjUsuarioAPI){return null;}  
51 - public function excluirUnidade($arrObjUnidadeAPI){return null;}  
52 - public function processarControlador($strAcao){return null;}  
53 - public function processarControladorAjax($strAcaoAjax){return null;}  
54 - public function processarControladorExterno($strAcao){return null;}  
55 - public function processarControladorPublicacoes($strAcao){return null;}  
56 - public function processarControladorAjaxExterno($strAcaoAjax){return null;}  
57 - public function processarControladorWebServices($strServico){return null;}  
58 -  
59 - //TODO: ponto de extensao temporario para complementar a lista de tipos de tarja de assinatura disponiveis no sistema  
60 - public function montarTipoTarjaAssinaturaCustomizada(){  
61 - return null;  
62 - }  
63 -  
64 - public function executar($func, ...$params) {  
65 - try {  
66 - $ret = call_user_func_array(array($this, $func), $params);  
67 - }catch(Exception $e){  
68 - throw new InfraException('Erro processando operação "'.$func.'" no módulo "'.$this->getNome().'".', $e);  
69 - }  
70 - return $ret;  
71 - }  
72 -}  
73 -?>  
74 \ No newline at end of file 0 \ No newline at end of file
sei/web/modulos/peticionamento/PeticionamentoIntegracao.php
@@ -171,7 +171,7 @@ class PeticionamentoIntegracao extends SeiIntegracao { @@ -171,7 +171,7 @@ class PeticionamentoIntegracao extends SeiIntegracao {
171 171
172 case 'tipo_processo_auto_completar_intercorretne': 172 case 'tipo_processo_auto_completar_intercorretne':
173 $arrObjTipoProcessoDTO = TipoProcessoPeticionamentoINT::autoCompletarTipoProcedimento($_POST['palavras_pesquisa'], $_POST['itens_selecionados'] ); 173 $arrObjTipoProcessoDTO = TipoProcessoPeticionamentoINT::autoCompletarTipoProcedimento($_POST['palavras_pesquisa'], $_POST['itens_selecionados'] );
174 - $xml = InfraAjax::gerarXMLItensArrInfraDTO($arrObjTipoProcessoDTO,'IdTipoProcedimento', 'Nome'); 174 + $xml = TipoProcessoPeticionamentoINT::gerarXMLItensArrInfraApi($arrObjTipoProcessoDTO,'IdTipoProcedimento', 'Nome');
175 break; 175 break;
176 176
177 case 'tipo_processo_auto_completar_com_assunto': 177 case 'tipo_processo_auto_completar_com_assunto':
@@ -390,6 +390,7 @@ class PeticionamentoIntegracao extends SeiIntegracao { @@ -390,6 +390,7 @@ class PeticionamentoIntegracao extends SeiIntegracao {
390 $objContato->usuario = $objContatoDTO->getNumIdUsuarioCadastro(); 390 $objContato->usuario = $objContatoDTO->getNumIdUsuarioCadastro();
391 $objContato->nome = utf8_encode( $objContatoDTO->getStrNome() ); 391 $objContato->nome = utf8_encode( $objContatoDTO->getStrNome() );
392 $objContato->id = utf8_encode( $objContatoDTO->getNumIdContato() ); 392 $objContato->id = utf8_encode( $objContatoDTO->getNumIdContato() );
  393 + $objContato->nomeTratado = PaginaSEI::tratarHTML($objContatoDTO->getStrNome());
393 $json = json_encode( $objContato , JSON_FORCE_OBJECT); 394 $json = json_encode( $objContato , JSON_FORCE_OBJECT);
394 } 395 }
395 396
@@ -430,14 +431,6 @@ class PeticionamentoIntegracao extends SeiIntegracao { @@ -430,14 +431,6 @@ class PeticionamentoIntegracao extends SeiIntegracao {
430 $arrNivelAcessoHipoteseLegal = MdPetIntercorrenteINT::verificarCriterioIntercorrente($_POST['idTipoProcedimento']); 431 $arrNivelAcessoHipoteseLegal = MdPetIntercorrenteINT::verificarCriterioIntercorrente($_POST['idTipoProcedimento']);
431 echo json_encode($arrNivelAcessoHipoteseLegal); 432 echo json_encode($arrNivelAcessoHipoteseLegal);
432 return true; 433 return true;
433 -  
434 - case 'montar_select_hipotese_legal':  
435 - $objEntradaListarHipotesesLegaisAPI = new EntradaListarHipotesesLegaisAPI();  
436 - $objEntradaListarHipotesesLegaisAPI->setNivelAcesso($_POST['nivelAcesso']);  
437 - $xml = MdPetIntercorrenteINT::montarSelectHipoteseLegal($objEntradaListarHipotesesLegaisAPI);  
438 - InfraAjax::enviarXML($xml);  
439 -  
440 - return true;  
441 } 434 }
442 435
443 return false; 436 return false;
@@ -770,36 +763,31 @@ class PeticionamentoIntegracao extends SeiIntegracao { @@ -770,36 +763,31 @@ class PeticionamentoIntegracao extends SeiIntegracao {
770 } */ 763 } */
771 764
772 public function montarBotaoAcessoExternoAutorizado(ProcedimentoAPI $objProcedimentoAPI){ 765 public function montarBotaoAcessoExternoAutorizado(ProcedimentoAPI $objProcedimentoAPI){
773 -//ini_set('xdebug.var_display_max_depth', 10); ini_set('xdebug.var_display_max_children', 256); ini_set('xdebug.var_display_max_data', 1024); echo '<pre>';  
774 -//var_dump($objProcedimentoAPI); echo '</pre>'; exit;  
775 -  
776 - $urlBase = ConfiguracaoSEI::getInstance()->getValor('SEI','URL');  
777 - $arrMenusNomes = array();  
778 -  
779 -  
780 766
  767 + $strParam = 'acao=md_pet_intercorrente_usu_ext_cadastrar&id_orgao_acesso_externo=0';
  768 + $hash = md5($strParam.'#'.SessaoSEIExterna::getInstance()->getNumIdUsuarioExterno().'@'.SessaoSEIExterna::getInstance()->getAtributo('RAND_USUARIO_EXTERNO'));
  769 + $link = 'http://localhost/sei/controlador_externo.php?acao=md_pet_intercorrente_usu_ext_cadastrar&id_orgao_acesso_externo=0&infra_hash=' . $hash;
  770 + $id_procedimento = $_GET['id_procedimento'];
  771 +
  772 + $array[] = "<script> function criarForm(){
  773 + var f = document.createElement(\"form\");
  774 + f.setAttribute('method',\"post\");
  775 + f.setAttribute('action',\"$link\");
  776 +
  777 + var i = document.createElement(\"input\");
  778 + i.setAttribute('type',\"hidden\");
  779 + i.setAttribute('name',\"id_procedimento\");
  780 + i.setAttribute('value',\"$id_procedimento\");
  781 +
  782 + f.appendChild(i);
  783 + document.getElementsByTagName('body')[0].appendChild(f);
  784 + f.submit();
  785 + }</script>";
  786 + $array[] = '<button type="button" accesskey="i" name="btnPetIntercorrente" value="Peticionamento Intercorrente" onclick="criarForm();" class="infraButton">Peticionamento <span class="infraTeclaAtalho">I</span>ntercorrente</button>';
  787 +
  788 + return $array;
781 789
782 - //$arrMenusNomes["Peticionar Processo Inicio"] = $urlBase .'/controlador_externo.php?acao=peticionamento_usuario_externo_iniciar';  
783 - //$url = $urlBase .'/controlador_externo.php?acao=md_pet_intercorrente_usu_ext_cadastrar';  
784 - //$url = $urlBase . '/' . SessaoSEIExterna::getInstance()->assinarLink('controlador_externo.php?acao=md_pet_intercorrente_usu_ext_cadastrar&txtProcesso=' . $objProcedimentoAPI->getNumeroProtocolo());  
785 -  
786 - //@todo EU 7051 - falta apenas montar o link adequado no botão "Peticionamento Intercorrente"  
787 -// $replaces = array('/', '-', '.');  
788 -// $numeroProtocolo = str_replace($replaces, '', $objProcedimentoAPI->getNumeroProtocolo());  
789 - $numeroProtocolo = '1';//$objProcedimentoAPI->getNumeroProtocolo();  
790 -  
791 - $array = array();  
792 - $url = SessaoSEIExterna::getInstance()->assinarLink('controlador_externo.php?acao=md_pet_intercorrente_usu_ext_cadastrar&id_orgao_acesso_externo=0');  
793 -  
794 - //$arrComandos[] = '<button type="button" accesskey="c" id="btnFechar" value="Fechar" onclick="location.href=\'' . PaginaSEIExterna::getInstance()->formatarXHTML(SessaoSEIExterna::getInstance()->assinarLink('controlador_externo.php?id_md_pet_rel_recibo_protoc=' . $_GET['id_md_pet_rel_recibo_protoc'] . '&acao=' . PaginaSEIExterna::getInstance()->getAcaoRetorno() . '&acao_origem=' . $_GET['acao'])) . '\'" class="infraButton">Fe<span class="infraTeclaAtalho">c</span>har</button>';  
795 - //$array[] = "<script> function acessarPeticionamentoIntercorrente( idProcedimento ){ alert(' Id do Processo' + idProcedimento ); }</script>";  
796 - // $array[] = "<script> function acessarPeticionamentoIntercorrente(){ window.location = '" . $url . "'; }</script>";  
797 - //$array[] = '<button type="button" accesskey="P" name="btnPetIntercorrente" value="Peticionamento Intercorrente" onclick="acessarPeticionamentoIntercorrente();" class="infraButton"><span class="infraTeclaAtalho">P</span>eticionamento Intercorrente</button>';  
798 -// $array[] = '<button type="button" accesskey="P" name="btnPetIntercorrente" value="Peticionamento Intercorrente" onclick="location.href=\'' . PaginaSEIExterna::getInstance()->formatarXHTML(SessaoSEIExterna::getInstance()->assinarLink('controlador_externo.php?txtProcesso=' . $numeroProtocolo . '&acao=md_pet_intercorrente_usu_ext_cadastrar')) . '\'" class="infraButton"><span class="infraTeclaAtalho">P</span>eticionamento Intercorrente</button>';  
799 - $array[] = '<a href="' . $url . '" >Peticionamento Intercorrente</a>';  
800 - return $array;  
801 -  
802 - } 790 + }
803 791
804 public function montarTipoTarjaAssinaturaCustomizada() 792 public function montarTipoTarjaAssinaturaCustomizada()
805 { 793 {
sei/web/modulos/peticionamento/criterio_intercorrente_peticionamento_cadastro.php
@@ -154,7 +154,7 @@ try { @@ -154,7 +154,7 @@ try {
154 switch ($_GET['acao']) { 154 switch ($_GET['acao']) {
155 case 'criterio_intercorrente_peticionamento_consultar': 155 case 'criterio_intercorrente_peticionamento_consultar':
156 $strTitulo = 'Consultar Critério Intercorrente'; 156 $strTitulo = 'Consultar Critério Intercorrente';
157 - $arrComandos[] = '<button type="button" accesskey="c" name="btnCancelar" id="btnCancelar" value="Cancelar" onclick="location.href=\''.PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.PaginaSEI::getInstance()->getAcaoRetorno().'&acao_origem='.$_GET['acao'].PaginaSEI::getInstance()->montarAncora($_GET['id_criterio_intercorrente_peticionamento']))).'\';" class="infraButton"><span class="infraTeclaAtalho">C</span>ancelar</button>'; 157 + $arrComandos[] = '<button type="button" accesskey="c" name="btnCancelar" id="btnCancelar" value="Fechar" onclick="location.href=\''.PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.PaginaSEI::getInstance()->getAcaoRetorno().'&acao_origem='.$_GET['acao'].PaginaSEI::getInstance()->montarAncora($_GET['id_criterio_intercorrente_peticionamento']))).'\';" class="infraButton">Fe<span class="infraTeclaAtalho">c</span>har</button>';
158 158
159 //$strItensSelTipoProcesso = TipoProcessoPeticionamentoINT::montarSelectTipoProcesso(null, null, $_POST['selTipoProcesso']); 159 //$strItensSelTipoProcesso = TipoProcessoPeticionamentoINT::montarSelectTipoProcesso(null, null, $_POST['selTipoProcesso']);
160 //$strItensSelDoc = SerieINT::montarSelectNomeRI0802(null, null, $_POST['selDocumento']); 160 //$strItensSelDoc = SerieINT::montarSelectNomeRI0802(null, null, $_POST['selDocumento']);
@@ -162,9 +162,9 @@ try { @@ -162,9 +162,9 @@ try {
162 case 'criterio_intercorrente_peticionamento_alterar': 162 case 'criterio_intercorrente_peticionamento_alterar':
163 $strTitulo = 'Alterar Critério para Intercorrente'; 163 $strTitulo = 'Alterar Critério para Intercorrente';
164 $arrComandos[] = '<button type="submit" accesskey="s" name="sbmAlterarCriterio" id="sbmAlterarCriterio" value="Salvar" class="infraButton"><span class="infraTeclaAtalho">S</span>alvar</button>'; 164 $arrComandos[] = '<button type="submit" accesskey="s" name="sbmAlterarCriterio" id="sbmAlterarCriterio" value="Salvar" class="infraButton"><span class="infraTeclaAtalho">S</span>alvar</button>';
165 - $arrComandos[] = '<button type="button" accesskey="c" name="btnCancelar" id="btnCancelar" value="Cancelar" onclick="location.href=\''.PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.PaginaSEI::getInstance()->getAcaoRetorno().'&acao_origem='.$_GET['acao'].PaginaSEI::getInstance()->montarAncora($_GET['id_criterio_intercorrente_peticionamento']))).'\';" class="infraButton"><span class="infraTeclaAtalho">C</span>ancelar</button>'; 165 + $arrComandos[] = '<button type="button" accesskey="c" name="btnCancelar" id="btnCancelar" value="Fechar" onclick="location.href=\''.PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.PaginaSEI::getInstance()->getAcaoRetorno().'&acao_origem='.$_GET['acao'].PaginaSEI::getInstance()->montarAncora($_GET['id_criterio_intercorrente_peticionamento']))).'\';" class="infraButton">Fe<span class="infraTeclaAtalho">c</span>har</button>';
166 166
167 - if (isset($_POST['sbmAlterarCriterio'])) { 167 + if (isset($_POST['sbmAlterarCriterio'])) {
168 /* 168 /*
169 $id = $_POST['hdnIdCriterioIntercorrentePeticionamento']; 169 $id = $_POST['hdnIdCriterioIntercorrentePeticionamento'];
170 $objCriterioIntercorrentePeticionamentoDTO = new CriterioIntercorrentePeticionamentoDTO(); 170 $objCriterioIntercorrentePeticionamentoDTO = new CriterioIntercorrentePeticionamentoDTO();
@@ -291,15 +291,15 @@ PaginaSEI::getInstance()-&gt;fecharJavaScript(); @@ -291,15 +291,15 @@ PaginaSEI::getInstance()-&gt;fecharJavaScript();
291 #lblTipoProcesso { position: absolute; left: 0%; top: 2px; width: 50%; } 291 #lblTipoProcesso { position: absolute; left: 0%; top: 2px; width: 50%; }
292 #txtTipoProcesso { position: absolute; left: 0%; top: 18px; width: 50%; } 292 #txtTipoProcesso { position: absolute; left: 0%; top: 18px; width: 50%; }
293 293
294 - <? if ($_GET['acao'] == 'criterio_intercorrente_peticionamento_alterar'){ ?>  
295 - #imgLupaTipoProcesso { position: absolute; left: 52%; top: 9%; }  
296 - #imgExcluirTipoProcesso { position: absolute; left: 55%; top: 9%; } 294 + <? if ($_GET['acao'] == 'criterio_intercorrente_peticionamento_alterar' || $_GET['acao'] == 'criterio_intercorrente_peticionamento_consultar'){ ?>
  295 + #imgLupaTipoProcesso { position: absolute; left: 51%; top: 15%; }
  296 + #imgExcluirTipoProcesso { position: absolute; left: 53.5%; top: 15%; }
297 #imgAjuda { display: none; } 297 #imgAjuda { display: none; }
298 - #selTipoProcesso {display: none; } 298 + #selTipoProcesso { display: none; }
299 <?} else{ ?> 299 <?} else{ ?>
300 - #imgLupaTipoProcesso { position: absolute; left: 72%; top: 18%; }  
301 - #imgExcluirTipoProcesso { position: absolute; left: 72%; top: 26%; }  
302 - #imgAjuda { position: absolute; left: 75%; top: 18%; } 300 + #imgLupaTipoProcesso { position: absolute; left: 71%; top: 18%; }
  301 + #imgExcluirTipoProcesso { position: absolute; left: 71%; top: 26%; }
  302 + #imgAjuda { position: absolute; left: 74%; top: 18%; }
303 <?} ?> 303 <?} ?>
304 #lblNivelAcesso { width: 50%; } 304 #lblNivelAcesso { width: 50%; }
305 #selNivelAcesso { width: 20%; } 305 #selNivelAcesso { width: 20%; }
@@ -327,9 +327,11 @@ PaginaSEI::getInstance()-&gt;abrirBody($strTitulo, &#39;onload=&quot;inicializar();&quot;&#39;); @@ -327,9 +327,11 @@ PaginaSEI::getInstance()-&gt;abrirBody($strTitulo, &#39;onload=&quot;inicializar();&quot;&#39;);
327 <div class="fieldsetClear"> 327 <div class="fieldsetClear">
328 <label id="lblTipoProcesso" for="txtTipoProcesso" class="infraLabelObrigatorio">Tipos de Processos: </label> 328 <label id="lblTipoProcesso" for="txtTipoProcesso" class="infraLabelObrigatorio">Tipos de Processos: </label>
329 <input type="text" onchange="removerProcessoAssociado(0);" id="txtTipoProcesso" name="txtTipoProcesso" class="infraText InfraAutoCompletar" value="<?= $nomeTipoProcesso ?>" tabindex="<?= PaginaSEI::getInstance()->getProxTabDados() ?>"/> 329 <input type="text" onchange="removerProcessoAssociado(0);" id="txtTipoProcesso" name="txtTipoProcesso" class="infraText InfraAutoCompletar" value="<?= $nomeTipoProcesso ?>" tabindex="<?= PaginaSEI::getInstance()->getProxTabDados() ?>"/>
  330 + <?php if($_GET['acao'] != 'criterio_intercorrente_peticionamento_consultar'){ ?>
330 <select name="selTipoProcesso" id="selTipoProcesso" size="8" class="infraSelect" multiple="multiple" tabindex="<?= PaginaSEI::getInstance()->getProxTabDados() ?>"> 331 <select name="selTipoProcesso" id="selTipoProcesso" size="8" class="infraSelect" multiple="multiple" tabindex="<?= PaginaSEI::getInstance()->getProxTabDados() ?>">
331 <?= $strTipoProcesso; ?> 332 <?= $strTipoProcesso; ?>
332 </select> 333 </select>
  334 + <?php } ?>
333 <input type="hidden" id="hdnIdTipoProcesso" name="hdnIdTipoProcesso" value="<?php echo $idTipoProcesso ?>"/> 335 <input type="hidden" id="hdnIdTipoProcesso" name="hdnIdTipoProcesso" value="<?php echo $idTipoProcesso ?>"/>
334 <input type="hidden" id="hdnIdCriterioIntercorrentePeticionamento" name="hdnIdCriterioIntercorrentePeticionamento" value="<?php echo $IdCriterioIntercorrentePeticionamento ?>"/> 336 <input type="hidden" id="hdnIdCriterioIntercorrentePeticionamento" name="hdnIdCriterioIntercorrentePeticionamento" value="<?php echo $IdCriterioIntercorrentePeticionamento ?>"/>
335 <img id="imgLupaTipoProcesso" onclick="objLupaTipoProcesso.selecionar(700,500);" src="/infra_css/imagens/lupa.gif" alt="Selecionar Tipo de Processo" title="Selecionar Tipo de Processo" class="infraImg"/> 337 <img id="imgLupaTipoProcesso" onclick="objLupaTipoProcesso.selecionar(700,500);" src="/infra_css/imagens/lupa.gif" alt="Selecionar Tipo de Processo" title="Selecionar Tipo de Processo" class="infraImg"/>
@@ -339,7 +341,7 @@ PaginaSEI::getInstance()-&gt;abrirBody($strTitulo, &#39;onload=&quot;inicializar();&quot;&#39;); @@ -339,7 +341,7 @@ PaginaSEI::getInstance()-&gt;abrirBody($strTitulo, &#39;onload=&quot;inicializar();&quot;&#39;);
339 <!-- Fim do Tipo de Processo --> 341 <!-- Fim do Tipo de Processo -->
340 342
341 <div style="clear:both;">&nbsp;</div> 343 <div style="clear:both;">&nbsp;</div>
342 - <? if ($_GET['acao'] == 'criterio_intercorrente_peticionamento_alterar'){ ?> 344 + <? if ($_GET['acao'] == 'criterio_intercorrente_peticionamento_alterar' || $_GET['acao'] == 'criterio_intercorrente_peticionamento_consultar'){ ?>
343 <div style="margin-top: 40px!important;"> 345 <div style="margin-top: 40px!important;">
344 <? } else { ?> 346 <? } else { ?>
345 <div style="margin-top: 166px!important;"> 347 <div style="margin-top: 166px!important;">
sei/web/modulos/peticionamento/criterio_intercorrente_peticionamento_lista.php
@@ -144,7 +144,7 @@ try { @@ -144,7 +144,7 @@ try {
144 144
145 $strLinkPesquisar = PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink('controlador.php?acao=' . $_GET['acao'] .'&acao_origem='.$_GET['acao'].'&acao_retorno=criterio_intercorrente_peticionamento_listar')); 145 $strLinkPesquisar = PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink('controlador.php?acao=' . $_GET['acao'] .'&acao_origem='.$_GET['acao'].'&acao_retorno=criterio_intercorrente_peticionamento_listar'));
146 $arrComandos[] = '<button type="button" accesskey="p" id="btnPesquisar" value="Pesquisar" onclick="pesquisar();" class="infraButton"><span class="infraTeclaAtalho">P</span>esquisar</button>'; 146 $arrComandos[] = '<button type="button" accesskey="p" id="btnPesquisar" value="Pesquisar" onclick="pesquisar();" class="infraButton"><span class="infraTeclaAtalho">P</span>esquisar</button>';
147 - $arrComandos[] = '<button type="button" accesskey="i" id="btnIntercorrentePadrao" value="IntercorentePadrao" onclick="location.href=\''.PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink('controlador.php?acao=criterio_intercorrente_peticionamento_padrao&acao_origem='.$_GET['acao'].'&acao_retorno='.$_GET['acao'])).'\'" class="infraButton"><span class="infraTeclaAtalho">I</span>ntercorrente Padr&atilde;o</button>'; 147 + $arrComandos[] = '<button type="button" accesskey="e" id="btnIntercorrentePadrao" value="IntercorentePadrao" onclick="location.href=\''.PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink('controlador.php?acao=criterio_intercorrente_peticionamento_padrao&acao_origem='.$_GET['acao'].'&acao_retorno='.$_GET['acao'])).'\'" class="infraButton">Int<span class="infraTeclaAtalho">e</span>rcorrente Padr&atilde;o</button>';
148 148
149 $bolAcaoCadastrar = SessaoSEI::getInstance()->verificarPermissao('criterio_intercorrente_peticionamento_cadastrar'); 149 $bolAcaoCadastrar = SessaoSEI::getInstance()->verificarPermissao('criterio_intercorrente_peticionamento_cadastrar');
150 if ($bolAcaoCadastrar){ 150 if ($bolAcaoCadastrar){
sei/web/modulos/peticionamento/criterio_intercorrente_peticionamento_padrao.php
@@ -228,7 +228,13 @@ PaginaSEI::getInstance()-&gt;fecharJavaScript(); @@ -228,7 +228,13 @@ PaginaSEI::getInstance()-&gt;fecharJavaScript();
228 228
229 #imgExcluirTipoProcesso { 229 #imgExcluirTipoProcesso {
230 position: absolute; 230 position: absolute;
231 - left: 53.6%; 231 + left: 53%;
  232 + top: 18px;
  233 + }
  234 +
  235 + #imgAjuda {
  236 + position: absolute;
  237 + left: 55%;
232 top: 18px; 238 top: 18px;
233 } 239 }
234 240
@@ -262,6 +268,12 @@ PaginaSEI::getInstance()-&gt;fecharJavaScript(); @@ -262,6 +268,12 @@ PaginaSEI::getInstance()-&gt;fecharJavaScript();
262 top: 18px; 268 top: 18px;
263 } 269 }
264 270
  271 + #imgAjuda {
  272 + position: absolute;
  273 + left: 55.2%;
  274 + top: 18px;
  275 + }
  276 +
265 #lblNivelAcesso { 277 #lblNivelAcesso {
266 width: 50%; 278 width: 50%;
267 } 279 }
@@ -303,7 +315,7 @@ PaginaSEI::getInstance()-&gt;abrirBody($strTitulo, &#39;onload=&quot;inicializar();&quot;&#39;); @@ -303,7 +315,7 @@ PaginaSEI::getInstance()-&gt;abrirBody($strTitulo, &#39;onload=&quot;inicializar();&quot;&#39;);
303 <input type="hidden" id="hdnIdMdPetTipoProcesso" name="hdnIdMdPetTipoProcesso" value="<?php echo $idMdPetTipoProcesso ?>"/> 315 <input type="hidden" id="hdnIdMdPetTipoProcesso" name="hdnIdMdPetTipoProcesso" value="<?php echo $idMdPetTipoProcesso ?>"/>
304 <img id="imgLupaTipoProcesso" onclick="objLupaTipoProcesso.selecionar(700,500);" src="/infra_css/imagens/lupa.gif" alt="Selecionar Tipo de Processo" title="Selecionar Tipo de Processo" class="infraImg"/> 316 <img id="imgLupaTipoProcesso" onclick="objLupaTipoProcesso.selecionar(700,500);" src="/infra_css/imagens/lupa.gif" alt="Selecionar Tipo de Processo" title="Selecionar Tipo de Processo" class="infraImg"/>
305 <img id="imgExcluirTipoProcesso" onclick="removerProcessoAssociado(0);objLupaTipoProcesso.remover();" src="/infra_css/imagens/remover.gif" alt="Remover Tipo de Processo" title="Remover Tipo de Processo" class="infraImg"/> 317 <img id="imgExcluirTipoProcesso" onclick="removerProcessoAssociado(0);objLupaTipoProcesso.remover();" src="/infra_css/imagens/remover.gif" alt="Remover Tipo de Processo" title="Remover Tipo de Processo" class="infraImg"/>
306 - 318 + <img id="imgAjuda" src="<?= PaginaSEI::getInstance()->getDiretorioImagensGlobal() ?>/ajuda.gif" name="ajuda" <?= PaginaSEI::montarTitleTooltip('Somente após a parametrização do Intercorrente Padrão é que os Usuários Externos passarão a visualizar o menu de Peticionamento Intercorrente. \n\n\n O Intercorrente Padrão será utilizado para a abertura de processo novo relacionado ao processo de fato indicado pelo Usuário Externo quando este corresponder a processo: 1) de Tipo sem Critério Intercorrente parametrizado; 2) com Nível de Acesso "Sigiloso"; 3) Sobrestado, Anexado ou Bloqueado; 4) que todas as Unidades por onde tramitou estejam desativadas.') ?> alt="Ajuda" class="infraImg"/>
307 </div> 319 </div>
308 <!-- Fim do Tipo de Processo --> 320 <!-- Fim do Tipo de Processo -->
309 321
sei/web/modulos/peticionamento/dto/HipoteseLegalPeticionamentoDTO.php
@@ -26,6 +26,7 @@ class HipoteseLegalPeticionamentoDTO extends InfraDTO { @@ -26,6 +26,7 @@ class HipoteseLegalPeticionamentoDTO extends InfraDTO {
26 $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_STR, 'Nome', 'h.nome', 'hipotese_legal h'); 26 $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_STR, 'Nome', 'h.nome', 'hipotese_legal h');
27 $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_STR, 'BaseLegal', 'h.base_legal', 'hipotese_legal h'); 27 $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_STR, 'BaseLegal', 'h.base_legal', 'hipotese_legal h');
28 $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_STR, 'SinAtivo', 'h.sin_ativo', 'hipotese_legal h'); 28 $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_STR, 'SinAtivo', 'h.sin_ativo', 'hipotese_legal h');
  29 + $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_STR, 'NivelAcessoHl', 'h.sta_nivel_acesso', 'hipotese_legal h');
29 } 30 }
30 31
31 32
sei/web/modulos/peticionamento/dto/ReciboPeticionamentoDTO.php
@@ -34,6 +34,15 @@ class ReciboPeticionamentoDTO extends InfraDTO { @@ -34,6 +34,15 @@ class ReciboPeticionamentoDTO extends InfraDTO {
34 $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM, 34 $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM,
35 'IdProtocolo', 35 'IdProtocolo',
36 'id_protocolo'); 36 'id_protocolo');
  37 +
  38 + $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_DBL,
  39 + 'IdDocumento',
  40 + 'id_documento');
  41 +
  42 + $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_STR,
  43 + 'NumeroProcessoFormatadoDoc',
  44 + 'protdoc.protocolo_formatado',
  45 + 'protocolo protdoc');
37 46
38 $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM, 47 $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM,
39 'IdUsuario', 48 'IdUsuario',
@@ -58,6 +67,10 @@ class ReciboPeticionamentoDTO extends InfraDTO { @@ -58,6 +67,10 @@ class ReciboPeticionamentoDTO extends InfraDTO {
58 $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_DBL, 67 $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_DBL,
59 'IdProtocoloRelacionado', 68 'IdProtocoloRelacionado',
60 'id_protocolo_relacionado'); 69 'id_protocolo_relacionado');
  70 +
  71 + $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_DBL,
  72 + 'IdDocumento',
  73 + 'id_documento');
61 74
62 $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_STR, 75 $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_STR,
63 'NomeTipoPeticionamento', 76 'NomeTipoPeticionamento',
@@ -93,12 +106,17 @@ class ReciboPeticionamentoDTO extends InfraDTO { @@ -93,12 +106,17 @@ class ReciboPeticionamentoDTO extends InfraDTO {
93 106
94 $this->configurarPK('IdReciboPeticionamento',InfraDTO::$TIPO_PK_NATIVA); 107 $this->configurarPK('IdReciboPeticionamento',InfraDTO::$TIPO_PK_NATIVA);
95 108
  109 + $this->configurarFK('IdDocumento', 'documento doc', 'documento.id_documento', InfraDTO::$TIPO_FK_OPCIONAL);
  110 + $this->configurarFK('IdDocumento', 'protocolo protdoc', 'protdoc.id_protocolo', InfraDTO::$TIPO_FK_OPCIONAL);
96 $this->configurarFK('IdProtocoloRelacionado', 'protocolo protRel', 'protRel.id_protocolo', InfraDTO::$TIPO_FK_OPCIONAL); 111 $this->configurarFK('IdProtocoloRelacionado', 'protocolo protRel', 'protRel.id_protocolo', InfraDTO::$TIPO_FK_OPCIONAL);
97 $this->configurarFK('IdProtocolo', 'protocolo prot', 'prot.id_protocolo', InfraDTO::$TIPO_FK_OPCIONAL); 112 $this->configurarFK('IdProtocolo', 'protocolo prot', 'prot.id_protocolo', InfraDTO::$TIPO_FK_OPCIONAL);
98 113
99 //unidade 114 //unidade
100 $this->configurarFK('IdUnidadeGeradora', 'unidade und', 'und.id_unidade'); 115 $this->configurarFK('IdUnidadeGeradora', 'unidade und', 'und.id_unidade');
101 - $this->configurarFK('IdUsuario', 'usuario user', 'user.id_usuario');  
102 - 116 + $this->configurarFK('IdUsuario', 'usuario user', 'user.id_usuario');
  117 +
  118 + //documento
  119 + $this->configurarFK('IdDocumento', 'documento doc', 'doc.id_documento');
  120 +
103 }} 121 }}
104 ?> 122 ?>
105 \ No newline at end of file 123 \ No newline at end of file
sei/web/modulos/peticionamento/gerir_tipo_contexto_peticionamento_cadastro.php
@@ -22,20 +22,17 @@ try { @@ -22,20 +22,17 @@ try {
22 $objRN = new GerirTipoContextoPeticionamentoRN(); 22 $objRN = new GerirTipoContextoPeticionamentoRN();
23 23
24 if( isset( $_POST['hdnPrincipal'] ) && $_POST['hdnPrincipal'] != "") { 24 if( isset( $_POST['hdnPrincipal'] ) && $_POST['hdnPrincipal'] != "") {
25 -  
26 $arrPrincipal = PaginaSEI::getInstance()->getArrValuesSelect($_POST['hdnPrincipal']); 25 $arrPrincipal = PaginaSEI::getInstance()->getArrValuesSelect($_POST['hdnPrincipal']);
27 $arrPrincipal['cadastro'] = 'S'; 26 $arrPrincipal['cadastro'] = 'S';
28 - $objRN->cadastrarMultiplo( $arrPrincipal );  
29 -  
30 - }  
31 -  
32 - if( isset( $_POST['hdnPrincipal2'] ) && $_POST['hdnPrincipal2'] != "") {  
33 - 27 + $objRN->cadastrarMultiplo( $arrPrincipal );
  28 + }
  29 +
  30 + // São permitidos Contatos de sistema para Seleção
  31 + if( isset( $_POST['hdnPrincipal2'] ) && $_POST['hdnPrincipal2'] != "") {
34 $arrPrincipal2 = PaginaSEI::getInstance()->getArrValuesSelect($_POST['hdnPrincipal2']); 32 $arrPrincipal2 = PaginaSEI::getInstance()->getArrValuesSelect($_POST['hdnPrincipal2']);
35 $arrPrincipal2['cadastro'] = 'N'; 33 $arrPrincipal2['cadastro'] = 'N';
36 $objRN->cadastrarMultiplo( $arrPrincipal2 ); 34 $objRN->cadastrarMultiplo( $arrPrincipal2 );
37 -  
38 - } 35 + }
39 36
40 }catch(Exception $e){ 37 }catch(Exception $e){
41 PaginaSEI::getInstance()->processarExcecao($e); 38 PaginaSEI::getInstance()->processarExcecao($e);
sei/web/modulos/peticionamento/int/MdPetIntercorrenteINT.php
@@ -45,24 +45,69 @@ @@ -45,24 +45,69 @@
45 $idTpProcedimento = $objProcedimentoDTO->getNumIdTipoProcedimento(); 45 $idTpProcedimento = $objProcedimentoDTO->getNumIdTipoProcedimento();
46 $tpProcedimento = $objProcedimentoDTO->getStrNomeTipoProcedimento(); 46 $tpProcedimento = $objProcedimentoDTO->getStrNomeTipoProcedimento();
47 47
48 - $objCriterioIntercorrenteDTO = new CriterioIntercorrentePeticionamentoDTO();  
49 - $objCriterioIntercorrenteRN = new CriterioIntercorrentePeticionamentoRN();  
50 - $objCriterioIntercorrenteDTO->setNumIdTipoProcedimento($idTpProcedimento);  
51 - $objCriterioIntercorrenteDTO->setStrSinCriterioPadrao('N');  
52 - $objCriterioIntercorrenteDTO->retTodos(true);  
53 -  
54 - $count = $objCriterioIntercorrenteRN->contar($objCriterioIntercorrenteDTO);  
55 - $processoIntercorrente = $count > 0 ? 'Direto no Processo Indicado.' : 'Em Processo Novo Relacionado ao Processo indicado';  
56 -  
57 - $urlValida = PaginaSEIExterna::getInstance()->formatarXHTML(SessaoSEIExterna::getInstance()->assinarLink('controlador_externo.php?id_procedimento=' . $idProcedimento . '&id_tipo_procedimento=' . $idTpProcedimento . '&acao=md_pet_intercorrente_usu_ext_assinar&tipo_selecao=2'));  
58 -  
59 - $xml .= '<IdTipoProcedimento>' . $idTpProcedimento . '</IdTipoProcedimento>';  
60 - $xml .= '<IdProcedimento>' . $idProcedimento . '</IdProcedimento>';  
61 - $xml .= '<numeroProcesso>' . $objProcedimentoDTO->getStrProtocoloProcedimentoFormatado() . '</numeroProcesso>';  
62 - $xml .= '<TipoProcedimento> ' . $tpProcedimento . ' </TipoProcedimento>';  
63 - $xml .= '<ProcessoIntercorrente>' . $processoIntercorrente . '</ProcessoIntercorrente>';  
64 - $xml .= '<UrlValida>' . htmlentities($urlValida) . '</UrlValida>';  
65 48
  49 + //$processoIntercorrente = $contadorCriterioIntercorrente > 0 ? 'Direto no Processo Indicado.' : 'Em Processo Novo Relacionado ao Processo indicado';
  50 +
  51 + $objAtividadeDTO = new AtividadeDTO();
  52 + $objAtividadeDTO->setDblIdProcedimentoProtocolo($objProcedimentoDTO->getDblIdProcedimento());
  53 + $idUnidadeReabrirProcesso = $objMdPetIntercorrenteRN->retornaUltimaUnidadeProcessoConcluido($objAtividadeDTO);
  54 +
  55 + $unidadeDTO = new UnidadeDTO();
  56 + $unidadeDTO->retTodos();
  57 + $unidadeDTO->setBolExclusaoLogica(false);
  58 + $unidadeDTO->setNumIdUnidade($idUnidadeReabrirProcesso);
  59 + $unidadeRN = new UnidadeRN();
  60 + $objUnidadeDTO = $unidadeRN->consultarRN0125($unidadeDTO);
  61 +//ini_set('xdebug.var_display_max_depth', 10); ini_set('xdebug.var_display_max_children', 256); ini_set('xdebug.var_display_max_data', 1024); echo '<pre>';
  62 +//var_dump($objUnidadeDTO); echo '</pre>'; exit;
  63 + // $idUnidadeAbrirNovoProcesso = $objMdPetIntercorrenteRN->retornaUltimaUnidadeProcessoAberto($objProcedimentoDTO->getDblIdProcedimento());
  64 + if($objUnidadeDTO->getStrSinAtivo() == 'N'){
  65 + $idUnidadeReabrirProcesso = null;
  66 + $objAtividadeRN = new MdPetIntercorrenteAtividadeRN();
  67 + $arrObjUnidadeDTO = $objAtividadeRN->listarUnidadesTramitacao($objProcedimentoDTO);
  68 +
  69 + foreach ($arrObjUnidadeDTO as $itemObjUnidadeDTO) {
  70 + if ($itemObjUnidadeDTO->getStrSinAtivo() == 'S') {
  71 + $idUnidadeReabrirProcesso = $itemObjUnidadeDTO->getNumIdUnidade();
  72 + }
  73 + }
  74 + }
  75 +//ini_set('xdebug.var_display_max_depth', 10); ini_set('xdebug.var_display_max_children', 256); ini_set('xdebug.var_display_max_data', 1024); echo '<pre>';
  76 +//var_dump($idUnidadeReabrirProcesso); echo '</pre>'; exit;
  77 + if($idUnidadeReabrirProcesso == null) {
  78 + $msg = 'O processo indicado não aceita peticionamento intercorrente. Utilize o Peticionamento de Processo Novo para protocolizar sua demanda.';
  79 + } else {
  80 + $objCriterioIntercorrenteDTO = new CriterioIntercorrentePeticionamentoDTO();
  81 + $objCriterioIntercorrenteRN = new CriterioIntercorrentePeticionamentoRN();
  82 + $objCriterioIntercorrenteDTO->setNumIdTipoProcedimento($idTpProcedimento);
  83 + $objCriterioIntercorrenteDTO->setStrSinCriterioPadrao('N');
  84 + $objCriterioIntercorrenteDTO->retTodos(true);
  85 +
  86 + $contadorCriterioIntercorrente = $objCriterioIntercorrenteRN->contar($objCriterioIntercorrenteDTO);
  87 +
  88 + $estadosReabrirRelacionado = array(ProtocoloRN::$TE_PROCEDIMENTO_SOBRESTADO, ProtocoloRN::$TE_PROCEDIMENTO_ANEXADO, ProtocoloRN::$TE_PROCEDIMENTO_BLOQUEADO);
  89 + /**
  90 + * Verifica se:
  91 + * 1 - Se o processo eh sigiloso (nivel de acesso global ou local eh igual a 2)
  92 + * 2 - Se o Tipo do Processo do procedimento informado nao possui um intercorrente cadastrado(neste caso irah utilizar o Intercorrente Padrao)
  93 + */
  94 + $processoIntercorrente = 'Direto no Processo Indicado';
  95 + if($contadorCriterioIntercorrente <= 0
  96 + || $objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo() == ProtocoloRN::$NA_SIGILOSO
  97 + || $objProcedimentoDTO->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_SIGILOSO
  98 + || in_array($objProcedimentoDTO->getStrStaEstadoProtocolo(), $estadosReabrirRelacionado)){
  99 + $processoIntercorrente = 'Em Processo Novo Relacionado ao Processo Indicado';
  100 + }
  101 +
  102 + $urlValida = PaginaSEIExterna::getInstance()->formatarXHTML(SessaoSEIExterna::getInstance()->assinarLink('controlador_externo.php?id_procedimento=' . $idProcedimento . '&id_tipo_procedimento=' . $idTpProcedimento . '&acao=md_pet_intercorrente_usu_ext_assinar&tipo_selecao=2'));
  103 +
  104 + $xml .= '<IdTipoProcedimento>' . $idTpProcedimento . '</IdTipoProcedimento>';
  105 + $xml .= '<IdProcedimento>' . $idProcedimento . '</IdProcedimento>';
  106 + $xml .= '<numeroProcesso>' . $objProcedimentoDTO->getStrProtocoloProcedimentoFormatado() . '</numeroProcesso>';
  107 + $xml .= '<TipoProcedimento> ' . $tpProcedimento . ' </TipoProcedimento>';
  108 + $xml .= '<ProcessoIntercorrente>' . $processoIntercorrente . '</ProcessoIntercorrente>';
  109 + $xml .= '<UrlValida>' . htmlentities($urlValida) . '</UrlValida>';
  110 + }
66 } else { 111 } else {
67 $msg = 'O processo indicado não aceita peticionamento intercorrente. Utilize o Peticionamento de Processo Novo para protocolizar sua demanda.'; 112 $msg = 'O processo indicado não aceita peticionamento intercorrente. Utilize o Peticionamento de Processo Novo para protocolizar sua demanda.';
68 //$xml .= '<MensagemValidacao>. $msg.</MensagemValidacao>'; 113 //$xml .= '<MensagemValidacao>. $msg.</MensagemValidacao>';
@@ -171,9 +216,9 @@ @@ -171,9 +216,9 @@
171 $objInfraParametroDTO = new InfraParametroDTO(); 216 $objInfraParametroDTO = new InfraParametroDTO();
172 $objInfraParametroDTO->setStrNome('SEI_HABILITAR_HIPOTESE_LEGAL'); 217 $objInfraParametroDTO->setStrNome('SEI_HABILITAR_HIPOTESE_LEGAL');
173 $objInfraParametroDTO->retTodos(); 218 $objInfraParametroDTO->retTodos();
174 - $objInfraParametroRN = new InfraParametroRN(); 219 + $objMdPetParametroRN = new MdPetParametroRN();
175 220
176 - $objInfraParametroDTO = $objInfraParametroRN->consultar($objInfraParametroDTO); 221 + $objInfraParametroDTO = $objMdPetParametroRN->consultar($objInfraParametroDTO);
177 222
178 return $objInfraParametroDTO->isSetStrValor() && 223 return $objInfraParametroDTO->isSetStrValor() &&
179 ($objInfraParametroDTO->getStrValor() == 1 || $objInfraParametroDTO->getStrValor() == 2); 224 ($objInfraParametroDTO->getStrValor() == 1 || $objInfraParametroDTO->getStrValor() == 2);
@@ -204,7 +249,7 @@ @@ -204,7 +249,7 @@
204 //Se não tem criterio intercorrente cadastrado, verifica se tem interorrente padrão cadastrado. 249 //Se não tem criterio intercorrente cadastrado, verifica se tem interorrente padrão cadastrado.
205 if (is_null($objCriterioIntercorrenteDTO)) { 250 if (is_null($objCriterioIntercorrenteDTO)) {
206 $objCriterioIntercorrenteDTO = new CriterioIntercorrentePeticionamentoDTO(); 251 $objCriterioIntercorrenteDTO = new CriterioIntercorrentePeticionamentoDTO();
207 - $objCriterioIntercorrenteDTO->setNumIdTipoProcedimento($idTipoProcessoPeticionamento); 252 + //$objCriterioIntercorrenteDTO->setNumIdTipoProcedimento($idTipoProcessoPeticionamento);
208 $objCriterioIntercorrenteDTO->setStrSinCriterioPadrao('S'); 253 $objCriterioIntercorrenteDTO->setStrSinCriterioPadrao('S');
209 $objCriterioIntercorrenteDTO->setStrSinAtivo('S'); 254 $objCriterioIntercorrenteDTO->setStrSinAtivo('S');
210 $objCriterioIntercorrenteDTO->retTodos(true); 255 $objCriterioIntercorrenteDTO->retTodos(true);
@@ -253,21 +298,30 @@ @@ -253,21 +298,30 @@
253 * @since 08/12/2016 298 * @since 08/12/2016
254 * @author André Luiz <andre.luiz@castgroup.com.br> 299 * @author André Luiz <andre.luiz@castgroup.com.br>
255 */ 300 */
256 - public static function montarSelectHipoteseLegal($objEntradaListarHipotesesLegaisAPI) 301 + public static function montarSelectHipoteseLegal()
257 { 302 {
258 -  
259 - $seiRN = new SeiRN();  
260 - $arrObjHipoteseLegalAPI = $seiRN->listarHipotesesLegais($objEntradaListarHipotesesLegaisAPI);  
261 - $strOptions = '<option value="null"> </option>';  
262 -  
263 - foreach ($arrObjHipoteseLegalAPI as $objHipoteseLegalAPI) {  
264 - $nomeBaseLegal = $objHipoteseLegalAPI->getNome() . ' (' . $objHipoteseLegalAPI->getBaseLegal() . ')';  
265 - $strOptions .= '<option value="' . $objHipoteseLegalAPI->getIdHipoteseLegal() . '">'; 303 + $objHipoteseLegalPetDTO = new HipoteseLegalPeticionamentoDTO();
  304 + $objHipoteseLegalPetDTO->setStrNivelAcessoHl(ProtocoloRN::$NA_RESTRITO);
  305 + $objHipoteseLegalPetDTO->setStrSinAtivo('S');
  306 + $objHipoteseLegalPetDTO->retStrBaseLegal();
  307 + $objHipoteseLegalPetDTO->retStrNome();
  308 + $objHipoteseLegalPetDTO->retNumIdHipoteseLegalPeticionamento();
  309 + $objHipoteseLegalPetDTO->setOrd("Nome", InfraDTO::$TIPO_ORDENACAO_ASC);
  310 +
  311 + $objHipoteseLegalPetRN = new HipoteseLegalPeticionamentoRN();
  312 + $arrObjHipoteseLegal = $objHipoteseLegalPetRN->listar($objHipoteseLegalPetDTO);
  313 + $strOptions = '<select id="selHipoteseLegal" name="selHipoteseLegal"><option value=""> </option>';
  314 +
  315 + foreach ($arrObjHipoteseLegal as $objHipoteseLegalPetDTO) {
  316 + $nomeBaseLegal = $objHipoteseLegalPetDTO->getStrNome() . ' (' . $objHipoteseLegalPetDTO->getStrBaseLegal() . ')';
  317 + $strOptions .= '<option value="' . $objHipoteseLegalPetDTO->getNumIdHipoteseLegalPeticionamento() . '">';
266 $strOptions .= $nomeBaseLegal; 318 $strOptions .= $nomeBaseLegal;
267 $strOptions .= '</option>'; 319 $strOptions .= '</option>';
268 } 320 }
269 321
270 - return InfraAjax::gerarXMLSelect($strOptions); 322 + $strOptions .= '</select>';
  323 +
  324 + return $strOptions;
271 } 325 }
272 326
273 /** 327 /**
@@ -282,14 +336,14 @@ @@ -282,14 +336,14 @@
282 public static function montarArrDocumentoAPI($idProcedimento, $hdnTabelaDinamicaDocumento) 336 public static function montarArrDocumentoAPI($idProcedimento, $hdnTabelaDinamicaDocumento)
283 { 337 {
284 338
285 - $objRemetenteAPI = new RemetenteAPI();  
286 - $objRemetenteAPI->setNome(SessaoSEIExterna::getInstance()->getStrNomeUsuarioExterno());  
287 - $objRemetenteAPI->setSigla(SessaoSEIExterna::getInstance()->getStrSiglaUsuarioExterno()); 339 + //seiv3
  340 + //$objRemetenteAPI = new RemetenteAPI();
  341 + //$objRemetenteAPI->setNome(SessaoSEIExterna::getInstance()->getStrNomeUsuarioExterno());
  342 + //$objRemetenteAPI->setSigla(SessaoSEIExterna::getInstance()->getStrSiglaUsuarioExterno());
288 343
289 - /*  
290 - $objDestinatarioAPI = new DestinatarioAPI();  
291 - $objDestinatarioAPI->set  
292 - */ 344 + //seiv3
  345 + //$objDestinatarioAPI = new DestinatarioAPI();
  346 + //$objDestinatarioAPI->set
293 347
294 $arrItensTbDocumento = PaginaSEIExterna::getInstance()->getArrItensTabelaDinamica($hdnTabelaDinamicaDocumento); 348 $arrItensTbDocumento = PaginaSEIExterna::getInstance()->getArrItensTabelaDinamica($hdnTabelaDinamicaDocumento);
295 $arrDocumentoAPI = array(); 349 $arrDocumentoAPI = array();
@@ -299,6 +353,7 @@ @@ -299,6 +353,7 @@
299 $documentoAPI->setIdProcedimento($idProcedimento); 353 $documentoAPI->setIdProcedimento($idProcedimento);
300 $documentoAPI->setIdSerie($itemTbDocumento[1]); 354 $documentoAPI->setIdSerie($itemTbDocumento[1]);
301 $documentoAPI->setDescricao($itemTbDocumento[2]); 355 $documentoAPI->setDescricao($itemTbDocumento[2]);
  356 + $documentoAPI->setNumero($itemTbDocumento[2]);
302 $documentoAPI->setNivelAcesso($itemTbDocumento[3]); 357 $documentoAPI->setNivelAcesso($itemTbDocumento[3]);
303 $documentoAPI->setIdHipoteseLegal($itemTbDocumento[4]); 358 $documentoAPI->setIdHipoteseLegal($itemTbDocumento[4]);
304 //$documentoAPI->setCampos($itemTbDocumento[5]); 359 //$documentoAPI->setCampos($itemTbDocumento[5]);
@@ -310,8 +365,11 @@ @@ -310,8 +365,11 @@
310 $documentoAPI->setIdArquivo($itemTbDocumento[7]); 365 $documentoAPI->setIdArquivo($itemTbDocumento[7]);
311 $documentoAPI->setSinAssinado('S'); 366 $documentoAPI->setSinAssinado('S');
312 $documentoAPI->setSinBloqueado('S'); 367 $documentoAPI->setSinBloqueado('S');
313 - $documentoAPI->setRemetente($objRemetenteAPI);  
314 368
  369 + //seiv3
  370 + //$documentoAPI->setRemetente($objRemetenteAPI);
  371 +
  372 + //seiv3
315 //$documentoAPI->setDestinatarios(); 373 //$documentoAPI->setDestinatarios();
316 374
317 $arrDocumentoAPI[] = $documentoAPI; 375 $arrDocumentoAPI[] = $documentoAPI;
sei/web/modulos/peticionamento/int/TipoProcessoPeticionamentoINT.php
@@ -49,41 +49,55 @@ class TipoProcessoPeticionamentoINT extends InfraINT { @@ -49,41 +49,55 @@ class TipoProcessoPeticionamentoINT extends InfraINT {
49 $objHipoteseLegalPeticionamentoDTO->retTodos(); 49 $objHipoteseLegalPeticionamentoDTO->retTodos();
50 $objHipoteseLegalPeticionamentoDTO->setOrd('Nome', InfraDTO::$TIPO_ORDENACAO_ASC); 50 $objHipoteseLegalPeticionamentoDTO->setOrd('Nome', InfraDTO::$TIPO_ORDENACAO_ASC);
51 $countHipotesesPeticionamento = $objHipoteseLegalPeticionamentoRN->contar($objHipoteseLegalPeticionamentoDTO); 51 $countHipotesesPeticionamento = $objHipoteseLegalPeticionamentoRN->contar($objHipoteseLegalPeticionamentoDTO);
52 -  
53 - if($countHipotesesPeticionamento > 0)  
54 - {  
55 - $peticionamento = true;  
56 - $objHipoteseLegalPeticionamentoDTO->retStrNome();  
57 - $objHipoteseLegalPeticionamentoDTO->retStrBaseLegal();  
58 - $arrHipoteses = $objHipoteseLegalPeticionamentoRN->listar($objHipoteseLegalPeticionamentoDTO);  
59 - }  
60 - else  
61 - {  
62 - $objHipoteseLegalRN = new HipoteseLegalRN();  
63 - $objHipoteseLegalCoreDTO = new HipoteseLegalDTO();  
64 -  
65 - $objHipoteseLegalCoreDTO->retTodos();  
66 - $objHipoteseLegalCoreDTO->setStrStaNivelAcesso( ProtocoloRN::$NA_RESTRITO );  
67 - $objHipoteseLegalCoreDTO->setOrdStrNome(InfraDTO::$TIPO_ORDENACAO_ASC);  
68 - $arrHipoteses = $objHipoteseLegalRN->listar( $objHipoteseLegalCoreDTO );  
69 - }  
70 -  
71 - $stringFim = '<option value=""> </option>';  
72 - if(count($arrHipoteses) > 0 ){  
73 -  
74 - foreach($arrHipoteses as $objHipoteseLegalDTO){  
75 -  
76 - $idHipoteseLegal = $peticionamento ? $objHipoteseLegalDTO->getNumIdHipoteseLegalPeticionamento() : $objHipoteseLegalDTO->getNumIdHipoteseLegal();  
77 -  
78 - if(!is_null($strValorItemSelecionado) && $strValorItemSelecionado == $idHipoteseLegal){  
79 - $stringFim .= '<option value="' . $idHipoteseLegal . '" selected="selected">' . $objHipoteseLegalDTO->getStrNome() . ' (' . $objHipoteseLegalDTO->getStrBaseLegal() .')';  
80 - } else {  
81 - $stringFim .= '<option value="' . $idHipoteseLegal . '">' . $objHipoteseLegalDTO->getStrNome() . ' (' . $objHipoteseLegalDTO->getStrBaseLegal() . ')';  
82 - }  
83 - $stringFim .= '</option>';  
84 -  
85 - }  
86 - } 52 +
  53 + if($countHipotesesPeticionamento > 0)
  54 + {
  55 + $peticionamento = true;
  56 + $objHipoteseLegalPeticionamentoDTO->retStrNome();
  57 + $objHipoteseLegalPeticionamentoDTO->retStrBaseLegal();
  58 + $arrHipoteses = $objHipoteseLegalPeticionamentoRN->listar($objHipoteseLegalPeticionamentoDTO);
  59 + $stringFim = '<option value=""> </option>';
  60 + if(count($arrHipoteses) > 0 ){
  61 +
  62 + foreach($arrHipoteses as $objHipoteseLegalDTO){
  63 +
  64 + $idHipoteseLegal = $peticionamento ? $objHipoteseLegalDTO->getNumIdHipoteseLegalPeticionamento() : $objHipoteseLegalDTO->getNumIdHipoteseLegal();
  65 +
  66 + if(!is_null($strValorItemSelecionado) && $strValorItemSelecionado == $idHipoteseLegal){
  67 + $stringFim .= '<option value="' . $idHipoteseLegal . '" selected="selected">' . $objHipoteseLegalDTO->getStrNome() . ' (' . $objHipoteseLegalDTO->getStrBaseLegal() .')';
  68 + } else {
  69 + $stringFim .= '<option value="' . $idHipoteseLegal . '">' . $objHipoteseLegalDTO->getStrNome() . ' (' . $objHipoteseLegalDTO->getStrBaseLegal() . ')';
  70 + }
  71 + $stringFim .= '</option>';
  72 +
  73 + }
  74 + }
  75 + }
  76 + else
  77 + {
  78 + $objEntradaListarHipotesesLegaisAPI = new EntradaListarHipotesesLegaisAPI();
  79 + $objEntradaListarHipotesesLegaisAPI->setNivelAcesso(ProtocoloRN::$NA_RESTRITO);
  80 +
  81 + $objSeiRN = new SeiRN();
  82 + $arrHipoteseLegalAPI = $objSeiRN->listarHipotesesLegais($objEntradaListarHipotesesLegaisAPI);
  83 +
  84 + $stringFim = '<option value=""> </option>';
  85 + if(count($arrHipoteseLegalAPI) > 0 ){
  86 + /* @var $hipoteseLegalAPI HipoteseLegalAPI */
  87 + foreach($arrHipoteseLegalAPI as $hipoteseLegalAPI){
  88 +
  89 + $idHipoteseLegal = $hipoteseLegalAPI->getIdHipoteseLegal();
  90 +
  91 + if(!is_null($strValorItemSelecionado) && $strValorItemSelecionado == $idHipoteseLegal){
  92 + $stringFim .= '<option value="' . $idHipoteseLegal . '" selected="selected">' . $hipoteseLegalAPI->getNome() . ' (' . $hipoteseLegalAPI->getBaseLegal() .')';
  93 + } else {
  94 + $stringFim .= '<option value="' . $idHipoteseLegal . '">' . $hipoteseLegalAPI->getNome() . ' (' . $hipoteseLegalAPI->getBaseLegal() . ')';
  95 + }
  96 + $stringFim .= '</option>';
  97 +
  98 + }
  99 + }
  100 + }
87 101
88 return $stringFim; 102 return $stringFim;
89 } 103 }
@@ -247,34 +261,65 @@ class TipoProcessoPeticionamentoINT extends InfraINT { @@ -247,34 +261,65 @@ class TipoProcessoPeticionamentoINT extends InfraINT {
247 261
248 public static function autoCompletarTipoProcedimento($strPalavrasPesquisa, $itensSelecionados = null){ 262 public static function autoCompletarTipoProcedimento($strPalavrasPesquisa, $itensSelecionados = null){
249 263
250 - $objTipoProcedimentoDTO = new TipoProcedimentoDTO();  
251 - $objTipoProcedimentoDTO->retNumIdTipoProcedimento();  
252 - $objTipoProcedimentoDTO->retStrNome();  
253 -  
254 - $objTipoProcedimentoDTO->setOrdStrNome(InfraDTO::$TIPO_ORDENACAO_ASC);  
255 -  
256 - $objTipoProcedimentoRN = new TipoProcedimentoRN();  
257 -  
258 - $arrObjTipoProcedimentoDTO = $objTipoProcedimentoRN->listarRN0244($objTipoProcedimentoDTO); 264 + $seiRN = new SeiRN();
  265 + $arrObjTipoProcedimentoApi = $seiRN->listarTiposProcedimento();
259 266
260 - $strPalavrasPesquisa = trim($strPalavrasPesquisa);  
261 -  
262 - $ret = $arrObjTipoProcedimentoDTO;  
263 if ($strPalavrasPesquisa != '' || $itensSelecionados != null) { 267 if ($strPalavrasPesquisa != '' || $itensSelecionados != null) {
264 $ret = array(); 268 $ret = array();
265 $strPalavrasPesquisa = strtolower($strPalavrasPesquisa); 269 $strPalavrasPesquisa = strtolower($strPalavrasPesquisa);
266 - foreach($arrObjTipoProcedimentoDTO as $objTipoProcedimentoDTO){  
267 - if($itensSelecionados != null && in_array($objTipoProcedimentoDTO->getNumIdTipoProcedimento(), $itensSelecionados)){ 270 + foreach($arrObjTipoProcedimentoApi as $objTipoProcedimentoApi){
  271 + /**@var $objTipoProcedimentoApi TipoProcedimentoAPI */
  272 + if($itensSelecionados != null && in_array($objTipoProcedimentoApi->getIdTipoProcedimento(), $itensSelecionados)){
268 continue; 273 continue;
269 } 274 }
270 - if ($strPalavrasPesquisa != '' && strpos(strtolower($objTipoProcedimentoDTO->getStrNome()),$strPalavrasPesquisa)==false){ 275 + if ($strPalavrasPesquisa != '' && strpos(strtolower($objTipoProcedimentoApi->getNome()),$strPalavrasPesquisa)==false){
271 continue; 276 continue;
272 } 277 }
273 - $ret[] = $objTipoProcedimentoDTO; 278 + $ret[] = $objTipoProcedimentoApi;
274 } 279 }
275 } 280 }
276 281
277 return $ret; 282 return $ret;
278 } 283 }
279 284
  285 + public static function gerarXMLItensArrInfraApi($arr, $strAtributoId, $strAtributoDescricao, $strAtributoComplemento=null, $strAtributoGrupo=null){
  286 + $metodoAtributoId = "get{$strAtributoId}";
  287 + $metodoAtributoDescricao = "get{$strAtributoDescricao}";
  288 + $metodoAtributoComplemento = "get{$strAtributoComplemento}";
  289 + $metodoAtributoGrupo = "get{$strAtributoGrupo}";
  290 +
  291 + $xml = '';
  292 + $xml .= '<itens>';
  293 + if ($arr !== null ){
  294 + foreach($arr as $dto){
  295 + $xml .= '<item id="'.self::formatarXMLAjax($dto->$metodoAtributoId()).'"';
  296 + $xml .= ' descricao="'.self::formatarXMLAjax($dto->$metodoAtributoDescricao()).'"';
  297 +
  298 + if ($strAtributoComplemento!==null){
  299 + $xml .= ' complemento="'.self::formatarXMLAjax($dto->$metodoAtributoComplemento()).'"';
  300 + }
  301 +
  302 + if ($strAtributoGrupo!==null){
  303 + $xml .= ' grupo="'.self::formatarXMLAjax($dto->$metodoAtributoGrupo()).'"';
  304 + }
  305 +
  306 + $xml .= '></item>';
  307 + }
  308 + }
  309 + $xml .= '</itens>';
  310 + return $xml;
  311 + }
  312 +
  313 + private static function formatarXMLAjax($str){
  314 + if (!is_numeric($str)){
  315 + $str = str_replace('&','&amp;',$str);
  316 + $str = str_replace('<','&amp;lt;',$str);
  317 + $str = str_replace('>','&amp;gt;',$str);
  318 + $str = str_replace('\"','&amp;quot;',$str);
  319 + $str = str_replace('"','&amp;quot;',$str);
  320 + //$str = str_replace("\n",'_',$str);
  321 + }
  322 + return $str;
  323 + }
  324 +
280 } 325 }
281 \ No newline at end of file 326 \ No newline at end of file
sei/web/modulos/peticionamento/md_pet_intercorrente_usu_ext_cadastro.php
1 <?php 1 <?php
2 - /** 2 +/**
3 * ANATEL 3 * ANATEL
4 * 4 *
5 * 20/10/2016 - criado por marcelo.bezerra@cast.com.br - CAST 5 * 20/10/2016 - criado por marcelo.bezerra@cast.com.br - CAST
@@ -15,8 +15,8 @@ @@ -15,8 +15,8 @@
15 * - área / bloco de processos 15 * - área / bloco de processos
16 * - área / bloco de documentos 16 * - área / bloco de documentos
17 * =========================================================================================================== 17 * ===========================================================================================================
18 - */  
19 - try { 18 +*/
  19 +try {
20 20
21 require_once dirname(__FILE__) . '/../../SEI.php'; 21 require_once dirname(__FILE__) . '/../../SEI.php';
22 22
@@ -31,16 +31,6 @@ @@ -31,16 +31,6 @@
31 SessaoSEIExterna::getInstance()->validarLink(); 31 SessaoSEIExterna::getInstance()->validarLink();
32 SessaoSEIExterna::getInstance()->validarPermissao($_GET['acao']); 32 SessaoSEIExterna::getInstance()->validarPermissao($_GET['acao']);
33 33
34 - /*  
35 - $doc = new DocumentoDTO();  
36 - $doc->retTodos(true);  
37 - $doc->setDblIdDocumento(10);  
38 -  
39 - $rn = new DocumentoRN();  
40 - ini_set('xdebug.var_display_max_depth', 10); ini_set('xdebug.var_display_max_children', 256); ini_set('xdebug.var_display_max_data', 1024); echo '<pre>';  
41 - var_dump($rn->consultarRN0005($doc)); echo '</pre>'; exit;  
42 - */  
43 -  
44 //===================================================== 34 //=====================================================
45 //INICIO - VARIAVEIS PRINCIPAIS E LISTAS DA PAGINA 35 //INICIO - VARIAVEIS PRINCIPAIS E LISTAS DA PAGINA
46 //===================================================== 36 //=====================================================
@@ -67,17 +57,12 @@ @@ -67,17 +57,12 @@
67 //===================================================== 57 //=====================================================
68 //INICIO FOLHAS DE ESTILOS CSS 58 //INICIO FOLHAS DE ESTILOS CSS
69 //===================================================== 59 //=====================================================
70 - //@todo remover a tag <style> do arquivo e descomentar a function abrirStyle()  
71 - //PaginaSEIExterna::getInstance()->abrirStyle();  
72 require_once('md_pet_intercorrente_usu_ext_cadastro_css.php'); 60 require_once('md_pet_intercorrente_usu_ext_cadastro_css.php');
73 - //PaginaSEIExterna::getInstance()->fecharStyle();  
74 //===================================================== 61 //=====================================================
75 //FIM FOLHAS DE ESTILOS CSS 62 //FIM FOLHAS DE ESTILOS CSS
76 //===================================================== 63 //=====================================================
77 64
78 PaginaSEIExterna::getInstance()->montarJavaScript(); 65 PaginaSEIExterna::getInstance()->montarJavaScript();
79 - //@todo remover a tag <script> do arquivo e descomentar a function abrirJavaScript()  
80 - //PaginaSEIExterna::getInstance()->abrirJavaScript();  
81 //===================================================== 66 //=====================================================
82 //INICIO JAVASCRIPT 67 //INICIO JAVASCRIPT
83 //===================================================== 68 //=====================================================
@@ -85,7 +70,6 @@ @@ -85,7 +70,6 @@
85 //===================================================== 70 //=====================================================
86 //FIM JAVASCRIPT 71 //FIM JAVASCRIPT
87 //===================================================== 72 //=====================================================
88 - //PaginaSEIExterna::getInstance()->fecharJavaScript();  
89 PaginaSEIExterna::getInstance()->fecharHead(); 73 PaginaSEIExterna::getInstance()->fecharHead();
90 PaginaSEIExterna::getInstance()->abrirBody($strTitulo, 'onload="inicializar();"'); 74 PaginaSEIExterna::getInstance()->abrirBody($strTitulo, 'onload="inicializar();"');
91 ?> 75 ?>
sei/web/modulos/peticionamento/md_pet_intercorrente_usu_ext_cadastro_bloco_documentos.php
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
25 <div class="clear"></div> 25 <div class="clear"></div>
26 26
27 <div class="bloco"> 27 <div class="bloco">
28 - <label class="infraLabelObrigatorio" for="selTipoDocumento">Tipo de Documento: <img src="<?= PaginaSEI::getInstance()->getDiretorioImagensGlobal() ?>/ajuda.gif" name="ajuda" <?= PaginaSEI::montarTitleTooltip($strMsgTooltipTipoDocumentoPrincipal) ?> alt="Ajuda" class="infraImg"/></label> 28 + <label class="infraLabelObrigatorio" for="selTipoDocumento">Tipo de Documento: <img src="<?= PaginaSEI::getInstance()->getDiretorioImagensGlobal() ?>/ajuda.gif" name="ajuda" <?= PaginaSEI::montarTitleTooltip($strMsgTooltipTipoDocumento) ?> alt="Ajuda" class="infraImg"/></label>
29 <select id="selTipoDocumento" class="infraSelect" tabindex="<?= PaginaSEI::getInstance()->getProxTabDados(); ?>"></select> 29 <select id="selTipoDocumento" class="infraSelect" tabindex="<?= PaginaSEI::getInstance()->getProxTabDados(); ?>"></select>
30 </div> 30 </div>
31 31
@@ -44,7 +44,9 @@ @@ -44,7 +44,9 @@
44 <?php if ($exibirHipoteseLegal): ?> 44 <?php if ($exibirHipoteseLegal): ?>
45 <div class="bloco" id="divBlcHipoteseLegal" style="display: none"> 45 <div class="bloco" id="divBlcHipoteseLegal" style="display: none">
46 <label class="infraLabelObrigatorio" for="selHipoteseLegal">Hipótese Legal: <img src="<?= PaginaSEI::getInstance()->getDiretorioImagensGlobal() ?>/ajuda.gif" name="ajuda" <?= PaginaSEI::montarTitleTooltip($strMsgTooltipHipoteseLegal) ?> alt="Ajuda" class="infraImg"/></label> 46 <label class="infraLabelObrigatorio" for="selHipoteseLegal">Hipótese Legal: <img src="<?= PaginaSEI::getInstance()->getDiretorioImagensGlobal() ?>/ajuda.gif" name="ajuda" <?= PaginaSEI::montarTitleTooltip($strMsgTooltipHipoteseLegal) ?> alt="Ajuda" class="infraImg"/></label>
47 - <div id="divHipoteseLegal"></div> 47 + <div id="divHipoteseLegal">
  48 + <?php echo $selHipoteseLegal; ?>
  49 + </div>
48 </div> 50 </div>
49 <?php endif; ?> 51 <?php endif; ?>
50 52
@@ -90,4 +92,5 @@ @@ -90,4 +92,5 @@
90 <input type="hidden" value="0" id="hdnIdDocumento"/> 92 <input type="hidden" value="0" id="hdnIdDocumento"/>
91 <input type="hidden" name="hdnIdProcedimento" id="hdnIdProcedimento" value=""/> 93 <input type="hidden" name="hdnIdProcedimento" id="hdnIdProcedimento" value=""/>
92 94
  95 +
93 </fieldset> 96 </fieldset>
94 \ No newline at end of file 97 \ No newline at end of file
sei/web/modulos/peticionamento/md_pet_intercorrente_usu_ext_cadastro_bloco_processos.php
@@ -9,9 +9,9 @@ @@ -9,9 +9,9 @@
9 Número: 9 Número:
10 </label> 10 </label>
11 11
12 - <input onchange="controlarChangeNumeroProcesso();" type="text" id="txtNumeroProcesso" name="txtNumeroProcesso" class="infraText" maxlength="30" style="width:170px;" tabindex="<?= PaginaSEI::getInstance()->getProxTabDados() ?>" value="<?= $txtNumeroProcesso ?>"/> 12 + <input onchange="controlarChangeNumeroProcesso();" type="text" id="txtNumeroProcesso" name="txtNumeroProcesso" class="infraText" maxlength="30" style="width:169px;" tabindex="<?= PaginaSEI::getInstance()->getProxTabDados() ?>" value="<?= $txtNumeroProcesso ?>"/>
13 13
14 - <button type="button" accesskey="V" id="btnValidar" onclick="validarNumeroProcesso()" class="infraButton"> 14 + <button tabindex="<?= PaginaSEI::getInstance()->getProxTabDados() ?>" type="button" accesskey="V" id="btnValidar" onclick="validarNumeroProcesso()" class="infraButton">
15 <span class="infraTeclaAtalho">V</span>alidar 15 <span class="infraTeclaAtalho">V</span>alidar
16 </button> 16 </button>
17 </div> 17 </div>
@@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
26 26
27 <input type="text" id="txtTipo" name="txtTipo" class="infraText" readonly="readonly" tabindex="<?= PaginaSEI::getInstance()->getProxTabDados() ?>" value="<?= $txtTipo ?>"/> 27 <input type="text" id="txtTipo" name="txtTipo" class="infraText" readonly="readonly" tabindex="<?= PaginaSEI::getInstance()->getProxTabDados() ?>" value="<?= $txtTipo ?>"/>
28 28
29 - <button type="button" onclick="adicionarProcesso();" accesskey="A" id="btnAdicionar" class="infraButton" style="display: none"> 29 + <button type="button" tabindex="<?= PaginaSEI::getInstance()->getProxTabDados() ?>" onclick="adicionarProcesso();" accesskey="A" id="btnAdicionar" class="infraButton" style="display: none">
30 <span class="infraTeclaAtalho">A</span>dicionar 30 <span class="infraTeclaAtalho">A</span>dicionar
31 </button> 31 </button>
32 32
sei/web/modulos/peticionamento/md_pet_intercorrente_usu_ext_cadastro_inicializar.php
1 <?php 1 <?php
2 //INICIALIZACAO DE VARIAVEIS DA PAGINA 2 //INICIALIZACAO DE VARIAVEIS DA PAGINA
3 - $txtOrientacoes = "Este peticionamento serve para protocolizar documentos em processos já existentes. Condicionado ao número do processo a ser validado abaixo e parametrizações da administração sobre o Tipo de Processo correspondente, os documentos poderão ser incluídos diretamente no processo indicado ou protocolizado em processo novo apartado relacionado ao processo indicado."; 3 + $txtOrientacoes = "Este peticionamento serve para protocolizar documentos em processos já existentes. Condicionado ao número do processo a ser validado abaixo e parametrizações da administração sobre o Tipo de Processo correspondente, os documentos poderão ser incluídos diretamente no processo indicado ou em processo novo relacionado.";
4 4
5 $arrComandos = array(); 5 $arrComandos = array();
6 $arrComandos[] = '<button type="button" accesskey="p" name="Peticionar" id="Peticionar" value="Peticionar" onclick="abrirPeticionar()" class="infraButton"><span class="infraTeclaAtalho">P</span>eticionar</button>'; 6 $arrComandos[] = '<button type="button" accesskey="p" name="Peticionar" id="Peticionar" value="Peticionar" onclick="abrirPeticionar()" class="infraButton"><span class="infraTeclaAtalho">P</span>eticionar</button>';
@@ -11,18 +11,10 @@ @@ -11,18 +11,10 @@
11 $strUrlAjaxMontarSelectTipoDocumento = SessaoSEIExterna::getInstance()->assinarLink('controlador_externo.php?acao=montar_select_tipo_documento'); 11 $strUrlAjaxMontarSelectTipoDocumento = SessaoSEIExterna::getInstance()->assinarLink('controlador_externo.php?acao=montar_select_tipo_documento');
12 $strUrlAjaxMontarSelectNivelAcesso = SessaoSEIExterna::getInstance()->assinarLink('controlador_externo.php?acao=montar_select_nivel_acesso'); 12 $strUrlAjaxMontarSelectNivelAcesso = SessaoSEIExterna::getInstance()->assinarLink('controlador_externo.php?acao=montar_select_nivel_acesso');
13 $strUrlAjaxCriterioIntercorrente = SessaoSEIExterna::getInstance()->assinarLink('controlador_externo.php?acao=verificar_criterio_intercorrente'); 13 $strUrlAjaxCriterioIntercorrente = SessaoSEIExterna::getInstance()->assinarLink('controlador_externo.php?acao=verificar_criterio_intercorrente');
14 - $strUrlAjaxMontarHipoteseLegal = SessaoSEIExterna::getInstance()->assinarLink('controlador_externo.php?acao=montar_select_hipotese_legal'); 14 +
15 //Fim Links 15 //Fim Links
16 16
17 //Msgs dos Tooltips de Ajuda 17 //Msgs dos Tooltips de Ajuda
18 - $strMsgTooltipFormato = 'Selecione a opção “Nato-digital” se o arquivo a ser carregado foi criado originalmente em meio eletrônico.\n\n\n Selecione a opção “Digitalizado” somente se o arquivo a ser carregado foi produzido da digitalização de um documento em papel.';  
19 - $strMsgTooltipTipoDocumento = 'Selecione o Tipo de Documento que melhor identifique o documento a ser carregado e complemente o Tipo no campo ao lado.';  
20 - $strMsgTooltipComplementoTipoDocumento = 'O Complemento do Tipo de Documento é o texto que completa a identificação do documento a ser carregado, adicionando ao nome do Tipo o texto que for digitado no referido campo (Tipo “Recurso” e Complemento “de 1ª Instância” identificará o documento como “Recurso de 1ª Instância”).\n\n\n Exemplos: O Complemento do Tipo “Nota” pode ser “Fiscal Eletrônica” ou “Fiscal nº 75/2016”. O Complemento do Tipo “Comprovante” pode ser “de Pagamento” ou “de Endereço”.';  
21 - //Msgs dos Tooltips de Ajuda  
22 - $strMsgTooltipInteressadoProprioUsuarioExterno = 'Para o Tipo de Processo escolhido o Interessado do processo a ser aberto somente pode ser o próprio Usuário Externo logado no sistema.';  
23 - $strMsgTooltipInteressadoInformandoCPFeCNPJ = 'Para o Tipo de Processo escolhido é possível adicionar os Interessados do processo a ser aberto por meio da indicação de CPF ou CNPJ válidos, devendo complementar seus cadastros caso necessário.';  
24 - $strMsgTooltipInteressadoDigitadoNomeExistente = 'Para o Tipo de Processo escolhido é possível adicionar os Interessados do processo a ser aberto a partir da base de Interessados já existentes. Caso necessário, clique na Lupa "Localizar Interessados" para uma pesquisa mais detalhada ou, na janela aberta, acessar o botão "Cadastrar Novo Interessado".';  
25 - $strMsgTooltipTipoDocumentoPrincipal = 'Como somente pode ter um Documento Principal, o Tipo de Documento correspondente já é previamente definido. Deve, ainda, ser complementado no campo ao lado.';  
26 $strMsgTooltipTipoDocumento = 'Selecione o Tipo de Documento que melhor identifique o documento a ser carregado e complemente o Tipo no campo ao lado.'; 18 $strMsgTooltipTipoDocumento = 'Selecione o Tipo de Documento que melhor identifique o documento a ser carregado e complemente o Tipo no campo ao lado.';
27 $strMsgTooltipComplementoTipoDocumento = 'O Complemento do Tipo de Documento é o texto que completa a identificação do documento a ser carregado, adicionando ao nome do Tipo o texto que for digitado no referido campo (Tipo “Recurso” e Complemento “de 1ª Instância” identificará o documento como “Recurso de 1ª Instância”).\n\n\n Exemplos: O Complemento do Tipo “Nota” pode ser “Fiscal Eletrônica” ou “Fiscal nº 75/2016”. O Complemento do Tipo “Comprovante” pode ser “de Pagamento” ou “de Endereço”.'; 19 $strMsgTooltipComplementoTipoDocumento = 'O Complemento do Tipo de Documento é o texto que completa a identificação do documento a ser carregado, adicionando ao nome do Tipo o texto que for digitado no referido campo (Tipo “Recurso” e Complemento “de 1ª Instância” identificará o documento como “Recurso de 1ª Instância”).\n\n\n Exemplos: O Complemento do Tipo “Nota” pode ser “Fiscal Eletrônica” ou “Fiscal nº 75/2016”. O Complemento do Tipo “Comprovante” pode ser “de Pagamento” ou “de Endereço”.';
28 $strMsgTooltipNivelAcesso = 'O Nível de Acesso que for indicado é de sua exclusiva responsabilidade e estará condicionado à análise por servidor público, que poderá, motivadamente, alterá-lo a qualquer momento sem necessidade de prévio aviso.\n\n\n Selecione "Público" se no teor do documento a ser carregado não existir informações restritas. Se no teor do documento existir informações restritas, selecione "Restrito" e, em seguida, a Hipótese Legal correspondente.'; 20 $strMsgTooltipNivelAcesso = 'O Nível de Acesso que for indicado é de sua exclusiva responsabilidade e estará condicionado à análise por servidor público, que poderá, motivadamente, alterá-lo a qualquer momento sem necessidade de prévio aviso.\n\n\n Selecione "Público" se no teor do documento a ser carregado não existir informações restritas. Se no teor do documento existir informações restritas, selecione "Restrito" e, em seguida, a Hipótese Legal correspondente.';
@@ -32,8 +24,8 @@ @@ -32,8 +24,8 @@
32 $strMsgTooltipFormato = 'Selecione a opção “Nato-digital” se o arquivo a ser carregado foi criado originalmente em meio eletrônico.\n\n\n Selecione a opção “Digitalizado” somente se o arquivo a ser carregado foi produzido da digitalização de um documento em papel.'; 24 $strMsgTooltipFormato = 'Selecione a opção “Nato-digital” se o arquivo a ser carregado foi criado originalmente em meio eletrônico.\n\n\n Selecione a opção “Digitalizado” somente se o arquivo a ser carregado foi produzido da digitalização de um documento em papel.';
33 //Fim Msgs 25 //Fim Msgs
34 26
35 -  
36 - 27 + $selHipoteseLegal = MdPetIntercorrenteINT::montarSelectHipoteseLegal();
  28 +
37 //RN Tamanho Maximo Arquivo 29 //RN Tamanho Maximo Arquivo
38 $tamanhoMaximo = MdPetIntercorrenteINT::tamanhoMaximoArquivoPermitido(); 30 $tamanhoMaximo = MdPetIntercorrenteINT::tamanhoMaximoArquivoPermitido();
39 //Fim RN 31 //Fim RN
sei/web/modulos/peticionamento/md_pet_intercorrente_usu_ext_cadastro_js.php
@@ -13,6 +13,23 @@ @@ -13,6 +13,23 @@
13 function inicializar() { 13 function inicializar() {
14 iniciarGridDinamicaProcesso(); 14 iniciarGridDinamicaProcesso();
15 inicializarDocumento(); 15 inicializarDocumento();
  16 + document.getElementById("txtNumeroProcesso").addEventListener("keyup", controlarEnterValidarProcesso, false);
  17 +
  18 + <?php if( isset( $_POST['id_procedimento'] ) ) {
  19 +
  20 + $objEntradaConsultarProcedimentoAPI = new EntradaConsultarProcedimentoAPI();
  21 + $objEntradaConsultarProcedimentoAPI->setIdProcedimento( $_POST['id_procedimento'] );
  22 + $objSeiRN = new SeiRN();
  23 + $objSaidaConsultarProcedimentoAPI = $objSeiRN->consultarProcedimento( $objEntradaConsultarProcedimentoAPI );
  24 +
  25 + $numeroProcesso = $objSaidaConsultarProcedimentoAPI->getProcedimentoFormatado();
  26 + ?>
  27 +
  28 + document.getElementById('txtNumeroProcesso').value = '<?= $numeroProcesso ?>';
  29 + validarNumeroProcesso();
  30 + adicionarProcesso();
  31 +
  32 + <? } ?>
16 } 33 }
17 34
18 /** 35 /**
@@ -109,6 +126,7 @@ @@ -109,6 +126,7 @@
109 $.ajax({ 126 $.ajax({
110 url: '<?=$strUrlAjaxNumeroProcesso?>', 127 url: '<?=$strUrlAjaxNumeroProcesso?>',
111 type: 'POST', 128 type: 'POST',
  129 + async: false,
112 dataType: 'XML', 130 dataType: 'XML',
113 data: paramsAjax, 131 data: paramsAjax,
114 success: function (r) { 132 success: function (r) {
@@ -124,6 +142,7 @@ @@ -124,6 +142,7 @@
124 document.getElementById('btnAdicionar').style.display = ''; 142 document.getElementById('btnAdicionar').style.display = '';
125 document.getElementById('hdnProcessoIntercorrente').value = $(r).find('ProcessoIntercorrente').text(); 143 document.getElementById('hdnProcessoIntercorrente').value = $(r).find('ProcessoIntercorrente').text();
126 document.getElementById('urlValidaAssinaturaProcesso').value = $(r).find('UrlValida').text(); 144 document.getElementById('urlValidaAssinaturaProcesso').value = $(r).find('UrlValida').text();
  145 +
127 } 146 }
128 }, 147 },
129 error: function (e) { 148 error: function (e) {
@@ -192,14 +211,7 @@ @@ -192,14 +211,7 @@
192 return 'id_tipo_procedimento=' + document.getElementById('hdnIdTipoProcedimento').value; 211 return 'id_tipo_procedimento=' + document.getElementById('hdnIdTipoProcedimento').value;
193 }; 212 };
194 } 213 }
195 -  
196 - function iniciarObjAjaxSelectHipoteseLegal() {  
197 - objAjaxSelectHipoteseLegal = new infraAjaxMontarSelect('selHipoteseLegal', '<?= $strUrlAjaxMontarHipoteseLegal?>');  
198 - objAjaxSelectHipoteseLegal.processarResultado = function () {  
199 - return 'nivelAcesso=' + RESTRITO;  
200 - }  
201 - }  
202 - 214 +
203 function carregarFieldDocumentos() { 215 function carregarFieldDocumentos() {
204 216
205 //Combos que dependem do processo 217 //Combos que dependem do processo
@@ -212,7 +224,6 @@ @@ -212,7 +224,6 @@
212 } 224 }
213 225
214 function verificarCriterioIntercorrente() { 226 function verificarCriterioIntercorrente() {
215 -  
216 var paramsAjax = { 227 var paramsAjax = {
217 idTipoProcedimento: document.getElementById('hdnIdTipoProcedimento').value 228 idTipoProcedimento: document.getElementById('hdnIdTipoProcedimento').value
218 }; 229 };
@@ -220,22 +231,30 @@ @@ -220,22 +231,30 @@
220 $.ajax({ 231 $.ajax({
221 url: '<?=$strUrlAjaxCriterioIntercorrente?>', 232 url: '<?=$strUrlAjaxCriterioIntercorrente?>',
222 type: 'POST', 233 type: 'POST',
  234 + async: false,
223 dataType: 'JSON', 235 dataType: 'JSON',
224 data: paramsAjax, 236 data: paramsAjax,
225 success: function (r) { 237 success: function (r) {
226 if (r.nivelAcesso) { 238 if (r.nivelAcesso) {
227 criarHiddenNivelAcesso(r.nivelAcesso); 239 criarHiddenNivelAcesso(r.nivelAcesso);
  240 + if (EXIBIR_HIPOTESE_LEGAL && r.nivelAcesso.id == RESTRITO && r.hipoteseLegal) {
  241 + criarHiddenHipoteseLegal(r.hipoteseLegal);
  242 + }
228 } else { 243 } else {
229 criarSelectNivelAcesso(); 244 criarSelectNivelAcesso();
230 - } 245 + }
231 246
232 - if (EXIBIR_HIPOTESE_LEGAL) { 247 + /*
  248 + if (EXIBIR_HIPOTESE_LEGAL && r.nivelAcesso.id == RESTRITO) {
233 if (r.hipoteseLegal) { 249 if (r.hipoteseLegal) {
  250 + console.log('criando a hipotese legal hidden');
234 criarHiddenHipoteseLegal(r.hipoteseLegal); 251 criarHiddenHipoteseLegal(r.hipoteseLegal);
235 } else { 252 } else {
  253 + console.log('criando a hipotese legal html select');
236 criarSelectHipoteseLegal(); 254 criarSelectHipoteseLegal();
237 } 255 }
238 } 256 }
  257 + */
239 }, 258 },
240 error: function (e) { 259 error: function (e) {
241 console.error('Erro ao processar o AJAX do SEI: ' + e.responseText); 260 console.error('Erro ao processar o AJAX do SEI: ' + e.responseText);
@@ -285,25 +304,6 @@ @@ -285,25 +304,6 @@
285 divNivelAcesso.appendChild(hdnNivelAcesso); 304 divNivelAcesso.appendChild(hdnNivelAcesso);
286 } 305 }
287 306
288 - function criarSelectHipoteseLegal() {  
289 - var selHipoteseLegal = document.createElement("select");  
290 - var divHipoteseLegal = document.getElementById('divHipoteseLegal');  
291 - var divBlcHipoteseLegal = document.getElementById('divBlcHipoteseLegal');  
292 - var selNivelAcesso = document.getElementById('selNivelAcesso');  
293 -  
294 - divHipoteseLegal.innerHTML = '';  
295 - divBlcHipoteseLegal.style.display = 'none';  
296 - selHipoteseLegal.id = 'selHipoteseLegal';  
297 - selHipoteseLegal.name = 'selHipoteseLegal';  
298 - selHipoteseLegal.className = 'infraSelect';  
299 - selHipoteseLegal.tabIndex = selNivelAcesso.tabIndex + 1;  
300 -  
301 - divHipoteseLegal.appendChild(selHipoteseLegal);  
302 -  
303 - iniciarObjAjaxSelectHipoteseLegal();  
304 - objAjaxSelectHipoteseLegal.executar();  
305 - }  
306 -  
307 function criarHiddenHipoteseLegal(hipoteseLegal) { 307 function criarHiddenHipoteseLegal(hipoteseLegal) {
308 var lblHipoteseLegal = document.createElement('label'); 308 var lblHipoteseLegal = document.createElement('label');
309 var divBlcHipoteseLegal = document.getElementById('divBlcHipoteseLegal'); 309 var divBlcHipoteseLegal = document.getElementById('divBlcHipoteseLegal');
@@ -323,7 +323,7 @@ @@ -323,7 +323,7 @@
323 hdnHipoteseLegal.value = hipoteseLegal.id; 323 hdnHipoteseLegal.value = hipoteseLegal.id;
324 divHipoteseLegal.appendChild(hdnHipoteseLegal); 324 divHipoteseLegal.appendChild(hdnHipoteseLegal);
325 325
326 - divBlcHipoteseLegal.style.display = ''; 326 + divBlcHipoteseLegal.style.display = 'block';
327 } 327 }
328 328
329 329
@@ -451,13 +451,18 @@ @@ -451,13 +451,18 @@
451 document.getElementById('selNivelAcesso').focus(); 451 document.getElementById('selNivelAcesso').focus();
452 return false; 452 return false;
453 } 453 }
  454 + } else {
  455 + nivelAcesso = document.getElementById('hdnNivelAcesso');
454 } 456 }
  457 +
455 var selHipoteseLegal = document.getElementById('selHipoteseLegal'); 458 var selHipoteseLegal = document.getElementById('selHipoteseLegal');
456 459
457 - if (EXIBIR_HIPOTESE_LEGAL && nivelAcesso.value == RESTRITO && selHipoteseLegal && selHipoteseLegal.value == '') {  
458 - alert('Informe a Hipótese Legal');  
459 - selHipoteseLegal.focus();  
460 - return false; 460 + if (nivelAcesso.value == RESTRITO) {
  461 + if (selHipoteseLegal && selHipoteseLegal.value == '') {
  462 + alert('Informe a Hipótese Legal');
  463 + selHipoteseLegal.focus();
  464 + return false;
  465 + }
461 } 466 }
462 467
463 var formato = null; 468 var formato = null;
@@ -541,10 +546,9 @@ @@ -541,10 +546,9 @@
541 var complementoTipoDocumento = document.getElementById('txtComplementoTipoDocumento').value; 546 var complementoTipoDocumento = document.getElementById('txtComplementoTipoDocumento').value;
542 //var idNivelAcesso = nivelAcesso; 547 //var idNivelAcesso = nivelAcesso;
543 var idHipoteseLegal = ''; 548 var idHipoteseLegal = '';
544 - var selHipoteseLegal = document.getElementById('selHipoteseLegal');  
545 - if(selHipoteseLegal){  
546 - idHipoteseLegal = selHipoteseLegal.value;  
547 - } else { 549 + if(document.getElementById('selHipoteseLegal')){
  550 + idHipoteseLegal = document.getElementById('selHipoteseLegal').value;
  551 + } else if(document.getElementById('hdnHipoteseLegal')){
548 idHipoteseLegal = document.getElementById('hdnHipoteseLegal').value; 552 idHipoteseLegal = document.getElementById('hdnHipoteseLegal').value;
549 } 553 }
550 554
@@ -711,6 +715,28 @@ @@ -711,6 +715,28 @@
711 document.getElementById('btnAdicionar').style.display = 'none'; 715 document.getElementById('btnAdicionar').style.display = 'none';
712 } 716 }
713 717
  718 +
  719 + function controlarEnterValidarProcesso(e){
  720 + var focus = returnElementFocus();
  721 + if(infraGetCodigoTecla(e)==13) {
  722 + document.getElementById('btnValidar').onclick();
  723 + }
  724 + }
  725 +
  726 +
  727 + function returnElementFocus() {
  728 + var focused = document.activeElement;
  729 + if (!focused || focused == document.body) {
  730 + focused = null;
  731 + }
  732 + else if (document.querySelector){
  733 + focused = document.querySelector(":focus")
  734 + }
  735 +
  736 + return focused;
  737 + }
  738 +
  739 +
714 //===============================================================================================================// 740 //===============================================================================================================//
715 //--------------------------------------------- FIM DOCUMENTO ---------------------------------------------------// 741 //--------------------------------------------- FIM DOCUMENTO ---------------------------------------------------//
716 //===============================================================================================================// 742 //===============================================================================================================//
sei/web/modulos/peticionamento/md_pet_intercorrente_usu_ext_concluir.php
@@ -26,31 +26,19 @@ try { @@ -26,31 +26,19 @@ try {
26 //===================================================== 26 //=====================================================
27 27
28 //preenche a combo Função 28 //preenche a combo Função
29 - $objCargoDTO = new CargoDTO();  
30 - //seiv2  
31 - //$objCargoDTO->retTodos();  
32 -  
33 - //alteracoes seiv3  
34 - $objCargoDTO->retNumIdCargo();  
35 - $objCargoDTO->retStrExpressao();  
36 - $objCargoDTO->retStrSinAtivo();  
37 -  
38 - $objCargoDTO->setOrdStrExpressao(InfraDTO::$TIPO_ORDENACAO_ASC);  
39 -  
40 - $objCargoRN = new CargoRN();  
41 - $arrObjCargoDTO = $objCargoRN->listarRN0302($objCargoDTO);  
42 - 29 + $objMdPetCargoRN = new MdPetCargoRN();
  30 + $arrObjCargoDTO = $objMdPetCargoRN->listarDistintos();
  31 +
43 //===================================================== 32 //=====================================================
44 //FIM - VARIAVEIS PRINCIPAIS E LISTAS DA PAGINA 33 //FIM - VARIAVEIS PRINCIPAIS E LISTAS DA PAGINA
45 //===================================================== 34 //=====================================================
46 35
47 - 36 + $strTitulo = 'Concluir Peticionamento - Assinatura Eletrônica';
  37 +
48 switch($_GET['acao']){ 38 switch($_GET['acao']){
49 39
50 case 'md_pet_intercorrente_usu_ext_assinar': 40 case 'md_pet_intercorrente_usu_ext_assinar':
51 - $strTitulo = 'Concluir Peticionamento - Assinatura Eletrônica';  
52 break; 41 break;
53 -  
54 case 'md_pet_intercorrente_usu_ext_concluir': 42 case 'md_pet_intercorrente_usu_ext_concluir':
55 $objMdPetIntercorrenteProcessoRN = new MdPetIntercorrenteProcessoRN(); 43 $objMdPetIntercorrenteProcessoRN = new MdPetIntercorrenteProcessoRN();
56 $resultado = $objMdPetIntercorrenteProcessoRN->cadastrar($_POST); 44 $resultado = $objMdPetIntercorrenteProcessoRN->cadastrar($_POST);
@@ -124,7 +112,7 @@ $arrComandos[] = &#39;&lt;button type=&quot;button&quot; accesskey=&quot;a&quot; name=&quot;Assinar&quot; value=&quot;Assi @@ -124,7 +112,7 @@ $arrComandos[] = &#39;&lt;button type=&quot;button&quot; accesskey=&quot;a&quot; name=&quot;Assinar&quot; value=&quot;Assi
124 $arrComandos[] = '<button type="button" accesskey="c" name="btnFechar" value="Fechar" onclick="fecharJanela()" class="infraButton">Fe<span class="infraTeclaAtalho">c</span>har</button>'; 112 $arrComandos[] = '<button type="button" accesskey="c" name="btnFechar" value="Fechar" onclick="fecharJanela()" class="infraButton">Fe<span class="infraTeclaAtalho">c</span>har</button>';
125 $urlAssinada = SessaoSEIExterna::getInstance()->assinarLink('controlador_externo.php?acao=md_pet_intercorrente_usu_ext_concluir&id_procedimento='.$_REQUEST['id_procedimento'].'&id_tipo_procedimento='.$_REQUEST['id_tipo_procedimento'].'&acao_origem='.$_GET['acao']); 113 $urlAssinada = SessaoSEIExterna::getInstance()->assinarLink('controlador_externo.php?acao=md_pet_intercorrente_usu_ext_concluir&id_procedimento='.$_REQUEST['id_procedimento'].'&id_tipo_procedimento='.$_REQUEST['id_tipo_procedimento'].'&acao_origem='.$_GET['acao']);
126 ?> 114 ?>
127 -<form id="frmConcluir" method="post" action="<?=PaginaSEIExterna::getInstance()->formatarXHTML($urlAssinada)?>"> 115 +<form id="frmConcluir" method="post" onsubmit="return assinar();" action="<?=PaginaSEIExterna::getInstance()->formatarXHTML($urlAssinada)?>">
128 <? 116 <?
129 PaginaSEIExterna::getInstance()->montarBarraComandosSuperior($arrComandos); 117 PaginaSEIExterna::getInstance()->montarBarraComandosSuperior($arrComandos);
130 PaginaSEIExterna::getInstance()->abrirAreaDados('auto'); 118 PaginaSEIExterna::getInstance()->abrirAreaDados('auto');
@@ -196,11 +184,11 @@ function isValido(){ @@ -196,11 +184,11 @@ function isValido(){
196 var senha = document.getElementById("senhaSEI").value; 184 var senha = document.getElementById("senhaSEI").value;
197 185
198 if( cargo == ""){ 186 if( cargo == ""){
199 - alert('Favor informe o cargo.'); 187 + alert('Favor informe o Cargo/Função.');
200 document.getElementById("selCargo").focus(); 188 document.getElementById("selCargo").focus();
201 return false; 189 return false;
202 } else if( senha == ""){ 190 } else if( senha == ""){
203 - alert('Favor informe a senha'); 191 + alert('Favor informe a Senha.');
204 document.getElementById("senhaSEI").focus(); 192 document.getElementById("senhaSEI").focus();
205 return false; 193 return false;
206 } else { 194 } else {
@@ -212,8 +200,10 @@ function isValido(){ @@ -212,8 +200,10 @@ function isValido(){
212 function assinar(){ 200 function assinar(){
213 if( isValido() ) { 201 if( isValido() ) {
214 document.getElementById('hdnSubmit').value = '1'; 202 document.getElementById('hdnSubmit').value = '1';
  203 + processando();
215 document.getElementById('frmConcluir').submit(); 204 document.getElementById('frmConcluir').submit();
216 } 205 }
  206 + return false;
217 } 207 }
218 208
219 function assinar2(){ 209 function assinar2(){
@@ -413,4 +403,59 @@ function carregarTabelaDocumento() { @@ -413,4 +403,59 @@ function carregarTabelaDocumento() {
413 frm.appendChild(hdnTbDocumento); 403 frm.appendChild(hdnTbDocumento);
414 404
415 } 405 }
  406 +
  407 +function exibirBotaoCancelarAviso(){
  408 +
  409 + var div = document.getElementById('divInfraAvisoFundo');
  410 +
  411 + if (div!=null && div.style.visibility == 'visible'){
  412 +
  413 + var botaoCancelar = document.getElementById('btnInfraAvisoCancelar');
  414 +
  415 + if (botaoCancelar != null){
  416 + botaoCancelar.style.display = 'block';
  417 + }
  418 + }
  419 +}
  420 +
  421 +function exibirAvisoEditor(){
  422 +
  423 + var divFundo = document.getElementById('divInfraAvisoFundo');
  424 +
  425 + if (divFundo==null){
  426 + divFundo = infraAviso(false, 'Processando...');
  427 + }else{
  428 + document.getElementById('btnInfraAvisoCancelar').style.display = 'none';
  429 + document.getElementById('imgInfraAviso').src='/infra_css/imagens/aguarde.gif';
  430 + }
  431 +
  432 + if (INFRA_IE==0 || INFRA_IE>=7){
  433 + divFundo.style.position = 'fixed';
  434 + }
  435 +
  436 + var divAviso = document.getElementById('divInfraAviso');
  437 +
  438 + divAviso.style.top = Math.floor(infraClientHeight()/3) + 'px';
  439 + divAviso.style.left = Math.floor((infraClientWidth()-200)/2) + 'px';
  440 + divAviso.style.width = '200px';
  441 + divAviso.style.border = '1px solid black';
  442 +
  443 + divFundo.style.width = screen.width*2 + 'px';
  444 + divFundo.style.height = screen.height*2 + 'px';
  445 + divFundo.style.visibility = 'visible';
  446 +
  447 +}
  448 +
  449 +function processando() {
  450 +
  451 + exibirAvisoEditor();
  452 + timeoutExibirBotao = self.setTimeout('exibirBotaoCancelarAviso()',30000);
  453 +
  454 + if (INFRA_IE>0) {
  455 + window.tempoInicio=(new Date()).getTime();
  456 + } else {
  457 + console.time('s');
  458 + }
  459 +
  460 +}
416 </script> 461 </script>
417 \ No newline at end of file 462 \ No newline at end of file
sei/web/modulos/peticionamento/peticionamento_contato_selecionar.php
@@ -80,7 +80,8 @@ try { @@ -80,7 +80,8 @@ try {
80 80
81 $objRelUnidadeTipoContContatoDTO->retNumIdTipoContato(); 81 $objRelUnidadeTipoContContatoDTO->retNumIdTipoContato();
82 $objRelUnidadeTipoContContatoDTO->setNumIdUnidade(SessaoSEIExterna::getInstance()->getNumIdUnidadeAtual()); 82 $objRelUnidadeTipoContContatoDTO->setNumIdUnidade(SessaoSEIExterna::getInstance()->getNumIdUnidadeAtual());
83 - $arrTiposContextosUnidade = InfraArray::converterArrInfraDTO($objRelUnidadeTipoContContatoRN->listarRN0547($objRelUnidadeTipoContContatoDTO),'IdTipoContextoContato'); 83 + //$arrTiposContextosUnidade = InfraArray::converterArrInfraDTO($objRelUnidadeTipoContContatoRN->listarRN0547($objRelUnidadeTipoContContatoDTO),'IdTipoContextoContato');
  84 + $arrTiposContextosUnidade = InfraArray::converterArrInfraDTO($objRelUnidadeTipoContContatoRN->listarRN0547($objRelUnidadeTipoContContatoDTO),'IdTipoContato');
84 85
85 $objContatoDTO = new ContatoDTO(); 86 $objContatoDTO = new ContatoDTO();
86 $objContatoDTO->retNumIdContato(); 87 $objContatoDTO->retNumIdContato();
@@ -115,14 +116,21 @@ try { @@ -115,14 +116,21 @@ try {
115 //$objContatoDTO->retStrSinContexto(); 116 //$objContatoDTO->retStrSinContexto();
116 117
117 if (count($arrTiposContextosUnidade)) { 118 if (count($arrTiposContextosUnidade)) {
118 - $objContatoDTO->adicionarCriterio(array('SinLiberadoTipoContextoContatoContato', 'IdTipoContextoContatoContato'),  
119 - array(InfraDTO::$OPER_IGUAL, InfraDTO::$OPER_IN),  
120 - array('S', $arrTiposContextosUnidade),  
121 - InfraDTO::$OPER_LOGICO_OR);  
122 - }else{  
123 -  
124 //seiv2 119 //seiv2
125 - //$objContatoDTO->setStrSinLiberadoTipoContextoContatoContato('S'); 120 + //$objContatoDTO->adicionarCriterio(array('SinLiberadoTipoContextoContatoContato', 'IdTipoContextoContatoContato'),
  121 + // array(InfraDTO::$OPER_IGUAL, InfraDTO::$OPER_IN),
  122 + // array('S', $arrTiposContextosUnidade),
  123 + // InfraDTO::$OPER_LOGICO_OR);
  124 +
  125 + //Verificar se novo campo SinAtivoTipoContato ou outro substitui anterior SinLiberadoTipoContextoContatoContato
  126 + $objContatoDTO->adicionarCriterio(
  127 + array('IdTipoContato'),
  128 + array(InfraDTO::$OPER_IN),
  129 + array($arrTiposContextosUnidade)
  130 + );
  131 + //seiv2
  132 + //}else{
  133 + // $objContatoDTO->setStrSinLiberadoTipoContextoContatoContato('S');
126 } 134 }
127 135
128 //seiv2 136 //seiv2
@@ -162,7 +170,7 @@ try { @@ -162,7 +170,7 @@ try {
162 170
163 $numTipoContextoContato = PaginaSEIExterna::getInstance()->recuperarCampo('selTipoContextoContato'); 171 $numTipoContextoContato = PaginaSEIExterna::getInstance()->recuperarCampo('selTipoContextoContato');
164 if ($numTipoContextoContato!='' && $numTipoContextoContato!='null'){ 172 if ($numTipoContextoContato!='' && $numTipoContextoContato!='null'){
165 - $objContatoDTO->setNumIdTipoContextoContatoContato($numTipoContextoContato); 173 + $objContatoDTO->setNumIdTipoContato($numTipoContextoContato);
166 }else if(!empty($arrobjRelTipoContextoPeticionamentoDTO)){ 174 }else if(!empty($arrobjRelTipoContextoPeticionamentoDTO)){
167 $arrId = array(); 175 $arrId = array();
168 foreach($arrobjRelTipoContextoPeticionamentoDTO as $item){ 176 foreach($arrobjRelTipoContextoPeticionamentoDTO as $item){
@@ -577,54 +585,36 @@ PaginaSEIExterna::getInstance()-&gt;abrirBody($strTitulo,&#39;onload=&quot;inicializar();&quot;&#39;) @@ -577,54 +585,36 @@ PaginaSEIExterna::getInstance()-&gt;abrirBody($strTitulo,&#39;onload=&quot;inicializar();&quot;&#39;)
577 onchange="selecionarTipoContato()" 585 onchange="selecionarTipoContato()"
578 tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" > 586 tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" >
579 <option></option> 587 <option></option>
580 -  
581 - <?  
582 - //seiv2  
583 - //$objTipoContextoContatoRN = new TipoContextoContatoRN();  
584 -  
585 - //alteracoes seiv3  
586 - $objTipoContextoContatoRN = new TipoContatoRN();  
587 -  
588 -  
589 -  
590 -  
591 -  
592 -  
593 - foreach( $arrobjRelTipoContextoPeticionamentoDTO as $item ){  
594 - //seiv2  
595 - //$dto = new TipoContextoContatoDTO();  
596 -  
597 - //alteracoes seiv3  
598 - $dto = new TipoContatoDTO();  
599 -  
600 - //seiv2  
601 - //$dto->setNumIdTipoContextoContato( $item->getNumIdTipoContextoContato() );  
602 -  
603 - //alteracoes seiv3  
604 - $dto->setNumIdTipoContato( $item->getNumIdTipoContextoContato() );  
605 -  
606 - $dto->retTodos();  
607 - $dto = $objTipoContextoContatoRN->consultarRN0336( $dto );  
608 -  
609 - $selected = "";  
610 -  
611 - //seiv2  
612 - //if( $_POST['selTipoContextoContato'] == $item->getNumIdTipoContextoContato() ){  
613 - //alteracoes seiv3  
614 - if( $_POST['selTipoContextoContato'] == $item->getNumIdTipoContextoContato() ){  
615 - $selected = " selected='selected' ";  
616 - }  
617 -  
618 - //seiv2  
619 - //<option value="<*?= $item->getNumIdTipoContextoContato() ?*>" <*?= $selected ?*> >  
620 -  
621 - //alteracoes seiv3 588 + <?
  589 + if(!empty($arrobjRelTipoContextoPeticionamentoDTO)){
  590 +
  591 + $objTipoContatoDTO = new TipoContatoDTO();
  592 + $objTipoContatoRN = new TipoContatoRN();
  593 +
  594 + $objTipoContatoDTO->retStrSinSistema();
  595 + $objTipoContatoDTO->retNumIdTipoContato();
  596 + $objTipoContatoDTO->retStrNome();
  597 +
  598 + // Tipos permitidos
  599 + $arrRelTipoContextoPeticionamento = InfraArray::converterArrInfraDTO($arrobjRelTipoContextoPeticionamentoDTO,'IdTipoContextoContato');
  600 +
  601 + $objTipoContatoDTO->adicionarCriterio(array('IdTipoContato'),
  602 + array(InfraDTO::$OPER_IN),
  603 + array($arrRelTipoContextoPeticionamento)
  604 + );
  605 + $objTipoContatoDTO->setOrdStrNome(InfraDTO::$TIPO_ORDENACAO_ASC);
  606 + $objTipoContatoDTO = $objTipoContatoRN->listarRN0337( $objTipoContatoDTO );
  607 + foreach( $objTipoContatoDTO as $item ){
  608 + $selected = '';
  609 + if( $_POST['selTipoContextoContato'] == $item->getNumIdTipoContato() ){
  610 + $selected = 'SELECTED';
  611 + }
  612 + if( $item->getStrSinSistema != "S" ) {
  613 + echo "<option value='" . $item->getNumIdTipoContato() . "' " . $selected . ">" . $item->getStrNome() . "</option>";
  614 + }
  615 + }
  616 + }
622 ?> 617 ?>
623 - <option value="<?= $item->getNumIdTipoContextoContato() ?>" <?= $selected ?> >  
624 - <?= $dto->getStrNome() ?>  
625 - </option>  
626 - <? } ?>  
627 -  
628 </select> 618 </select>
629 619
630 <? 620 <?
sei/web/modulos/peticionamento/peticionamento_interessado_cadastro.php
@@ -319,6 +319,7 @@ try { @@ -319,6 +319,7 @@ try {
319 319
320 if( $janelaSelecaoPorNome == null || $janelaSelecaoPorNome == "" ){ 320 if( $janelaSelecaoPorNome == null || $janelaSelecaoPorNome == "" ){
321 echo "window.opener.document.getElementById('txtNomeRazaoSocial').value = '" . $nome . "';"; 321 echo "window.opener.document.getElementById('txtNomeRazaoSocial').value = '" . $nome . "';";
  322 + echo "window.opener.document.getElementById('txtNomeRazaoSocialTratadoHTML').value = '" .PaginaSEI::tratarHTML($nome) . "';";
322 echo "window.opener.document.getElementById('hdnCustomizado').value = 'true';"; 323 echo "window.opener.document.getElementById('hdnCustomizado').value = 'true';";
323 echo "window.opener.document.getElementById('hdnIdInteressadoCadastrado').value = " . $objContatoDTO->getNumIdContato() . ";"; 324 echo "window.opener.document.getElementById('hdnIdInteressadoCadastrado').value = " . $objContatoDTO->getNumIdContato() . ";";
324 } else { 325 } else {
sei/web/modulos/peticionamento/peticionamento_usuario_externo_cadastro.php
@@ -183,7 +183,8 @@ PaginaSEIExterna::getInstance()-&gt;abrirAreaDados(&#39;auto&#39;); @@ -183,7 +183,8 @@ PaginaSEIExterna::getInstance()-&gt;abrirAreaDados(&#39;auto&#39;);
183 </div> 183 </div>
184 184
185 <div style="width: auto;"> 185 <div style="width: auto;">
186 - 186 +
  187 + <input type="hidden" name="txtNomeRazaoSocialTratadoHTML" id="txtNomeRazaoSocialTratadoHTML" value=""/>
187 <input type="hidden" name="hdnIdInteressadoCadastrado" id="hdnIdInteressadoCadastrado" value="" /> 188 <input type="hidden" name="hdnIdInteressadoCadastrado" id="hdnIdInteressadoCadastrado" value="" />
188 <input type="hidden" name="hdnListaInteressadosIndicados" id="hdnListaInteressadosIndicados" value="" /> 189 <input type="hidden" name="hdnListaInteressadosIndicados" id="hdnListaInteressadosIndicados" value="" />
189 <input type="hidden" name="hdnCustomizado" id="hdnCustomizado" value="" /> 190 <input type="hidden" name="hdnCustomizado" id="hdnCustomizado" value="" />
sei/web/modulos/peticionamento/peticionamento_usuario_externo_cadastro_js.php
@@ -557,11 +557,11 @@ function receberInteressado( arrDadosInteressado, InteressadoCustomizado ){ @@ -557,11 +557,11 @@ function receberInteressado( arrDadosInteressado, InteressadoCustomizado ){
557 557
558 } 558 }
559 559
560 - debugger; 560 + var nomeInteressadoTratado = document.getElementById('txtNomeRazaoSocialTratadoHTML').value;
561 objTabelaInteressado.adicionar([ arrDadosInteressado[0], 561 objTabelaInteressado.adicionar([ arrDadosInteressado[0],
562 arrDadosInteressado[1] , 562 arrDadosInteressado[1] ,
563 - arrDadosInteressado[2] ,  
564 - arrDadosInteressado[3], 563 + arrDadosInteressado[2] ,
  564 + nomeInteressadoTratado,
565 '' ]); 565 '' ]);
566 if( InteressadoCustomizado != "" || strUsuarioLogado == arrDadosInteressado[4]) { 566 if( InteressadoCustomizado != "" || strUsuarioLogado == arrDadosInteressado[4]) {
567 567
@@ -1140,6 +1140,7 @@ function abrirCadastroInteressado(){ @@ -1140,6 +1140,7 @@ function abrirCadastroInteressado(){
1140 $('#hdnIdInteressadoCadastrado').val(obj.id); 1140 $('#hdnIdInteressadoCadastrado').val(obj.id);
1141 $('#txtNomeRazaoSocial').val(obj.nome); 1141 $('#txtNomeRazaoSocial').val(obj.nome);
1142 $('#hdnUsuarioCadastro').val(obj.usuario); 1142 $('#hdnUsuarioCadastro').val(obj.usuario);
  1143 + $('#txtNomeRazaoSocialTratadoHTML').val(obj.nomeTratado);
1143 $('#hdnCustomizado').val(''); 1144 $('#hdnCustomizado').val('');
1144 return; 1145 return;
1145 } 1146 }
@@ -1148,6 +1149,7 @@ function abrirCadastroInteressado(){ @@ -1148,6 +1149,7 @@ function abrirCadastroInteressado(){
1148 1149
1149 //charmar janela para cadastrar um novo interessado 1150 //charmar janela para cadastrar um novo interessado
1150 $('#txtNomeRazaoSocial').val(''); 1151 $('#txtNomeRazaoSocial').val('');
  1152 + $('#txtNomeRazaoSocialTratadoHTML').val('');
1151 $('#hdnCustomizado').val(''); 1153 $('#hdnCustomizado').val('');
1152 1154
1153 if( chkTipoPessoaFisica ){ 1155 if( chkTipoPessoaFisica ){
sei/web/modulos/peticionamento/peticionamento_usuario_externo_concluir.php
@@ -26,20 +26,9 @@ try { @@ -26,20 +26,9 @@ try {
26 //===================================================== 26 //=====================================================
27 27
28 //preenche a combo Função 28 //preenche a combo Função
29 - $objCargoDTO = new CargoDTO();  
30 - //seiv2  
31 - //$objCargoDTO->retTodos();  
32 -  
33 - //alteracoes seiv3  
34 - $objCargoDTO->retNumIdCargo();  
35 - $objCargoDTO->retStrExpressao();  
36 - $objCargoDTO->retStrSinAtivo();  
37 -  
38 - $objCargoDTO->setOrdStrExpressao(InfraDTO::$TIPO_ORDENACAO_ASC);  
39 -  
40 - $objCargoRN = new CargoRN();  
41 - $arrObjCargoDTO = $objCargoRN->listarRN0302($objCargoDTO);  
42 - 29 + $objMdPetCargoRN = new MdPetCargoRN();
  30 + $arrObjCargoDTO = $objMdPetCargoRN->listarDistintos();
  31 +
43 //===================================================== 32 //=====================================================
44 //FIM - VARIAVEIS PRINCIPAIS E LISTAS DA PAGINA 33 //FIM - VARIAVEIS PRINCIPAIS E LISTAS DA PAGINA
45 //===================================================== 34 //=====================================================
@@ -264,11 +253,11 @@ function isValido(){ @@ -264,11 +253,11 @@ function isValido(){
264 var senha = document.getElementById("senhaSEI").value; 253 var senha = document.getElementById("senhaSEI").value;
265 254
266 if( cargo == ""){ 255 if( cargo == ""){
267 - alert('Favor informe o cargo.'); 256 + alert('Favor informe o Cargo/Função.');
268 document.getElementById("selCargo").focus(); 257 document.getElementById("selCargo").focus();
269 return false; 258 return false;
270 } else if( senha == ""){ 259 } else if( senha == ""){
271 - alert('Favor informe a senha'); 260 + alert('Favor informe a Senha.');
272 document.getElementById("senhaSEI").focus(); 261 document.getElementById("senhaSEI").focus();
273 return false; 262 return false;
274 } else { 263 } else {
@@ -408,6 +397,8 @@ function assinar(){ @@ -408,6 +397,8 @@ function assinar(){
408 document.getElementById('hdnDocComplementar').value = hdnDocComplementar.value; 397 document.getElementById('hdnDocComplementar').value = hdnDocComplementar.value;
409 } 398 }
410 399
  400 + processando();
  401 +
411 document.getElementById('frmConcluir').submit(); 402 document.getElementById('frmConcluir').submit();
412 403
413 } 404 }
@@ -456,7 +447,58 @@ function fecharJanela(){ @@ -456,7 +447,58 @@ function fecharJanela(){
456 window.close(); 447 window.close();
457 } 448 }
458 449
459 -function OnSubmitForm() {  
460 - return isValido();  
461 -} 450 +function exibirBotaoCancelarAviso(){
  451 +
  452 + var div = document.getElementById('divInfraAvisoFundo');
  453 +
  454 + if (div!=null && div.style.visibility == 'visible'){
  455 +
  456 + var botaoCancelar = document.getElementById('btnInfraAvisoCancelar');
  457 +
  458 + if (botaoCancelar != null){
  459 + botaoCancelar.style.display = 'block';
  460 + }
  461 + }
  462 +}
  463 +
  464 +function exibirAvisoEditor(){
  465 +
  466 + var divFundo = document.getElementById('divInfraAvisoFundo');
  467 +
  468 + if (divFundo==null){
  469 + divFundo = infraAviso(false, 'Processando...');
  470 + }else{
  471 + document.getElementById('btnInfraAvisoCancelar').style.display = 'none';
  472 + document.getElementById('imgInfraAviso').src='/infra_css/imagens/aguarde.gif';
  473 + }
  474 +
  475 + if (INFRA_IE==0 || INFRA_IE>=7){
  476 + divFundo.style.position = 'fixed';
  477 + }
  478 +
  479 + var divAviso = document.getElementById('divInfraAviso');
  480 +
  481 + divAviso.style.top = Math.floor(infraClientHeight()/3) + 'px';
  482 + divAviso.style.left = Math.floor((infraClientWidth()-200)/2) + 'px';
  483 + divAviso.style.width = '200px';
  484 + divAviso.style.border = '1px solid black';
  485 +
  486 + divFundo.style.width = screen.width*2 + 'px';
  487 + divFundo.style.height = screen.height*2 + 'px';
  488 + divFundo.style.visibility = 'visible';
  489 +
  490 +}
  491 +
  492 +function processando() {
  493 +
  494 + exibirAvisoEditor();
  495 + timeoutExibirBotao = self.setTimeout('exibirBotaoCancelarAviso()',30000);
  496 +
  497 + if (INFRA_IE>0) {
  498 + window.tempoInicio=(new Date()).getTime();
  499 + } else {
  500 + console.time('s');
  501 + }
  502 +
  503 +}
462 </script> 504 </script>
463 \ No newline at end of file 505 \ No newline at end of file
sei/web/modulos/peticionamento/recibo_peticionamento_intercorrente_usuario_externo_consulta.php
@@ -71,9 +71,10 @@ try { @@ -71,9 +71,10 @@ try {
71 $objReciboPeticionamentoDTO = new ReciboPeticionamentoDTO(); 71 $objReciboPeticionamentoDTO = new ReciboPeticionamentoDTO();
72 $objReciboPeticionamentoDTO->setNumIdReciboPeticionamento($_GET['id_md_pet_rel_recibo_protoc']); 72 $objReciboPeticionamentoDTO->setNumIdReciboPeticionamento($_GET['id_md_pet_rel_recibo_protoc']);
73 $objReciboPeticionamentoDTO->retNumIdProtocolo(); 73 $objReciboPeticionamentoDTO->retNumIdProtocolo();
  74 + $objReciboPeticionamentoDTO->retDblIdDocumento();
74 $objReciboPeticionamentoRN = new ReciboPeticionamentoRN(); 75 $objReciboPeticionamentoRN = new ReciboPeticionamentoRN();
75 $objReciboPeticionamentoDTO = $objReciboPeticionamentoRN->consultar($objReciboPeticionamentoDTO); 76 $objReciboPeticionamentoDTO = $objReciboPeticionamentoRN->consultar($objReciboPeticionamentoDTO);
76 - 77 +
77 $objProtocoloDTO = new ProtocoloDTO(); 78 $objProtocoloDTO = new ProtocoloDTO();
78 $objProtocoloDTO->retDblIdProtocolo(); 79 $objProtocoloDTO->retDblIdProtocolo();
79 $objProtocoloDTO->setDblIdProtocolo($objReciboPeticionamentoDTO->getNumIdProtocolo()); 80 $objProtocoloDTO->setDblIdProtocolo($objReciboPeticionamentoDTO->getNumIdProtocolo());
@@ -87,11 +88,10 @@ try { @@ -87,11 +88,10 @@ try {
87 $documentoRN = new DocumentoRN(); 88 $documentoRN = new DocumentoRN();
88 $documentoReciboDTO = new DocumentoDTO(); 89 $documentoReciboDTO = new DocumentoDTO();
89 $documentoReciboDTO->retStrProtocoloDocumentoFormatado(); 90 $documentoReciboDTO->retStrProtocoloDocumentoFormatado();
90 - $documentoReciboDTO->setDblIdProcedimento( $objReciboPeticionamentoDTO->getNumIdProtocolo() );  
91 - $documentoReciboDTO->setNumIdSerie( $idSerieParam );  
92 - $documentoReciboDTO->setDblIdDocumento( $_GET['id_documento'] ); 91 + $documentoReciboDTO->setDblIdDocumento( $objReciboPeticionamentoDTO->getDblIdDocumento() );
  92 +
93 $documentoReciboDTO = $documentoRN->consultarRN0005( $documentoReciboDTO ); 93 $documentoReciboDTO = $documentoRN->consultarRN0005( $documentoReciboDTO );
94 - 94 +
95 if( $documentoReciboDTO != null ){ 95 if( $documentoReciboDTO != null ){
96 $strTitulo = 'Recibo Eletrônico de Protocolo - SEI n° ' . $documentoReciboDTO->getStrProtocoloDocumentoFormatado(); 96 $strTitulo = 'Recibo Eletrônico de Protocolo - SEI n° ' . $documentoReciboDTO->getStrProtocoloDocumentoFormatado();
97 } else { 97 } else {
@@ -265,10 +265,10 @@ PaginaSEIExterna::getInstance()-&gt;abrirJavaScript(); @@ -265,10 +265,10 @@ PaginaSEIExterna::getInstance()-&gt;abrirJavaScript();
265 265
266 <div style="height:auto; margin-top: 11px;" class="infraAreaDados" id="divInfraAreaDados"> 266 <div style="height:auto; margin-top: 11px;" class="infraAreaDados" id="divInfraAreaDados">
267 267
268 - <table align="center" style="width: 90%" border="0"> 268 + <table align="center" style="width: 95%" border="0">
269 269
270 <tr> 270 <tr>
271 - <td style="font-weight: bold; width: 300px;">Usuário Externo (signatário):</td> 271 + <td style="font-weight: bold; width: 400px;">Usuário Externo (signatário):</td>
272 <td><?= $usuarioDTO->getStrNome() ?></td> 272 <td><?= $usuarioDTO->getStrNome() ?></td>
273 </tr> 273 </tr>
274 274
sei/web/modulos/peticionamento/recibo_peticionamento_usuario_externo_consulta.php
@@ -71,6 +71,7 @@ try { @@ -71,6 +71,7 @@ try {
71 $objReciboPeticionamentoDTO = new ReciboPeticionamentoDTO(); 71 $objReciboPeticionamentoDTO = new ReciboPeticionamentoDTO();
72 $objReciboPeticionamentoDTO->setNumIdReciboPeticionamento($_GET['id_md_pet_rel_recibo_protoc']); 72 $objReciboPeticionamentoDTO->setNumIdReciboPeticionamento($_GET['id_md_pet_rel_recibo_protoc']);
73 $objReciboPeticionamentoDTO->retNumIdProtocolo(); 73 $objReciboPeticionamentoDTO->retNumIdProtocolo();
  74 + $objReciboPeticionamentoDTO->retDblIdDocumento();
74 $objReciboPeticionamentoRN = new ReciboPeticionamentoRN(); 75 $objReciboPeticionamentoRN = new ReciboPeticionamentoRN();
75 $objReciboPeticionamentoDTO = $objReciboPeticionamentoRN->consultar($objReciboPeticionamentoDTO); 76 $objReciboPeticionamentoDTO = $objReciboPeticionamentoRN->consultar($objReciboPeticionamentoDTO);
76 77
@@ -87,8 +88,7 @@ try { @@ -87,8 +88,7 @@ try {
87 $documentoRN = new DocumentoRN(); 88 $documentoRN = new DocumentoRN();
88 $documentoReciboDTO = new DocumentoDTO(); 89 $documentoReciboDTO = new DocumentoDTO();
89 $documentoReciboDTO->retStrProtocoloDocumentoFormatado(); 90 $documentoReciboDTO->retStrProtocoloDocumentoFormatado();
90 - $documentoReciboDTO->setDblIdProcedimento( $objReciboPeticionamentoDTO->getNumIdProtocolo() );  
91 - $documentoReciboDTO->setNumIdSerie( $idSerieParam ); 91 + $documentoReciboDTO->setDblIdDocumento( $objReciboPeticionamentoDTO->getDblIdDocumento() );
92 $documentoReciboDTO = $documentoRN->consultarRN0005( $documentoReciboDTO ); 92 $documentoReciboDTO = $documentoRN->consultarRN0005( $documentoReciboDTO );
93 93
94 if( $documentoReciboDTO != null ){ 94 if( $documentoReciboDTO != null ){
@@ -275,10 +275,10 @@ try { @@ -275,10 +275,10 @@ try {
275 275
276 <div style="height:auto; margin-top: 11px;" class="infraAreaDados" id="divInfraAreaDados"> 276 <div style="height:auto; margin-top: 11px;" class="infraAreaDados" id="divInfraAreaDados">
277 277
278 - <table align="center" style="width: 90%" border="0"> 278 + <table align="center" style="width: 95%" border="0">
279 279
280 <tr> 280 <tr>
281 - <td style="font-weight: bold; width: 300px;">Usuário Externo (signatário):</td> 281 + <td style="font-weight: bold; width: 400px;">Usuário Externo (signatário):</td>
282 <td><?= $usuarioDTO->getStrNome() ?></td> 282 <td><?= $usuarioDTO->getStrNome() ?></td>
283 </tr> 283 </tr>
284 284
@@ -308,7 +308,7 @@ try { @@ -308,7 +308,7 @@ try {
308 </tr> 308 </tr>
309 <?php foreach ($arrInteressados as $interessado) : ?> 309 <?php foreach ($arrInteressados as $interessado) : ?>
310 <tr> 310 <tr>
311 - <td colspan="2">&nbsp&nbsp&nbsp&nbsp<?= $interessado->getStrNome() ?></td> 311 + <td colspan="2">&nbsp&nbsp&nbsp&nbsp<?= PaginaSEI::tratarHTML($interessado->getStrNome()) ?></td>
312 </tr> 312 </tr>
313 <?php endforeach; ?> 313 <?php endforeach; ?>
314 <?php endif; ?> 314 <?php endif; ?>
sei/web/modulos/peticionamento/recibo_peticionamento_usuario_externo_lista.php
@@ -57,7 +57,8 @@ try { @@ -57,7 +57,8 @@ try {
57 $bolAcaoCadastrar = SessaoSEIExterna::getInstance()->verificarPermissao('recibo_peticionamento_usuario_externo_cadastrar'); 57 $bolAcaoCadastrar = SessaoSEIExterna::getInstance()->verificarPermissao('recibo_peticionamento_usuario_externo_cadastrar');
58 58
59 $objReciboPeticionamentoDTO = new ReciboPeticionamentoDTO(); 59 $objReciboPeticionamentoDTO = new ReciboPeticionamentoDTO();
60 - $objReciboPeticionamentoDTO->retTodos(); 60 + $objReciboPeticionamentoDTO->retTodos( );
  61 + $objReciboPeticionamentoDTO->retStrNumeroProcessoFormatadoDoc();
61 62
62 $objInfraParametro = new InfraParametro(BancoSEI::getInstance()); 63 $objInfraParametro = new InfraParametro(BancoSEI::getInstance());
63 $strVersaoModuloPeticionamento = $objInfraParametro->getValor('VERSAO_MODULO_PETICIONAMENTO', false); 64 $strVersaoModuloPeticionamento = $objInfraParametro->getValor('VERSAO_MODULO_PETICIONAMENTO', false);
@@ -105,8 +106,9 @@ try { @@ -105,8 +106,9 @@ try {
105 $strResultado .= '<caption class="infraCaption">'.PaginaSEIExterna::getInstance()->gerarCaptionTabela($strCaptionTabela,$numRegistros).'</caption>'; 106 $strResultado .= '<caption class="infraCaption">'.PaginaSEIExterna::getInstance()->gerarCaptionTabela($strCaptionTabela,$numRegistros).'</caption>';
106 $strResultado .= '<tr>'; 107 $strResultado .= '<tr>';
107 108
108 - $strResultado .= '<th class="infraTh" width="20%">'.PaginaSEIExterna::getInstance()->getThOrdenacao($objReciboPeticionamentoDTO,'Data e Horário','DataHoraRecebimentoFinal',$arrObjReciboPeticionamentoDTO).'</th>'."\n";  
109 - $strResultado .= '<th class="infraTh" width="30%">'.PaginaSEIExterna::getInstance()->getThOrdenacao($objReciboPeticionamentoDTO,'Número do Processo','NumeroProcessoFormatado',$arrObjReciboPeticionamentoDTO).'</th>'."\n"; 109 + $strResultado .= '<th class="infraTh" width="15%">'.PaginaSEIExterna::getInstance()->getThOrdenacao($objReciboPeticionamentoDTO,'Data e Horário','DataHoraRecebimentoFinal',$arrObjReciboPeticionamentoDTO).'</th>'."\n";
  110 + $strResultado .= '<th class="infraTh" width="20%">'.PaginaSEIExterna::getInstance()->getThOrdenacao($objReciboPeticionamentoDTO,'Número do Processo','NumeroProcessoFormatado',$arrObjReciboPeticionamentoDTO).'</th>'."\n";
  111 + $strResultado .= '<th class="infraTh" width="15%">'.PaginaSEIExterna::getInstance()->getThOrdenacao($objReciboPeticionamentoDTO,'Recibo','NumeroProcessoFormatadoDoc',$arrObjReciboPeticionamentoDTO).'</th>'."\n";
110 $strResultado .= '<th class="infraTh" width="30%">'.PaginaSEIExterna::getInstance()->getThOrdenacao($objReciboPeticionamentoDTO,'Tipo de Peticionamento','TipoPeticionamento',$arrObjReciboPeticionamentoDTO).'</th>'."\n"; 112 $strResultado .= '<th class="infraTh" width="30%">'.PaginaSEIExterna::getInstance()->getThOrdenacao($objReciboPeticionamentoDTO,'Tipo de Peticionamento','TipoPeticionamento',$arrObjReciboPeticionamentoDTO).'</th>'."\n";
111 $strResultado .= '<th class="infraTh" width="15%">Ações</th>'."\n"; 113 $strResultado .= '<th class="infraTh" width="15%">Ações</th>'."\n";
112 $strResultado .= '</tr>'."\n"; 114 $strResultado .= '</tr>'."\n";
@@ -147,6 +149,8 @@ try { @@ -147,6 +149,8 @@ try {
147 $strResultado .= '<td></td>'; 149 $strResultado .= '<td></td>';
148 } 150 }
149 151
  152 + $strResultado .= '<td>' . $arrObjReciboPeticionamentoDTO[$i]->getStrNumeroProcessoFormatadoDoc() .'</td>';
  153 +
150 $strResultado .= '<td>' . $arrObjReciboPeticionamentoDTO[$i]->getStrStaTipoPeticionamentoFormatado() .'</td>'; 154 $strResultado .= '<td>' . $arrObjReciboPeticionamentoDTO[$i]->getStrStaTipoPeticionamentoFormatado() .'</td>';
151 155
152 $strResultado .= '<td align="center">'; 156 $strResultado .= '<td align="center">';
sei/web/modulos/peticionamento/rn/AtualizadorModuloPeticionamentoRN.php
@@ -78,7 +78,7 @@ class AtualizadorModuloPeticionamentoRN extends InfraRN @@ -78,7 +78,7 @@ class AtualizadorModuloPeticionamentoRN extends InfraRN
78 die; 78 die;
79 } 79 }
80 80
81 - //Contem atualizações da versao 1.1.0 81 + //Contem atualizações da versao 1.1.0 (Intercorrente)
82 protected function instalarv110() 82 protected function instalarv110()
83 { 83 {
84 try { 84 try {
@@ -122,6 +122,49 @@ class AtualizadorModuloPeticionamentoRN extends InfraRN @@ -122,6 +122,49 @@ class AtualizadorModuloPeticionamentoRN extends InfraRN
122 $objInfraMetaBD->adicionarChaveEstrangeira('fk5_md_pet_rel_recibo_protoc', 'md_pet_rel_recibo_protoc', array('id_protocolo_relacionado'), 'protocolo', array('id_protocolo')); 122 $objInfraMetaBD->adicionarChaveEstrangeira('fk5_md_pet_rel_recibo_protoc', 'md_pet_rel_recibo_protoc', array('id_protocolo_relacionado'), 'protocolo', array('id_protocolo'));
123 123
124 } 124 }
  125 +
  126 + //coluna id_documento na tabela de recibo
  127 + $objInfraMetaBD->adicionarColuna('md_pet_rel_recibo_protoc', 'id_documento', '' . $objInfraMetaBD->tipoNumeroGrande() , 'NULL');
  128 + $objInfraMetaBD->adicionarChaveEstrangeira('fk6_md_pet_rel_recibo_protoc', 'md_pet_rel_recibo_protoc', array('id_documento'), 'documento', array('id_documento'));
  129 +
  130 + //Atualizando dados da tabela
  131 + $objInfraParametro = new InfraParametro(BancoSEI::getInstance());
  132 + $ret = $objInfraParametro->listarValores(array('ID_SERIE_RECIBO_MODULO_PETICIONAMENTO'), false);
  133 +
  134 + $arrObjInfraParametroDTO = NULL;
  135 + $idSeriePet = array_key_exists('ID_SERIE_RECIBO_MODULO_PETICIONAMENTO' , $ret) ? $ret['ID_SERIE_RECIBO_MODULO_PETICIONAMENTO'] : null;
  136 +
  137 + if($idSeriePet){
  138 + $arrObjDocumentDTO = array();
  139 +
  140 + $objDocumentoDTO = new DocumentoDTO();
  141 + $objDocumentoDTO->retDblIdDocumento();
  142 + $objDocumentoDTO->retDblIdProcedimento();
  143 + $objDocumentoDTO->setNumIdSerie($idSeriePet);
  144 + $objDocumentoRN = new DocumentoRN();
  145 + $countDoc = $objDocumentoRN->contarRN0007($objDocumentoDTO);
  146 +
  147 + if ($countDoc > 0) {
  148 + $arrObjDocumentDTO = $objDocumentoRN->listarRN0008($objDocumentoDTO);
  149 + foreach ($arrObjDocumentDTO as $objDocumentoDTO) {
  150 + $objReciboPeticionamentoDTO = new ReciboPeticionamentoDTO();
  151 + $objReciboPeticionamentoRN = new ReciboPeticionamentoRN();
  152 + $objReciboPeticionamentoDTO->setNumIdProtocolo($objDocumentoDTO->getDblIdProcedimento());
  153 + $objReciboPeticionamentoDTO->setDblIdDocumento($objDocumentoDTO->getDblIdDocumento());
  154 + $objReciboPeticionamentoDTO->retNumIdReciboPeticionamento();
  155 + $arrObjReciboPeticionamentoDTO = $objReciboPeticionamentoRN->listar($objReciboPeticionamentoDTO);
  156 +
  157 + foreach ($arrObjReciboPeticionamentoDTO as $objDTO){
  158 + $objReciboPeticionamentoRN->alterar($objDTO);
  159 + }
  160 + }
  161 + }
  162 +
  163 + }
  164 +
  165 +
  166 +
  167 +
125 168
126 //Atualizando parametro para controlar versao do modulo 169 //Atualizando parametro para controlar versao do modulo
127 $this->logar('ATUALIZANDO PARAMETRO ' . $this->nomeParametroModulo . ' NA TABELA infra_parametro PARA CONTROLAR A VERSÃO DO MÓDULO'); 170 $this->logar('ATUALIZANDO PARAMETRO ' . $this->nomeParametroModulo . ' NA TABELA infra_parametro PARA CONTROLAR A VERSÃO DO MÓDULO');
sei/web/modulos/peticionamento/rn/CriterioIntercorrentePeticionamentoRN.php
@@ -345,10 +345,10 @@ class CriterioIntercorrentePeticionamentoRN extends InfraRN @@ -345,10 +345,10 @@ class CriterioIntercorrentePeticionamentoRN extends InfraRN
345 345
346 private function _retornaValorParametroHipoteseLegal(){ 346 private function _retornaValorParametroHipoteseLegal(){
347 $objInfraParametroDTO = new InfraParametroDTO(); 347 $objInfraParametroDTO = new InfraParametroDTO();
348 - $objInfraParametroRN = new InfraParametroRN(); 348 + $objMdPetParametroRN = new MdPetParametroRN();
349 $objInfraParametroDTO->retTodos(); 349 $objInfraParametroDTO->retTodos();
350 $objInfraParametroDTO->setStrNome('SEI_HABILITAR_HIPOTESE_LEGAL'); 350 $objInfraParametroDTO->setStrNome('SEI_HABILITAR_HIPOTESE_LEGAL');
351 - $objInfraParametroDTO = $objInfraParametroRN->consultar($objInfraParametroDTO); 351 + $objInfraParametroDTO = $objMdPetParametroRN->consultar($objInfraParametroDTO);
352 $valorParametroHipoteseLegal = $objInfraParametroDTO->getStrValor(); 352 $valorParametroHipoteseLegal = $objInfraParametroDTO->getStrValor();
353 return $valorParametroHipoteseLegal; 353 return $valorParametroHipoteseLegal;
354 } 354 }
sei/web/modulos/peticionamento/rn/EmailNotificacaoPetIntercorrenteRN.php
@@ -67,7 +67,10 @@ class EmailNotificacaoPetIntercorrenteRN extends EmailNotificacaoPeticionamentoR @@ -67,7 +67,10 @@ class EmailNotificacaoPetIntercorrenteRN extends EmailNotificacaoPeticionamentoR
67 //variaveis basicas em uso no email 67 //variaveis basicas em uso no email
68 //$linkLoginUsuarioExterno = $objOrgaoDTO->getStrSitioInternet(); 68 //$linkLoginUsuarioExterno = $objOrgaoDTO->getStrSitioInternet();
69 //$linkLoginUsuarioExterno = $this->getObjInfraSessao()->getStrPaginaLogin() 69 //$linkLoginUsuarioExterno = $this->getObjInfraSessao()->getStrPaginaLogin()
70 - $linkLoginUsuarioExterno = SessaoSEIExterna::getInstance()->getStrPaginaLogin(); 70 + //$linkLoginUsuarioExterno = SessaoSEIExterna::getInstance()->getStrPaginaLogin();
  71 + $linkLoginUsuarioExterno = SessaoSEIExterna::getInstance()->getStrPaginaLogin() . '&id_orgao_acesso_externo=0';
  72 +
  73 +
71 $strNomeTipoProcedimento = $objProcedimentoDTO->getStrNomeTipoProcedimento(); 74 $strNomeTipoProcedimento = $objProcedimentoDTO->getStrNomeTipoProcedimento();
72 $strProtocoloFormatado = $objProcedimentoDTO->getStrProtocoloProcedimentoFormatado(); 75 $strProtocoloFormatado = $objProcedimentoDTO->getStrProtocoloProcedimentoFormatado();
73 $strSiglaUnidade = $objUnidadeDTO->getStrSigla(); 76 $strSiglaUnidade = $objUnidadeDTO->getStrSigla();
@@ -199,7 +202,7 @@ class EmailNotificacaoPetIntercorrenteRN extends EmailNotificacaoPeticionamentoR @@ -199,7 +202,7 @@ class EmailNotificacaoPetIntercorrenteRN extends EmailNotificacaoPeticionamentoR
199 202
200 $strAssunto = $objEmailSistemaDTO->getStrAssunto(); 203 $strAssunto = $objEmailSistemaDTO->getStrAssunto();
201 $strAssunto = str_replace('@sigla_orgao@',$objOrgaoDTO->getStrSigla(), $strAssunto); 204 $strAssunto = str_replace('@sigla_orgao@',$objOrgaoDTO->getStrSigla(), $strAssunto);
202 - $strAssunto = str_replace('@processo@', $documentoDTO->getStrProtocoloDocumentoFormatado() , $strAssunto); 205 + $strAssunto = str_replace('@processo@', $objProcedimentoDTO->getStrProtocoloProcedimentoFormatado() , $strAssunto);
203 206
204 $strConteudo = $objEmailSistemaDTO->getStrConteudo(); 207 $strConteudo = $objEmailSistemaDTO->getStrConteudo();
205 208
sei/web/modulos/peticionamento/rn/EmailNotificacaoPeticionamentoRN.php
@@ -67,7 +67,10 @@ class EmailNotificacaoPeticionamentoRN extends InfraRN { @@ -67,7 +67,10 @@ class EmailNotificacaoPeticionamentoRN extends InfraRN {
67 //variaveis basicas em uso no email 67 //variaveis basicas em uso no email
68 //$linkLoginUsuarioExterno = $objOrgaoDTO->getStrSitioInternet(); 68 //$linkLoginUsuarioExterno = $objOrgaoDTO->getStrSitioInternet();
69 //$linkLoginUsuarioExterno = $this->getObjInfraSessao()->getStrPaginaLogin() 69 //$linkLoginUsuarioExterno = $this->getObjInfraSessao()->getStrPaginaLogin()
70 - $linkLoginUsuarioExterno = SessaoSEIExterna::getInstance()->getStrPaginaLogin(); 70 + //$linkLoginUsuarioExterno = SessaoSEIExterna::getInstance()->getStrPaginaLogin();
  71 + $linkLoginUsuarioExterno = SessaoSEIExterna::getInstance()->getStrPaginaLogin() . '&id_orgao_acesso_externo=0';
  72 +
  73 +
71 $strNomeTipoProcedimento = $objProcedimentoDTO->getStrNomeTipoProcedimento(); 74 $strNomeTipoProcedimento = $objProcedimentoDTO->getStrNomeTipoProcedimento();
72 $strProtocoloFormatado = $objProcedimentoDTO->getStrProtocoloProcedimentoFormatado(); 75 $strProtocoloFormatado = $objProcedimentoDTO->getStrProtocoloProcedimentoFormatado();
73 $strSiglaUnidade = $objUnidadeDTO->getStrSigla(); 76 $strSiglaUnidade = $objUnidadeDTO->getStrSigla();
@@ -152,6 +155,7 @@ class EmailNotificacaoPeticionamentoRN extends InfraRN { @@ -152,6 +155,7 @@ class EmailNotificacaoPeticionamentoRN extends InfraRN {
152 $strConteudo = str_replace('@email_usuario_externo@', $strEmailContato ,$strConteudo); 155 $strConteudo = str_replace('@email_usuario_externo@', $strEmailContato ,$strConteudo);
153 $strConteudo = str_replace('@link_login_usuario_externo@', $linkLoginUsuarioExterno , $strConteudo); 156 $strConteudo = str_replace('@link_login_usuario_externo@', $linkLoginUsuarioExterno , $strConteudo);
154 157
  158 +
155 if ($reciboDTOBasico->getStrStaTipoPeticionamento()=="N"){ 159 if ($reciboDTOBasico->getStrStaTipoPeticionamento()=="N"){
156 $strConteudo = str_replace('@tipo_peticionamento@',"Processo Novo",$strConteudo); 160 $strConteudo = str_replace('@tipo_peticionamento@',"Processo Novo",$strConteudo);
157 }else if ($reciboDTOBasico->getStrStaTipoPeticionamento()=="I"){ 161 }else if ($reciboDTOBasico->getStrStaTipoPeticionamento()=="I"){
sei/web/modulos/peticionamento/rn/GerirTipoContextoPeticionamentoRN.php
@@ -120,11 +120,11 @@ class GerirTipoContextoPeticionamentoRN extends InfraRN { @@ -120,11 +120,11 @@ class GerirTipoContextoPeticionamentoRN extends InfraRN {
120 $arrIdTipo = array(); 120 $arrIdTipo = array();
121 121
122 foreach( $arrRelTipoContextoPeticionamentoDTO as $itemDTO ){ 122 foreach( $arrRelTipoContextoPeticionamentoDTO as $itemDTO ){
123 -  
124 - $idTipo = $itemDTO->getNumIdTipoContextoContato();  
125 - array_push( $arrIdTipo , $idTipo); 123 + //$idTipo = $itemDTO->getNumIdTipoContextoContato();
  124 + //array_push( $arrIdTipo , $idTipo);
  125 + array_push( $arrIdTipo , $itemDTO);
126 } 126 }
127 - 127 +
128 $objTipoContatoRN = new TipoContatoRN(); 128 $objTipoContatoRN = new TipoContatoRN();
129 $objTipoContatoDTO = new TipoContatoDTO(); 129 $objTipoContatoDTO = new TipoContatoDTO();
130 $objTipoContatoDTO->retTodos(); 130 $objTipoContatoDTO->retTodos();
@@ -139,20 +139,17 @@ class GerirTipoContextoPeticionamentoRN extends InfraRN { @@ -139,20 +139,17 @@ class GerirTipoContextoPeticionamentoRN extends InfraRN {
139 139
140 //se tiver tipos do sistema, monta mensagem de erro 140 //se tiver tipos do sistema, monta mensagem de erro
141 if( is_array( $arrTipoContatoReservado ) && count( $arrTipoContatoReservado ) > 0 ){ 141 if( is_array( $arrTipoContatoReservado ) && count( $arrTipoContatoReservado ) > 0 ){
142 -  
143 foreach( $arrTipoContatoReservado as $itemTipoContatoDTO ){ 142 foreach( $arrTipoContatoReservado as $itemTipoContatoDTO ){
144 -  
145 - $strMensagem .= $itemTipoContatoDTO->getStrNome() . "\n" ; 143 + $strMensagem .= "\t- ". $itemTipoContatoDTO->getStrNome() . "\n" ;
146 } 144 }
147 -  
148 } 145 }
149 146
150 } 147 }
151 148
152 if( $strMensagem != ""){ 149 if( $strMensagem != ""){
153 - $objInfraException->adicionarValidacao( " Nao permitido adicionar tipos de interessado reservados do sistema. Os seguintes tipos de interessado não são permitidos: \n ". $strMensagem ); 150 + $objInfraException->adicionarValidacao( " Não permitido adicionar Tipos de Contatos reservados do Sistema. Os seguintes Tipos não são permitidos: \n\n ". $strMensagem );
154 } 151 }
155 - 152 +
156 } 153 }
157 154
158 protected function cadastrarMultiploControlado( $arrPrincipal ){ 155 protected function cadastrarMultiploControlado( $arrPrincipal ){
@@ -176,14 +173,20 @@ class GerirTipoContextoPeticionamentoRN extends InfraRN { @@ -176,14 +173,20 @@ class GerirTipoContextoPeticionamentoRN extends InfraRN {
176 unset( $arrPrincipal['cadastro'] ); 173 unset( $arrPrincipal['cadastro'] );
177 174
178 $lista = $this->listar($objDTO); 175 $lista = $this->listar($objDTO);
179 - $this->validarTiposReservados( $lista, $objInfraException ); 176 +
  177 + //$this->validarTiposReservados( $lista, $objInfraException );
180 178
181 - $this->excluir( $lista ); 179 + //quando for Cadastro, impedir tipos reservados, quando for seleçao, nao deve impedir
  180 + if( $cadastro == 'S'){
  181 + $this->validarTiposReservados( $arrPrincipal, $objInfraException );
  182 + }
182 183
  184 + $this->excluir( $lista );
  185 +
183 //$arrPrincipal = PaginaSEI::getInstance()->getArrValuesSelect($_POST['hdnPrincipal']); 186 //$arrPrincipal = PaginaSEI::getInstance()->getArrValuesSelect($_POST['hdnPrincipal']);
184 187
185 if(!$arrPrincipal) { 188 if(!$arrPrincipal) {
186 - $objInfraException->adicionarValidacao('Informe pelo menos um tipo de interessado.'); 189 + $objInfraException->adicionarValidacao('Informe pelo menos um Tipo de Contato.');
187 } 190 }
188 191
189 $objInfraException->lancarValidacoes(); 192 $objInfraException->lancarValidacoes();
sei/web/modulos/peticionamento/rn/MdPetCargoRN.php 0 → 100644
@@ -0,0 +1,122 @@ @@ -0,0 +1,122 @@
  1 +<?
  2 +/**
  3 +* ANATEL
  4 +*
  5 +* 06/12/2016 - criado por marcelo.bezerra - CAST
  6 +*
  7 +*/
  8 +
  9 +require_once dirname(__FILE__).'/../../../SEI.php';
  10 +
  11 +class MdPetCargoRN extends InfraRN {
  12 +
  13 + public function __construct() {
  14 + parent::__construct ();
  15 + }
  16 +
  17 + protected function inicializarObjInfraIBanco() {
  18 + return BancoSEI::getInstance ();
  19 + }
  20 +
  21 + protected function listarDistintosConectado() {
  22 +
  23 + try {
  24 +
  25 + //Regras de Negocio
  26 + $objInfraException = new InfraException();
  27 +
  28 + // Masculinos
  29 + $objCargoMascDTO = new CargoDTO();
  30 + $objCargoMascDTO->setDistinct(true);
  31 + $objCargoMascDTO->setStrSinAtivo('S');
  32 + $objCargoMascDTO->retNumIdCargo();
  33 + $objCargoMascDTO->retStrExpressao();
  34 + $objCargoMascDTO->adicionarCriterio(
  35 + array('StaGenero')
  36 + , array(InfraDTO::$OPER_IGUAL)
  37 + , array('M')
  38 + , NULL
  39 + );
  40 + $objCargoMascRN = new CargoRN();
  41 + $arrObjCargoMascDTO = $objCargoMascRN->listarRN0302($objCargoMascDTO);
  42 + $arrCargoMasc = InfraArray::converterArrInfraDTO($arrObjCargoMascDTO,'Expressao');
  43 + $arrCargoIdMasc = InfraArray::converterArrInfraDTO($arrObjCargoMascDTO,'IdCargo');
  44 +
  45 + // Nulos
  46 + $objCargoNuloDTO = new CargoDTO();
  47 + $objCargoNuloDTO->setDistinct(true);
  48 + $objCargoNuloDTO->setStrSinAtivo('S');
  49 + $objCargoNuloDTO->retNumIdCargo();
  50 + $objCargoNuloDTO->retStrExpressao();
  51 + $objCargoNuloDTO->adicionarCriterio(
  52 + array('StaGenero')
  53 + , array(InfraDTO::$OPER_IGUAL)
  54 + , array(NULL)
  55 + );
  56 + if (count($arrCargoMasc)>0){
  57 + $objCargoNuloDTO->adicionarCriterio(
  58 + array('Expressao')
  59 + , array(InfraDTO::$OPER_NOT_IN)
  60 + , array($arrCargoMasc)
  61 + );
  62 + };
  63 + $objCargoNuloRN = new CargoRN();
  64 + $arrObjCargoNuloDTO = $objCargoNuloRN->listarRN0302($objCargoNuloDTO);
  65 + $arrCargoNulo = InfraArray::converterArrInfraDTO($arrObjCargoNuloDTO,'Expressao');
  66 + $arrCargoIdNulo = InfraArray::converterArrInfraDTO($arrObjCargoNuloDTO,'IdCargo');
  67 +
  68 + // Femininos
  69 + $objCargoFemDTO = new CargoDTO();
  70 + $objCargoFemDTO->setDistinct(true);
  71 + $objCargoFemDTO->setStrSinAtivo('S');
  72 + $objCargoFemDTO->retNumIdCargo();
  73 + $objCargoFemDTO->retStrExpressao();
  74 + $objCargoFemDTO->adicionarCriterio(
  75 + array('StaGenero')
  76 + , array(InfraDTO::$OPER_IGUAL)
  77 + , array('F')
  78 + );
  79 + if (count($arrCargoMasc)>0){
  80 + $objCargoFemDTO->adicionarCriterio(
  81 + array('Expressao')
  82 + , array(InfraDTO::$OPER_NOT_IN)
  83 + , array($arrCargoMasc)
  84 + );
  85 + };
  86 + if (count($arrCargoNulo)>0){
  87 + $objCargoFemDTO->adicionarCriterio(
  88 + array('Expressao')
  89 + , array(InfraDTO::$OPER_NOT_IN)
  90 + , array($arrCargoNulo)
  91 + );
  92 + };
  93 + $objCargoFemRN = new CargoRN();
  94 + $arrObjCargoFemDTO = $objCargoFemRN->listarRN0302($objCargoFemDTO);
  95 + $arrCargoIdFem = InfraArray::converterArrInfraDTO($arrObjCargoFemDTO,'IdCargo');
  96 +
  97 + // Resultado ordenado
  98 + $arrCargo = array_merge($arrCargoIdMasc,$arrCargoIdNulo);
  99 + $arrCargo = array_merge($arrCargo,$arrCargoIdFem);
  100 +
  101 + $objCargoDTO = new CargoDTO();
  102 + $objCargoDTO->retNumIdCargo();
  103 + $objCargoDTO->retStrExpressao();
  104 + $objCargoDTO->adicionarCriterio(
  105 + array('IdCargo')
  106 + , array(InfraDTO::$OPER_IN)
  107 + , array($arrCargo)
  108 + , NULL
  109 + );
  110 + $objCargoDTO->setOrdStrExpressao(InfraDTO::$TIPO_ORDENACAO_ASC);
  111 + $objCargoRN = new CargoRN();
  112 + $arrObjCargoDTO = $objCargoRN->listarRN0302($objCargoDTO);
  113 +
  114 + return $arrObjCargoDTO;
  115 +
  116 + //Auditoria
  117 + }catch(Exception $e){
  118 + throw new InfraException('Erro pesquisando Contato.',$e);
  119 + }
  120 + }
  121 +}
  122 +?>
0 \ No newline at end of file 123 \ No newline at end of file
sei/web/modulos/peticionamento/rn/MdPetIntercorrenteAndamentoSigilosoRN.php 0 → 100644
@@ -0,0 +1,759 @@ @@ -0,0 +1,759 @@
  1 +<?
  2 +/**
  3 + * TRIBUNAL REGIONAL FEDERAL DA 4ª REGIÃO
  4 + *
  5 + * 31/01/2008 - criado por marcio_db
  6 + *
  7 + * Versão do Gerador de Código: 1.13.1
  8 + *
  9 + * Versão no CVS: $Id$
  10 + */
  11 +
  12 +require_once dirname(__FILE__) . '/../../../SEI.php';
  13 +
  14 +class MdPetIntercorrenteAndamentoSigilosoRN extends InfraRN
  15 +{
  16 +
  17 + public function __construct()
  18 + {
  19 + parent::__construct();
  20 + }
  21 +
  22 + protected function inicializarObjInfraIBanco()
  23 + {
  24 + return BancoSEI::getInstance();
  25 + }
  26 +
  27 + protected function consultarProcedimentoConectado(EntradaConsultarProcedimentoAPI $objEntradaConsultarProcedimentoAPI){
  28 +
  29 + try{
  30 + $objProcedimentoDTO = new ProcedimentoDTO();
  31 + $objProcedimentoDTO->retDblIdProcedimento();
  32 + $objProcedimentoDTO->retNumIdTipoProcedimento();
  33 + $objProcedimentoDTO->retStrNomeTipoProcedimento();
  34 + $objProcedimentoDTO->retStrStaNivelAcessoGlobalProtocolo();
  35 + $objProcedimentoDTO->retStrProtocoloProcedimentoFormatado();
  36 + $objProcedimentoDTO->retStrDescricaoProtocolo();
  37 + $objProcedimentoDTO->retDtaGeracaoProtocolo();
  38 + $objProcedimentoDTO->setDblIdProcedimento($objEntradaConsultarProcedimentoAPI->getIdProcedimento());
  39 +
  40 + $objProcedimentoRN = new ProcedimentoRN();
  41 + $objProcedimentoDTO = $objProcedimentoRN->consultarRN0201($objProcedimentoDTO);
  42 +
  43 + $objProcedimentoHistoricoDTO = new ProcedimentoHistoricoDTO();
  44 + $objProcedimentoHistoricoDTO->setDblIdProcedimento($objProcedimentoDTO->getDblIdProcedimento());
  45 + $objProcedimentoHistoricoDTO->setStrStaHistorico(ProcedimentoRN::$TH_RESUMIDO);
  46 + $objProcedimentoHistoricoDTO->setStrSinGerarLinksHistorico('N');
  47 + $objProcedimentoHistoricoDTO->setNumMaxRegistrosRetorno(1);
  48 + $objProcedimentoDTOHistorico = $this->consultarHistoricoRN1025($objProcedimentoHistoricoDTO);
  49 + $arrObjAtividadeDTOHistorico = $objProcedimentoDTOHistorico->getArrObjAtividadeDTO();
  50 + $objAtividadeDTO = $arrObjAtividadeDTOHistorico[0];
  51 +
  52 + if ($objAtividadeDTO!=null) {
  53 + $objAndamentoAPIUltimo = new AndamentoAPI();
  54 + $objAndamentoAPIUltimo->setDescricao($objAtividadeDTO->getStrNomeTarefa());
  55 + $objAndamentoAPIUltimo->setDataHora($objAtividadeDTO->getDthAbertura());
  56 +
  57 + $objUsuarioAPI = new UsuarioAPI();
  58 + $objUsuarioAPI->setIdUsuario($objAtividadeDTO->getNumIdUsuarioOrigem());
  59 + $objUsuarioAPI->setSigla($objAtividadeDTO->getStrSiglaUsuarioOrigem());
  60 + $objUsuarioAPI->setNome($objAtividadeDTO->getStrNomeUsuarioOrigem());
  61 + $objAndamentoAPIUltimo->setUsuario($objUsuarioAPI);
  62 +
  63 + $objUnidadeAPI = new UnidadeAPI();
  64 + $objUnidadeAPI->setIdUnidade($objAtividadeDTO->getNumIdUnidade());
  65 + $objUnidadeAPI->setSigla($objAtividadeDTO->getStrSiglaUnidade());
  66 + $objUnidadeAPI->setDescricao($objAtividadeDTO->getStrDescricaoUnidade());
  67 + $objAndamentoAPIUltimo->setUnidade($objUnidadeAPI);
  68 + }
  69 + $objSaidaConsultarProcedimentoAPI = new SaidaConsultarProcedimentoAPI();
  70 + $objSaidaConsultarProcedimentoAPI->setUltimoAndamento($objAndamentoAPIUltimo);
  71 +
  72 + return $objSaidaConsultarProcedimentoAPI;
  73 + }catch(Exception $e){
  74 + throw new InfraException('Erro processando consulta de processo.',$e);
  75 + }
  76 + }
  77 +
  78 + protected function consultarHistoricoRN1025Conectado(ProcedimentoHistoricoDTO $parObjProcedimentoHistoricoDTO)
  79 + {
  80 + try {
  81 +
  82 + //Valida Permissao
  83 + SessaoSEI::getInstance()->validarAuditarPermissao('procedimento_consultar_historico', __METHOD__, $parObjProcedimentoHistoricoDTO);
  84 +
  85 + //Regras de Negocio
  86 + if (!$parObjProcedimentoHistoricoDTO->isSetStrSinGerarLinksHistorico()) {
  87 + $parObjProcedimentoHistoricoDTO->setStrSinGerarLinksHistorico('S');
  88 + }
  89 +
  90 + if (!$parObjProcedimentoHistoricoDTO->isSetStrSinRetornarAtributos()) {
  91 + $parObjProcedimentoHistoricoDTO->setStrSinRetornarAtributos('N');
  92 + }
  93 +
  94 +
  95 + $objPesquisaProtocoloDTO = new PesquisaProtocoloDTO();
  96 + $objPesquisaProtocoloDTO->setStrStaTipo(ProtocoloRN::$TPP_PROCEDIMENTOS);
  97 + $objPesquisaProtocoloDTO->setStrStaAcesso(ProtocoloRN::$TAP_TODOS);
  98 + $objPesquisaProtocoloDTO->setDblIdProtocolo($parObjProcedimentoHistoricoDTO->getDblIdProcedimento());
  99 +
  100 + $objProtocoloRN = new ProtocoloRN();
  101 + $arrObjProtocoloDTO = $objProtocoloRN->pesquisarRN0967($objPesquisaProtocoloDTO);
  102 +
  103 + if (count($arrObjProtocoloDTO) == 0) {
  104 + throw new InfraException('Processo não encontrado.', null, null, false);
  105 + }
  106 +
  107 + $objProtocoloDTO = $arrObjProtocoloDTO[0];
  108 + /*
  109 + if ($objProtocoloDTO->getStrStaNivelAcessoGlobal()==ProtocoloRN::$NA_SIGILOSO && $objProtocoloDTO->getNumCodigoAcesso()<0 && $parObjProcedimentoHistoricoDTO->getStrStaHistorico()!=ProcedimentoRN::$TH_EXTERNO){
  110 + throw new InfraException('Processo não encontrado para exibição do histórico.');
  111 + }
  112 + */
  113 +
  114 + $objProcedimentoDTO = new ProcedimentoDTO();
  115 + $objProcedimentoDTO->setDblIdProcedimento($objProtocoloDTO->getDblIdProtocolo());
  116 + $objProcedimentoDTO->setNumIdUnidadeGeradoraProtocolo($objProtocoloDTO->getNumIdUnidadeGeradora());
  117 + $objProcedimentoDTO->setStrProtocoloProcedimentoFormatado($objProtocoloDTO->getStrProtocoloFormatado());
  118 + $objProcedimentoDTO->setDtaGeracaoProtocolo($objProtocoloDTO->getDtaGeracao());
  119 + $objProcedimentoDTO->setStrSiglaUnidadeGeradoraProtocolo($objProtocoloDTO->getStrSiglaUnidadeGeradora());
  120 + $objProcedimentoDTO->setStrStaNivelAcessoGlobalProtocolo($objProtocoloDTO->getStrStaNivelAcessoGlobal());
  121 +
  122 + $objAtividadeDTO = new AtividadeDTO();
  123 + $objAtividadeDTO->retNumIdAtividade();
  124 + $objAtividadeDTO->retDblIdProtocolo();
  125 + $objAtividadeDTO->retNumIdUnidade();
  126 + $objAtividadeDTO->retNumIdUsuario();
  127 + $objAtividadeDTO->retStrSiglaUnidade();
  128 + $objAtividadeDTO->retStrDescricaoUnidade();
  129 + $objAtividadeDTO->retNumIdUnidadeOrigem();
  130 + $objAtividadeDTO->retDthAbertura();
  131 + $objAtividadeDTO->retDthConclusao();
  132 + $objAtividadeDTO->retNumIdTarefa();
  133 + $objAtividadeDTO->retStrNomeTarefa();
  134 + $objAtividadeDTO->retStrIdTarefaModuloTarefa();
  135 + $objAtividadeDTO->retNumIdUsuarioOrigem();
  136 + $objAtividadeDTO->retStrSiglaUnidadeOrigem();
  137 + $objAtividadeDTO->retStrSiglaUsuarioOrigem();
  138 + $objAtividadeDTO->retStrNomeUsuarioOrigem();
  139 + $objAtividadeDTO->retStrSiglaUsuarioAtribuicao();
  140 + $objAtividadeDTO->retStrNomeUsuarioAtribuicao();
  141 + $objAtividadeDTO->retStrSiglaUsuarioConclusao();
  142 + $objAtividadeDTO->retStrNomeUsuarioConclusao();
  143 + $objAtividadeDTO->retDtaPrazo();
  144 + $objAtividadeDTO->retStrStaProtocoloProtocolo();
  145 + $objAtividadeDTO->retStrSinInicial();
  146 +
  147 + if ($parObjProcedimentoHistoricoDTO->getStrStaHistorico() == ProcedimentoRN::$TH_RESUMIDO || $parObjProcedimentoHistoricoDTO->getStrStaHistorico() == ProcedimentoRN::$TH_EXTERNO) {
  148 +
  149 + $objAtividadeDTO->adicionarCriterio(array('IdTarefa', 'SinHistoricoResumidoTarefa'),
  150 + array(InfraDTO::$OPER_IGUAL, InfraDTO::$OPER_IGUAL),
  151 + array(null, 'S'),
  152 + InfraDTO::$OPER_LOGICO_OR);
  153 +
  154 +
  155 + } else if ($parObjProcedimentoHistoricoDTO->getStrStaHistorico() == ProcedimentoRN::$TH_PARCIAL) {
  156 +
  157 + $objAtividadeDTO->adicionarCriterio(array('IdTarefa', 'SinHistoricoCompletoTarefa'),
  158 + array(InfraDTO::$OPER_IGUAL, InfraDTO::$OPER_IGUAL),
  159 + array(null, 'S'),
  160 + InfraDTO::$OPER_LOGICO_OR);
  161 +
  162 + } else if ($parObjProcedimentoHistoricoDTO->getStrStaHistorico() == ProcedimentoRN::$TH_PERSONALIZADO) {
  163 +
  164 + if (!$parObjProcedimentoHistoricoDTO->isSetDblIdProcedimentoAnexado() && !$parObjProcedimentoHistoricoDTO->isSetDblIdDocumento()) {
  165 +
  166 + if ($parObjProcedimentoHistoricoDTO->isSetNumIdAtividade()) {
  167 + if (!is_array($parObjProcedimentoHistoricoDTO->getNumIdAtividade())) {
  168 + $objAtividadeDTO->setNumIdAtividade($parObjProcedimentoHistoricoDTO->getNumIdAtividade());
  169 + } else {
  170 + $objAtividadeDTO->setNumIdAtividade($parObjProcedimentoHistoricoDTO->getNumIdAtividade(), InfraDTO::$OPER_IN);
  171 + }
  172 + }
  173 +
  174 + if ($parObjProcedimentoHistoricoDTO->isSetNumIdTarefa()) {
  175 + if (!is_array($parObjProcedimentoHistoricoDTO->getNumIdTarefa())) {
  176 + $objAtividadeDTO->setNumIdTarefa($parObjProcedimentoHistoricoDTO->getNumIdTarefa());
  177 + } else {
  178 + $objAtividadeDTO->setNumIdTarefa($parObjProcedimentoHistoricoDTO->getNumIdTarefa(), InfraDTO::$OPER_IN);
  179 + }
  180 + }
  181 +
  182 + if ($parObjProcedimentoHistoricoDTO->isSetStrIdTarefaModulo()) {
  183 + if (!is_array($parObjProcedimentoHistoricoDTO->getStrIdTarefaModulo())) {
  184 + $objAtividadeDTO->setStrIdTarefaModuloTarefa($parObjProcedimentoHistoricoDTO->getStrIdTarefaModulo());
  185 + } else {
  186 + $objAtividadeDTO->setStrIdTarefaModuloTarefa($parObjProcedimentoHistoricoDTO->getStrIdTarefaModulo(), InfraDTO::$OPER_IN);
  187 + }
  188 + }
  189 +
  190 + } else {
  191 +
  192 + $objAtributoAndamentoDTO = new AtributoAndamentoDTO();
  193 + $objAtributoAndamentoDTO->retNumIdAtividade();
  194 + $objAtributoAndamentoDTO->setDblIdProtocoloAtividade($objProcedimentoDTO->getDblIdProcedimento());
  195 +
  196 + if ($parObjProcedimentoHistoricoDTO->isSetNumIdAtividade()) {
  197 + if (!is_array($parObjProcedimentoHistoricoDTO->getNumIdAtividade())) {
  198 + $objAtributoAndamentoDTO->setNumIdAtividade($parObjProcedimentoHistoricoDTO->getNumIdAtividade());
  199 + } else {
  200 + $objAtributoAndamentoDTO->setNumIdAtividade($parObjProcedimentoHistoricoDTO->getNumIdAtividade(), InfraDTO::$OPER_IN);
  201 + }
  202 + }
  203 +
  204 + if ($parObjProcedimentoHistoricoDTO->isSetNumIdTarefa()) {
  205 + if (!is_array($parObjProcedimentoHistoricoDTO->getNumIdTarefa())) {
  206 + $objAtributoAndamentoDTO->setNumIdTarefaAtividade($parObjProcedimentoHistoricoDTO->getNumIdTarefa());
  207 + } else {
  208 + $objAtributoAndamentoDTO->setNumIdTarefaAtividade($parObjProcedimentoHistoricoDTO->getNumIdTarefa(), InfraDTO::$OPER_IN);
  209 + }
  210 + }
  211 +
  212 + if ($parObjProcedimentoHistoricoDTO->isSetStrIdTarefaModulo()) {
  213 + if (!is_array($parObjProcedimentoHistoricoDTO->getStrIdTarefaModulo())) {
  214 + $objAtividadeDTO->setStrIdTarefaModuloTarefa($parObjProcedimentoHistoricoDTO->getStrIdTarefaModulo());
  215 + } else {
  216 + $objAtividadeDTO->setStrIdTarefaModuloTarefa($parObjProcedimentoHistoricoDTO->getStrIdTarefaModulo(), InfraDTO::$OPER_IN);
  217 + }
  218 + }
  219 +
  220 + if ($parObjProcedimentoHistoricoDTO->isSetDblIdProcedimentoAnexado()) {
  221 + $objAtributoAndamentoDTO->setStrNome('PROCESSO');
  222 + $objAtributoAndamentoDTO->setStrIdOrigem($parObjProcedimentoHistoricoDTO->getDblIdProcedimentoAnexado());
  223 + } else {
  224 + $objAtributoAndamentoDTO->setStrNome('DOCUMENTO');
  225 + $objAtributoAndamentoDTO->setStrIdOrigem($parObjProcedimentoHistoricoDTO->getDblIdDocumento());
  226 + }
  227 +
  228 + $objAtributoAndamentoRN = new AtributoAndamentoRN();
  229 + $arrObjAtributoAndamentoDTO = $objAtributoAndamentoRN->listarRN1367($objAtributoAndamentoDTO);
  230 +
  231 + if (count($arrObjAtributoAndamentoDTO)) {
  232 + $objAtividadeDTO->setNumIdAtividade(InfraArray::converterArrInfraDTO($arrObjAtributoAndamentoDTO, 'IdAtividade'), InfraDTO::$OPER_IN);
  233 + } else {
  234 + $objAtividadeDTO->setNumIdAtividade(null);
  235 + }
  236 + }
  237 + }
  238 +
  239 + $objAtividadeDTO->setDblIdProtocolo($objProcedimentoDTO->getDblIdProcedimento());
  240 +
  241 + $objAtividadeDTO->setOrdNumIdAtividade(InfraDTO::$TIPO_ORDENACAO_DESC);
  242 +
  243 + //paginação
  244 + $objAtividadeDTO->setNumMaxRegistrosRetorno($parObjProcedimentoHistoricoDTO->getNumMaxRegistrosRetorno());
  245 + $objAtividadeDTO->setNumPaginaAtual($parObjProcedimentoHistoricoDTO->getNumPaginaAtual());
  246 +
  247 + $objAtividadeRN = new AtividadeRN();
  248 + $arrObjAtividadeDTO = InfraArray::indexarArrInfraDTO($objAtividadeRN->listarRN0036($objAtividadeDTO), 'IdAtividade');
  249 +
  250 + //paginação
  251 + $parObjProcedimentoHistoricoDTO->setNumTotalRegistros($objAtividadeDTO->getNumTotalRegistros());
  252 + $parObjProcedimentoHistoricoDTO->setNumRegistrosPaginaAtual($objAtividadeDTO->getNumRegistrosPaginaAtual());
  253 +
  254 +
  255 + if (count($arrObjAtividadeDTO)) {
  256 + $objAtributoAndamentoDTO = new AtributoAndamentoDTO();
  257 + $objAtributoAndamentoDTO->retTodos(true);
  258 + $objAtributoAndamentoDTO->setNumIdAtividade(InfraArray::converterArrInfraDTO($arrObjAtividadeDTO, 'IdAtividade'), InfraDTO::$OPER_IN);
  259 +
  260 + $objAtributoAndamentoDTO->setOrdNumIdAtributoAndamento(InfraDTO::$TIPO_ORDENACAO_ASC);
  261 +
  262 + $objAtributoAndamentoRN = new AtributoAndamentoRN();
  263 + $arrObjAtributoAndamentoDTO = $objAtributoAndamentoRN->listarRN1367($objAtributoAndamentoDTO);
  264 +
  265 + if (count($arrObjAtributoAndamentoDTO) > 0) {
  266 +
  267 + if ($parObjProcedimentoHistoricoDTO->getStrSinGerarLinksHistorico() == 'N') {
  268 + $bolAcaoDownload = false;
  269 + $bolAcaoProcedimentoTrabalhar = false;
  270 + $bolAcaoRelBlocoProtocoloListar = false;
  271 + $bolAcaoDocumentoVisualizar = false;
  272 + $bolAcaoLocalizadorProtocolosListar = false;
  273 + } else if ($objProtocoloDTO->getNumCodigoAcesso() < 0) {
  274 + $bolAcaoDownload = false;
  275 + $bolAcaoProcedimentoTrabalhar = false;
  276 + $bolAcaoDocumentoVisualizar = false;
  277 + $bolAcaoRelBlocoProtocoloListar = false;
  278 +
  279 + //monta link de arquivo mesmo se não tem acesso
  280 + $bolAcaoLocalizadorProtocolosListar = SessaoSEI::getInstance()->verificarPermissao('localizador_protocolos_listar');
  281 +
  282 + } else {
  283 + $bolAcaoDownload = SessaoSEI::getInstance()->verificarPermissao('documento_download_anexo');
  284 + $bolAcaoProcedimentoTrabalhar = SessaoSEI::getInstance()->verificarPermissao('procedimento_trabalhar');
  285 + $bolAcaoDocumentoVisualizar = SessaoSEI::getInstance()->verificarPermissao('documento_visualizar');
  286 + $bolAcaoRelBlocoProtocoloListar = SessaoSEI::getInstance()->verificarPermissao('rel_bloco_protocolo_listar');
  287 + $bolAcaoLocalizadorProtocolosListar = SessaoSEI::getInstance()->verificarPermissao('localizador_protocolos_listar');
  288 + }
  289 +
  290 + $arrObjAtributoAndamentoDTOPorNome = InfraArray::indexarArrInfraDTO($arrObjAtributoAndamentoDTO, 'Nome', true);
  291 +
  292 + if (isset($arrObjAtributoAndamentoDTOPorNome['PROCESSO'])) {
  293 + $dto = new ProcedimentoDTO();
  294 + $dto->retDblIdProcedimento();
  295 + $dto->setDblIdProcedimento(InfraArray::converterArrInfraDTO($arrObjAtributoAndamentoDTOPorNome['PROCESSO'], 'IdOrigem'), InfraDTO::$OPER_IN);
  296 +
  297 + $arrObjProcedimentoDTO = InfraArray::indexarArrInfraDTO($this->listarRN0278($dto), 'IdProcedimento');
  298 + }
  299 +
  300 + if (isset($arrObjAtributoAndamentoDTOPorNome['DOCUMENTO'])) {
  301 + $dto = new DocumentoDTO();
  302 + $dto->retDblIdDocumento();
  303 + $dto->retStrProtocoloDocumentoFormatado();
  304 + $dto->retStrNomeSerie();
  305 + $dto->retStrNumero();
  306 + $dto->retStrStaProtocoloProtocolo();
  307 + $dto->setDblIdDocumento(InfraArray::converterArrInfraDTO($arrObjAtributoAndamentoDTOPorNome['DOCUMENTO'], 'IdOrigem'), InfraDTO::$OPER_IN);
  308 +
  309 + $objDocumentoRN = new DocumentoRN();
  310 + $arrObjDocumentoDTO = InfraArray::indexarArrInfraDTO($objDocumentoRN->listarRN0008($dto), 'IdDocumento');
  311 + }
  312 +
  313 + if (isset($arrObjAtributoAndamentoDTOPorNome['BLOCO'])) {
  314 + $objBlocoDTO = new BlocoDTO();
  315 + $objBlocoDTO->retNumIdBloco();
  316 + $objBlocoDTO->setNumIdBloco(InfraArray::converterArrInfraDTO($arrObjAtributoAndamentoDTOPorNome['BLOCO'], 'IdOrigem'), InfraDTO::$OPER_IN);
  317 + $objBlocoDTO->setNumIdUnidade(SessaoSEI::getInstance()->getNumIdUnidadeAtual());
  318 +
  319 + $objBlocoRN = new BlocoRN();
  320 + $arrIdBloco = InfraArray::converterArrInfraDTO($objBlocoRN->listarRN1277($objBlocoDTO), 'IdBloco');
  321 +
  322 + $objRelBlocoUnidadeDTO = new RelBlocoUnidadeDTO();
  323 + $objRelBlocoUnidadeDTO->retNumIdBloco();
  324 + $objRelBlocoUnidadeDTO->setNumIdBloco(InfraArray::converterArrInfraDTO($arrObjAtributoAndamentoDTOPorNome['BLOCO'], 'IdOrigem'), InfraDTO::$OPER_IN);
  325 + $objRelBlocoUnidadeDTO->setNumIdUnidade(SessaoSEI::getInstance()->getNumIdUnidadeAtual());
  326 +
  327 + $objRelBlocoUnidadeRN = new RelBlocoUnidadeRN();
  328 + $arrIdBloco = array_unique(array_merge($arrIdBloco, InfraArray::converterArrInfraDTO($objRelBlocoUnidadeRN->listarRN1304($objRelBlocoUnidadeDTO), 'IdBloco')));
  329 + }
  330 +
  331 + if ($bolAcaoLocalizadorProtocolosListar && isset($arrObjAtributoAndamentoDTOPorNome['LOCALIZADOR'])) {
  332 + $dto = new LocalizadorDTO();
  333 + $dto->retNumIdLocalizador();
  334 + $dto->retNumIdUnidade();
  335 + $dto->setNumIdLocalizador(InfraArray::converterArrInfraDTO($arrObjAtributoAndamentoDTOPorNome['LOCALIZADOR'], 'IdOrigem'), InfraDTO::$OPER_IN);
  336 +
  337 + $objLocalizadorRN = new LocalizadorRN();
  338 + $arrObjLocalizadorDTO = InfraArray::indexarArrInfraDTO($objLocalizadorRN->listarRN0622($dto), 'IdLocalizador');
  339 + } else {
  340 + $arrObjLocalizadorDTO = array();
  341 + }
  342 +
  343 + $arrObjNivelAcessoDTO = InfraArray::indexarArrInfraDTO($objProtocoloRN->listarNiveisAcessoRN0878(), 'StaNivel');
  344 + foreach ($arrObjNivelAcessoDTO as $objNivelAcessoDTO) {
  345 + $objNivelAcessoDTO->setStrDescricao(InfraString::transformarCaixaBaixa($objNivelAcessoDTO->getStrDescricao()));
  346 + }
  347 +
  348 + $arrObjGrauSigiloDTO = InfraArray::indexarArrInfraDTO(ProtocoloRN::listarGrausSigiloso(), 'StaGrau');
  349 + foreach ($arrObjGrauSigiloDTO as $objGrauSigiloDTO) {
  350 + $objGrauSigiloDTO->setStrDescricao(InfraString::transformarCaixaBaixa($objGrauSigiloDTO->getStrDescricao()));
  351 + }
  352 +
  353 +
  354 + $objTipoConferenciaDTO = new TipoConferenciaDTO();
  355 + $objTipoConferenciaDTO->setBolExclusaoLogica(false);
  356 + $objTipoConferenciaDTO->retNumIdTipoConferencia();
  357 + $objTipoConferenciaDTO->retStrDescricao();
  358 +
  359 + $objTipoConferenciaRN = new TipoConferenciaRN();
  360 + $arrObjTipoConferenciaDTO = InfraArray::indexarArrInfraDTO($objTipoConferenciaRN->listar($objTipoConferenciaDTO), 'IdTipoConferencia');
  361 + foreach ($arrObjTipoConferenciaDTO as $objTipoConferenciaDTO) {
  362 + $objTipoConferenciaDTO->setStrDescricao(InfraString::transformarCaixaBaixa($objTipoConferenciaDTO->getStrDescricao()));
  363 + }
  364 +
  365 + $objHipoteseLegalDTO = new HipoteseLegalDTO();
  366 + $objHipoteseLegalDTO->setBolExclusaoLogica(false);
  367 + $objHipoteseLegalDTO->retNumIdHipoteseLegal();
  368 + $objHipoteseLegalDTO->retStrNome();
  369 + $objHipoteseLegalDTO->retStrBaseLegal();
  370 +
  371 + $objHipoteseLegalRN = new HipoteseLegalRN();
  372 + $arrObjHipoteseLegalDTO = InfraArray::indexarArrInfraDTO($objHipoteseLegalRN->listar($objHipoteseLegalDTO), 'IdHipoteseLegal');
  373 +
  374 + foreach ($arrObjAtributoAndamentoDTO as $objAtributoAndamentoDTO) {
  375 +
  376 + $objAtividadeDTO = $arrObjAtividadeDTO[$objAtributoAndamentoDTO->getNumIdAtividade()];
  377 +
  378 + $strNomeTarefa = $objAtividadeDTO->getStrNomeTarefa();
  379 +
  380 + $objAtributoAndamentoDTO->setStrValor(PaginaSEI::tratarHTML($objAtributoAndamentoDTO->getStrValor()));
  381 +
  382 + switch ($objAtributoAndamentoDTO->getStrNome()) {
  383 +
  384 + case 'DOCUMENTO':
  385 + $this->substituirAtributoDocumentoHistorico($objAtributoAndamentoDTO, $arrObjDocumentoDTO, $bolAcaoDocumentoVisualizar, $strNomeTarefa);
  386 + break;
  387 +
  388 + case 'DOCUMENTOS':
  389 + $this->substitutirAtributoMultiploDocumentos($objAtributoAndamentoDTO, $arrObjAtributoAndamentoDTOPorNome['DOCUMENTO'], $arrObjDocumentoDTO, $bolAcaoDocumentoVisualizar, $strNomeTarefa);
  390 + break;
  391 +
  392 + case 'NIVEL_ACESSO':
  393 + $strNomeTarefa = str_replace('@NIVEL_ACESSO@', $arrObjNivelAcessoDTO[$objAtributoAndamentoDTO->getStrIdOrigem()]->getStrDescricao(), $strNomeTarefa);
  394 + break;
  395 +
  396 + case 'GRAU_SIGILO':
  397 + if ($objAtributoAndamentoDTO->getNumIdTarefaAtividade() == TarefaRN::$TI_GERACAO_PROCEDIMENTO ||
  398 + $objAtributoAndamentoDTO->getNumIdTarefaAtividade() == TarefaRN::$TI_GERACAO_DOCUMENTO ||
  399 + $objAtributoAndamentoDTO->getNumIdTarefaAtividade() == TarefaRN::$TI_RECEBIMENTO_DOCUMENTO ||
  400 + $objAtributoAndamentoDTO->getNumIdTarefaAtividade() == TarefaRN::$TI_ALTERACAO_NIVEL_ACESSO_GLOBAL
  401 + ) {
  402 + $strNomeTarefa = str_replace('@GRAU_SIGILO@', ' (' . $arrObjGrauSigiloDTO[$objAtributoAndamentoDTO->getStrIdOrigem()]->getStrDescricao() . ')', $strNomeTarefa);
  403 + } else {
  404 + $strNomeTarefa = str_replace('@GRAU_SIGILO@', ' ' . $arrObjGrauSigiloDTO[$objAtributoAndamentoDTO->getStrIdOrigem()]->getStrDescricao(), $strNomeTarefa);
  405 + }
  406 + break;
  407 +
  408 + case 'HIPOTESE_LEGAL':
  409 + if ($objAtributoAndamentoDTO->getNumIdTarefaAtividade() == TarefaRN::$TI_ALTERACAO_NIVEL_ACESSO_PROCESSO ||
  410 + $objAtributoAndamentoDTO->getNumIdTarefaAtividade() == TarefaRN::$TI_ALTERACAO_GRAU_SIGILO_PROCESSO ||
  411 + $objAtributoAndamentoDTO->getNumIdTarefaAtividade() == TarefaRN::$TI_ALTERACAO_HIPOTESE_LEGAL_PROCESSO ||
  412 + $objAtributoAndamentoDTO->getNumIdTarefaAtividade() == TarefaRN::$TI_ALTERACAO_NIVEL_ACESSO_DOCUMENTO ||
  413 + $objAtributoAndamentoDTO->getNumIdTarefaAtividade() == TarefaRN::$TI_ALTERACAO_GRAU_SIGILO_DOCUMENTO ||
  414 + $objAtributoAndamentoDTO->getNumIdTarefaAtividade() == TarefaRN::$TI_ALTERACAO_HIPOTESE_LEGAL_DOCUMENTO
  415 + ) {
  416 + if ($objAtributoAndamentoDTO->getStrIdOrigem() == null) {
  417 + $strNomeTarefa = str_replace('@HIPOTESE_LEGAL@', '"não informada"', $strNomeTarefa);
  418 + } else {
  419 + $strNomeTarefa = str_replace('@HIPOTESE_LEGAL@', HipoteseLegalINT::formatarHipoteseLegal($arrObjHipoteseLegalDTO[$objAtributoAndamentoDTO->getStrIdOrigem()]->getStrNome(), $arrObjHipoteseLegalDTO[$objAtributoAndamentoDTO->getStrIdOrigem()]->getStrBaseLegal()), $strNomeTarefa);
  420 + }
  421 + } else {
  422 + $strNomeTarefa = str_replace('@HIPOTESE_LEGAL@', ', ' . HipoteseLegalINT::formatarHipoteseLegal($arrObjHipoteseLegalDTO[$objAtributoAndamentoDTO->getStrIdOrigem()]->getStrNome(), $arrObjHipoteseLegalDTO[$objAtributoAndamentoDTO->getStrIdOrigem()]->getStrBaseLegal()), $strNomeTarefa);
  423 + }
  424 + break;
  425 +
  426 + case 'VISUALIZACAO':
  427 + if ($objAtributoAndamentoDTO->getStrIdOrigem() == null || $objAtributoAndamentoDTO->getStrIdOrigem() == AcessoExternoRN::$TV_INTEGRAL) {
  428 + $strNomeTarefa = str_replace('@VISUALIZACAO@', ' Com visualização integral do processo.', $strNomeTarefa);
  429 + } else if ($objAtributoAndamentoDTO->getStrIdOrigem() == AcessoExternoRN::$TV_PARCIAL) {
  430 + if ($objAtividadeDTO->getNumIdTarefa() == TarefaRN::$TI_LIBERACAO_ACESSO_EXTERNO) {
  431 + $strNomeTarefa = str_replace('@VISUALIZACAO@', ' Para disponibilização de documentos.', $strNomeTarefa);
  432 + } else {
  433 + $strNomeTarefa = str_replace('@VISUALIZACAO@', ' Com visualização parcial do processo.', $strNomeTarefa);
  434 + }
  435 + } else if ($objAtributoAndamentoDTO->getStrIdOrigem() == AcessoExternoRN::$TV_NENHUM) {
  436 + $strNomeTarefa = str_replace('@VISUALIZACAO@', ' Sem acesso ao processo.', $strNomeTarefa);
  437 + }
  438 + break;
  439 +
  440 + case 'DATA_AUTUACAO':
  441 + if ($objAtributoAndamentoDTO->getStrValor() != null) {
  442 + $strNomeTarefa = str_replace('@DATA_AUTUACAO@', ' (autuado em ' . $objAtributoAndamentoDTO->getStrValor() . ')', $strNomeTarefa);
  443 + }
  444 + break;
  445 +
  446 + case 'TIPO_CONFERENCIA':
  447 + if ($objAtributoAndamentoDTO->getNumIdTarefaAtividade() == TarefaRN::$TI_ALTERACAO_TIPO_CONFERENCIA_DOCUMENTO) {
  448 + if ($objAtributoAndamentoDTO->getStrIdOrigem() == null) {
  449 + $strNomeTarefa = str_replace('@TIPO_CONFERENCIA@', '"não informado"', $strNomeTarefa);
  450 + } else {
  451 + $strNomeTarefa = str_replace('@TIPO_CONFERENCIA@', $arrObjTipoConferenciaDTO[$objAtributoAndamentoDTO->getStrIdOrigem()]->getStrDescricao(), $strNomeTarefa);
  452 + }
  453 + } else {
  454 + $strNomeTarefa = str_replace('@TIPO_CONFERENCIA@', ', conferido com ' . $arrObjTipoConferenciaDTO[$objAtributoAndamentoDTO->getStrIdOrigem()]->getStrDescricao(), $strNomeTarefa);
  455 + }
  456 + break;
  457 +
  458 + case 'PROCESSO':
  459 + $this->substituirAtributoProcessoHistorico($objAtributoAndamentoDTO, $arrObjProcedimentoDTO, $bolAcaoProcedimentoTrabalhar, $strNomeTarefa);
  460 + break;
  461 +
  462 + case 'USUARIO':
  463 + if ($objAtributoAndamentoDTO->getStrValor() != null) {
  464 + $arrValor = explode('¥', $objAtributoAndamentoDTO->getStrValor());
  465 + $strSubstituicao = '<a href="javascript:void(0);" alt="' . $arrValor[1] . '" title="' . $arrValor[1] . '" class="ancoraSigla">' . $arrValor[0] . '</a>';
  466 + } else {
  467 + $strSubstituicao = '';
  468 + }
  469 + $strNomeTarefa = str_replace('@USUARIO@', $strSubstituicao, $strNomeTarefa);
  470 + break;
  471 +
  472 + case 'USUARIOS':
  473 + $this->substitutirAtributoMultiploUsuarios($objAtributoAndamentoDTO, $arrObjAtributoAndamentoDTOPorNome['USUARIO'], $strNomeTarefa);
  474 + break;
  475 +
  476 + case 'UNIDADE':
  477 + $arrValor = explode('¥', $objAtributoAndamentoDTO->getStrValor());
  478 + $strSubstituicao = '<a href="javascript:void(0);" alt="' . $arrValor[1] . '" title="' . $arrValor[1] . '" class="ancoraSigla">' . $arrValor[0] . '</a>';
  479 + $strNomeTarefa = str_replace('@UNIDADE@', $strSubstituicao, $strNomeTarefa);
  480 + break;
  481 +
  482 + case 'BLOCO':
  483 + $this->substituirAtributoBlocoHistorico($objAtributoAndamentoDTO, $arrIdBloco, $bolAcaoRelBlocoProtocoloListar, $strNomeTarefa);
  484 + break;
  485 +
  486 + case 'DATA_HORA':
  487 + $strNomeTarefa = str_replace('@DATA_HORA@', substr($objAtributoAndamentoDTO->getStrValor(), 0, 16), $strNomeTarefa);
  488 + break;
  489 +
  490 + case 'USUARIO_ANULACAO':
  491 + $arrValor = explode('¥', $objAtributoAndamentoDTO->getStrValor());
  492 + $strSubstituicao = '<a href="javascript:void(0);" alt="' . $arrValor[1] . '" title="' . $arrValor[1] . '" class="ancoraSigla">' . $arrValor[0] . '</a>';
  493 + $strNomeTarefa = str_replace('@USUARIO_ANULACAO@', $strSubstituicao, $strNomeTarefa);
  494 + break;
  495 +
  496 + case 'INTERESSADO':
  497 + $arrValor = explode('¥', $objAtributoAndamentoDTO->getStrValor());
  498 + $strSubstituicao = '<a href="javascript:void(0);" alt="' . $arrValor[1] . '" title="' . $arrValor[1] . '" class="ancoraSigla">' . $arrValor[0] . '</a>';
  499 + $strNomeTarefa = str_replace('@INTERESSADO@', $strSubstituicao, $strNomeTarefa);
  500 + break;
  501 +
  502 + case 'LOCALIZADOR':
  503 + $this->substituirAtributoLocalizadorHistorico($objAtributoAndamentoDTO, $arrObjLocalizadorDTO, $bolAcaoLocalizadorProtocolosListar, $strNomeTarefa);
  504 + break;
  505 +
  506 + case 'ANEXO':
  507 +
  508 + $strSubstituicao = $objAtributoAndamentoDTO->getStrValor();
  509 +
  510 + if ($bolAcaoDownload) {
  511 + $objAnexoDTO = new AnexoDTO();
  512 + $objAnexoDTO->retNumIdAnexo();
  513 + $objAnexoDTO->setNumIdAnexo($objAtributoAndamentoDTO->getStrIdOrigem());
  514 + $objAnexoDTO->setNumMaxRegistrosRetorno(1);
  515 +
  516 + $objAnexoRN = new AnexoRN();
  517 + if ($objAnexoRN->consultarRN0736($objAnexoDTO) != null) {
  518 + $strSubstituicao = '<a href="' . SessaoSEI::getInstance()->assinarLink('controlador.php?acao=documento_download_anexo&id_anexo=' . $objAtributoAndamentoDTO->getStrIdOrigem()) . '" target="_blank" class="ancoraHistoricoProcesso">' . $objAtributoAndamentoDTO->getStrValor() . '</a>';
  519 + } else {
  520 + $strSubstituicao = '<a href="javascript:void(0);" onclick="alert(\'Este anexo foi excluído.\');" class="ancoraHistoricoProcesso">' . $objAtributoAndamentoDTO->getStrValor() . '</a>';
  521 + }
  522 + }
  523 + $strNomeTarefa = str_replace('@ANEXO@', $strSubstituicao, $strNomeTarefa);
  524 + break;
  525 +
  526 + default:
  527 + $strNomeTarefa = str_replace('@' . $objAtributoAndamentoDTO->getStrNome() . '@', $objAtributoAndamentoDTO->getStrValor(), $strNomeTarefa);
  528 + }
  529 +
  530 + if ($parObjProcedimentoHistoricoDTO->getStrStaHistorico() == ProcedimentoRN::$TH_AUDITORIA && $objAtributoAndamentoDTO->getStrNome() == 'USUARIO_EMULADOR') {
  531 + $arrValor = explode('±', $objAtributoAndamentoDTO->getStrValor());
  532 + $arrUsuario = explode('¥', $arrValor[0]);
  533 + $arrOrgaoUsuario = explode('¥', $arrValor[1]);
  534 + $strUsuario = '<a href="javascript:void(0);" alt="' . $arrUsuario[1] . '" title="' . $arrUsuario[1] . '" class="ancoraSigla">' . $arrUsuario[0] . '</a>';
  535 + $strOrgaoUsuario = '<a href="javascript:void(0);" alt="' . $arrOrgaoUsuario[1] . '" title="' . $arrOrgaoUsuario[1] . '" class="ancoraSigla">' . $arrOrgaoUsuario[0] . '</a>';
  536 + $strNomeTarefa .= ' (emulado por ' . $strUsuario . ' / ' . $strOrgaoUsuario . ')';
  537 + }
  538 +
  539 + $objAtividadeDTO->setStrNomeTarefa($strNomeTarefa);
  540 + }
  541 + }
  542 +
  543 +
  544 + if ($parObjProcedimentoHistoricoDTO->getStrStaHistorico() == ProcedimentoRN::$TH_TOTAL) {
  545 +
  546 + foreach ($arrObjAtividadeDTO as $objAtividadeDTO) {
  547 + if ($objAtividadeDTO->getDthConclusao() == null) {
  548 + $objAtividadeDTO->setStrSinUltimaUnidadeHistorico('S');
  549 + } else {
  550 + $objAtividadeDTO->setStrSinUltimaUnidadeHistorico('N');
  551 + }
  552 + }
  553 +
  554 + } else {
  555 +
  556 + //buscar as unidades/usuarios que possuem andamento em aberto
  557 + $objAtividadeDTO = new AtividadeDTO();
  558 + $objAtividadeDTO->setDistinct(true);
  559 + $objAtividadeDTO->retNumIdUnidade();
  560 + $objAtividadeDTO->retNumIdUsuario();
  561 + $objAtividadeDTO->setDthConclusao(null);
  562 + $objAtividadeDTO->setDblIdProtocolo($objProcedimentoDTO->getDblIdProcedimento());
  563 +
  564 + $objAtividadeRN = new AtividadeRN();
  565 + $arrObjAtividadeDTOAbertas = $objAtividadeRN->listarRN0036($objAtividadeDTO);
  566 +
  567 + foreach ($arrObjAtividadeDTOAbertas as $objAtividadeDTOAberta) {
  568 + foreach ($arrObjAtividadeDTO as $objAtividadeDTO) {
  569 + if ($objAtividadeDTO->getNumIdUnidade() == $objAtividadeDTOAberta->getNumIdUnidade() && ($objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo() != ProtocoloRN::$NA_SIGILOSO || $objAtividadeDTO->getNumIdUsuario() == $objAtividadeDTOAberta->getNumIdUsuario())) {
  570 + $objAtividadeDTO->setStrSinUltimaUnidadeHistorico('S');
  571 + break;
  572 + }
  573 + }
  574 + }
  575 +
  576 + foreach ($arrObjAtividadeDTO as $objAtividadeDTO) {
  577 + if (!$objAtividadeDTO->isSetStrSinUltimaUnidadeHistorico()) {
  578 + $objAtividadeDTO->setStrSinUltimaUnidadeHistorico('N');
  579 + }
  580 + }
  581 + }
  582 +
  583 + if ($parObjProcedimentoHistoricoDTO->getStrSinRetornarAtributos() == 'S') {
  584 +
  585 + $arrObjAtributoAndamentoDTOPorAtividade = InfraArray::indexarArrInfraDTO($arrObjAtributoAndamentoDTO, 'IdAtividade', true);
  586 +
  587 + foreach ($arrObjAtividadeDTO as $objAtividadeDTO) {
  588 + if (isset($arrObjAtributoAndamentoDTOPorAtividade[$objAtividadeDTO->getNumIdAtividade()])) {
  589 + $objAtividadeDTO->setArrObjAtributoAndamentoDTO($arrObjAtributoAndamentoDTOPorAtividade[$objAtividadeDTO->getNumIdAtividade()]);
  590 + } else {
  591 + $objAtividadeDTO->setArrObjAtributoAndamentoDTO(array());
  592 + }
  593 + }
  594 + }
  595 + }
  596 +
  597 +
  598 + foreach ($arrObjAtividadeDTO as $objAtividadeDTO) {
  599 +
  600 + if (in_array($objAtividadeDTO->getNumIdTarefa(), array(TarefaRN::$TI_GERACAO_PROCEDIMENTO,
  601 + TarefaRN::$TI_GERACAO_DOCUMENTO,
  602 + TarefaRN::$TI_RECEBIMENTO_DOCUMENTO,
  603 + TarefaRN::$TI_LIBERACAO_ACESSO_EXTERNO,
  604 + TarefaRN::$TI_LIBERACAO_ACESSO_EXTERNO_CANCELADA,
  605 + TarefaRN::$TI_LIBERACAO_ASSINATURA_EXTERNA,
  606 + TarefaRN::$TI_LIBERACAO_ASSINATURA_EXTERNA_CANCELADA))) {
  607 +
  608 + $objAtividadeDTO->setStrNomeTarefa(str_replace(array('@NIVEL_ACESSO@',
  609 + '@GRAU_SIGILO@',
  610 + '@TIPO_CONFERENCIA@',
  611 + '@DATA_AUTUACAO@',
  612 + '@HIPOTESE_LEGAL@',
  613 + '@VISUALIZACAO@'), '', $objAtividadeDTO->getStrNomeTarefa()));
  614 + }
  615 + }
  616 +
  617 + $objProcedimentoDTO->setArrObjAtividadeDTO(array_values($arrObjAtividadeDTO));
  618 +
  619 + return $objProcedimentoDTO;
  620 +
  621 + } catch (Exception $e) {
  622 + throw new InfraException('Erro consultando histórico do processo.', $e);
  623 + }
  624 + }
  625 +
  626 + private function montarAtributoDocumentoHistorico(AtributoAndamentoDTO $objAtributoAndamentoDTO, $arrObjDocumentoDTO, $bolAcaoDocumentoVisualizar)
  627 + {
  628 +
  629 + if (!isset($arrObjDocumentoDTO[$objAtributoAndamentoDTO->getStrIdOrigem()])) {
  630 + $strSubstituicao = '<a href="javascript:void(0);" onclick="alert(\'Este documento foi excluído.\');" class="ancoraHistoricoProcesso">' . $objAtributoAndamentoDTO->getStrValor() . '</a>';
  631 + } else {
  632 + $objDocumentoDTO = $arrObjDocumentoDTO[$objAtributoAndamentoDTO->getStrIdOrigem()];
  633 + $strIdentificacao = PaginaSEI::tratarHTML(trim($objDocumentoDTO->getStrNomeSerie() . ' ' . $objDocumentoDTO->getStrNumero()));
  634 + if ($bolAcaoDocumentoVisualizar) {
  635 + $strSubstituicao = '<a href="' . SessaoSEI::getInstance()->assinarLink('controlador.php?acao=documento_visualizar&id_documento=' . $objAtributoAndamentoDTO->getStrIdOrigem()) . '" target="_blank" class="ancoraHistoricoProcesso">' . $objAtributoAndamentoDTO->getStrValor() . '</a> (' . $strIdentificacao . ')';
  636 + } else {
  637 + $strSubstituicao = $objAtributoAndamentoDTO->getStrValor() . ' (' . $strIdentificacao . ')';
  638 + }
  639 + }
  640 +
  641 + return $strSubstituicao;
  642 + }
  643 +
  644 + private function substitutirAtributoMultiploDocumentos($objAtributoAndamentoDTO, $arrObjAtributoAndamentoDTO, $arrObjDocumentoDTO, $bolAcaoDocumentoVisualizar, &$strNomeTarefa)
  645 + {
  646 + if (is_array($arrObjAtributoAndamentoDTO)) {
  647 +
  648 + $arr = array();
  649 +
  650 + $numAtributosTotal = count($arrObjAtributoAndamentoDTO);
  651 + for ($i = 0; $i < $numAtributosTotal; $i++) {
  652 + if ($arrObjAtributoAndamentoDTO[$i]->getNumIdAtividade() == $objAtributoAndamentoDTO->getNumIdAtividade()) {
  653 + $arr[] = $arrObjAtributoAndamentoDTO[$i];
  654 + }
  655 + }
  656 +
  657 + $n = count($arr);
  658 + $strValorMultiplo = '';
  659 + for ($i = 0; $i < $n; $i++) {
  660 + if ($strValorMultiplo != '') {
  661 + if ($i == ($n - 1)) {
  662 + $strValorMultiplo .= ' e ';
  663 + } else {
  664 + $strValorMultiplo .= ', ';
  665 + }
  666 + }
  667 + $strValorMultiplo .= $this->montarAtributoDocumentoHistorico($arr[$i], $arrObjDocumentoDTO, $bolAcaoDocumentoVisualizar);
  668 + }
  669 +
  670 + $strNomeTarefa = str_replace('#DOCUMENTOS#', $strValorMultiplo, $strNomeTarefa);
  671 + }
  672 + }
  673 +
  674 + private function substitutirAtributoMultiploUsuarios($objAtributoAndamentoDTO, $arrObjAtributoAndamentoDTO, &$strNomeTarefa)
  675 + {
  676 + if (is_array($arrObjAtributoAndamentoDTO)) {
  677 +
  678 + $arr = array();
  679 +
  680 + $numAtributosTotal = count($arrObjAtributoAndamentoDTO);
  681 + for ($i = 0; $i < $numAtributosTotal; $i++) {
  682 + if ($arrObjAtributoAndamentoDTO[$i]->getNumIdAtividade() == $objAtributoAndamentoDTO->getNumIdAtividade()) {
  683 + $arr[] = $arrObjAtributoAndamentoDTO[$i];
  684 + }
  685 + }
  686 +
  687 + $n = count($arr);
  688 + $strValorMultiplo = '';
  689 + for ($i = 0; $i < $n; $i++) {
  690 + if ($strValorMultiplo != '') {
  691 + if ($i == ($n - 1)) {
  692 + $strValorMultiplo .= ' e ';
  693 + } else {
  694 + $strValorMultiplo .= ', ';
  695 + }
  696 + }
  697 + $arrValor = explode('¥', $arr[$i]->getStrValor());
  698 + $strValorMultiplo .= '<a href="javascript:void(0);" alt="' . $arrValor[1] . '" title="' . $arrValor[1] . '" class="ancoraSigla">' . $arrValor[0] . '</a>';
  699 + }
  700 +
  701 + $strNomeTarefa = str_replace('#USUARIOS#', $strValorMultiplo, $strNomeTarefa);
  702 + }
  703 + }
  704 +
  705 + private function substituirAtributoDocumentoHistorico(AtributoAndamentoDTO $objAtributoAndamentoDTO, $arrObjDocumentoDTO, $bolAcaoDocumentoVisualizar, &$strNomeTarefa)
  706 + {
  707 + $strSubstituicao = $this->montarAtributoDocumentoHistorico($objAtributoAndamentoDTO, $arrObjDocumentoDTO, $bolAcaoDocumentoVisualizar);
  708 + $strNomeTarefa = str_replace('@DOCUMENTO@', $strSubstituicao, $strNomeTarefa);
  709 + }
  710 +
  711 + private function substituirAtributoBlocoHistorico(AtributoAndamentoDTO $objAtributoAndamentoDTO, $arrIdBloco, $bolAcaoRelBlocoProtocoloListar, &$strNomeTarefa)
  712 + {
  713 +
  714 + $strSubstituicao = $objAtributoAndamentoDTO->getStrValor();
  715 +
  716 + if ($bolAcaoRelBlocoProtocoloListar) {
  717 +
  718 + if (in_array($objAtributoAndamentoDTO->getStrIdOrigem(), $arrIdBloco)) {
  719 + $strSubstituicao = '<a href="' . SessaoSEI::getInstance()->assinarLink('controlador.php?acao=rel_bloco_protocolo_listar&id_bloco=' . $objAtributoAndamentoDTO->getStrIdOrigem()) . '" target="_blank" class="ancoraHistoricoProcesso">' . $objAtributoAndamentoDTO->getStrValor() . '</a>';
  720 + }
  721 +
  722 + }
  723 +
  724 + $strNomeTarefa = str_replace('@BLOCO@', $strSubstituicao, $strNomeTarefa);
  725 + }
  726 +
  727 + private function substituirAtributoProcessoHistorico(AtributoAndamentoDTO $objAtributoAndamentoDTO, $arrObjProcedimentoDTO, $bolAcaoProcedimentoTrabalhar, &$strNomeTarefa)
  728 + {
  729 +
  730 + $strSubstituicao = $objAtributoAndamentoDTO->getStrValor();
  731 +
  732 + if ($bolAcaoProcedimentoTrabalhar) {
  733 + if (isset($arrObjProcedimentoDTO[$objAtributoAndamentoDTO->getStrIdOrigem()])) {
  734 + $strSubstituicao = '<a href="' . SessaoSEI::getInstance()->assinarLink('controlador.php?acao=procedimento_trabalhar&id_procedimento=' . $objAtributoAndamentoDTO->getStrIdOrigem()) . '" target="_blank" class="ancoraHistoricoProcesso">' . $objAtributoAndamentoDTO->getStrValor() . '</a>';
  735 + } else {
  736 + $strSubstituicao = '<a href="javascript:void(0);" onclick="alert(\'Este processo foi excluído.\');" class="ancoraHistoricoProcesso">' . $objAtributoAndamentoDTO->getStrValor() . '</a>';
  737 + }
  738 + }
  739 +
  740 + $strNomeTarefa = str_replace('@PROCESSO@', $strSubstituicao, $strNomeTarefa);
  741 + }
  742 +
  743 + private function substituirAtributoLocalizadorHistorico(AtributoAndamentoDTO $objAtributoAndamentoDTO, $arrObjLocalizadorDTO, $bolAcaoLocalizadorProtocoloListar, &$strNomeTarefa)
  744 + {
  745 +
  746 + $strIdOrigem = $objAtributoAndamentoDTO->getStrIdOrigem();
  747 +
  748 + //só mostra link se o localizador é da unidade atual
  749 + if ($bolAcaoLocalizadorProtocoloListar && isset($arrObjLocalizadorDTO[$strIdOrigem]) && $arrObjLocalizadorDTO[$strIdOrigem]->getNumIdUnidade() == SessaoSEI::getInstance()->getNumIdUnidadeAtual()) {
  750 + $strSubstituicao = '<a href="' . SessaoSEI::getInstance()->assinarLink('controlador.php?acao=localizador_protocolos_listar&id_localizador=' . $strIdOrigem) . '" target="_blank" class="ancoraHistoricoProcesso">' . $objAtributoAndamentoDTO->getStrValor() . '</a>';
  751 + } else {
  752 + $strSubstituicao = $objAtributoAndamentoDTO->getStrValor();
  753 + }
  754 +
  755 + $strNomeTarefa = str_replace('@LOCALIZADOR@', $strSubstituicao, $strNomeTarefa);
  756 + }
  757 +}
  758 +
  759 +?>
0 \ No newline at end of file 760 \ No newline at end of file
sei/web/modulos/peticionamento/rn/MdPetIntercorrenteAtividadeRN.php 0 → 100644
@@ -0,0 +1,85 @@ @@ -0,0 +1,85 @@
  1 +<?
  2 +/**
  3 +* TRIBUNAL REGIONAL FEDERAL DA 4ª REGIÃO
  4 +*
  5 +* 05/06/2008 - criado por fbv
  6 +*
  7 +* Versão do Gerador de Código: 1.17.0
  8 +*
  9 +* Versão no CVS: $Id$
  10 +*/
  11 +
  12 +require_once dirname(__FILE__).'/../../../SEI.php';
  13 +
  14 +class MdPetIntercorrenteAtividadeRN extends AtividadeRN {
  15 +
  16 +
  17 +
  18 + protected function listarUnidadesTramitacaoControlado(ProcedimentoDTO $objProcedimentoDTO){
  19 + try{
  20 +
  21 + $objAtividadeDTO = new AtividadeDTO();
  22 + $objAtividadeDTO->setDistinct(true);
  23 + $objAtividadeDTO->retNumIdUnidade();
  24 + $objAtividadeDTO->retStrSiglaUnidade();
  25 + $objAtividadeDTO->retStrDescricaoUnidade();
  26 +
  27 + $objAtividadeDTO->setNumIdTarefa(array(TarefaRN::$TI_GERACAO_PROCEDIMENTO,
  28 + TarefaRN::$TI_PROCESSO_REMETIDO_UNIDADE,
  29 + TarefaRN::$TI_PROCESSO_CONCESSAO_CREDENCIAL,
  30 + TarefaRN::$TI_PROCESSO_CONCESSAO_CREDENCIAL_ANULADA),InfraDTO::$OPER_IN);
  31 +
  32 + $objAtividadeDTO->setDblIdProtocolo($objProcedimentoDTO->getDblIdProcedimento());
  33 +
  34 + //$objAtividadeDTO->setNumIdUnidade(SessaoSEI::getInstance()->getNumIdUnidadeAtual(),InfraDTO::$OPER_DIFERENTE);
  35 +
  36 + $objAtividadeDTO->setOrdStrSiglaUnidade(InfraDTO::$TIPO_ORDENACAO_ASC);
  37 +
  38 + $arrObjAtividadeDTO = $this->listarRN0036($objAtividadeDTO);
  39 +
  40 + foreach($arrObjAtividadeDTO as $objAtividadeDTO){
  41 + $objAtividadeDTO->setDtaPrazo(null);
  42 + }
  43 +
  44 + if (count($arrObjAtividadeDTO)>0){
  45 +
  46 + $arrObjAtividadeDTO = InfraArray::indexarArrInfraDTO($arrObjAtividadeDTO,'IdUnidade');
  47 +
  48 + $arrIdUnidade=InfraArray::converterArrInfraDTO($arrObjAtividadeDTO,'IdUnidade');
  49 +
  50 + //Acessar os retornos programados para a unidade atual
  51 + $objRetornoProgramadoDTO = new RetornoProgramadoDTO();
  52 + $objRetornoProgramadoDTO->setNumFiltroFkAtividadeRetorno(InfraDTO::$FILTRO_FK_WHERE);
  53 + $objRetornoProgramadoDTO->retNumIdUnidade();
  54 + $objRetornoProgramadoDTO->retDtaProgramada();
  55 + $objRetornoProgramadoDTO->setNumIdUnidade($arrIdUnidade,InfraDTO::$OPER_IN);
  56 + $objRetornoProgramadoDTO->setDblIdProtocoloAtividadeEnvio($objProcedimentoDTO->getDblIdProcedimento());
  57 + $objRetornoProgramadoDTO->setNumIdUnidadeAtividadeEnvio(SessaoSEI::getInstance()->getNumIdUnidadeAtual());
  58 + $objRetornoProgramadoDTO->setNumIdUnidadeAtividadeRetorno(null);
  59 +
  60 + $objRetornoProgramadoRN = new RetornoProgramadoRN();
  61 + $arrObjRetornoProgramadoDTO = $objRetornoProgramadoRN->listar($objRetornoProgramadoDTO);
  62 +
  63 + foreach ($arrObjRetornoProgramadoDTO as $objRetornoProgramadoDTO) {
  64 + $arrObjAtividadeDTO[$objRetornoProgramadoDTO->getNumIdUnidade()]->setDtaPrazo($objRetornoProgramadoDTO->getDtaProgramada());
  65 + }
  66 + }
  67 +
  68 + $objUnidadeDTO = new UnidadeDTO();
  69 + $objUnidadeDTO->retTodos();
  70 + $objUnidadeDTO->setBolExclusaoLogica(false);
  71 + $objUnidadeDTO->setNumIdUnidade(array_keys($arrObjAtividadeDTO), InfraDTO::$OPER_IN);
  72 +
  73 + $objUnidadeRN = new UnidadeRN();
  74 + $arrObjUnidadeDTO = $objUnidadeRN->listarRN0127($objUnidadeDTO);
  75 +
  76 + return $arrObjUnidadeDTO;
  77 +
  78 + }catch(Exception $e){
  79 + throw new InfraException('Erro listando unidades de tramitação.',$e);
  80 + }
  81 + }
  82 +
  83 +
  84 +}
  85 +?>
0 \ No newline at end of file 86 \ No newline at end of file
sei/web/modulos/peticionamento/rn/MdPetIntercorrenteProcessoRN.php
@@ -46,30 +46,10 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN { @@ -46,30 +46,10 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN {
46 * @return boolean 46 * @return boolean
47 */ 47 */
48 protected function validarUnidadeProcessoConectado($objProcedimentoDTO){ 48 protected function validarUnidadeProcessoConectado($objProcedimentoDTO){
49 - $objAtividadeDTO = new AtividadeDTO();  
50 - $objAtividadeRN = new AtividadeRN();  
51 - $objAtividadeDTO->setDblIdProcedimentoProtocolo($objProcedimentoDTO->getDblIdProcedimento());  
52 - $objAtividadeDTO->retNumIdUnidade();  
53 - $arrObjAtividUnidTramitado = $objAtividadeRN->listarRN0036($objAtividadeDTO);  
54 -  
55 - $arr = array();  
56 - if(count($arrObjAtividUnidTramitado) > 0){  
57 - foreach($arrObjAtividUnidTramitado as $objAtividadeDTO){  
58 - $idUnidade = $objAtividadeDTO->getNumIdUnidade();  
59 - array_push($arr, $idUnidade);  
60 - }  
61 - } 49 + $objAtividadeRN = new AtividadeRN();
  50 + $arrObjUnidadeDTO = $objAtividadeRN->listarUnidadesTramitacao($objProcedimentoDTO);
62 51
63 - $arrIdsUnidades = array_unique($arr);  
64 - $objUnidadeDTO = new UnidadeDTO();  
65 - $objUnidadeRN = new UnidadeRN();  
66 -  
67 - $objUnidadeDTO->setStrSinAtivo('S');  
68 - $objUnidadeDTO->setNumIdUnidade($arrIdsUnidades, InfraDTO::$OPER_IN);  
69 - $objUnidadeDTO->retNumIdUnidade();  
70 - $count = $objUnidadeRN->contarRN0128($objUnidadeDTO);  
71 -  
72 - if($count == 0){ 52 + if(count($arrObjUnidadeDTO) == 0){
73 return false; 53 return false;
74 } 54 }
75 55
@@ -132,8 +112,6 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN { @@ -132,8 +112,6 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN {
132 $objAtividadeDTO->retNumIdUnidade(); 112 $objAtividadeDTO->retNumIdUnidade();
133 $objAtividadeDTO->setOrdDthConclusao(InfraDTO::$TIPO_ORDENACAO_DESC); 113 $objAtividadeDTO->setOrdDthConclusao(InfraDTO::$TIPO_ORDENACAO_DESC);
134 $arrObjAtividadeDTO = $objAtividadeRN->listarRN0036($objAtividadeDTO); 114 $arrObjAtividadeDTO = $objAtividadeRN->listarRN0036($objAtividadeDTO);
135 -//ini_set('xdebug.var_display_max_depth', 10); ini_set('xdebug.var_display_max_children', 256); ini_set('xdebug.var_display_max_data', 1024); echo '<pre>';  
136 -//var_dump($arrObjAtividadeDTO); echo '</pre>'; exit;  
137 $objUltimaAtvProcesso = count($arrObjAtividadeDTO) > 0 ? current($arrObjAtividadeDTO) : null; 115 $objUltimaAtvProcesso = count($arrObjAtividadeDTO) > 0 ? current($arrObjAtividadeDTO) : null;
138 if(!is_null($objUltimaAtvProcesso)) { 116 if(!is_null($objUltimaAtvProcesso)) {
139 $idUnidadeReabrirProcesso = $objUltimaAtvProcesso->getNumIdUnidade(); 117 $idUnidadeReabrirProcesso = $objUltimaAtvProcesso->getNumIdUnidade();
@@ -147,11 +125,39 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN { @@ -147,11 +125,39 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN {
147 $objProcedimentoDTO = $params[0]; 125 $objProcedimentoDTO = $params[0];
148 $objCriterioIntercorrenteDTO = $params[1]; 126 $objCriterioIntercorrenteDTO = $params[1];
149 //$arrObjDocumentoAPI = $params[2]; 127 //$arrObjDocumentoAPI = $params[2];
  128 + $especificacao = $params[2];
150 129
151 $idUnidadeAbrirNovoProcesso = $this->retornaUltimaUnidadeProcessoAberto($objProcedimentoDTO->getDblIdProcedimento()); 130 $idUnidadeAbrirNovoProcesso = $this->retornaUltimaUnidadeProcessoAberto($objProcedimentoDTO->getDblIdProcedimento());
152 -//ini_set('xdebug.var_display_max_depth', 10); ini_set('xdebug.var_display_max_children', 256); ini_set('xdebug.var_display_max_data', 1024); echo '<pre>';  
153 -//var_dump($idUnidadeAbrirNovoProcesso); echo '</pre>'; exit;  
154 - //Salva um processo do tipo padrão selecionado 131 +
  132 + // inicio da verificação da unidade ativa, caso não esteja tenta buscar uma unidade ativa para reabrir o processo.
  133 + $unidadeDTO = new UnidadeDTO();
  134 + $unidadeDTO->retTodos();
  135 + $unidadeDTO->setBolExclusaoLogica(false);
  136 + $unidadeDTO->setNumIdUnidade($idUnidadeAbrirNovoProcesso);
  137 + $unidadeRN = new UnidadeRN();
  138 + $objUnidadeDTO = $unidadeRN->consultarRN0125($unidadeDTO);
  139 +
  140 + if($objUnidadeDTO->getStrSinAtivo() == 'N'){
  141 + $idUnidadeAbrirNovoProcesso = null;
  142 + $objAtividadeRN = new MdPetIntercorrenteAtividadeRN();
  143 + $arrObjUnidadeDTO = $objAtividadeRN->listarUnidadesTramitacao($objProcedimentoDTO);
  144 +
  145 + foreach ($arrObjUnidadeDTO as $itemObjUnidadeDTO) {
  146 + if ($itemObjUnidadeDTO->getStrSinAtivo() == 'S') {
  147 + $idUnidadeAbrirNovoProcesso = $itemObjUnidadeDTO->getNumIdUnidade();
  148 + }
  149 + }
  150 + }
  151 +
  152 + if($idUnidadeAbrirNovoProcesso == null) {
  153 + $objInfraException = new InfraException();
  154 + $objInfraException->adicionarValidacao('O processo indicado não aceita peticionamento intercorrente. Utilize o Peticionamento de Processo Novo para protocolizar sua demanda.');
  155 + $objInfraException->lancarValidacoes();
  156 + return false;
  157 + }
  158 + // fim da verificação da unidade ativa
  159 +
  160 + // Salva um processo do tipo padrão selecionado
155 $this->simularLogin($idUnidadeAbrirNovoProcesso); 161 $this->simularLogin($idUnidadeAbrirNovoProcesso);
156 162
157 $objEntradaGerarProcedimentoAPI = new EntradaGerarProcedimentoAPI(); 163 $objEntradaGerarProcedimentoAPI = new EntradaGerarProcedimentoAPI();
@@ -159,6 +165,11 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN { @@ -159,6 +165,11 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN {
159 165
160 $objProcedimentoAPI = new ProcedimentoAPI(); 166 $objProcedimentoAPI = new ProcedimentoAPI();
161 $objProcedimentoAPI->setIdTipoProcedimento($objCriterioIntercorrenteDTO->getNumIdTipoProcedimento()); 167 $objProcedimentoAPI->setIdTipoProcedimento($objCriterioIntercorrenteDTO->getNumIdTipoProcedimento());
  168 + if ($especificacao!=null){
  169 + $objProcedimentoAPI->setEspecificacao( $especificacao );
  170 + }
  171 +
  172 +
162 $objEntradaGerarProcedimentoAPI->setProcedimento($objProcedimentoAPI); 173 $objEntradaGerarProcedimentoAPI->setProcedimento($objProcedimentoAPI);
163 $objEntradaGerarProcedimentoAPI->setProcedimentosRelacionados($arrProcedimentoRelacionado); 174 $objEntradaGerarProcedimentoAPI->setProcedimentosRelacionados($arrProcedimentoRelacionado);
164 //$objEntradaGerarProcedimentoAPI->setDocumentos($arrObjDocumentoAPI); 175 //$objEntradaGerarProcedimentoAPI->setDocumentos($arrObjDocumentoAPI);
@@ -173,28 +184,30 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN { @@ -173,28 +184,30 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN {
173 * @since 19/12/2016 184 * @since 19/12/2016
174 * @author Jaqueline Mendes <jaqueline.mendes@castgroup.com.br> 185 * @author Jaqueline Mendes <jaqueline.mendes@castgroup.com.br>
175 */ 186 */
176 - private function retornaUltimaUnidadeProcessoAberto($idProcedimento){  
177 - $objSEIRN = new SeiRN(); 187 + protected function retornaUltimaUnidadeProcessoAbertoConectado($idProcedimento){
  188 +
  189 + $objProcedimentoDTO = new ProcedimentoDTO();
  190 + $objProcedimentoDTO->retTodos(true);
  191 + $objProcedimentoDTO->setDblIdProcedimento($idProcedimento);
  192 + $objProcedimentoRN = new ProcedimentoRN();
  193 + $objProcedimentoDTO = $objProcedimentoRN->consultarRN0201($objProcedimentoDTO);
  194 +
178 $objEntradaConsultaProcApi = new EntradaConsultarProcedimentoAPI(); 195 $objEntradaConsultaProcApi = new EntradaConsultarProcedimentoAPI();
179 $objEntradaConsultaProcApi->setIdProcedimento($idProcedimento); 196 $objEntradaConsultaProcApi->setIdProcedimento($idProcedimento);
180 $objEntradaConsultaProcApi->setSinRetornarUltimoAndamento('S'); 197 $objEntradaConsultaProcApi->setSinRetornarUltimoAndamento('S');
  198 +
181 /** 199 /**
182 * @var $saidaConsultarProcedimentoAPI SaidaConsultarProcedimentoAPI 200 * @var $saidaConsultarProcedimentoAPI SaidaConsultarProcedimentoAPI
183 */ 201 */
184 - $saidaConsultarProcedimentoAPI = $objSEIRN->consultarProcedimento($objEntradaConsultaProcApi);  
185 -  
186 -  
187 - /*  
188 - $objProcedimentoHistoricoDTO = new ProcedimentoHistoricoDTO();  
189 - $objProcedimentoHistoricoDTO->setDblIdProcedimento($idProcedimento);  
190 - $objProcedimentoRN = new ProcedimentoRN();  
191 - $objProcedimentoDTOHistorico = $objProcedimentoRN->consultarHistoricoRN1025($objProcedimentoHistoricoDTO);  
192 - $arrObjAtividadeDTOHistorico = $objProcedimentoDTOHistorico->getArrObjAtividadeDTO();  
193 - */ 202 + if($objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo() == ProtocoloRN::$NA_SIGILOSO ||
  203 + $objProcedimentoDTO->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_SIGILOSO){
  204 + $md = new MdPetIntercorrenteAndamentoSigilosoRN();
  205 + $saidaConsultarProcedimentoAPI = $md->consultarProcedimento($objEntradaConsultaProcApi);
  206 + } else {
  207 + $objSEIRN = new SeiRN();
  208 + $saidaConsultarProcedimentoAPI = $objSEIRN->consultarProcedimento($objEntradaConsultaProcApi);
  209 + }
194 210
195 -// ini_set('xdebug.var_display_max_depth', 10); ini_set('xdebug.var_display_max_children', 256); ini_set('xdebug.var_display_max_data', 1024); echo '<pre>';  
196 -// var_dump($arrObjAtividadeDTOHistorico);  
197 -// var_dump($saidaConsultarProcedimentoAPI); echo '</pre>'; exit;  
198 /** 211 /**
199 * @var $ultimoAndamento AndamentoAPI 212 * @var $ultimoAndamento AndamentoAPI
200 */ 213 */
@@ -204,65 +217,104 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN { @@ -204,65 +217,104 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN {
204 */ 217 */
205 $objUnidadeAPI = $ultimoAndamento->getUnidade(); 218 $objUnidadeAPI = $ultimoAndamento->getUnidade();
206 219
207 -  
208 return $objUnidadeAPI->getIdUnidade(); 220 return $objUnidadeAPI->getIdUnidade();
209 } 221 }
210 222
211 - protected function reabrirProcessoApiConectado(ProcedimentoDTO $objProcedimentoDTO) { 223 + protected function incluirDocumentosApi($objProcedimentoDTO, $arrObjDocumentoAPI)
  224 + {
  225 + $arrObjReciboDocPet = array();
212 $objSEIRN = new SeiRN(); 226 $objSEIRN = new SeiRN();
213 - //Reabre o Processo quando necessário de Critério Intercorrente  
214 - $objEntradaConsultaProcApi = new EntradaConsultarProcedimentoAPI();  
215 - $objEntradaConsultaProcApi->setIdProcedimento($objProcedimentoDTO->getDblIdProcedimento());  
216 - $objEntradaConsultaProcApi->setSinRetornarUnidadesProcedimentoAberto('S'); 227 + $idUnidadeProcesso = $this->retornaUltimaUnidadeProcessoAberto($objProcedimentoDTO->getDblIdProcedimento());
217 228
218 - $ret = $objSEIRN->consultarProcedimento($objEntradaConsultaProcApi);  
219 - $arrUnidadesAberto = $ret->getUnidadesProcedimentoAberto();  
220 - $unidadesAberto = count($arrUnidadesAberto);  
221 -// var_dump($unidadesAberto); echo '</pre>'; exit;  
222 229
223 - if ($unidadesAberto < 0) {  
224 - return false;  
225 - }  
226 - $objAtividadeDTO = new AtividadeDTO();  
227 - $objAtividadeDTO->setDblIdProcedimentoProtocolo($objProcedimentoDTO->getDblIdProcedimento());  
228 - $idUnidadeReabrirProcesso = $this->retornaUltimaUnidadeProcessoConcluido($objAtividadeDTO); 230 + // inicio da verificação da unidade ativa, caso não esteja tenta buscar uma unidade ativa para reabrir o processo.
  231 + $unidadeDTO = new UnidadeDTO();
  232 + $unidadeDTO->retTodos();
  233 + $unidadeDTO->setBolExclusaoLogica(false);
  234 + $unidadeDTO->setNumIdUnidade($idUnidadeProcesso);
  235 + $unidadeRN = new UnidadeRN();
  236 + $objUnidadeDTO = $unidadeRN->consultarRN0125($unidadeDTO);
229 237
230 -// ini_set('xdebug.var_display_max_depth', 10); ini_set('xdebug.var_display_max_children', 256); ini_set('xdebug.var_display_max_data', 1024); echo '<pre>';  
231 -// var_dump($idUnidadeReabrirProcesso); echo '</pre>'; exit; 238 + if($objUnidadeDTO->getStrSinAtivo() == 'N'){
  239 + $idUnidadeProcesso = null;
  240 + $objAtividadeRN = new AtividadeRN();
  241 + $arrObjAtividadeDTO = $objAtividadeRN->listarUnidadesTramitacao($objProcedimentoDTO);
232 242
233 - if (!$idUnidadeReabrirProcesso) {  
234 - return true;  
235 - } 243 + foreach ($arrObjAtividadeDTO as $itemObjAtividadeDTO) {
  244 + $unidadeDTO = new UnidadeDTO();
  245 + $unidadeDTO->retTodos();
  246 + $unidadeDTO->setBolExclusaoLogica(false);
  247 + $unidadeDTO->setNumIdUnidade($itemObjAtividadeDTO->getNumIdUnidade());
  248 + $unidadeRN = new UnidadeRN();
  249 + $objUnidadeDTO = $unidadeRN->consultarRN0125($unidadeDTO);
236 250
237 - $this->simularLogin($idUnidadeReabrirProcesso);  
238 251
239 - $objEntradaReabrirProcessoAPI = new EntradaReabrirProcessoAPI();  
240 - $objEntradaReabrirProcessoAPI->setIdProcedimento($objProcedimentoDTO->getDblIdProcedimento());  
241 - $objEntradaReabrirProcessoAPI->setProtocoloProcedimento($objProcedimentoDTO->getStrProtocoloProcedimentoFormatado()); 252 + if ($objUnidadeDTO->getStrSinAtivo() == 'S') {
  253 + $idUnidadeProcesso = $objUnidadeDTO->getNumIdUnidade();
  254 + }
  255 + }
  256 + }
  257 +
242 258
243 - $objSEIRN->reabrirProcesso($objEntradaReabrirProcessoAPI);  
244 - return true;  
245 - }  
246 259
247 - protected function incluirDocumentosApi($objProcedimentoDTO, $arrObjDocumentoAPI)  
248 - {  
249 - $arrObjReciboDocPet = array();  
250 - $objSEIRN = new SeiRN();  
251 - $idUnidadeProcesso = $this->retornaUltimaUnidadeProcessoAberto($objProcedimentoDTO->getDblIdProcedimento());  
252 $this->simularLogin($idUnidadeProcesso); 260 $this->simularLogin($idUnidadeProcesso);
253 - /*  
254 - $objInfraParametro = new InfraParametro(BancoSEI::getInstance());  
255 - $idSerieParam = $objInfraParametro->getValor('ID_SERIE_RECIBO_MODULO_PETICIONAMENTO');  
256 - */ 261 +
257 foreach ($arrObjDocumentoAPI as $documentoAPI) { 262 foreach ($arrObjDocumentoAPI as $documentoAPI) {
258 /* @var $documentoAPI DocumentoAPI */ 263 /* @var $documentoAPI DocumentoAPI */
259 - //$documentoAPI->setIdSerie($idSerieParam);  
260 - //$documentoAPI->set  
261 $saidaIncluirDocumentoAPI = $objSEIRN->incluirDocumento($documentoAPI); 264 $saidaIncluirDocumentoAPI = $objSEIRN->incluirDocumento($documentoAPI);
262 - $formato = MdPetIntercorrenteINT::retornaTipoFormatoDocumento($saidaIncluirDocumentoAPI);  
263 - $objReciboDocAnexPetDTO = MdPetIntercorrenteINT::retornaObjReciboDocPreenchido(array($saidaIncluirDocumentoAPI->getIdDocumento(), $formato));  
264 - array_push($arrObjReciboDocPet, $objReciboDocAnexPetDTO);  
265 - $this->assinarETravarDocumento($saidaIncluirDocumentoAPI); 265 +
  266 + // Remententes
  267 + $idsParticipantes = array();
  268 +
  269 + $objParticipante = new ParticipanteDTO();
  270 + $objParticipante->setDblIdProtocolo($saidaIncluirDocumentoAPI->getIdDocumento());
  271 + $objParticipante->setNumIdContato($this->getContatoDTOUsuarioLogado()->getNumIdContato());
  272 + $objParticipante->setNumIdUnidade($idUnidadeProcesso);
  273 + $objParticipante->setStrStaParticipacao(ParticipanteRN::$TP_REMETENTE);
  274 + $objParticipante->setNumSequencia(0);
  275 + $idsParticipantes[] = $objParticipante;
  276 +
  277 + //Interessados
  278 + // Processo Principal - Interessados
  279 + $objParticipanteProcPrincDTO = new ParticipanteDTO();
  280 + $objParticipanteProcPrincDTO->retNumIdParticipante();
  281 + $objParticipanteProcPrincDTO->retNumIdContato();
  282 + $objParticipanteProcPrincDTO->retNumIdUnidade();
  283 + $objParticipanteProcPrincDTO->retStrStaParticipacao();
  284 + $objParticipanteProcPrincDTO->retStrNomeContato();
  285 + $objParticipanteProcPrincDTO->retNumSequencia();
  286 + $objParticipanteProcPrincDTO->setDblIdProtocolo($objProcedimentoDTO->getDblIdProcedimento());
  287 + $objParticipanteProcPrincDTO->setStrStaParticipacao(ParticipanteRN::$TP_INTERESSADO);
  288 +
  289 + $objParticipanteProcPrincRN = new ParticipanteRN();
  290 + $arrobjParticipanteProcPrinc = $objParticipanteProcPrincRN->listarRN0189($objParticipanteProcPrincDTO);
  291 + // Processo Principal - Interessados - FIM
  292 +
  293 + // Processo - Interessados
  294 + $i=0;
  295 + foreach($arrobjParticipanteProcPrinc as $objParticipanteProcPrinc){
  296 + $objParticipante = new ParticipanteDTO();
  297 + $objParticipante->setDblIdProtocolo($saidaIncluirDocumentoAPI->getIdDocumento());
  298 + $objParticipante->setNumIdContato($objParticipanteProcPrinc->getNumIdContato());
  299 + $objParticipante->setNumIdUnidade($objParticipanteProcPrinc->getNumIdUnidade());
  300 + $objParticipante->setStrStaParticipacao(ParticipanteRN::$TP_INTERESSADO);
  301 + $objParticipante->setNumSequencia($i);
  302 + $idsParticipantes[] = $objParticipante;
  303 + $i++;
  304 + }
  305 +
  306 + $objMdPetParticipanteRN = new MdPetParticipanteRN();
  307 + $arrInteressado = array();
  308 + $arrInteressado[0] = $saidaIncluirDocumentoAPI->getIdDocumento();
  309 + $arrInteressado[1] = $idsParticipantes;
  310 + //$arrInteressado[2] = $idsRemententes;
  311 + $objMdPetParticipanteRN->setInteressadosRemetentesProcedimentoDocumento( $arrInteressado );
  312 + // Processo - Interessados - FIM
  313 +
  314 + $formato = MdPetIntercorrenteINT::retornaTipoFormatoDocumento($saidaIncluirDocumentoAPI);
  315 + $objReciboDocAnexPetDTO = MdPetIntercorrenteINT::retornaObjReciboDocPreenchido(array($saidaIncluirDocumentoAPI->getIdDocumento(), $formato));
  316 + array_push($arrObjReciboDocPet, $objReciboDocAnexPetDTO);
  317 + $this->assinarETravarDocumento($saidaIncluirDocumentoAPI);
266 } 318 }
267 return $arrObjReciboDocPet; 319 return $arrObjReciboDocPet;
268 } 320 }
@@ -282,15 +334,25 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN { @@ -282,15 +334,25 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN {
282 $this->tipoConferenciaAlterado = false; 334 $this->tipoConferenciaAlterado = false;
283 //setar temporariamente e depois remover da entidade 335 //setar temporariamente e depois remover da entidade
284 if(! $documentoDTO->getNumIdTipoConferencia() ){ 336 if(! $documentoDTO->getNumIdTipoConferencia() ){
  337 + // buscando o menor tipo de conferencia
  338 + $tipoConferenciaDTOConsulta = new TipoConferenciaDTO();
  339 + $tipoConferenciaDTOConsulta->retTodos();
  340 + $tipoConferenciaDTOConsulta->setStrSinAtivo('S');
  341 + $tipoConferenciaDTOConsulta->setOrd('IdTipoConferencia', InfraDTO::$TIPO_ORDENACAO_ASC);
  342 + $tipoConferenciaRN = new TipoConferenciaRN();
  343 + $arrTipoConferenciaDTO = $tipoConferenciaRN->listar($tipoConferenciaDTOConsulta);
  344 + $numIdTipoConferencia = $arrTipoConferenciaDTO[0]->getNumIdTipoConferencia();
  345 + // fim buscando o menor tipo de conferencia
  346 +
285 //setando um tipo de conferencia padrao (que sera removido depois), apenas para passar na validação 347 //setando um tipo de conferencia padrao (que sera removido depois), apenas para passar na validação
286 - $documentoDTO->setNumIdTipoConferencia(1); 348 + $documentoDTO->setNumIdTipoConferencia($numIdTipoConferencia);
287 $documentoAlteracaoDTO = new DocumentoDTO(); 349 $documentoAlteracaoDTO = new DocumentoDTO();
288 $documentoAlteracaoDTO->retDblIdDocumento(); 350 $documentoAlteracaoDTO->retDblIdDocumento();
289 $documentoAlteracaoDTO->retNumIdTipoConferencia(); 351 $documentoAlteracaoDTO->retNumIdTipoConferencia();
290 $documentoAlteracaoDTO->setDblIdDocumento( $documentoDTO->getDblIdDocumento() ); 352 $documentoAlteracaoDTO->setDblIdDocumento( $documentoDTO->getDblIdDocumento() );
291 $documentoAlteracaoDTO = $documentoRN->consultarRN0005( $documentoAlteracaoDTO ); 353 $documentoAlteracaoDTO = $documentoRN->consultarRN0005( $documentoAlteracaoDTO );
292 354
293 - $documentoAlteracaoDTO->setNumIdTipoConferencia(1); 355 + $documentoAlteracaoDTO->setNumIdTipoConferencia($numIdTipoConferencia);
294 $documentoBD->alterar( $documentoAlteracaoDTO ); 356 $documentoBD->alterar( $documentoAlteracaoDTO );
295 $this->tipoConferenciaAlterado = true; 357 $this->tipoConferenciaAlterado = true;
296 } 358 }
@@ -342,7 +404,8 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN { @@ -342,7 +404,8 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN {
342 $objParticipanteDTO->retNumIdUnidade(); 404 $objParticipanteDTO->retNumIdUnidade();
343 $objParticipanteDTO->retDblIdProtocolo(); 405 $objParticipanteDTO->retDblIdProtocolo();
344 $objParticipanteDTO->retNumIdParticipante(); 406 $objParticipanteDTO->retNumIdParticipante();
345 - $objParticipanteDTO->setNumIdUnidade( $objUnidadeDTO->getNumIdUnidade() ); 407 + //FK de BD (ak1_participante) trata somente id_contato, id_protocolo, sta_participacao, então desconsiderar unidade
  408 + //$objParticipanteDTO->setNumIdUnidade( $objUnidadeDTO->getNumIdUnidade() );
346 $objParticipanteDTO->setNumIdContato( $objUsuarioDTO->getNumIdContato() ); 409 $objParticipanteDTO->setNumIdContato( $objUsuarioDTO->getNumIdContato() );
347 $objParticipanteDTO->setDblIdProtocolo( $objProcedimentoDTO->getDblIdProcedimento() ); 410 $objParticipanteDTO->setDblIdProtocolo( $objProcedimentoDTO->getDblIdProcedimento() );
348 411
@@ -399,7 +462,7 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN { @@ -399,7 +462,7 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN {
399 $objAssinaturaDTO->setStrCargoFuncao( "Usuário Externo - " . $cargoDTO->getStrExpressao() ); 462 $objAssinaturaDTO->setStrCargoFuncao( "Usuário Externo - " . $cargoDTO->getStrExpressao() );
400 $objAssinaturaDTO->setArrObjDocumentoDTO(array($documentoDTO)); 463 $objAssinaturaDTO->setArrObjDocumentoDTO(array($documentoDTO));
401 464
402 - $documentoRN = new DocumentoRN(); 465 + $documentoRN = new DocumentoPeticionamentoRN();
403 $objAssinaturaDTO = $documentoRN->assinar($objAssinaturaDTO); 466 $objAssinaturaDTO = $documentoRN->assinar($objAssinaturaDTO);
404 $this->addDocumentos($documentoDTO); 467 $this->addDocumentos($documentoDTO);
405 $this->fecharDocumentoParaAssinatura($documentoDTO); 468 $this->fecharDocumentoParaAssinatura($documentoDTO);
@@ -488,8 +551,8 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN { @@ -488,8 +551,8 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN {
488 $objProcedimentoDTO = new ProcedimentoDTO(); 551 $objProcedimentoDTO = new ProcedimentoDTO();
489 $objProcedimentoRN = new ProcedimentoRN(); 552 $objProcedimentoRN = new ProcedimentoRN();
490 $objProcedimentoDTO->setDblIdProcedimento($params['id_procedimento']); 553 $objProcedimentoDTO->setDblIdProcedimento($params['id_procedimento']);
491 - $objProcedimentoDTO->retDblIdProcedimento();  
492 - $objProcedimentoDTO->retStrProtocoloProcedimentoFormatado(); 554 + $objProcedimentoDTO->retTodos(true);
  555 + //$objProcedimentoDTO->retStrProtocoloProcedimentoFormatado();
493 $objProcedimentoDTO = $objProcedimentoRN->consultarRN0201($objProcedimentoDTO); 556 $objProcedimentoDTO = $objProcedimentoRN->consultarRN0201($objProcedimentoDTO);
494 557
495 $objCriterioIntercorrenteRN = new CriterioIntercorrentePeticionamentoRN(); 558 $objCriterioIntercorrenteRN = new CriterioIntercorrentePeticionamentoRN();
@@ -501,33 +564,101 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN { @@ -501,33 +564,101 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN {
501 $arrDadosRecibo = array(); 564 $arrDadosRecibo = array();
502 $arrDadosRecibo['idProcedimento'] = $params['id_procedimento']; 565 $arrDadosRecibo['idProcedimento'] = $params['id_procedimento'];
503 566
504 - if ($objCriterioIntercorrenteDTO->getStrSinCriterioPadrao() == 'S') { 567 + // Remententes
  568 + $contatoDTOUsuarioLogado = $this->getContatoDTOUsuarioLogado();
  569 + $idsRemententes = array();
  570 + $idsRemententes[] = $contatoDTOUsuarioLogado->getNumIdContato();
505 571
  572 + $estadosReabrirRelacionado = array(ProtocoloRN::$TE_PROCEDIMENTO_SOBRESTADO, ProtocoloRN::$TE_PROCEDIMENTO_ANEXADO, ProtocoloRN::$TE_PROCEDIMENTO_BLOQUEADO);
  573 + /**
  574 + * Verifica se:
  575 + * 1 - Se o processo eh sigiloso (nivel de acesso global ou local eh igual a 2)
  576 + * 2 - Se o Tipo do Processo do procedimento informado nao possui um intercorrente cadastrado(neste caso irah utilizar o Intercorrente Padrao)
  577 + */
  578 + if ($objCriterioIntercorrenteDTO->getStrSinCriterioPadrao() == 'S'
  579 + || $objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo() == ProtocoloRN::$NA_SIGILOSO
  580 + || $objProcedimentoDTO->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_SIGILOSO
  581 + || in_array($objProcedimentoDTO->getStrStaEstadoProtocolo(), $estadosReabrirRelacionado)) {
  582 +
  583 + $especificacao = 'Peticionamento Intercorrente relacionado ao Processo nº ' . $objProcedimentoDTO->getStrProtocoloProcedimentoFormatado();
  584 + $objSaidaGerarProcedimentoAPI = $this->gerarProcedimentoApi(array($objProcedimentoDTO, $objCriterioIntercorrenteDTO, $especificacao));
506 585
507 - $objSaidaGerarProcedimentoAPI = $this->gerarProcedimentoApi(array($objProcedimentoDTO, $objCriterioIntercorrenteDTO));  
508 $arrDadosRecibo['idProcedimentoRel'] = $params['id_procedimento']; 586 $arrDadosRecibo['idProcedimentoRel'] = $params['id_procedimento'];
509 $arrDadosRecibo['idProcedimento'] = $objSaidaGerarProcedimentoAPI->getIdProcedimento(); 587 $arrDadosRecibo['idProcedimento'] = $objSaidaGerarProcedimentoAPI->getIdProcedimento();
510 $params['id_procedimento'] = $objSaidaGerarProcedimentoAPI->getIdProcedimento(); 588 $params['id_procedimento'] = $objSaidaGerarProcedimentoAPI->getIdProcedimento();
511 - //$arrDadosRecibo['idProcedimento'] = ;  
512 - //$arrObjReciboDocPet = $this->retornarDocumentosRecibo($objSaidaGerarProcedimentoAPI);  
513 //Se possui critérios intercorrentes setta os documentos no processo existente 589 //Se possui critérios intercorrentes setta os documentos no processo existente
514 $this->setProcedimentoDTO($objSaidaGerarProcedimentoAPI->getIdProcedimento()); 590 $this->setProcedimentoDTO($objSaidaGerarProcedimentoAPI->getIdProcedimento());
515 - } else {  
516 -// var_dump('Padrão'); echo '</pre>'; exit;  
517 - $this->reabrirProcessoApi($objProcedimentoDTO); 591 + }
  592 +
  593 + //SE o criterio existe, e NAO é o criterio padrao, tenta incluir documento no proprio processo (caso o mesmo esteja aberto) ou reabrir o processo (caso o mesmo esteja fechado)
  594 + else if( $objCriterioIntercorrenteDTO != null &&
  595 + $objCriterioIntercorrenteDTO->getStrSinCriterioPadrao() == 'N') {
  596 +
  597 + //se for necessario, executar reabertura do processo
  598 + $reaberturaRN = new MdPetIntercorrenteReaberturaRN();
  599 +
  600 + if( $reaberturaRN->isNecessarioReabrirProcedimento( $objProcedimentoDTO ) ) {
  601 + $reaberturaRN->reabrirProcessoApi($objProcedimentoDTO);
  602 + }
  603 +
518 $this->setProcedimentoDTO($params['id_procedimento']); 604 $this->setProcedimentoDTO($params['id_procedimento']);
519 } 605 }
520 - $arrDocApi = MdPetIntercorrenteINT::montarArrDocumentoAPI($params['id_procedimento'],$params['hdnTbDocumento']);  
521 606
522 - /*  
523 - ini_set('xdebug.var_display_max_depth', 10); ini_set('xdebug.var_display_max_children', 256); ini_set('xdebug.var_display_max_data', 1024); echo '<pre>';  
524 - var_dump($arrDadosRecibo);  
525 - var_dump($objProcedimentoDTO);  
526 - var_dump($this->getProcedimentoDTO());  
527 - echo '</pre>'; exit;  
528 - */ 607 + $idUnidadeProcesso = $this->retornaUltimaUnidadeProcessoAberto($this->getProcedimentoDTO()->getDblIdProcedimento());
  608 +
  609 + //Remetentes
  610 + $idsParticipantes = array();
  611 +
  612 + $objParticipante = new ParticipanteDTO();
  613 + $objParticipante->setDblIdProtocolo($this->getProcedimentoDTO()->getDblIdProcedimento());
  614 + $objParticipante->setNumIdContato($this->getContatoDTOUsuarioLogado()->getNumIdContato());
  615 + $objParticipante->setNumIdUnidade($idUnidadeProcesso);
  616 + $objParticipante->setStrStaParticipacao(ParticipanteRN::$TP_REMETENTE);
  617 + $objParticipante->setNumSequencia(0);
  618 + $idsParticipantes[] = $objParticipante;
  619 +
  620 + //Interessados
  621 + // Processo Principal - Interessados
  622 + $objParticipanteProcPrincDTO = new ParticipanteDTO();
  623 + $objParticipanteProcPrincDTO->retNumIdParticipante();
  624 + $objParticipanteProcPrincDTO->retNumIdContato();
  625 + $objParticipanteProcPrincDTO->retNumIdUnidade();
  626 + $objParticipanteProcPrincDTO->retStrStaParticipacao();
  627 + $objParticipanteProcPrincDTO->retStrNomeContato();
  628 + $objParticipanteProcPrincDTO->retNumSequencia();
  629 + $objParticipanteProcPrincDTO->setDblIdProtocolo($objProcedimentoDTO->getDblIdProcedimento());
  630 + $objParticipanteProcPrincDTO->setStrStaParticipacao(ParticipanteRN::$TP_INTERESSADO);
  631 +
  632 + $objParticipanteProcPrincRN = new ParticipanteRN();
  633 + $arrobjParticipanteProcPrinc = $objParticipanteProcPrincRN->listarRN0189($objParticipanteProcPrincDTO);
  634 + // Processo Principal - Interessados - FIM
  635 +
  636 + // Processo - Interessados
  637 + $i=0;
  638 + foreach($arrobjParticipanteProcPrinc as $objParticipanteProcPrinc){
  639 + $objParticipante = new ParticipanteDTO();
  640 + $objParticipante->setDblIdProtocolo($this->getProcedimentoDTO()->getDblIdProcedimento());
  641 + $objParticipante->setNumIdContato($objParticipanteProcPrinc->getNumIdContato());
  642 + $objParticipante->setNumIdUnidade($objParticipanteProcPrinc->getNumIdUnidade());
  643 + $objParticipante->setStrStaParticipacao(ParticipanteRN::$TP_INTERESSADO);
  644 + $objParticipante->setNumSequencia($i);
  645 + $idsParticipantes[] = $objParticipante;
  646 + $i++;
  647 + }
  648 +
  649 + $objMdPetParticipanteRN = new MdPetParticipanteRN();
  650 + $arrInteressado = array();
  651 + $arrInteressado[0] = $this->getProcedimentoDTO()->getDblIdProcedimento();
  652 + $arrInteressado[1] = $idsParticipantes;
  653 + //$arrInteressado[2] = $idsRemententes;
  654 + $objMdPetParticipanteRN->setInteressadosRemetentesProcedimentoDocumento( $arrInteressado );
  655 + // Processo - Interessados - FIM
  656 +
  657 +
  658 + $arrDocApi = MdPetIntercorrenteINT::montarArrDocumentoAPI($params['id_procedimento'],$params['hdnTbDocumento']);
  659 +
  660 + $arrObjReciboDocPet = $this->incluirDocumentosApi($this->getProcedimentoDTO(), $arrDocApi);
529 661
530 - $arrObjReciboDocPet = $this->incluirDocumentosApi($this->getProcedimentoDTO(), $arrDocApi);  
531 $objReciboRN = new ReciboPeticionamentoRN(); 662 $objReciboRN = new ReciboPeticionamentoRN();
532 $objReciboDTO = $objReciboRN->gerarReciboSimplificadoIntercorrente($arrDadosRecibo); 663 $objReciboDTO = $objReciboRN->gerarReciboSimplificadoIntercorrente($arrDadosRecibo);
533 664
@@ -535,13 +666,64 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN { @@ -535,13 +666,64 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN {
535 $this->setReciboDTO($objReciboDTO); 666 $this->setReciboDTO($objReciboDTO);
536 $this->cadastrarReciboDocumentoAnexo(array($objReciboDTO, $arrObjReciboDocPet)); 667 $this->cadastrarReciboDocumentoAnexo(array($objReciboDTO, $arrObjReciboDocPet));
537 $documentoReciboDTO = $this->montarReciboIntercorrente($params); 668 $documentoReciboDTO = $this->montarReciboIntercorrente($params);
538 - $this->setDocumentoRecibo($documentoReciboDTO);  
539 - $this->enviarEmail($params); 669 +
  670 + //Remetentes
  671 + $idsParticipantes = array();
  672 +
  673 + $objParticipante = new ParticipanteDTO();
  674 + $objParticipante->setDblIdProtocolo($documentoReciboDTO->getDblIdDocumento());
  675 + $objParticipante->setNumIdContato($this->getContatoDTOUsuarioLogado()->getNumIdContato());
  676 + $objParticipante->setNumIdUnidade($idUnidadeProcesso);
  677 + $objParticipante->setStrStaParticipacao(ParticipanteRN::$TP_REMETENTE);
  678 + $objParticipante->setNumSequencia(0);
  679 + $idsParticipantes[] = $objParticipante;
  680 +
  681 + // Recibo - Interessados
  682 + $i=0;
  683 + foreach($arrobjParticipanteProcPrinc as $objParticipanteProcPrinc){
  684 + $objParticipante = new ParticipanteDTO();
  685 + $objParticipante->setDblIdProtocolo($documentoReciboDTO->getDblIdDocumento());
  686 + $objParticipante->setNumIdContato($objParticipanteProcPrinc->getNumIdContato());
  687 + $objParticipante->setNumIdUnidade($objParticipanteProcPrinc->getNumIdUnidade());
  688 + $objParticipante->setStrStaParticipacao(ParticipanteRN::$TP_INTERESSADO);
  689 + $objParticipante->setNumSequencia($i);
  690 + $idsParticipantes[] = $objParticipante;
  691 + $i++;
  692 + }
  693 +
  694 + $objMdPetParticipanteRN = new MdPetParticipanteRN();
  695 + $arrInteressado = array();
  696 + $arrInteressado[0] = $documentoReciboDTO->getDblIdDocumento();
  697 + $arrInteressado[1] = $idsParticipantes;
  698 + //$arrInteressado[2] = $idsRemententes;
  699 +
  700 + $objMdPetParticipanteRN->setInteressadosRemetentesProcedimentoDocumento( $arrInteressado );
  701 + // Recibo - Interessados - FIM
  702 +
  703 + $this->setDocumentoRecibo($documentoReciboDTO);
  704 + $this->enviarEmail($params);
540 return array( 705 return array(
541 'recibo' => $objReciboDTO, 706 'recibo' => $objReciboDTO,
542 'documento' => $documentoReciboDTO 707 'documento' => $documentoReciboDTO
543 ); 708 );
544 //Gerar Recibo e executar javascript para fechar janela filha e redirecionar janela pai para a tela de detalhes do recibo que foi gerado] 709 //Gerar Recibo e executar javascript para fechar janela filha e redirecionar janela pai para a tela de detalhes do recibo que foi gerado]
  710 +
  711 +
  712 + }
  713 +
  714 + // obtendo a ultima atividade informada para o processo, para marcar
  715 + // como nao visualizada, deixando assim o processo marcado como "vermelho"
  716 + // (status de Nao Visualizado) na listagem da tela "Controle de processos"
  717 + $atividadeDTO = new AtividadeDTO();
  718 + $atividadeDTO->retTodos();
  719 + $atividadeDTO->setDblIdProtocolo( $this->getProcedimentoDTO()->getDblIdProcedimento() );
  720 + $atividadeDTO->setOrd("IdAtividade", InfraDTO::$TIPO_ORDENACAO_DESC);
  721 + $ultimaAtividadeDTO = $atividadeRN->listarRN0036( $atividadeDTO );
  722 +
  723 + //alterar a ultima atividade criada para nao visualizado
  724 + if( $ultimaAtividadeDTO != null && count( $ultimaAtividadeDTO ) > 0){
  725 + $ultimaAtividadeDTO[0]->setNumTipoVisualizacao( AtividadeRN::$TV_NAO_VISUALIZADO );
  726 + $atividadeBD->alterar( $ultimaAtividadeDTO[0] );
545 } 727 }
546 728
547 return false; 729 return false;
@@ -713,5 +895,24 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN { @@ -713,5 +895,24 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN {
713 return $this->arrDocumentos; 895 return $this->arrDocumentos;
714 } 896 }
715 897
  898 + private function getContatoDTOUsuarioLogado(){
  899 +
  900 + $usuarioRN = new UsuarioRN();
  901 + $usuarioDTO = new UsuarioDTO();
  902 + $usuarioDTO->retNumIdUsuario();
  903 + $usuarioDTO->setNumIdUsuario( SessaoSEIExterna::getInstance()->getNumIdUsuarioExterno() );
  904 + $usuarioDTO->retNumIdContato();
  905 + $usuarioDTO->retStrNomeContato();
  906 + $usuarioDTO = $usuarioRN->consultarRN0489( $usuarioDTO );
  907 +
  908 + $contatoRN = new ContatoRN();
  909 + $contatoDTO = new ContatoDTO();
  910 + $contatoDTO->retTodos();
  911 + $contatoDTO->setNumIdContato( $usuarioDTO->getNumIdContato() );
  912 + $contatoDTO = $contatoRN->consultarRN0324( $contatoDTO );
  913 +
  914 + return $contatoDTO;
  915 + }
  916 +
716 } 917 }
717 ?> 918 ?>
718 \ No newline at end of file 919 \ No newline at end of file
sei/web/modulos/peticionamento/rn/MdPetIntercorrenteReaberturaRN.php 0 → 100644
@@ -0,0 +1,129 @@ @@ -0,0 +1,129 @@
  1 +<?php
  2 +/**
  3 + * ANATEL
  4 + *
  5 + * 20/02/2017 - criado por marcelo.bezerra - CAST
  6 + *
  7 + */
  8 +
  9 +require_once dirname(__FILE__).'/../../../SEI.php';
  10 +
  11 +class MdPetIntercorrenteReaberturaRN extends InfraRN {
  12 +
  13 + public function __construct(){
  14 + parent::__construct();
  15 + }
  16 +
  17 + protected function inicializarObjInfraIBanco(){
  18 + return BancoSEI::getInstance();
  19 + }
  20 +
  21 + /*
  22 + * Função responsável por verificar se o processo não está aberto em nenhuma unidade e se é necessário reabri-lo para poder inserir documentos nele
  23 + * */
  24 + public function isNecessarioReabrirProcedimentoConectado ( ProcedimentoDTO $objProcedimentoDTO ){
  25 +
  26 + $objSEIRN = new SeiRN();
  27 + //Reabre o Processo quando necessário de Critério Intercorrente
  28 + $objEntradaConsultaProcApi = new EntradaConsultarProcedimentoAPI();
  29 + $objEntradaConsultaProcApi->setIdProcedimento($objProcedimentoDTO->getDblIdProcedimento());
  30 + $objEntradaConsultaProcApi->setSinRetornarUnidadesProcedimentoAberto('S');
  31 +
  32 + $ret = $objSEIRN->consultarProcedimento($objEntradaConsultaProcApi);
  33 + $arrUnidadesAberto = $ret->getUnidadesProcedimentoAberto();
  34 +
  35 + if( count( $arrUnidadesAberto ) == 0 ){
  36 +
  37 + return true;
  38 + }
  39 +
  40 + return false;
  41 +
  42 + }
  43 +
  44 + /*
  45 + * Função responsável pela reabertura de processo
  46 + * */
  47 + protected function reabrirProcessoApiConectado(ProcedimentoDTO $objProcedimentoDTO) {
  48 +
  49 + $objSEIRN = new SeiRN();
  50 + //Reabre o Processo quando necessário de Critério Intercorrente
  51 + $objEntradaConsultaProcApi = new EntradaConsultarProcedimentoAPI();
  52 + $objEntradaConsultaProcApi->setIdProcedimento($objProcedimentoDTO->getDblIdProcedimento());
  53 + $objEntradaConsultaProcApi->setSinRetornarUnidadesProcedimentoAberto('S');
  54 +
  55 + $ret = $objSEIRN->consultarProcedimento($objEntradaConsultaProcApi);
  56 + $arrUnidadesAberto = $ret->getUnidadesProcedimentoAberto();
  57 + $unidadesAberto = count($arrUnidadesAberto);
  58 +
  59 + if ($unidadesAberto < 0) {
  60 + return false;
  61 + }
  62 +
  63 + $objAtividadeDTO = new AtividadeDTO();
  64 + $objAtividadeDTO->setDblIdProcedimentoProtocolo($objProcedimentoDTO->getDblIdProcedimento());
  65 + $idUnidadeReabrirProcesso = $this->retornaUltimaUnidadeProcessoConcluido($objAtividadeDTO);
  66 +
  67 + $unidadeDTO = new UnidadeDTO();
  68 + $unidadeDTO->retTodos();
  69 + $unidadeDTO->setBolExclusaoLogica(false);
  70 + $unidadeDTO->setNumIdUnidade($idUnidadeReabrirProcesso);
  71 + $unidadeRN = new UnidadeRN();
  72 + $objUnidadeDTO = $unidadeRN->consultarRN0125($unidadeDTO);
  73 +
  74 + if($objUnidadeDTO->getStrSinAtivo() == 'N'){
  75 + $idUnidadeReabrirProcesso = null;
  76 + $objAtividadeRN = new AtividadeRN();
  77 + $arrObjUnidadeDTO = $objAtividadeRN->listarUnidadesTramitacao($objProcedimentoDTO);
  78 + foreach ($arrObjUnidadeDTO as $itemObjUnidadeDTO) {
  79 + if ($itemObjUnidadeDTO->getStrSinAtivo() == 'S') {
  80 + $idUnidadeReabrirProcesso = $itemObjUnidadeDTO->getNumIdUnidade();
  81 + break;
  82 + }
  83 + }
  84 + }
  85 +
  86 + if (!$idUnidadeReabrirProcesso) {
  87 + return false;
  88 + }
  89 +
  90 + $this->simularLogin($idUnidadeReabrirProcesso);
  91 +
  92 + $objEntradaReabrirProcessoAPI = new EntradaReabrirProcessoAPI();
  93 + $objEntradaReabrirProcessoAPI->setIdProcedimento($objProcedimentoDTO->getDblIdProcedimento());
  94 + $objEntradaReabrirProcessoAPI->setProtocoloProcedimento($objProcedimentoDTO->getStrProtocoloProcedimentoFormatado());
  95 +
  96 + $objSEIRN->reabrirProcesso($objEntradaReabrirProcessoAPI);
  97 + return true;
  98 + }
  99 +
  100 + private function simularLogin($idUnidade)
  101 + {
  102 + SessaoSEI::getInstance()->simularLogin(null, null, SessaoSEIExterna::getInstance()->getNumIdUsuarioExterno(), $idUnidade);
  103 + //$this->setUnidadeDTO($idUnidade);
  104 + }
  105 +
  106 + /**
  107 + * Retorna a ultima unidade que o processo foi
  108 + * Pesquisa o processo exatamente como foi digitado SEM considerar a formatação
  109 + * @access protected
  110 + * @author Jaqueline Mendes <jaqueline.mendes@cast.com.br>
  111 + * @param ProtocoloDTO $parObjProtocoloDTO
  112 + * @return mixed
  113 + */
  114 + protected function retornaUltimaUnidadeProcessoConcluidoConectado(AtividadeDTO $objAtividadeDTO){
  115 +
  116 + $idUnidadeReabrirProcesso = null;
  117 + $objAtividadeRN = new AtividadeRN();
  118 + $objAtividadeDTO->retDthConclusao();
  119 + $objAtividadeDTO->retNumIdUnidade();
  120 + $objAtividadeDTO->setOrdDthConclusao(InfraDTO::$TIPO_ORDENACAO_DESC);
  121 + $arrObjAtividadeDTO = $objAtividadeRN->listarRN0036($objAtividadeDTO);
  122 + $objUltimaAtvProcesso = count($arrObjAtividadeDTO) > 0 ? current($arrObjAtividadeDTO) : null;
  123 + if(!is_null($objUltimaAtvProcesso)) {
  124 + $idUnidadeReabrirProcesso = $objUltimaAtvProcesso->getNumIdUnidade();
  125 + }
  126 +
  127 + return $idUnidadeReabrirProcesso;
  128 + }
  129 +}
0 \ No newline at end of file 130 \ No newline at end of file
sei/web/modulos/peticionamento/rn/MdPetParticipanteRN.php 0 → 100644
@@ -0,0 +1,120 @@ @@ -0,0 +1,120 @@
  1 +<?
  2 +/**
  3 +* ANATEL
  4 +*
  5 +* 28/06/2016 - criado por marcelo.bezerra - CAST
  6 +*
  7 +*/
  8 +
  9 +require_once dirname(__FILE__).'/../../../SEI.php';
  10 +
  11 +class MdPetParticipanteRN extends InfraRN {
  12 +
  13 + public function __construct() {
  14 +
  15 + session_start();
  16 +
  17 + //////////////////////////////////////////////////////////////////////////////
  18 + InfraDebug::getInstance()->setBolLigado(false);
  19 + InfraDebug::getInstance()->setBolDebugInfra(false);
  20 + InfraDebug::getInstance()->limpar();
  21 + //////////////////////////////////////////////////////////////////////////////
  22 +
  23 + parent::__construct ();
  24 + }
  25 +
  26 + protected function inicializarObjInfraIBanco() {
  27 + return BancoSEI::getInstance ();
  28 + }
  29 +
  30 + private function getContatoDTOUsuarioLogado(){
  31 +
  32 + $usuarioRN = new UsuarioRN();
  33 + $usuarioDTO = new UsuarioDTO();
  34 + $usuarioDTO->retNumIdUsuario();
  35 + $usuarioDTO->setNumIdUsuario( SessaoSEIExterna::getInstance()->getNumIdUsuarioExterno() );
  36 + $usuarioDTO->retNumIdContato();
  37 + $usuarioDTO->retStrNomeContato();
  38 + $usuarioDTO = $usuarioRN->consultarRN0489( $usuarioDTO );
  39 +
  40 + $contatoRN = new ContatoRN();
  41 + $contatoDTO = new ContatoDTO();
  42 + $contatoDTO->retTodos();
  43 + $contatoDTO->setNumIdContato( $usuarioDTO->getNumIdContato() );
  44 + $contatoDTO = $contatoRN->consultarRN0324( $contatoDTO );
  45 +
  46 + return $contatoDTO;
  47 + }
  48 +
  49 + public function setInteressadosRemetentesProcedimentoDocumentoControlado($arrParam){
  50 +
  51 + if (isset($arrParam[0])) {
  52 + $protocolo = $arrParam[0];
  53 + }else{
  54 + $protocolo = null;
  55 + }
  56 + if (isset($arrParam[1])) {
  57 + $participantes = $arrParam[1];
  58 + }else{
  59 + $participantes = null;
  60 + }
  61 +
  62 +
  63 + // documento_cadastro.php - criação de objeto
  64 +// $objProtocoloInteressadoDTO = new ProtocoloDTO();
  65 +
  66 + // documento_cadastro.php linha 292
  67 + //$arrObjParticipantesDTO = array();
  68 +
  69 + $arrObjParticipantesDTO = $participantes;
  70 +
  71 +// $objProtocoloInteressadoDTO->setDblIdProtocolo($protocolo);
  72 +// $objProtocoloInteressadoDTO->setArrObjParticipanteDTO($arrObjParticipantesDTO);
  73 +
  74 + // ProtocoloRN.php linha 514 fazendo parte da protected function alterarRN0203Controlado(ProtocoloDTO $objProtocoloDTO){
  75 +
  76 + // PROTOCOLO - participantes já cadastrados
  77 + $objParticipanteDTO = new ParticipanteDTO();
  78 + $objParticipanteDTO->retNumIdParticipante();
  79 + $objParticipanteDTO->retNumIdContato();
  80 + $objParticipanteDTO->retNumIdUnidade();
  81 + $objParticipanteDTO->retStrStaParticipacao();
  82 + $objParticipanteDTO->retStrNomeContato();
  83 + $objParticipanteDTO->retNumSequencia();
  84 + $objParticipanteDTO->setDblIdProtocolo($protocolo);
  85 +
  86 + $objParticipanteRN = new ParticipanteRN();
  87 + $arrParticipantesAntigos = $objParticipanteRN->listarRN0189($objParticipanteDTO);
  88 +
  89 +// $arrParticipantesNovos = $objProtocoloInteressadoDTO->getArrObjParticipanteDTO();
  90 + $arrParticipantesNovos = $arrObjParticipantesDTO;
  91 +
  92 + foreach($arrParticipantesNovos as $participanteNovo){
  93 + $flagCadastrar = true;
  94 + $objParticipanteDTOAntigo = null;
  95 +
  96 + foreach($arrParticipantesAntigos as $participanteAntigo){
  97 + if ($participanteNovo->getNumIdContato()=== $participanteAntigo->getNumIdContato() &&
  98 + $participanteNovo->getStrStaParticipacao()=== $participanteAntigo->getStrStaParticipacao()){
  99 + $objParticipanteDTOAntigo = $participanteAntigo;
  100 + $flagCadastrar = false;
  101 + break;
  102 + }
  103 + }
  104 +
  105 + if ($flagCadastrar){
  106 + //$participanteNovo->setDblIdProtocolo($objProtocoloInteressadoDTO->getDblIdProtocolo());
  107 + //$participanteNovo->setNumIdUnidade(SessaoSEIExterna::getInstance()->getNumIdUnidadeAtual());
  108 + $objParticipanteRN->cadastrarRN0170($participanteNovo);
  109 + }else if ($participanteNovo->getNumSequencia()!=$objParticipanteDTOAntigo->getNumSequencia()){
  110 + //altera sequencia
  111 + $participanteNovo->setNumIdParticipante($participanteAntigo->getNumIdParticipante());
  112 + //garante que não vai alterar a unidade
  113 + $participanteNovo->unSetNumIdUnidade();
  114 + $objParticipanteRN->alterarRN0889($participanteNovo);
  115 + }
  116 + }
  117 +
  118 + }
  119 +}
  120 +?>
0 \ No newline at end of file 121 \ No newline at end of file
sei/web/modulos/peticionamento/rn/ProcessoPeticionamentoRN.php
@@ -84,9 +84,14 @@ class ProcessoPeticionamentoRN extends InfraRN { @@ -84,9 +84,14 @@ class ProcessoPeticionamentoRN extends InfraRN {
84 } 84 }
85 85
86 protected function gerarProcedimentoControlado( $arrParametros ){ 86 protected function gerarProcedimentoControlado( $arrParametros ){
87 -  
88 - try {  
89 - 87 + try {
  88 +
  89 + $contatoDTOUsuarioLogado = $this->getContatoDTOUsuarioLogado();
  90 +
  91 + //Remententes
  92 + $idsRemententes = array();
  93 + $idsRemententes[] = $contatoDTOUsuarioLogado->getNumIdContato();
  94 +
90 $idTipoProc = $arrParametros['id_tipo_procedimento']; 95 $idTipoProc = $arrParametros['id_tipo_procedimento'];
91 $objTipoProcDTO = new TipoProcessoPeticionamentoDTO(); 96 $objTipoProcDTO = new TipoProcessoPeticionamentoDTO();
92 $objTipoProcDTO->retTodos(true); 97 $objTipoProcDTO->retTodos(true);
@@ -129,19 +134,25 @@ class ProcessoPeticionamentoRN extends InfraRN { @@ -129,19 +134,25 @@ class ProcessoPeticionamentoRN extends InfraRN {
129 $unidadeDTO = $unidadeRN->consultarRN0125( $unidadeDTO ); 134 $unidadeDTO = $unidadeRN->consultarRN0125( $unidadeDTO );
130 135
131 $protocoloRN = new ProtocoloPeticionamentoRN(); 136 $protocoloRN = new ProtocoloPeticionamentoRN();
132 -  
133 - $arrParticipantesParametro = array();  
134 - 137 +
  138 + //seiv2
  139 + //$arrParticipantesParametro = array();
  140 + //$arrObjInteressadoAPI = array();
  141 +
135 if( $objTipoProcDTO->getStrSinIIProprioUsuarioExterno() == 'S' ){ 142 if( $objTipoProcDTO->getStrSinIIProprioUsuarioExterno() == 'S' ){
136 -  
137 - $contatoDTOUsuarioLogado = $this->getContatoDTOUsuarioLogado(); 143 +
138 $arrParametros['hdnListaInteressados'] = $contatoDTOUsuarioLogado->getNumIdContato(); 144 $arrParametros['hdnListaInteressados'] = $contatoDTOUsuarioLogado->getNumIdContato();
  145 +
  146 + // Interessados
139 $idsContatos = array(); 147 $idsContatos = array();
140 $idsContatos[] = $arrParametros['hdnListaInteressados']; 148 $idsContatos[] = $arrParametros['hdnListaInteressados'];
141 -  
142 - $arrParticipantesParametro = $this->atribuirParticipantes( $this->montarArrContatosInteressados( $idsContatos ) ); 149 + $idsContatos = array_merge($idsRemententes, $idsContatos);
  150 +
  151 + //seiv3 refatoraçao
  152 + //$arrParticipantesParametro = $this->atribuirParticipantes( $this->montarArrContatosInteressados( $idsContatos ) );
  153 +
143 } 154 }
144 - 155 +
145 //verificar se esta vindo o array de participantes 156 //verificar se esta vindo o array de participantes
146 //participantes selecionados via pop up OU indicados diretamente por CPF/CNPJ 157 //participantes selecionados via pop up OU indicados diretamente por CPF/CNPJ
147 else if( $objTipoProcDTO->getStrSinIIProprioUsuarioExterno() == 'N' && 158 else if( $objTipoProcDTO->getStrSinIIProprioUsuarioExterno() == 'N' &&
@@ -151,17 +162,21 @@ class ProcessoPeticionamentoRN extends InfraRN { @@ -151,17 +162,21 @@ class ProcessoPeticionamentoRN extends InfraRN {
151 $arrContatosInteressados = array(); 162 $arrContatosInteressados = array();
152 163
153 if (strpos( $arrParametros['hdnListaInteressados'] , ',') !== false) { 164 if (strpos( $arrParametros['hdnListaInteressados'] , ',') !== false) {
  165 + // Interessados
154 $idsContatos = split(",", $arrParametros['hdnListaInteressados']); 166 $idsContatos = split(",", $arrParametros['hdnListaInteressados']);
155 } else { 167 } else {
  168 + // Interessados
156 $idsContatos = array(); 169 $idsContatos = array();
157 $idsContatos[] = $arrParametros['hdnListaInteressados']; 170 $idsContatos[] = $arrParametros['hdnListaInteressados'];
158 } 171 }
159 - 172 +
160 //seiv3 refatoraçao 173 //seiv3 refatoraçao
161 - $arrParticipantesParametro = $this->atribuirParticipantes( $this->montarArrContatosInteressados( $idsContatos ) );  
162 - 174 + //$arrParticipantesParametro = $this->atribuirParticipantes( $this->montarArrContatosInteressados( $idsContatos ) );
  175 +
163 } 176 }
164 - 177 +
  178 + $idsContatos = array_unique($idsContatos);
  179 +
165 //Gera um processo 180 //Gera um processo
166 $objProcedimentoAPI = new ProcedimentoAPI(); 181 $objProcedimentoAPI = new ProcedimentoAPI();
167 $objProcedimentoAPI->setIdTipoProcedimento( $objTipoProcDTO->getNumIdProcedimento() ); 182 $objProcedimentoAPI->setIdTipoProcedimento( $objTipoProcDTO->getNumIdProcedimento() );
@@ -169,7 +184,10 @@ class ProcessoPeticionamentoRN extends InfraRN { @@ -169,7 +184,10 @@ class ProcessoPeticionamentoRN extends InfraRN {
169 $objProcedimentoAPI->setIdUnidadeGeradora( $unidadeDTO->getNumIdUnidade() ); 184 $objProcedimentoAPI->setIdUnidadeGeradora( $unidadeDTO->getNumIdUnidade() );
170 $objProcedimentoAPI->setEspecificacao( $arrParametros['txtEspecificacaoDocPrincipal'] ); 185 $objProcedimentoAPI->setEspecificacao( $arrParametros['txtEspecificacaoDocPrincipal'] );
171 $objProcedimentoAPI->setNumeroProtocolo(''); 186 $objProcedimentoAPI->setNumeroProtocolo('');
  187 +
  188 + //seiv2
172 //$objProcedimentoAPI->setInteressados( $arrParticipantesParametro ); 189 //$objProcedimentoAPI->setInteressados( $arrParticipantesParametro );
  190 +
173 $objEntradaGerarProcedimentoAPI = new EntradaGerarProcedimentoAPI(); 191 $objEntradaGerarProcedimentoAPI = new EntradaGerarProcedimentoAPI();
174 $objEntradaGerarProcedimentoAPI->setProcedimento($objProcedimentoAPI); 192 $objEntradaGerarProcedimentoAPI->setProcedimento($objProcedimentoAPI);
175 193
@@ -178,7 +196,40 @@ class ProcessoPeticionamentoRN extends InfraRN { @@ -178,7 +196,40 @@ class ProcessoPeticionamentoRN extends InfraRN {
178 196
179 //$objSaidaGerarProcedimentoAPI = new SaidaGerarProcedimentoAPI(); 197 //$objSaidaGerarProcedimentoAPI = new SaidaGerarProcedimentoAPI();
180 $objSaidaGerarProcedimentoAPI = $objSeiRN->gerarProcedimento($objEntradaGerarProcedimentoAPI); 198 $objSaidaGerarProcedimentoAPI = $objSeiRN->gerarProcedimento($objEntradaGerarProcedimentoAPI);
181 - 199 +
  200 + //seiv3
  201 + //Remetentes
  202 + $idsParticipantes = array();
  203 +
  204 + $objParticipante = new ParticipanteDTO();
  205 + $objParticipante->setDblIdProtocolo($objSaidaGerarProcedimentoAPI->getIdProcedimento());
  206 + $objParticipante->setNumIdContato($this->getContatoDTOUsuarioLogado()->getNumIdContato());
  207 + $objParticipante->setNumIdUnidade($unidadeDTO->getNumIdUnidade());
  208 + $objParticipante->setStrStaParticipacao(ParticipanteRN::$TP_REMETENTE);
  209 + $objParticipante->setNumSequencia(0);
  210 + $idsParticipantes[] = $objParticipante;
  211 +
  212 + // Processo - Interessados
  213 + $i=0;
  214 + foreach($idsContatos as $interessado){
  215 + $objParticipante = new ParticipanteDTO();
  216 + $objParticipante->setDblIdProtocolo($objSaidaGerarProcedimentoAPI->getIdProcedimento());
  217 + $objParticipante->setNumIdContato($interessado);
  218 + $objParticipante->setNumIdUnidade($unidadeDTO->getNumIdUnidade());
  219 + $objParticipante->setStrStaParticipacao(ParticipanteRN::$TP_INTERESSADO);
  220 + $objParticipante->setNumSequencia($i);
  221 + $idsParticipantes[] = $objParticipante;
  222 + $i++;
  223 + }
  224 +
  225 + $objMdPetParticipanteRN = new MdPetParticipanteRN();
  226 + $arrInteressado = array();
  227 + $arrInteressado[0] = $objSaidaGerarProcedimentoAPI->getIdProcedimento();
  228 + $arrInteressado[1] = $idsParticipantes;
  229 +
  230 + $objMdPetParticipanteRN->setInteressadosRemetentesProcedimentoDocumento( $arrInteressado );
  231 + // Processo - Interessados - FIM
  232 +
182 //gerando recibo e adicionando recibo NAO ASSINADO ao processo 233 //gerando recibo e adicionando recibo NAO ASSINADO ao processo
183 $reciboPeticionamentoRN = new ReciboPeticionamentoRN(); 234 $reciboPeticionamentoRN = new ReciboPeticionamentoRN();
184 $reciboDTOBasico = $reciboPeticionamentoRN->gerarReciboSimplificado( $objSaidaGerarProcedimentoAPI->getIdProcedimento() ); 235 $reciboDTOBasico = $reciboPeticionamentoRN->gerarReciboSimplificado( $objSaidaGerarProcedimentoAPI->getIdProcedimento() );
@@ -194,24 +245,28 @@ class ProcessoPeticionamentoRN extends InfraRN { @@ -194,24 +245,28 @@ class ProcessoPeticionamentoRN extends InfraRN {
194 $objProcedimentoDTO->setDblIdProcedimento( $objSaidaGerarProcedimentoAPI->getIdProcedimento() ); 245 $objProcedimentoDTO->setDblIdProcedimento( $objSaidaGerarProcedimentoAPI->getIdProcedimento() );
195 $objProcedimentoDTO->setStrProtocoloProcedimentoFormatado( $objSaidaConsultarProcedimentoAPI->getProcedimentoFormatado() ); 246 $objProcedimentoDTO->setStrProtocoloProcedimentoFormatado( $objSaidaConsultarProcedimentoAPI->getProcedimentoFormatado() );
196 $objProcedimentoDTO->setNumIdTipoProcedimento( $objSaidaConsultarProcedimentoAPI->getTipoProcedimento()->getIdTipoProcedimento() ); 247 $objProcedimentoDTO->setNumIdTipoProcedimento( $objSaidaConsultarProcedimentoAPI->getTipoProcedimento()->getIdTipoProcedimento() );
197 -  
198 - $this->montarArrDocumentos( $arrParametros, $unidadeDTO, $objProcedimentoDTO,  
199 - $arrParticipantesParametro, $reciboDTOBasico );  
200 - 248 +
  249 + //seiv2
  250 + //$this->montarArrDocumentos( $arrParametros, $unidadeDTO, $objProcedimentoDTO,
  251 + // $arrParticipantesParametro, $reciboDTOBasico );
  252 + //seiv3
  253 + $this->montarArrDocumentos( $arrParametros, $unidadeDTO, $objProcedimentoDTO, $reciboDTOBasico );
  254 +
201 $arrParams = array(); 255 $arrParams = array();
202 $arrParams[0] = $arrParametros; 256 $arrParams[0] = $arrParametros;
203 $arrParams[1] = $unidadeDTO; 257 $arrParams[1] = $unidadeDTO;
204 $arrParams[2] = $objProcedimentoDTO; 258 $arrParams[2] = $objProcedimentoDTO;
205 - $arrParams[3] = $arrParticipantesParametro; 259 + //seiv2
  260 + //$arrParams[3] = $arrParticipantesParametro;
206 $arrParams[4] = $reciboDTOBasico; 261 $arrParams[4] = $reciboDTOBasico;
207 -  
208 - $reciboPeticionamentoRN->montarRecibo( $arrParams ); 262 +
  263 + $reciboGerado = $reciboPeticionamentoRN->montarRecibo( $arrParams );
209 264
210 $arrProcessoReciboRetorno = array(); 265 $arrProcessoReciboRetorno = array();
211 $arrProcessoReciboRetorno[0] = $reciboDTOBasico; 266 $arrProcessoReciboRetorno[0] = $reciboDTOBasico;
212 $arrProcessoReciboRetorno[1] = $objProcedimentoDTO; 267 $arrProcessoReciboRetorno[1] = $objProcedimentoDTO;
213 -  
214 - //enviando email de sistema EU 5155 / 5156 - try catch por causa que em localhost o envio de email gera erro 268 +
  269 + //enviando email de sistema EU 5155 / 5156 - try catch por causa que em localhost o envio de email gera erro
215 try { 270 try {
216 $emailNotificacaoPeticionamentoRN = new EmailNotificacaoPeticionamentoRN(); 271 $emailNotificacaoPeticionamentoRN = new EmailNotificacaoPeticionamentoRN();
217 $emailNotificacaoPeticionamentoRN->notificaoPeticionamentoExterno( $arrParams ); 272 $emailNotificacaoPeticionamentoRN->notificaoPeticionamentoExterno( $arrParams );
@@ -229,7 +284,41 @@ class ProcessoPeticionamentoRN extends InfraRN { @@ -229,7 +284,41 @@ class ProcessoPeticionamentoRN extends InfraRN {
229 284
230 //removendo as tarefas do tipo "Disponibilizado acesso externo para @INTERESSADO@" 285 //removendo as tarefas do tipo "Disponibilizado acesso externo para @INTERESSADO@"
231 foreach( $arrDocsProcesso as $DocumentoProcessoDTO ){ 286 foreach( $arrDocsProcesso as $DocumentoProcessoDTO ){
  287 +
  288 + //seiv3
  289 + //Remetentes
  290 + $idsParticipantes = array();
  291 +
  292 + $objParticipante = new ParticipanteDTO();
  293 + $objParticipante->setDblIdProtocolo($DocumentoProcessoDTO->getDblIdDocumento());
  294 + $objParticipante->setNumIdContato($this->getContatoDTOUsuarioLogado()->getNumIdContato());
  295 + $objParticipante->setNumIdUnidade($unidadeDTO->getNumIdUnidade());
  296 + $objParticipante->setStrStaParticipacao(ParticipanteRN::$TP_REMETENTE);
  297 + $objParticipante->setNumSequencia(0);
  298 + $idsParticipantes[] = $objParticipante;
  299 +
  300 + // Documento - Interessados
  301 + $i=0;
  302 + //foreach($arrobjParticipanteProcPrinc as $objParticipanteProcPrinc){
  303 + foreach($idsContatos as $interessado){
  304 + $objParticipante = new ParticipanteDTO();
  305 + $objParticipante->setDblIdProtocolo($DocumentoProcessoDTO->getDblIdDocumento());
  306 + $objParticipante->setNumIdContato($interessado);
  307 + $objParticipante->setNumIdUnidade($unidadeDTO->getNumIdUnidade());
  308 + $objParticipante->setStrStaParticipacao(ParticipanteRN::$TP_INTERESSADO);
  309 + $objParticipante->setNumSequencia($i);
  310 + $idsParticipantes[] = $objParticipante;
  311 + $i++;
  312 + }
  313 +
  314 + $objMdPetParticipanteRN = new MdPetParticipanteRN();
  315 + $arrInteressado = array();
  316 + $arrInteressado[0] = $DocumentoProcessoDTO->getDblIdDocumento();
  317 + $arrInteressado[1] = $idsParticipantes;
232 318
  319 + $objMdPetParticipanteRN->setInteressadosRemetentesProcedimentoDocumento( $arrInteressado );
  320 + // Documento - Interessados - FIM
  321 +
233 $objAtividadeDTOLiberacao = new AtividadeDTO(); 322 $objAtividadeDTOLiberacao = new AtividadeDTO();
234 $objAtividadeDTOLiberacao->retTodos(); 323 $objAtividadeDTOLiberacao->retTodos();
235 $objAtividadeDTOLiberacao->setDblIdProtocolo( $objProcedimentoDTO->getDblIdProcedimento() ); 324 $objAtividadeDTOLiberacao->setDblIdProtocolo( $objProcedimentoDTO->getDblIdProcedimento() );
@@ -304,11 +393,10 @@ class ProcessoPeticionamentoRN extends InfraRN { @@ -304,11 +393,10 @@ class ProcessoPeticionamentoRN extends InfraRN {
304 return $saidaDocExternoAPI; 393 return $saidaDocExternoAPI;
305 394
306 } 395 }
307 - 396 +
308 private function montarArrDocumentos( $arrParametros , $objUnidadeDTO , 397 private function montarArrDocumentos( $arrParametros , $objUnidadeDTO ,
309 - $objProcedimentoDTO , $arrParticipantesParametro ,  
310 - $reciboDTOBasico ){  
311 - 398 + $objProcedimentoDTO , $reciboDTOBasico ){
  399 +
312 //tentando simular sessao de usuario interno do SEI 400 //tentando simular sessao de usuario interno do SEI
313 SessaoSEI::getInstance()->setNumIdUnidadeAtual( $objUnidadeDTO->getNumIdUnidade() ); 401 SessaoSEI::getInstance()->setNumIdUnidadeAtual( $objUnidadeDTO->getNumIdUnidade() );
314 SessaoSEI::getInstance()->setNumIdUsuario( SessaoSEIExterna::getInstance()->getNumIdUsuarioExterno() ); 402 SessaoSEI::getInstance()->setNumIdUsuario( SessaoSEIExterna::getInstance()->getNumIdUsuarioExterno() );
@@ -316,7 +404,7 @@ class ProcessoPeticionamentoRN extends InfraRN { @@ -316,7 +404,7 @@ class ProcessoPeticionamentoRN extends InfraRN {
316 $objDocumentoPeticionamentoRN = new DocumentoPeticionamentoRN(); 404 $objDocumentoPeticionamentoRN = new DocumentoPeticionamentoRN();
317 405
318 $arrDocumentoDTO = array(); 406 $arrDocumentoDTO = array();
319 - 407 +
320 //verificar se foi editado documento principal gerado pelo editor do SEI 408 //verificar se foi editado documento principal gerado pelo editor do SEI
321 if( isset( $arrParametros['docPrincipalConteudoHTML'] ) && $arrParametros['docPrincipalConteudoHTML'] != "" ){ 409 if( isset( $arrParametros['docPrincipalConteudoHTML'] ) && $arrParametros['docPrincipalConteudoHTML'] != "" ){
322 410
@@ -330,10 +418,14 @@ class ProcessoPeticionamentoRN extends InfraRN { @@ -330,10 +418,14 @@ class ProcessoPeticionamentoRN extends InfraRN {
330 //==================================== 418 //====================================
331 //gera no sistema as informações referentes ao documento principal 419 //gera no sistema as informações referentes ao documento principal
332 //==================================== 420 //====================================
  421 + //seiv2
  422 + //$documentoDTOPrincipal = $this->montarDocumentoPrincipal( $objProcedimentoDTO,
  423 + // $objTipoProcDTO, $objUnidadeDTO,
  424 + // $arrParticipantesParametro, $arrParametros );
  425 + //seiv3
333 $documentoDTOPrincipal = $this->montarDocumentoPrincipal( $objProcedimentoDTO, 426 $documentoDTOPrincipal = $this->montarDocumentoPrincipal( $objProcedimentoDTO,
334 - $objTipoProcDTO, $objUnidadeDTO,  
335 - $arrParticipantesParametro, $arrParametros );  
336 - 427 + $objTipoProcDTO, $objUnidadeDTO, $arrParametros );
  428 +
337 //==================================== 429 //====================================
338 //ASSINAR O DOCUMENTO PRINCIPAL 430 //ASSINAR O DOCUMENTO PRINCIPAL
339 //==================================== 431 //====================================
@@ -348,9 +440,9 @@ class ProcessoPeticionamentoRN extends InfraRN { @@ -348,9 +440,9 @@ class ProcessoPeticionamentoRN extends InfraRN {
348 $reciboDocAnexoDTO->setNumIdDocumento( $documentoDTOPrincipal->getDblIdDocumento() ); 440 $reciboDocAnexoDTO->setNumIdDocumento( $documentoDTOPrincipal->getDblIdDocumento() );
349 $reciboDocAnexoDTO->setStrClassificacaoDocumento( ReciboDocumentoAnexoPeticionamentoRN::$TP_PRINCIPAL ); 441 $reciboDocAnexoDTO->setStrClassificacaoDocumento( ReciboDocumentoAnexoPeticionamentoRN::$TP_PRINCIPAL );
350 $reciboDocAnexoDTO = $reciboDocAnexoRN->cadastrar( $reciboDocAnexoDTO ); 442 $reciboDocAnexoDTO = $reciboDocAnexoRN->cadastrar( $reciboDocAnexoDTO );
351 - 443 +
352 } 444 }
353 - 445 +
354 //verificar se o documento principal é do tipo externo (ANEXO) 446 //verificar se o documento principal é do tipo externo (ANEXO)
355 else { 447 else {
356 448
@@ -444,32 +536,27 @@ class ProcessoPeticionamentoRN extends InfraRN { @@ -444,32 +536,27 @@ class ProcessoPeticionamentoRN extends InfraRN {
444 //se setar array da unidade pode cair na regra: "Unidade <nome-Unidade> não está sinalizada como protocolo." 536 //se setar array da unidade pode cair na regra: "Unidade <nome-Unidade> não está sinalizada como protocolo."
445 //nao esta fazendo reabertura de processo - trata-se de processo novo 537 //nao esta fazendo reabertura de processo - trata-se de processo novo
446 $objDocumentoDTO->setArrObjUnidadeDTO($arrObjUnidadeDTOReabertura); 538 $objDocumentoDTO->setArrObjUnidadeDTO($arrObjUnidadeDTOReabertura);
447 -  
448 - //INTERESSADOS E REMETENTES  
449 - $arrObjParticipantesDTO = array();  
450 -  
451 - //o proprio usuario externo logado é remetente do documento  
452 - $contatoDTO = $this->getContatoDTOUsuarioLogado();  
453 -  
454 - $remetenteDTO = new ParticipanteDTO();  
455 - $remetenteRN = new ParticipanteRN();  
456 - $remetenteDTO->retTodos();  
457 - $remetenteDTO->setStrStaParticipacao( ParticipanteRN::$TP_REMETENTE );  
458 - $remetenteDTO->setNumIdContato( $contatoDTO->getNumIdContato() );  
459 - $remetenteDTO->setNumIdUnidade( $objUnidadeDTO->getNumIdUnidade() );  
460 - $remetenteDTO->setNumSequencia(0);  
461 -  
462 - $arrObjParticipantesDTO = $arrParticipantesParametro;  
463 - $arrObjParticipantesDTO[] = $remetenteDTO;  
464 - 539 +
  540 + //seiv2
  541 + //$remetenteDTO = new ParticipanteDTO();
  542 + //$remetenteRN = new ParticipanteRN();
  543 + //$remetenteDTO->retTodos();
  544 + //$remetenteDTO->setStrStaParticipacao( ParticipanteRN::$TP_REMETENTE );
  545 + //$remetenteDTO->setNumIdContato( $contatoDTO->getNumIdContato() );
  546 + //$remetenteDTO->setNumIdUnidade( $objUnidadeDTO->getNumIdUnidade() );
  547 + //$remetenteDTO->setNumSequencia(0);
  548 +
  549 + //seiv2
  550 + //$arrObjParticipantesDTO = $arrParticipantesParametro;
  551 + //$arrObjParticipantesDTO[] = $remetenteDTO;
  552 +
465 $objDocumentoDTO->setNumIdTextoPadraoInterno(''); 553 $objDocumentoDTO->setNumIdTextoPadraoInterno('');
466 $objDocumentoDTO->setStrProtocoloDocumentoTextoBase(''); 554 $objDocumentoDTO->setStrProtocoloDocumentoTextoBase('');
467 -  
468 $objDocumentoDTO->setNumIdSerie( $idSerieAnexo ); 555 $objDocumentoDTO->setNumIdSerie( $idSerieAnexo );
469 $objDocumentoDTO->setStrStaDocumento(DocumentoRN::$TD_EXTERNO); 556 $objDocumentoDTO->setStrStaDocumento(DocumentoRN::$TD_EXTERNO);
470 -  
471 - $objSaidaDocumentoAPI = $this->gerarAssinarDocumentoAnexoSeiRN( $objUnidadeDTO, $arrParametros, $objDocumentoDTO, $objProcedimentoDTO, $itemAnexo, $reciboDTOBasico, ReciboDocumentoAnexoPeticionamentoRN::$TP_PRINCIPAL );  
472 - 557 +
  558 + $objSaidaDocumentoAPI = $this->gerarAssinarDocumentoAnexoSeiRN( $objUnidadeDTO, $arrParametros, $objDocumentoDTO, $objProcedimentoDTO, $itemAnexo, $reciboDTOBasico, ReciboDocumentoAnexoPeticionamentoRN::$TP_PRINCIPAL );
  559 +
473 //============================= 560 //=============================
474 //criando registro em anexo 561 //criando registro em anexo
475 //============================= 562 //=============================
@@ -559,30 +646,26 @@ class ProcessoPeticionamentoRN extends InfraRN { @@ -559,30 +646,26 @@ class ProcessoPeticionamentoRN extends InfraRN {
559 //se setar array da unidade pode cair na regra: "Unidade <nome-Unidade> não está sinalizada como protocolo." 646 //se setar array da unidade pode cair na regra: "Unidade <nome-Unidade> não está sinalizada como protocolo."
560 //nao esta fazendo reabertura de processo - trata-se de processo novo 647 //nao esta fazendo reabertura de processo - trata-se de processo novo
561 $objDocumentoDTO->setArrObjUnidadeDTO($arrObjUnidadeDTOReabertura); 648 $objDocumentoDTO->setArrObjUnidadeDTO($arrObjUnidadeDTOReabertura);
562 -  
563 - //INTERESSADOS E REMETENTES  
564 - $arrObjParticipantesDTO = array();  
565 -  
566 - //o proprio usuario externo logado é remetente do documento  
567 - $contatoDTO = $this->getContatoDTOUsuarioLogado();  
568 -  
569 - $remetenteDTO = new ParticipanteDTO();  
570 - $remetenteRN = new ParticipanteRN();  
571 - $remetenteDTO->retTodos();  
572 - $remetenteDTO->setStrStaParticipacao( ParticipanteRN::$TP_REMETENTE );  
573 - $remetenteDTO->setNumIdContato( $contatoDTO->getNumIdContato() );  
574 - $remetenteDTO->setNumIdUnidade( $objUnidadeDTO->getNumIdUnidade() );  
575 - $remetenteDTO->setNumSequencia(0);  
576 -  
577 - $arrObjParticipantesDTO = $arrParticipantesParametro;  
578 - $arrObjParticipantesDTO[] = $remetenteDTO;  
579 - 649 +
  650 + //seiv2
  651 + //$remetenteDTO = new ParticipanteDTO();
  652 + //$remetenteRN = new ParticipanteRN();
  653 + //$remetenteDTO->retTodos();
  654 + //$remetenteDTO->setStrStaParticipacao( ParticipanteRN::$TP_REMETENTE );
  655 + //$remetenteDTO->setNumIdContato( $contatoDTO->getNumIdContato() );
  656 + //$remetenteDTO->setNumIdUnidade( $objUnidadeDTO->getNumIdUnidade() );
  657 + //$remetenteDTO->setNumSequencia(0);
  658 +
  659 + //seiv2
  660 + //$arrObjParticipantesDTO = $arrParticipantesParametro;
  661 + //$arrObjParticipantesDTO[] = $remetenteDTO;
  662 +
580 $objDocumentoDTO->setNumIdTextoPadraoInterno(''); 663 $objDocumentoDTO->setNumIdTextoPadraoInterno('');
581 $objDocumentoDTO->setStrProtocoloDocumentoTextoBase(''); 664 $objDocumentoDTO->setStrProtocoloDocumentoTextoBase('');
582 $objDocumentoDTO->setNumIdSerie( $idSerieAnexo ); 665 $objDocumentoDTO->setNumIdSerie( $idSerieAnexo );
583 666
584 $objSaidaDocumentoAPI = $this->gerarAssinarDocumentoAnexoSeiRN( $objUnidadeDTO, $arrParametros, $objDocumentoDTO, $objProcedimentoDTO, $itemAnexo, $reciboDTOBasico, ReciboDocumentoAnexoPeticionamentoRN::$TP_ESSENCIAL ); 667 $objSaidaDocumentoAPI = $this->gerarAssinarDocumentoAnexoSeiRN( $objUnidadeDTO, $arrParametros, $objDocumentoDTO, $objProcedimentoDTO, $itemAnexo, $reciboDTOBasico, ReciboDocumentoAnexoPeticionamentoRN::$TP_ESSENCIAL );
585 - 668 +
586 //================================== 669 //==================================
587 //CRIANDO ANEXOS 670 //CRIANDO ANEXOS
588 //================================= 671 //=================================
@@ -670,30 +753,25 @@ class ProcessoPeticionamentoRN extends InfraRN { @@ -670,30 +753,25 @@ class ProcessoPeticionamentoRN extends InfraRN {
670 //nao esta fazendo reabertura de processo - trata-se de processo novo 753 //nao esta fazendo reabertura de processo - trata-se de processo novo
671 $objDocumentoDTO->setArrObjUnidadeDTO($arrObjUnidadeDTOReabertura); 754 $objDocumentoDTO->setArrObjUnidadeDTO($arrObjUnidadeDTOReabertura);
672 755
673 - //INTERESSADOS E REMETENTES  
674 - $arrObjParticipantesDTO = array();  
675 -  
676 - //o proprio usuario externo logado é remetente do documento  
677 - $contatoDTO = $this->getContatoDTOUsuarioLogado();  
678 -  
679 - $remetenteDTO = new ParticipanteDTO();  
680 - $remetenteRN = new ParticipanteRN();  
681 - $remetenteDTO->retTodos();  
682 - $remetenteDTO->setStrStaParticipacao( ParticipanteRN::$TP_REMETENTE );  
683 - $remetenteDTO->setNumIdContato( $contatoDTO->getNumIdContato() );  
684 - $remetenteDTO->setNumIdUnidade( $objUnidadeDTO->getNumIdUnidade() );  
685 - $remetenteDTO->setNumSequencia(0);  
686 -  
687 - $arrObjParticipantesDTO = $arrParticipantesParametro;  
688 - $arrObjParticipantesDTO[] = $remetenteDTO;  
689 - 756 + //seiv2
  757 + //$remetenteDTO = new ParticipanteDTO();
  758 + //$remetenteRN = new ParticipanteRN();
  759 + //$remetenteDTO->retTodos();
  760 + //$remetenteDTO->setStrStaParticipacao( ParticipanteRN::$TP_REMETENTE );
  761 + //$remetenteDTO->setNumIdContato( $contatoDTO->getNumIdContato() );
  762 + //$remetenteDTO->setNumIdUnidade( $objUnidadeDTO->getNumIdUnidade() );
  763 + //$remetenteDTO->setNumSequencia(0);
  764 +
  765 + //seiv3
  766 + //$arrObjParticipantesDTO = $arrParticipantesParametro;
  767 + //$arrObjParticipantesDTO[] = $remetenteDTO;
  768 +
690 $objDocumentoDTO->setNumIdTextoPadraoInterno(''); 769 $objDocumentoDTO->setNumIdTextoPadraoInterno('');
691 $objDocumentoDTO->setStrProtocoloDocumentoTextoBase(''); 770 $objDocumentoDTO->setStrProtocoloDocumentoTextoBase('');
692 -  
693 $objDocumentoDTO->setNumIdSerie( $idSerieAnexo ); 771 $objDocumentoDTO->setNumIdSerie( $idSerieAnexo );
694 -  
695 - $objSaidaDocumentoAPI = $this->gerarAssinarDocumentoAnexoSeiRN( $objUnidadeDTO, $arrParametros, $objDocumentoDTO, $objProcedimentoDTO, $itemAnexo, $reciboDTOBasico, ReciboDocumentoAnexoPeticionamentoRN::$TP_COMPLEMENTAR );  
696 - 772 +
  773 + $objSaidaDocumentoAPI = $this->gerarAssinarDocumentoAnexoSeiRN( $objUnidadeDTO, $arrParametros, $objDocumentoDTO, $objProcedimentoDTO, $itemAnexo, $reciboDTOBasico, ReciboDocumentoAnexoPeticionamentoRN::$TP_COMPLEMENTAR );
  774 +
697 //======================== 775 //========================
698 //CRIANDO ANEXOS 776 //CRIANDO ANEXOS
699 //======================== 777 //========================
@@ -722,59 +800,59 @@ class ProcessoPeticionamentoRN extends InfraRN { @@ -722,59 +800,59 @@ class ProcessoPeticionamentoRN extends InfraRN {
722 } 800 }
723 801
724 } 802 }
725 -  
726 - private function montarProtocoloDocumentoAnexo( $arrParametros, $objUnidadeDTO, $objProcedimentoDTO,  
727 - $arrParticipantesParametro, $arrAnexos, $reciboDTOBasico ){  
728 -  
729 - $reciboAnexoRN = new ReciboDocumentoAnexoPeticionamentoRN();  
730 - $strClassificacao = $arrParametros['CLASSIFICACAO_RECIBO'];  
731 -  
732 - foreach( $arrAnexos as $anexoDTOVinculado){  
733 -  
734 - $anexoBD = new AnexoBD( $this->getObjInfraIBanco() );  
735 - $anexoBD->alterar( $anexoDTOVinculado );  
736 -  
737 - $reciboAnexoDTO = new ReciboDocumentoAnexoPeticionamentoDTO();  
738 - $reciboAnexoDTO->setNumIdAnexo( $anexoDTOVinculado->getNumIdAnexo() );  
739 - $reciboAnexoDTO->setNumIdReciboPeticionamento( $reciboDTOBasico->getNumIdReciboPeticionamento() );  
740 - $reciboAnexoDTO->setNumIdDocumento( $anexoDTOVinculado->getDblIdProtocolo() );  
741 - $reciboAnexoDTO->setStrClassificacaoDocumento( $strClassificacao );  
742 - $reciboAnexoDTO = $reciboAnexoRN->cadastrar( $reciboAnexoDTO );  
743 -  
744 - }  
745 -  
746 - }  
747 - 803 +
  804 + //NÃO FOI ACHADO USO
  805 + //private function montarProtocoloDocumentoAnexo( $arrParametros, $objUnidadeDTO, $objProcedimentoDTO,
  806 + // $arrParticipantesParametro, $arrAnexos, $reciboDTOBasico ){
  807 + //
  808 + // $reciboAnexoRN = new ReciboDocumentoAnexoPeticionamentoRN();
  809 + // $strClassificacao = $arrParametros['CLASSIFICACAO_RECIBO'];
  810 + //
  811 + // foreach( $arrAnexos as $anexoDTOVinculado){
  812 + //
  813 + // $anexoBD = new AnexoBD( $this->getObjInfraIBanco() );
  814 + // $anexoBD->alterar( $anexoDTOVinculado );
  815 + //
  816 + // $reciboAnexoDTO = new ReciboDocumentoAnexoPeticionamentoDTO();
  817 + // $reciboAnexoDTO->setNumIdAnexo( $anexoDTOVinculado->getNumIdAnexo() );
  818 + // $reciboAnexoDTO->setNumIdReciboPeticionamento( $reciboDTOBasico->getNumIdReciboPeticionamento() );
  819 + // $reciboAnexoDTO->setNumIdDocumento( $anexoDTOVinculado->getDblIdProtocolo() );
  820 + // $reciboAnexoDTO->setStrClassificacaoDocumento( $strClassificacao );
  821 + // $reciboAnexoDTO = $reciboAnexoRN->cadastrar( $reciboAnexoDTO );
  822 + //
  823 + // }
  824 + //
  825 + //}
  826 +
748 private function montarDocumentoPrincipal( $objProcedimentoDTO, 827 private function montarDocumentoPrincipal( $objProcedimentoDTO,
749 $objTipoProcDTO, 828 $objTipoProcDTO,
750 $objUnidadeDTO, 829 $objUnidadeDTO,
751 - $arrParticipantesParametro, 830 + //seiv2
  831 + //$arrParticipantesParametro,
752 $arrParametros ){ 832 $arrParametros ){
753 - 833 +
754 $objSeiRN = new SeiRN(); 834 $objSeiRN = new SeiRN();
755 835
756 $nivelAcessoDocPrincipal = $arrParametros['nivelAcessoDocPrincipal']; 836 $nivelAcessoDocPrincipal = $arrParametros['nivelAcessoDocPrincipal'];
757 $grauSigiloDocPrincipal = $arrParametros['grauSigiloDocPrincipal']; 837 $grauSigiloDocPrincipal = $arrParametros['grauSigiloDocPrincipal'];
758 $hipoteseLegalDocPrincipal = $arrParametros['hipoteseLegalDocPrincipal']; 838 $hipoteseLegalDocPrincipal = $arrParametros['hipoteseLegalDocPrincipal'];
759 -  
760 - //INTERESSADOS E REMETENTES  
761 - $arrObjParticipantesDTO = array();  
762 - 839 +
763 //o proprio usuario externo logado é remetente do documento 840 //o proprio usuario externo logado é remetente do documento
764 $contatoDTO = $this->getContatoDTOUsuarioLogado(); 841 $contatoDTO = $this->getContatoDTOUsuarioLogado();
765 -  
766 - $remetenteDTO = new ParticipanteDTO();  
767 - $remetenteRN = new ParticipanteRN();  
768 - $remetenteDTO->retTodos();  
769 - $remetenteDTO->setStrStaParticipacao( ParticipanteRN::$TP_REMETENTE );  
770 - $remetenteDTO->setNumIdContato( $contatoDTO->getNumIdContato() );  
771 - $remetenteDTO->setNumIdUnidade( $objUnidadeDTO->getNumIdUnidade() );  
772 - $remetenteDTO->setNumSequencia(0);  
773 -  
774 - $arrObjParticipantesDTO = array();  
775 - $arrObjParticipantesDTO[] = $remetenteDTO;  
776 - $arrParticipantesParametro[] = $remetenteDTO;  
777 - 842 +
  843 + //seiv2
  844 + //$remetenteDTO = new ParticipanteDTO();
  845 + //$remetenteRN = new ParticipanteRN();
  846 + //$remetenteDTO->retTodos();
  847 + //$remetenteDTO->setStrStaParticipacao( ParticipanteRN::$TP_REMETENTE );
  848 + //$remetenteDTO->setNumIdContato( $contatoDTO->getNumIdContato() );
  849 + //$remetenteDTO->setNumIdUnidade( $objUnidadeDTO->getNumIdUnidade() );
  850 + //$remetenteDTO->setNumSequencia(0);
  851 +
  852 + //seiv2
  853 + //$arrObjParticipantesDTO[] = $remetenteDTO;
  854 + //$arrParticipantesParametro[] = $remetenteDTO;
  855 +
778 //Incluir documento interno 856 //Incluir documento interno
779 $objDocumentoAPI = new DocumentoAPI(); 857 $objDocumentoAPI = new DocumentoAPI();
780 858
@@ -787,10 +865,11 @@ class ProcessoPeticionamentoRN extends InfraRN { @@ -787,10 +865,11 @@ class ProcessoPeticionamentoRN extends InfraRN {
787 $objDocumentoAPI->setConteudo(base64_encode( $arrParametros['docPrincipalConteudoHTML'] )); 865 $objDocumentoAPI->setConteudo(base64_encode( $arrParametros['docPrincipalConteudoHTML'] ));
788 $objDocumentoAPI->setSinAssinado('S'); 866 $objDocumentoAPI->setSinAssinado('S');
789 $objDocumentoAPI->setSinBloqueado('S'); 867 $objDocumentoAPI->setSinBloqueado('S');
790 -  
791 - $objSaidaIncluirDocumentoAPI = $objSeiRN->incluirDocumento($objDocumentoAPI); 868 +
  869 + $objSaidaIncluirDocumentoAPI = $objSeiRN->incluirDocumento($objDocumentoAPI);
  870 +
792 SessaoSEIExterna::getInstance()->setAtributo('idDocPrincipalGerado', $objSaidaIncluirDocumentoAPI->getIdDocumento() ); 871 SessaoSEIExterna::getInstance()->setAtributo('idDocPrincipalGerado', $objSaidaIncluirDocumentoAPI->getIdDocumento() );
793 - 872 +
794 $documentoDTOPrincipal = new DocumentoDTO(); 873 $documentoDTOPrincipal = new DocumentoDTO();
795 $documentoDTOPrincipal->setDblIdDocumento( $objSaidaIncluirDocumentoAPI->getIdDocumento() ); 874 $documentoDTOPrincipal->setDblIdDocumento( $objSaidaIncluirDocumentoAPI->getIdDocumento() );
796 return $documentoDTOPrincipal; 875 return $documentoDTOPrincipal;
@@ -893,18 +972,26 @@ class ProcessoPeticionamentoRN extends InfraRN { @@ -893,18 +972,26 @@ class ProcessoPeticionamentoRN extends InfraRN {
893 $bolRemoverTipoConferencia = false; 972 $bolRemoverTipoConferencia = false;
894 973
895 if( !$documentoDTO->isSetNumIdTipoConferencia() || $documentoDTO->getNumIdTipoConferencia()==null ){ 974 if( !$documentoDTO->isSetNumIdTipoConferencia() || $documentoDTO->getNumIdTipoConferencia()==null ){
896 - 975 +
  976 + // buscando o menor tipo de conferencia
  977 + $tipoConferenciaDTOConsulta = new TipoConferenciaDTO();
  978 + $tipoConferenciaDTOConsulta->retTodos();
  979 + $tipoConferenciaDTOConsulta->setStrSinAtivo('S');
  980 + $tipoConferenciaDTOConsulta->setOrd('IdTipoConferencia', InfraDTO::$TIPO_ORDENACAO_ASC);
  981 + $tipoConferenciaRN = new TipoConferenciaRN();
  982 + $arrTipoConferenciaDTO = $tipoConferenciaRN->listar($tipoConferenciaDTOConsulta);
  983 + $numIdTipoConferencia = $arrTipoConferenciaDTO[0]->getNumIdTipoConferencia();
  984 + // fim buscando o menor tipo de conferencia
  985 +
897 //setando um tipo de conferencia padrao (que sera removido depois), apenas para passar na validação 986 //setando um tipo de conferencia padrao (que sera removido depois), apenas para passar na validação
898 - //@todo nao deixar o ID hard-coded (talvez criar novo tipo de conferencia para usar aqui)  
899 - $documentoDTO->setNumIdTipoConferencia( 1 ); 987 + $documentoDTO->setNumIdTipoConferencia($numIdTipoConferencia);
900 $documentoAlteracaoDTO = new DocumentoDTO(); 988 $documentoAlteracaoDTO = new DocumentoDTO();
901 $documentoAlteracaoDTO->retDblIdDocumento(); 989 $documentoAlteracaoDTO->retDblIdDocumento();
902 $documentoAlteracaoDTO->retNumIdTipoConferencia(); 990 $documentoAlteracaoDTO->retNumIdTipoConferencia();
903 $documentoAlteracaoDTO->setDblIdDocumento( $documentoDTO->getDblIdDocumento() ); 991 $documentoAlteracaoDTO->setDblIdDocumento( $documentoDTO->getDblIdDocumento() );
904 $documentoAlteracaoDTO = $documentoRN->consultarRN0005( $documentoAlteracaoDTO ); 992 $documentoAlteracaoDTO = $documentoRN->consultarRN0005( $documentoAlteracaoDTO );
905 993
906 - //@todo nao deixar o ID hard-coded (talvez criar novo tipo de conferencia para usar aqui)  
907 - $documentoAlteracaoDTO->setNumIdTipoConferencia(1); 994 + $documentoAlteracaoDTO->setNumIdTipoConferencia($numIdTipoConferencia);
908 $documentoBD->alterar( $documentoAlteracaoDTO ); 995 $documentoBD->alterar( $documentoAlteracaoDTO );
909 $bolRemoverTipoConferencia = true; 996 $bolRemoverTipoConferencia = true;
910 997
@@ -946,23 +1033,24 @@ class ProcessoPeticionamentoRN extends InfraRN { @@ -946,23 +1033,24 @@ class ProcessoPeticionamentoRN extends InfraRN {
946 $objAcessoExternoBD->excluir( $objAcessoExternoDTO ); 1033 $objAcessoExternoBD->excluir( $objAcessoExternoDTO );
947 1034
948 } 1035 }
949 -  
950 - private function montarArrContatosInteressados( $idsContatos ){  
951 -  
952 - $contatoRN = new ContatoRN();  
953 - $objContatoDTO = new ContatoDTO();  
954 - $objContatoDTO->retStrSigla();  
955 - $objContatoDTO->retStrNome();  
956 - $objContatoDTO->retNumIdContato();  
957 -  
958 - $objContatoDTO->adicionarCriterio(array('IdContato', 'SinAtivo'),  
959 - array(InfraDTO::$OPER_IN, InfraDTO::$OPER_IGUAL),  
960 - array( $idsContatos,'S'),  
961 - InfraDTO::$OPER_LOGICO_AND);  
962 -  
963 - $arrContatos = $contatoRN->listarRN0325( $objContatoDTO );  
964 - return $arrContatos;  
965 - } 1036 +
  1037 + //NÃO FOI ACHADO USO
  1038 + //private function montarArrContatosInteressados( $idsContatos ){
  1039 + //
  1040 + // $contatoRN = new ContatoRN();
  1041 + // $objContatoDTO = new ContatoDTO();
  1042 + // $objContatoDTO->retStrSigla();
  1043 + // $objContatoDTO->retStrNome();
  1044 + // $objContatoDTO->retNumIdContato();
  1045 +
  1046 + // $objContatoDTO->adicionarCriterio(array('IdContato', 'SinAtivo'),
  1047 + // array(InfraDTO::$OPER_IN, InfraDTO::$OPER_IGUAL),
  1048 + // array( $idsContatos,'S'),
  1049 + // InfraDTO::$OPER_LOGICO_AND);
  1050 +
  1051 + // $arrContatos = $contatoRN->listarRN0325( $objContatoDTO );
  1052 + // return $arrContatos;
  1053 + //}
966 1054
967 private function atribuirParticipantes( $arrObjInteressados) 1055 private function atribuirParticipantes( $arrObjInteressados)
968 { 1056 {
@@ -1213,5 +1301,6 @@ class ProcessoPeticionamentoRN extends InfraRN { @@ -1213,5 +1301,6 @@ class ProcessoPeticionamentoRN extends InfraRN {
1213 1301
1214 return $contatoDTO; 1302 return $contatoDTO;
1215 } 1303 }
  1304 +
1216 } 1305 }
1217 ?> 1306 ?>
1218 \ No newline at end of file 1307 \ No newline at end of file
sei/web/modulos/peticionamento/rn/ReciboPeticionamentoIntercorrenteRN.php
@@ -39,86 +39,43 @@ class ReciboPeticionamentoIntercorrenteRN extends ReciboPeticionamentoRN { @@ -39,86 +39,43 @@ class ReciboPeticionamentoIntercorrenteRN extends ReciboPeticionamentoRN {
39 $idSerieRecibo = $objInfraParametro->getValor('ID_SERIE_RECIBO_MODULO_PETICIONAMENTO'); 39 $idSerieRecibo = $objInfraParametro->getValor('ID_SERIE_RECIBO_MODULO_PETICIONAMENTO');
40 40
41 //============================================= 41 //=============================================
42 - //MONTAGEM DO PROTOCOLODTO DO DOCUMENTO 42 + //MONTAGEM DO DOCUMENTO VIA SEI RN
43 //============================================= 43 //=============================================
44 44
45 - $protocoloReciboDocumentoDTO = new ProtocoloDTO(); 45 + $objDocumentoAPI = new DocumentoAPI();
  46 + $objDocumentoAPI->setIdProcedimento( $objProcedimentoDTO->getDblIdProcedimento() );
  47 + $objDocumentoAPI->setSubTipo( DocumentoRN::$TD_FORMULARIO_AUTOMATICO );
  48 + $objDocumentoAPI->setTipo( ProtocoloRN::$TP_DOCUMENTO_GERADO );
  49 + $objDocumentoAPI->setIdSerie( $idSerieRecibo );
  50 + $objDocumentoAPI->setSinAssinado('N');
  51 + $objDocumentoAPI->setSinBloqueado('S');
  52 + $objDocumentoAPI->setIdHipoteseLegal( null );
  53 + $objDocumentoAPI->setNivelAcesso( ProtocoloRN::$NA_PUBLICO );
  54 + $objDocumentoAPI->setIdTipoConferencia( null );
46 55
47 - $protocoloReciboDocumentoDTO->setDblIdProtocolo(null);  
48 - $protocoloReciboDocumentoDTO->setStrDescricao( null );  
49 - $protocoloReciboDocumentoDTO->setStrStaNivelAcessoLocal( ProtocoloRN::$NA_PUBLICO );  
50 - //$protocoloReciboDocumentoDTO->setStrProtocoloFormatado( $numeroDocumento );  
51 - //$protocoloReciboDocumentoDTO->setStrProtocoloFormatadoPesquisa( $numeroDocumento );  
52 - $protocoloReciboDocumentoDTO->setNumIdUnidadeGeradora( $objUnidadeDTO->getNumIdUnidade() );  
53 - $protocoloReciboDocumentoDTO->setNumIdUsuarioGerador( SessaoSEIExterna::getInstance()->getNumIdUsuarioExterno() );  
54 - $protocoloReciboDocumentoDTO->setStrStaProtocolo( ProtocoloRN::$TP_DOCUMENTO_GERADO ); 56 + $objDocumentoAPI->setConteudo(base64_encode( utf8_encode($htmlRecibo) ) );
55 57
56 - $protocoloReciboDocumentoDTO->setStrStaNivelAcessoLocal( ProtocoloRN::$NA_PUBLICO );  
57 - $protocoloReciboDocumentoDTO->setNumIdHipoteseLegal( null );  
58 - $protocoloReciboDocumentoDTO->setStrStaGrauSigilo(null);  
59 -  
60 - $protocoloReciboDocumentoDTO->setDtaGeracao( InfraData::getStrDataAtual() );  
61 - $protocoloReciboDocumentoDTO->setArrObjAnexoDTO(array());  
62 - $protocoloReciboDocumentoDTO->setArrObjRelProtocoloAssuntoDTO(array());  
63 - $protocoloReciboDocumentoDTO->setArrObjRelProtocoloProtocoloDTO(array()); 58 + $objSeiRN = new SeiRN();
  59 + $saidaDocExternoAPI = $objSeiRN->incluirDocumento( $objDocumentoAPI );
64 60
65 - $protocoloReciboDocumentoDTO->setStrStaEstado( ProtocoloRN::$TE_NORMAL );  
66 - $protocoloReciboDocumentoDTO->setArrObjLocalizadorDTO(array());  
67 - $protocoloReciboDocumentoDTO->setArrObjObservacaoDTO( array() );  
68 - $protocoloReciboDocumentoDTO->setArrObjParticipanteDTO( $arrParticipantesParametro );  
69 - $protocoloReciboDocumentoDTO->setNumIdSerieDocumento( $idSerieRecibo );  
70 -  
71 - //==========================  
72 - //ATRIBUTOS  
73 - //==========================  
74 - $arrRelProtocoloAtributo = AtributoINT::processar(null, null); 61 + //necessario forçar update da coluna sta_documento da tabela documento
  62 + //inclusao via SeiRN nao permitiu definir como documento de formulario automatico
  63 + $parObjDocumentoDTO = new DocumentoDTO();
  64 + $parObjDocumentoDTO->retTodos();
  65 + $parObjDocumentoDTO->setDblIdDocumento( $saidaDocExternoAPI->getIdDocumento() );
75 66
76 - $arrObjRelProtocoloAtributoDTO = array(); 67 + $docRN = new DocumentoRN();
  68 + $parObjDocumentoDTO = $docRN->consultarRN0005( $parObjDocumentoDTO );
  69 + $parObjDocumentoDTO->setStrStaDocumento( DocumentoRN::$TD_FORMULARIO_AUTOMATICO );
  70 + $objDocumentoBD = new DocumentoBD($this->getObjInfraIBanco());
  71 + $objDocumentoBD->alterar($parObjDocumentoDTO);
77 72
78 - for($x = 0;$x<count($arrRelProtocoloAtributo);$x++){  
79 - $arrRelProtocoloAtributoDTO = new RelProtocoloAtributoDTO();  
80 - $arrRelProtocoloAtributoDTO->setStrValor($arrRelProtocoloAtributo[$x]->getStrValor());  
81 - $arrRelProtocoloAtributoDTO->setNumIdAtributo($arrRelProtocoloAtributo[$x]->getNumIdAtributo());  
82 - $arrObjRelProtocoloAtributoDTO[$x] = $arrRelProtocoloAtributoDTO;  
83 - } 73 + $reciboDTO->setDblIdDocumento( $saidaDocExternoAPI->getIdDocumento() );
84 74
85 - $protocoloReciboDocumentoDTO->setArrObjRelProtocoloAtributoDTO($arrObjRelProtocoloAtributoDTO); 75 + $objBD = new ReciboPeticionamentoBD($this->getObjInfraIBanco());
  76 + $reciboDTO = $objBD->alterar( $reciboDTO );
86 77
87 - //=============================================  
88 - //MONTAGEM DO DOCUMENTODTO  
89 - //=============================================  
90 -  
91 - //TESTE COMENTADO $documentoBD = new DocumentoBD( $this->getObjInfraIBanco() );  
92 - $docRN = new DocumentoPeticionamentoRN();  
93 -  
94 - $documentoReciboDTO = new DocumentoDTO();  
95 - $documentoReciboDTO->setDblIdDocumento( $protocoloReciboDocumentoDTO->getDblIdProtocolo() );  
96 - $documentoReciboDTO->setDblIdProcedimento( $objProcedimentoDTO->getDblIdProcedimento() );  
97 - $documentoReciboDTO->setNumIdSerie( $idSerieRecibo );  
98 - $documentoReciboDTO->setNumIdUnidadeResponsavel( $objUnidadeDTO->getNumIdUnidade() );  
99 - $documentoReciboDTO->setObjProtocoloDTO( $protocoloReciboDocumentoDTO );  
100 -  
101 - $documentoReciboDTO->setNumIdConjuntoEstilos(null);  
102 -  
103 - $documentoReciboDTO->setNumIdTipoConferencia( null );  
104 - $documentoReciboDTO->setStrNumero(''); //sistema atribui numeracao sequencial automatica  
105 - $documentoReciboDTO->setStrConteudo( $htmlRecibo );  
106 -  
107 - $documentoReciboDTO->setStrConteudoAssinatura(null);  
108 - $documentoReciboDTO->setStrCrcAssinatura(null);  
109 - $documentoReciboDTO->setStrQrCodeAssinatura(null);  
110 -  
111 - $documentoReciboDTO->setStrSinBloqueado('S');  
112 -  
113 - $documentoReciboDTO->setStrStaDocumento(DocumentoRN::$TD_FORMULARIO_AUTOMATICO);  
114 -  
115 - $documentoReciboDTO->setNumIdTextoPadraoInterno(null);  
116 - $documentoReciboDTO->setStrProtocoloDocumentoTextoBase('');  
117 -  
118 - $documentoReciboDTO = $docRN->gerarRN0003Customizado( $documentoReciboDTO );  
119 -// ini_set('xdebug.var_display_max_depth', 10); ini_set('xdebug.var_display_max_children', 256); ini_set('xdebug.var_display_max_data', 1024); echo '<pre>';  
120 -// var_dump($documentoReciboDTO); echo '</pre>'; exit;  
121 - return $documentoReciboDTO; 78 + return $parObjDocumentoDTO;
122 79
123 } 80 }
124 81
@@ -139,9 +96,9 @@ class ReciboPeticionamentoIntercorrenteRN extends ReciboPeticionamentoRN { @@ -139,9 +96,9 @@ class ReciboPeticionamentoIntercorrenteRN extends ReciboPeticionamentoRN {
139 96
140 $html = ''; 97 $html = '';
141 98
142 - $html .= '<table align="center" style="width: 90%" border="0">'; 99 + $html .= '<table align="center" style="width: 95%" border="0">';
143 $html .= '<tbody><tr>'; 100 $html .= '<tbody><tr>';
144 - $html .= '<td style="font-weight: bold; width: 300px;">Usuário Externo (signatário):</td>'; 101 + $html .= '<td style="font-weight: bold; width: 400px;">Usuário Externo (signatário):</td>';
145 $html .= '<td>' . $objUsuarioDTO->getStrNome() . '</td>'; 102 $html .= '<td>' . $objUsuarioDTO->getStrNome() . '</td>';
146 $html .= '</tr>'; 103 $html .= '</tr>';
147 104
@@ -164,7 +121,32 @@ class ReciboPeticionamentoIntercorrenteRN extends ReciboPeticionamentoRN { @@ -164,7 +121,32 @@ class ReciboPeticionamentoIntercorrenteRN extends ReciboPeticionamentoRN {
164 $html .= '<td style="font-weight: bold;">Número do Processo:</td>'; 121 $html .= '<td style="font-weight: bold;">Número do Processo:</td>';
165 $html .= '<td>' . $objProcedimentoDTO->getStrProtocoloProcedimentoFormatado() . '</td>'; 122 $html .= '<td>' . $objProcedimentoDTO->getStrProtocoloProcedimentoFormatado() . '</td>';
166 $html .= '</tr>'; 123 $html .= '</tr>';
167 - 124 +
  125 + if( $reciboDTO->isSetDblIdProtocoloRelacionado()) {
  126 +
  127 + $idProtocoloPrinc = $reciboDTO->getDblIdProtocoloRelacionado();
  128 +
  129 + if(!(InfraString::isBolVazia($idProtocoloPrinc))){
  130 +
  131 + $objProtocoloRN = new ProtocoloRN();
  132 + $objProtocoloDTO = new ProtocoloDTO();
  133 +
  134 + $objProtocoloDTO->setDblIdProtocolo($idProtocoloPrinc);
  135 + $objProtocoloDTO->retTodos();
  136 +
  137 + $objProtocoloDTO = $objProtocoloRN->consultarRN0186($objProtocoloDTO);
  138 + $protocoloRelFormatado = $objProtocoloDTO->getStrProtocoloFormatado();
  139 +
  140 + //se houver processo relacionado
  141 + $html .= '<tr>';
  142 + $html .= '<td> &ensp;&nbsp; Relacionado ao Processo:</td>';
  143 + $html .= '<td>' . $protocoloRelFormatado . '</td>';
  144 + $html .= '</tr>';
  145 +
  146 + }
  147 +
  148 + }
  149 +
168 //obter interessados (apenas os do tipo interessado, nao os do tipo remetente) 150 //obter interessados (apenas os do tipo interessado, nao os do tipo remetente)
169 $arrInteressados = array(); 151 $arrInteressados = array();
170 /* 152 /*
sei/web/modulos/peticionamento/rn/ReciboPeticionamentoRN.php
@@ -123,6 +123,7 @@ class ReciboPeticionamentoRN extends InfraRN { @@ -123,6 +123,7 @@ class ReciboPeticionamentoRN extends InfraRN {
123 protected function gerarReciboSimplificadoControlado( $idProcedimento ) { 123 protected function gerarReciboSimplificadoControlado( $idProcedimento ) {
124 124
125 $reciboDTO = new ReciboPeticionamentoDTO(); 125 $reciboDTO = new ReciboPeticionamentoDTO();
  126 + $reciboDTO->retTodos();
126 127
127 $reciboDTO->setNumIdProtocolo( $idProcedimento ); 128 $reciboDTO->setNumIdProtocolo( $idProcedimento );
128 $reciboDTO->setNumIdUsuario( SessaoSEIExterna::getInstance()->getNumIdUsuarioExterno() ); 129 $reciboDTO->setNumIdUsuario( SessaoSEIExterna::getInstance()->getNumIdUsuarioExterno() );
@@ -178,8 +179,9 @@ class ReciboPeticionamentoRN extends InfraRN { @@ -178,8 +179,9 @@ class ReciboPeticionamentoRN extends InfraRN {
178 $arrParametros = $arrParams[0]; //parametros adicionais fornecidos no formulario de peticionamento 179 $arrParametros = $arrParams[0]; //parametros adicionais fornecidos no formulario de peticionamento
179 $objUnidadeDTO = $arrParams[1]; //UnidadeDTO da unidade geradora do processo 180 $objUnidadeDTO = $arrParams[1]; //UnidadeDTO da unidade geradora do processo
180 $objProcedimentoDTO = $arrParams[2]; //ProcedimentoDTO para vincular o recibo ao processo correto 181 $objProcedimentoDTO = $arrParams[2]; //ProcedimentoDTO para vincular o recibo ao processo correto
181 - $arrParticipantesParametro = $arrParams[3]; //array de ParticipanteDTO  
182 - 182 + //seiv2
  183 + //$arrParticipantesParametro = $arrParams[3]; //array de ParticipanteDTO
  184 +
183 //tentando simular sessao de usuario interno do SEI 185 //tentando simular sessao de usuario interno do SEI
184 SessaoSEI::getInstance()->simularLogin(null, null, SessaoSEIExterna::getInstance()->getNumIdUsuarioExterno(), $objUnidadeDTO->getNumIdUnidade() ); 186 SessaoSEI::getInstance()->simularLogin(null, null, SessaoSEIExterna::getInstance()->getNumIdUsuarioExterno(), $objUnidadeDTO->getNumIdUnidade() );
185 187
@@ -220,6 +222,11 @@ class ReciboPeticionamentoRN extends InfraRN { @@ -220,6 +222,11 @@ class ReciboPeticionamentoRN extends InfraRN {
220 $objDocumentoBD = new DocumentoBD($this->getObjInfraIBanco()); 222 $objDocumentoBD = new DocumentoBD($this->getObjInfraIBanco());
221 $objDocumentoBD->alterar($parObjDocumentoDTO); 223 $objDocumentoBD->alterar($parObjDocumentoDTO);
222 224
  225 + $reciboDTO->setDblIdDocumento( $saidaDocExternoAPI->getIdDocumento() );
  226 +
  227 + $objBD = new ReciboPeticionamentoBD($this->getObjInfraIBanco());
  228 + $reciboDTO = $objBD->alterar( $reciboDTO );
  229 +
223 return $reciboDTO; 230 return $reciboDTO;
224 231
225 } 232 }
@@ -241,9 +248,9 @@ class ReciboPeticionamentoRN extends InfraRN { @@ -241,9 +248,9 @@ class ReciboPeticionamentoRN extends InfraRN {
241 248
242 $html = ''; 249 $html = '';
243 250
244 - $html .= '<table align="center" style="width: 90%" border="0">'; 251 + $html .= '<table align="center" style="width: 95%" border="0">';
245 $html .= '<tbody><tr>'; 252 $html .= '<tbody><tr>';
246 - $html .= '<td style="font-weight: bold; width: 300px;">Usuário Externo (signatário):</td>'; 253 + $html .= '<td style="font-weight: bold; width: 400px;">Usuário Externo (signatário):</td>';
247 $html .= '<td>' . $objUsuarioDTO->getStrNome() . '</td>'; 254 $html .= '<td>' . $objUsuarioDTO->getStrNome() . '</td>';
248 $html .= '</tr>'; 255 $html .= '</tr>';
249 256
@@ -562,5 +569,25 @@ class ReciboPeticionamentoRN extends InfraRN { @@ -562,5 +569,25 @@ class ReciboPeticionamentoRN extends InfraRN {
562 return null; 569 return null;
563 } 570 }
564 571
  572 +
  573 + /**
  574 + * Short description of method alterarControlado
  575 + *
  576 + * @access protected
  577 + * @author Jaqueline Mendes <jaqueline.mendes@castgroup.com.br>
  578 + * @param $objDTO
  579 + * @return mixed
  580 + */
  581 + protected function alterarControlado(ReciboPeticionamentoDTO $objDTO) {
  582 +
  583 + try {
  584 + $objBD = new ReciboPeticionamentoBD($this->getObjInfraIBanco());
  585 + $objBD->alterar($objDTO);
  586 +
  587 + } catch ( Exception $e ) {
  588 + throw new InfraException ('Erro alterando Recibo Peticionamento, ', $e);
  589 + }
  590 + }
  591 +
565 } 592 }
566 ?> 593 ?>
567 \ No newline at end of file 594 \ No newline at end of file
sei/web/modulos/peticionamento/rn/TamanhoArquivoPermitidoPeticionamentoRN.php
@@ -142,8 +142,8 @@ class TamanhoArquivoPermitidoPeticionamentoRN extends InfraRN { @@ -142,8 +142,8 @@ class TamanhoArquivoPermitidoPeticionamentoRN extends InfraRN {
142 $objInfraParametroDTO->retStrValor(); 142 $objInfraParametroDTO->retStrValor();
143 $objInfraParametroDTO->setStrNome('SEI_TAM_MB_DOC_EXTERNO'); 143 $objInfraParametroDTO->setStrNome('SEI_TAM_MB_DOC_EXTERNO');
144 144
145 - $objInfraParametroRN = new InfraParametroRN();  
146 - $objInfraParametroDTO = $objInfraParametroRN->consultar($objInfraParametroDTO); 145 + $objMdPetParametroRN = new MdPetParametroRN();
  146 + $objInfraParametroDTO = $objMdPetParametroRN->consultar($objInfraParametroDTO);
147 147
148 $valor = $objInfraParametroDTO->getStrValor(); 148 $valor = $objInfraParametroDTO->getStrValor();
149 149
sei/web/modulos/peticionamento/rn/TipoProcessoPeticionamentoRN.php
@@ -350,10 +350,10 @@ class TipoProcessoPeticionamentoRN extends InfraRN { @@ -350,10 +350,10 @@ class TipoProcessoPeticionamentoRN extends InfraRN {
350 350
351 private function _retornaValorParametroHipoteseLegal(){ 351 private function _retornaValorParametroHipoteseLegal(){
352 $objInfraParametroDTO = new InfraParametroDTO(); 352 $objInfraParametroDTO = new InfraParametroDTO();
353 - $objInfraParametroRN = new InfraParametroRN(); 353 + $objMdPetParametroRN = new MdPetParametroRN();
354 $objInfraParametroDTO->retTodos(); 354 $objInfraParametroDTO->retTodos();
355 $objInfraParametroDTO->setStrNome('SEI_HABILITAR_HIPOTESE_LEGAL'); 355 $objInfraParametroDTO->setStrNome('SEI_HABILITAR_HIPOTESE_LEGAL');
356 - $objInfraParametroDTO = $objInfraParametroRN->consultar($objInfraParametroDTO); 356 + $objInfraParametroDTO = $objMdPetParametroRN->consultar($objInfraParametroDTO);
357 $valorParametroHipoteseLegal = $objInfraParametroDTO->getStrValor(); 357 $valorParametroHipoteseLegal = $objInfraParametroDTO->getStrValor();
358 return $valorParametroHipoteseLegal; 358 return $valorParametroHipoteseLegal;
359 } 359 }
sei/web/modulos/peticionamento/tipo_processo_peticionamento_cadastro.php
@@ -103,13 +103,13 @@ try { @@ -103,13 +103,13 @@ try {
103 $contatoAssociadoDTO = $contatoAssociadoRN->consultarRN0324( $contatoAssociadoDTO ); 103 $contatoAssociadoDTO = $contatoAssociadoRN->consultarRN0324( $contatoAssociadoDTO );
104 $arrObjUnidadeDTOFormatado[$objUnidadeDTO->getNumIdUnidade()]['uf'] = $contatoAssociadoDTO->getStrSiglaUf(); 104 $arrObjUnidadeDTOFormatado[$objUnidadeDTO->getNumIdUnidade()]['uf'] = $contatoAssociadoDTO->getStrSiglaUf();
105 } 105 }
106 -  
107 - 106 +
  107 +
108 $objInfraParametroDTO = new InfraParametroDTO(); 108 $objInfraParametroDTO = new InfraParametroDTO();
109 - $objInfraParametroRN = new InfraParametroRN(); 109 + $objMdPetParametroRN = new MdPetParametroRN();
110 $objInfraParametroDTO->retTodos(); 110 $objInfraParametroDTO->retTodos();
111 $objInfraParametroDTO->setStrNome('SEI_HABILITAR_HIPOTESE_LEGAL'); 111 $objInfraParametroDTO->setStrNome('SEI_HABILITAR_HIPOTESE_LEGAL');
112 - $objInfraParametroDTO = $objInfraParametroRN->consultar($objInfraParametroDTO); 112 + $objInfraParametroDTO = $objMdPetParametroRN->consultar($objInfraParametroDTO);
113 $valorParametroHipoteseLegal = $objInfraParametroDTO->getStrValor(); 113 $valorParametroHipoteseLegal = $objInfraParametroDTO->getStrValor();
114 114
115 if($_GET['acao'] === 'tipo_processo_peticionamento_consultar' || $_GET['acao'] === 'tipo_processo_peticionamento_alterar'){ 115 if($_GET['acao'] === 'tipo_processo_peticionamento_consultar' || $_GET['acao'] === 'tipo_processo_peticionamento_alterar'){
sei/web/rn/TarjaAssinaturaRN.php
@@ -1,374 +0,0 @@ @@ -1,374 +0,0 @@
1 -<?  
2 -/**  
3 -* TRIBUNAL REGIONAL FEDERAL DA 4ª REGIÃO  
4 -*  
5 -* 22/06/2012 - criado por bcu  
6 -*  
7 -* Versão do Gerador de Código: 1.32.1  
8 -*  
9 -* Versão no CVS: $Id$  
10 -*/  
11 -  
12 -require_once dirname(__FILE__).'/../SEI.php';  
13 -  
14 -class TarjaAssinaturaRN extends InfraRN  
15 -{  
16 -  
17 - public static $TT_ASSINATURA_CERTIFICADO_DIGITAL = 'C';  
18 - public static $TT_ASSINATURA_SENHA = 'S';  
19 - public static $TT_AUTENTICACAO_CERTIFICADO_DIGITAL = 'A';  
20 - public static $TT_AUTENTICACAO_SENHA = 'H';  
21 - public static $TT_INSTRUCOES_VALIDACAO = 'V';  
22 -  
23 - public function __construct()  
24 - {  
25 - parent::__construct();  
26 - }  
27 -  
28 - protected function inicializarObjInfraIBanco()  
29 - {  
30 - return BancoSEI::getInstance();  
31 - }  
32 -  
33 - public function listarTiposTarjaAssinatura()  
34 - {  
35 - try {  
36 -  
37 - $objArrTipoDTO = array();  
38 -  
39 - $objTipoDTO = new TipoDTO();  
40 - $objTipoDTO->setStrStaTipo(self::$TT_ASSINATURA_CERTIFICADO_DIGITAL);  
41 - $objTipoDTO->setStrDescricao('Assinatura com Certificado Digital');  
42 - $objArrTipoDTO[] = $objTipoDTO;  
43 -  
44 - $objTipoDTO = new TipoDTO();  
45 - $objTipoDTO->setStrStaTipo(self::$TT_ASSINATURA_SENHA);  
46 - $objTipoDTO->setStrDescricao('Assinatura Eletrônica');  
47 - $objArrTipoDTO[] = $objTipoDTO;  
48 -  
49 - $objTipoDTO = new TipoDTO();  
50 - $objTipoDTO->setStrStaTipo(self::$TT_AUTENTICACAO_CERTIFICADO_DIGITAL);  
51 - $objTipoDTO->setStrDescricao('Autenticação com Certificado Digital');  
52 - $objArrTipoDTO[] = $objTipoDTO;  
53 -  
54 - $objTipoDTO = new TipoDTO();  
55 - $objTipoDTO->setStrStaTipo(self::$TT_AUTENTICACAO_SENHA);  
56 - $objTipoDTO->setStrDescricao('Autenticação Eletrônica');  
57 - $objArrTipoDTO[] = $objTipoDTO;  
58 -  
59 - $objTipoDTO = new TipoDTO();  
60 - $objTipoDTO->setStrStaTipo(self::$TT_INSTRUCOES_VALIDACAO);  
61 - $objTipoDTO->setStrDescricao('Instruções de Validação');  
62 - $objArrTipoDTO[] = $objTipoDTO;  
63 -  
64 - //TODO: obter tipos de tarja adicionais via pontos de extensão (temporario)  
65 - global $SEI_MODULOS;  
66 -  
67 - foreach ($SEI_MODULOS as $seiModulo) {  
68 -  
69 - if (($arrIntegracao = $seiModulo->executar('montarTipoTarjaAssinaturaCustomizada')) != null) {  
70 -  
71 - foreach ($arrIntegracao as $objTipoDTO) {  
72 - $objArrTipoDTO[] = $objTipoDTO;  
73 - }  
74 -  
75 - }  
76 -  
77 - }  
78 -  
79 - return $objArrTipoDTO;  
80 -  
81 - } catch (Exception $e) {  
82 - throw new InfraException('Erro listando tipos de tarja de assinatura.', $e);  
83 - }  
84 - }  
85 -  
86 -  
87 - private function validarStrStaTarjaAssinatura(TarjaAssinaturaDTO $objTarjaAssinaturaDTO, InfraException $objInfraException)  
88 - {  
89 - if (InfraString::isBolVazia($objTarjaAssinaturaDTO->getStrStaTarjaAssinatura())) {  
90 - $objTarjaAssinaturaDTO->setStrStaTarjaAssinatura(null);  
91 - //$objInfraException->adicionarValidacao('Forma de Autenticação não informada.');  
92 - } else {  
93 - $objAssinaturaRN = new AssinaturaRN();  
94 - if (!in_array($objTarjaAssinaturaDTO->getStrStaTarjaAssinatura(), InfraArray::converterArrInfraDTO($this->listarTiposTarjaAssinatura(), 'StaTipo'))) {  
95 - $objInfraException->adicionarValidacao('Forma de Autenticação inválida.');  
96 - }  
97 - }  
98 - }  
99 -  
100 - private function validarStrTexto(TarjaAssinaturaDTO $objTarjaAssinaturaDTO, InfraException $objInfraException)  
101 - {  
102 - if (InfraString::isBolVazia($objTarjaAssinaturaDTO->getStrTexto())) {  
103 - $objInfraException->adicionarValidacao('Texto não informado.');  
104 - } else {  
105 - $objTarjaAssinaturaDTO->setStrTexto(trim($objTarjaAssinaturaDTO->getStrTexto()));  
106 - }  
107 - }  
108 -  
109 - private function validarStrNomeArquivo(TarjaAssinaturaDTO $objTarjaAssinaturaDTO, InfraException $objInfraException)  
110 - {  
111 - if (!InfraString::isBolVazia($objTarjaAssinaturaDTO->getStrNomeArquivo()) && $objTarjaAssinaturaDTO->getStrNomeArquivo() != "*REMOVER*") {  
112 - if (!file_exists(DIR_SEI_TEMP.'/'.$objTarjaAssinaturaDTO->getStrNomeArquivo())){  
113 - $objInfraException->adicionarValidacao('Não foi possível abrir arquivo da imagem.');  
114 - }  
115 - }  
116 - }  
117 -  
118 - /*  
119 - protected function cadastrarControlado(TarjaAssinaturaDTO $objTarjaAssinaturaDTO) {  
120 - try{  
121 -  
122 - //Valida Permissao  
123 - SessaoSEI::getInstance()->validarAuditarPermissao('tarja_assinatura_cadastrar',__METHOD__,$objTarjaAssinaturaDTO);  
124 -  
125 - //Regras de Negocio  
126 - $objInfraException = new InfraException();  
127 -  
128 - $this->validarStrStaTarjaAssinatura($objTarjaAssinaturaDTO, $objInfraException);  
129 - $this->validarStrTexto($objTarjaAssinaturaDTO, $objInfraException);  
130 - $this->validarStrLogo($objTarjaAssinaturaDTO, $objInfraException);  
131 -  
132 - $objInfraException->lancarValidacoes();  
133 -  
134 - $objTarjaAssinaturaBD = new TarjaAssinaturaBD($this->getObjInfraIBanco());  
135 - $ret = $objTarjaAssinaturaBD->cadastrar($objTarjaAssinaturaDTO);  
136 -  
137 - //Auditoria  
138 -  
139 - return $ret;  
140 -  
141 - }catch(Exception $e){  
142 - throw new InfraException('Erro cadastrando Tarja de Assinatura.',$e);  
143 - }  
144 - }  
145 - */  
146 -  
147 - protected function alterarControlado(TarjaAssinaturaDTO $objTarjaAssinaturaDTO)  
148 - {  
149 - try {  
150 -  
151 - //Valida Permissao  
152 - SessaoSEI::getInstance()->validarAuditarPermissao('tarja_assinatura_alterar', __METHOD__, $objTarjaAssinaturaDTO);  
153 -  
154 - $objTarjaAssinaturaDTOBanco = new TarjaAssinaturaDTO();  
155 - $objTarjaAssinaturaDTOBanco->retStrStaTarjaAssinatura();  
156 - $objTarjaAssinaturaDTOBanco->retStrTexto();  
157 - $objTarjaAssinaturaDTOBanco->retStrLogo();  
158 - $objTarjaAssinaturaDTOBanco->setNumIdTarjaAssinatura($objTarjaAssinaturaDTO->getNumIdTarjaAssinatura());  
159 - $objTarjaAssinaturaDTOBanco = $this->consultar($objTarjaAssinaturaDTOBanco);  
160 -  
161 - //Regras de Negocio  
162 - $objInfraException = new InfraException();  
163 -  
164 - if ($objTarjaAssinaturaDTO->getStrStaTarjaAssinatura() != $objTarjaAssinaturaDTOBanco->getStrStaTarjaAssinatura()) {  
165 - $objInfraException->adicionarValidacao('Não é possível alterar o tipo da tarja de assinatura.');  
166 - }  
167 -  
168 - $this->validarStrTexto($objTarjaAssinaturaDTO, $objInfraException);  
169 - $this->validarStrNomeArquivo($objTarjaAssinaturaDTO, $objInfraException);  
170 -  
171 - $objInfraException->lancarValidacoes();  
172 -  
173 - if (!InfraString::isBolVazia($objTarjaAssinaturaDTO->getStrNomeArquivo())) {  
174 - if ($objTarjaAssinaturaDTO->getStrNomeArquivo() == "*REMOVER*") {  
175 - $objTarjaAssinaturaDTO->setStrLogo(null);  
176 - } else {  
177 - $dadosArquivo = file_get_contents(DIR_SEI_TEMP.'/'.$objTarjaAssinaturaDTO->getStrNomeArquivo());  
178 - $objTarjaAssinaturaDTO->setStrLogo(base64_encode($dadosArquivo));  
179 - }  
180 - } else {  
181 - $objTarjaAssinaturaDTO->setStrLogo($objTarjaAssinaturaDTOBanco->getStrLogo());  
182 - }  
183 -  
184 - $objTarjaAssinaturaBD = new TarjaAssinaturaBD($this->getObjInfraIBanco());  
185 -  
186 - if ($objTarjaAssinaturaDTO->getStrTexto() != $objTarjaAssinaturaDTOBanco->getStrTexto() ||  
187 - $objTarjaAssinaturaDTO->getStrLogo() != $objTarjaAssinaturaDTOBanco->getStrLogo()  
188 - ) {  
189 -  
190 - $dto = new TarjaAssinaturaDTO();  
191 - $dto->setStrSinAtivo('N');  
192 - $dto->setNumIdTarjaAssinatura($objTarjaAssinaturaDTO->getNumIdTarjaAssinatura());  
193 - $objTarjaAssinaturaBD->alterar($dto);  
194 -  
195 - $objTarjaAssinaturaDTO->setStrSinAtivo('S');  
196 - $objTarjaAssinaturaBD->cadastrar($objTarjaAssinaturaDTO);  
197 -  
198 - } else {  
199 - $objTarjaAssinaturaBD->alterar($objTarjaAssinaturaDTO);  
200 - }  
201 -  
202 - //Auditoria  
203 -  
204 - } catch (Exception $e) {  
205 - throw new InfraException('Erro alterando Tarja de Assinatura.', $e);  
206 - }  
207 - }  
208 -  
209 - protected function excluirControlado($arrObjTarjaAssinaturaDTO)  
210 - {  
211 - try {  
212 -  
213 - //Valida Permissao  
214 - SessaoSEI::getInstance()->validarAuditarPermissao('tarja_assinatura_excluir', __METHOD__, $arrObjTarjaAssinaturaDTO);  
215 -  
216 - //Regras de Negocio  
217 - //$objInfraException = new InfraException();  
218 -  
219 - //$objInfraException->lancarValidacoes();  
220 -  
221 - $objTarjaAssinaturaBD = new TarjaAssinaturaBD($this->getObjInfraIBanco());  
222 - for ($i = 0; $i < count($arrObjTarjaAssinaturaDTO); $i++) {  
223 - $objTarjaAssinaturaBD->excluir($arrObjTarjaAssinaturaDTO[$i]);  
224 - }  
225 -  
226 - //Auditoria  
227 -  
228 - } catch (Exception $e) {  
229 - throw new InfraException('Erro excluindo Tarja de Assinatura.', $e);  
230 - }  
231 - }  
232 -  
233 - protected function consultarConectado(TarjaAssinaturaDTO $objTarjaAssinaturaDTO)  
234 - {  
235 - try {  
236 -  
237 - //Valida Permissao  
238 - SessaoSEI::getInstance()->validarAuditarPermissao('tarja_assinatura_consultar', __METHOD__, $objTarjaAssinaturaDTO);  
239 -  
240 - //Regras de Negocio  
241 - //$objInfraException = new InfraException();  
242 -  
243 - //$objInfraException->lancarValidacoes();  
244 -  
245 - $objTarjaAssinaturaBD = new TarjaAssinaturaBD($this->getObjInfraIBanco());  
246 - $ret = $objTarjaAssinaturaBD->consultar($objTarjaAssinaturaDTO);  
247 -  
248 - //Auditoria  
249 -  
250 - return $ret;  
251 - } catch (Exception $e) {  
252 - throw new InfraException('Erro consultando Tarja de Assinatura.', $e);  
253 - }  
254 - }  
255 -  
256 - protected function listarConectado(TarjaAssinaturaDTO $objTarjaAssinaturaDTO)  
257 - {  
258 - try {  
259 -  
260 - //Valida Permissao  
261 - SessaoSEI::getInstance()->validarAuditarPermissao('tarja_assinatura_listar', __METHOD__, $objTarjaAssinaturaDTO);  
262 -  
263 - //Regras de Negocio  
264 - //$objInfraException = new InfraException();  
265 -  
266 - //$objInfraException->lancarValidacoes();  
267 -  
268 - $objTarjaAssinaturaBD = new TarjaAssinaturaBD($this->getObjInfraIBanco());  
269 - $ret = $objTarjaAssinaturaBD->listar($objTarjaAssinaturaDTO);  
270 -  
271 - //Auditoria  
272 -  
273 - return $ret;  
274 -  
275 - } catch (Exception $e) {  
276 - throw new InfraException('Erro listando Tarjas de Assinatura.', $e);  
277 - }  
278 - }  
279 -  
280 - protected function contarConectado(TarjaAssinaturaDTO $objTarjaAssinaturaDTO)  
281 - {  
282 - try {  
283 -  
284 - //Valida Permissao  
285 - SessaoSEI::getInstance()->validarAuditarPermissao('tarja_assinatura_listar', __METHOD__, $objTarjaAssinaturaDTO);  
286 -  
287 - //Regras de Negocio  
288 - //$objInfraException = new InfraException();  
289 -  
290 - //$objInfraException->lancarValidacoes();  
291 -  
292 - $objTarjaAssinaturaBD = new TarjaAssinaturaBD($this->getObjInfraIBanco());  
293 - $ret = $objTarjaAssinaturaBD->contar($objTarjaAssinaturaDTO);  
294 -  
295 - //Auditoria  
296 -  
297 - return $ret;  
298 - } catch (Exception $e) {  
299 - throw new InfraException('Erro contando Tarjas de Assinatura.', $e);  
300 - }  
301 - }  
302 -  
303 - /*  
304 - protected function desativarControlado($arrObjTarjaAssinaturaDTO){  
305 - try {  
306 -  
307 - //Valida Permissao  
308 - SessaoSEI::getInstance()->validarAuditarPermissao('tarja_assinatura_desativar');  
309 -  
310 - //Regras de Negocio  
311 - //$objInfraException = new InfraException();  
312 -  
313 - //$objInfraException->lancarValidacoes();  
314 -  
315 - $objTarjaAssinaturaBD = new TarjaAssinaturaBD($this->getObjInfraIBanco());  
316 - for($i=0;$i<count($arrObjTarjaAssinaturaDTO);$i++){  
317 - $objTarjaAssinaturaBD->desativar($arrObjTarjaAssinaturaDTO[$i]);  
318 - }  
319 -  
320 - //Auditoria  
321 -  
322 - }catch(Exception $e){  
323 - throw new InfraException('Erro desativando Tarja de Assinatura.',$e);  
324 - }  
325 - }  
326 -  
327 - protected function reativarControlado($arrObjTarjaAssinaturaDTO){  
328 - try {  
329 -  
330 - //Valida Permissao  
331 - SessaoSEI::getInstance()->validarAuditarPermissao('tarja_assinatura_reativar');  
332 -  
333 - //Regras de Negocio  
334 - //$objInfraException = new InfraException();  
335 -  
336 - //$objInfraException->lancarValidacoes();  
337 -  
338 - $objTarjaAssinaturaBD = new TarjaAssinaturaBD($this->getObjInfraIBanco());  
339 - for($i=0;$i<count($arrObjTarjaAssinaturaDTO);$i++){  
340 - $objTarjaAssinaturaBD->reativar($arrObjTarjaAssinaturaDTO[$i]);  
341 - }  
342 -  
343 - //Auditoria  
344 -  
345 - }catch(Exception $e){  
346 - throw new InfraException('Erro reativando Tarja de Assinatura.',$e);  
347 - }  
348 - }  
349 -  
350 - protected function bloquearControlado(TarjaAssinaturaDTO $objTarjaAssinaturaDTO)  
351 - {  
352 - try {  
353 -  
354 - //Valida Permissao  
355 - SessaoSEI::getInstance()->validarAuditarPermissao('tarja_assinatura_consultar');  
356 -  
357 - //Regras de Negocio  
358 - //$objInfraException = new InfraException();  
359 -  
360 - //$objInfraException->lancarValidacoes();  
361 -  
362 - $objTarjaAssinaturaBD = new TarjaAssinaturaBD($this->getObjInfraIBanco());  
363 - $ret = $objTarjaAssinaturaBD->bloquear($objTarjaAssinaturaDTO);  
364 -  
365 - //Auditoria  
366 -  
367 - return $ret;  
368 - } catch (Exception $e) {  
369 - throw new InfraException('Erro bloqueando Tarja de Assinatura.', $e);  
370 - }  
371 - }  
372 - */  
373 -}  
374 -?>  
375 \ No newline at end of file 0 \ No newline at end of file