Commit 8d3e96cd7f4e4a25a55c198a043adf82ad1d620e
1 parent
d4eae54a
Exists in
master
and in
1 other branch
Atualizações pré versão 1.1 do Módulo.
Showing
4 changed files
with
170 additions
and
234 deletions
Show diff stats
sei/web/modulos/peticionamento/int/MdPetIntercorrenteINT.php
@@ -16,113 +16,92 @@ | @@ -16,113 +16,92 @@ | ||
16 | * @param int $numeroProcesso | 16 | * @param int $numeroProcesso |
17 | * @return string | 17 | * @return string |
18 | * @since 28/11/2016 | 18 | * @since 28/11/2016 |
19 | - * @author Jaqueline Mendes jaqueline.mendes@castgroup.com.br | ||
20 | */ | 19 | */ |
21 | public static function gerarXMLvalidacaoNumeroProcesso($numeroProcesso) | 20 | public static function gerarXMLvalidacaoNumeroProcesso($numeroProcesso) |
22 | { | 21 | { |
22 | + $xmlMensagemErro = '<Validacao><MensagemValidacao>%s</MensagemValidacao></Validacao>'; | ||
23 | + $strMsgProcessoNaoExiste = 'O número de processo indicado não existe no sistema. Verifique se o número está correto e completo, inclusive com o Dígito Verificador.'; | ||
24 | + $strMsgProcessoNaoAceitaPeticionamento = 'O processo indicado não aceita peticionamento intercorrente. Utilize o Peticionamento de Processo Novo para protocolizar sua demanda.'; | ||
23 | 25 | ||
24 | $objMdPetIntercorrenteRN = new MdPetIntercorrenteProcessoRN(); | 26 | $objMdPetIntercorrenteRN = new MdPetIntercorrenteProcessoRN(); |
25 | $objProtocoloDTO = new ProtocoloDTO(); | 27 | $objProtocoloDTO = new ProtocoloDTO(); |
26 | $objProtocoloDTO->setStrProtocoloFormatadoPesquisa(InfraUtil::retirarFormatacao($numeroProcesso, false)); | 28 | $objProtocoloDTO->setStrProtocoloFormatadoPesquisa(InfraUtil::retirarFormatacao($numeroProcesso, false)); |
27 | $objProtocoloDTO = $objMdPetIntercorrenteRN->pesquisarProtocoloFormatado($objProtocoloDTO); | 29 | $objProtocoloDTO = $objMdPetIntercorrenteRN->pesquisarProtocoloFormatado($objProtocoloDTO); |
28 | - | ||
29 | $xml = '<Validacao>'; | 30 | $xml = '<Validacao>'; |
30 | 31 | ||
31 | - if (!is_null($objProtocoloDTO)) { | ||
32 | - $objProcedimentoDTO = new ProcedimentoDTO(); | ||
33 | - $objProcedimentoRN = new ProcedimentoRN(); | ||
34 | - $objProcedimentoDTO->setDblIdProcedimento($objProtocoloDTO->getDblIdProtocolo()); | ||
35 | - $objProcedimentoDTO->retTodos(true); | ||
36 | - $objProcedimentoDTO = $objProcedimentoRN->consultarRN0201($objProcedimentoDTO); | ||
37 | - $msg = ''; | ||
38 | - | ||
39 | - if (!is_null($objProcedimentoDTO)) { | ||
40 | - | ||
41 | - $unidadeValida = $objMdPetIntercorrenteRN->validarUnidadeProcesso($objProcedimentoDTO); | ||
42 | - $idProcedimento = $objProcedimentoDTO->getDblIdProcedimento(); | ||
43 | - | ||
44 | - if ($unidadeValida) { | ||
45 | - $idTpProcedimento = $objProcedimentoDTO->getNumIdTipoProcedimento(); | ||
46 | - $tpProcedimento = $objProcedimentoDTO->getStrNomeTipoProcedimento(); | ||
47 | - | ||
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 | - } | ||
111 | - } else { | ||
112 | - $msg = 'O processo indicado não aceita peticionamento intercorrente. Utilize o Peticionamento de Processo Novo para protocolizar sua demanda.'; | ||
113 | - //$xml .= '<MensagemValidacao>. $msg.</MensagemValidacao>'; | 32 | + if (! $objProtocoloDTO) { |
33 | + return sprintf($xmlMensagemErro, $strMsgProcessoNaoExiste); | ||
34 | + } | ||
35 | + | ||
36 | + $objProcedimentoDTO = new ProcedimentoDTO(); | ||
37 | + $objProcedimentoRN = new ProcedimentoRN(); | ||
38 | + $objProcedimentoDTO->setDblIdProcedimento($objProtocoloDTO->getDblIdProtocolo()); | ||
39 | + $objProcedimentoDTO->retTodos(true); | ||
40 | + $objProcedimentoDTO = $objProcedimentoRN->consultarRN0201($objProcedimentoDTO); | ||
41 | + | ||
42 | + $unidadeValida = $objMdPetIntercorrenteRN->validarUnidadeProcesso($objProcedimentoDTO); | ||
43 | + | ||
44 | + if (! $unidadeValida) { | ||
45 | + return sprintf($xmlMensagemErro, $strMsgProcessoNaoAceitaPeticionamento); | ||
46 | + } | ||
47 | + | ||
48 | + $objAtividadeDTO = new AtividadeDTO(); | ||
49 | + $objAtividadeDTO->setDblIdProcedimentoProtocolo($objProcedimentoDTO->getDblIdProcedimento()); | ||
50 | + $idUnidadeReabrirProcesso = $objMdPetIntercorrenteRN->retornaUltimaUnidadeProcessoConcluido($objAtividadeDTO); | ||
51 | + | ||
52 | + $unidadeDTO = new UnidadeDTO(); | ||
53 | + $unidadeDTO->retTodos(); | ||
54 | + $unidadeDTO->setBolExclusaoLogica(false); | ||
55 | + $unidadeDTO->setNumIdUnidade($idUnidadeReabrirProcesso); | ||
56 | + $unidadeRN = new UnidadeRN(); | ||
57 | + $objUnidadeDTO = $unidadeRN->consultarRN0125($unidadeDTO); | ||
58 | + | ||
59 | + if($objUnidadeDTO->getStrSinAtivo() == 'N'){ | ||
60 | + $idUnidadeReabrirProcesso = null; | ||
61 | + $objAtividadeRN = new MdPetIntercorrenteAtividadeRN(); | ||
62 | + $arrObjUnidadeDTO = $objAtividadeRN->listarUnidadesTramitacao($objProcedimentoDTO); | ||
63 | + | ||
64 | + foreach ($arrObjUnidadeDTO as $itemObjUnidadeDTO) { | ||
65 | + if ($itemObjUnidadeDTO->getStrSinAtivo() == 'S') { | ||
66 | + $idUnidadeReabrirProcesso = $itemObjUnidadeDTO->getNumIdUnidade(); | ||
114 | } | 67 | } |
115 | - } else { | ||
116 | - $msg = 'O número de processo indicado não existe no sistema. Verifique se o número está correto e completo, inclusive com o Dígito Verificador.'; | ||
117 | } | 68 | } |
118 | - } else { | ||
119 | - $msg = 'O número de processo indicado não existe no sistema. Verifique se o número está correto e completo, inclusive com o Dígito Verificador.'; | 69 | + |
70 | + if($idUnidadeReabrirProcesso == null) { | ||
71 | + return sprintf($xmlMensagemErro, $strMsgProcessoNaoAceitaPeticionamento); | ||
72 | + } | ||
120 | } | 73 | } |
121 | 74 | ||
122 | - if ($msg != '') { | ||
123 | - $xml .= '<MensagemValidacao>' . $msg . '</MensagemValidacao>'; | 75 | + $objCriterioIntercorrenteDTO = new CriterioIntercorrentePeticionamentoDTO(); |
76 | + $objCriterioIntercorrenteRN = new CriterioIntercorrentePeticionamentoRN(); | ||
77 | + $objCriterioIntercorrenteDTO->setNumIdTipoProcedimento($objProcedimentoDTO->getNumIdTipoProcedimento()); | ||
78 | + $objCriterioIntercorrenteDTO->setStrSinCriterioPadrao('N'); | ||
79 | + $objCriterioIntercorrenteDTO->retTodos(true); | ||
80 | + | ||
81 | + $contadorCriterioIntercorrente = $objCriterioIntercorrenteRN->contar($objCriterioIntercorrenteDTO); | ||
82 | + | ||
83 | + $estadosReabrirRelacionado = array(ProtocoloRN::$TE_PROCEDIMENTO_SOBRESTADO, ProtocoloRN::$TE_PROCEDIMENTO_ANEXADO, ProtocoloRN::$TE_PROCEDIMENTO_BLOQUEADO); | ||
84 | + /** | ||
85 | + * Verifica se: | ||
86 | + * 1 - Se o processo eh sigiloso (nivel de acesso global ou local eh igual a 2) | ||
87 | + * 2 - Se o Tipo do Processo do procedimento informado nao possui um intercorrente cadastrado(neste caso irah utilizar o Intercorrente Padrao) | ||
88 | + */ | ||
89 | + $processoIntercorrente = 'Direto no Processo Indicado'; | ||
90 | + if($contadorCriterioIntercorrente <= 0 | ||
91 | + || $objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo() == ProtocoloRN::$NA_SIGILOSO | ||
92 | + || $objProcedimentoDTO->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_SIGILOSO | ||
93 | + || in_array($objProcedimentoDTO->getStrStaEstadoProtocolo(), $estadosReabrirRelacionado)){ | ||
94 | + $processoIntercorrente = 'Em Processo Novo Relacionado ao Processo Indicado'; | ||
124 | } | 95 | } |
125 | 96 | ||
97 | + $urlValida = PaginaSEIExterna::getInstance()->formatarXHTML(SessaoSEIExterna::getInstance()->assinarLink('controlador_externo.php?id_procedimento=' . $objProcedimentoDTO->getDblIdProcedimento() . '&id_tipo_procedimento=' . $objProcedimentoDTO->getNumIdTipoProcedimento() . '&acao=md_pet_intercorrente_usu_ext_assinar&tipo_selecao=2')); | ||
98 | + | ||
99 | + $xml .= '<IdTipoProcedimento>' . $objProcedimentoDTO->getNumIdTipoProcedimento() . '</IdTipoProcedimento>'; | ||
100 | + $xml .= '<IdProcedimento>' . $objProcedimentoDTO->getDblIdProcedimento() . '</IdProcedimento>'; | ||
101 | + $xml .= '<numeroProcesso>' . $objProcedimentoDTO->getStrProtocoloProcedimentoFormatado() . '</numeroProcesso>'; | ||
102 | + $xml .= '<TipoProcedimento> ' . $objProcedimentoDTO->getStrNomeTipoProcedimento() . ' </TipoProcedimento>'; | ||
103 | + $xml .= '<ProcessoIntercorrente>' . $processoIntercorrente . '</ProcessoIntercorrente>'; | ||
104 | + $xml .= '<UrlValida>' . htmlentities($urlValida) . '</UrlValida>'; | ||
126 | $xml .= '</Validacao>'; | 105 | $xml .= '</Validacao>'; |
127 | 106 | ||
128 | return $xml; | 107 | return $xml; |
sei/web/modulos/peticionamento/md_pet_intercorrente_usu_ext_concluir.php
@@ -206,143 +206,6 @@ function assinar(){ | @@ -206,143 +206,6 @@ function assinar(){ | ||
206 | return false; | 206 | return false; |
207 | } | 207 | } |
208 | 208 | ||
209 | -function assinar2(){ | ||
210 | - | ||
211 | - if( isValido() ){ | ||
212 | - | ||
213 | - var textoEspecificacao = window.opener.document.getElementById('txtEspecificacao').value; | ||
214 | - var nivelAcesso = window.opener.document.getElementById('nivelAcesso1').value; | ||
215 | - | ||
216 | - var campoHipLegal1 = window.opener.document.getElementById('hipoteseLegal1'); | ||
217 | - var campoHipLegal2 = window.opener.document.getElementById('hipoteseLegal2'); | ||
218 | - var campoHipLegal3 = window.opener.document.getElementById('hipoteseLegal3'); | ||
219 | - | ||
220 | - var hipoteseLegal = null; | ||
221 | - var hipoteseLegal2 = null; | ||
222 | - var hipoteseLegal3 = null; | ||
223 | - | ||
224 | - if( campoHipLegal1 != null && campoHipLegal1 != undefined ){ | ||
225 | - hipoteseLegal = campoHipLegal1.value; | ||
226 | - } | ||
227 | - | ||
228 | - if( campoHipLegal2 != null && campoHipLegal2 != undefined ){ | ||
229 | - hipoteseLegal2 = window.opener.document.getElementById('hipoteseLegal2'); | ||
230 | - } | ||
231 | - | ||
232 | - if( campoHipLegal3 != null && campoHipLegal3 != undefined ){ | ||
233 | - hipoteseLegal3 = window.opener.document.getElementById('hipoteseLegal3'); | ||
234 | - } | ||
235 | - | ||
236 | - if( hipoteseLegal2 != null && hipoteseLegal2 != undefined ){ | ||
237 | - document.getElementById('hipoteseLegalDocEssencial').value = hipoteseLegal2.value; | ||
238 | - } | ||
239 | - | ||
240 | - if( hipoteseLegal3 != null && hipoteseLegal3 != undefined ){ | ||
241 | - document.getElementById('hipoteseLegalDocComplementar').value = hipoteseLegal3.value; | ||
242 | - } | ||
243 | - | ||
244 | - document.getElementById('txtEspecificacaoDocPrincipal').value = textoEspecificacao; | ||
245 | - document.getElementById('nivelAcessoDocPrincipal').value = nivelAcesso; | ||
246 | - document.getElementById('grauSigiloDocPrincipal').value = nivelAcesso; | ||
247 | - document.getElementById('hipoteseLegalDocPrincipal').value = hipoteseLegal; | ||
248 | - | ||
249 | - //verificar se esta vindo uma lista de interessados | ||
250 | - var selInteressados = window.opener.document.getElementById('selInteressados'); | ||
251 | - var hdnSelInteressadosIndicados = window.opener.document.getElementById('hdnListaInteressadosIndicados'); | ||
252 | - var selInteressadosSelecionadosTxt = ''; | ||
253 | - | ||
254 | - //verificar se esta a combo de UF (Unidades multiplas) | ||
255 | - var selUFAberturaProcesso = window.opener.document.getElementById('selUFAberturaProcesso'); | ||
256 | - | ||
257 | - if( selUFAberturaProcesso != null ) { | ||
258 | - document.getElementById('hdnIdUnidadeMultiplaSelecionada').value = selUFAberturaProcesso.value; | ||
259 | - } | ||
260 | - | ||
261 | - // loop through options in select list | ||
262 | - if( selInteressados != null ) { | ||
263 | - | ||
264 | - for (var i=0, len=selInteressados.options.length; i<len; i++) { | ||
265 | - | ||
266 | - opt = selInteressados.options[i]; | ||
267 | - | ||
268 | - // add to array of option elements to return from this function | ||
269 | - if( selInteressadosSelecionadosTxt != ''){ | ||
270 | - selInteressadosSelecionadosTxt += ','; | ||
271 | - } | ||
272 | - | ||
273 | - selInteressadosSelecionadosTxt += opt.value; | ||
274 | - | ||
275 | - } | ||
276 | - | ||
277 | - document.getElementById('hdnListaInteressados').value = selInteressadosSelecionadosTxt; | ||
278 | - | ||
279 | - } | ||
280 | - | ||
281 | - //lista de interessados indicados por CPF/CNPJ | ||
282 | - if( hdnSelInteressadosIndicados != null && hdnSelInteressadosIndicados != "") { | ||
283 | - | ||
284 | - var hdnListaInteressadosIndicados = hdnSelInteressadosIndicados.value; | ||
285 | - | ||
286 | - //caractere de quebra de linha | ||
287 | - var arrHash = hdnListaInteressadosIndicados.split('¥'); | ||
288 | - var quantidadeRegistro = arrHash.length; | ||
289 | - | ||
290 | - if( quantidadeRegistro == 0){ | ||
291 | - | ||
292 | - //caractere de quebra de coluna | ||
293 | - var arrLocal = hdnListaInteressadosIndicados.split('±'); | ||
294 | - var idContato = arrLocal[0]; | ||
295 | - | ||
296 | - if( selInteressadosSelecionadosTxt != ''){ | ||
297 | - selInteressadosSelecionadosTxt += ','; | ||
298 | - } | ||
299 | - | ||
300 | - selInteressadosSelecionadosTxt += idContato; | ||
301 | - | ||
302 | - } else if( quantidadeRegistro > 0 ){ | ||
303 | - | ||
304 | - for(var i = 0; i < quantidadeRegistro ; i++ ){ | ||
305 | - | ||
306 | - var arrLocal = arrHash[i].split('±'); | ||
307 | - var idContato = arrLocal[0]; | ||
308 | - | ||
309 | - if( selInteressadosSelecionadosTxt != ''){ | ||
310 | - selInteressadosSelecionadosTxt += ','; | ||
311 | - } | ||
312 | - | ||
313 | - selInteressadosSelecionadosTxt += idContato; | ||
314 | - | ||
315 | - } | ||
316 | - | ||
317 | - } | ||
318 | - | ||
319 | - document.getElementById('hdnListaInteressados').value = selInteressadosSelecionadosTxt; | ||
320 | - | ||
321 | - } | ||
322 | - | ||
323 | - //obtendo valores das grids de documentos principais, essenciais e complementares | ||
324 | - var hdnDocPrincipal = window.opener.document.getElementById('hdnDocPrincipal'); | ||
325 | - var hdnDocEssencial = window.opener.document.getElementById('hdnDocEssencial'); | ||
326 | - var hdnDocComplementar = window.opener.document.getElementById('hdnDocComplementar'); | ||
327 | - | ||
328 | - if( hdnDocPrincipal != null && hdnDocPrincipal != undefined){ | ||
329 | - document.getElementById('hdnDocPrincipal').value = hdnDocPrincipal.value; | ||
330 | - } | ||
331 | - | ||
332 | - if( hdnDocEssencial != null && hdnDocEssencial != undefined){ | ||
333 | - document.getElementById('hdnDocEssencial').value = hdnDocEssencial.value; | ||
334 | - } | ||
335 | - | ||
336 | - if( hdnDocComplementar != null && hdnDocComplementar != undefined){ | ||
337 | - document.getElementById('hdnDocComplementar').value = hdnDocComplementar.value; | ||
338 | - } | ||
339 | - | ||
340 | - document.getElementById('frmConcluir').submit(); | ||
341 | - | ||
342 | - } | ||
343 | - | ||
344 | -} | ||
345 | - | ||
346 | function callback(opt) { | 209 | function callback(opt) { |
347 | selInteressadosSelecionados + ', '; | 210 | selInteressadosSelecionados + ', '; |
348 | } | 211 | } |
sei/web/modulos/peticionamento/rn/EmailNotificacaoPetIntercorrenteRN.php
@@ -48,12 +48,29 @@ class EmailNotificacaoPetIntercorrenteRN extends EmailNotificacaoPeticionamentoR | @@ -48,12 +48,29 @@ class EmailNotificacaoPetIntercorrenteRN extends EmailNotificacaoPeticionamentoR | ||
48 | $objOrgaoDTO->setStrSinAtivo('S'); | 48 | $objOrgaoDTO->setStrSinAtivo('S'); |
49 | $objOrgaoDTO = $orgaoRN->consultarRN1352( $objOrgaoDTO ); | 49 | $objOrgaoDTO = $orgaoRN->consultarRN1352( $objOrgaoDTO ); |
50 | 50 | ||
51 | - //pegar a lista de email da unidade, a unidade pode não ter, email unidade | ||
52 | - $objEmailUnidadeDTO = new EmailUnidadeDTO(); | ||
53 | - $emailUnidadeRN = new EmailUnidadeRN(); | ||
54 | - $objEmailUnidadeDTO->retStrEmail(); | ||
55 | - $objEmailUnidadeDTO->setNumIdUnidade($objUnidadeDTO->getNumIdUnidade()); | ||
56 | - $arrEmailUnidade = $emailUnidadeRN->listar($objEmailUnidadeDTO); | 51 | + // Se Direto no Processo Indicado, não só unidade geradoras, mas todas abertas |
52 | + if ($arrParametros['diretoProcessoIndicado']){ | ||
53 | + $objMdPetIntercorrenteProcessoRN = new MdPetIntercorrenteProcessoRN(); | ||
54 | + $arrObjAtividadeDTO = $objMdPetIntercorrenteProcessoRN->retornaUnidadesProcessoAberto( $arrParametros['id_procedimento'] ); | ||
55 | + $arrUnidade = InfraArray::converterArrInfraDTO($arrObjAtividadeDTO,'IdUnidade'); | ||
56 | + | ||
57 | + $objEmailUnidadeDTO = new EmailUnidadeDTO(); | ||
58 | + $emailUnidadeRN = new EmailUnidadeRN(); | ||
59 | + $objEmailUnidadeDTO->retStrEmail(); | ||
60 | + $objEmailUnidadeDTO->adicionarCriterio( | ||
61 | + array('IdUnidade'), | ||
62 | + array(InfraDTO::$OPER_IN), | ||
63 | + array( $arrUnidade ) | ||
64 | + ); | ||
65 | + $arrEmailUnidade = $emailUnidadeRN->listar($objEmailUnidadeDTO); | ||
66 | + //pegar a lista de email da unidade, a unidade pode não ter, email unidade | ||
67 | + }else{ | ||
68 | + $objEmailUnidadeDTO = new EmailUnidadeDTO(); | ||
69 | + $emailUnidadeRN = new EmailUnidadeRN(); | ||
70 | + $objEmailUnidadeDTO->retStrEmail(); | ||
71 | + $objEmailUnidadeDTO->setNumIdUnidade($objUnidadeDTO->getNumIdUnidade()); | ||
72 | + $arrEmailUnidade = $emailUnidadeRN->listar($objEmailUnidadeDTO); | ||
73 | + } | ||
57 | 74 | ||
58 | //obtendo o tipo de procedimento | 75 | //obtendo o tipo de procedimento |
59 | $idTipoProc = $arrParametros['id_tipo_procedimento']; | 76 | $idTipoProc = $arrParametros['id_tipo_procedimento']; |
sei/web/modulos/peticionamento/rn/MdPetIntercorrenteProcessoRN.php
@@ -220,6 +220,80 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN { | @@ -220,6 +220,80 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN { | ||
220 | return $objUnidadeAPI->getIdUnidade(); | 220 | return $objUnidadeAPI->getIdUnidade(); |
221 | } | 221 | } |
222 | 222 | ||
223 | + /** | ||
224 | + * Função responsável por Retornar todas as unidades em que o processo está aberto | ||
225 | + * buscado em: ProcedimentoINT.php - montarAcoesArvore() - linhas 766 a 870 | ||
226 | + * @param $idProcedimento | ||
227 | + * @return AtividadeDTO $arrObjAtividadeDTO | ||
228 | + * @since 07/03/2017 | ||
229 | + * @author CAST - castgroup.com.br | ||
230 | + */ | ||
231 | + protected function retornaUnidadesProcessoAbertoConectado($idProcedimento){ | ||
232 | + | ||
233 | + $arrAtividade = array(); | ||
234 | + | ||
235 | + $objProcedimentoDTO = new ProcedimentoDTO(); | ||
236 | + $objProcedimentoDTO->setDblIdProcedimento($idProcedimento); | ||
237 | + $objProcedimentoDTO->retStrStaNivelAcessoGlobalProtocolo(); | ||
238 | + $objProcedimentoDTO->retStrStaEstadoProtocolo(); | ||
239 | + | ||
240 | + $objProcedimentoRN = new ProcedimentoRN(); | ||
241 | + $objProcedimentoDTO = $objProcedimentoRN->consultarRN0201($objProcedimentoDTO); | ||
242 | + $strStaNivelAcessoGlobal = $objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo(); | ||
243 | + | ||
244 | + $bolFlagSobrestado = false; | ||
245 | + if ($objProcedimentoDTO->getStrStaEstadoProtocolo()==ProtocoloRN::$TE_PROCEDIMENTO_SOBRESTADO){ | ||
246 | + $bolFlagSobrestado = true; | ||
247 | + } | ||
248 | + | ||
249 | + $objAtividadeRN = new AtividadeRN(); | ||
250 | + $objAtividadeDTO = new AtividadeDTO(); | ||
251 | + $objAtividadeDTO->setDistinct(true); | ||
252 | + $objAtividadeDTO->retNumIdUnidade(); | ||
253 | + $objAtividadeDTO->retStrSiglaUnidade(); | ||
254 | + $objAtividadeDTO->retStrDescricaoUnidade(); | ||
255 | + | ||
256 | + $objAtividadeDTO->setOrdStrSiglaUnidade(InfraDTO::$TIPO_ORDENACAO_ASC); | ||
257 | + | ||
258 | + if ($strStaNivelAcessoGlobal==ProtocoloRN::$NA_SIGILOSO){ | ||
259 | + $objAtividadeDTO->retNumIdUsuario(); | ||
260 | + $objAtividadeDTO->retStrSiglaUsuario(); | ||
261 | + $objAtividadeDTO->retStrNomeUsuario(); | ||
262 | + }else{ | ||
263 | + $objAtividadeDTO->retNumIdUsuarioAtribuicao(); | ||
264 | + $objAtividadeDTO->retStrSiglaUsuarioAtribuicao(); | ||
265 | + $objAtividadeDTO->retStrNomeUsuarioAtribuicao(); | ||
266 | + | ||
267 | + //ordena descendente pois no envio de processo que já existe na unidade e está atribuído ficará com mais de um andamento em aberto | ||
268 | + //desta forma os andamentos com usuário nulo (envios do processo) serão listados depois | ||
269 | + $objAtividadeDTO->setOrdStrSiglaUsuarioAtribuicao(InfraDTO::$TIPO_ORDENACAO_DESC); | ||
270 | + } | ||
271 | + $objAtividadeDTO->setDblIdProtocolo($idProcedimento); | ||
272 | + $objAtividadeDTO->setDthConclusao(null); | ||
273 | + | ||
274 | + //sigiloso sem credencial nao considera o usuario atual | ||
275 | + if ($strStaNivelAcessoGlobal==ProtocoloRN::$NA_SIGILOSO){ | ||
276 | + $objAcessoDTO = new AcessoDTO(); | ||
277 | + $objAcessoDTO->setDistinct(true); | ||
278 | + $objAcessoDTO->retNumIdUsuario(); | ||
279 | + $objAcessoDTO->setDblIdProtocolo($dblIdProcedimento); | ||
280 | + $objAcessoDTO->setStrStaTipo(AcessoRN::$TA_CREDENCIAL_PROCESSO); | ||
281 | + | ||
282 | + $objAcessoRN = new AcessoRN(); | ||
283 | + $arrObjAcessoDTO = $objAcessoRN->listar($objAcessoDTO); | ||
284 | + | ||
285 | + $objAtividadeDTO->setNumIdUsuario(InfraArray::converterArrInfraDTO($arrObjAcessoDTO,'IdUsuario'),InfraDTO::$OPER_IN); | ||
286 | + } | ||
287 | + | ||
288 | + $arrObjAtividadeDTO = $objAtividadeRN->listarRN0036($objAtividadeDTO); | ||
289 | + | ||
290 | + if ($strStaNivelAcessoGlobal!=ProtocoloRN::$NA_SIGILOSO){ | ||
291 | + //filtra andamentos com indicação de usuário atribuído | ||
292 | + $arrObjAtividadeDTO = InfraArray::distinctArrInfraDTO($arrObjAtividadeDTO,'SiglaUnidade'); | ||
293 | + } | ||
294 | + return $arrObjAtividadeDTO; | ||
295 | + } | ||
296 | + | ||
223 | protected function incluirDocumentosApi($objProcedimentoDTO, $arrObjDocumentoAPI) | 297 | protected function incluirDocumentosApi($objProcedimentoDTO, $arrObjDocumentoAPI) |
224 | { | 298 | { |
225 | $arrObjReciboDocPet = array(); | 299 | $arrObjReciboDocPet = array(); |
@@ -575,6 +649,7 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN { | @@ -575,6 +649,7 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN { | ||
575 | * 1 - Se o processo eh sigiloso (nivel de acesso global ou local eh igual a 2) | 649 | * 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) | 650 | * 2 - Se o Tipo do Processo do procedimento informado nao possui um intercorrente cadastrado(neste caso irah utilizar o Intercorrente Padrao) |
577 | */ | 651 | */ |
652 | + $params['diretoProcessoIndicado']=false; | ||
578 | if ($objCriterioIntercorrenteDTO->getStrSinCriterioPadrao() == 'S' | 653 | if ($objCriterioIntercorrenteDTO->getStrSinCriterioPadrao() == 'S' |
579 | || $objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo() == ProtocoloRN::$NA_SIGILOSO | 654 | || $objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo() == ProtocoloRN::$NA_SIGILOSO |
580 | || $objProcedimentoDTO->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_SIGILOSO | 655 | || $objProcedimentoDTO->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_SIGILOSO |
@@ -601,6 +676,8 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN { | @@ -601,6 +676,8 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN { | ||
601 | $reaberturaRN->reabrirProcessoApi($objProcedimentoDTO); | 676 | $reaberturaRN->reabrirProcessoApi($objProcedimentoDTO); |
602 | } | 677 | } |
603 | 678 | ||
679 | + $params['diretoProcessoIndicado']=true; | ||
680 | + | ||
604 | $this->setProcedimentoDTO($params['id_procedimento']); | 681 | $this->setProcedimentoDTO($params['id_procedimento']); |
605 | } | 682 | } |
606 | 683 |