Commit 21e2b9a56db6dcf94ee3110e369c90fd4e985dd9
1 parent
2765fbeb
Exists in
master
and in
3 other branches
Códigos adequados para o SEI 3.0.0
Showing
37 changed files
with
6718 additions
and
0 deletions
Show diff stats
@@ -0,0 +1,36 @@ | @@ -0,0 +1,36 @@ | ||
1 | +# Módulo de Pesquisa Pública | ||
2 | + | ||
3 | +## Requisitos: | ||
4 | +- SEI 3.0.0 instalado ou atualizado (verificar valor da constante de versão do SEI no arquivo /sei/web/SEI.php). | ||
5 | +- Antes de executar os scripts de instalação (itens 4 e 5 abaixo), o usuário de acesso aos bancos de dados do SEI e do SIP, constante nos arquivos ConfiguracaoSEI.php e ConfiguracaoSip.php, deverá ter permissão de acesso total ao banco de dados, permitindo, por exemplo, criação e exclusão de tabelas. | ||
6 | + | ||
7 | +## Procedimentos para Instalação: | ||
8 | + | ||
9 | +1. Fazer backup dos bancos de dados do SEI e do SIP. | ||
10 | + | ||
11 | +2. Carregar no servidor os arquivos do módulo localizados na pasta "/sei/web/modulos/pesquisa" e os scripts de instalação/atualização "/sei/scripts/sei_instalar_modulo_pesquisa.php" e "/sip/scripts/sip_instalar_modulo_pesquisa.php". | ||
12 | + | ||
13 | +3. Editar o arquivo "/sei/config/ConfiguracaoSEI.php", tomando o cuidado de usar editor que não altere o charset do arquivo, para adicionar a referência à classe de integração do módulo e seu caminho relativo dentro da pasta "/sei/web/modulos" na array 'Modulos' da chave 'SEI': | ||
14 | + | ||
15 | + 'SEI' => array( | ||
16 | + 'URL' => 'http://[Servidor_PHP]/sei', | ||
17 | + 'Producao' => false, | ||
18 | + 'RepositorioArquivos' => '/var/sei/arquivos', | ||
19 | + 'Modulos' => array('PesquisaIntegracao' => 'pesquisa',) | ||
20 | + ), | ||
21 | + | ||
22 | +4. Rodar o script de banco "/sei/scripts/sei_instalar_modulo_pesquisa.php" em linha de comando no servidor do SEI, verificando se não houve erro em sua execução, em que ao final do log deverá ser informado "FIM". Exemplo de comando de execução: | ||
23 | + | ||
24 | + /usr/bin/php -c /etc/php.ini /var/www/html/sei/scripts/sei_instalar_modulo_pesquisa.php > atualizacao_modulo_pesquisa_sei.log | ||
25 | + | ||
26 | +5. Rodar o script de banco "/sip/scripts/sip_instalar_modulo_pesquisa.php" em linha de comando no servidor do SIP, verificando se não houve erro em sua execução, em que ao final do log deverá ser informado "FIM". Exemplo de comando de execução: | ||
27 | + | ||
28 | + /usr/bin/php -c /etc/php.ini /var/www/html/sip/scripts/sip_instalar_modulo_pesquisa.php > atualizacao_modulo_pesquisa_sip.log | ||
29 | + | ||
30 | +6. Após a execução com sucesso, com um usuário com permissão de Administrador no SEI, abra o menu de configuração do módulo no SEI (Administração > Pesquisa Pública > Parâmetros Pesquisa Pública) e verifique as opções de configuração da Pesquisa Pública. | ||
31 | + | ||
32 | +7. Após a configuração, a página de Pesquisa Pública estará acessível pelo endereço a seguir: | ||
33 | + http://[Servidor_PHP]/sei/modulos/pesquisa/processo_pesquisar.php?acao_externa=protocolo_pesquisar&acao_origem_externa=protocolo_pesquisar&id_orgao_acesso_externo=0 | ||
34 | + | ||
35 | +8. Em caso de erro durante a execução do script verificar (lendo as mensagens de erro e no SEI em Infra > Log e no SIP em Infra > Log) se a causa é algum problema na infra-estrutura local. Neste caso, após a correção, restaurar o backup do banco de dados e executar novamente os scripts indicados nos itens 4 e 5 acima. | ||
36 | + - Caso não seja possível identificar a causa, abrir Issue no projeto do módulo no Gitlab do Portal do SPB: https://softwarepublico.gov.br/gitlab/cade/mod-sei-pesquisa | ||
0 | \ No newline at end of file | 37 | \ No newline at end of file |
@@ -0,0 +1,23 @@ | @@ -0,0 +1,23 @@ | ||
1 | +<? | ||
2 | + | ||
3 | + try { | ||
4 | + | ||
5 | + require_once dirname(__FILE__).'/SEI.php'; | ||
6 | + | ||
7 | + session_start(); | ||
8 | + | ||
9 | + SessaoSEI::getInstance(false); | ||
10 | + | ||
11 | + $objInstaladorModuloPesquisaPublica = new InstaladorModuloPesquisaPublicaRN(); | ||
12 | + $objInstaladorModuloPesquisaPublica->instalar(); | ||
13 | + | ||
14 | + exit; | ||
15 | + | ||
16 | + } catch (Exception $e) { | ||
17 | + | ||
18 | + echo(InfraException::inspecionar($e)); | ||
19 | + try{LogSEI::getInstance()->gravar(InfraException::inspecionar($e)); }catch (Exception $e){} | ||
20 | + } | ||
21 | + | ||
22 | + | ||
23 | +?> |
@@ -0,0 +1,572 @@ | @@ -0,0 +1,572 @@ | ||
1 | +<?php | ||
2 | +/** | ||
3 | + * CONSELHO ADMINISTRATIVO DE DEFESA ECONÔMICA | ||
4 | + * 2014-11-12 | ||
5 | + * Versão do Gerador de Código: 1.0 | ||
6 | + * Versão no CVS/SVN: | ||
7 | + * | ||
8 | + * sei | ||
9 | + * pesquisa | ||
10 | + * BuscaProtocoloExterno | ||
11 | + * | ||
12 | + * | ||
13 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
14 | + */ | ||
15 | + | ||
16 | +/** | ||
17 | + * Classe de Busca na solução de indexação solr. | ||
18 | + * | ||
19 | + * | ||
20 | + * @package institucional_pesquisa_BuscaProtocoloExterno | ||
21 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
22 | + * @license Creative Commons Atribuição 3.0 não adaptada | ||
23 | + * <http://creativecommons.org/licenses/by/3.0/deed.pt_BR> | ||
24 | + * @ignore Este código é livre para uso sem nenhuma restrição, | ||
25 | + * salvo pelas informações a seguir referentes | ||
26 | + * a @author e @copyright que devem ser mantidas inalteradas! | ||
27 | + * @copyright Conselho Administrativo de Defesa Econômica ©2014-2018 | ||
28 | + * <http://www.cade.gov.br> | ||
29 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
30 | + */ | ||
31 | + | ||
32 | + | ||
33 | +require_once("SolrUtilExterno.php"); | ||
34 | +require_once ("Criptografia.php"); | ||
35 | + | ||
36 | +class BuscaProtocoloExterno { | ||
37 | + | ||
38 | + public static function executar($q, $strDescricaoPesquisa, $strObservacaoPesquisa, $inicio, $numMaxResultados, $strParticipanteSolr, $md5Captcha = null) { | ||
39 | + | ||
40 | + //carrega configurações pesquisa | ||
41 | + | ||
42 | + $objParametroPesquisaDTO = new ParametroPesquisaDTO(); | ||
43 | + $objParametroPesquisaDTO->retStrNome(); | ||
44 | + $objParametroPesquisaDTO->retStrValor(); | ||
45 | + | ||
46 | + $objParametroPesquisaRN = new ParametroPesquisaRN(); | ||
47 | + $arrObjParametroPesquisaDTO = $objParametroPesquisaRN->listar($objParametroPesquisaDTO); | ||
48 | + | ||
49 | + $arrParametroPesquisaDTO = InfraArray::converterArrInfraDTO($arrObjParametroPesquisaDTO,'Valor','Nome'); | ||
50 | + | ||
51 | + $bolPesquisaDocumentoProcessoPublico = $arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_DOCUMENTO_PROCESSO_PUBLICO] == 'S' ? true : false; | ||
52 | + $bolPesquisaProcessoRestrito = $arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_PROCESSO_RESTRITO] == 'S' ? true : false; | ||
53 | + $bolLinkMetadadosProcessoRestrito = $arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_METADADOS_PROCESSO_RESTRITO] == 'S' ? true : false; | ||
54 | + $txtDescricaoProcedimentoAcessoRestrito = $arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_DESCRICAO_PROCEDIMENTO_ACESSO_RESTRITO]; | ||
55 | + $bolAutocompletarInterressado = $arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_AUTO_COMPLETAR_INTERESSADO] == 'S' ? true : false; | ||
56 | + | ||
57 | + $parametros = new stdClass(); | ||
58 | + $filtro = new stdClass(); | ||
59 | + | ||
60 | + $partialfields = ''; | ||
61 | + | ||
62 | + //die($_REQUEST["partialfields"]); | ||
63 | + | ||
64 | + if(!$bolAutocompletarInterressado){ | ||
65 | + $partialfields = $strParticipanteSolr; | ||
66 | + } | ||
67 | + | ||
68 | + | ||
69 | + | ||
70 | + if (!InfraString::isBolVazia($_REQUEST["partialfields"])){ | ||
71 | + $partialfields = $partialfields.$_REQUEST["partialfields"]; | ||
72 | + | ||
73 | + | ||
74 | + $checkbox = array(); | ||
75 | + if (preg_match("/sta_prot:([A-Z;]+)/i", $partialfields, $checkbox) > 0) { | ||
76 | + $checkbox = explode(";", $checkbox[1]); | ||
77 | + } | ||
78 | + | ||
79 | + | ||
80 | + | ||
81 | + }else{ | ||
82 | + $checkbox = array('P','G','R'); | ||
83 | + } | ||
84 | + | ||
85 | + $grupo = array(); | ||
86 | + | ||
87 | + // PESQUISAR EM: PROCESSOS | ||
88 | + if (in_array("P", $checkbox)) { | ||
89 | + | ||
90 | + if($bolPesquisaProcessoRestrito){ | ||
91 | + array_push($grupo, "(sta_prot:P)"); | ||
92 | + }else{ | ||
93 | + array_push($grupo, "(sta_prot:P AND tipo_aces:P)"); | ||
94 | + } | ||
95 | + | ||
96 | + } | ||
97 | + | ||
98 | + // PESQUISAR EM: DOCUMENTOS EXTERNOS | ||
99 | + | ||
100 | + if($bolPesquisaDocumentoProcessoPublico){ | ||
101 | + | ||
102 | + if (in_array("R", $checkbox)) { | ||
103 | + | ||
104 | + array_push($grupo, "(sta_prot:R AND tipo_aces:P)"); | ||
105 | + | ||
106 | + | ||
107 | + } | ||
108 | + | ||
109 | + // PESQUISAR EM: DOCUMENTOS GERADOS | ||
110 | + $filtroDocumentoInternoAssinado = ''; | ||
111 | + if (in_array("G", $checkbox)) { | ||
112 | + | ||
113 | + array_push($grupo, "(sta_prot:G AND tipo_aces:P)"); | ||
114 | + | ||
115 | + | ||
116 | + } | ||
117 | + } | ||
118 | + | ||
119 | + | ||
120 | + | ||
121 | + if (count($grupo)>0){ | ||
122 | + //Alteração para consulta externa sem login | ||
123 | + $staProtocolo = '('.implode(" OR ", $grupo).')'; | ||
124 | + //$staProtocolo = '('.implode(" OR ", $grupo).') AND tipo_acesso:P'; | ||
125 | + | ||
126 | + | ||
127 | + | ||
128 | + | ||
129 | + if (preg_match("/sta_prot:([A-Z;]+)/i", $partialfields)){ | ||
130 | + $partialfields = preg_replace("/sta_prot:[A-Z;]+/i", $staProtocolo, $partialfields); | ||
131 | + }else{ | ||
132 | + $partialfields .= $staProtocolo; | ||
133 | + } | ||
134 | + } | ||
135 | + | ||
136 | + | ||
137 | + | ||
138 | + /** | ||
139 | + * ELABORA A URL | ||
140 | + */ | ||
141 | + | ||
142 | + $parametros->q = SolrUtilExterno::formatarOperadores($q); | ||
143 | + | ||
144 | + if ($strDescricaoPesquisa!=''){ | ||
145 | + | ||
146 | + if ($parametros->q != ''){ | ||
147 | + $parametros->q .= ' AND '; | ||
148 | + } | ||
149 | + | ||
150 | + $parametros->q .= '('.SolrUtilExterno::formatarOperadores($strDescricaoPesquisa, 'desc').')'; | ||
151 | + } | ||
152 | + | ||
153 | + if ($strObservacaoPesquisa!=''){ | ||
154 | + if ($parametros->q != ''){ | ||
155 | + $parametros->q .= ' AND '; | ||
156 | + } | ||
157 | + $parametros->q .= '('.SolrUtilExterno::formatarOperadores($strObservacaoPesquisa,'desc'.SessaoSEI::getInstance()->getNumIdUnidadeAtual()).')'; | ||
158 | + } | ||
159 | + | ||
160 | + $parametros->start = $inicio; | ||
161 | + | ||
162 | + if ($parametros->q != '' && $partialfields != ''){ | ||
163 | + $parametros->q .= ' AND ' .$partialfields; | ||
164 | + }else if ($partialfields != ''){ | ||
165 | + $parametros->q = $partialfields; | ||
166 | + } | ||
167 | + | ||
168 | + $parametros->sort = 'dta_ger desc'; | ||
169 | + | ||
170 | + | ||
171 | + //////////////////////////// | ||
172 | +// print_r($parametros); | ||
173 | +// die; | ||
174 | + ////////////////////////// | ||
175 | + | ||
176 | + | ||
177 | + $parametros->q = utf8_encode($parametros->q); | ||
178 | + | ||
179 | + | ||
180 | + | ||
181 | + //Monta url de busca | ||
182 | + $urlBusca = ConfiguracaoSEI::getInstance()->getValor('Solr','Servidor') . '/'.ConfiguracaoSEI::getInstance()->getValor('Solr','CoreProtocolos') .'/select?' . http_build_query($parametros).'&hl=true&hl.snippets=2&hl.fl=content&hl.fragsize=100&hl.maxAnalyzedChars=1048576&hl.alternateField=content&hl.maxAlternateFieldLength=100&hl.maxClauseCount=2000&fl=id,id_prot,id_proc,id_doc,id_tipo_proc,id_serie,id_anexo,id_uni_ger,prot_doc,prot_proc,numero,id_usu_ger,dta_ger,desc'; | ||
183 | + //$urlBusca = ConfiguracaoSEI::getInstance()->getValor('Solr','Servidor') . '/'.ConfiguracaoSEI::getInstance()->getValor('Solr','CoreProtocolos') .'/select?' . http_build_query($parametros).'&hl=true&hl.snippets=2&hl.fl=content&hl.fragsize=100&hl.maxAnalyzedChars=1048576&hl.alternateField=content&hl.maxAlternateFieldLength=100&hl.maxClauseCount=2000&fl=id,tipo_acesso,id_unidade_acesso,id_unidade_geradora,id_unidade_aberto,identificacao_protocolo,nome_tipo_processo,protocolo_documento_formatado,protocolo_processo_formatado,sigla_unidade_geradora,descricao_unidade_geradora,sigla_usuario_gerador,nome_usuario_gerador,dta_geracao,link_arvore,id_protocolo'; | ||
184 | + | ||
185 | + //////////////////////////// | ||
186 | +// print_r($urlBusca); | ||
187 | +// die; | ||
188 | + ////////////////////////// | ||
189 | + | ||
190 | + | ||
191 | + // @DEBUG | ||
192 | + | ||
193 | + //echo 'URL:'.$urlBusca; | ||
194 | + //echo "PARÂMETROS: " . print_r($parametros, true); | ||
195 | + | ||
196 | + //Objeto que contera o xml do resultado de busca | ||
197 | + //$resultados = new SolrXmlResults($urlBusca, $numMaximoResultados); | ||
198 | + | ||
199 | + //$numSeg = InfraUtil::verificarTempoProcessamento(); | ||
200 | + $resultados = file_get_contents($urlBusca, false); | ||
201 | + //$numSeg = InfraUtil::verificarTempoProcessamento($numSeg); | ||
202 | + | ||
203 | + if ($resultados == ''){ | ||
204 | + throw new InfraException('Nenhum retorno encontrado no resultado da pesquisa.'); | ||
205 | + } | ||
206 | + | ||
207 | + $xml = simplexml_load_string($resultados); | ||
208 | + | ||
209 | + $html = ''; | ||
210 | + | ||
211 | + $arrRet = $xml->xpath('/response/result/@numFound'); | ||
212 | + | ||
213 | + $itens = array_shift($arrRet); | ||
214 | + | ||
215 | + | ||
216 | + | ||
217 | + | ||
218 | + | ||
219 | + if ($itens == 0){ | ||
220 | + | ||
221 | + $html .= "<div class=\"sem-resultado\">"; | ||
222 | + $html .= "Sua pesquisa pelo termo <b>" . PaginaSEI::tratarHTML($_POST["q"]) . "</b> não encontrou nenhum protocolo correspondente."; | ||
223 | + $html .= "<br/>"; | ||
224 | + $html .= "<br/>"; | ||
225 | + $html .= "Sugestões:"; | ||
226 | + $html .= "<ul>"; | ||
227 | + $html .= "<li>Certifique-se de que todas as palavras estejam escritas corretamente.</li>"; | ||
228 | + $html .= "<li>Tente palavras-chave diferentes.</li>"; | ||
229 | + $html .= "<li>Tente palavras-chave mais genéricas.</li>"; | ||
230 | + $html .= "</ul>"; | ||
231 | + $html .= "</div>"; | ||
232 | + | ||
233 | + | ||
234 | + }else{ | ||
235 | + | ||
236 | + $html = SolrUtilExterno::criarBarraEstatisticas($itens,$inicio,($inicio+10)); | ||
237 | + | ||
238 | + $registros = $xml->xpath('/response/result/doc'); | ||
239 | + | ||
240 | + $numRegistros = sizeof($registros); | ||
241 | + | ||
242 | + for ($i = 0; $i < $numRegistros; $i++) { | ||
243 | + | ||
244 | + $dados = array(); | ||
245 | + $titulo = ""; | ||
246 | + $regResultado = $registros[$i]; | ||
247 | + | ||
248 | + $dados["tipo_acesso"] = SolrUtil::obterTag($regResultado, 'tipo_aces', 'str'); | ||
249 | + $dados["id_unidade_acesso"] = SolrUtil::obterTag($regResultado, 'id_uni_aces', 'str'); | ||
250 | + $dados["id_unidade_geradora"] = SolrUtil::obterTag($regResultado, 'id_uni_ger', 'int'); | ||
251 | + //$dados["id_unidade_aberto"] = $registros[$i]->xpath("str[@name='id_unidade_aberto']"); | ||
252 | + //$dados["identificacao_protocolo"] = $registros[$i]->xpath("str[@name='identificacao_protocolo']"); | ||
253 | + //$dados["nome_tipo_processo"] = $registros[$i]->xpath("str[@name='nome_tipo_processo']"); | ||
254 | + $dados["protocolo_documento_formatado"] = SolrUtil::obterTag($regResultado, 'prot_doc', 'str'); | ||
255 | + $dados["protocolo_processo_formatado"] = SolrUtil::obterTag($regResultado, 'prot_proc', 'str'); | ||
256 | + $dados["id_usuario_gerador"] = SolrUtil::obterTag($regResultado, 'id_usu_ger', 'int'); | ||
257 | + $dados['id_tipo_processo'] = SolrUtil::obterTag($regResultado, 'id_tipo_proc', 'int'); | ||
258 | + $dados["identificacao_protocolo"] = SolrUtil::obterTag($regResultado, 'numero', 'str'); | ||
259 | + $dados["descricao_protocolo"] = SolrUtil::obterTag($regResultado, 'desc', 'str'); | ||
260 | + | ||
261 | + | ||
262 | + $arrMetatags = array(); | ||
263 | + $strSiglaUnidadeGeradora=""; | ||
264 | + $strDescricaoUnidadeGeradora=""; | ||
265 | + | ||
266 | + if (isset($dados["id_unidade_geradora"])){ | ||
267 | + $objUnidadeDTO = new UnidadeDTO(); | ||
268 | + $objUnidadeDTO->setNumIdUnidade($dados["id_unidade_geradora"]); | ||
269 | + $objUnidadeDTO->retStrSigla(); | ||
270 | + $objUnidadeDTO->retStrDescricao(); | ||
271 | + | ||
272 | + $objUnidadeRN = new UnidadeRN(); | ||
273 | + $objUnidadeDTO = $objUnidadeRN->consultarRN0125($objUnidadeDTO); | ||
274 | + | ||
275 | + if($objUnidadeDTO != null){ | ||
276 | + $strSiglaUnidadeGeradora = $objUnidadeDTO->getStrSigla(); | ||
277 | + $strDescricaoUnidadeGeradora = $objUnidadeDTO->getStrDescricao(); | ||
278 | + | ||
279 | + } | ||
280 | + } | ||
281 | + | ||
282 | + | ||
283 | + $arrMetatags['Unidade Geradora'] = '<a alt="'.$strDescricaoUnidadeGeradora.'" title="'.$strDescricaoUnidadeGeradora.'" class="ancoraSigla">'.$strSiglaUnidadeGeradora.'</a>'; | ||
284 | + | ||
285 | + $dtaGeracao = SolrUtil::obterTag($regResultado, 'dta_ger', 'date'); | ||
286 | + $dtaGeracao = preg_replace("/(\d{4})-(\d{2})-(\d{2})(.*)/", "$3/$2/$1", $dtaGeracao); | ||
287 | + | ||
288 | + $arrMetatags['Data'] = $dtaGeracao; | ||
289 | + | ||
290 | + // SNIPPET | ||
291 | + $numId = $registros[$i]->xpath("str[@name='id']"); | ||
292 | + $numId = utf8_decode($numId[0]); | ||
293 | + $temp = $xml->xpath("/response/lst[@name='highlighting']/lst[@name='".$numId."']/arr[@name='content']/str"); | ||
294 | + | ||
295 | + $snippet = ''; | ||
296 | + for($j=0;$j<count($temp);$j++){ | ||
297 | + $snippetTemp = utf8_decode($temp[$j]); | ||
298 | + $snippetTemp = strtoupper(trim(strip_tags($snippetTemp))) == "NULL" ? null : $snippetTemp; | ||
299 | + $snippetTemp = preg_replace("/<br>/i", "<br />", $snippetTemp); | ||
300 | + $snippetTemp = preg_replace("/<.*?>/", "", $snippetTemp); | ||
301 | + $snippet .= $snippetTemp.'<b> ... </b>'; | ||
302 | + } | ||
303 | + | ||
304 | + | ||
305 | + | ||
306 | + // PROTOCOLO | ||
307 | + $idProtocolo = SolrUtil::obterTag($regResultado, 'id_prot', 'long'); | ||
308 | + $objProtocoloRN = new ProtocoloRN(); | ||
309 | + $objProtocoloDTO = new ProtocoloDTO(); | ||
310 | + $objProtocoloDTO->setDblIdProtocolo($idProtocolo); | ||
311 | + $objProtocoloDTO->retDblIdProtocolo(); | ||
312 | + $objProtocoloDTO->retStrStaProtocolo(); | ||
313 | + $objProtocoloDTO->retStrStaNivelAcessoGlobal(); | ||
314 | + $objProtocoloDTO->retStrProtocoloFormatado(); | ||
315 | + $objProtocoloDTO->retNumIdHipoteseLegal(); | ||
316 | + $objProtocoloDTO = $objProtocoloRN->consultarRN0186($objProtocoloDTO); | ||
317 | + $idProcedimento = ''; | ||
318 | + if($objProtocoloDTO->getStrStaProtocolo() != ProtocoloRN::$TP_PROCEDIMENTO){ | ||
319 | + $objDocumentoRN = new DocumentoRN(); | ||
320 | + $objDocumentoDTO = new DocumentoDTO(); | ||
321 | + $objDocumentoDTO->setDblIdDocumento($idProtocolo); | ||
322 | + $objDocumentoDTO->retDblIdDocumento(); | ||
323 | + $objDocumentoDTO->retDblIdProcedimento(); | ||
324 | + $objDocumentoDTO->retNumIdSerie(); | ||
325 | + $objDocumentoDTO->retStrNomeSerie(); | ||
326 | + $objDocumentoDTO->retStrNumero(); | ||
327 | + $objDocumentoDTO = $objDocumentoRN->consultarRN0005($objDocumentoDTO); | ||
328 | + $idProcedimento = $objDocumentoDTO->getDblIdProcedimento(); | ||
329 | + | ||
330 | + $dados["identificacao_protocolo"] = $objDocumentoDTO->getStrNomeSerie() . ' '. $objDocumentoDTO->getStrNumero(); | ||
331 | + | ||
332 | + // INCLUIDO 21/12/2015 Substitui data de geração para data de assinatura de documentos gerados | ||
333 | + if($objProtocoloDTO->getStrStaProtocolo() == ProtocoloRN::$TP_DOCUMENTO_GERADO){ | ||
334 | + | ||
335 | + $objAssinaturaDTO = new AssinaturaDTO(); | ||
336 | + $objAssinaturaDTO->setDblIdDocumento($idProtocolo); | ||
337 | + $objAssinaturaDTO->setOrdDthAberturaAtividade(InfraDTO::$TIPO_ORDENACAO_ASC); | ||
338 | + $objAssinaturaDTO->retDthAberturaAtividade(); | ||
339 | + | ||
340 | + $objAssinaturaRN = new AssinaturaRN(); | ||
341 | + $arrObjAssinaturaDTO = $objAssinaturaRN->listarRN1323($objAssinaturaDTO); | ||
342 | + | ||
343 | + if(is_array($arrObjAssinaturaDTO) && count($arrObjAssinaturaDTO) > 0) { | ||
344 | + | ||
345 | + $objAssinaturaDTO = $arrObjAssinaturaDTO[0]; | ||
346 | + if($objAssinaturaDTO != null && $objAssinaturaDTO->isSetDthAberturaAtividade()){ | ||
347 | + | ||
348 | + $dtaGeracao = substr($objAssinaturaDTO->getDthAberturaAtividade(),0,10); | ||
349 | + | ||
350 | + $arrMetatags['Data'] = $dtaGeracao; | ||
351 | + | ||
352 | + } | ||
353 | + } | ||
354 | + | ||
355 | + | ||
356 | + | ||
357 | + } | ||
358 | + | ||
359 | + if($objProtocoloDTO->getStrStaProtocolo() == ProtocoloRN::$TP_DOCUMENTO_RECEBIDO){ | ||
360 | + | ||
361 | + $objAtributoAndamentoDTO = new AtributoAndamentoDTO(); | ||
362 | + $objAtributoAndamentoDTO->setDblIdProtocoloAtividade($idProcedimento); | ||
363 | + $objAtributoAndamentoDTO->setNumIdTarefaAtividade(TarefaRN::$TI_RECEBIMENTO_DOCUMENTO); | ||
364 | + $objAtributoAndamentoDTO->setStrNome("DOCUMENTO"); | ||
365 | + $objAtributoAndamentoDTO->setStrIdOrigem($idProtocolo); | ||
366 | + | ||
367 | + $objAtributoAndamentoDTO->retDthAberturaAtividade(); | ||
368 | + | ||
369 | + $objAtributoAndamentoRN = new AtributoAndamentoRN(); | ||
370 | + | ||
371 | + $objAtributoAndamentoDTO = $objAtributoAndamentoRN->consultarRN1366($objAtributoAndamentoDTO); | ||
372 | + | ||
373 | + if($objAtributoAndamentoDTO != null && $objAtributoAndamentoDTO->isSetDthAberturaAtividade()){ | ||
374 | + | ||
375 | + $dtaGeracao = substr($objAtributoAndamentoDTO->getDthAberturaAtividade(),0,10); | ||
376 | + | ||
377 | + $arrMetatags['Data'] = $dtaGeracao; | ||
378 | + | ||
379 | + } | ||
380 | + } | ||
381 | + | ||
382 | + }else{ | ||
383 | + $idProcedimento = $objProtocoloDTO->getDblIdProtocolo(); | ||
384 | + } | ||
385 | + | ||
386 | + $parametrosCriptografadosProcesso = Criptografia::criptografa('acao_externa=processo_exibir&id_orgao_acesso_externo=0&id_procedimento='.$idProcedimento); | ||
387 | + $urlPesquisaProcesso = 'processo_exibir.php?'.$parametrosCriptografadosProcesso; | ||
388 | + $arvore = $urlPesquisaProcesso; | ||
389 | + | ||
390 | + | ||
391 | + $tituloLinkNumeroProcesso = "<a href=\"" . PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink(SolrUtilExterno::prepararUrl($arvore))) . "\" target=\"_blank\" class=\"protocoloNormal\">"; | ||
392 | + $tituloLinkNumeroProcesso .= $dados["protocolo_processo_formatado"]; | ||
393 | + $tituloLinkNumeroProcesso .= "</a>"; | ||
394 | + | ||
395 | + $tituloProtocolo = $tituloLinkNumeroProcesso; | ||
396 | + | ||
397 | + //Tipo do Processo | ||
398 | + $strNomeTipoProcedimento = ""; | ||
399 | + if (isset($dados["id_tipo_processo"])){ | ||
400 | + $objTipoProcedimentoDTO = new TipoProcedimentoDTO(); | ||
401 | + $objTipoProcedimentoDTO->setNumIdTipoProcedimento($dados["id_tipo_processo"]); | ||
402 | + $objTipoProcedimentoDTO->retStrNome(); | ||
403 | + | ||
404 | + $objTipoProcedimentoRN = new TipoProcedimentoRN(); | ||
405 | + $objTipoProcedimentoDTO = $objTipoProcedimentoRN->consultarRN0267($objTipoProcedimentoDTO); | ||
406 | + | ||
407 | + if($objTipoProcedimentoDTO != null){ | ||
408 | + $strNomeTipoProcedimento = $objTipoProcedimentoDTO->getStrNome(); | ||
409 | + | ||
410 | + } | ||
411 | + } | ||
412 | + | ||
413 | + | ||
414 | + | ||
415 | + | ||
416 | + $titulo = $strNomeTipoProcedimento . " N° " . $tituloLinkNumeroProcesso; | ||
417 | + | ||
418 | + if (empty($dados["protocolo_documento_formatado"]) == false) { | ||
419 | + if($objDocumentoDTO == null){ | ||
420 | + print_r($idProtocolo); | ||
421 | + echo ' '; | ||
422 | + print_r($dados["protocolo_documento_formatado"]); | ||
423 | + die; | ||
424 | + } | ||
425 | + | ||
426 | + $titulo .= " "; | ||
427 | + $parametrosCriptografadosDocumentos = Criptografia::criptografa('acao_externa=documento_exibir&id_orgao_acesso_externo=0&id_documento='.$objDocumentoDTO->getDblIdDocumento()); | ||
428 | + $endereco = 'documento_consulta_externa.php?'.$parametrosCriptografadosDocumentos; | ||
429 | + $titulo .= "(<a target=\"_blank\" href=\"" . PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink($endereco)) . "\""; | ||
430 | + $titulo .= " class=\"protocoloNormal\""; | ||
431 | + $titulo .= ">" . $dados["identificacao_protocolo"] . "</a>)"; | ||
432 | + | ||
433 | + //$tituloProtocolo = "<a target=\"_blank\" href=\"" . PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink($endereco)) . "\" class=\"protocoloNormal\" >".$dados["protocolo_documento_formatado"]. "</a>"; | ||
434 | + | ||
435 | + } | ||
436 | + | ||
437 | + | ||
438 | + | ||
439 | + | ||
440 | + $tituloCompleto = "<a href=\"" . PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink(SolrUtilExterno::prepararUrl($arvore))) . "\" target=\"_blank\" class=\"arvore\">"; | ||
441 | + $tituloCompleto .= "<img border=\"0\" src=\"solr/img/arvore.png\" alt=\"\" title=\"Visualizar árvore\" width=\"14\" height=\"16\" class=\"arvore\" />"; | ||
442 | + $tituloCompleto .= "</a>"; | ||
443 | + | ||
444 | + $tituloCompleto .= $titulo; | ||
445 | + | ||
446 | + // REMOVE TAGS DO TÍTULO | ||
447 | + $tituloCompleto = preg_replace("/<.*?>/", "", $tituloCompleto); | ||
448 | + | ||
449 | + | ||
450 | + | ||
451 | + | ||
452 | + if($objProtocoloDTO->getStrStaNivelAcessoGlobal() != ProtocoloRN::$NA_PUBLICO && $bolPesquisaProcessoRestrito){ | ||
453 | + | ||
454 | + if(!$bolLinkMetadadosProcessoRestrito || $objProtocoloDTO->getStrStaProtocolo() != ProtocoloRN::$TP_PROCEDIMENTO){ | ||
455 | + $tituloCompleto = $objProtocoloDTO->getStrProtocoloFormatado(); | ||
456 | + $titulo = $objProtocoloDTO->getStrProtocoloFormatado(); | ||
457 | + $tituloProtocolo = $objProtocoloDTO->getStrProtocoloFormatado(); | ||
458 | + //$tituloProtocolo = 'N° SEI (Documento/Processo)'; | ||
459 | + | ||
460 | + $objHipoteseLegalDTO = new HipoteseLegalDTO(); | ||
461 | + $objHipoteseLegalDTO->retTodos(false); | ||
462 | + $objHipoteseLegalDTO->setNumIdHipoteseLegal($objProtocoloDTO->getNumIdHipoteseLegal()); | ||
463 | + | ||
464 | + $objHipoteseLegalRN = new HipoteseLegalRN(); | ||
465 | + $objHipoteseLegalDTO = $objHipoteseLegalRN->consultar($objHipoteseLegalDTO); | ||
466 | + | ||
467 | + if($objHipoteseLegalDTO != null){ | ||
468 | + $snippet = '<b>Hipótese Legal de Restrição de Acesso: '.$objHipoteseLegalDTO->getStrNome().' ('.$objHipoteseLegalDTO->getStrBaseLegal().')</b>'; | ||
469 | + $txtDescricaoProcedimentoAcessoRestrito = trim($txtDescricaoProcedimentoAcessoRestrito); | ||
470 | + if( !empty($txtDescricaoProcedimentoAcessoRestrito)){ | ||
471 | + $snippet .= '<br/>'; | ||
472 | + $snippet .= $txtDescricaoProcedimentoAcessoRestrito; | ||
473 | + } | ||
474 | + }else{ | ||
475 | + if( !empty($txtDescricaoProcedimentoAcessoRestrito)){ | ||
476 | + $snippet = $txtDescricaoProcedimentoAcessoRestrito; | ||
477 | + }else{ | ||
478 | + $snippet = 'Processo de Acesso Restrito'; | ||
479 | + } | ||
480 | + | ||
481 | + } | ||
482 | + | ||
483 | + unset($arrMetatags['Usuário'] ); | ||
484 | + unset($arrMetatags['Unidade Geradora']); | ||
485 | + unset($arrMetatags['Data']); | ||
486 | + } | ||
487 | + | ||
488 | + | ||
489 | + | ||
490 | + | ||
491 | + } | ||
492 | + | ||
493 | + // Protege contra a não idexação no solr quando o processo passa de público para restrito. | ||
494 | + if(($objProtocoloDTO->getStrStaProtocolo() == ProtocoloRN::$TP_PROCEDIMENTO && $objProtocoloDTO->getStrStaNivelAcessoGlobal() != ProtocoloRN::$NA_PUBLICO && !$bolPesquisaProcessoRestrito) || ($objProtocoloDTO->getStrStaProtocolo() == ProtocoloRN::$TP_PROCEDIMENTO && $objProtocoloDTO->getStrStaNivelAcessoGlobal() == ProtocoloRN::$NA_SIGILOSO)){ | ||
495 | + | ||
496 | + $tituloCompleto = 'ACESSO RESTRITO'; | ||
497 | + $titulo = 'ACESSO RESTRITO'; | ||
498 | + $tituloProtocolo = 'ACESSO RESTRITO'; | ||
499 | + unset($arrMetatags['Usuário'] ); | ||
500 | + unset($arrMetatags['Unidade Geradora']); | ||
501 | + unset($arrMetatags['Data']); | ||
502 | + $snippet = 'ACESSO RESTRITO'; | ||
503 | + | ||
504 | + | ||
505 | + } | ||
506 | + | ||
507 | + // Protege contra a não idexação no solr quando o documento passa de público para restrito. | ||
508 | + //if($objProtocoloDTO->getStrStaProtocolo() != ProtocoloRN::$TP_PROCEDIMENTO && $objProtocoloDTO->getStrStaNivelAcessoGlobal() != ProtocoloRN::$NA_PUBLICO && !$bolPesquisaDocumentoProcessoRestrito){ | ||
509 | + if($objProtocoloDTO->getStrStaProtocolo() != ProtocoloRN::$TP_PROCEDIMENTO && $objProtocoloDTO->getStrStaNivelAcessoGlobal() != ProtocoloRN::$NA_PUBLICO){ | ||
510 | + | ||
511 | + $tituloCompleto = 'ACESSO RESTRITO'; | ||
512 | + $titulo = 'ACESSO RESTRITO'; | ||
513 | + $tituloProtocolo = 'ACESSO RESTRITO'; | ||
514 | + unset($arrMetatags['Usuário'] ); | ||
515 | + unset($arrMetatags['Unidade Geradora']); | ||
516 | + unset($arrMetatags['Data']); | ||
517 | + $snippet = 'ACESSO RESTRITO'; | ||
518 | + | ||
519 | + | ||
520 | + } | ||
521 | + | ||
522 | + $html .= "<table border=\"0\" class=\"resultado\">\n"; | ||
523 | + $html .= "<tr class=\"resTituloRegistro\">\n"; | ||
524 | + $html .= "<td class=\"resTituloEsquerda\">"; | ||
525 | + $html .= $tituloCompleto; | ||
526 | + $html .= "</td>\n"; | ||
527 | + $html .= "<td class=\"resTituloDireita\">"; | ||
528 | + $html .= $tituloProtocolo; | ||
529 | + $html .= "</td>\n"; | ||
530 | + $html .= "</tr>\n"; | ||
531 | + | ||
532 | + if (empty($snippet) == false) | ||
533 | + $html .= "<tr>\n | ||
534 | + <td colspan=\"2\" class=\"resSnippet\"> | ||
535 | + " . $snippet . " | ||
536 | + </td>\n | ||
537 | + </tr>\n"; | ||
538 | + | ||
539 | + if (count($arrMetatags)) { | ||
540 | + $html .= "<tr>\n"; | ||
541 | + $html .= "<td colspan=\"2\" class=\"metatag\">\n"; | ||
542 | + $html .= "<table>\n"; | ||
543 | + $html .= "<tbody>\n"; | ||
544 | + $html .= "<tr>\n"; | ||
545 | + | ||
546 | + foreach($arrMetatags as $nomeMetaTag => $valorMetaTag){ | ||
547 | + | ||
548 | + $html .= "<td>"; | ||
549 | + $html .= "<b>" . $nomeMetaTag . ":</b> " . $valorMetaTag; | ||
550 | + $html .= "</td>\n"; | ||
551 | + | ||
552 | + | ||
553 | + } | ||
554 | + | ||
555 | + $html .= "</tr>\n"; | ||
556 | + $html .= "</tbody>\n"; | ||
557 | + $html .= "</table>\n"; | ||
558 | + $html .= "</td>\n"; | ||
559 | + $html .= "</tr>\n"; | ||
560 | + } | ||
561 | + | ||
562 | + $html .= "</table>\n"; | ||
563 | + } | ||
564 | + | ||
565 | + | ||
566 | + $html .= SolrUtilExterno::criarBarraNavegacao($itens, $inicio, 10, PaginaSEIExterna::getInstance(), SessaoSEIExterna::getInstance(),$md5Captcha); | ||
567 | + } | ||
568 | + | ||
569 | + return $html; | ||
570 | + } | ||
571 | +} | ||
572 | +?> |
@@ -0,0 +1,60 @@ | @@ -0,0 +1,60 @@ | ||
1 | +<? | ||
2 | +/** | ||
3 | + * CONSELHO ADMINISTRATIVO DE DEFESA ECONÔMICA | ||
4 | + * 2014-10-02 | ||
5 | + * Versão do Gerador de Código: 1.0 | ||
6 | + * Versão no CVS/SVN: | ||
7 | + * | ||
8 | + * sei | ||
9 | + * pesquisa | ||
10 | + * ConverterURI | ||
11 | + * | ||
12 | + * | ||
13 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
14 | + */ | ||
15 | + | ||
16 | +/** | ||
17 | + * Arquivo para conversão de url. | ||
18 | + * | ||
19 | + * | ||
20 | + * @package institucional_pesquisa_controlador_ajax_externo | ||
21 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
22 | + * @license Creative Commons Atribuição 3.0 não adaptada | ||
23 | + * <http://creativecommons.org/licenses/by/3.0/deed.pt_BR> | ||
24 | + * @ignore Este código é livre para uso sem nenhuma restrição, | ||
25 | + * salvo pelas informações a seguir referentes | ||
26 | + * a @author e @copyright que devem ser mantidas inalteradas! | ||
27 | + * @copyright Conselho Administrativo de Defesa Econômica ©2014-2018 | ||
28 | + * <http://www.cade.gov.br> | ||
29 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
30 | + */ | ||
31 | + | ||
32 | +require_once ("Criptografia.php"); | ||
33 | + class ConverteURI{ | ||
34 | + | ||
35 | + public static function converterURI(){ | ||
36 | + | ||
37 | + try { | ||
38 | + $arr = explode('?', $_SERVER['REQUEST_URI']); | ||
39 | + $arrParametros = Criptografia::descriptografa($arr[1]); | ||
40 | + //$parametros = explode('&', $arrParametros[0]); | ||
41 | + $parametros = explode('&', $arrParametros); | ||
42 | + $chaves = array(); | ||
43 | + $valores = array(); | ||
44 | + foreach ($parametros as $parametro){ | ||
45 | + $arrChaveValor = explode('=', $parametro); | ||
46 | + $chaves[] = $arrChaveValor[0]; | ||
47 | + $valores[] = $arrChaveValor[1]; | ||
48 | + | ||
49 | + } | ||
50 | + $novosParametros = array_combine($chaves, array_values($valores)); | ||
51 | + $new_query_string = http_build_query($novosParametros); | ||
52 | + $_SERVER['REQUEST_URI'] = $arr[0].'?'.$new_query_string; | ||
53 | + $_GET = $novosParametros; | ||
54 | + }catch (Exception $e){ | ||
55 | + throw new InfraException('Erro validando url.', $e); | ||
56 | + } | ||
57 | + } | ||
58 | + } | ||
59 | + | ||
60 | +?> | ||
0 | \ No newline at end of file | 61 | \ No newline at end of file |
@@ -0,0 +1,152 @@ | @@ -0,0 +1,152 @@ | ||
1 | +<? | ||
2 | +/** | ||
3 | + * CONSELHO ADMINISTRATIVO DE DEFESA ECONÔMICA | ||
4 | + * 2014-09-29 | ||
5 | + * Versão do Gerador de Código: 1.0 | ||
6 | + * Versão no CVS/SVN: | ||
7 | + * | ||
8 | + * sei | ||
9 | + * pesquisa | ||
10 | + * controlador_ajax_externo | ||
11 | + * | ||
12 | + * | ||
13 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
14 | + */ | ||
15 | + | ||
16 | +/** | ||
17 | + * Arquivo para realizar criptografia de parametros. | ||
18 | + * | ||
19 | + * | ||
20 | + * @package institucional_pesquisa_controlador_ajax_externo | ||
21 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
22 | + * @license Creative Commons Atribuição 3.0 não adaptada | ||
23 | + * <http://creativecommons.org/licenses/by/3.0/deed.pt_BR> | ||
24 | + * @ignore Este código é livre para uso sem nenhuma restrição, | ||
25 | + * salvo pelas informações a seguir referentes | ||
26 | + * a @author e @copyright que devem ser mantidas inalteradas! | ||
27 | + * @copyright Conselho Administrativo de Defesa Econômica ©2014-2018 | ||
28 | + * <http://www.cade.gov.br> | ||
29 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
30 | + */ | ||
31 | + | ||
32 | +/** | ||
33 | + * CONSELHO ADMINISTRATIVO DE DEFESA ECONÔMICA | ||
34 | +* | ||
35 | +* 01/09/2014 - criado por alex braga | ||
36 | +* | ||
37 | +* Versão do Gerador de Código: | ||
38 | +* | ||
39 | +* Versão no CVS: | ||
40 | +*/ | ||
41 | + | ||
42 | + | ||
43 | + class Criptografia{ | ||
44 | + | ||
45 | + private static $KEY = 'c@d3s3mp@p3l'; | ||
46 | + | ||
47 | + public static function criptografa($texto){ | ||
48 | + try { | ||
49 | + | ||
50 | + return strtr(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5(Criptografia::getChaveCriptografia()), serialize($texto), MCRYPT_MODE_CBC, md5(md5(Criptografia::getChaveCriptografia())))), '+/=', '-_,'); | ||
51 | + | ||
52 | + | ||
53 | + } catch (Exception $e) { | ||
54 | + | ||
55 | + throw new InfraException('Erro validando link externo.',$e); | ||
56 | + } | ||
57 | + } | ||
58 | + | ||
59 | + public static function descriptografa($texto){ | ||
60 | + try { | ||
61 | + | ||
62 | + return unserialize(rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5(Criptografia::getChaveCriptografia()), base64_decode(strtr($texto, '-_,', '+/=')), MCRYPT_MODE_CBC, md5(md5(Criptografia::getChaveCriptografia()))), "\0")); | ||
63 | + } catch (Exception $e) { | ||
64 | + | ||
65 | + throw new InfraException('Erro validando link externo.',$e); | ||
66 | + } | ||
67 | + } | ||
68 | + | ||
69 | + private static function getChaveCriptografia(){ | ||
70 | + | ||
71 | + $objParametroPesquisaDTO = new ParametroPesquisaDTO(); | ||
72 | + $objParametroPesquisaDTO->setStrNome(ParametroPesquisaRN::$TA_CHAVE_CRIPTOGRAFIA); | ||
73 | + $objParametroPesquisaDTO->retStrValor(); | ||
74 | + $objParametroPesquisaDTO->retStrNome(); | ||
75 | + | ||
76 | + $objParametroPesquisaRN = new ParametroPesquisaRN(); | ||
77 | + | ||
78 | + $objParametroPesquisaDTO = $objParametroPesquisaRN->consultar($objParametroPesquisaDTO); | ||
79 | + | ||
80 | + if($objParametroPesquisaDTO != null && !empty($objParametroPesquisaDTO->getStrValor())){ | ||
81 | + | ||
82 | + return $objParametroPesquisaDTO->getStrValor(); | ||
83 | + } | ||
84 | + | ||
85 | + return $KEY; | ||
86 | + } | ||
87 | + | ||
88 | + //Esta criptografia é usada no site do cade; | ||
89 | + //Alterar metodo de criptografia por uma criptografia php. | ||
90 | + public static function criptografaSiteCade($texto){ | ||
91 | + | ||
92 | + $caminho = dirname(__FILE__).'/criptografia/mascaraArgumentos.jar'; | ||
93 | + $instrucao = 'java -jar '.$caminho.' \'criptografa\' \''.$texto.'\' \''.Criptografia::$KEY.'\' '; | ||
94 | + | ||
95 | + exec( $instrucao, $saida, $retorno); | ||
96 | + if($retorno !=0){ | ||
97 | + throw new InfraException('Erro validando link externo.',$e); | ||
98 | + }else{ | ||
99 | + return $saida; | ||
100 | + } | ||
101 | + | ||
102 | + } | ||
103 | + //Esta criptografia é usada no site do cade; | ||
104 | + //Alterar metodo de criptografia por uma criptografia php. | ||
105 | + public static function descriptografaSiteCade($texto){ | ||
106 | + | ||
107 | + $caminho = dirname(__FILE__).'/criptografia/mascaraArgumentos.jar'; | ||
108 | + $instrucao = 'java -jar '.$caminho.' \'descriptografa\' \''.$texto.'\' \''.Criptografia::$KEY.'\' '; | ||
109 | + | ||
110 | + exec( $instrucao, $saida, $retorno); | ||
111 | + if($retorno !=0){ | ||
112 | + throw new InfraException('Erro validando link externo.',$e); | ||
113 | + }else{ | ||
114 | + return $saida; | ||
115 | + } | ||
116 | + | ||
117 | + } | ||
118 | + | ||
119 | + //Esta criptografia é usada no site do cade; | ||
120 | + //Alterar metodo de criptografia por uma criptografia php. | ||
121 | + public static function descriptografaArgumentos($parametro){ | ||
122 | + | ||
123 | + $parametrosCriptografados = $_SERVER['QUERY_STRING']; | ||
124 | + $parametrosDescriptografados = Criptografia::descriptografa($parametrosCriptografados); | ||
125 | + $arrParametros = explode("&", $parametrosDescriptografados[0]); | ||
126 | + $bolRecuperParametro = false; | ||
127 | + $valorParametro = ''; | ||
128 | + foreach ($arrParametros as $arrParametro){ | ||
129 | + $parametroRetorno = explode("=", $arrParametro); | ||
130 | + if($parametroRetorno[0] == $parametro){ | ||
131 | + $bolRecuperParametro = true; | ||
132 | + $valorParametro = $parametroRetorno[1]; | ||
133 | + break; | ||
134 | + }else{ | ||
135 | + $bolRecuperParametro = false; | ||
136 | + } | ||
137 | + } | ||
138 | + | ||
139 | + if($bolRecuperParametro){ | ||
140 | + return $valorParametro; | ||
141 | + }else{ | ||
142 | + throw new InfraException('Erro recuperando parâmetro.'); | ||
143 | + } | ||
144 | + | ||
145 | + | ||
146 | + } | ||
147 | + | ||
148 | + } | ||
149 | + | ||
150 | + | ||
151 | + | ||
152 | +?> | ||
0 | \ No newline at end of file | 153 | \ No newline at end of file |
@@ -0,0 +1,78 @@ | @@ -0,0 +1,78 @@ | ||
1 | +<? | ||
2 | + | ||
3 | +class PesquisaCADE{ | ||
4 | + | ||
5 | + | ||
6 | + public static function executar($strProtocoloPesquisa,$strNomeParticipante,$md5Captcha,$inicio = 0,$paginaAtual = 0,$maxRetorno = 10){ | ||
7 | + | ||
8 | + $objProcessoDTO = new ProcessoDTO(); | ||
9 | + $objProcessoDTO->setStrProNumero(str_replace(' ', '', $strProtocoloPesquisa)); | ||
10 | + $objProcessoDTO->setNomeParte(InfraString::excluirAcentos($strNomeParticipante)); | ||
11 | + $objProcessoDTO->retStrProNumero(); | ||
12 | + $objProcessoDTO->retNumProCodigo(); | ||
13 | + $objProcessoDTO->retStrTipproNome(); | ||
14 | + $objProcessoDTO->retStrProSumula(); | ||
15 | + //PaginaSEIExterna::getInstance()->prepararOrdenacao($objProcessoDTO,'ProNumero',InfraDTO::$TIPO_ORDENACAO_ASC); | ||
16 | + | ||
17 | + | ||
18 | + $objProcessoRN = new ProcessoRN(); | ||
19 | + | ||
20 | + //conta registro | ||
21 | + //$totalRegistro = $objProcessoRN->contarComFiltro($objProcessoDTO); | ||
22 | + | ||
23 | + $totalRegistro = $objProcessoRN->contarProNumeroParte($objProcessoDTO); | ||
24 | + | ||
25 | + //Pesquisa paginada | ||
26 | + $objProcessoDTO->setNumPaginaAtual($paginaAtual); | ||
27 | + $objProcessoDTO->setNumMaxRegistrosRetorno($maxRetorno); | ||
28 | + //PaginaSEIExterna::getInstance()->processarPaginacao($objProcessoDTO); | ||
29 | + //$arrObjProcessoDTO = $objProcessoRN->listarTodosComFiltro($objProcessoDTO); | ||
30 | + $arrObjProcessoDTO = $objProcessoRN->listarProNumeroParte($objProcessoDTO); | ||
31 | + | ||
32 | + | ||
33 | + | ||
34 | + | ||
35 | + if ($totalRegistro != 0){ | ||
36 | + | ||
37 | + //$bolHttps = ConfiguracaoSEI::getInstance()->getValor('SessaoSEIExterna','https'); | ||
38 | + | ||
39 | + $html = PesquisaUtil::criarBarraEstatisticas($totalRegistro,$inicio,($inicio+10)); | ||
40 | + $html .= '<a name = "Pesquisa_Intranet"></a>'; | ||
41 | + $html .= '<p style="text-align:center; font-size: 1.6em;"> Pesquisa Processual Site do Cade </p>'; | ||
42 | + $html .= '<table id="infraTableIntranet" width="99%" class="resultado">'."\n"; | ||
43 | + $html.= '<th>Resultado de pesquisa processual no site do CADE.</th>'; | ||
44 | + | ||
45 | + foreach ($arrObjProcessoDTO as $objProtocoloDTO){ | ||
46 | + $html .= '<tr class="resTituloRegistro">'; | ||
47 | + $html .= '<td class="metatag" colspan="2">'."\n"; | ||
48 | + $strLinkArvoreCADE = "http://www.cade.gov.br/Processo.aspx?processo=".$objProtocoloDTO->getStrProNumero(); | ||
49 | + | ||
50 | + // if ($bolHttps){ | ||
51 | + // $strLinkArvoreCADE = str_replace('http://','https://',$strLinkArvoreCADE); | ||
52 | + // } | ||
53 | + | ||
54 | + $html .= '<a href="'.$strLinkArvoreCADE.'" target="_blank" class="arvore" ><img border="0" src="../../'.PaginaSEIExterna::getInstance()->getDiretorioImagensLocal().'/icone-arvore.png" alt="" title="Visualizar árvore" width="14" height="16" class="arvore" /></a> '; | ||
55 | + //Tipo do Processo | ||
56 | + $html .= '<a href="'.$strLinkArvoreCADE.'" target="_blank" style="font-size: 1em;">' .utf8_decode(iconv('CP850', 'UTF-8', $objProtocoloDTO->getStrTipproNome())).': Nº '. $objProtocoloDTO->getStrProNumero() . '</a>'; | ||
57 | + $html .= '</td>'; | ||
58 | + $html .= '<td align="right">'.$objProtocoloDTO->getStrProNumero().'</td>'; | ||
59 | + $html .= '</tr>'."\n"; | ||
60 | + $html .= '<tr class="infraTrClara">'; | ||
61 | + $html .= '<td colspan="2" class="metatag" style="padding: 0.8em 0.5em;">'; | ||
62 | + $html .= utf8_decode(iconv('CP850', 'UTF-8', $objProtocoloDTO->getStrProSumula())); | ||
63 | + $html .= '<td/>'; | ||
64 | + $html .= '<tr/>'; | ||
65 | + | ||
66 | + | ||
67 | + } | ||
68 | + | ||
69 | + $html .= '</table>'; | ||
70 | + $html .= PesquisaUtil::criarBarraNavegacao($totalRegistro, $inicio, 10, PaginaSEIExterna::getInstance(), SessaoSEIExterna::getInstance(),'intranet',$md5Captcha); | ||
71 | + | ||
72 | + return $html; | ||
73 | + } | ||
74 | + | ||
75 | + } | ||
76 | +} | ||
77 | + | ||
78 | +?> |
@@ -0,0 +1,94 @@ | @@ -0,0 +1,94 @@ | ||
1 | +<? | ||
2 | + class PesquisaIntegracao extends SeiIntegracao { | ||
3 | + | ||
4 | + public function getNome(){ | ||
5 | + return 'Módulo de Pesquisa Pública'; | ||
6 | + } | ||
7 | + | ||
8 | + public function getVersao() { | ||
9 | + return '3.0.0'; | ||
10 | + } | ||
11 | + | ||
12 | + public function getInstituicao(){ | ||
13 | + return 'CADE - Conselho Administrativo de Defesa Econômica'; | ||
14 | + } | ||
15 | + | ||
16 | + public function processarControlador($strAcao){ | ||
17 | + | ||
18 | + switch ($strAcao) { | ||
19 | + | ||
20 | + case 'md_parametro_pesquisa_listar' : | ||
21 | + case 'md_parametro_pesquisa_alterar': | ||
22 | + require_once dirname ( __FILE__ ) . '/parametro_pesquisa_lista.php'; | ||
23 | + return true; | ||
24 | + } | ||
25 | + | ||
26 | + return false; | ||
27 | + | ||
28 | + } | ||
29 | + | ||
30 | + public function processarControladorAjaxExterno($strAcaoAjax){ | ||
31 | + $xml = null; | ||
32 | + | ||
33 | + switch($strAcaoAjax){ | ||
34 | + case 'contato_auto_completar_contexto_pesquisa': | ||
35 | + | ||
36 | + //alterado para atender anatel exibir apenas nome contato | ||
37 | + $objContatoDTO = new ContatoDTO(); | ||
38 | + $objContatoDTO->retNumIdContato(); | ||
39 | + $objContatoDTO->retStrSigla(); | ||
40 | + $objContatoDTO->retStrNome(); | ||
41 | + | ||
42 | + $objContatoDTO->setStrPalavrasPesquisa($_POST['palavras_pesquisa']); | ||
43 | + | ||
44 | + if ($numIdGrupoContato!=''){ | ||
45 | + $objContatoDTO->setNumIdGrupoContato($_POST['id_grupo_contato']); | ||
46 | + } | ||
47 | + | ||
48 | + | ||
49 | + $objContatoDTO->setNumMaxRegistrosRetorno(50); | ||
50 | + $objContatoDTO->setOrdStrNome(InfraDTO::$TIPO_ORDENACAO_ASC); | ||
51 | + | ||
52 | + $objContatoRN = new ContatoRN(); | ||
53 | + $arrObjContatoDTO = $objContatoRN->pesquisarRN0471($objContatoDTO); | ||
54 | + | ||
55 | + // $arrObjContatoDTO = ContatoINT::autoCompletarContextoPesquisa($_POST['palavras_pesquisa'],$_POST['id_grupo_contato']); | ||
56 | + $xml = InfraAjax::gerarXMLItensArrInfraDTO($arrObjContatoDTO,'IdContato', 'Nome'); | ||
57 | + break; | ||
58 | + | ||
59 | + } | ||
60 | + | ||
61 | + return $xml; | ||
62 | + } | ||
63 | + | ||
64 | + public function montarMenuUsuarioExterno(){ | ||
65 | + | ||
66 | + $objParametroPesquisaDTO = new ParametroPesquisaDTO(); | ||
67 | + $objParametroPesquisaDTO->setStrNome(ParametroPesquisaRN::$TA_MENU_USUARIO_EXTERNO); | ||
68 | + $objParametroPesquisaDTO->retStrValor(); | ||
69 | + $objParametroPesquisaDTO->retStrNome(); | ||
70 | + | ||
71 | + $objParametroPesquisaRN = new ParametroPesquisaRN(); | ||
72 | + $objParametroPesquisaDTO = $objParametroPesquisaRN->consultar($objParametroPesquisaDTO); | ||
73 | + | ||
74 | + | ||
75 | + $bolMenuUsuarioExterno = $objParametroPesquisaDTO->getStrValor() == 'S' ? true : false; | ||
76 | + | ||
77 | + if($bolMenuUsuarioExterno){ | ||
78 | + $arrModulos = ConfiguracaoSEI::getInstance()->getValor('SEI','Modulos'); | ||
79 | + if(is_array($arrModulos) && array_key_exists('PesquisaIntegracao', $arrModulos)){ | ||
80 | + $caminho = $arrModulos['PesquisaIntegracao']; | ||
81 | + $arrMenu = array(); | ||
82 | + $arrMenu[] = '-^'.ConfiguracaoSEI::getInstance()->getValor('SEI','URL').'/modulos/'.$caminho.'/processo_pesquisar.php?acao_externa=protocolo_pesquisar&acao_origem_externa=protocolo_pesquisar&id_orgao_acesso_externo=0^^Pesquisa Processual^_blank^'; | ||
83 | + | ||
84 | + return $arrMenu; | ||
85 | + | ||
86 | + } | ||
87 | + } | ||
88 | + | ||
89 | + return null; | ||
90 | + | ||
91 | + } | ||
92 | + | ||
93 | + } | ||
94 | +?> | ||
0 | \ No newline at end of file | 95 | \ No newline at end of file |
@@ -0,0 +1,211 @@ | @@ -0,0 +1,211 @@ | ||
1 | +<? | ||
2 | + | ||
3 | +class PesquisaUtil { | ||
4 | + | ||
5 | + | ||
6 | + public static function criarBarraEstatisticas($total,$inicio,$fim) { | ||
7 | + return "<div class=\"barra\">".self::obterTextoBarraEstatisticas($total,$inicio,$fim)."</div>"; | ||
8 | + } | ||
9 | + | ||
10 | + public static function obterTextoBarraEstatisticas($total,$inicio,$fim) { | ||
11 | + $ret = ''; | ||
12 | + if ($total > 0 && $total != "") { | ||
13 | + if ($total < $fim) { | ||
14 | + $ret .= $total.' resultado'.($total>1?'s':''); | ||
15 | + } else { | ||
16 | + $ret .= "Exibindo " . ($inicio+1) . " - " . $fim . " de " . $total; | ||
17 | + } | ||
18 | + } | ||
19 | + return $ret; | ||
20 | + } | ||
21 | + | ||
22 | + //Cria a navegacao completa | ||
23 | + public static function criarBarraNavegacao($totalRes, $inicio, $numResPorPag, $objPagina, $objSessao, $strLocalPesquisa,$md5Captcha = null,$strControlador = 'processo_pesquisar.php') | ||
24 | + { | ||
25 | + | ||
26 | + if ($totalRes == 0) | ||
27 | + return; | ||
28 | + | ||
29 | + $nav = "<div class=\"paginas\">"; | ||
30 | + | ||
31 | + $paginaAtual = $inicio / $numResPorPag + 1; | ||
32 | + | ||
33 | + $urlSemInicio = $strControlador.'?acao_externa='.$_GET['acao_externa']."&acao_origem_externa=protocolo_pesquisar_paginado"; | ||
34 | + | ||
35 | + $urlSemInicio .= '&local_pesquisa='.$strLocalPesquisa; | ||
36 | + | ||
37 | + $hash = (!is_null($md5Captcha)) ? "&hash=".$md5Captcha : ""; | ||
38 | + | ||
39 | + if ($inicio != null ) { | ||
40 | + $nav .= "<span class=\"pequeno\"><a href=\"javascript:pagina.ir('" . $objPagina->formatarXHTML($objSessao->assinarLink($urlSemInicio . '&num_pagina='. ($paginaAtual - 2) . "&inicio_cade=" . ($inicio - $numResPorPag) . $hash)) . "')\">Anterior</a></span>\n"; | ||
41 | + } | ||
42 | + | ||
43 | + if ($totalRes > $numResPorPag) | ||
44 | + { | ||
45 | + $numPagParaClicar = 12; | ||
46 | + | ||
47 | + if (ceil($totalRes / $numResPorPag) > $numPagParaClicar) | ||
48 | + { | ||
49 | + $iniNav = ($paginaAtual - floor(($numPagParaClicar - 1) / 2)) - 1; | ||
50 | + $fimNav = ($paginaAtual + ceil(($numPagParaClicar - 1) / 2)); | ||
51 | + | ||
52 | + if ($iniNav < 0) | ||
53 | + { | ||
54 | + $iniNav = 0; | ||
55 | + $fimNav = $numPagParaClicar; | ||
56 | + } | ||
57 | + | ||
58 | + if ($fimNav > ceil($totalRes / $numResPorPag)) | ||
59 | + { | ||
60 | + $fimNav = ceil($totalRes / $numResPorPag); | ||
61 | + $iniNav = $fimNav - $numPagParaClicar; | ||
62 | + } | ||
63 | + } | ||
64 | + else | ||
65 | + { | ||
66 | + $iniNav = 0; | ||
67 | + $fimNav = ceil($totalRes / $numResPorPag); | ||
68 | + } | ||
69 | + | ||
70 | + for ($i = $iniNav; $i < $fimNav; $i++) | ||
71 | + { | ||
72 | + $numPagina = $i; | ||
73 | + if ($inicio == 0 AND $i == 0){ | ||
74 | + $nav .= " <b>" . ($i + 1) . "</b> "; | ||
75 | + }elseif (($i + 1) == ($inicio / $numResPorPag + 1)){ | ||
76 | + $nav .= " <b>" . ($i + 1) . "</b> "; | ||
77 | + }else{ | ||
78 | + //$nav .= " <a href=\"javascript:pagina.ir('" . str_replace('+','%2B',$objPagina->formatarXHTML($objSessao->assinarLink($urlSemInicio . '&num_pagina='.$numPagina."&inicio=" . ($i * $numResPorPag)))).'#Pesquisa_Siscade' . "')\">" . ($i + 1) . "</a>\n"; | ||
79 | + $nav .= " <a href=\"javascript:pagina.ir('" . str_replace('+','%2B',$objPagina->formatarXHTML($objSessao->assinarLink($urlSemInicio . '&num_pagina='.$numPagina."&inicio_cade=" . ($i * $numResPorPag) . $hash)))."')\">" . ($i + 1) . "</a>\n"; | ||
80 | + | ||
81 | + } | ||
82 | + } | ||
83 | + } | ||
84 | + | ||
85 | + if (($inicio / $numResPorPag) + 1 != ceil($totalRes / $numResPorPag)) { | ||
86 | + $nav .= "<span class=\"pequeno\"><a href=\"javascript:pagina.ir('" . $objPagina->formatarXHTML($objSessao->assinarLink($urlSemInicio . '&num_pagina='.$paginaAtual . "&inicio_cade=" . ($inicio + $numResPorPag) . $hash)) . "')\">Próxima</a></span>\n"; | ||
87 | + } | ||
88 | + | ||
89 | + $nav .= "</div>"; | ||
90 | + | ||
91 | + return $nav; | ||
92 | + } | ||
93 | + | ||
94 | + public static function buscaParticipantes($strNomeParticipante){ | ||
95 | + | ||
96 | + $objContatoDTO = new ContatoDTO(); | ||
97 | + $objContatoDTO->retNumIdContato(); | ||
98 | + | ||
99 | + | ||
100 | + $objContatoDTO->setStrPalavrasPesquisa($strNomeParticipante); | ||
101 | + | ||
102 | + if ($numIdGrupoContato!=''){ | ||
103 | + $objContatoDTO->setNumIdGrupoContato($numIdGrupoContato); | ||
104 | + } | ||
105 | + | ||
106 | + | ||
107 | + $objContatoDTO->setNumMaxRegistrosRetorno(50); | ||
108 | + | ||
109 | + $objContatoDTO->setOrdStrNome(InfraDTO::$TIPO_ORDENACAO_ASC); | ||
110 | + | ||
111 | + $objContatoRN = new ContatoRN(); | ||
112 | + $arrObjContatoDTO = $objContatoRN->pesquisarRN0471($objContatoDTO); | ||
113 | + | ||
114 | + $ret = PesquisaUtil::preparaIdParticipantes($arrObjContatoDTO); | ||
115 | + | ||
116 | + return $ret; | ||
117 | + | ||
118 | + | ||
119 | + | ||
120 | + } | ||
121 | + | ||
122 | + public static function valiadarLink($strLink = null){ | ||
123 | + | ||
124 | + if ($strLink == null){ | ||
125 | + $strLink = $_SERVER['REQUEST_URI']; | ||
126 | + } | ||
127 | + | ||
128 | + $strLink = urldecode($strLink); | ||
129 | + | ||
130 | + if (trim($strLink == '')){ | ||
131 | + return; | ||
132 | + } | ||
133 | + | ||
134 | + $arrParametros = (array('id_orgao_acesso_externo','id_procedimento','id_documento')); | ||
135 | + | ||
136 | + foreach ($arrParametros as $strParametros){ | ||
137 | + if(isset($_GET[$strParametros])){ | ||
138 | + | ||
139 | + if(trim($_GET[$strParametros]) == ''){ | ||
140 | + throw new InfraException('Link externo inválido.'); | ||
141 | + } | ||
142 | + | ||
143 | + if(!is_numeric($_GET[$strParametros])){ | ||
144 | + throw new InfraException('Link externo inválido.'); | ||
145 | + } | ||
146 | + } | ||
147 | + } | ||
148 | + | ||
149 | + $arrScriptFileName = (array('processo_exibir.php','documento_consulta_externa.php')); | ||
150 | + | ||
151 | + if(in_array(basename($_SERVER['SCRIPT_FILENAME']), $arrScriptFileName)){ | ||
152 | + if(!isset($_GET['acao_externa']) || trim($_GET['acao_externa'])==''){ | ||
153 | + throw new InfraException('Link externo inválido.'); | ||
154 | + } | ||
155 | + | ||
156 | + if(!isset($_GET['id_orgao_acesso_externo'])){ | ||
157 | + throw new InfraException('Link externo inválido.'); | ||
158 | + } | ||
159 | + } | ||
160 | + | ||
161 | + if (basename($_SERVER['SCRIPT_FILENAME']) == 'controlador_ajax_externo.php'){ | ||
162 | + | ||
163 | + if (!isset($_GET['acao_ajax_externo']) || trim($_GET['acao_ajax_externo'])==''){ | ||
164 | + throw new InfraException('Link externo inválido.'); | ||
165 | + } | ||
166 | + | ||
167 | + | ||
168 | + $arrAcaoAjaxExterno = (array('contato_auto_completar_contexto_pesquisa','unidade_auto_completar_todas')); | ||
169 | + | ||
170 | + if (!in_array($_GET['acao_ajax_externo'], $arrAcaoAjaxExterno)) { | ||
171 | + throw new InfraException('Link externo inválido.'); | ||
172 | + } | ||
173 | + } | ||
174 | + | ||
175 | + } | ||
176 | + | ||
177 | + private static function preparaIdParticipantes($arrObjContatoDTO){ | ||
178 | + $strIdParticipante = ''; | ||
179 | + if(!empty($arrObjContatoDTO) && count($arrObjContatoDTO) == 1){ | ||
180 | + $strIdParticipante = $strIdParticipante.'id_int:*'.$arrObjContatoDTO[0]->getNumIdContato().'* AND '; | ||
181 | + } | ||
182 | + else if (!empty($arrObjContatoDTO) && count($arrObjContatoDTO) > 1){ | ||
183 | + $count = 0; | ||
184 | + $strIdParticipante = 'id_int:('; | ||
185 | + for($i=0;$i < count($arrObjContatoDTO); $i++){ | ||
186 | + $count = $count + 1; | ||
187 | + $strIdParticipante = $strIdParticipante.'*'.$arrObjContatoDTO[$i]->getNumIdContato().'*'; | ||
188 | + if($count < count($arrObjContatoDTO)){ | ||
189 | + $strIdParticipante = $strIdParticipante.' OR '; | ||
190 | + } | ||
191 | + | ||
192 | + if($count == count($arrObjContatoDTO)){ | ||
193 | + $strIdParticipante = $strIdParticipante.') AND '; | ||
194 | + } | ||
195 | + } | ||
196 | + | ||
197 | +// foreach ($arrObjContatoDTO as $objContatoDTO){ | ||
198 | +// $strIdParticipante = $strIdParticipante.'*'.$objContatoDTO->getNumIdContato().'*'; | ||
199 | +// if(end(array_keys($arrObjContatoDTO->NumIdContato())) == $objContatoDTO->NumIdContato()){ | ||
200 | +// $strIdParticipante = $strIdParticipante.' OR '; | ||
201 | +// } | ||
202 | +// } | ||
203 | + } | ||
204 | + | ||
205 | + return $strIdParticipante; | ||
206 | + | ||
207 | + } | ||
208 | + | ||
209 | +} | ||
210 | + | ||
211 | +?> | ||
0 | \ No newline at end of file | 212 | \ No newline at end of file |
@@ -0,0 +1,209 @@ | @@ -0,0 +1,209 @@ | ||
1 | +<? | ||
2 | +class SolrUtilExterno { | ||
3 | + | ||
4 | + | ||
5 | + public static function formatarCaracteresEspeciais($q){ | ||
6 | + | ||
7 | + $arrSolrExc = array(chr(92),'/','+','-','&','|','!','(',')','{','}','[',']','^','~','*','?',':'); | ||
8 | + | ||
9 | + foreach($arrSolrExc as $solrExc){ | ||
10 | + $q = str_replace($solrExc, chr(92).$solrExc, $q); | ||
11 | + } | ||
12 | + | ||
13 | + return $q; | ||
14 | + } | ||
15 | + | ||
16 | + public static function formatarOperadores($q,$tag=null) { | ||
17 | + | ||
18 | + $q = InfraString::excluirAcentos(InfraString::transformarCaixaBaixa($q)); | ||
19 | + | ||
20 | + //remove aspas repetidas | ||
21 | + while(strpos($q,'""')!==false){ | ||
22 | + $q = str_replace('""','"',$q); | ||
23 | + } | ||
24 | + | ||
25 | + $arrPalavrasQ = InfraString::agruparItens($q); | ||
26 | + | ||
27 | + //print_r($arrPalavrasQ); | ||
28 | + //die; | ||
29 | + | ||
30 | + for($i=0;$i<count($arrPalavrasQ);$i++){ | ||
31 | + | ||
32 | + //número de aspas ímpar, remover do token que ficar com apenas uma | ||
33 | + $arrPalavrasQ[$i] = SolrUtilExterno::formatarCaracteresEspeciais(str_replace('"','',$arrPalavrasQ[$i])); | ||
34 | + | ||
35 | + if ( strpos($arrPalavrasQ[$i],' ') !== false) { | ||
36 | + | ||
37 | + if ($tag==null){ | ||
38 | + $arrPalavrasQ[$i] = '"'.$arrPalavrasQ[$i].'"'; | ||
39 | + }else{ | ||
40 | + $arrPalavrasQ[$i] = $tag.':"'.$arrPalavrasQ[$i].'"'; | ||
41 | + } | ||
42 | + }else if($arrPalavrasQ[$i] == 'e') { | ||
43 | + $arrPalavrasQ[$i] = "AND"; | ||
44 | + } | ||
45 | + else if($arrPalavrasQ[$i]=='ou') { | ||
46 | + $arrPalavrasQ[$i] = "OR"; | ||
47 | + } | ||
48 | + else if($arrPalavrasQ[$i]=='nao') { | ||
49 | + $arrPalavrasQ[$i] = "AND NOT"; | ||
50 | + }else{ | ||
51 | + if ($tag!=null){ | ||
52 | + $arrPalavrasQ[$i] = $tag.':'.$arrPalavrasQ[$i]; | ||
53 | + } | ||
54 | + } | ||
55 | + } | ||
56 | + | ||
57 | + $ret = ''; | ||
58 | + for($i=0;$i<count($arrPalavrasQ);$i++){ | ||
59 | + //Adiciona operador and como padrão se não informado | ||
60 | + if ($i>0){ | ||
61 | + if (!in_array($arrPalavrasQ[$i-1],array('AND','OR','AND NOT','(')) && !in_array($arrPalavrasQ[$i],array('AND','OR','AND NOT',')'))){ | ||
62 | + $ret .= " AND"; | ||
63 | + } | ||
64 | + } | ||
65 | + $ret .= ' '.$arrPalavrasQ[$i]; | ||
66 | + } | ||
67 | + | ||
68 | + $ret = str_replace(" AND AND NOT "," AND NOT ", $ret); | ||
69 | + | ||
70 | + if (substr($ret,0,strlen(" AND NOT "))==" AND NOT "){ | ||
71 | + $ret = substr($ret, strlen(" AND NOT ")); | ||
72 | + $ret = 'NOT '. $ret; | ||
73 | + } | ||
74 | + | ||
75 | + if (substr($ret,0,strlen(" AND "))==" AND "){ | ||
76 | + $ret = substr($ret, strlen(" AND ")); | ||
77 | + } | ||
78 | + | ||
79 | + if (substr($ret,0,strlen(" OR "))==" OR "){ | ||
80 | + $ret = substr($ret, strlen(" OR ")); | ||
81 | + } | ||
82 | + | ||
83 | + if (substr($ret,strlen(" AND")*-1)==" AND"){ | ||
84 | + $ret = substr($ret,0, strlen(" AND")*-1); | ||
85 | + } | ||
86 | + | ||
87 | + if (substr($ret,strlen(" OR")*-1)==" OR"){ | ||
88 | + $ret = substr($ret,0, strlen(" OR")*-1); | ||
89 | + } | ||
90 | + | ||
91 | + if (substr($ret,strlen(" AND NOT")*-1)==" AND NOT"){ | ||
92 | + $ret = substr($ret,0, strlen(" AND NOT")*-1); | ||
93 | + } | ||
94 | + | ||
95 | + return $ret; | ||
96 | + } | ||
97 | + | ||
98 | + public static function criarBarraEstatisticas($total,$inicio,$fim) { | ||
99 | + return "<div class=\"barra\">".self::obterTextoBarraEstatisticas($total,$inicio,$fim)."</div>"; | ||
100 | + } | ||
101 | + | ||
102 | + public static function obterTextoBarraEstatisticas($total,$inicio,$fim) { | ||
103 | + $ret = ''; | ||
104 | + if ($total > 0 && $total != "") { | ||
105 | + if ($total < $fim) { | ||
106 | + $ret .= $total.' resultado'.($total>1?'s':''); | ||
107 | + } else { | ||
108 | + $ret .= "Exibindo " . ($inicio+1) . " - " . $fim . " de " . $total; | ||
109 | + } | ||
110 | + } | ||
111 | + return $ret; | ||
112 | + } | ||
113 | + | ||
114 | + //Cria a navegacao completa | ||
115 | + public static function criarBarraNavegacao($totalRes, $inicio, $numResPorPag, $objPagina, $objSessao, $md5Captcha = null, $strControlador = 'processo_pesquisar.php' ) | ||
116 | + { | ||
117 | + | ||
118 | + if ($totalRes == 0) | ||
119 | + return; | ||
120 | + | ||
121 | + $nav = "<div class=\"paginas\">"; | ||
122 | + | ||
123 | + $paginaAtual = $inicio / $numResPorPag + 1; | ||
124 | + | ||
125 | + $urlSemInicio = $strControlador.'?acao_externa='.$_GET['acao_externa']."&acao_origem_externa=protocolo_pesquisar_paginado"; | ||
126 | + | ||
127 | + $hash = (!is_null($md5Captcha)) ? "&hash=".$md5Captcha : ""; | ||
128 | + | ||
129 | + if ($inicio != null ) { | ||
130 | + $nav .= "<span class=\"pequeno\"><a href=\"javascript:pagina.ir('" . $objPagina->formatarXHTML($objSessao->assinarLink($urlSemInicio . "&inicio=" . ($inicio - $numResPorPag) . $hash)) . "')\">Anterior</a></span>\n"; | ||
131 | + } | ||
132 | + | ||
133 | + if ($totalRes > $numResPorPag) | ||
134 | + { | ||
135 | + $numPagParaClicar = 12; | ||
136 | + | ||
137 | + if (ceil($totalRes / $numResPorPag) > $numPagParaClicar) | ||
138 | + { | ||
139 | + $iniNav = ($paginaAtual - floor(($numPagParaClicar - 1) / 2)) - 1; | ||
140 | + $fimNav = ($paginaAtual + ceil(($numPagParaClicar - 1) / 2)); | ||
141 | + | ||
142 | + if ($iniNav < 0) | ||
143 | + { | ||
144 | + $iniNav = 0; | ||
145 | + $fimNav = $numPagParaClicar; | ||
146 | + } | ||
147 | + | ||
148 | + if ($fimNav > ceil($totalRes / $numResPorPag)) | ||
149 | + { | ||
150 | + $fimNav = ceil($totalRes / $numResPorPag); | ||
151 | + $iniNav = $fimNav - $numPagParaClicar; | ||
152 | + } | ||
153 | + } | ||
154 | + else | ||
155 | + { | ||
156 | + $iniNav = 0; | ||
157 | + $fimNav = ceil($totalRes / $numResPorPag); | ||
158 | + } | ||
159 | + | ||
160 | + for ($i = $iniNav; $i < $fimNav; $i++) | ||
161 | + { | ||
162 | + if ($inicio == 0 AND $i == 0){ | ||
163 | + $nav .= " <b>" . ($i + 1) . "</b> "; | ||
164 | + }elseif (($i + 1) == ($inicio / $numResPorPag + 1)){ | ||
165 | + $nav .= " <b>" . ($i + 1) . "</b> "; | ||
166 | + }else{ | ||
167 | + $nav .= " <a href=\"javascript:pagina.ir('" . str_replace('+','%2B',$objPagina->formatarXHTML($objSessao->assinarLink($urlSemInicio . "&inicio=" . ($i * $numResPorPag)))) . $hash . "')\">" . ($i + 1) . "</a>\n"; | ||
168 | + } | ||
169 | + } | ||
170 | + } | ||
171 | + | ||
172 | + if (($inicio / $numResPorPag) + 1 != ceil($totalRes / $numResPorPag)) { | ||
173 | + $nav .= "<span class=\"pequeno\"><a href=\"javascript:pagina.ir('" . $objPagina->formatarXHTML($objSessao->assinarLink($urlSemInicio . "&inicio=" . ($inicio + $numResPorPag))) . $hash . "')\">Próxima</a></span>\n"; | ||
174 | + } | ||
175 | + | ||
176 | + $nav .= "</div>"; | ||
177 | + | ||
178 | + return $nav; | ||
179 | + } | ||
180 | + | ||
181 | + public static function prepararUrl($url){ | ||
182 | + $pos = strpos($url,'controlador.php'); | ||
183 | + if ($pos !== false){ | ||
184 | + $url = ConfiguracaoSEI::getInstance()->getValor('SEI','URL').substr($url,$pos); | ||
185 | + }else{ | ||
186 | + $pos = strpos($url,'/publicacoes/controlador_publicacoes.php'); | ||
187 | + if ($pos !== false){ | ||
188 | + $url = ConfiguracaoSEI::getInstance()->getValor('SEI','URL').substr($url,$pos); | ||
189 | + } | ||
190 | + } | ||
191 | + | ||
192 | + if (ConfiguracaoSEI::getInstance()->getValor('SessaoSEI','https')){ | ||
193 | + $url = str_replace('http://','https://',$url); | ||
194 | + } | ||
195 | + | ||
196 | + return $url; | ||
197 | + } | ||
198 | + | ||
199 | + public static function obterTag($reg, $tag, $tipo){ | ||
200 | + $ret = $reg->xpath($tipo.'[@name=\''.$tag.'\']'); | ||
201 | + if (isset($ret[0])){ | ||
202 | + $ret = utf8_decode($ret[0]); | ||
203 | + }else{ | ||
204 | + $ret = null; | ||
205 | + } | ||
206 | + return $ret; | ||
207 | + } | ||
208 | +} | ||
209 | +?> | ||
0 | \ No newline at end of file | 210 | \ No newline at end of file |
@@ -0,0 +1,58 @@ | @@ -0,0 +1,58 @@ | ||
1 | +<? | ||
2 | +/* | ||
3 | +* CONSELHO ADMINISTRATIVO DE DEFESA ECONÔMICA - CADE | ||
4 | +* | ||
5 | +* 01/10/2014 - criado por alex braga | ||
6 | +* | ||
7 | +* | ||
8 | +* Versão do Gerador de Código: | ||
9 | +*/ | ||
10 | +try { | ||
11 | + require_once dirname(__FILE__).'/../../SEI.php'; | ||
12 | + | ||
13 | + //session_start(); | ||
14 | + | ||
15 | + ////////////////////////////////////////////////////////////////////////////// | ||
16 | + InfraDebug::getInstance()->setBolLigado(false); | ||
17 | + InfraDebug::getInstance()->setBolDebugInfra(false); | ||
18 | + InfraDebug::getInstance()->limpar(); | ||
19 | + ////////////////////////////////////////////////////////////////////////////// | ||
20 | + | ||
21 | + //SessaoSEIExterna::getInstance()->validarLink(); | ||
22 | + | ||
23 | + PesquisaUtil::valiadarLink(); | ||
24 | + | ||
25 | + // SessaoSEI::getInstance()->validarPermissao($_GET['acao']); | ||
26 | + | ||
27 | + $strNomeArquivo = ''; | ||
28 | + | ||
29 | + switch($_GET['acao_externa']){ | ||
30 | + | ||
31 | + case 'pesquisa_solr_ajuda_externa': | ||
32 | + $strConteudo = file_get_contents('../../ajuda/ajuda_solr.html'); | ||
33 | + break; | ||
34 | + | ||
35 | + case 'pesquisa_fts_ajuda_externa': | ||
36 | + $strConteudo = file_get_contents('../../ajuda/ajuda_fts.html'); | ||
37 | + break; | ||
38 | + | ||
39 | + case 'assinatura_digital_ajuda_externa': | ||
40 | + $strConteudo = file_get_contents('../../ajuda/assinatura_digital_ajuda.html'); | ||
41 | + $strConteudo = str_replace('[servidor]', ConfiguracaoSEI::getInstance()->getValor('SEI','URL'), $strConteudo); | ||
42 | + break; | ||
43 | + | ||
44 | + default: | ||
45 | + throw new InfraException("Ação '".$_GET['acao']."' não reconhecida."); | ||
46 | + } | ||
47 | + | ||
48 | + header('Content-Type: text/html; charset=iso-8859-1'); | ||
49 | + header('Vary: Accept'); | ||
50 | + header('Cache-Control: no-cache, must-revalidate'); | ||
51 | + header('Pragma: no-cache'); | ||
52 | + | ||
53 | + echo $strConteudo; | ||
54 | + | ||
55 | +}catch(Exception $e){ | ||
56 | + die('Erro realizando download do anexo:'.$e->__toString()); | ||
57 | +} | ||
58 | +?> | ||
0 | \ No newline at end of file | 59 | \ No newline at end of file |
@@ -0,0 +1,19 @@ | @@ -0,0 +1,19 @@ | ||
1 | +<? | ||
2 | +/** | ||
3 | +* CONSELHO ADMINISTRATIVO DE DEFESA ECONÔMICA | ||
4 | +* | ||
5 | +* 29/11/2016 - criado por alex | ||
6 | +* | ||
7 | +* Versão do Gerador de Código: 1.39.0 | ||
8 | +*/ | ||
9 | + | ||
10 | +require_once dirname(__FILE__).'/../../../SEI.php'; | ||
11 | + | ||
12 | +class ParametroPesquisaBD extends InfraBD { | ||
13 | + | ||
14 | + public function __construct(InfraIBanco $objInfraIBanco){ | ||
15 | + parent::__construct($objInfraIBanco); | ||
16 | + } | ||
17 | + | ||
18 | +} | ||
19 | +?> |
@@ -0,0 +1,157 @@ | @@ -0,0 +1,157 @@ | ||
1 | +<? | ||
2 | +/** | ||
3 | + * CONSELHO ADMINISTRATIVO DE DEFESA ECONÔMICA | ||
4 | + * 2014-12-15 | ||
5 | + * Versão do Gerador de Código: 1.0 | ||
6 | + * Versão no CVS/SVN: | ||
7 | + * | ||
8 | + * sei | ||
9 | + * pesquisa | ||
10 | + * ProcedimentoSiscadeBD | ||
11 | + * | ||
12 | + * | ||
13 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
14 | + */ | ||
15 | + | ||
16 | +/** | ||
17 | + * Classe Banco de dados Procedimento siscade. | ||
18 | + * | ||
19 | + * | ||
20 | + * @package institucional_pesquisa_ProcedimentoSiscadeBD | ||
21 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
22 | + * @license Creative Commons Atribuição 3.0 não adaptada | ||
23 | + * <http://creativecommons.org/licenses/by/3.0/deed.pt_BR> | ||
24 | + * @ignore Este código é livre para uso sem nenhuma restrição, | ||
25 | + * salvo pelas informações a seguir referentes | ||
26 | + * @copyright Conselho Administrativo de Defesa Econômica ©2014-2018 | ||
27 | + * <http://www.cade.gov.br> | ||
28 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
29 | + */ | ||
30 | + | ||
31 | +require_once dirname(__FILE__).'/../../../SEI.php'; | ||
32 | + | ||
33 | +class ProcedimentoSiscadeBD extends InfraBD { | ||
34 | + | ||
35 | + private $sqlProcedimentoParte = 'select distinct(pro.NR_PROCEDIMENTO), pro.TX_RESUMO, esp.NM_ESPECIE, pro.ID_CONFIDENCIALIDADE from S_PROCEDIMENTO pro | ||
36 | + inner join S_ESPECIE esp on esp.ID_ESPECIE = pro.ID_ESPECIE | ||
37 | + inner join S_PROCEDIMENTO_PARTE par on par.ID_PROCEDIMENTO = pro.ID_PROCEDIMENTO | ||
38 | + left join S_PESSOA_FISICA fis on fis.ID_PESSOAFISICA = par.ID_PESSOAFISICA | ||
39 | + left join S_PESSOA_JURIDICA jus on jus.ID_PESSOAJURIDICA = par.ID_PESSOAJURIDICA | ||
40 | + left join S_ENTE_ADMINISTRATIVO ent on ent.ID_ENTEADMINISTRATIVO = par.ID_ENTEADMINISTRACAO'; | ||
41 | + | ||
42 | + private $operadorWhere = ' where '; | ||
43 | + | ||
44 | + public function __construct(InfraIBanco $objInfraIBanco){ | ||
45 | + parent::__construct($objInfraIBanco); | ||
46 | + } | ||
47 | + | ||
48 | + public function contarProcedimentoParte(ProcedimentoSiscadeDTO $objProcedimentoSiscadeDTO){ | ||
49 | + | ||
50 | + try { | ||
51 | + | ||
52 | + $where = $this->operadorWhere; | ||
53 | + | ||
54 | + if(!InfraString::isBolVazia($objProcedimentoSiscadeDTO->getStrNrProcedimento())){ | ||
55 | + $proNumero = (string)addslashes('%'.$objProcedimentoSiscadeDTO->getStrNrProcedimento().'%'); | ||
56 | + $where .= "pro.NR_PROCEDIMENTO like '{$proNumero}'"; | ||
57 | + | ||
58 | + } | ||
59 | + | ||
60 | + | ||
61 | + if(!InfraString::isBolVazia($objProcedimentoSiscadeDTO->getStrNrProcedimento()) && !InfraString::isBolVazia($objProcedimentoSiscadeDTO->getStrNomeParte())){ | ||
62 | + $where .= ' and '; | ||
63 | + } | ||
64 | + | ||
65 | + | ||
66 | + | ||
67 | + if(!InfraString::isBolVazia($objProcedimentoSiscadeDTO->getStrNomeParte())){ | ||
68 | + $nomeParte = (string)addslashes('%'.$objProcedimentoSiscadeDTO->getStrNomeParte().'%'); | ||
69 | + $where .= " (fis.NM_NOME like '{$nomeParte}' or jus.NM_NOME like '{$nomeParte}' or ent.NM_DENOMINACAO like '{$nomeParte}') "; | ||
70 | + | ||
71 | + } | ||
72 | + | ||
73 | + $where .= ' and pro.ID_CONFIDENCIALIDADE = 1'; | ||
74 | + | ||
75 | + $sql = 'select count(*) as total from ( '.$this->sqlProcedimentoParte.$where.' ) as procedimento'; | ||
76 | + | ||
77 | + | ||
78 | + $rs = $this->getObjInfraIBanco()->consultarSql($sql); | ||
79 | + | ||
80 | + return $rs[0]['total']; | ||
81 | + | ||
82 | + } catch (Exception $e) { | ||
83 | + throw new InfraException('Erro contando procedimento Siscade',$e); | ||
84 | + } | ||
85 | + } | ||
86 | + | ||
87 | + public function listarPaginadoProcedimentoParte(ProcedimentoSiscadeDTO $objProcedimentoSiscadeDTO){ | ||
88 | + | ||
89 | + | ||
90 | + | ||
91 | + | ||
92 | + try { | ||
93 | + | ||
94 | + $where = $this->operadorWhere; | ||
95 | + | ||
96 | + if(!InfraString::isBolVazia($objProcedimentoSiscadeDTO->getStrNrProcedimento())){ | ||
97 | + $proNumero = (string)addslashes('%'.$objProcedimentoSiscadeDTO->getStrNrProcedimento().'%'); | ||
98 | + | ||
99 | + | ||
100 | + $where .= "pro.NR_PROCEDIMENTO like '{$proNumero}'"; | ||
101 | + | ||
102 | + | ||
103 | + } | ||
104 | + | ||
105 | + ; | ||
106 | + | ||
107 | + if(!InfraString::isBolVazia($objProcedimentoSiscadeDTO->getStrNrProcedimento()) && !InfraString::isBolVazia($objProcedimentoSiscadeDTO->getStrNomeParte())){ | ||
108 | + $where .= ' and '; | ||
109 | + } | ||
110 | + | ||
111 | + | ||
112 | + | ||
113 | + if(!InfraString::isBolVazia($objProcedimentoSiscadeDTO->getStrNomeParte())){ | ||
114 | + $nomeParte = (string)addslashes('%'.$objProcedimentoSiscadeDTO->getStrNomeParte().'%'); | ||
115 | + $where .= " (fis.NM_NOME like '{$nomeParte}' or jus.NM_NOME like '{$nomeParte}' or ent.NM_DENOMINACAO like '{$nomeParte}') "; | ||
116 | + | ||
117 | + } | ||
118 | + | ||
119 | + //condição de confidencialidade | ||
120 | + | ||
121 | + $where .= ' and pro.ID_CONFIDENCIALIDADE = 1'; | ||
122 | + | ||
123 | + $sql = $this->sqlProcedimentoParte.$where.' order by pro.NR_PROCEDIMENTO'; | ||
124 | + | ||
125 | + | ||
126 | + $ini = ($objProcedimentoSiscadeDTO->getNumPaginaAtual() * $objProcedimentoSiscadeDTO->getNumMaxRegistrosRetorno() ); | ||
127 | + $qtd = $objProcedimentoSiscadeDTO->getNumMaxRegistrosRetorno(); | ||
128 | + | ||
129 | + $rs = $this->getObjInfraIBanco()->paginarSql($sql,$ini,$qtd); | ||
130 | + | ||
131 | + $arrObjProcedimentoSiscadeDTO = array(); | ||
132 | + | ||
133 | + | ||
134 | + for($i = 0; $i < count($rs[registrosPagina]); $i++){ | ||
135 | + $objProcedimentoSiscadeDTO = new ProcedimentoSiscadeDTO(); | ||
136 | + $objProcedimentoSiscadeDTO->setStrNrProcedimento($rs[registrosPagina][$i]['NR_PROCEDIMENTO']); | ||
137 | + $objProcedimentoSiscadeDTO->setStrTxResumo($rs[registrosPagina][$i]['TX_RESUMO']); | ||
138 | + $objProcedimentoSiscadeDTO->setStrNmEspecie($rs[registrosPagina][$i]['NM_ESPECIE']); | ||
139 | + $arrObjProcedimentoSiscadeDTO[] = $objProcedimentoSiscadeDTO; | ||
140 | + } | ||
141 | + | ||
142 | + return $arrObjProcedimentoSiscadeDTO; | ||
143 | + | ||
144 | + | ||
145 | + | ||
146 | + } catch (Exception $e) { | ||
147 | + throw new InfraException('Erro listando procedimento Siscade',$e); | ||
148 | + } | ||
149 | + } | ||
150 | + | ||
151 | + | ||
152 | +} | ||
153 | + | ||
154 | + | ||
155 | +?> | ||
156 | + | ||
157 | + |
@@ -0,0 +1,188 @@ | @@ -0,0 +1,188 @@ | ||
1 | +<? | ||
2 | + | ||
3 | +/** | ||
4 | + * CONSELHO ADMINISTRATIVO DE DEFESA ECONÔMICA | ||
5 | + * 2014-11-12 | ||
6 | + * Versão do Gerador de Código: 1.0 | ||
7 | + * Versão no CVS/SVN: | ||
8 | + * | ||
9 | + * sei | ||
10 | + * pesquisa | ||
11 | + * ProcessoBD | ||
12 | + * | ||
13 | + * | ||
14 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
15 | + */ | ||
16 | + | ||
17 | +/** | ||
18 | + * Classe de Banco de dados da tabela processo DBCade. | ||
19 | + * | ||
20 | + * | ||
21 | + * @package institucional_pesquisa_ProcessoBD | ||
22 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
23 | + * @license Creative Commons Atribuição 3.0 não adaptada | ||
24 | + * <http://creativecommons.org/licenses/by/3.0/deed.pt_BR> | ||
25 | + * @ignore Este código é livre para uso sem nenhuma restrição, | ||
26 | + * salvo pelas informações a seguir referentes | ||
27 | + * @copyright Conselho Administrativo de Defesa Econômica ©2014-2018 | ||
28 | + * <http://www.cade.gov.br> | ||
29 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
30 | + */ | ||
31 | + | ||
32 | + | ||
33 | +require_once dirname(__FILE__).'/../../../SEI.php'; | ||
34 | + | ||
35 | +class ProcessoBD extends InfraBD { | ||
36 | + | ||
37 | + private $sqlRepresentada = 'select distinct(pro.pro_codigo), pro.pro_numero, CAST(pro.pro_sumula AS varchar(1000)) as pro_sumula, tip.tippro_nome | ||
38 | + from processos pro inner join processoXrepresentada representada | ||
39 | + on pro.pro_codigo = representada.pro_codigo | ||
40 | + inner join pessoas pes | ||
41 | + on representada.pes_codigo = pes.pes_codigo | ||
42 | + inner join tipos_processos tip | ||
43 | + on tip.tippro_codigo = pro.tippro_codigo '; | ||
44 | + | ||
45 | + private $sqlRepresentante = 'select distinct(pro.pro_codigo), pro.pro_numero, CAST(pro.pro_sumula AS varchar(1000)) as pro_sumula, tip.tippro_nome | ||
46 | + from processos pro inner join processoXrepresentante representante | ||
47 | + on pro.pro_codigo = representante.pro_codigo | ||
48 | + inner join pessoas pes | ||
49 | + on representante.pes_codigo = pes.pes_codigo | ||
50 | + inner join tipos_processos tip | ||
51 | + on tip.tippro_codigo = pro.tippro_codigo '; | ||
52 | + | ||
53 | + private $sqlRequerente = 'select distinct(pro.pro_codigo), pro.pro_numero, CAST(pro.pro_sumula AS varchar(1000)) as pro_sumula , tip.tippro_nome | ||
54 | + from processos pro inner join processoXrequerente requerente | ||
55 | + on pro.pro_codigo = requerente.pro_codigo | ||
56 | + inner join pessoas pes | ||
57 | + on requerente.pes_codigo = pes.pes_codigo | ||
58 | + inner join tipos_processos tip | ||
59 | + on tip.tippro_codigo = pro.tippro_codigo '; | ||
60 | + | ||
61 | + private $operadoUnion = ' union '; | ||
62 | + | ||
63 | + private $operadorWhere = ' where '; | ||
64 | + | ||
65 | + | ||
66 | + | ||
67 | + public function __construct(InfraIBanco $objInfraIBanco){ | ||
68 | + parent::__construct($objInfraIBanco); | ||
69 | + } | ||
70 | + | ||
71 | + | ||
72 | + public function contarPronumeroParte(ProcessoDTO $objProcessoDTO){ | ||
73 | + | ||
74 | + try { | ||
75 | + | ||
76 | + $where = $this->operadorWhere; | ||
77 | + | ||
78 | + | ||
79 | + if (!InfraString::isBolVazia($objProcessoDTO->getStrProNumero())){ | ||
80 | + $proNumero = (string)addslashes('%'.$objProcessoDTO->getStrProNumero().'%'); | ||
81 | + $where .= "pro.pro_numero like '{$proNumero}'"; | ||
82 | + | ||
83 | + } | ||
84 | + | ||
85 | + | ||
86 | + if(!InfraString::isBolVazia($objProcessoDTO->getStrProNumero()) && !InfraString::isBolVazia($objProcessoDTO->getNomeParte())){ | ||
87 | + $where .= ' and '; | ||
88 | + } | ||
89 | + | ||
90 | + if(!InfraString::isBolVazia($objProcessoDTO->getNomeParte())){ | ||
91 | + $nomeParte = (string)addslashes('%'.$objProcessoDTO->getNomeParte().'%'); | ||
92 | + $where .= "pes.pes_nome like '{$nomeParte}'"; | ||
93 | + } | ||
94 | + | ||
95 | + | ||
96 | + $sql = 'select count(*) as total from ( '. | ||
97 | + $this->sqlRepresentada . $where . $this->operadoUnion . | ||
98 | + $this->sqlRepresentante . $where . $this->operadoUnion . | ||
99 | + $this->sqlRequerente . $where . ' ) as pro_partes '; | ||
100 | + | ||
101 | + | ||
102 | + $rs = $this->getObjInfraIBanco()->consultarSql($sql); | ||
103 | + | ||
104 | + | ||
105 | + | ||
106 | + return $rs[0]['total']; | ||
107 | + | ||
108 | + | ||
109 | + | ||
110 | + | ||
111 | + } catch (Exception $e) { | ||
112 | + throw new InfraException('Error contando processos DBCade',$e); | ||
113 | + } | ||
114 | + } | ||
115 | + | ||
116 | + | ||
117 | + public function listarPaginadoPronumeroParte(ProcessoDTO $objProcessoDTO){ | ||
118 | + | ||
119 | + try { | ||
120 | + | ||
121 | + | ||
122 | + | ||
123 | + $where = $this->operadorWhere; | ||
124 | + | ||
125 | + | ||
126 | + if (!InfraString::isBolVazia($objProcessoDTO->getStrProNumero())){ | ||
127 | + $proNumero = (string)addslashes('%'.$objProcessoDTO->getStrProNumero().'%'); | ||
128 | + $where .= "pro.pro_numero like '{$proNumero}'"; | ||
129 | + | ||
130 | + } | ||
131 | + | ||
132 | + | ||
133 | + if(!InfraString::isBolVazia($objProcessoDTO->getStrProNumero()) && !InfraString::isBolVazia($objProcessoDTO->getNomeParte())){ | ||
134 | + $where .= ' and '; | ||
135 | + } | ||
136 | + | ||
137 | + if(!InfraString::isBolVazia($objProcessoDTO->getNomeParte())){ | ||
138 | + $nomeParte = (string)addslashes('%'.$objProcessoDTO->getNomeParte().'%'); | ||
139 | + $where .= "pes.pes_nome like '{$nomeParte}'"; | ||
140 | + } | ||
141 | + | ||
142 | + $inicioPaginacao = ($objProcessoDTO->getNumPaginaAtual() * $objProcessoDTO->getNumMaxRegistrosRetorno() ) + 1; | ||
143 | + $numRegistro = ($objProcessoDTO->getNumMaxRegistrosRetorno() * $objProcessoDTO->getNumPaginaAtual()) + $objProcessoDTO->getNumMaxRegistrosRetorno(); | ||
144 | + $sql = 'select identity(int,1,1) as InfraRowNumber, * INTO #InfraTabela FROM ( '. | ||
145 | + $this->sqlRepresentada . $where . $this->operadoUnion . | ||
146 | + $this->sqlRepresentante . $where . $this->operadoUnion . | ||
147 | + $this->sqlRequerente . $where . ' ) ' . | ||
148 | + 'as InfraTabela ORDER BY pro_numero ASC select *, | ||
149 | + (select count(*) from #InfraTabela ) as InfraRowCount | ||
150 | + from #InfraTabela where InfraRowNumber BETWEEN '. $inicioPaginacao . ' AND '. $numRegistro .' ORDER BY InfraRowNumber | ||
151 | + drop table #InfraTabela'; | ||
152 | + | ||
153 | + | ||
154 | + | ||
155 | + | ||
156 | + $rs = $this->getObjInfraIBanco()->consultarSql($sql); | ||
157 | + | ||
158 | + $arrObjProcessoDTO = array(); | ||
159 | + | ||
160 | + for($i = 0; $i < count($rs); $i++){ | ||
161 | + $objProcessoDTO = new ProcessoDTO(); | ||
162 | + $objProcessoDTO->setStrProNumero($rs[$i]['pro_numero']); | ||
163 | + $objProcessoDTO->setStrProSumula($rs[$i]['pro_sumula']); | ||
164 | + $objProcessoDTO->setStrTipproNome($rs[$i]['tippro_nome']); | ||
165 | + $objProcessoDTO->setNumProCodigo($rs[$i]['pro_codigo']); | ||
166 | + $arrObjProcessoDTO[] = $objProcessoDTO; | ||
167 | + } | ||
168 | + | ||
169 | + | ||
170 | + return $arrObjProcessoDTO; | ||
171 | + | ||
172 | + | ||
173 | + | ||
174 | + | ||
175 | + | ||
176 | + | ||
177 | + | ||
178 | + | ||
179 | + } catch (Exception $e) { | ||
180 | + throw new InfraException('Error listando processos DBCade',$e); | ||
181 | + } | ||
182 | + } | ||
183 | + | ||
184 | + | ||
185 | +} | ||
186 | + | ||
187 | + | ||
188 | +?> | ||
0 | \ No newline at end of file | 189 | \ No newline at end of file |
@@ -0,0 +1,92 @@ | @@ -0,0 +1,92 @@ | ||
1 | +<? | ||
2 | +/** | ||
3 | + * CONSELHO ADMINISTRATIVO DE DEFESA ECONÔMICA | ||
4 | + * 2014-09-29 | ||
5 | + * Versão do Gerador de Código: 1.0 | ||
6 | + * Versão no CVS/SVN: | ||
7 | + * | ||
8 | + * sei | ||
9 | + * pesquisa | ||
10 | + * controlador_ajax_externo | ||
11 | + * | ||
12 | + * | ||
13 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
14 | + */ | ||
15 | + | ||
16 | +/** | ||
17 | + * Arquivo para realizar controle requisição ajax. | ||
18 | + * | ||
19 | + * | ||
20 | + * @package institucional_pesquisa_controlador_ajax_externo | ||
21 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
22 | + * @license Creative Commons Atribuição 3.0 não adaptada | ||
23 | + * <http://creativecommons.org/licenses/by/3.0/deed.pt_BR> | ||
24 | + * @ignore Este código é livre para uso sem nenhuma restrição, | ||
25 | + * salvo pelas informações a seguir referentes | ||
26 | + * a @author e @copyright que devem ser mantidas inalteradas! | ||
27 | + * @copyright Conselho Administrativo de Defesa Econômica ©2014-2018 | ||
28 | + * <http://www.cade.gov.br> | ||
29 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
30 | + */ | ||
31 | + | ||
32 | +try{ | ||
33 | + require_once dirname(__FILE__).'/../../SEI.php'; | ||
34 | + | ||
35 | + //session_start(); | ||
36 | + | ||
37 | + //SessaoSEIExterna::getInstance()->validarLink(); | ||
38 | + | ||
39 | + //infraTratarErroFatal(SessaoSEIExterna::getInstance(),'controlador_externo.php?acao=infra_erro_fatal_logar'); | ||
40 | + | ||
41 | + InfraAjax::decodificarPost(); | ||
42 | + //Verificar | ||
43 | + SessaoSEIExterna::getInstance()->validarSessao(); | ||
44 | + PesquisaUtil::valiadarLink(); | ||
45 | + | ||
46 | + | ||
47 | + switch($_GET['acao_ajax_externo']){ | ||
48 | + | ||
49 | + case 'contato_auto_completar_contexto_pesquisa': | ||
50 | + | ||
51 | + //alterado para atender anatel exibir apenas nome contato | ||
52 | + $objContatoDTO = new ContatoDTO(); | ||
53 | + $objContatoDTO->retNumIdContato(); | ||
54 | + $objContatoDTO->retStrSigla(); | ||
55 | + $objContatoDTO->retStrNome(); | ||
56 | + | ||
57 | + $objContatoDTO->setStrPalavrasPesquisa($_POST['palavras_pesquisa']); | ||
58 | + | ||
59 | + if ($numIdGrupoContato!=''){ | ||
60 | + $objContatoDTO->setNumIdGrupoContato($_POST['id_grupo_contato']); | ||
61 | + } | ||
62 | + | ||
63 | + | ||
64 | + $objContatoDTO->setNumMaxRegistrosRetorno(50); | ||
65 | + $objContatoDTO->setOrdStrNome(InfraDTO::$TIPO_ORDENACAO_ASC); | ||
66 | + | ||
67 | + $objContatoRN = new ContatoRN(); | ||
68 | + | ||
69 | + $arrObjContatoDTO = $objContatoRN->pesquisarRN0471($objContatoDTO); | ||
70 | + | ||
71 | +// $arrObjContatoDTO = ContatoINT::autoCompletarContextoPesquisa($_POST['palavras_pesquisa'],$_POST['id_grupo_contato']); | ||
72 | + $xml = InfraAjax::gerarXMLItensArrInfraDTO($arrObjContatoDTO,'IdContato', 'Nome'); | ||
73 | + break; | ||
74 | + | ||
75 | + | ||
76 | + case 'unidade_auto_completar_todas': | ||
77 | + $arrObjUnidadeDTO = UnidadeINT::autoCompletarUnidades($_POST['palavras_pesquisa'],true,$_POST['id_orgao']); | ||
78 | + $xml = InfraAjax::gerarXMLItensArrInfraDTO($arrObjUnidadeDTO,'IdUnidade', 'Sigla'); | ||
79 | + break; | ||
80 | + | ||
81 | + default: | ||
82 | + throw new InfraException("Ação '".$_GET['acao_ajax_externo']."' não reconhecida pelo controlador AJAX externo."); | ||
83 | + } | ||
84 | + | ||
85 | + | ||
86 | + InfraAjax::enviarXML($xml); | ||
87 | + | ||
88 | +}catch(Exception $e){ | ||
89 | + //LogSEI::getInstance()->gravar('ERRO AJAX: '.$e->__toString()); | ||
90 | + InfraAjax::processarExcecao($e); | ||
91 | +} | ||
92 | +?> | ||
0 | \ No newline at end of file | 93 | \ No newline at end of file |
@@ -0,0 +1,243 @@ | @@ -0,0 +1,243 @@ | ||
1 | +div.infraAreaGlobal{ | ||
2 | +width: 98% !important; | ||
3 | +} | ||
4 | + | ||
5 | +div.infraBarraSistemaD{ | ||
6 | +padding-top:1em; | ||
7 | +} | ||
8 | + | ||
9 | +.protocoloAberto { | ||
10 | +color:green; | ||
11 | +} | ||
12 | + | ||
13 | +.protocoloFechado { | ||
14 | +color:red; | ||
15 | +} | ||
16 | + | ||
17 | +.protocoloNormal, | ||
18 | +.protocoloAberto, | ||
19 | +.protocoloFechado, | ||
20 | +.linkFuncionalidade { | ||
21 | +text-decoration:none; | ||
22 | +padding:.5em; | ||
23 | +font-size:1.2em !important; | ||
24 | +} | ||
25 | + | ||
26 | +a.protocoloNormal:hover, | ||
27 | +a.protocoloAberto:hover, | ||
28 | +a.protocoloFechado:hover, | ||
29 | +a.linkFuncionalidade:hover{ | ||
30 | +text-decoration:underline; | ||
31 | +} | ||
32 | + | ||
33 | +a.ancoraOpcao{ | ||
34 | +color:black; | ||
35 | +display:block; | ||
36 | +text-decoration:none; | ||
37 | +padding:.1em .2em .1em .2em; | ||
38 | +width:100%; | ||
39 | +} | ||
40 | + | ||
41 | +div.infraRotuloMenu, | ||
42 | +div.infraSetaMenu{ | ||
43 | +color:black; | ||
44 | +} | ||
45 | + | ||
46 | + | ||
47 | +div.infraMenu a{ | ||
48 | +background-color:#c7c7c7; | ||
49 | +} | ||
50 | + | ||
51 | + | ||
52 | +div.infraMenu a:hover{ | ||
53 | +background-color:white; | ||
54 | +border:.1em solid #dfdfdf; | ||
55 | +} | ||
56 | + | ||
57 | +div.tituloProcessoDocumento { | ||
58 | +padding-top:0.4em; | ||
59 | +padding-bottom:0.4em; | ||
60 | +text-align:center; | ||
61 | +vertical-align:middle; | ||
62 | +width:100%; | ||
63 | +color:#666; | ||
64 | +background-color:#dfdfdf; | ||
65 | +border-bottom:.6em solid white; | ||
66 | +overflow:hidden; | ||
67 | +} | ||
68 | + | ||
69 | +div.tituloProcessoDocumento label { | ||
70 | +font-size:1.4em; | ||
71 | +font-weight:bold; | ||
72 | +color:#666; | ||
73 | +background-color:#dfdfdf; | ||
74 | +} | ||
75 | + | ||
76 | +img.botaoSEI{ | ||
77 | +margin:.1em; | ||
78 | +border:.1em solid white; | ||
79 | +height:4em !important; | ||
80 | +width:4em !important; | ||
81 | +} | ||
82 | + | ||
83 | +img.botaoSEI:hover { | ||
84 | +border:.1em solid black; | ||
85 | +} | ||
86 | + | ||
87 | +a.ancoraSigla{ | ||
88 | + /* color:#0000CC; */ | ||
89 | + text-decoration:none; | ||
90 | + font-size:1em; | ||
91 | +} | ||
92 | + | ||
93 | +a.ancoraSigla:hover{ | ||
94 | + text-decoration:underline; | ||
95 | +} | ||
96 | + | ||
97 | +a.ancoraPadraoAzul{ | ||
98 | +padding:0 .5em 0 .5em; | ||
99 | +text-decoration:none; | ||
100 | +font-size:1.2em; | ||
101 | +color: #0066CC; | ||
102 | +} | ||
103 | + | ||
104 | +a.ancoraPadraoPreta{ | ||
105 | +padding:0 .5em 0 .5em; | ||
106 | +text-decoration:none; | ||
107 | +font-size:1.2em; | ||
108 | +color: black; | ||
109 | +} | ||
110 | + | ||
111 | +a.ancoraPadraoAzul:hover, | ||
112 | +a.ancoraPadraoPreta:hover{ | ||
113 | +text-decoration:underline; | ||
114 | +} | ||
115 | + | ||
116 | + | ||
117 | +fieldset.infraFieldset{ | ||
118 | +border:.1em solid black; | ||
119 | +} | ||
120 | + | ||
121 | +legend.infraLegend{ | ||
122 | +background-color:#e5e5e5; | ||
123 | +color:black; | ||
124 | +border:.1em solid black; | ||
125 | +} | ||
126 | + | ||
127 | +label.infraLabelOpcional, | ||
128 | +label.infraLabelObrigatorio, | ||
129 | +label.infraLabelCheckbox, | ||
130 | +label.infraLabelRadio{ | ||
131 | +color:black; | ||
132 | +} | ||
133 | + | ||
134 | +label.infraLabelObrigatorio span.infraTeclaAtalho{ | ||
135 | +color:black; | ||
136 | +} | ||
137 | + | ||
138 | +label.infraLabelOpcional span.infraTeclaAtalho{ | ||
139 | +color:black; | ||
140 | +} | ||
141 | + | ||
142 | +span.infraTeclaAtalho{ | ||
143 | +color:black; | ||
144 | +} | ||
145 | + | ||
146 | +a.ancoraHistoricoProcesso{ | ||
147 | +font-size:1em; | ||
148 | +} | ||
149 | + | ||
150 | +a.ancoraVisualizacaoDocumento{ | ||
151 | +font-size:1em; | ||
152 | +} | ||
153 | + | ||
154 | +input.infraButton, button.infraButton{ | ||
155 | +border-color: #666 #666 #666 #666; | ||
156 | +color:black; | ||
157 | +} | ||
158 | + | ||
159 | +input.infraButton span.infraTeclaAtalho, | ||
160 | +button.infraButton span.infraTeclaAtalho{ | ||
161 | +color:black; | ||
162 | +} | ||
163 | + | ||
164 | +label.infraLabelObrigatorio span.infraTeclaAtalho{ | ||
165 | +color:black; | ||
166 | +} | ||
167 | + | ||
168 | +.divItemCelula{ | ||
169 | + padding:.2em 0 .2em 0; | ||
170 | +} | ||
171 | + | ||
172 | +span.spanItemCelula{ | ||
173 | + float:left; | ||
174 | + border:.1em solid transparent; | ||
175 | +} | ||
176 | + | ||
177 | +.divDiamante{ | ||
178 | + float:left; | ||
179 | + width:5%; | ||
180 | + border:.1em solid transparent; | ||
181 | +} | ||
182 | + | ||
183 | + | ||
184 | +table.infraTable img.infraImg, | ||
185 | +table.infraTable img.infraImgNormal, | ||
186 | +table.infraTable img.infraImgOpaca{ | ||
187 | +padding:0 .2em 0 .2em; | ||
188 | +} | ||
189 | + | ||
190 | +caption.infraCaption{ | ||
191 | +color: black; | ||
192 | +} | ||
193 | + | ||
194 | +tr.totalEstatisticas { | ||
195 | +background-color:#ffffdd; | ||
196 | +} | ||
197 | + | ||
198 | +td.totalEstatisticas { | ||
199 | +background-color:#ffffdd; | ||
200 | +} | ||
201 | + | ||
202 | +div.divAreaGrafico { | ||
203 | +float:left; | ||
204 | +/* width:100%; */ | ||
205 | +overflow:auto !important; | ||
206 | +padding-top:.5em; | ||
207 | +padding-bottom:1.5em; | ||
208 | +font-size:1.2em; | ||
209 | +} | ||
210 | + | ||
211 | +/* ******************** */ | ||
212 | +.infraDivCheckbox{ | ||
213 | +} | ||
214 | + | ||
215 | +.infraDivRadio{ | ||
216 | +} | ||
217 | + | ||
218 | +.infraDivCheckbox input, | ||
219 | +.infraDivRadio input{ | ||
220 | +float:left; | ||
221 | +} | ||
222 | + | ||
223 | +.infraDivCheckbox label, | ||
224 | +.infraDivRadio label{ | ||
225 | +float:left; | ||
226 | +padding-left:.2em; | ||
227 | +} | ||
228 | + | ||
229 | +.infraDivCheckbox label{ | ||
230 | +line-height:1.8em; | ||
231 | +} | ||
232 | + | ||
233 | +.infraDivRadio label{ | ||
234 | +line-height:1.6em; | ||
235 | +} | ||
236 | + | ||
237 | +tr.trVermelha{ | ||
238 | +background-color:#f59f9f; | ||
239 | +} | ||
240 | + | ||
241 | +button.buttonWorkflow{ | ||
242 | +border: .1em solid red; | ||
243 | +} |
@@ -0,0 +1,280 @@ | @@ -0,0 +1,280 @@ | ||
1 | +<? | ||
2 | +/** | ||
3 | + * CONSELHO ADMINISTRATIVO DE DEFESA ECONÔMICA | ||
4 | +* | ||
5 | +* 03/10/2014 - criado por alex braga | ||
6 | +* | ||
7 | +* Versão do Gerador de Código: | ||
8 | +* | ||
9 | +* Versão no CVS: | ||
10 | +*/ | ||
11 | + | ||
12 | +try { | ||
13 | + require_once dirname(__FILE__).'/../../SEI.php'; | ||
14 | + require_once ("ConverteURI.php"); | ||
15 | + | ||
16 | + SessaoSEIExterna::getInstance()->validarSessao(); | ||
17 | + //session_start(); | ||
18 | + | ||
19 | + ////////////////////////////////////////////////////////////////////////////// | ||
20 | + //InfraDebug::getInstance()->setBolLigado(false); | ||
21 | + //InfraDebug::getInstance()->setBolDebugInfra(false); | ||
22 | + //InfraDebug::getInstance()->limpar(); | ||
23 | + ////////////////////////////////////////////////////////////////////////////// | ||
24 | + ConverteURI::converterURI(); | ||
25 | + PesquisaUtil::valiadarLink(); | ||
26 | +// if (isset($_GET['id_acesso_externo'])){ | ||
27 | +// SessaoSEIExterna::getInstance($_GET['id_acesso_externo'])->validarLink(); | ||
28 | +// }else{ | ||
29 | +// // SessaoSEIExterna::getInstance()->validarLink(); | ||
30 | +// } | ||
31 | + | ||
32 | + $objParametroPesquisaDTO = new ParametroPesquisaDTO(); | ||
33 | + $objParametroPesquisaDTO->retStrNome(); | ||
34 | + $objParametroPesquisaDTO->retStrValor(); | ||
35 | + | ||
36 | + $objParametroPesquisaRN = new ParametroPesquisaRN(); | ||
37 | + $arrObjParametroPesquisaDTO = $objParametroPesquisaRN->listar($objParametroPesquisaDTO); | ||
38 | + | ||
39 | + $arrParametroPesquisaDTO = InfraArray::converterArrInfraDTO($arrObjParametroPesquisaDTO,'Valor','Nome'); | ||
40 | + | ||
41 | + $bolListaDocumentoProcessoRestrito = $arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_LISTA_DOCUMENTO_PROCESSO_RESTRITO] == 'S' ? true : false; | ||
42 | + $bolListaDocumentoProcessoPublico = $arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_LISTA_DOCUMENTO_PROCESSO_PUBLICO] == 'S' ? true : false; | ||
43 | + | ||
44 | + $objDocumentoDTO = new DocumentoDTO(); | ||
45 | + $objDocumentoDTO->retDblIdDocumento(); | ||
46 | + $objDocumentoDTO->retDblIdProcedimento(); | ||
47 | + $objDocumentoDTO->retStrConteudo(); | ||
48 | + $objDocumentoDTO->retStrNomeSerie(); | ||
49 | + $objDocumentoDTO->retStrStaDocumento(); | ||
50 | + $objDocumentoDTO->retStrSiglaUnidadeGeradoraProtocolo(); | ||
51 | + $objDocumentoDTO->retStrProtocoloDocumentoFormatado(); | ||
52 | + $objDocumentoDTO->retStrStaProtocoloProtocolo(); | ||
53 | + $objDocumentoDTO->retDblIdDocumentoEdoc(); | ||
54 | + $objDocumentoDTO->retStrStaEstadoProtocolo(); | ||
55 | + // $objDocumentoDTO->retStrSinAssinaturaBloqueada(); | ||
56 | + $objDocumentoDTO->retNumIdUnidadeGeradoraProtocolo(); | ||
57 | + $objDocumentoDTO->retStrStaNivelAcessoGlobalProtocolo(); | ||
58 | + $objDocumentoDTO->retStrStaNivelAcessoLocalProtocolo(); | ||
59 | + $objDocumentoDTO->setDblIdDocumento($_GET['id_documento']); | ||
60 | + | ||
61 | + $objDocumentoRN = new DocumentoRN(); | ||
62 | + $objDocumentoDTO = $objDocumentoRN->consultarRN0005($objDocumentoDTO); | ||
63 | + | ||
64 | + | ||
65 | + | ||
66 | + if ($objDocumentoDTO==null){ | ||
67 | + die('Documento não encontrado.'); | ||
68 | + } | ||
69 | + | ||
70 | + if(!$bolListaDocumentoProcessoPublico){ | ||
71 | + die('Documento não encontrado'); | ||
72 | + } | ||
73 | + | ||
74 | + $objProtocoloProcedimentoDTO = new ProtocoloDTO(); | ||
75 | + $objProtocoloProcedimentoDTO->setDblIdProtocolo($objDocumentoDTO->getDblIdProcedimento()); | ||
76 | + $objProtocoloProcedimentoDTO->retStrStaNivelAcessoLocal(); | ||
77 | + $objProtocoloProcedimentoDTO->retStrStaNivelAcessoGlobal(); | ||
78 | + | ||
79 | + $objProtocoloRN = new ProtocoloRN(); | ||
80 | + $objProtocoloProcedimentoDTO = $objProtocoloRN->consultarRN0186($objProtocoloProcedimentoDTO); | ||
81 | + | ||
82 | + if($objProtocoloProcedimentoDTO != null && $objProtocoloProcedimentoDTO->getStrStaNivelAcessoLocal() != ProtocoloRN::$NA_PUBLICO){ | ||
83 | + die('Documento não encontrado.'); | ||
84 | + } | ||
85 | + | ||
86 | + if ($objDocumentoDTO->getStrStaEstadoProtocolo()==ProtocoloRN::$TE_DOCUMENTO_CANCELADO){ | ||
87 | + die('Documento '.$objDocumentoDTO->getStrProtocoloDocumentoFormatado().' foi cancelado.'); | ||
88 | + } | ||
89 | + | ||
90 | + if(!$bolListaDocumentoProcessoRestrito){ | ||
91 | + if ($objDocumentoDTO->getStrStaNivelAcessoGlobalProtocolo()!= ProtocoloRN::$NA_PUBLICO){ | ||
92 | + die('Documento não encontrado.'); | ||
93 | + } | ||
94 | + } | ||
95 | + | ||
96 | + | ||
97 | + | ||
98 | + if($bolListaDocumentoProcessoRestrito){ | ||
99 | + | ||
100 | + if($objDocumentoDTO->getStrStaNivelAcessoGlobalProtocolo() == ProtocoloRN::$NA_SIGILOSO || $objDocumentoDTO->getStrStaNivelAcessoLocalProtocolo() != ProtocoloRN::$NA_PUBLICO){ | ||
101 | + | ||
102 | + die('Documento não encontrado.'); | ||
103 | + | ||
104 | + } | ||
105 | + } | ||
106 | + | ||
107 | + // Exibe apenas documentos de processos públicos. | ||
108 | + | ||
109 | + | ||
110 | + //Carregar dados do cabeçalho | ||
111 | + $objProcedimentoDTO = new ProcedimentoDTO(); | ||
112 | + $objProcedimentoDTO->setDblIdProcedimento($objDocumentoDTO->getDblIdProcedimento()); | ||
113 | + $objProcedimentoDTO->setStrSinDocTodos('S'); | ||
114 | + $objProcedimentoDTO->setArrDblIdProtocoloAssociado(array($objDocumentoDTO->getDblIdDocumento())); | ||
115 | + | ||
116 | + $objProcedimentoRN = new ProcedimentoRN(); | ||
117 | + $arr = $objProcedimentoRN->listarCompleto($objProcedimentoDTO); | ||
118 | + | ||
119 | + if (count($arr)==0){ | ||
120 | + die('Processo não encontrado.'); | ||
121 | + } | ||
122 | + | ||
123 | + $objAcessoExternoRN = new AcessoExternoRN(); | ||
124 | + | ||
125 | + $objProcedimentoDTO = $arr[0]; | ||
126 | + $bolFlag = false; | ||
127 | + foreach($objProcedimentoDTO->getArrObjDocumentoDTO() as $dto){ | ||
128 | + if ($dto->getDblIdDocumento() == $objDocumentoDTO->getDblIdDocumento()){ | ||
129 | + if (SessaoSEIExterna::getInstance()->getNumIdUsuarioExterno()==null){ | ||
130 | + if (!$objDocumentoRN->verificarSelecaoAcessoExterno($dto)){ | ||
131 | + if ($dto->getStrStaProtocoloProtocolo()==ProtocoloRN::$TP_DOCUMENTO_GERADO && $dto->getStrSinAssinado()=='N'){ | ||
132 | + die('Documento '.$objDocumentoDTO->getStrProtocoloDocumentoFormatado().' ainda não foi assinado.'); | ||
133 | + }else{ | ||
134 | + die('Documento '.$objDocumentoDTO->getStrProtocoloDocumentoFormatado().' não está disponível para visualização externa.'); | ||
135 | + } | ||
136 | + } | ||
137 | + }else{ | ||
138 | + | ||
139 | + if (!$objDocumentoRN->verificarSelecaoAcessoExterno($dto)){ | ||
140 | + | ||
141 | + if ($dto->getStrStaProtocoloProtocolo()!=ProtocoloRN::$TP_DOCUMENTO_GERADO){ | ||
142 | + die('Documento '.$objDocumentoDTO->getStrProtocoloDocumentoFormatado().' não está disponível para visualização externa.'); | ||
143 | + }else{ | ||
144 | + | ||
145 | + $objAcessoExternoDTO = new AcessoExternoDTO(); | ||
146 | + $objAcessoExternoDTO->setDblIdDocumento($_GET['id_documento']); | ||
147 | + $objAcessoExternoDTO->setNumIdAcessoExterno($_GET['id_acesso_externo_assinatura']); | ||
148 | + | ||
149 | + if ($objAcessoExternoRN->contar($objAcessoExternoDTO)==0){ | ||
150 | + | ||
151 | + if ($dto->getStrSinAssinado()=='N'){ | ||
152 | + die('Documento '.$objDocumentoDTO->getStrProtocoloDocumentoFormatado().' ainda não foi assinado.'); | ||
153 | + }else{ | ||
154 | + die('Documento '.$objDocumentoDTO->getStrProtocoloDocumentoFormatado().' não está disponível para assinatura externa.'); | ||
155 | + } | ||
156 | + | ||
157 | + } | ||
158 | + } | ||
159 | + } | ||
160 | + | ||
161 | + } | ||
162 | + $bolFlag = true; | ||
163 | + break; | ||
164 | + } | ||
165 | + } | ||
166 | + | ||
167 | + if (!$bolFlag){ | ||
168 | + die('Documento não encontrado no processo.'); | ||
169 | + } | ||
170 | + | ||
171 | + $strTitulo = $objDocumentoDTO->getStrNomeSerie().' '.$objDocumentoDTO->getStrSiglaUnidadeGeradoraProtocolo().' '.$objDocumentoDTO->getStrProtocoloDocumentoFormatado(); | ||
172 | + | ||
173 | + if ($objDocumentoDTO->getStrStaDocumento()==DocumentoRN::$TD_EDITOR_EDOC){ | ||
174 | + if ($objDocumentoDTO->getDblIdDocumentoEdoc()!=null){ | ||
175 | + | ||
176 | + $objDocumentoRN->bloquearAssinaturaVisualizada($objDocumentoDTO); | ||
177 | + | ||
178 | + $objEDocRN = new EDocRN(); | ||
179 | + //echo EDocINT::montarVisualizacaoDocumento($objDocumentoDTO->getDblIdDocumentoEdoc()); | ||
180 | + echo $objEDocRN->consultarHTMLDocumentoRN1204($objDocumentoDTO); | ||
181 | + | ||
182 | + }else{ | ||
183 | + echo 'Documento sem conteúdo.'; | ||
184 | + } | ||
185 | + }else if ($objDocumentoDTO->getStrStaDocumento()==DocumentoRN::$TD_EDITOR_INTERNO){ | ||
186 | + $objEditorDTO = new EditorDTO(); | ||
187 | + $objEditorDTO->setDblIdDocumento($objDocumentoDTO->getDblIdDocumento()); | ||
188 | + $objEditorDTO->setNumIdBaseConhecimento(null); | ||
189 | + $objEditorDTO->setStrSinCabecalho('S'); | ||
190 | + $objEditorDTO->setStrSinRodape('S'); | ||
191 | + $objEditorDTO->setStrSinIdentificacaoVersao('N'); | ||
192 | + | ||
193 | + $objEditorRN = new EditorRN(); | ||
194 | + echo $objEditorRN->consultarHtmlVersao($objEditorDTO); | ||
195 | + | ||
196 | + }else if (isset($_GET['id_anexo'])){ | ||
197 | + | ||
198 | + $objDocumentoRN->bloquearAssinaturaVisualizada($objDocumentoDTO); | ||
199 | + | ||
200 | + $objAnexoDTO = new AnexoDTO(); | ||
201 | + $objAnexoDTO->retNumIdAnexo(); | ||
202 | + $objAnexoDTO->retStrNome(); | ||
203 | + $objAnexoDTO->setNumIdAnexo($_GET['id_anexo']); | ||
204 | + $objAnexoDTO->retDthInclusao(); | ||
205 | + | ||
206 | + $objAnexoRN = new AnexoRN(); | ||
207 | + $objAnexoDTO = $objAnexoRN->consultarRN0736($objAnexoDTO); | ||
208 | + | ||
209 | + header("Pragma: public"); // required | ||
210 | + header('Pragma: no-cache'); | ||
211 | + header("Expires: 0"); | ||
212 | + header("Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0"); | ||
213 | + header("Cache-Control: private","false"); // required for certain browsers | ||
214 | + | ||
215 | + PaginaSEIExterna::getInstance()->montarHeaderDownload($objAnexoDTO->getStrNome()); | ||
216 | + | ||
217 | + $fp = fopen($objAnexoRN->obterLocalizacao($objAnexoDTO), "rb"); | ||
218 | + while (!feof($fp)) { | ||
219 | + echo fread($fp, TAM_BLOCO_LEITURA_ARQUIVO); | ||
220 | + } | ||
221 | + fclose($fp); | ||
222 | + | ||
223 | + | ||
224 | + }else if ($objDocumentoDTO->getStrStaProtocoloProtocolo()==ProtocoloRN::$TP_DOCUMENTO_RECEBIDO){ | ||
225 | + | ||
226 | + // $objDocumentoRN->bloquearAssinaturaVisualizada($objDocumentoDTO); | ||
227 | + | ||
228 | + | ||
229 | + $objAnexoDTO = new AnexoDTO(); | ||
230 | + $objAnexoDTO->retNumIdAnexo(); | ||
231 | + $objAnexoDTO->retStrNome(); | ||
232 | + $objAnexoDTO->retNumIdAnexo(); | ||
233 | + $objAnexoDTO->setDblIdProtocolo($objDocumentoDTO->getDblIdDocumento()); | ||
234 | + $objAnexoDTO->retDblIdProtocolo(); | ||
235 | + $objAnexoDTO->retDthInclusao(); | ||
236 | + | ||
237 | + $objAnexoRN = new AnexoRN(); | ||
238 | + $arrObjAnexoDTO = $objAnexoRN->listarRN0218($objAnexoDTO); | ||
239 | + | ||
240 | + if (count($arrObjAnexoDTO)!=1){ | ||
241 | + $strResultado = ''; | ||
242 | + }else{ | ||
243 | + $objAnexoDTO = $arrObjAnexoDTO[0]; | ||
244 | + | ||
245 | + header("Pragma: public"); | ||
246 | + header('Pragma: no-cache'); | ||
247 | + header("Expires: 0"); | ||
248 | + header("Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0"); | ||
249 | + header("Cache-Control: private","false"); | ||
250 | + | ||
251 | + PaginaSEI::getInstance()->montarHeaderDownload($objAnexoDTO->getStrNome()); | ||
252 | + | ||
253 | + $fp = fopen($objAnexoRN->obterLocalizacao($objAnexoDTO), "rb"); | ||
254 | + while (!feof($fp)) { | ||
255 | + echo fread($fp, TAM_BLOCO_LEITURA_ARQUIVO); | ||
256 | + } | ||
257 | + fclose($fp); | ||
258 | + | ||
259 | + } | ||
260 | + | ||
261 | + }else{ | ||
262 | + echo '<html>'; | ||
263 | + echo '<head>'; | ||
264 | + echo '<title>:: '.PaginaSEIExterna::getInstance()->getStrNomeSistema().' - '.$strTitulo.' ::</title>'; | ||
265 | + echo '</head>'; | ||
266 | + echo '<body>'; | ||
267 | + //echo DocumentoINT::formatarExibicaoConteudo(DocumentoINT::$TV_HTML, $objDocumentoDTO->getStrConteudo(), PaginaSEIExterna::getInstance(), SessaoSEIExterna::getInstance(), 'documento_consulta_externa.php?id_acesso_externo='.$_GET['id_acesso_externo'].'&id_documento='.$_GET['id_documento']); | ||
268 | + echo DocumentoExternoINT::formatarExibicaoConteudo(DocumentoINT::$TV_HTML, $objDocumentoDTO->getStrConteudo(), PaginaSEIExterna::getInstance(), SessaoSEIExterna::getInstance(), ''); | ||
269 | + echo '</body>'; | ||
270 | + echo '</html>'; | ||
271 | + } | ||
272 | + | ||
273 | + $objDocumentoDTO->unSetStrConteudo(); | ||
274 | + AuditoriaSEI::getInstance()->auditar('documento_consulta_externa',__FILE__,$objDocumentoDTO); | ||
275 | + | ||
276 | +}catch(Exception $e){ | ||
277 | + try{ LogSEI::getInstance()->gravar(InfraException::inspecionar($e)); }catch(Exception $e2){} | ||
278 | + die('Erro consultando documento em acesso externo.'); | ||
279 | +} | ||
280 | +?> | ||
0 | \ No newline at end of file | 281 | \ No newline at end of file |
@@ -0,0 +1,33 @@ | @@ -0,0 +1,33 @@ | ||
1 | +<? | ||
2 | +/** | ||
3 | +* CONSELHO ADMINISTRATIVO DE DEFESA ECONOMICA | ||
4 | +* | ||
5 | +* 29/11/2016 - criado por alex | ||
6 | +* | ||
7 | +* Versão do Gerador de Código: 1.39.0 | ||
8 | +*/ | ||
9 | + | ||
10 | +require_once dirname(__FILE__).'/../../../SEI.php'; | ||
11 | + | ||
12 | +class ParametroPesquisaDTO extends InfraDTO { | ||
13 | + | ||
14 | + public function getStrNomeTabela() { | ||
15 | + return 'md_parametro_pesquisa'; | ||
16 | + } | ||
17 | + | ||
18 | + public function montar() { | ||
19 | + | ||
20 | + $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_STR, | ||
21 | + 'Nome', | ||
22 | + 'nome'); | ||
23 | + | ||
24 | + $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_STR, | ||
25 | + 'Valor', | ||
26 | + 'valor'); | ||
27 | + | ||
28 | + $this->configurarPK('Nome', InfraDTO::$TIPO_PK_INFORMADO); | ||
29 | + | ||
30 | + } | ||
31 | + | ||
32 | +} | ||
33 | +?> |
sei/web/modulos/pesquisa/dto/ProtocoloPesquisaPublicaDTO.php
0 → 100644
@@ -0,0 +1,65 @@ | @@ -0,0 +1,65 @@ | ||
1 | +<? | ||
2 | +/** | ||
3 | + * CONSELHO ADMINISTRATIVO DE DEFESA ECONÔMICA | ||
4 | + * 2014-09-29 | ||
5 | + * Versão do Gerador de Código: 1.0 | ||
6 | + * Versão no CVS/SVN: | ||
7 | + * | ||
8 | + * sei | ||
9 | + * pesquisa | ||
10 | + * Processo DTO | ||
11 | + * | ||
12 | + * | ||
13 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
14 | + */ | ||
15 | + | ||
16 | +/** | ||
17 | + * Classe mantem dados processo DBCade. | ||
18 | + * | ||
19 | + * | ||
20 | + * @package institucional_pesquisa_processo_pesquisar | ||
21 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
22 | + * @license Creative Commons Atribuição 3.0 não adaptada | ||
23 | + * <http://creativecommons.org/licenses/by/3.0/deed.pt_BR> | ||
24 | + * @ignore Este código é livre para uso sem nenhuma restrição, | ||
25 | + * salvo pelas informações a seguir referentes | ||
26 | + * @copyright Conselho Administrativo de Defesa Econômica ©2014-2018 | ||
27 | + * <http://www.cade.gov.br> | ||
28 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
29 | + */ | ||
30 | + | ||
31 | + | ||
32 | +require_once dirname(__FILE__).'/../../../SEI.php'; | ||
33 | + | ||
34 | +class ProtocoloPesquisaPublicaDTO extends InfraDTO { | ||
35 | + | ||
36 | + | ||
37 | + | ||
38 | + public function getStrNomeTabela(){ | ||
39 | + return null; | ||
40 | + } | ||
41 | + | ||
42 | + | ||
43 | + | ||
44 | + public function montar(){ | ||
45 | + | ||
46 | + $this->adicionarAtributo(InfraDTO::$PREFIXO_STR, 'NumeroSEI'); | ||
47 | + $this->adicionarAtributo(InfraDTO::$PREFIXO_STR, 'TipoDocumento'); | ||
48 | + $this->adicionarAtributo(InfraDTO::$PREFIXO_DTA, 'Documento'); | ||
49 | + $this->adicionarAtributo(InfraDTO::$PREFIXO_DTA, 'Registro'); | ||
50 | + $this->adicionarAtributo(InfraDTO::$PREFIXO_STR, 'Unidade' ); | ||
51 | + $this->adicionarAtributo(InfraDTO::$PREFIXO_STR, 'StaAssociacao'); | ||
52 | + $this->adicionarAtributo(InfraDTO::$PREFIXO_OBJ, 'DocumentoDTO'); | ||
53 | + $this->adicionarAtributo(InfraDTO::$PREFIXO_OBJ, 'ProcedimentoDTO'); | ||
54 | + | ||
55 | + | ||
56 | + | ||
57 | + | ||
58 | + } | ||
59 | + | ||
60 | + | ||
61 | + | ||
62 | + | ||
63 | + | ||
64 | + | ||
65 | +} |
No preview for this file type
@@ -0,0 +1,275 @@ | @@ -0,0 +1,275 @@ | ||
1 | +function partialFields() { | ||
2 | + var contador; | ||
3 | + var erro = false; | ||
4 | + var idUnidadeAberto; | ||
5 | + var mtName; | ||
6 | + var mtValue; | ||
7 | + var partFields = document.getElementById("partialfields"); | ||
8 | + for (x = 0; x < mt.length; x++) { | ||
9 | + mtName = mt[x][0]; | ||
10 | + if (document.getElementById(mt[x][1]).tagName.toLowerCase() == "input") | ||
11 | + mtValue = utf8Encode(formatarCaracteresEspeciais(removerAcentos(trim(document | ||
12 | + .getElementById(mt[x][1]).value)))); | ||
13 | + else if (document.getElementById(mt[x][1]).tagName.toLowerCase() == "select") { | ||
14 | + mtValue = utf8Encode(trim(document.getElementById(mt[x][1]).options[document | ||
15 | + .getElementById(mt[x][1]).selectedIndex].value)); | ||
16 | + } | ||
17 | + switch (mtName) { | ||
18 | + case "protocolo_formatado_pesquisa": | ||
19 | + mtValue = mtValue.replace(/[^0-9]/g, ""); | ||
20 | + if (mtValue.length > 0 && mtValue.toUpperCase() != "NULL") { | ||
21 | + if (partFields.value.length > 0) { | ||
22 | + partFields.value += " AND "; | ||
23 | + } | ||
24 | + partFields.value += mtName + ":*;" + mtValue + ";*"; | ||
25 | + } | ||
26 | + break; | ||
27 | + default: | ||
28 | + if (mtValue.length > 0 && mtValue.toUpperCase() != "NULL") { | ||
29 | + var bolCampoMultiplo = false; | ||
30 | + if (mtName == 'id_participante' || mtName == 'id_assunto' | ||
31 | + || mtName == 'id_unidade_acesso' | ||
32 | + || mtName == 'id_unidade_aberto' | ||
33 | + || mtName == 'id_assinante') { | ||
34 | + bolCampoMultiplo = true; | ||
35 | + } | ||
36 | + if (partFields.value.length > 0) { | ||
37 | + partFields.value += " AND "; | ||
38 | + } | ||
39 | + if (bolCampoMultiplo) { | ||
40 | + if(mtName == 'id_participante'){ | ||
41 | + partFields.value += mtName + ":(" + mtValue + ")"; | ||
42 | + }else{ | ||
43 | + partFields.value += mtName + ":*" + mtValue + "*"; | ||
44 | + } | ||
45 | + } else { | ||
46 | + | ||
47 | + if(mtName == 'id_participante'){ | ||
48 | + partFields.value += mtName + ":(" + mtValue +")"; | ||
49 | + }else{ | ||
50 | + partFields.value += mtName + ":" + mtValue; | ||
51 | + } | ||
52 | + | ||
53 | + | ||
54 | + } | ||
55 | + } | ||
56 | + break; | ||
57 | + } | ||
58 | + } | ||
59 | + // SIGLAS DOS USU�RIOS | ||
60 | + var strVerificacao = removerAcentos(trim(document | ||
61 | + .getElementById("hdnSiglasUsuarios").value)); | ||
62 | + if (strVerificacao != '') { | ||
63 | + var siglas = strVerificacao.split(','); | ||
64 | + if (siglas.length > 0) { | ||
65 | + if (partFields.value.length > 0) { | ||
66 | + partFields.value += " AND "; | ||
67 | + } | ||
68 | + partFields.value += "(sigla_usuario_gerador:" | ||
69 | + + siglas.join(" OR sigla_usuario_gerador:") + ")"; | ||
70 | + } | ||
71 | + } | ||
72 | + // CHECKBOX DO PESQUISAR EM | ||
73 | + for (contador = 0; contador < mtCheckbox.length; contador += 1) { | ||
74 | + var campo; | ||
75 | + var campos; | ||
76 | + var dados = []; | ||
77 | + for (campos = 1; campos < mtCheckbox[contador].length; campos += 1) { | ||
78 | + campo = document.getElementById(mtCheckbox[contador][campos]); | ||
79 | + if (campo.checked) { | ||
80 | + dados.push(campo.value); | ||
81 | + } | ||
82 | + } | ||
83 | + if (dados.length > 0) { | ||
84 | + if (partFields.value.length > 0) { | ||
85 | + partFields.value += " AND "; | ||
86 | + } | ||
87 | + partFields.value += mtCheckbox[contador][0] + ":" + dados.join(";"); | ||
88 | + } | ||
89 | + } | ||
90 | + var dataInicio = infraTrim(document.getElementById('txtDataInicio').value); | ||
91 | + var dataFim = infraTrim(document.getElementById('txtDataFim').value); | ||
92 | + if (dataInicio != '' || dataFim != '') { | ||
93 | + if (dataInicio != '' | ||
94 | + && !infraValidarData(document.getElementById('txtDataInicio'))) { | ||
95 | + return false; | ||
96 | + } | ||
97 | + if (dataFim != '' | ||
98 | + && !infraValidarData(document.getElementById('txtDataFim'))) { | ||
99 | + return false; | ||
100 | + } | ||
101 | + if (dataInicio != '' && dataFim != '' | ||
102 | + && infraCompararDatas(dataInicio, dataFim) < 0) { | ||
103 | + alert('Per�odo de datas inv�lido.'); | ||
104 | + document.getElementById('txtDataInicio').focus(); | ||
105 | + return false; | ||
106 | + } | ||
107 | + var dia1 = dataInicio.substr(0, 2); | ||
108 | + var mes1 = dataInicio.substr(3, 2); | ||
109 | + var ano1 = dataInicio.substr(6, 4); | ||
110 | + var dia2 = dataFim.substr(0, 2); | ||
111 | + var mes2 = dataFim.substr(3, 2); | ||
112 | + var ano2 = dataFim.substr(6, 4); | ||
113 | + if (partFields.value.length > 0) { | ||
114 | + partFields.value += " AND "; | ||
115 | + } | ||
116 | + if (dataInicio != '' && dataFim != '') { | ||
117 | + partFields.value += 'dta_geracao:[' + ano1 + '-' + mes1 + '-' | ||
118 | + + dia1 + 'T00:00:00Z TO ' + ano2 + '-' + mes2 + '-' + dia2 | ||
119 | + + 'T00:00:00Z]'; | ||
120 | + } else if (dataInicio != '') { | ||
121 | + partFields.value += 'dta_geracao:"' + ano1 + '-' + mes1 + '-' | ||
122 | + + dia1 + 'T00:00:00Z"'; | ||
123 | + } else { | ||
124 | + partFields.value += 'dta_geracao:"' + ano2 + '-' + mes2 + '-' | ||
125 | + + dia2 + 'T00:00:00Z"'; | ||
126 | + } | ||
127 | + } | ||
128 | + return true; | ||
129 | +} | ||
130 | + | ||
131 | + | ||
132 | +function partialFieldsAutoCompletarInteressado() { | ||
133 | + var contador; | ||
134 | + var erro = false; | ||
135 | + var idUnidadeAberto; | ||
136 | + var mtName; | ||
137 | + var mtValue; | ||
138 | + var partFields = document.getElementById("partialfields"); | ||
139 | + | ||
140 | + for (x = 0; x < mt.length; x++) { | ||
141 | + mtName = mt[x][0]; | ||
142 | + | ||
143 | + if (document.getElementById(mt[x][1]).tagName.toLowerCase() == "input") | ||
144 | + mtValue = utf8Encode(formatarCaracteresEspeciais(removerAcentos(trim(document.getElementById(mt[x][1]).value)))); | ||
145 | + else if (document.getElementById(mt[x][1]).tagName.toLowerCase() == "select") { | ||
146 | + mtValue = utf8Encode(trim(document.getElementById(mt[x][1]).options[document.getElementById(mt[x][1]).selectedIndex].value)); | ||
147 | + } | ||
148 | + | ||
149 | + switch (mtName) { | ||
150 | + | ||
151 | + case "protocolo_formatado_pesquisa": | ||
152 | + | ||
153 | + mtValue = mtValue.replace(/[^0-9]/g, ""); | ||
154 | + | ||
155 | + if (mtValue.length > 0 && mtValue.toUpperCase() != "NULL") { | ||
156 | + if (partFields.value.length > 0) { | ||
157 | + partFields.value += " AND "; | ||
158 | + } | ||
159 | + partFields.value += mtName + ":*;" + mtValue +";*"; | ||
160 | + } | ||
161 | + break; | ||
162 | + | ||
163 | + default: | ||
164 | + if (mtValue.length > 0 && mtValue.toUpperCase() != "NULL") { | ||
165 | + | ||
166 | + var bolCampoMultiplo = false; | ||
167 | + | ||
168 | + if (mtName == 'id_participante' || | ||
169 | + mtName == 'id_assunto' || | ||
170 | + mtName == 'id_unidade_acesso' || | ||
171 | + mtName == 'id_unidade_aberto' || | ||
172 | + mtName == 'id_assinante'){ | ||
173 | + | ||
174 | + bolCampoMultiplo = true; | ||
175 | + } | ||
176 | + | ||
177 | + if (partFields.value.length > 0) { | ||
178 | + partFields.value += " AND "; | ||
179 | + } | ||
180 | + if (bolCampoMultiplo){ | ||
181 | + partFields.value += mtName + ":*" + mtValue + "*"; | ||
182 | + }else{ | ||
183 | + partFields.value += mtName + ":" + mtValue; | ||
184 | + } | ||
185 | + | ||
186 | + } | ||
187 | + | ||
188 | + break; | ||
189 | + } | ||
190 | + | ||
191 | + | ||
192 | + } | ||
193 | + | ||
194 | + | ||
195 | + // SIGLAS DOS USU�RIOS | ||
196 | + var strVerificacao = removerAcentos(trim(document.getElementById("hdnSiglasUsuarios").value)); | ||
197 | + | ||
198 | + if (strVerificacao != ''){ | ||
199 | + | ||
200 | + var siglas = strVerificacao.split(','); | ||
201 | + | ||
202 | + if (siglas.length > 0) { | ||
203 | + if (partFields.value.length > 0) { | ||
204 | + partFields.value += " AND "; | ||
205 | + } | ||
206 | + partFields.value += "(sigla_usuario_gerador:" + siglas.join(" OR sigla_usuario_gerador:") + ")"; | ||
207 | + } | ||
208 | + } | ||
209 | + | ||
210 | + // CHECKBOX DO PESQUISAR EM | ||
211 | + | ||
212 | + for (contador = 0; contador < mtCheckbox.length; contador += 1) { | ||
213 | + var campo; | ||
214 | + var campos; | ||
215 | + var dados = []; | ||
216 | + | ||
217 | + for (campos = 1; campos < mtCheckbox[contador].length; campos += 1) { | ||
218 | + campo = document.getElementById(mtCheckbox[contador][campos]); | ||
219 | + | ||
220 | + if (campo.checked) { | ||
221 | + dados.push(campo.value); | ||
222 | + } | ||
223 | + } | ||
224 | + | ||
225 | + if (dados.length > 0) { | ||
226 | + if (partFields.value.length > 0) { | ||
227 | + partFields.value += " AND "; | ||
228 | + } | ||
229 | + | ||
230 | + partFields.value += mtCheckbox[contador][0] + ":" + dados.join(";"); | ||
231 | + } | ||
232 | + } | ||
233 | + | ||
234 | + var dataInicio = infraTrim(document.getElementById('txtDataInicio').value); | ||
235 | + var dataFim = infraTrim(document.getElementById('txtDataFim').value); | ||
236 | + | ||
237 | + if (dataInicio!='' || dataFim!=''){ | ||
238 | + | ||
239 | + if (dataInicio != '' && !infraValidarData(document.getElementById('txtDataInicio'))){ | ||
240 | + return false; | ||
241 | + } | ||
242 | + | ||
243 | + if (dataFim!='' && !infraValidarData(document.getElementById('txtDataFim'))){ | ||
244 | + return false; | ||
245 | + } | ||
246 | + | ||
247 | + if (dataInicio!='' && dataFim!='' && infraCompararDatas(dataInicio,dataFim) < 0){ | ||
248 | + alert('Período de datas inválido.'); | ||
249 | + document.getElementById('txtDataInicio').focus(); | ||
250 | + return false; | ||
251 | + } | ||
252 | + | ||
253 | + var dia1 = dataInicio.substr(0,2); | ||
254 | + var mes1 = dataInicio.substr(3,2); | ||
255 | + var ano1 = dataInicio.substr(6,4); | ||
256 | + | ||
257 | + var dia2 = dataFim.substr(0,2); | ||
258 | + var mes2 = dataFim.substr(3,2); | ||
259 | + var ano2 = dataFim.substr(6,4); | ||
260 | + | ||
261 | + if (partFields.value.length > 0) { | ||
262 | + partFields.value += " AND "; | ||
263 | + } | ||
264 | + | ||
265 | + if (dataInicio != '' && dataFim != '') { | ||
266 | + partFields.value += 'dta_geracao:[' + ano1 + '-' + mes1 + '-' + dia1 + 'T00:00:00Z TO ' + ano2 + '-' + mes2 + '-' + dia2 +'T00:00:00Z]'; | ||
267 | + }else if (dataInicio != ''){ | ||
268 | + partFields.value += 'dta_geracao:"'+ ano1 + '-' + mes1 + '-' + dia1 + 'T00:00:00Z"'; | ||
269 | + }else{ | ||
270 | + partFields.value += 'dta_geracao:"'+ ano2 + '-' + mes2 + '-' + dia2 + 'T00:00:00Z"'; | ||
271 | + } | ||
272 | + } | ||
273 | + | ||
274 | + return true; | ||
275 | +} | ||
0 | \ No newline at end of file | 276 | \ No newline at end of file |
842 Bytes
180 Bytes
587 Bytes
9.71 KB
8.82 KB
9.29 KB
@@ -0,0 +1,180 @@ | @@ -0,0 +1,180 @@ | ||
1 | +<?php | ||
2 | + | ||
3 | +/** | ||
4 | + * CONSELHO ADMINISTRATIVO DE DEFESA ECONÔMICA | ||
5 | +* 2014-12-15 | ||
6 | +* Versão do Gerador de Código: 1.0 | ||
7 | +* Versão no CVS/SVN: | ||
8 | +* | ||
9 | +* sei | ||
10 | +* pesquisa | ||
11 | +* ProcedimentoSiscadeBD | ||
12 | +* | ||
13 | +* | ||
14 | +* @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
15 | +*/ | ||
16 | + | ||
17 | +/** | ||
18 | + * Classe Banco de dados Procedimento siscade. | ||
19 | +* | ||
20 | +* | ||
21 | +* @package institucional_pesquisa_ProcedimentoSiscadeBD | ||
22 | +* @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
23 | +* @license Creative Commons Atribuição 3.0 não adaptada | ||
24 | +* <http://creativecommons.org/licenses/by/3.0/deed.pt_BR> | ||
25 | +* @ignore Este código é livre para uso sem nenhuma restrição, | ||
26 | +* salvo pelas informações a seguir referentes | ||
27 | +* @copyright Conselho Administrativo de Defesa Econômica ©2014-2018 | ||
28 | +* <http://www.cade.gov.br> | ||
29 | +* @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
30 | +*/ | ||
31 | + | ||
32 | +class DocumentoExternoINT extends DocumentoINT{ | ||
33 | + | ||
34 | + public static function formatarExibicaoConteudo($strTipoVisualizacao, $strConteudo, $objInfraPagina=null, $objInfraSessao=null, $strLinkDownload=null){ | ||
35 | + | ||
36 | + $strResultado = ''; | ||
37 | + | ||
38 | + if (!InfraString::isBolVazia($strConteudo)){ | ||
39 | + | ||
40 | + if (substr($strConteudo,0,5) != '<?xml'){ | ||
41 | + $strResultado = $strConteudo; | ||
42 | + }else{ | ||
43 | + | ||
44 | + //die($strConteudo); | ||
45 | + | ||
46 | + //internamente o DOM utiliza UTF-8 mesmo passando iso-8859-1 | ||
47 | + //por isso e necessario usar utf8_decode | ||
48 | + $objXml = new DomDocument('1.0','iso-8859-1'); | ||
49 | + | ||
50 | + /* | ||
51 | + $strConteudo = '<?xml version="1.0"?> | ||
52 | + <documento> | ||
53 | + <atributo id="" tipo="" nome="" titulo="Atributo A">nomeA</atributo> | ||
54 | + <atributo id="" tipo="" nome="" titulo="Atributo B">nomeB</atributo> | ||
55 | + <atributo id="" tipo="" nome="" titulo="Atributo C"> | ||
56 | + <valores> | ||
57 | + <valor id="" tipo="" nome="" titulo="Valor C1">nomeC1</valor> | ||
58 | + <valor id="" tipo="" nome="" titulo="Valor C2">nomeC2</valor> | ||
59 | + </valores> | ||
60 | + </atributo> | ||
61 | + <atributo id="" tipo="" nome="" titulo="Atributo D"> | ||
62 | + <valores id="" tipo="" nome="" titulo="Valores D1"> | ||
63 | + <valor id="" tipo="" nome="" titulo="Valor D1V1">D1V1</valor> | ||
64 | + <valor id="" tipo="" nome="" titulo="Valor D1V2">D1V2</valor> | ||
65 | + <valor id="" tipo="" nome="" titulo="Valor D1V3">D1V3</valor> | ||
66 | + </valores> | ||
67 | + <valores id="" tipo="" nome="" titulo="Valores D2"> | ||
68 | + <valor id="" tipo="" nome="" titulo="Valor D2V1">D2V1</valor> | ||
69 | + <valor id="" tipo="" nome="" titulo="Valor D2V2">D2V2</valor> | ||
70 | + <valor id="" tipo="" nome="" titulo="Valor D2V3">D2V3</valor> | ||
71 | + </valores> | ||
72 | + <valores id="" tipo="" nome="" titulo="Valores D3"> | ||
73 | + <valor id="" tipo="" nome="" nome="d3v1" titulo="Valor D3V1">D3V1</valor> | ||
74 | + <valor id="" tipo="" nome="" titulo="Valor D3V2">D3V2</valor> | ||
75 | + <valor id="" tipo="" nome="" titulo="Valor D3V3">D3V3</valor> | ||
76 | + </valores> | ||
77 | + </atributo> | ||
78 | + </documento>'; | ||
79 | + */ | ||
80 | + | ||
81 | + $objXml->loadXML($strConteudo); | ||
82 | + | ||
83 | + $arrAtributos = $objXml->getElementsByTagName('atributo'); | ||
84 | + | ||
85 | + if ($strTipoVisualizacao == self::$TV_HTML){ | ||
86 | + | ||
87 | + $strNovaLinha = '<br />'; | ||
88 | + $strItemInicio = '<b>'; | ||
89 | + $strItemFim = '</b>'; | ||
90 | + $strSubitemInicio = '<i>'; | ||
91 | + $strSubitemFim = '</i>'; | ||
92 | + $strEspaco = ' '; | ||
93 | + | ||
94 | + }else{ | ||
95 | + | ||
96 | + $strNovaLinha = "\n"; | ||
97 | + $strItemInicio = ''; | ||
98 | + $strItemFim = ''; | ||
99 | + $strSubitemInicio = ''; | ||
100 | + $strSubitemFim = ''; | ||
101 | + $strEspaco = ' '; | ||
102 | + | ||
103 | + } | ||
104 | + | ||
105 | + $strResultado = ''; | ||
106 | + | ||
107 | + if ($objInfraSessao!=null){ | ||
108 | + $bolAcaoDownload = $objInfraSessao->verificarPermissao('documento_download_anexo'); | ||
109 | + } | ||
110 | + | ||
111 | + foreach($arrAtributos as $atributo){ | ||
112 | + | ||
113 | + $arrValores = $atributo->getElementsByTagName('valores'); | ||
114 | + | ||
115 | + if ($arrValores->length==0){ | ||
116 | + //não mostra item que não possua valor | ||
117 | + if (!InfraString::isBolVazia($atributo->nodeValue)){ | ||
118 | + $strResultado .= $strNovaLinha.$strItemInicio.self::formatarTagConteudo($strTipoVisualizacao,$atributo->getAttribute('titulo')).$strItemFim.': '.$strNovaLinha.$strEspaco.$strEspaco.self::formatarTagConteudo($strTipoVisualizacao,$atributo->nodeValue); | ||
119 | + $strResultado .= $strNovaLinha; | ||
120 | + } | ||
121 | + }else{ | ||
122 | + | ||
123 | + if ($atributo->getAttribute('titulo')!=''){ | ||
124 | + $strResultado .= $strNovaLinha.$strItemInicio.self::formatarTagConteudo($strTipoVisualizacao,$atributo->getAttribute('titulo')).$strItemFim.':'; | ||
125 | + } | ||
126 | + | ||
127 | + foreach($arrValores as $valores){ | ||
128 | + | ||
129 | + if ($valores->getAttribute('titulo')!=''){ | ||
130 | + $strResultado .= $strNovaLinha.$strEspaco.$strEspaco.$strSubitemInicio.self::formatarTagConteudo($strTipoVisualizacao,$valores->getAttribute('titulo')).':'.$strSubitemFim; | ||
131 | + } | ||
132 | + | ||
133 | + $arrValor = $valores->getElementsByTagName('valor'); | ||
134 | + | ||
135 | + foreach($arrValor as $valor){ | ||
136 | + | ||
137 | + $strResultado .= $strNovaLinha.$strEspaco.$strEspaco.$strEspaco.$strEspaco; | ||
138 | + | ||
139 | + if ($valor->getAttribute('titulo')!=''){ | ||
140 | + $strResultado .= self::formatarTagConteudo($strTipoVisualizacao,$valor->getAttribute('titulo')).': '; | ||
141 | + } | ||
142 | + | ||
143 | + if ($valor->getAttribute('tipo')=='ANEXO'){ | ||
144 | + if ($objInfraPagina==null || $objInfraSessao==null || $strLinkDownload==null){ | ||
145 | + $strResultado .= self::formatarTagConteudo($strTipoVisualizacao,$valor->nodeValue); | ||
146 | + }else { | ||
147 | + if ($bolAcaoDownload){ | ||
148 | + $objAnexoDTO = new AnexoDTO(); | ||
149 | + $objAnexoDTO->setNumIdAnexo($valor->getAttribute('id')); | ||
150 | + $objAnexoRN = new AnexoRN(); | ||
151 | + if ($objAnexoRN->contarRN0734($objAnexoDTO)>0){ | ||
152 | + //$strResultado .= '<a href="'.$objInfraPagina->formatarXHTML($objInfraSessao->assinarLink($strLinkDownload.'&id_anexo='.$valor->getAttribute('id'))).'" target="_blank" class="ancoraVisualizacaoDocumento">'.self::formatarTagConteudo($strTipoVisualizacao,$valor->nodeValue).'</a>'; | ||
153 | + $strResultado = '<span>'.self::formatarTagConteudo($strTipoVisualizacao,$valor->nodeValue).'<span>'; | ||
154 | + }else{ | ||
155 | + $strResultado .= '<a href="javascript:void(0);" onclick="alert(\'Este anexo foi excluído.\');" class="ancoraVisualizacaoDocumento">'.self::formatarTagConteudo($strTipoVisualizacao,$valor->nodeValue).'</a>'; | ||
156 | + } | ||
157 | + }else{ | ||
158 | + $strResultado .= self::formatarTagConteudo($strTipoVisualizacao,$valor->nodeValue); | ||
159 | + } | ||
160 | + } | ||
161 | + }else{ | ||
162 | + $strResultado .= self::formatarTagConteudo($strTipoVisualizacao,$valor->nodeValue); | ||
163 | + } | ||
164 | + } | ||
165 | + | ||
166 | + if ($arrValor->length>1){ | ||
167 | + $strResultado .= $strNovaLinha; | ||
168 | + } | ||
169 | + } | ||
170 | + $strResultado .= $strNovaLinha; | ||
171 | + } | ||
172 | + } | ||
173 | + } | ||
174 | + } | ||
175 | + return $strResultado; | ||
176 | + } | ||
177 | + | ||
178 | +} | ||
179 | + | ||
180 | +?> | ||
0 | \ No newline at end of file | 181 | \ No newline at end of file |
@@ -0,0 +1,214 @@ | @@ -0,0 +1,214 @@ | ||
1 | +<? | ||
2 | +/** | ||
3 | +* TRIBUNAL REGIONAL FEDERAL DA 4ª REGIÃO | ||
4 | +* | ||
5 | +* 29/11/2016 - criado por alex | ||
6 | +* | ||
7 | +* Versão do Gerador de Código: 1.39.0 | ||
8 | +*/ | ||
9 | + | ||
10 | +try { | ||
11 | + require_once dirname(__FILE__).'/../../SEI.php'; | ||
12 | + | ||
13 | + session_start(); | ||
14 | + | ||
15 | + ////////////////////////////////////////////////////////////////////////////// | ||
16 | + //InfraDebug::getInstance()->setBolLigado(false); | ||
17 | + //InfraDebug::getInstance()->setBolDebugInfra(true); | ||
18 | + //InfraDebug::getInstance()->limpar(); | ||
19 | + ////////////////////////////////////////////////////////////////////////////// | ||
20 | + | ||
21 | + SessaoSEI::getInstance()->validarLink(); | ||
22 | + SessaoSEI::getInstance()->validarPermissao($_GET['acao']); | ||
23 | + | ||
24 | + switch($_GET['acao']){ | ||
25 | + | ||
26 | + | ||
27 | + case 'md_parametro_pesquisa_listar': | ||
28 | + $strTitulo = 'Parâmetros Pesquisa Pública'; | ||
29 | + break; | ||
30 | + | ||
31 | + case 'md_parametro_pesquisa_alterar': | ||
32 | + | ||
33 | + $strTitulo = 'Parâmetros Pesquisa Pública'; | ||
34 | + if(isset($_POST['btnSalvar'])) { | ||
35 | + $arrParametroPesquisaDTO = array( | ||
36 | + array('Nome' => ParametroPesquisaRN::$TA_CAPTCHA , 'Valor' => PaginaSEI::getInstance()->getCheckbox($_POST['chkCapcthaPesquisa'])), | ||
37 | + array('Nome' => ParametroPesquisaRN::$TA_CAPTCHA_PDF , 'Valor' => PaginaSEI::getInstance()->getCheckbox($_POST['chkCapcthaGerarPdf'])), | ||
38 | + array('Nome' => ParametroPesquisaRN::$TA_LISTA_ANDAMENTO_PROCESSO_PUBLICO , 'Valor' => PaginaSEI::getInstance()->getCheckbox($_POST['chkListaAndamentoProcessoPublico'])), | ||
39 | + array('Nome' => ParametroPesquisaRN::$TA_PROCESSO_RESTRITO , 'Valor' => PaginaSEI::getInstance()->getCheckbox($_POST['chkProcessoRestrito'])), | ||
40 | + array('Nome' => ParametroPesquisaRN::$TA_METADADOS_PROCESSO_RESTRITO , 'Valor' => PaginaSEI::getInstance()->getCheckbox($_POST['chkMetaDadosProcessoRestrito'])), | ||
41 | + array('Nome' => ParametroPesquisaRN::$TA_LISTA_ANDAMENTO_PROCESSO_RESTRITO , 'Valor' => PaginaSEI::getInstance()->getCheckbox($_POST['chkListaAndamentoProcessoRestrito'])), | ||
42 | + array('Nome' => ParametroPesquisaRN::$TA_DESCRICAO_PROCEDIMENTO_ACESSO_RESTRITO , 'Valor' => trim($_POST['txtDescricaoProcessoAcessoRestrito'])), | ||
43 | + array('Nome' => ParametroPesquisaRN::$TA_DOCUMENTO_PROCESSO_PUBLICO , 'Valor' => PaginaSEI::getInstance()->getCheckbox($_POST['chkDocumentoProcessoPublico'])), | ||
44 | + array('Nome' => ParametroPesquisaRN::$TA_LISTA_DOCUMENTO_PROCESSO_PUBLICO , 'Valor' => PaginaSEI::getInstance()->getCheckbox($_POST['chkListaDocumentoProcessoPublico'])), | ||
45 | + array('Nome' => ParametroPesquisaRN::$TA_LISTA_DOCUMENTO_PROCESSO_RESTRITO , 'Valor' => PaginaSEI::getInstance()->getCheckbox($_POST['chkListaDocumentoProcessoRestrito'])), | ||
46 | + array('Nome' => ParametroPesquisaRN::$TA_AUTO_COMPLETAR_INTERESSADO , 'Valor' => PaginaSEI::getInstance()->getCheckbox($_POST['chkAutoCompletarInteressado'])), | ||
47 | + array('Nome' => ParametroPesquisaRN::$TA_MENU_USUARIO_EXTERNO , 'Valor' => PaginaSEI::getInstance()->getCheckbox($_POST['chkMenuUsuarioExterno'])), | ||
48 | + array('Nome' => ParametroPesquisaRN::$TA_CHAVE_CRIPTOGRAFIA , 'Valor' => trim($_POST['txtChaveCriptografia'])), | ||
49 | + | ||
50 | + | ||
51 | + ); | ||
52 | + | ||
53 | + $arrObjParametroPesquisaDTO = InfraArray::gerarArrInfraDTOMultiAtributos('ParametroPesquisaDTO', $arrParametroPesquisaDTO); | ||
54 | + | ||
55 | + $objParametroPesquisaRN = new ParametroPesquisaRN(); | ||
56 | + $objParametroPesquisaRN->alterarParametros($arrObjParametroPesquisaDTO); | ||
57 | + | ||
58 | + PaginaSEI::getInstance()->adicionarMensagem("Parametros da Pesquisa Pública salva com sucesso!",PaginaSEI::$TIPO_MSG_AVISO); | ||
59 | + } | ||
60 | + | ||
61 | + | ||
62 | + break; | ||
63 | + | ||
64 | + | ||
65 | + | ||
66 | + default: | ||
67 | + throw new InfraException("Ação '".$_GET['acao']."' não reconhecida."); | ||
68 | + } | ||
69 | + | ||
70 | + $arrComandos = array(); | ||
71 | + | ||
72 | + $arrComandos[] = '<button type="submit" accesskey="S" id="btnSalvar" name="btnSalvar" value="Salvar" class="infraButton"><span class="infraTeclaAtalho">S</span>alvar</button>'; | ||
73 | + | ||
74 | + | ||
75 | + $objParametroPesquisaDTO = new ParametroPesquisaDTO(); | ||
76 | + $objParametroPesquisaDTO->retStrNome(); | ||
77 | + $objParametroPesquisaDTO->retStrValor(); | ||
78 | + | ||
79 | + | ||
80 | + $objParametroPesquisaRN = new ParametroPesquisaRN(); | ||
81 | + $arrObjParametroPesquisaDTO = $objParametroPesquisaRN->listar($objParametroPesquisaDTO); | ||
82 | + | ||
83 | + $arrParametroPesquisaDTO = InfraArray::converterArrInfraDTO($arrObjParametroPesquisaDTO,'Valor','Nome'); | ||
84 | + | ||
85 | + | ||
86 | +}catch(Exception $e){ | ||
87 | + PaginaSEI::getInstance()->processarExcecao($e); | ||
88 | +} | ||
89 | + | ||
90 | +PaginaSEI::getInstance()->montarDocType(); | ||
91 | +PaginaSEI::getInstance()->abrirHtml(); | ||
92 | +PaginaSEI::getInstance()->abrirHead(); | ||
93 | +PaginaSEI::getInstance()->montarMeta(); | ||
94 | +PaginaSEI::getInstance()->montarTitle(PaginaSEI::getInstance()->getStrNomeSistema().' - '.$strTitulo); | ||
95 | +PaginaSEI::getInstance()->montarStyle(); | ||
96 | +PaginaSEI::getInstance()->abrirStyle(); | ||
97 | + | ||
98 | + | ||
99 | + | ||
100 | + | ||
101 | + | ||
102 | +PaginaSEI::getInstance()->fecharStyle(); | ||
103 | +PaginaSEI::getInstance()->montarJavaScript(); | ||
104 | +PaginaSEI::getInstance()->abrirJavaScript(); | ||
105 | +?> | ||
106 | + | ||
107 | +function inicializar(){ | ||
108 | + | ||
109 | +} | ||
110 | + | ||
111 | +function validarCadastro() { | ||
112 | + | ||
113 | + if (infraTrim(document.getElementById('txtChaveCriptografia').value)=='') { | ||
114 | + alert('Informe a Chave para criptografia.'); | ||
115 | + document.getElementById('txtChaveCriptografia').focus(); | ||
116 | + return false; | ||
117 | + } | ||
118 | + | ||
119 | + return true; | ||
120 | +} | ||
121 | + | ||
122 | +function OnSubmitForm() { | ||
123 | + return validarCadastro(); | ||
124 | +} | ||
125 | + | ||
126 | + | ||
127 | +<? | ||
128 | +PaginaSEI::getInstance()->fecharJavaScript(); | ||
129 | +PaginaSEI::getInstance()->fecharHead(); | ||
130 | +PaginaSEI::getInstance()->abrirBody($strTitulo,'onload="inicializar();"'); | ||
131 | +PaginaSEI::getInstance()->abrirAreaDados(null); | ||
132 | +?> | ||
133 | +<form id="frmParametroPesquisaLista" method="post" onsubmit="return OnSubmitForm();" action="<?=SessaoSEI::getInstance()->assinarLink('controlador.php?acao=md_parametro_pesquisa_alterar&acao_origem='.$_GET['acao'])?>"> | ||
134 | + | ||
135 | + <? | ||
136 | + //PaginaSEI::getInstance()->montarBarraLocalizacao($strTitulo); | ||
137 | + PaginaSEI::getInstance()->montarBarraComandosSuperior($arrComandos); | ||
138 | + //PaginaSEI::getInstance()->montarAreaValidacao(); | ||
139 | + ?> | ||
140 | + | ||
141 | + <h2 style='font-weight:bold;text-decoration: underline;'>Captcha</h2> | ||
142 | + <h3 style='font-weight:bold; font-style: italic;'>Habilitar Captcha na pesquisa pública:</h3> | ||
143 | + <input id="chkCapcthaPesquisa" name="chkCapcthaPesquisa" type="checkbox" class="infraCheckBox" <?=($arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_CAPTCHA] == 'S') ? "checked" : ""?> tabindex="<?=PaginaSEI::getInstance()->getProxTabDados()?>" /> | ||
144 | + <label id="lblCapcthaPesquisa" for="chkCapcthaPesquisa" class="infraLabelCheckBox">Sim</label> | ||
145 | + | ||
146 | + <h3 style='font-weight:bold; font-style: italic;'>Habilitar Captcha gerar PDF:</h3> | ||
147 | + <input id="chkCapcthaGerarPdf" name="chkCapcthaGerarPdf" type="checkbox" class="infraCheckBox" <?=($arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_CAPTCHA_PDF] == 'S') ? "checked" : ""?> tabindex="<?=PaginaSEI::getInstance()->getProxTabDados()?>" /> | ||
148 | + <label id="lblCapcthaGerarPdf" for="chkCapcthaGerarPdf" class="infraLabelCheckBox">Sim</label> | ||
149 | + <hr/> | ||
150 | + | ||
151 | + <h2 style='font-weight:bold;text-decoration: underline;'>Processos</h2> | ||
152 | + | ||
153 | + <h3 style='font-weight:bold; font-style: italic;'>Habilitar a exibição dos Andamentos nos processos com nível de acesso global "Público":</h3> | ||
154 | + <input id="chkListaAndamentoProcessoPublico" name="chkListaAndamentoProcessoPublico" type="checkbox" class="infraCheckBox" <?=($arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_LISTA_ANDAMENTO_PROCESSO_PUBLICO] == 'S') ? "checked" : ""?> tabindex="<?=PaginaSEI::getInstance()->getProxTabDados()?>" /> | ||
155 | + <label id="lblListaAndamentoProcessoPublico" for="chkListaAndamentoProcessoPublico" class="infraLabelCheckBox">Sim</label> | ||
156 | + | ||
157 | + <h3 style='font-weight:bold; font-style: italic;'>Habilitar a pesquisa em processos com nível de acesso global "Restrito":</h3> | ||
158 | + <input id="chkProcessoRestrito" name="chkProcessoRestrito" type="checkbox" class="infraCheckBox" <?=($arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_PROCESSO_RESTRITO] == 'S') ? "checked" : ""?> tabindex="<?=PaginaSEI::getInstance()->getProxTabDados()?>" /> | ||
159 | + <label id="lblProcessoRestrito" for="chkProcessoRestrito" class="infraLabelCheckBox">Sim</label> | ||
160 | + | ||
161 | + <h3 style='font-weight:bold; font-style: italic;'>Habilitar o acesso aos metadados dos Processos com nível de acesso global "Restrito"</h3> | ||
162 | + <input id="chkMetaDadosProcessoRestrito" name="chkMetaDadosProcessoRestrito" type="checkbox" class="infraCheckBox" <?=($arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_METADADOS_PROCESSO_RESTRITO] == 'S') ? "checked" : ""?> tabindex="<?=PaginaSEI::getInstance()->getProxTabDados()?>" /> | ||
163 | + <label id="lblMetaDadosProcessoRestrito" for="chkMetaDadosProcessoRestrito" class="infraLabelCheckBox">Sim</label> | ||
164 | + | ||
165 | + <h3 style='font-weight:bold; font-style: italic;'>Habilitar a exibição dos Andamentos nos processos com nível de acesso global "Restrito":</h3> | ||
166 | + <input id="chkListaAndamentoProcessoRestrito" name="chkListaAndamentoProcessoRestrito" type="checkbox" class="infraCheckBox" <?=($arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_LISTA_ANDAMENTO_PROCESSO_RESTRITO] == 'S') ? "checked" : ""?> tabindex="<?=PaginaSEI::getInstance()->getProxTabDados()?>" /> | ||
167 | + <label id="lblListaAndamentoProcessoRestrito" for="chkListaAndamentoProcessoRestrito" class="infraLabelCheckBox">Sim</label> | ||
168 | + | ||
169 | + <h3 style='font-weight:bold; font-style: italic;'>Descrição de justificativa de restrição de acesso e orientações para meios alternativos de solicitação de acesso:</h3> | ||
170 | + <textarea id="txtDescricaoProcessoAcessoRestrito" name="txtDescricaoProcessoAcessoRestrito" class="infraTextarea" rows="5" style="width: 90%" tabindex="<?=PaginaSEI::getInstance()->getProxTabDados()?>" ><?=$arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_DESCRICAO_PROCEDIMENTO_ACESSO_RESTRITO]?></textarea> | ||
171 | + <hr> | ||
172 | + | ||
173 | + <h2 style='font-weight:bold;text-decoration: underline;'>Documentos</h2> | ||
174 | + <h3 style='font-weight:bold; font-style: italic;'>Habilitar a pesquisa em Documentos que estão associados à processos com nível de acesso global "Público":</h3> | ||
175 | + <input id="chkDocumentoProcessoPublico" name="chkDocumentoProcessoPublico" type="checkbox" class="infraCheckBox" <?=($arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_DOCUMENTO_PROCESSO_PUBLICO] == 'S') ? "checked" : ""?> tabindex="<?=PaginaSEI::getInstance()->getProxTabDados()?>" /> | ||
176 | + <label id="lblDocumentoProcessoPublico" for="chkDocumentoProcessoPublico" class="infraLabelCheckBox">Sim</label> | ||
177 | + | ||
178 | + <h3 style='font-weight:bold; font-style: italic;'>Habilitar o acesso aos Documentos nos processos com nível de acesso global "Público":</h3> | ||
179 | + <input id="chkListaDocumentoProcessoPublico" name="chkListaDocumentoProcessoPublico" type="checkbox" class="infraCheckBox" <?=($arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_LISTA_DOCUMENTO_PROCESSO_PUBLICO] == 'S') ? "checked" : ""?> tabindex="<?=PaginaSEI::getInstance()->getProxTabDados()?>" /> | ||
180 | + <label id="lblListaDocumentoProcessoPublico" for="chkListaDocumentoProcessoPublico" class="infraLabelCheckBox">Sim</label> | ||
181 | + | ||
182 | + <h3 style='font-weight:bold; font-style: italic;'>Habilitar o acesso aos Documentos nos processos com nível de acesso global "Restrito":</h3> | ||
183 | + <input id="chkListaDocumentoProcessoRestrito" name="chkListaDocumentoProcessoRestrito" type="checkbox" class="infraCheckBox" <?=($arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_LISTA_DOCUMENTO_PROCESSO_RESTRITO] == 'S') ? "checked" : ""?> tabindex="<?=PaginaSEI::getInstance()->getProxTabDados()?>" /> | ||
184 | + <label id="lblListaDocumentoProcessoRestrito" for="chkListaDocumentoProcessoRestrito" class="infraLabelCheckBox">Sim</label> | ||
185 | + | ||
186 | + <hr/> | ||
187 | + | ||
188 | + | ||
189 | + <h2 style='font-weight:bold;text-decoration: underline;'>Configurações Gerais</h2> | ||
190 | + | ||
191 | + <h3 style='font-weight:bold; font-style: italic;'>Habilitar a função auto completar no campo "Interessado / Remetente" na página principal da Pesquisa Pública:</h3> | ||
192 | + <input id="chkAutoCompletarInteressado" name="chkAutoCompletarInteressado" type="checkbox" class="infraCheckBox" <?=($arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_AUTO_COMPLETAR_INTERESSADO] == 'S') ? "checked" : ""?> tabindex="<?=PaginaSEI::getInstance()->getProxTabDados()?>" /> | ||
193 | + <label id="lblAutoCompletarInteressado" for="chkAutoCompletarInteressado" class="infraLabelCheckBox">Sim</label> | ||
194 | + | ||
195 | + <h3 style='font-weight:bold; font-style: italic;'>Habilitar o link da pesquisa pública no menu de usuário externo:</h3> | ||
196 | + <input id="chkMenuUsuarioExterno" name="chkMenuUsuarioExterno" type="checkbox" class="infraCheckBox" <?=($arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_MENU_USUARIO_EXTERNO] == 'S') ? "checked" : ""?> tabindex="<?=PaginaSEI::getInstance()->getProxTabDados()?>" /> | ||
197 | + <label id="lblMenuUsuarioExterno" for="chkMenuUsuarioExterno" class="infraLabelCheckBox">Sim</label> | ||
198 | + | ||
199 | + <h3 style='font-weight:bold; font-style: italic;'>Chave para criptografia dos links de processos e documentos:</h3> | ||
200 | + <input id="txtChaveCriptografia" name="txtChaveCriptografia" type="text" class="infraText" maxlength="100" style="width: 40%" value="<?=$arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_CHAVE_CRIPTOGRAFIA]?>" tabindex="<?=PaginaSEI::getInstance()->getProxTabDados()?>" /> | ||
201 | + | ||
202 | + <? | ||
203 | + //PaginaSEI::getInstance()->montarBarraLocalizacao($strTitulo); | ||
204 | + PaginaSEI::getInstance()->montarBarraComandosInferior($arrComandos); | ||
205 | + //PaginaSEI::getInstance()->montarAreaValidacao(); | ||
206 | + ?> | ||
207 | + | ||
208 | + | ||
209 | +</form> | ||
210 | +<? | ||
211 | +PaginaSEI::getInstance()->fecharAreaDados(); | ||
212 | +PaginaSEI::getInstance()->fecharBody(); | ||
213 | +PaginaSEI::getInstance()->fecharHtml(); | ||
214 | +?> | ||
0 | \ No newline at end of file | 215 | \ No newline at end of file |
@@ -0,0 +1,18 @@ | @@ -0,0 +1,18 @@ | ||
1 | +CREATE TABLE `SEI_3.0.0`.`md_parametro_pesquisa` ( | ||
2 | + `nome` VARCHAR(100) NOT NULL, | ||
3 | + `valor` LONGTEXT NULL, | ||
4 | + PRIMARY KEY (`nome`)); | ||
5 | + | ||
6 | +INSERT INTO `SEI_3.0.0`.`md_parametro_pesquisa` (`nome`, `valor`) VALUES ('CAPTCHA', 'S'); | ||
7 | +INSERT INTO `SEI_3.0.0`.`md_parametro_pesquisa` (`nome`, `valor`) VALUES ('CAPTCHA_PDF', 'S'); | ||
8 | +INSERT INTO `SEI_3.0.0`.`md_parametro_pesquisa` (`nome`, `valor`) VALUES ('DOCUMENTO_PROCESSO_PUBLICO', 'S'); | ||
9 | +INSERT INTO `SEI_3.0.0`.`md_parametro_pesquisa` (`nome`, `valor`) VALUES ('LISTA_DOCUMENTO_PROCESSO_PUBLICO', 'S'); | ||
10 | +INSERT INTO `SEI_3.0.0`.`md_parametro_pesquisa` (`nome`, `valor`) VALUES ('LISTA_DOCUMENTO_PROCESSO_RESTRITO', 'S'); | ||
11 | +INSERT INTO `SEI_3.0.0`.`md_parametro_pesquisa` (`nome`, `valor`) VALUES ('LISTA_ANDAMENTO_PROCESSO_PUBLICO', 'S'); | ||
12 | +INSERT INTO `SEI_3.0.0`.`md_parametro_pesquisa` (`nome`, `valor`) VALUES ('PROCESSO_RESTRITO', 'S'); | ||
13 | +INSERT INTO `SEI_3.0.0`.`md_parametro_pesquisa` (`nome`, `valor`) VALUES ('METADADOS_PROCESSO_RESTRITO', 'S'); | ||
14 | +INSERT INTO `SEI_3.0.0`.`md_parametro_pesquisa` (`nome`, `valor`) VALUES ('LISTA_ANDAMENTO_PROCESSO_RESTRITO', 'S'); | ||
15 | +INSERT INTO `SEI_3.0.0`.`md_parametro_pesquisa` (`nome`, `valor`) VALUES ('DESCRICAO_PROCEDIMENTO_ACESSO_RESTRITO', 'Processo ou Documento de Acesso Restrito - Para condições de acesso verifique a <a style=\"font-size: 1em;\" href=\"http://www.cade.gov.br/Default.aspx?2808080814f235152223\" target=\"_blank\">Resolução n° 11/2014</a> ou entre em contato com o Núcleo Gestor do SEI pelo e-mail sei@cade.gov.br.'); | ||
16 | +INSERT INTO `SEI_3.0.0`.`md_parametro_pesquisa` (`nome`, `valor`) VALUES ('AUTO_COMPLETAR_INTERESSADO', 'S'); | ||
17 | +INSERT INTO `SEI_3.0.0`.`md_parametro_pesquisa` (`nome`, `valor`) VALUES ('CHAVE_CRIPTOGRAFIA', 'C@d3S3mP@p3l#S3I83'); | ||
18 | +INSERT INTO `SEI_3.0.0`.`md_parametro_pesquisa` (`nome`, `valor`) VALUES ('MENU_USUARIO_EXTERNO', 'S'); | ||
0 | \ No newline at end of file | 19 | \ No newline at end of file |
@@ -0,0 +1,99 @@ | @@ -0,0 +1,99 @@ | ||
1 | +<? | ||
2 | +/** | ||
3 | + * CONSELHO ADMINISTRATIVO DE DEFESA ECONÔMICA | ||
4 | +* | ||
5 | +* 02/10/2014 - criado por alex braga | ||
6 | +* | ||
7 | +* Versão do Gerador de Código: | ||
8 | +* | ||
9 | +* Versão no CVS: | ||
10 | +*/ | ||
11 | +try { | ||
12 | + require_once dirname(__FILE__).'/../../SEI.php'; | ||
13 | + | ||
14 | + //session_start(); | ||
15 | + | ||
16 | + ////////////////////////////////////////////////////////////////////////////// | ||
17 | + InfraDebug::getInstance()->setBolLigado(false); | ||
18 | + InfraDebug::getInstance()->setBolDebugInfra(false); | ||
19 | + InfraDebug::getInstance()->limpar(); | ||
20 | + ////////////////////////////////////////////////////////////////////////////// | ||
21 | + | ||
22 | + if (isset($_GET['id_acesso_externo'])){ | ||
23 | + SessaoSEIExterna::getInstance($_GET['id_acesso_externo'])->validarLink(); | ||
24 | + }else{ | ||
25 | + SessaoSEIExterna::getInstance()->validarLink(); | ||
26 | + } | ||
27 | + | ||
28 | + switch($_GET['acao_externa']){ | ||
29 | + | ||
30 | + case 'usuario_externo_exibir_arquivo': | ||
31 | + | ||
32 | + AuditoriaSEI::getInstance()->auditar('usuario_externo_exibir_arquivo', __FILE__); | ||
33 | +/* | ||
34 | + * SEI 2.5.1 */ | ||
35 | + $infraParametroDTO = new InfraParametroDTO(); | ||
36 | + $infraParametroDTO->setStrNome('SEI_VERSAO'); | ||
37 | + $infraParametroDTO->retStrValor(); | ||
38 | + | ||
39 | + $infraParametroRN = new InfraParametroRN(); | ||
40 | + $infraParametroDTO = $infraParametroRN->consultar($infraParametroDTO); | ||
41 | + $versaoSei = $infraParametroDTO->getStrValor(); | ||
42 | + print_r($versaoSei); | ||
43 | + | ||
44 | + | ||
45 | + if($versaoSei == '2.5.1'){ | ||
46 | + | ||
47 | + header("Pragma: public"); | ||
48 | + header('Pragma: no-cache'); | ||
49 | + header("Expires: 0"); | ||
50 | + header("Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0"); | ||
51 | + header("Cache-Control: private","false"); | ||
52 | + PaginaSEIExterna::getInstance()->montarHeaderDownload($_GET['nome_arquivo'],'attachment'); | ||
53 | + | ||
54 | + $fp = fopen(dirname(__FILE__).'/../../'.DIR_UPLOAD.'/'.$_GET['nome_arquivo'], "rb"); | ||
55 | + while (!feof($fp)) { | ||
56 | + echo fread($fp, TAM_BLOCO_LEITURA_ARQUIVO); | ||
57 | + } | ||
58 | + fclose($fp); | ||
59 | + break; | ||
60 | + | ||
61 | + }else{ | ||
62 | + /* | ||
63 | + * SEI 2.5.2 */ | ||
64 | + header("Pragma: public"); | ||
65 | + header('Pragma: no-cache'); | ||
66 | + header("Expires: 0"); | ||
67 | + header("Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0"); | ||
68 | + header("Cache-Control: private","false"); | ||
69 | + $strNomeDownload=$_GET['nome_download']; | ||
70 | + | ||
71 | + if (InfraString::isBolVazia($strNomeDownload)){ | ||
72 | + $strNomeDownload=$_GET['nome_arquivo']; | ||
73 | + } | ||
74 | + | ||
75 | + PaginaSEI::getInstance()->montarHeaderDownload($strNomeDownload,'attachment'); | ||
76 | + | ||
77 | + $fp = fopen(DIR_SEI_TEMP.'/'.$_GET['nome_arquivo'], "rb"); | ||
78 | + while (!feof($fp)) { | ||
79 | + echo fread($fp, TAM_BLOCO_LEITURA_ARQUIVO); | ||
80 | + } | ||
81 | + fclose($fp); | ||
82 | + | ||
83 | + break; | ||
84 | + | ||
85 | + } | ||
86 | + | ||
87 | + | ||
88 | + | ||
89 | + | ||
90 | + | ||
91 | + default: | ||
92 | + throw new InfraException("Ação '".$_GET['acao']."' não reconhecida."); | ||
93 | + } | ||
94 | + | ||
95 | +}catch(Exception $e){ | ||
96 | + try{ LogSEI::getInstance()->gravar(InfraException::inspecionar($e)."\n".'$_GET: '.print_r($_GET,true)); }catch(Exception $e2){} | ||
97 | + die('Erro exibindo arquivo em acesso externo.'); | ||
98 | +} | ||
99 | +?> | ||
0 | \ No newline at end of file | 100 | \ No newline at end of file |
@@ -0,0 +1,903 @@ | @@ -0,0 +1,903 @@ | ||
1 | +<? | ||
2 | +/** | ||
3 | + * CONSELHO ADMINISTRATIVO DE DEFESA ECONÔMICA | ||
4 | +* | ||
5 | +* 29/09/2014 - criado por alex braga | ||
6 | +* | ||
7 | +* Versão do Gerador de Código: | ||
8 | +* | ||
9 | +* Versão no CVS: | ||
10 | +*/ | ||
11 | + | ||
12 | +try { | ||
13 | + require_once dirname(__FILE__).'/../../SEI.php'; | ||
14 | + | ||
15 | + SessaoSEIExterna::getInstance()->validarSessao(); | ||
16 | + //session_start(); | ||
17 | + | ||
18 | + ////////////////////////////////////////////////////////////////////////////// | ||
19 | +// InfraDebug::getInstance()->setBolLigado(false); | ||
20 | +// InfraDebug::getInstance()->setBolDebugInfra(true); | ||
21 | +// InfraDebug::getInstance()->limpar(); | ||
22 | + ////////////////////////////////////////////////////////////////////////////// | ||
23 | + | ||
24 | + ConverteURI::converterURI(); | ||
25 | + PesquisaUtil::valiadarLink(); | ||
26 | + | ||
27 | + // SessaoSEIExterna::getInstance()->validarLink(); | ||
28 | + | ||
29 | + | ||
30 | + //carrega configurações pesquisa | ||
31 | + | ||
32 | + $objParametroPesquisaDTO = new ParametroPesquisaDTO(); | ||
33 | + $objParametroPesquisaDTO->retStrNome(); | ||
34 | + $objParametroPesquisaDTO->retStrValor(); | ||
35 | + | ||
36 | + $objParametroPesquisaRN = new ParametroPesquisaRN(); | ||
37 | + $arrObjParametroPesquisaDTO = $objParametroPesquisaRN->listar($objParametroPesquisaDTO); | ||
38 | + | ||
39 | + $arrParametroPesquisaDTO = InfraArray::converterArrInfraDTO($arrObjParametroPesquisaDTO,'Valor','Nome'); | ||
40 | + | ||
41 | + $bolPesquisaProcessoRestrito = $arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_PROCESSO_RESTRITO] == 'S' ? true : false; | ||
42 | + $bolListaDocumentoProcessoPublico = $arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_LISTA_DOCUMENTO_PROCESSO_PUBLICO] == 'S' ? true : false; | ||
43 | + $bolListaAndamentoProcessoPublico = $arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_LISTA_ANDAMENTO_PROCESSO_PUBLICO] == 'S' ? true : false; | ||
44 | + $bolCaptchaGerarPdf = $arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_CAPTCHA_PDF] == 'S' ? true : false; | ||
45 | + $bolLinkMetadadosProcessoRestrito = $arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_METADADOS_PROCESSO_RESTRITO] == 'S' ? true : false; | ||
46 | + $bolListaAndamentoProcessoRestrito = $arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_LISTA_ANDAMENTO_PROCESSO_RESTRITO] == 'S' ? true : false; | ||
47 | + $bolListaDocumentoProcessoRestrito = $arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_LISTA_DOCUMENTO_PROCESSO_RESTRITO] == 'S' ? true : false; | ||
48 | + $txtDescricaoProcessoAcessoRestrito = $arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_DESCRICAO_PROCEDIMENTO_ACESSO_RESTRITO]; | ||
49 | + | ||
50 | + if($bolCaptchaGerarPdf) { | ||
51 | + $strCodigoParaGeracaoCaptcha = InfraCaptcha::obterCodigo(); | ||
52 | + $md5Captcha = md5(InfraCaptcha::gerar($strCodigoParaGeracaoCaptcha)); | ||
53 | + }else { | ||
54 | + $md5Captcha = null; | ||
55 | + } | ||
56 | + | ||
57 | + PaginaSEIExterna::getInstance()->setTipoPagina(PaginaSEIExterna::$TIPO_PAGINA_SEM_MENU); | ||
58 | + | ||
59 | + $strTitulo = 'Pesquisa Processual'; | ||
60 | + | ||
61 | + | ||
62 | + $dblIdProcedimento = $_GET['id_procedimento']; | ||
63 | + | ||
64 | + //Carregar dados do cabeçalho | ||
65 | + $objProcedimentoDTO = new ProcedimentoDTO(); | ||
66 | + $objProcedimentoDTO->retStrNomeTipoProcedimento(); | ||
67 | + $objProcedimentoDTO->retStrProtocoloProcedimentoFormatado(); | ||
68 | + $objProcedimentoDTO->retDtaGeracaoProtocolo(); | ||
69 | + $objProcedimentoDTO->retStrStaNivelAcessoGlobalProtocolo(); | ||
70 | + $objProcedimentoDTO->retStrStaNivelAcessoLocalProtocolo(); | ||
71 | + $objProcedimentoDTO->retNumIdHipoteseLegalProtocolo(); | ||
72 | + | ||
73 | + $objProcedimentoDTO->setDblIdProcedimento($dblIdProcedimento); | ||
74 | + $objProcedimentoDTO->setStrSinDocTodos('S'); | ||
75 | + $objProcedimentoDTO->setStrSinProcAnexados('S'); | ||
76 | + //$objProcedimentoDTO->setStrSinDocAnexos('S'); | ||
77 | + //$objProcedimentoDTO->setStrSinDocConteudo('S'); | ||
78 | + | ||
79 | + $objProcedimentoRN = new ProcedimentoRN(); | ||
80 | + $arr = $objProcedimentoRN->listarCompleto($objProcedimentoDTO); | ||
81 | + | ||
82 | + if (count($arr)==0){ | ||
83 | + //SessaoSEIExterna::getInstance()->sair(null, 'Processo não encontrado.'); | ||
84 | + die('Processo não encontrado.'); | ||
85 | + } | ||
86 | + | ||
87 | + $objProcedimentoDTO = $arr[0]; | ||
88 | + | ||
89 | + if($objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo() == ProtocoloRN::$NA_SIGILOSO ){ | ||
90 | + | ||
91 | + die('Processo não encontrado.'); | ||
92 | + | ||
93 | + } | ||
94 | + | ||
95 | + if(!$bolLinkMetadadosProcessoRestrito || !$bolPesquisaProcessoRestrito){ | ||
96 | + if ($objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo()!= ProtocoloRN::$NA_PUBLICO){ | ||
97 | + die('Processo não encontrado.'); | ||
98 | + } | ||
99 | + } | ||
100 | + | ||
101 | + | ||
102 | + | ||
103 | + | ||
104 | + | ||
105 | + | ||
106 | + //Carregar interessados no processo | ||
107 | + $objInteressadosParticipanteDTO = new ParticipanteDTO(); | ||
108 | + $objInteressadosParticipanteDTO->retStrNomeContato(); | ||
109 | + $objInteressadosParticipanteDTO->setDblIdProtocolo($dblIdProcedimento); | ||
110 | + $objInteressadosParticipanteDTO->setStrStaParticipacao(ParticipanteRN::$TP_INTERESSADO); | ||
111 | + | ||
112 | + | ||
113 | + $objInteressadosParticipanteRN = new ParticipanteRN(); | ||
114 | + | ||
115 | + $objInteressadosParticipanteDTO = $objInteressadosParticipanteRN->listarRN0189($objInteressadosParticipanteDTO); | ||
116 | + | ||
117 | + if (count($objInteressadosParticipanteDTO)==0){ | ||
118 | + $strInteressados = ' '; | ||
119 | + }else{ | ||
120 | + $strInteressados = ''; | ||
121 | + foreach($objInteressadosParticipanteDTO as $objInteressadoParticipanteDTO){ | ||
122 | + $strInteressados .= $objInteressadoParticipanteDTO->getStrNomeContato()."<br /> "; | ||
123 | + } | ||
124 | + } | ||
125 | + | ||
126 | + | ||
127 | + //Mensagem Processo Restrito | ||
128 | + $strMensagemProcessoRestrito = ''; | ||
129 | + $strHipoteseLegal = ''; | ||
130 | + if($objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo() == ProtocoloRN::$NA_RESTRITO && $bolLinkMetadadosProcessoRestrito){ | ||
131 | + | ||
132 | + $objHipoteseLegalDTO = new HipoteseLegalDTO(); | ||
133 | + $objHipoteseLegalDTO->setNumIdHipoteseLegal($objProcedimentoDTO->getNumIdHipoteseLegalProtocolo()); | ||
134 | + $objHipoteseLegalDTO->retStrBaseLegal(); | ||
135 | + $objHipoteseLegalDTO->retStrNome(); | ||
136 | + | ||
137 | + $objHipoteseLegalRN = new HipoteseLegalRN(); | ||
138 | + $objHipoteseLegalDTO = $objHipoteseLegalRN->consultar($objHipoteseLegalDTO); | ||
139 | + | ||
140 | + if($objHipoteseLegalDTO != null){ | ||
141 | + | ||
142 | + $strHipoteseLegal .= '<img src="/infra_css/imagens/espaco.gif">'; | ||
143 | + $strHipoteseLegal .= '<img src="imagens/sei_chave_restrito.gif" align="absbottom" title="Acesso Restrito.
'.PaginaSEIExterna::getInstance()->formatarXHTML($objHipoteseLegalDTO->getStrNome().' ('.$objHipoteseLegalDTO->getStrBaseLegal().')').'">'; | ||
144 | + | ||
145 | + } | ||
146 | + | ||
147 | + $strMensagemProcessoRestrito = '<p style="font-size: 1.2em;"> '.$txtDescricaoProcessoAcessoRestrito.'</p>'; | ||
148 | + | ||
149 | + } | ||
150 | + | ||
151 | + | ||
152 | + $strResultadoCabecalho = ''; | ||
153 | + $strResultadoCabecalho .= '<table id="tblCabecalho" width="99.3%" class="infraTable" summary="Cabeçalho de Processo" >'."\n"; | ||
154 | + $strResultadoCabecalho .= '<tr><th class="infraTh" colspan="2">Autuação</th></tr>'."\n"; | ||
155 | + $strResultadoCabecalho .= '<tr class="infraTrClara"><td width="20%">Processo:</td><td>'.$objProcedimentoDTO->getStrProtocoloProcedimentoFormatado().$strHipoteseLegal.'</td></tr>'."\n"; | ||
156 | + $strResultadoCabecalho .= '<tr class="infraTrClara"><td width="20%">Tipo:</td><td>'.PaginaSEIExterna::getInstance()->formatarXHTML($objProcedimentoDTO->getStrNomeTipoProcedimento()).'</td></tr>'."\n"; | ||
157 | + $strResultadoCabecalho .= '<tr class="infraTrClara"><td width="20%">Data de Registro:</td><td>'.$objProcedimentoDTO->getDtaGeracaoProtocolo().'</td></tr>'."\n"; | ||
158 | + $strResultadoCabecalho .= '<tr class="infraTrClara"><td width="20%">Interessados:</td><td> '.$strInteressados.'</td></tr>'."\n"; | ||
159 | + $strResultadoCabecalho .= '</table>'."\n"; | ||
160 | + | ||
161 | + | ||
162 | + | ||
163 | + | ||
164 | + | ||
165 | + | ||
166 | + //$arrObjDocumentoDTO = InfraArray::indexarArrInfraDTO($objProcedimentoDTO->getArrObjDocumentoDTO(),'IdDocumento'); | ||
167 | + $arrObjRelProtocoloProtocoloDTO = array(); | ||
168 | + | ||
169 | + if($bolListaDocumentoProcessoPublico && $objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo() == ProtocoloRN::$NA_PUBLICO ){ | ||
170 | + $arrObjRelProtocoloProtocoloDTO = $objProcedimentoDTO->getArrObjRelProtocoloProtocoloDTO(); | ||
171 | + }else if($bolListaDocumentoProcessoRestrito && $objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo() == ProtocoloRN::$NA_RESTRITO){ | ||
172 | + $arrObjRelProtocoloProtocoloDTO = $objProcedimentoDTO->getArrObjRelProtocoloProtocoloDTO(); | ||
173 | + } | ||
174 | + | ||
175 | + // Objeto Fake para paginação. | ||
176 | + $objProtocoloPesquisaPublicaPaginacaoDTO = new ProtocoloPesquisaPublicaDTO(); | ||
177 | + $objProtocoloPesquisaPublicaPaginacaoDTO->retTodos(true); | ||
178 | + PaginaSEIExterna::getInstance()->prepararOrdenacao($objProtocoloPesquisaPublicaPaginacaoDTO, 'Registro', InfraDTO::$TIPO_ORDENACAO_ASC); | ||
179 | + //PaginaSEIExterna::getInstance()->prepararPaginacao($objProtocoloPesquisaPublicaPaginacaoDTO,4); | ||
180 | + //PaginaSEIExterna::getInstance()->processarPaginacao($objProtocoloPesquisaPublicaPaginacaoDTO); | ||
181 | + $arrObjProtocoloPesquisaPublicaDTO = array(); | ||
182 | + | ||
183 | + $objDocumentoRN = new DocumentoRN(); | ||
184 | + | ||
185 | + $numProtocolos = 0; | ||
186 | + $numDocumentosPdf = 0; | ||
187 | + $strCssMostrarAcoes = '.colunaAcoes {display:none;}'."\n"; | ||
188 | + | ||
189 | + $strThCheck = PaginaSEIExterna::getInstance()->getThCheck(); | ||
190 | + | ||
191 | + foreach($arrObjRelProtocoloProtocoloDTO as $objRelProtocoloProtocoloDTO){ | ||
192 | + | ||
193 | + if ($objRelProtocoloProtocoloDTO->getStrStaAssociacao()==RelProtocoloProtocoloRN::$TA_DOCUMENTO_ASSOCIADO){ | ||
194 | + | ||
195 | + $objDocumentoDTO = $objRelProtocoloProtocoloDTO->getObjProtocoloDTO2(); | ||
196 | + //valida documentos para retornar | ||
197 | + if ($objDocumentoRN->verificarSelecaoAcessoExterno($objDocumentoDTO)){ | ||
198 | + | ||
199 | + $objProtocoloPesquisaPublicaDTO = new ProtocoloPesquisaPublicaDTO(); | ||
200 | + $objProtocoloPesquisaPublicaDTO->setStrNumeroSEI($objDocumentoDTO->getStrProtocoloDocumentoFormatado()); | ||
201 | + $objProtocoloPesquisaPublicaDTO->setStrTipoDocumento(PaginaSEIExterna::getInstance()->formatarXHTML($objDocumentoDTO->getStrNomeSerie().' '.$objDocumentoDTO->getStrNumero())); | ||
202 | + | ||
203 | + | ||
204 | + if($objDocumentoDTO->getStrStaProtocoloProtocolo() == ProtocoloRN::$TP_DOCUMENTO_RECEBIDO){ | ||
205 | + | ||
206 | + $objAtributoAndamentoDTO = new AtributoAndamentoDTO(); | ||
207 | + $objAtributoAndamentoDTO->setDblIdProtocoloAtividade($objProcedimentoDTO->getDblIdProcedimento()); | ||
208 | + $objAtributoAndamentoDTO->setNumIdTarefaAtividade(TarefaRN::$TI_RECEBIMENTO_DOCUMENTO); | ||
209 | + $objAtributoAndamentoDTO->setStrNome("DOCUMENTO"); | ||
210 | + $objAtributoAndamentoDTO->setStrIdOrigem($objDocumentoDTO->getDblIdDocumento()); | ||
211 | + | ||
212 | + $objAtributoAndamentoDTO->retDthAberturaAtividade(); | ||
213 | + | ||
214 | + $objAtributoAndamentoRN = new AtributoAndamentoRN(); | ||
215 | + | ||
216 | + $objAtributoAndamentoDTO = $objAtributoAndamentoRN->consultarRN1366($objAtributoAndamentoDTO); | ||
217 | + | ||
218 | + if($objAtributoAndamentoDTO != null && $objAtributoAndamentoDTO->isSetDthAberturaAtividade()){ | ||
219 | + | ||
220 | + $dtaRecebimento = substr($objAtributoAndamentoDTO->getDthAberturaAtividade(),0,10); | ||
221 | + | ||
222 | + $objProtocoloPesquisaPublicaDTO->setDtaRegistro($dtaRecebimento); | ||
223 | + | ||
224 | + }else{ | ||
225 | + | ||
226 | + $objProtocoloPesquisaPublicaDTO->setDtaRegistro($objDocumentoDTO->getDtaGeracaoProtocolo()); | ||
227 | + } | ||
228 | + | ||
229 | + $objProtocoloPesquisaPublicaDTO->setDtaDocumento($objDocumentoDTO->getDtaGeracaoProtocolo()); | ||
230 | + | ||
231 | + }else if ($objDocumentoDTO->getStrStaProtocoloProtocolo() == ProtocoloRN::$TP_DOCUMENTO_GERADO){ | ||
232 | + | ||
233 | + $objAssinaturaDTO = new AssinaturaDTO(); | ||
234 | + $objAssinaturaDTO->setDblIdDocumento($objDocumentoDTO->getDblIdDocumento()); | ||
235 | + $objAssinaturaDTO->setOrdNumIdAssinatura(InfraDTO::$TIPO_ORDENACAO_ASC); | ||
236 | + $objAssinaturaDTO->retDthAberturaAtividade(); | ||
237 | + | ||
238 | + $objAssinaturaRN = new AssinaturaRN(); | ||
239 | + $arrObjAssinaturaDTO = $objAssinaturaRN->listarRN1323($objAssinaturaDTO); | ||
240 | + | ||
241 | + if(is_array($arrObjAssinaturaDTO) && count($arrObjAssinaturaDTO) > 0) { | ||
242 | + | ||
243 | + $objAssinaturaDTO = $arrObjAssinaturaDTO[0]; | ||
244 | + | ||
245 | + if($objAssinaturaDTO != null && $objAssinaturaDTO->isSetDthAberturaAtividade()){ | ||
246 | + | ||
247 | + $dtaAssinatura = substr($objAssinaturaDTO->getDthAberturaAtividade(),0,10); | ||
248 | + | ||
249 | + $objProtocoloPesquisaPublicaDTO->setDtaRegistro($dtaAssinatura); | ||
250 | + $objProtocoloPesquisaPublicaDTO->setDtaDocumento($dtaAssinatura); | ||
251 | + | ||
252 | + }else{ | ||
253 | + $objProtocoloPesquisaPublicaDTO->setDtaRegistro($objDocumentoDTO->getDtaGeracaoProtocolo()); | ||
254 | + $objProtocoloPesquisaPublicaDTO->setDtaDocumento($objDocumentoDTO->getDtaGeracaoProtocolo()); | ||
255 | + } | ||
256 | + }else{ | ||
257 | + | ||
258 | + $objProtocoloPesquisaPublicaDTO->setDtaRegistro($objDocumentoDTO->getDtaGeracaoProtocolo()); | ||
259 | + $objProtocoloPesquisaPublicaDTO->setDtaDocumento($objDocumentoDTO->getDtaGeracaoProtocolo()); | ||
260 | + } | ||
261 | + | ||
262 | + | ||
263 | + | ||
264 | + | ||
265 | + } | ||
266 | + | ||
267 | + | ||
268 | + $objProtocoloPesquisaPublicaDTO->setStrUnidade($objDocumentoDTO->getStrSiglaUnidadeGeradoraProtocolo()); | ||
269 | + $objProtocoloPesquisaPublicaDTO->setStrStaAssociacao($objRelProtocoloProtocoloDTO->getStrStaAssociacao()); | ||
270 | + $objProtocoloPesquisaPublicaDTO->setObjDocumentoDTO($objDocumentoDTO); | ||
271 | + | ||
272 | + | ||
273 | + $arrObjProtocoloPesquisaPublicaDTO[] = $objProtocoloPesquisaPublicaDTO; | ||
274 | + $numProtocolos++; | ||
275 | + } | ||
276 | + }else if ($objRelProtocoloProtocoloDTO->getStrStaAssociacao()==RelProtocoloProtocoloRN::$TA_PROCEDIMENTO_ANEXADO){ | ||
277 | + | ||
278 | + $objProcedimentoDTOAnexado = $objRelProtocoloProtocoloDTO->getObjProtocoloDTO2(); | ||
279 | + | ||
280 | + $objProtocoloPesquisaPublicaDTO = new ProtocoloPesquisaPublicaDTO(); | ||
281 | + $objProtocoloPesquisaPublicaDTO->setStrNumeroSEI($objProcedimentoDTOAnexado->getStrProtocoloProcedimentoFormatado()); | ||
282 | + $objProtocoloPesquisaPublicaDTO->setStrTipoDocumento(PaginaSEIExterna::getInstance()->formatarXHTML($objProcedimentoDTOAnexado->getStrNomeTipoProcedimento())); | ||
283 | + $objProtocoloPesquisaPublicaDTO->setDtaDocumento($objProcedimentoDTOAnexado->getDtaGeracaoProtocolo()); | ||
284 | + $objProtocoloPesquisaPublicaDTO->setDtaRegistro($objProcedimentoDTOAnexado->getDtaGeracaoProtocolo()); | ||
285 | + $objProtocoloPesquisaPublicaDTO->setStrUnidade($objProcedimentoDTOAnexado->getStrSiglaUnidadeGeradoraProtocolo()); | ||
286 | + $objProtocoloPesquisaPublicaDTO->setStrStaAssociacao($objRelProtocoloProtocoloDTO->getStrStaAssociacao()); | ||
287 | + $objProtocoloPesquisaPublicaDTO->setObjProcedimentoDTO($objProcedimentoDTOAnexado); | ||
288 | + | ||
289 | + $arrObjProtocoloPesquisaPublicaDTO[] = $objProtocoloPesquisaPublicaDTO; | ||
290 | + | ||
291 | + | ||
292 | + $numProtocolos++; | ||
293 | + } | ||
294 | + } | ||
295 | + | ||
296 | + | ||
297 | + if ($numProtocolos > 0){ | ||
298 | + | ||
299 | + | ||
300 | + | ||
301 | + $strResultado = '<table id="tblDocumentos" width="99.3%" class="infraTable" summary="Lista de Documentos" > | ||
302 | + <caption class="infraCaption" >'.PaginaSEIExterna::getInstance()->gerarCaptionTabela("Protocolos",$numProtocolos).'</caption> | ||
303 | + <tr> | ||
304 | + <th class="infraTh" width="1%">'.$strThCheck.'</th> | ||
305 | + <th class="infraTh" width="15%">'.PaginaSEIExterna::getInstance()->getThOrdenacao($objProtocoloPesquisaPublicaPaginacaoDTO,'Documento / Processo','NumeroSEI',$arrObjProtocoloPesquisaPublicaDTO,true).'</th> | ||
306 | + <th class="infraTh" width="15%">'.PaginaSEIExterna::getInstance()->getThOrdenacao($objProtocoloPesquisaPublicaPaginacaoDTO,'Tipo de Documento','TipoDocumento',$arrObjProtocoloPesquisaPublicaDTO,true).'</th> | ||
307 | + <th class="infraTh" width="15%">'.PaginaSEIExterna::getInstance()->getThOrdenacao($objProtocoloPesquisaPublicaPaginacaoDTO,'Data do Documento','Documento',$arrObjProtocoloPesquisaPublicaDTO,true).'</th> | ||
308 | + <th class="infraTh" width="15%">'.PaginaSEIExterna::getInstance()->getThOrdenacao($objProtocoloPesquisaPublicaPaginacaoDTO,'Data de Registro','Registro',$arrObjProtocoloPesquisaPublicaDTO,true).'</th> | ||
309 | + <th class="infraTh" width="15%">'.PaginaSEIExterna::getInstance()->getThOrdenacao($objProtocoloPesquisaPublicaPaginacaoDTO,'Unidade','Unidade',$arrObjProtocoloPesquisaPublicaDTO,true).'</th> | ||
310 | + | ||
311 | + </tr>'; | ||
312 | + | ||
313 | + // monta tabela documentos | ||
314 | + foreach ($arrObjProtocoloPesquisaPublicaDTO as $objProtocoloPesquisaPublicaDTO){ | ||
315 | + | ||
316 | + if($objProtocoloPesquisaPublicaDTO->getStrStaAssociacao() == RelProtocoloProtocoloRN::$TA_DOCUMENTO_ASSOCIADO){ | ||
317 | + | ||
318 | + $objDocumentoDTO = $objProtocoloPesquisaPublicaDTO->getObjDocumentoDTO(); | ||
319 | + $urlCripografadaDocumeto = Criptografia::criptografa('acao_externa=documento_exibir&id_documento='.$objDocumentoDTO->getDblIdDocumento().'&id_orgao_acesso_externo=0'); | ||
320 | + $strLinkDocumento = PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink('documento_consulta_externa.php?'.$urlCripografadaDocumeto)); | ||
321 | + | ||
322 | + $strResultado .= '<tr class="infraTrClara">'; | ||
323 | + | ||
324 | + //Cria checkbox para gerar PDF, verifica se o Processo é público e o Acesso Local do Protocolo é Público | ||
325 | + if($objDocumentoDTO->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_PUBLICO && $objProcedimentoDTO->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_PUBLICO){ | ||
326 | + if($objDocumentoRN->verificarSelecaoGeracaoPdf($objDocumentoDTO)){ | ||
327 | + $strResultado .= '<td align="center">'.PaginaSEIExterna::getInstance()->getTrCheck($numDocumentosPdf++, $objDocumentoDTO->getDblIdDocumento(), $objDocumentoDTO->getStrNomeSerie()).'</td>'; | ||
328 | + }else{ | ||
329 | + $strResultado .= '<td> </td>'; | ||
330 | + } | ||
331 | + }else{ | ||
332 | + $strResultado .= '<td> </td>'; | ||
333 | + } | ||
334 | + | ||
335 | + | ||
336 | + //Exibe link de documentos com nivel de acesso local Público de processo público | ||
337 | + if($objDocumentoDTO->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_PUBLICO && $objProcedimentoDTO->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_PUBLICO ){ | ||
338 | + $strResultado .= '<td align="center" style="padding-right:22px"><a href="javascript:void(0);" onclick="window.open(\''.$strLinkDocumento.'\');" alt="'.PaginaSEIExterna::getInstance()->formatarXHTML($objDocumentoDTO->getStrNomeSerie()).'" title="'.PaginaSEIExterna::getInstance()->formatarXHTML($objDocumentoDTO->getStrNomeSerie()).'" class="ancoraPadraoAzul">'.$objDocumentoDTO->getStrProtocoloDocumentoFormatado().'</a></td>'; | ||
339 | + }else{ | ||
340 | + if($objDocumentoDTO->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_RESTRITO){ | ||
341 | + | ||
342 | + //necessario para retornar id hipotese legal do documento | ||
343 | + $strHipoteseLegalDocumento = ''; | ||
344 | + $objProtocoloDocumentoDTO = new ProtocoloDTO(); | ||
345 | + $objProtocoloDocumentoDTO->setDblIdProtocolo($objDocumentoDTO->getDblIdDocumento()); | ||
346 | + $objProtocoloDocumentoDTO->retNumIdHipoteseLegal(); | ||
347 | + | ||
348 | + $objProtocoloRN = new ProtocoloRN(); | ||
349 | + $objProtocoloDocumentoDTO = $objProtocoloRN->consultarRN0186($objProtocoloDocumentoDTO); | ||
350 | + | ||
351 | + if($objProtocoloDocumentoDTO != null){ | ||
352 | + | ||
353 | + $objHipoteseLegaDocumentoDTO = new HipoteseLegalDTO(); | ||
354 | + $objHipoteseLegaDocumentoDTO->setNumIdHipoteseLegal($objProtocoloDocumentoDTO->getNumIdHipoteseLegal()); | ||
355 | + $objHipoteseLegaDocumentoDTO->retStrNome(); | ||
356 | + $objHipoteseLegaDocumentoDTO->retStrBaseLegal(); | ||
357 | + | ||
358 | + $objHipoteseLegalRN = new HipoteseLegalRN(); | ||
359 | + $objHipoteseLegaDocumentoDTO = $objHipoteseLegalRN->consultar($objHipoteseLegaDocumentoDTO); | ||
360 | + | ||
361 | + | ||
362 | + if($objHipoteseLegaDocumentoDTO != null){ | ||
363 | + | ||
364 | + $strHipoteseLegalDocumento .= $objHipoteseLegaDocumentoDTO->getStrNome().' ('.$objHipoteseLegaDocumentoDTO->getStrBaseLegal().')'; | ||
365 | + } | ||
366 | + } | ||
367 | + | ||
368 | + | ||
369 | + | ||
370 | + $strResultado .= '<td align="center" ><span class="retiraAncoraPadraoAzul">'.$objDocumentoDTO->getStrProtocoloDocumentoFormatado().'</span>'; | ||
371 | + $strResultado .= '<img src="/infra_css/imagens/espaco.gif">'; | ||
372 | + $strResultado .= '<img src="imagens/sei_chave_restrito.gif" align="absbottom" title="Acesso Restrito.
'.PaginaSEIExterna::getInstance()->formatarXHTML($strHipoteseLegalDocumento).'">'; | ||
373 | + $strResultado .= '</td>'; | ||
374 | + | ||
375 | + }else{ | ||
376 | + $strResultado .= '<td align="center" style="padding-right:22px" ><span class="retiraAncoraPadraoAzul">'.$objDocumentoDTO->getStrProtocoloDocumentoFormatado().'</span>'; | ||
377 | + } | ||
378 | + | ||
379 | + | ||
380 | + } | ||
381 | + | ||
382 | + $strResultado .= '<td align="center">'.PaginaSEIExterna::getInstance()->formatarXHTML($objDocumentoDTO->getStrNomeSerie().' '.$objDocumentoDTO->getStrNumero()).'</td> | ||
383 | + <td align="center">'.$objProtocoloPesquisaPublicaDTO->getDtaDocumento().'</td> | ||
384 | + <td align="center">'.$objProtocoloPesquisaPublicaDTO->getDtaRegistro().'</td> | ||
385 | + <td align="center"><a alt="'.$objDocumentoDTO->getStrDescricaoUnidadeGeradoraProtocolo().'" title="'.$objDocumentoDTO->getStrDescricaoUnidadeGeradoraProtocolo().'" class="ancoraSigla">'.$objDocumentoDTO->getStrSiglaUnidadeGeradoraProtocolo().'</a></td> | ||
386 | + <td align="center" class="colunaAcoes">'; | ||
387 | + | ||
388 | + $strResultado .='</td></tr>'; | ||
389 | + | ||
390 | + }else if($objProtocoloPesquisaPublicaDTO->getStrStaAssociacao() == RelProtocoloProtocoloRN::$TA_PROCEDIMENTO_ANEXADO){ | ||
391 | + | ||
392 | + | ||
393 | + $strResultado .= '<tr class="infraTrClara">'; | ||
394 | + $strResultado .= '<td> </td>'; | ||
395 | + $strHipoteseLegalAnexo = ''; | ||
396 | + $strProtocoloRestrito = ''; | ||
397 | + | ||
398 | + $objProcedimentoDTOAnexado = $objProtocoloPesquisaPublicaDTO->getObjProcedimentoDTO(); | ||
399 | + | ||
400 | + // cria indicação de acesso restrito com hipotese legal. | ||
401 | + if($objProcedimentoDTOAnexado->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_RESTRITO){ | ||
402 | + | ||
403 | + $strHipoteseLegalAnexo = ''; | ||
404 | + $objProtocoloAnexoDTO = new ProtocoloDTO(); | ||
405 | + $objProtocoloAnexoDTO->setDblIdProtocolo($objProcedimentoDTOAnexado->getDblIdProcedimento()); | ||
406 | + $objProtocoloAnexoDTO->retNumIdHipoteseLegal(); | ||
407 | + | ||
408 | + $objProtocoloRN = new ProtocoloRN(); | ||
409 | + $objProtocoloAnexoDTO = $objProtocoloRN->consultarRN0186($objProtocoloAnexoDTO); | ||
410 | + | ||
411 | + if($objProtocoloAnexoDTO != null){ | ||
412 | + | ||
413 | + $objHipoteseLegaAnexoDTO = new HipoteseLegalDTO(); | ||
414 | + $objHipoteseLegaAnexoDTO->setNumIdHipoteseLegal($objProtocoloAnexoDTO->getNumIdHipoteseLegal()); | ||
415 | + $objHipoteseLegaAnexoDTO->retStrNome(); | ||
416 | + $objHipoteseLegaAnexoDTO->retStrBaseLegal(); | ||
417 | + | ||
418 | + $objHipoteseLegalRN = new HipoteseLegalRN(); | ||
419 | + $objHipoteseLegaDocumentoDTO = $objHipoteseLegalRN->consultar($objHipoteseLegaAnexoDTO); | ||
420 | + | ||
421 | + | ||
422 | + if($objHipoteseLegaDocumentoDTO != null){ | ||
423 | + | ||
424 | + $strHipoteseLegalAnexo .= $objHipoteseLegaDocumentoDTO->getStrNome().' ('.$objHipoteseLegaDocumentoDTO->getStrBaseLegal().')'; | ||
425 | + } | ||
426 | + } | ||
427 | + $strProtocoloRestrito .= '<img src="imagens/sei_chave_restrito.gif" align="absbottom" title="Acesso Restrito.
'.$strHipoteseLegalAnexo.'">'; | ||
428 | + } | ||
429 | + | ||
430 | + if($objProcedimentoDTOAnexado->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_PUBLICO && $objProcedimentoDTO->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_PUBLICO ){ | ||
431 | + $parametrosCriptografadosProcesso = Criptografia::criptografa('id_orgao_acesso_externo=0&id_procedimento='.$objProcedimentoDTOAnexado->getDblIdProcedimento()); | ||
432 | + $urlPesquisaProcesso = 'processo_exibir.php?'.$parametrosCriptografadosProcesso; | ||
433 | + | ||
434 | + // $strLinkProcessoAnexado = PaginaSEIExterna::getInstance()->formatarXHTML(SessaoSEIExterna::getInstance()->assinarLink('processo_acesso_externo_consulta.php?id_acesso_externo='.$_GET['id_acesso_externo'].'&id_acesso_externo_assinatura='.$_GET['id_acesso_externo_assinatura'].'&id_procedimento_anexado='.$objProcedimentoDTOAnexado->getDblIdProcedimento())); | ||
435 | + | ||
436 | + $strLinkProcessoAnexado = PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink(SolrUtilExterno::prepararUrl($urlPesquisaProcesso))); | ||
437 | + | ||
438 | + | ||
439 | + $strResultado .= '<td align="center"><a href="javascript:void(0);" onclick="window.open(\''.$strLinkProcessoAnexado.'\');" alt="'.$objProcedimentoDTOAnexado->getStrNomeTipoProcedimento().'" title="'.$objProcedimentoDTOAnexado->getStrNomeTipoProcedimento().'" class="ancoraPadraoAzul">'.$objProcedimentoDTOAnexado->getStrProtocoloProcedimentoFormatado().'</a>'.$strProtocoloRestrito.'</td>'; | ||
440 | + | ||
441 | + }else{ | ||
442 | + | ||
443 | + $strResultado .= '<td align="center" style="padding-right:22px" ><span class="retiraAncoraPadraoAzul">'.PaginaSEIExterna::getInstance()->formatarXHTML($objProcedimentoDTOAnexado->getStrProtocoloProcedimentoFormatado()).' </span>'.$strProtocoloRestrito.'</td>'; | ||
444 | + | ||
445 | + } | ||
446 | + | ||
447 | + $strResultado.= '<td align="center">'.PaginaSEIExterna::getInstance()->formatarXHTML($objProcedimentoDTOAnexado->getStrNomeTipoProcedimento()).'</td> | ||
448 | + <td align="center">'.$objProtocoloPesquisaPublicaDTO->getDtaDocumento().'</td> | ||
449 | + <td align="center">'.$objProtocoloPesquisaPublicaDTO->getDtaRegistro().'</td> | ||
450 | + <td align="center"><a alt="'.$objProcedimentoDTOAnexado->getStrDescricaoUnidadeGeradoraProtocolo().'" title="'.$objProcedimentoDTOAnexado->getStrDescricaoUnidadeGeradoraProtocolo().'" class="ancoraSigla">'.$objProcedimentoDTOAnexado->getStrSiglaUnidadeGeradoraProtocolo().'</a></td> | ||
451 | + <td align="center" class="colunaAcoes"> </td>'; | ||
452 | + $strResultado .='</tr>'; | ||
453 | + | ||
454 | + } | ||
455 | + } | ||
456 | + | ||
457 | + $strResultado.='</table>'; | ||
458 | + | ||
459 | + } | ||
460 | + | ||
461 | + | ||
462 | + $arrComandos = array(); | ||
463 | + if ($numDocumentosPdf > 0){ | ||
464 | + if($bolCaptchaGerarPdf){ | ||
465 | + $strComando = '<button type="button" accesskey="G" name="btnGerarPdfModal" value="Gerar PDF" onclick="gerarPdfModal();" class="infraButton"><span class="infraTeclaAtalho">G</span>erar PDF</button>'; | ||
466 | + }else{ | ||
467 | + $strComando = '<button type="button" accesskey="G" name="btnGerarPdfModal" value="Gerar PDF" onclick="gerarPdf();" class="infraButton"><span class="infraTeclaAtalho">G</span>erar PDF</button>'; | ||
468 | + } | ||
469 | + | ||
470 | + $arrComandos[] = $strComando; | ||
471 | + | ||
472 | + } | ||
473 | + | ||
474 | + //Carregar histórico | ||
475 | + | ||
476 | + $numRegistrosAtividades = 0; | ||
477 | + | ||
478 | + | ||
479 | + if(($bolListaAndamentoProcessoPublico && $objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo() == ProtocoloRN::$NA_PUBLICO) || | ||
480 | + ($bolListaAndamentoProcessoRestrito && $objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo() == ProtocoloRN::$NA_RESTRITO) ){ | ||
481 | + | ||
482 | + $objProcedimentoHistoricoDTO = new ProcedimentoHistoricoDTO(); | ||
483 | + $objProcedimentoHistoricoDTO->setDblIdProcedimento($dblIdProcedimento); | ||
484 | + $objProcedimentoHistoricoDTO->setStrStaHistorico(ProcedimentoRN::$TH_EXTERNO); | ||
485 | + $objProcedimentoHistoricoDTO->setStrSinGerarLinksHistorico('N'); | ||
486 | + | ||
487 | + $objProcedimentoRN = new ProcedimentoRN(); | ||
488 | + $objProcedimentoDTORet = $objProcedimentoRN->consultarHistoricoRN1025($objProcedimentoHistoricoDTO); | ||
489 | + $arrObjAtividadeDTO = $objProcedimentoDTORet->getArrObjAtividadeDTO(); | ||
490 | + | ||
491 | + $numRegistrosAtividades = count($arrObjAtividadeDTO); | ||
492 | + } | ||
493 | + | ||
494 | + | ||
495 | + | ||
496 | + | ||
497 | + if ($numRegistrosAtividades > 0){ | ||
498 | + | ||
499 | + $bolCheck = false; | ||
500 | + | ||
501 | + $strResultadoAndamentos = ''; | ||
502 | + | ||
503 | + $strResultadoAndamentos .= '<table id="tblHistorico" width="99.3%" class="infraTable" summary="Histórico de Andamentos">'."\n"; | ||
504 | + $strResultadoAndamentos .= '<caption class="infraCaption">'.PaginaSEIExterna::getInstance()->gerarCaptionTabela('Andamentos',$numRegistrosAtividades).'</caption>'; | ||
505 | + $strResultadoAndamentos .= '<tr>'; | ||
506 | + $strResultadoAndamentos .= '<th class="infraTh" width="20%">Data/Hora</th>'; | ||
507 | + $strResultadoAndamentos .= '<th class="infraTh" width="10%">Unidade</th>'; | ||
508 | + $strResultadoAndamentos .= '<th class="infraTh">Descrição</th>'; | ||
509 | + $strResultadoAndamentos .= '</tr>'."\n"; | ||
510 | + | ||
511 | + $strQuebraLinha = '<span style="line-height:.5em"><br /></span>'; | ||
512 | + | ||
513 | + | ||
514 | + foreach($arrObjAtividadeDTO as $objAtividadeDTO){ | ||
515 | + | ||
516 | + //InfraDebug::getInstance()->gravar($objAtividadeDTO->getNumIdAtividade()); | ||
517 | + | ||
518 | + $strResultadoAndamentos .= "\n\n".'<!-- '.$objAtividadeDTO->getNumIdAtividade().' -->'."\n"; | ||
519 | + | ||
520 | + if ($objAtividadeDTO->getStrSinUltimaUnidadeHistorico() == 'S'){ | ||
521 | + $strAbertas = 'class="andamentoAberto"'; | ||
522 | + }else{ | ||
523 | + $strAbertas = 'class="andamentoConcluido"'; | ||
524 | + } | ||
525 | + | ||
526 | + $strResultadoAndamentos .= '<tr '.$strAbertas.'>'; | ||
527 | + $strResultadoAndamentos .= "\n".'<td align="center">'; | ||
528 | + $strResultadoAndamentos .= substr($objAtividadeDTO->getDthAbertura(),0,16); | ||
529 | + $strResultadoAndamentos .= '</td>'; | ||
530 | + | ||
531 | + $strResultadoAndamentos .= "\n".'<td align="center">'; | ||
532 | + $strResultadoAndamentos .= '<a alt="'.$objAtividadeDTO->getStrDescricaoUnidade().'" title="'.$objAtividadeDTO->getStrDescricaoUnidade().'" class="ancoraSigla">'.$objAtividadeDTO->getStrSiglaUnidade().'</a>'; | ||
533 | + $strResultadoAndamentos .= '</td>'; | ||
534 | + | ||
535 | + $strResultadoAndamentos .= "\n"; | ||
536 | + $strResultadoAndamentos .= "\n".'<td>'; | ||
537 | + | ||
538 | + if (!InfraString::isBolVazia($objAtividadeDTO->getStrNomeTarefa())){ | ||
539 | + $strResultadoAndamentos .= nl2br($objAtividadeDTO->getStrNomeTarefa()).$strQuebraLinha; | ||
540 | + } | ||
541 | + | ||
542 | + $strResultadoAndamentos .= '</td>'; | ||
543 | + | ||
544 | + $strResultadoAndamentos .= '</tr>'; | ||
545 | + } | ||
546 | + $strResultadoAndamentos .= '</table><br />'; | ||
547 | + } | ||
548 | + | ||
549 | + | ||
550 | + | ||
551 | + AuditoriaSEI::getInstance()->auditar('processo_consulta_externa', __FILE__, strip_tags($strResultadoCabecalho)."\n".strip_tags($strResultado)); | ||
552 | + | ||
553 | + if ($_POST['hdnFlagGerar']=='1'){ | ||
554 | + | ||
555 | + if(md5($_POST['txtCaptcha']) != $_POST['hdnCaptchaMd5'] && $_GET['hash'] != $_POST['hdnCaptchaMd5'] && $bolCaptchaGerarPdf == true){ | ||
556 | + PaginaSEIExterna::getInstance()->setStrMensagem('Código de confirmação inválido.'); | ||
557 | + | ||
558 | + }else { | ||
559 | + | ||
560 | + | ||
561 | + $objDocumentoRN = new DocumentoRN(); | ||
562 | + | ||
563 | + $parArrObjDocumentoDTO = InfraArray::converterArrInfraDTO(InfraArray::gerarArrInfraDTO('DocumentoDTO','IdDocumento',PaginaSEIExterna::getInstance()->getArrStrItensSelecionados()),'IdDocumento'); | ||
564 | + $objDocumentoDTO = new DocumentoDTO(); | ||
565 | + $objDocumentoDTO->retDblIdDocumento(); | ||
566 | + $objDocumentoDTO->setDblIdDocumento($parArrObjDocumentoDTO, InfraDTO::$OPER_IN); | ||
567 | + $objDocumentoDTO->retDblIdProcedimento(); | ||
568 | + $objDocumentoDTO->retStrStaNivelAcessoGlobalProtocolo(); | ||
569 | + $objDocumentoDTO->retStrStaNivelAcessoLocalProtocolo(); | ||
570 | + $arrObjDocumentoDTO = $objDocumentoRN->listarRN0008($objDocumentoDTO); | ||
571 | + | ||
572 | + foreach ($arrObjDocumentoDTO as $objDocumentoDTO){ | ||
573 | + | ||
574 | + //Alterardo para atender o pedido da anatel para gerar pdf de documentos de nivel de acesso local = Público e de Procedimentos Públicos mesmo se o nivel global for restrito | ||
575 | + if($bolListaDocumentoProcessoRestrito){ | ||
576 | + if($objDocumentoDTO->getDblIdProcedimento() != $dblIdProcedimento || $objDocumentoDTO->getStrStaNivelAcessoLocalProtocolo() != ProtocoloRN::$NA_PUBLICO || $objProcedimentoDTO->getStrStaNivelAcessoLocalProtocolo() != ProtocoloRN::$NA_PUBLICO){ | ||
577 | + die ("Erro ao Gerar Pdf"); | ||
578 | + } | ||
579 | + }else if($bolListaDocumentoProcessoPublico){ | ||
580 | + if($objDocumentoDTO->getDblIdProcedimento() != $dblIdProcedimento || $objDocumentoDTO->getStrStaNivelAcessoGlobalProtocolo() != ProtocoloRN::$NA_PUBLICO){ | ||
581 | + die ("Erro ao Gerar Pdf"); | ||
582 | + } | ||
583 | + }else{ | ||
584 | + die ("Erro ao Gerar Pdf"); | ||
585 | + } | ||
586 | + | ||
587 | + | ||
588 | + } | ||
589 | + | ||
590 | + | ||
591 | + $objDocumentoRN = new DocumentoRN(); | ||
592 | + $objAnexoDTO = $objDocumentoRN->gerarPdf(InfraArray::gerarArrInfraDTO('DocumentoDTO','IdDocumento',PaginaSEIExterna::getInstance()->getArrStrItensSelecionados())); | ||
593 | + | ||
594 | + $bolGeracaoOK = true; | ||
595 | + | ||
596 | + } | ||
597 | + | ||
598 | + } | ||
599 | + | ||
600 | +}catch(Exception $e){ | ||
601 | + PaginaSEIExterna::getInstance()->processarExcecao($e); | ||
602 | +} | ||
603 | + | ||
604 | + | ||
605 | +PaginaSEIExterna::getInstance()->montarDocType(); | ||
606 | +PaginaSEIExterna::getInstance()->abrirHtml(); | ||
607 | +PaginaSEIExterna::getInstance()->abrirHead(); | ||
608 | +PaginaSEIExterna::getInstance()->montarMeta(); | ||
609 | +PaginaSEIExterna::getInstance()->montarTitle(':: '.PaginaSEIExterna::getInstance()->getStrNomeSistema().' - '.$strTitulo.' ::'); | ||
610 | +PaginaSEIExterna::getInstance()->montarStyle(); | ||
611 | +PaginaSEIExterna::getInstance()->abrirStyle(); | ||
612 | +echo $strCssMostrarAcoes; | ||
613 | +?> | ||
614 | + | ||
615 | +div.infraBarraSistemaE {width:90%} | ||
616 | +div.infraBarraSistemaD {width:5%} | ||
617 | +div.infraBarraComandos {width:99%} | ||
618 | + | ||
619 | +table caption { | ||
620 | + text-align:left !important; | ||
621 | + font-size: 1.2em; | ||
622 | + font-weight:bold; | ||
623 | +} | ||
624 | + | ||
625 | +.andamentoAberto { | ||
626 | + background-color:white; | ||
627 | +} | ||
628 | + | ||
629 | +.andamentoConcluido { | ||
630 | + background-color:white; | ||
631 | +} | ||
632 | + | ||
633 | + | ||
634 | +#tblCabecalho{margin-top:1;} | ||
635 | +#tblDocumentos {margin-top:1.5em;} | ||
636 | +#tblHistorico {margin-top:1.5em;} | ||
637 | + | ||
638 | +<? if($bolCaptchaGerarPdf) { ?> | ||
639 | +#lblCaptcha {position: absolute; top:30%; left: 20%; width: 80%} | ||
640 | +#txtCaptcha{position: absolute; top:56%; left: 20%; height:15%; width:56%;font-size: 3em;} | ||
641 | +#btnEnviarCaptcha {position: absolute; top:80%; left: 20%; width:56%} | ||
642 | + | ||
643 | +#divInfraModal{ | ||
644 | + | ||
645 | + display: none; | ||
646 | + position: fixed; | ||
647 | + z-index: 1; | ||
648 | + padding-top: 100px; | ||
649 | + left: 0; | ||
650 | + top: 0; | ||
651 | + width: 50%; | ||
652 | + height: 50%; | ||
653 | + overflow: auto; | ||
654 | + | ||
655 | +} | ||
656 | + | ||
657 | + | ||
658 | + | ||
659 | +.close { | ||
660 | + color: white; | ||
661 | + float: right; | ||
662 | + font-size: 28px; | ||
663 | + font-weight: bold; | ||
664 | +} | ||
665 | + | ||
666 | +.close:hover, | ||
667 | +.close:focus { | ||
668 | + color: #000; | ||
669 | + text-decoration: none; | ||
670 | + cursor: pointer; | ||
671 | +} | ||
672 | + | ||
673 | +.modal-header { | ||
674 | + padding: 2px 16px; | ||
675 | + background-image: url("imagens/bg_barra_sistema.jpg"); | ||
676 | + color: white; | ||
677 | +} | ||
678 | + | ||
679 | +.modal-body {padding: 2px 16px;} | ||
680 | + | ||
681 | +.modal-footer { | ||
682 | + padding: 2px 16px; | ||
683 | + background-color: #5cb85c; | ||
684 | + color: white; | ||
685 | +} | ||
686 | +<? } ?> | ||
687 | + | ||
688 | +span.retiraAncoraPadraoAzul{font-size: 1.2em;} | ||
689 | + | ||
690 | +<? | ||
691 | +PaginaSEIExterna::getInstance()->fecharStyle(); | ||
692 | +PaginaSEIExterna::getInstance()->montarJavaScript(); | ||
693 | +PaginaSEIExterna::getInstance()->abrirJavaScript(); | ||
694 | +?> | ||
695 | + | ||
696 | +function inicializar(){ | ||
697 | + | ||
698 | + <?if ($bolGeracaoOK){?> | ||
699 | + | ||
700 | + | ||
701 | + <!-- | ||
702 | + //window.open('<?=SessaoSEIExterna::getInstance()->assinarLink('processo_exibe_arquivo.php?id_acesso_externo='.$_GET['id_acesso_externo'].'&acao_externa=usuario_externo_exibir_arquivo&nome_arquivo='.$objAnexoDTO->getStrNome().'&nome_download=SEI-'.$objProcedimentoDTO->getStrProtocoloProcedimentoFormatado().'.pdf');?>'); | ||
703 | + --> | ||
704 | + | ||
705 | + window.open('<?=SessaoSEIExterna::getInstance()->assinarLink('processo_exibe_arquivo.php?acao_externa=usuario_externo_exibir_arquivo&acao_origem_externa=protocolo_pesquisar&id_orgao_acesso_externo=0&nome_arquivo='.$objAnexoDTO->getStrNome().'&nome_download=SEI-'.$objProcedimentoDTO->getStrProtocoloProcedimentoFormatado().'.pdf');?>'); | ||
706 | + | ||
707 | + | ||
708 | + <?}?> | ||
709 | + | ||
710 | + infraEfeitoTabelas(); | ||
711 | +} | ||
712 | + | ||
713 | + | ||
714 | +<? | ||
715 | +if($bolCaptchaGerarPdf){ | ||
716 | +?> | ||
717 | + | ||
718 | +$(document).unbind("keyup").keyup(function(e){ | ||
719 | + e.preventDefault(); | ||
720 | + var code = e.which; | ||
721 | + if(code==13){ | ||
722 | + var modal = document.getElementById('divInfraModal'); | ||
723 | + if(modal.style.display == "block"){ | ||
724 | + fecharPdfModal(); | ||
725 | + gerarPdf(); | ||
726 | + | ||
727 | + } | ||
728 | + } | ||
729 | +}); | ||
730 | + | ||
731 | + | ||
732 | + | ||
733 | +function gerarPdfModal(){ | ||
734 | + | ||
735 | + if (document.getElementById('hdnInfraItensSelecionados').value==''){ | ||
736 | + alert('Nenhum documento selecionado.'); | ||
737 | + return; | ||
738 | + } | ||
739 | + var modal = document.getElementById('divInfraModal'); | ||
740 | + modal.style.display = "block"; | ||
741 | + | ||
742 | +} | ||
743 | + | ||
744 | +function fecharPdfModal(){ | ||
745 | + | ||
746 | + var modal = document.getElementById('divInfraModal'); | ||
747 | + modal.style.display = "none"; | ||
748 | +} | ||
749 | + | ||
750 | +window.onclick = function(event) { | ||
751 | + var modal = document.getElementById('divInfraModal'); | ||
752 | + if (event.target == modal) { | ||
753 | + modal.style.display = "none"; | ||
754 | + } | ||
755 | +} | ||
756 | + | ||
757 | +<? | ||
758 | +} | ||
759 | +?> | ||
760 | + | ||
761 | +function gerarPdf() { | ||
762 | + | ||
763 | + if (document.getElementById('hdnInfraItensSelecionados').value==''){ | ||
764 | + alert('Nenhum documento selecionado.'); | ||
765 | + return; | ||
766 | + } | ||
767 | + | ||
768 | + <? | ||
769 | + if($bolCaptchaGerarPdf){ | ||
770 | + ?> | ||
771 | + fecharPdfModal(); | ||
772 | + <? | ||
773 | + } | ||
774 | + ?> | ||
775 | + | ||
776 | + infraExibirAviso(false); | ||
777 | + | ||
778 | + document.getElementById('hdnFlagGerar').value = '1'; | ||
779 | + document.getElementById('frmProcessoAcessoExternoConsulta').submit(); | ||
780 | +} | ||
781 | + | ||
782 | +<? | ||
783 | +PaginaSEIExterna::getInstance()->fecharJavaScript(); | ||
784 | +PaginaSEIExterna::getInstance()->fecharHead(); | ||
785 | +PaginaSEIExterna::getInstance()->abrirBody($strTitulo,'onload="inicializar();"'); | ||
786 | +?> | ||
787 | + | ||
788 | +<form id="frmProcessoAcessoExternoConsulta" method="post"> | ||
789 | +<? | ||
790 | +if($bolCaptchaGerarPdf){ | ||
791 | + echo ' | ||
792 | + <div id="divInfraModal" class="infraFundoTransparente" style="position: fixed; width: 100%; height: 100%; visibility: visible;"> | ||
793 | + <div id="divCaptcha" class="infraAreaDados" style="height: 220px; width: 230px; background-color:white"> | ||
794 | + <div class="modal-header"> | ||
795 | + <span id="spnClose" class="close" onclick="fecharPdfModal();">×</span> | ||
796 | + <h2 style ="color: white;font-size: 1.2em;font-weight: bold;">Digite o Código da Imagem</h2> | ||
797 | + </div> | ||
798 | + <div class="modal-body"> | ||
799 | + <label id="lblCaptcha" accesskey="" class="infraLabelObrigatorio"> | ||
800 | + <img src="/infra_js/infra_gerar_captcha.php?codetorandom='.$strCodigoParaGeracaoCaptcha.'" alt="Não foi possível carregar imagem de confirmação" /> </label> | ||
801 | + <input type="text" id="txtCaptcha" name="txtCaptcha" class="infraText" maxlength="4" value="" /> | ||
802 | + <button id="btnEnviarCaptcha" type="submit" accesskey="G" name="btnEnviarCaptcha" value="Enviar" onclick="gerarPdf();" class="infraButton"><span class="infraTeclaAtalho">E</span>nviar</button> | ||
803 | + </div> | ||
804 | + | ||
805 | + </div> | ||
806 | + </div> | ||
807 | + '; | ||
808 | + | ||
809 | +} | ||
810 | +PaginaSEIExterna::getInstance()->montarBarraComandosSuperior($arrComandos); | ||
811 | +echo $strResultadoCabecalho; | ||
812 | +echo $strMensagemProcessoRestrito; | ||
813 | +PaginaSEIExterna::getInstance()->montarAreaTabela($strResultado,$numProtocolos); | ||
814 | +echo $strResultadoAndamentos; | ||
815 | +?> | ||
816 | +<input type="hidden" id="hdnFlagGerar" name="hdnFlagGerar" value="0" /> | ||
817 | + <?if($bolCaptchaGerarPdf) { ?> | ||
818 | + <input type="hidden" id="hdnCaptchaMd5" name="hdnCaptchaMd5" class="infraText" value="<?=md5(InfraCaptcha::gerar($strCodigoParaGeracaoCaptcha));?>" /> | ||
819 | + <?} ?> | ||
820 | +</form> | ||
821 | +<? | ||
822 | +PaginaSEIExterna::getInstance()->montarAreaDebug(); | ||
823 | + | ||
824 | +if($bolGeracaoOK){ | ||
825 | + ?> | ||
826 | + <script> | ||
827 | + if (navigator.userAgent.match(/msie/i) || navigator.userAgent.match(/trident/i) ){ | ||
828 | + | ||
829 | + window.open('<?=SessaoSEIExterna::getInstance()->assinarLink('processo_exibe_arquivo.php?acao_externa=usuario_externo_exibir_arquivo&acao_origem_externa=protocolo_pesquisar&id_orgao_acesso_externo=0&nome_arquivo='.$objAnexoDTO->getStrNome().'&nome_download=SEI-'.$objProcedimentoDTO->getStrProtocoloProcedimentoFormatado().'.pdf');?>'); | ||
830 | + <? | ||
831 | + if($bolCaptchaGerarPdf){ | ||
832 | + ?> | ||
833 | + | ||
834 | + $(document).unbind("keyup").keyup(function(e){ | ||
835 | + e.preventDefault(); | ||
836 | + var code = e.which; | ||
837 | + if(code==13){ | ||
838 | + var modal = document.getElementById('divInfraModal'); | ||
839 | + if(modal.style.display == "block"){ | ||
840 | + fecharPdfModal(); | ||
841 | + gerarPdf(); | ||
842 | + | ||
843 | + } | ||
844 | + } | ||
845 | + }); | ||
846 | + | ||
847 | + | ||
848 | + | ||
849 | + function gerarPdfModal(){ | ||
850 | + | ||
851 | + if (document.getElementById('hdnInfraItensSelecionados').value==''){ | ||
852 | + alert('Nenhum documento selecionado.'); | ||
853 | + return; | ||
854 | + } | ||
855 | + var modal = document.getElementById('divInfraModal'); | ||
856 | + modal.style.display = "block"; | ||
857 | + | ||
858 | + } | ||
859 | + | ||
860 | + function fecharPdfModal(){ | ||
861 | + | ||
862 | + var modal = document.getElementById('divInfraModal'); | ||
863 | + modal.style.display = "none"; | ||
864 | + } | ||
865 | + | ||
866 | + window.onclick = function(event) { | ||
867 | + var modal = document.getElementById('divInfraModal'); | ||
868 | + if (event.target == modal) { | ||
869 | + modal.style.display = "none"; | ||
870 | + } | ||
871 | + } | ||
872 | + | ||
873 | + <? | ||
874 | + } | ||
875 | + ?> | ||
876 | + | ||
877 | + function gerarPdf() { | ||
878 | + | ||
879 | + if (document.getElementById('hdnInfraItensSelecionados').value==''){ | ||
880 | + alert('Nenhum documento selecionado.'); | ||
881 | + return; | ||
882 | + } | ||
883 | + | ||
884 | + <? | ||
885 | + if($bolCaptchaGerarPdf){ | ||
886 | + ?> | ||
887 | + fecharPdfModal(); | ||
888 | + <? | ||
889 | + } | ||
890 | + ?> | ||
891 | + | ||
892 | + infraExibirAviso(false); | ||
893 | + | ||
894 | + document.getElementById('hdnFlagGerar').value = '1'; | ||
895 | + document.getElementById('frmProcessoAcessoExternoConsulta').submit(); | ||
896 | + } | ||
897 | + } | ||
898 | + </script> | ||
899 | +<? | ||
900 | +} | ||
901 | +PaginaSEIExterna::getInstance()->fecharBody(); | ||
902 | +PaginaSEIExterna::getInstance()->fecharHtml(); | ||
903 | +?> | ||
0 | \ No newline at end of file | 904 | \ No newline at end of file |
@@ -0,0 +1,701 @@ | @@ -0,0 +1,701 @@ | ||
1 | +<? | ||
2 | +/** | ||
3 | + * CONSELHO ADMINISTRATIVO DE DEFESA ECONÔMICA | ||
4 | + * 2014-09-29 | ||
5 | + * Versão do Gerador de Código: 1.0 | ||
6 | + * Versão no CVS/SVN: | ||
7 | + * | ||
8 | + * sei | ||
9 | + * pesquisa | ||
10 | + * processo_pesquisar | ||
11 | + * | ||
12 | + * | ||
13 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
14 | + */ | ||
15 | + | ||
16 | +/** | ||
17 | + * Pagina de apresentação da página de pesquisa. | ||
18 | + * | ||
19 | + * | ||
20 | + * @package Cade_pesquisa_processo_pesquisar | ||
21 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
22 | + * @license Creative Commons Atribuição 3.0 não adaptada | ||
23 | + * <http://creativecommons.org/licenses/by/3.0/deed.pt_BR> | ||
24 | + * @ignore Este código é livre para uso sem nenhuma restrição, | ||
25 | + * salvo pelas informações a seguir referentes | ||
26 | + * @copyright Conselho Administrativo de Defesa Econômica ©2014-2018 | ||
27 | + * <http://www.cade.gov.br> | ||
28 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
29 | + */ | ||
30 | + | ||
31 | + | ||
32 | +try { | ||
33 | + require_once dirname(__FILE__).'/../../SEI.php'; | ||
34 | + require_once dirname(__FILE__).'/BuscaProtocoloExterno.php'; | ||
35 | + require_once ("ConverteURI.php"); | ||
36 | + | ||
37 | +// session_start(); | ||
38 | + | ||
39 | + SessaoSEIExterna::getInstance()->validarSessao(); | ||
40 | + | ||
41 | +// InfraDebug::getInstance()->setBolLigado(false); | ||
42 | +// InfraDebug::getInstance()->setBolDebugInfra(false); | ||
43 | +// InfraDebug::getInstance()->limpar(); | ||
44 | + | ||
45 | + $objParametroPesquisaDTO = new ParametroPesquisaDTO(); | ||
46 | + $objParametroPesquisaDTO->retStrNome(); | ||
47 | + $objParametroPesquisaDTO->retStrValor(); | ||
48 | + | ||
49 | + $objParametroPesquisaRN = new ParametroPesquisaRN(); | ||
50 | + $arrObjParametroPesquisaDTO = $objParametroPesquisaRN->listar($objParametroPesquisaDTO); | ||
51 | + | ||
52 | + $arrParametroPesquisaDTO = InfraArray::converterArrInfraDTO($arrObjParametroPesquisaDTO,'Valor','Nome'); | ||
53 | + | ||
54 | + $bolCaptcha = $arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_CAPTCHA] == 'S' ? true : false; | ||
55 | + $bolAutocompletarInterressado = $arrParametroPesquisaDTO[ParametroPesquisaRN::$TA_AUTO_COMPLETAR_INTERESSADO] == 'S' ? true : false; | ||
56 | + | ||
57 | + | ||
58 | + // SessaoSEIExterna::getInstance()->validarLink(); | ||
59 | + PesquisaUtil::valiadarLink(); | ||
60 | + | ||
61 | + PaginaSEIExterna::getInstance()->setBolXHTML(false); | ||
62 | + | ||
63 | + if($bolCaptcha) { | ||
64 | + $strCodigoParaGeracaoCaptcha = InfraCaptcha::obterCodigo(); | ||
65 | + $md5Captcha = md5(InfraCaptcha::gerar($strCodigoParaGeracaoCaptcha)); | ||
66 | + }else { | ||
67 | + $md5Captcha = null; | ||
68 | + } | ||
69 | + if (isset($_POST['hdnFlagPesquisa']) || isset($_POST['sbmLimpar'])){ | ||
70 | + | ||
71 | + if(isset($_POST['sbmLimpar'])){ | ||
72 | + | ||
73 | + PaginaSEIExterna::getInstance()->limparCampos(); | ||
74 | + PaginaSEIExterna::getInstance()->salvarCampo('rdoData', ''); | ||
75 | + PaginaSEIExterna::getInstance()->salvarCampo('chkSinProcessos', 'P'); | ||
76 | + | ||
77 | + | ||
78 | + }else{ | ||
79 | + | ||
80 | + PaginaSEIExterna::getInstance()->salvarCampo('chkSinProcessos', $_POST['chkSinProcessos']); | ||
81 | + PaginaSEIExterna::getInstance()->salvarCampo('chkSinDocumentosGerados', $_POST['chkSinDocumentosGerados']); | ||
82 | + PaginaSEIExterna::getInstance()->salvarCampo('chkSinDocumentosRecebidos', $_POST['chkSinDocumentosRecebidos']); | ||
83 | + | ||
84 | + PaginaSEIExterna::getInstance()->salvarCamposPost(array('q', | ||
85 | + 'txtParticipante', | ||
86 | + 'hdnIdParticipante', | ||
87 | + 'txtAssinante', | ||
88 | + 'hdnIdAssinante', | ||
89 | + 'txtDescricaoPesquisa', | ||
90 | + 'txtObservacaoPesquisa', | ||
91 | + 'txtAssunto', | ||
92 | + 'hdnIdAssunto', | ||
93 | + 'txtUnidade', | ||
94 | + 'hdnIdUnidade', | ||
95 | + 'txtProtocoloPesquisa', | ||
96 | + 'selTipoProcedimentoPesquisa', | ||
97 | + 'selSeriePesquisa', | ||
98 | + 'txtNumeroDocumentoPesquisa', | ||
99 | + 'rdoData', | ||
100 | + 'txtDataInicio', | ||
101 | + 'txtDataFim', | ||
102 | + 'hdnSiglasUsuarios', | ||
103 | + 'txtSiglaUsuario1', | ||
104 | + 'txtSiglaUsuario2', | ||
105 | + 'txtSiglaUsuario3', | ||
106 | + 'txtSiglaUsuario4' | ||
107 | + )); | ||
108 | + | ||
109 | + } | ||
110 | + | ||
111 | + | ||
112 | + }else{ | ||
113 | + | ||
114 | + PaginaSEIExterna::getInstance()->salvarCampo('q', ''); | ||
115 | + PaginaSEIExterna::getInstance()->salvarCampo('txtProtocoloPesquisa', $strProtocoloFormatadoLimpo); | ||
116 | + PaginaSEIExterna::getInstance()->salvarCampo('chkSinProcessos', 'P'); | ||
117 | + PaginaSEIExterna::getInstance()->salvarCampo('chkSinDocumentosGerados', ''); | ||
118 | + PaginaSEIExterna::getInstance()->salvarCampo('chkSinDocumentosRecebidos', ''); | ||
119 | + PaginaSEIExterna::getInstance()->salvarCampo('txtParticipante', ''); | ||
120 | + PaginaSEIExterna::getInstance()->salvarCampo('hdnIdParticipante', ''); | ||
121 | + PaginaSEIExterna::getInstance()->salvarCampo('txtAssinante', ''); | ||
122 | + PaginaSEIExterna::getInstance()->salvarCampo('hdnIdAssinante', ''); | ||
123 | + PaginaSEIExterna::getInstance()->salvarCampo('txtDescricaoPesquisa', ''); | ||
124 | + PaginaSEIExterna::getInstance()->salvarCampo('txtObservacaoPesquisa', ''); | ||
125 | + PaginaSEIExterna::getInstance()->salvarCampo('txtAssunto', ''); | ||
126 | + PaginaSEIExterna::getInstance()->salvarCampo('hdnIdAssunto', ''); | ||
127 | + PaginaSEIExterna::getInstance()->salvarCampo('txtUnidade', ''); | ||
128 | + PaginaSEIExterna::getInstance()->salvarCampo('hdnIdUnidade', ''); | ||
129 | + //PaginaSEIExterna::getInstance()->salvarCampo('txtProtocoloPesquisa', ''); | ||
130 | + PaginaSEIExterna::getInstance()->salvarCampo('selTipoProcedimentoPesquisa', ''); | ||
131 | + PaginaSEIExterna::getInstance()->salvarCampo('selSeriePesquisa', ''); | ||
132 | + PaginaSEIExterna::getInstance()->salvarCampo('txtNumeroDocumentoPesquisa', ''); | ||
133 | + PaginaSEIExterna::getInstance()->salvarCampo('rdoData', ''); | ||
134 | + PaginaSEIExterna::getInstance()->salvarCampo('txtDataInicio', ''); | ||
135 | + PaginaSEIExterna::getInstance()->salvarCampo('txtDataFim', ''); | ||
136 | + PaginaSEIExterna::getInstance()->salvarCampo('txtSiglaUsuario1', ''); | ||
137 | + PaginaSEIExterna::getInstance()->salvarCampo('txtSiglaUsuario2', ''); | ||
138 | + PaginaSEIExterna::getInstance()->salvarCampo('txtSiglaUsuario3', ''); | ||
139 | + PaginaSEIExterna::getInstance()->salvarCampo('txtSiglaUsuario4', ''); | ||
140 | + PaginaSEIExterna::getInstance()->salvarCampo('hdnSiglasUsuarios', ''); | ||
141 | + } | ||
142 | + | ||
143 | + | ||
144 | + switch($_GET['acao_externa']){ | ||
145 | + | ||
146 | + case 'protocolo_pesquisar': | ||
147 | + case 'protocolo_pesquisa_rapida': | ||
148 | + | ||
149 | + | ||
150 | + $strTitulo = 'Pesquisa Pública'; | ||
151 | + | ||
152 | + | ||
153 | + // Altero os caracteres 'Coringas' por aspas Duplas para não dar erro de Js no IE | ||
154 | + $strPalavrasPesquisa = str_replace("$*",'\"',PaginaSEIExterna::getInstance()->recuperarCampo('q')); | ||
155 | + $strSinProcessos = PaginaSEIExterna::getInstance()->recuperarCampo('chkSinProcessos'); | ||
156 | + $strSinDocumentosGerados = PaginaSEIExterna::getInstance()->recuperarCampo('chkSinDocumentosGerados'); | ||
157 | + $strSinDocumentosRecebidos = PaginaSEIExterna::getInstance()->recuperarCampo('chkSinDocumentosRecebidos'); | ||
158 | + $strIdParticipante = PaginaSEIExterna::getInstance()->recuperarCampo('hdnIdParticipante'); | ||
159 | + $strNomeParticipante = PaginaSEIExterna::getInstance()->recuperarCampo('txtParticipante'); | ||
160 | + $strIdAssinante = PaginaSEIExterna::getInstance()->recuperarCampo('hdnIdAssinante'); | ||
161 | + $strNomeAssinante = PaginaSEIExterna::getInstance()->recuperarCampo('txtAssinante'); | ||
162 | + $strDescricaoPesquisa = PaginaSEIExterna::getInstance()->recuperarCampo('txtDescricaoPesquisa'); | ||
163 | + $strObservacaoPesquisa = PaginaSEIExterna::getInstance()->recuperarCampo('txtObservacaoPesquisa'); | ||
164 | + $strIdAssunto = PaginaSEIExterna::getInstance()->recuperarCampo('hdnIdAssunto'); | ||
165 | + $strDescricaoAssunto = PaginaSEIExterna::getInstance()->recuperarCampo('txtAssunto'); | ||
166 | + $strIdUnidade = PaginaSEIExterna::getInstance()->recuperarCampo('hdnIdUnidade'); | ||
167 | + $strDescricaoUnidade = PaginaSEIExterna::getInstance()->recuperarCampo('txtUnidade'); | ||
168 | + $strProtocoloPesquisa = PaginaSEIExterna::getInstance()->recuperarCampo('txtProtocoloPesquisa'); | ||
169 | + $numIdTipoProcedimento = PaginaSEIExterna::getInstance()->recuperarCampo('selTipoProcedimentoPesquisa','null'); | ||
170 | + $numIdSerie = PaginaSEIExterna::getInstance()->recuperarCampo('selSeriePesquisa','null'); | ||
171 | + $strNumeroDocumentoPesquisa = PaginaSEIExterna::getInstance()->recuperarCampo('txtNumeroDocumentoPesquisa'); | ||
172 | + $strStaData = PaginaSEIExterna::getInstance()->recuperarCampo('rdoData'); | ||
173 | + $strDataInicio = PaginaSEIExterna::getInstance()->recuperarCampo('txtDataInicio'); | ||
174 | + $strDataFim = PaginaSEIExterna::getInstance()->recuperarCampo('txtDataFim'); | ||
175 | + $strSiglaUsuario1 = PaginaSEIExterna::getInstance()->recuperarCampo('txtSiglaUsuario1'); | ||
176 | + $strSiglaUsuario2 = PaginaSEIExterna::getInstance()->recuperarCampo('txtSiglaUsuario2'); | ||
177 | + $strSiglaUsuario3 = PaginaSEIExterna::getInstance()->recuperarCampo('txtSiglaUsuario3'); | ||
178 | + $strSiglaUsuario4 = PaginaSEIExterna::getInstance()->recuperarCampo('txtSiglaUsuario4'); | ||
179 | + $strUsuarios = PaginaSEIExterna::getInstance()->recuperarCampo('hdnSiglasUsuarios'); | ||
180 | + $strParticipanteSolr = ''; | ||
181 | + | ||
182 | + //Opção de Auto Completar Interressado | ||
183 | + if(!$bolAutocompletarInterressado){ | ||
184 | + | ||
185 | + if(!InfraString::isBolVazia($strNomeParticipante)){ | ||
186 | + $strParticipanteSolr = PesquisaUtil::buscaParticipantes($strNomeParticipante); | ||
187 | + } | ||
188 | + | ||
189 | + } | ||
190 | + | ||
191 | + | ||
192 | + | ||
193 | + $strDisplayAvancado = 'block'; | ||
194 | + $bolPreencheuAvancado = false; | ||
195 | + if (($strSinProcessos=='P' || $strSinDocumentosGerados=='G' || $strSinDocumentosRecebidos=='R') && | ||
196 | + !InfraString::isBolVazia($strIdParticipante) || | ||
197 | + !InfraString::isBolVazia($strParticipanteSolr) || | ||
198 | + !InfraString::isBolVazia($strIdAssinante) || | ||
199 | + !InfraString::isBolVazia($strDescricaoPesquisa) || | ||
200 | + !InfraString::isBolVazia($strObservacaoPesquisa) || | ||
201 | + !InfraString::isBolVazia($strIdAssunto) || | ||
202 | + !InfraString::isBolVazia($strIdUnidade) || | ||
203 | + !InfraString::isBolVazia($strProtocoloPesquisa) || | ||
204 | + !InfraString::isBolVazia($numIdTipoProcedimento) || | ||
205 | + !InfraString::isBolVazia($numIdSerie) || | ||
206 | + !InfraString::isBolVazia($strNumeroDocumentoPesquisa) || | ||
207 | + !InfraString::isBolVazia($strDataInicio) || | ||
208 | + !InfraString::isBolVazia($strDataFim) || | ||
209 | + !InfraString::isBolVazia(str_replace(',','',$strUsuarios))){ | ||
210 | + | ||
211 | + //$strDisplayAvancado = 'none'; | ||
212 | + $bolPreencheuAvancado = true; | ||
213 | + } | ||
214 | + | ||
215 | + $q = PaginaSEIExterna::getInstance()->recuperarCampo('q'); | ||
216 | + | ||
217 | + $inicio = intval($_REQUEST["inicio"]); | ||
218 | + | ||
219 | + $strResultado = ''; | ||
220 | + | ||
221 | + if (isset($_POST['sbmPesquisar']) || ($_GET['acao_origem_externa'] == "protocolo_pesquisar_paginado")){ | ||
222 | + | ||
223 | + if(md5($_POST['txtCaptcha']) != $_POST['hdnCaptchaMd5'] && $_GET['hash'] != $_POST['hdnCaptchaMd5'] && $bolCaptcha == true){ | ||
224 | + PaginaSEIExterna::getInstance()->setStrMensagem('Código de confirmação inválido.'); | ||
225 | + }else{ | ||
226 | + //preencheu palavra de busca ou alguma opção avançada | ||
227 | + if (!InfraString::isBolVazia($q) || $bolPreencheuAvancado) { | ||
228 | + | ||
229 | + try{ | ||
230 | + $strResultado = BuscaProtocoloExterno::executar($q, $strDescricaoPesquisa, $strObservacaoPesquisa, $inicio, 100, $strParticipanteSolr,$md5Captcha); | ||
231 | + }catch(Exception $e){ | ||
232 | + LogSEI::getInstance()->gravar(InfraException::inspecionar($e)); | ||
233 | + throw new InfraException('Erro realizando pesquisa.',$e); | ||
234 | + } | ||
235 | + | ||
236 | + | ||
237 | + } | ||
238 | + | ||
239 | + | ||
240 | + | ||
241 | +// if(strpos($strResultado, 'sem-resultado')){ | ||
242 | + | ||
243 | +// $strResultado = ''; | ||
244 | +// } | ||
245 | + | ||
246 | + | ||
247 | + } | ||
248 | + | ||
249 | + | ||
250 | + } | ||
251 | + | ||
252 | + | ||
253 | + | ||
254 | + break; | ||
255 | + | ||
256 | + default: | ||
257 | + throw new InfraException("Ação '".$_GET['acao']."' não reconhecida."); | ||
258 | + } | ||
259 | + | ||
260 | + $strItensSelTipoProcedimento = TipoProcedimentoINT::montarSelectNome('null',' ',$numIdTipoProcedimento); | ||
261 | + $strItensSelSerie = SerieINT::montarSelectNomeRI0802('null',' ',$numIdSerie); | ||
262 | + | ||
263 | + $strLinkAjaxContatos = SessaoSEIExterna::getInstance()->assinarLink('controlador_ajax_externo.php?acao_ajax_externo=contato_auto_completar_contexto_pesquisa&id_orgao_acesso_externo=0'); | ||
264 | + $strLinkAjaxUnidade = SessaoSEIExterna::getInstance()->assinarLink('controlador_ajax_externo.php?acao_ajax_externo=unidade_auto_completar_todas&id_orgao_acesso_externo=0'); | ||
265 | + | ||
266 | + $strLinkAjuda = PaginaSEIExterna::getInstance()->formatarXHTML(SessaoSEIExterna::getInstance()->assinarLink('ajuda_exibir_externo.php?acao_externa=pesquisa_solr_ajuda_externa&id_orgao_acesso_externo=0')); | ||
267 | + | ||
268 | + if ($strStaData=='0'){ | ||
269 | + $strDisplayPeriodoExplicito = $strDisplayAvancado; | ||
270 | + }else{ | ||
271 | + $strDisplayPeriodoExplicito = 'none'; | ||
272 | + } | ||
273 | + | ||
274 | + | ||
275 | + | ||
276 | + | ||
277 | + | ||
278 | +}catch(Exception $e){ | ||
279 | + PaginaSEIExterna::getInstance()->processarExcecao($e); | ||
280 | +} | ||
281 | +PaginaSEIExterna::getInstance()->montarDocType(); | ||
282 | +PaginaSEIExterna::getInstance()->abrirHtml(); | ||
283 | +PaginaSEIExterna::getInstance()->abrirHead(); | ||
284 | +PaginaSEIExterna::getInstance()->montarMeta(); | ||
285 | +PaginaSEIExterna::getInstance()->montarTitle(':: '.PaginaSEIExterna::getInstance()->getStrNomeSistema().' - '.$strTitulo.' ::'); | ||
286 | +PaginaSEIExterna::getInstance()->montarStyle(); | ||
287 | +PaginaSEIExterna::getInstance()->abrirStyle(); | ||
288 | +?> | ||
289 | + | ||
290 | +#lblPalavrasPesquisa{position:absolute;left:0%;top:4%;width:20%;} | ||
291 | +#q{position:absolute;left:21%;top:1%;width:60%;} | ||
292 | +#ancAjuda{position:absolute;left:82%;top:%;} | ||
293 | +#sbmPesquisar {position:absolute;left:86%;top:5%; width:10%;} | ||
294 | +#lnkAvancado {position:absolute;left:96%;top:5%;display:none;} | ||
295 | + | ||
296 | +#lblPesquisarEm {position:absolute;left:0%;top:17%;width:20%;} | ||
297 | +#divSinProcessos {position:absolute;left:21%;top:15%;} | ||
298 | +#divSinDocumentosGerados {position:absolute;left:38%;top:15%;} | ||
299 | +#divSinDocumentosRecebidos {position:absolute;left:61%;top:15%;} | ||
300 | + | ||
301 | +#lblParticipante {position:absolute;left:0%;top:28%;width:20%;} | ||
302 | +#txtParticipante {position:absolute;left:21%;top:27%;width:60%;} | ||
303 | + | ||
304 | + | ||
305 | + | ||
306 | +#lblUnidade {position:absolute;left:0%;top:40%;width:20%;} | ||
307 | +#txtUnidade{position:absolute;left:21%;top:39%;width:60%;} | ||
308 | +#lblProtocoloPesquisa{position:absolute;left:0%;top:50%;width:20%;} | ||
309 | +#txtProtocoloPesquisa{position:absolute;left:21%;top:35%;width:20%;} | ||
310 | +#lblProtocoloPesquisaComplemento {position:absolute;left:42%;top:14%;width:25%;} | ||
311 | +#lblAssinante {position:absolute;left:0%;top:18%;width:20%;} | ||
312 | +#txtAssinante {position:absolute;left:21%;top:17%;width:60%;} | ||
313 | +#lblDescricaoPesquisa {position:absolute;left:0%;top:26%;width:20%;} | ||
314 | +#txtDescricaoPesquisa {position:absolute;left:21%;top:25%;width:60%;} | ||
315 | +#ancAjudaDescricao{position:absolute;left:82%;top:25%;} | ||
316 | +#lblObservacaoPesquisa {position:absolute;left:0%;top:34%;width:20%;} | ||
317 | +#txtObservacaoPesquisa {position:absolute;left:21%;top:33%;width:60%;} | ||
318 | +#ancAjudaObservacao {position:absolute;left:82%;top:33%;} | ||
319 | +#lblAssunto {position:absolute;left:0%;top:42%;width:20%;} | ||
320 | +#txtAssunto {position:absolute;left:21%;top:41%;width:60%;} | ||
321 | +#imgPesquisarAssuntos {position:absolute;top:41%;left:82%;} | ||
322 | +#lblTipoProcedimentoPesquisa {position:absolute;left:0%;top:52%;width:20%;} | ||
323 | +#selTipoProcedimentoPesquisa {position:absolute;left:21%;top:51%;width:60.5%;} | ||
324 | +#lblSeriePesquisa {position:absolute;left:0%;top:64%;width:20%;} | ||
325 | +#selSeriePesquisa {position:absolute;left:21%;top:63%;width:60.5%;} | ||
326 | + | ||
327 | +#lblNumeroDocumentoPesquisa | ||
328 | +{position:absolute;left:0%;top:76%;width:20%;} | ||
329 | +#txtNumeroDocumentoPesquisa | ||
330 | +{position:absolute;left:21%;top:75%;width:20%;} #lblData | ||
331 | +{position:absolute;left:0%;top:76%;width:20%;} #divOptPeriodoExplicito | ||
332 | +{position:absolute;left:21%;top:75%;} #divOptPeriodo30 | ||
333 | +{position:absolute;left:40%;top:75%;} #divOptPeriodo60 | ||
334 | +{position:absolute;left:55%;top:75%;} #txtDataInicio | ||
335 | +{position:absolute;left:21%;top:0%;width:9%;} #imgDataInicio | ||
336 | +{position:absolute;left:31%;top:10%;} #lblDataE | ||
337 | +{position:absolute;left:33%;top:10%;width:1%;} #txtDataFim | ||
338 | +{position:absolute;left:35%;top:0%;width:9%;} #imgDataFim | ||
339 | +{position:absolute;left:45%;top:10%;} #lblSiglaUsuario | ||
340 | +{position:absolute;left:0%;top:0%;width:20%;} #txtSiglaUsuario1 | ||
341 | +{position:absolute;left:21%;top:0%;width:9%;} #txtSiglaUsuario2 | ||
342 | +{position:absolute;left:31%;top:0%;width:9%;} #txtSiglaUsuario3 | ||
343 | +{position:absolute;left:41%;top:0%;width:9%;} #txtSiglaUsuario4 | ||
344 | +{position:absolute;left:51%;top:0%;width:9%;} | ||
345 | + | ||
346 | +#divAvancado {display: <?=$strDisplayAvancado?>;} | ||
347 | +#divPeriodoExplicito {display:<?=$strDisplayPeriodoExplicito?>;} | ||
348 | +#divUsuario {display:<?=$strDisplayAvancado?>;} | ||
349 | +#lnkAvancado{ border-bottom: 1px solid transparent; color: #0000b0;text-decoration: none; } | ||
350 | +.sugestao{ font-size: 1.2em; } | ||
351 | +div#conteudo > div.barra { border-bottom: .1em solid #909090; font-size: 1.2em; margin:0 0 .5em 0; padding: 0 0 .5em 0; text-align: right; } | ||
352 | +div#conteudo > div.paginas { border-top: .1em solid #909090; margin: 0 0 5em; padding:.5em 0 0 0; text-align: center; font-size: 1.2em; } | ||
353 | +div#conteudo > div.sem-resultado { font-size:1.2em; margin: .5em 0 0 0; } | ||
354 | +div#conteudo table { border-collapse: collapse; border-spacing: 0px; } | ||
355 | +div#conteudo > table { margin: 0 0 .5em; width: 100%; } | ||
356 | +table.resultado td {background: #f0f0f0; padding: .3em .5em; } | ||
357 | +div#conteudo > table > tbody > tr:first-child > td { background: #e0e0e0; } | ||
358 | +tr.resTituloRegistro td {background: #e0e0e0; } | ||
359 | +div#conteudo a.protocoloAberto, div#conteudo a.protocoloNormal{ font-size:1.1em !important; } | ||
360 | +div#conteudo a.protocoloAberto:hover, div#conteudo a.protocoloNormal:hover{text-decoration:underline !important; } | ||
361 | +div#conteudo td.metatag > table{ border-collapse: collapse; margin: 0px auto; white-space: nowrap; } | ||
362 | + | ||
363 | +div#conteudo td.metatag > table { text-align: left; width:75%; } | ||
364 | + | ||
365 | +div#conteudo td.metatag > table > tbody > tr > td { color: #333333; font-size: .9em; padding: 0 2em; width:30%; } | ||
366 | +div#conteudo td.metatag > table > tbody > tr > td:first-child { width:45%; } | ||
367 | +div#conteudo td.metatag > table > tbody > tr > td > b { color: #006600; font-weight:normal; } | ||
368 | +span.pequeno { font-size: .9em; } | ||
369 | +div#mensagem { background:#e0e0e0; border-color: #c0c0c0; border-style: solid; border-width: .1em; margin: 4em auto 0; padding: 2em; } | ||
370 | +div#mensagem > span.pequeno { color:#909090; font-size: .9em; } | ||
371 | +td.resTituloEsquerda img.arvore { margin:0px 5px -3px 0px; } | ||
372 | +td.resTituloDireita { text-align:right; width:20%; } | ||
373 | + | ||
374 | +div.paginas, div.paginas * { font-size: 12px; } div.paginas b {font-weight: bold; } | ||
375 | +div.paginas a { border-bottom: 1px solid transparent; color: #000080; text-decoration: none; } | ||
376 | +div.paginas a:hover { border-bottom: 1px solid #000000; color: #800000; } | ||
377 | +td.resSnippet b { font-weight:bold; } | ||
378 | +#divInfraAreaTabela tr.infraTrClara td {padding:.3em;} | ||
379 | +#divInfraAreaTabela table.infraTable {border-spacing:0;} | ||
380 | + | ||
381 | +<? if($bolCaptcha) { ?> | ||
382 | +#sbmPesquisar {position:absolute;left:86%;top:42%;width:10%;font-size: 1.2em} | ||
383 | +#sbmLimpar {position:absolute;left:86%;top:52%; width:10%;font-size: 1.2em} | ||
384 | +#lblCodigo {position:absolute;left:86%;top:8%;width:10%;} | ||
385 | +#lblCaptcha {position:absolute;left:86%;top:0%;} | ||
386 | +#txtCaptcha{position:absolute;left:86%;top:18%;width:10%;height:18%;font-size:3em;} | ||
387 | +<?}else { ?> | ||
388 | +#sbmPesquisar {position:absolute;left:86%;top:10%;width:10%;font-size: 1.2em} | ||
389 | +#sbmLimpar {position:absolute;left:86%;top:70%; width:10%;font-size: 1.2em} | ||
390 | +<?} ?> | ||
391 | + | ||
392 | +<? | ||
393 | +PaginaSEIExterna::getInstance()->fecharStyle(); | ||
394 | + | ||
395 | +PaginaSEIExterna::getInstance()->montarJavaScript(); | ||
396 | +PaginaSEIExterna::getInstance()->adicionarJavaScript('solr/js/sistema.js'); | ||
397 | +PaginaSEIExterna::getInstance()->abrirJavaScript(); | ||
398 | +?> | ||
399 | + | ||
400 | + | ||
401 | +var objAutoCompletarInteressadoRI1225 = null; | ||
402 | +var objAutoCompletarUsuario = null; | ||
403 | +var objAutoCompletarAssuntoRI1223 = null; | ||
404 | +var objAutoCompletarUnidade = null; | ||
405 | + | ||
406 | + | ||
407 | + | ||
408 | +function inicializar(){ | ||
409 | + | ||
410 | + | ||
411 | + infraOcultarMenuSistemaEsquema(); | ||
412 | + | ||
413 | + <?if($bolAutocompletarInterressado) {?> | ||
414 | + | ||
415 | + //Interessado/Remetente | ||
416 | + objAutoCompletarInteressadoRI1225 = new infraAjaxAutoCompletar('hdnIdParticipante','txtParticipante','<?=$strLinkAjaxContatos?>'); | ||
417 | + //objAutoCompletarInteressadoRI1225.maiusculas = true; | ||
418 | + //objAutoCompletarInteressadoRI1225.mostrarAviso = true; | ||
419 | + //objAutoCompletarInteressadoRI1225.tempoAviso = 1000; | ||
420 | + //objAutoCompletarInteressadoRI1225.tamanhoMinimo = 3; | ||
421 | + objAutoCompletarInteressadoRI1225.limparCampo = true; | ||
422 | + //objAutoCompletarInteressadoRI1225.bolExecucaoAutomatica = false; | ||
423 | + | ||
424 | + | ||
425 | + | ||
426 | + objAutoCompletarInteressadoRI1225.prepararExecucao = function(){ | ||
427 | + return 'palavras_pesquisa='+document.getElementById('txtParticipante').value; | ||
428 | + }; | ||
429 | + objAutoCompletarInteressadoRI1225.selecionar('<?=$strIdParticipante;?>','<?=PaginaSEI::getInstance()->formatarParametrosJavascript($strNomeParticipante)?>'); | ||
430 | + | ||
431 | + <?}?> | ||
432 | + | ||
433 | + //Unidades | ||
434 | + objAutoCompletarUnidade = new infraAjaxAutoCompletar('hdnIdUnidade','txtUnidade','<?=$strLinkAjaxUnidade?>'); | ||
435 | + | ||
436 | + | ||
437 | + objAutoCompletarUnidade.limparCampo = true; | ||
438 | + objAutoCompletarUnidade.prepararExecucao = function(){ | ||
439 | + return 'palavras_pesquisa='+document.getElementById('txtUnidade').value; | ||
440 | + }; | ||
441 | + objAutoCompletarUnidade.selecionar('<?=$strIdUnidade;?>','<?=PaginaSEIExterna::getInstance()->formatarParametrosJavascript($strDescricaoUnidade)?>'); | ||
442 | + | ||
443 | + document.getElementById('txtProtocoloPesquisa').focus(); | ||
444 | + | ||
445 | + | ||
446 | + //remover a string null dos combos | ||
447 | + document.getElementById('selTipoProcedimentoPesquisa').options[0].value=''; | ||
448 | + document.getElementById('selSeriePesquisa').options[0].value=''; | ||
449 | + | ||
450 | + infraProcessarResize(); | ||
451 | + | ||
452 | + | ||
453 | + <? if ($strLinkVisualizarSigilosoPublicado != ''){ ?> | ||
454 | + infraAbrirJanela('<?=$strLinkVisualizarSigilosoPublicado?>','janelaSigilosoPublicado',750,550,'location=0,status=1,resizable=1,scrollbars=1',false); | ||
455 | + <? } ?> | ||
456 | + | ||
457 | + | ||
458 | + sistemaInicializar(); | ||
459 | + | ||
460 | + | ||
461 | +} | ||
462 | + | ||
463 | + | ||
464 | +function tratarPeriodo(valor){ | ||
465 | + if (valor=='0'){ | ||
466 | + document.getElementById('divPeriodoExplicito').style.display='block'; | ||
467 | + document.getElementById('txtDataInicio').value=''; | ||
468 | + document.getElementById('txtDataFim').value=''; | ||
469 | + }else if (valor =='30'){ | ||
470 | + document.getElementById('divPeriodoExplicito').style.display='none'; | ||
471 | + document.getElementById('txtDataInicio').value='<?php echo ProtocoloINT::calcularDataInicial(30); ?>'; | ||
472 | + document.getElementById('txtDataFim').value='<?php echo date('d/m/Y'); ?>'; | ||
473 | + }else if (valor =='60'){ | ||
474 | + document.getElementById('divPeriodoExplicito').style.display='none'; | ||
475 | + document.getElementById('txtDataInicio').value='<?php echo ProtocoloINT::calcularDataInicial(60); ?>'; | ||
476 | + document.getElementById('txtDataFim').value='<?php echo date('d/m/Y'); ?>'; | ||
477 | + } | ||
478 | +} | ||
479 | + | ||
480 | +function sugerirUsuario(obj){ | ||
481 | + if (infraTrim(obj.value)==''){ | ||
482 | + obj.value = '<?=SessaoSEIExterna::getInstance()->getStrSiglaUsuario()?>'; | ||
483 | + } | ||
484 | +} | ||
485 | + | ||
486 | + | ||
487 | + | ||
488 | +function obterUsuarios(){ | ||
489 | + var objHdnUsuarios = document.getElementById('hdnSiglasUsuarios'); | ||
490 | + objHdnUsuarios.value = ''; | ||
491 | + | ||
492 | + if (document.getElementById('txtSiglaUsuario1').value != ''){ | ||
493 | + if (objHdnUsuarios.value == ''){ | ||
494 | + objHdnUsuarios.value += infraTrim(document.getElementById('txtSiglaUsuario1').value); | ||
495 | + }else { | ||
496 | + objHdnUsuarios.value += ',' + infraTrim(document.getElementById('txtSiglaUsuario1').value); | ||
497 | + } | ||
498 | + } | ||
499 | + if (document.getElementById('txtSiglaUsuario2').value != ''){ | ||
500 | + if (objHdnUsuarios.value == ''){ | ||
501 | + objHdnUsuarios.value += infraTrim(document.getElementById('txtSiglaUsuario2').value); | ||
502 | + }else { | ||
503 | + objHdnUsuarios.value += ',' + infraTrim(document.getElementById('txtSiglaUsuario2').value); | ||
504 | + } | ||
505 | + } | ||
506 | + if (document.getElementById('txtSiglaUsuario3').value != ''){ | ||
507 | + if (objHdnUsuarios.value == ''){ | ||
508 | + objHdnUsuarios.value += infraTrim(document.getElementById('txtSiglaUsuario3').value); | ||
509 | + }else { | ||
510 | + objHdnUsuarios.value += ',' + infraTrim(document.getElementById('txtSiglaUsuario3').value); | ||
511 | + } | ||
512 | + } | ||
513 | + if (document.getElementById('txtSiglaUsuario4').value != ''){ | ||
514 | + if (objHdnUsuarios.value == ''){ | ||
515 | + objHdnUsuarios.value += infraTrim(document.getElementById('txtSiglaUsuario4').value); | ||
516 | + }else { | ||
517 | + objHdnUsuarios.value += ',' + infraTrim(document.getElementById('txtSiglaUsuario4').value); | ||
518 | + } | ||
519 | + } | ||
520 | +} | ||
521 | + | ||
522 | + | ||
523 | + | ||
524 | + | ||
525 | + | ||
526 | + | ||
527 | + | ||
528 | + | ||
529 | +function onSubmitForm(){ | ||
530 | + | ||
531 | + if (!document.getElementById('chkSinProcessos').checked && !document.getElementById('chkSinDocumentosGerados').checked && !document.getElementById('chkSinDocumentosRecebidos').checked){ | ||
532 | + alert('Selecione pelo menos uma das opções de pesquisa avançada: Processos, Documentos Gerados ou Documento Recebidos'); | ||
533 | + return false; | ||
534 | + } | ||
535 | + | ||
536 | + limpaFields(); | ||
537 | + return partialFields(); | ||
538 | + | ||
539 | +} | ||
540 | + | ||
541 | +function exibirAvancado(){ | ||
542 | + | ||
543 | + if (document.getElementById('divAvancado').style.display=='none'){ | ||
544 | + document.getElementById('divAvancado').style.display = 'block'; | ||
545 | + | ||
546 | + if (document.getElementById('optPeriodoExplicito').checked){ | ||
547 | + document.getElementById('divPeriodoExplicito').style.display='block'; | ||
548 | + }else{ | ||
549 | + document.getElementById('divPeriodoExplicito').style.display='none'; | ||
550 | + } | ||
551 | + document.getElementById('divUsuario').style.display = 'block'; | ||
552 | + | ||
553 | + }else{ | ||
554 | + document.getElementById('divAvancado').style.display = 'none'; | ||
555 | + document.getElementById('divPeriodoExplicito').style.display='none'; | ||
556 | + document.getElementById('divUsuario').style.display='none'; | ||
557 | + document.getElementById('txtProtocoloPesquisa').focus(); | ||
558 | + } | ||
559 | + | ||
560 | + infraProcessarResize(); | ||
561 | +} | ||
562 | + | ||
563 | +<? | ||
564 | +PaginaSEIExterna::getInstance()->fecharJavaScript(); | ||
565 | +PaginaSEIExterna::getInstance()->fecharHead(); | ||
566 | +PaginaSEIExterna::getInstance()->abrirBody($strTitulo,'onload="inicializar();"'); | ||
567 | +?> | ||
568 | + <form id="seiSearch" name="seiSearch" method="post" onsubmit="return onSubmitForm();" action="<?=PaginaSEIExterna::getInstance()->formatarXHTML(SessaoSEIExterna::getInstance()->assinarLink('processo_pesquisar.php?acao_externa='.$_GET['acao_externa'].'&acao_origem_externa='.$_GET['acao_externa'].$strParametros))?>"> | ||
569 | + <br /> | ||
570 | + <br /> | ||
571 | + | ||
572 | + <div id="divGeral" class="infraAreaDados" style="height: 3.2em; width: 99%; overflow: visible;"> | ||
573 | + <label id="lblProtocoloPesquisa" for="txtProtocoloPesquisa" accesskey="" class="infraLabelOpcional">Nº do Processo ou Documento:</label> | ||
574 | + <input type="text" id="txtProtocoloPesquisa" name="txtProtocoloPesquisa" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strProtocoloPesquisa);?>" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
575 | + | ||
576 | + <?if($bolCaptcha) { ?> | ||
577 | + <label id="lblCaptcha" accesskey="" class="infraLabelObrigatorio"> | ||
578 | + <img src="/infra_js/infra_gerar_captcha.php?codetorandom=<?=$strCodigoParaGeracaoCaptcha;?>" alt="Não foi possível carregar imagem de confirmação" /> </label> | ||
579 | + <?} else {?> | ||
580 | + <input type="submit" id="sbmPesquisar"name="sbmPesquisar" value="Pesquisar" class="infraButton" /> | ||
581 | + <input type="submit" id="sbmLimpar"name="sbmLimpar" value="Limpar Campos" class="infraButton" /> | ||
582 | + <?}?> | ||
583 | + | ||
584 | + | ||
585 | + </div> | ||
586 | + <div id="divAvancado" class="infraAreaDados" style="height: 20em; width: 99%;"> | ||
587 | + <?if($bolCaptcha) { ?> | ||
588 | + <label id="lblCodigo" for="txtCaptcha" accesskey="" class="infraLabelOpcional">Digite o código acima:</label> | ||
589 | + <input type="text" id="txtCaptcha" name="txtCaptcha" class="infraText" maxlength="4" value="" /> | ||
590 | + <input type="submit" id="sbmPesquisar"name="sbmPesquisar" value="Pesquisar" class="infraButton" /> | ||
591 | + <input type="submit" id="sbmLimpar"name="sbmLimpar" value="Limpar Campos" class="infraButton" /> | ||
592 | + <?}?> | ||
593 | + | ||
594 | + | ||
595 | + <label id="lblPalavrasPesquisa" for="q" accesskey="" class="infraLabelOpcional">Pesquisa Livre:</label> | ||
596 | + <input type="text" id="q" name="q" class="infraText" value="<?=str_replace('\\','',str_replace('"','"',PaginaSEIExterna::tratarHTML($strPalavrasPesquisa)))?>" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
597 | + <a id="ancAjuda" href="<?=$strLinkAjuda?>" target="janAjuda" title="Ajuda para Pesquisa" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>"> | ||
598 | + <img src="<?=PaginaSEIExterna::getInstance()->getDiretorioImagensGlobal()?>/ajuda.gif" class="infraImg" /> | ||
599 | + </a> | ||
600 | + | ||
601 | + <label id="lblPesquisarEm" accesskey="" class="infraLabelObrigatorio">Pesquisar em:</label> | ||
602 | + | ||
603 | + <div id="divSinProcessos" class="infraDivCheckbox"> | ||
604 | + <input type="checkbox" id="chkSinProcessos" name="chkSinProcessos" value="P" class="infraCheckbox" <?=($strSinProcessos=='P'?'checked="checked"':'')?> tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
605 | + <label id="lblSinProcessos" for="chkSinProcessos" accesskey="" class="infraLabelCheckbox">Processos</label> | ||
606 | + </div> | ||
607 | + <div id="divSinDocumentosGerados" class="infraDivCheckbox" title="Documento nato do Sei"> | ||
608 | + <input type="checkbox" id="chkSinDocumentosGerados" name="chkSinDocumentosGerados" value="G" class="infraCheckbox" <?=($strSinDocumentosGerados=='G'?'checked="checked"':'')?> tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
609 | + <label id="lblSinDocumentosGerados" for="chkSinDocumentosGerados" accesskey="" class="infraLabelCheckbox">Documentos Gerados</label> | ||
610 | + </div> | ||
611 | + | ||
612 | + <div id="divSinDocumentosRecebidos" class="infraDivCheckbox" title="Arquivo anexo"> | ||
613 | + <input type="checkbox" id="chkSinDocumentosRecebidos" name="chkSinDocumentosRecebidos" value="R" class="infraCheckbox" <?=($strSinDocumentosRecebidos=='R'?'checked="checked"':'')?> tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
614 | + <label id="lblSinDocumentosRecebidos" for="chkSinDocumentosRecebidos" accesskey="" class="infraLabelCheckbox">Documentos Externos</label> | ||
615 | + </div> | ||
616 | + | ||
617 | + | ||
618 | + | ||
619 | + <label id="lblParticipante" for="txtParticipante" accesskey="" class="infraLabelOpcional">Interessado / Remetente:</label> | ||
620 | + <input type="text" id="txtParticipante" name="txtParticipante" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strNomeParticipante);?>" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
621 | + <input type="hidden" id="hdnIdParticipante" name="hdnIdParticipante" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strIdParticipante)?>" /> | ||
622 | + | ||
623 | + | ||
624 | + <label id="lblUnidade" for="txtUnidade" class="infraLabelOpcional">Unidade:</label> | ||
625 | + <input type="text" id="txtUnidade" name="txtUnidade" class="infraText" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" value="<?=PaginaSEIExterna::tratarHTML($strDescricaoUnidade)?>" /> | ||
626 | + <input type="hidden" id="hdnIdUnidade" name="hdnIdUnidade" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strIdUnidade)?>" /> | ||
627 | + | ||
628 | + <label id="lblTipoProcedimentoPesquisa" for="selTipoProcedimentoPesquisa" accesskey="" class="infraLabelOpcional">Tipo do Processo:</label> | ||
629 | + <select id="selTipoProcedimentoPesquisa" name="selTipoProcedimentoPesquisa" class="infraSelect" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" > | ||
630 | + <?=$strItensSelTipoProcedimento?> | ||
631 | + </select> | ||
632 | + | ||
633 | + <label id="lblSeriePesquisa" for="selSeriePesquisa" accesskey="" class="infraLabelOpcional">Tipo do Documento:</label> | ||
634 | + <select id="selSeriePesquisa" name="selSeriePesquisa" class="infraSelect" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" > | ||
635 | + <?=$strItensSelSerie?> | ||
636 | + </select> | ||
637 | + | ||
638 | + <label id="lblData" class="infraLabelOpcional">Data:</label> | ||
639 | + | ||
640 | + <div id="divOptPeriodoExplicito" class="infraDivRadio"> | ||
641 | + <input type="radio" name="rdoData" id="optPeriodoExplicito" value="0" onclick="tratarPeriodo(this.value);" <?=($strStaData=='0'?'checked="checked"':'')?> class="infraRadio"/> | ||
642 | + <label id="lblPeriodoExplicito" accesskey="" for="optPeriodoExplicito" class="infraLabelRadio" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>">Período explícito</label> | ||
643 | + </div> | ||
644 | + | ||
645 | + <div id="divOptPeriodo30" class="infraDivRadio"> | ||
646 | + <input type="radio" name="rdoData" id="optPeriodo30" value="30" onclick="tratarPeriodo(this.value);" <?=($strStaData=='30'?'checked="checked"':'')?> class="infraRadio"/> | ||
647 | + <label id="lblPeriodo30" accesskey="" for="optPeriodo30" class="infraLabelRadio" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>">30 dias</label> | ||
648 | + </div> | ||
649 | + | ||
650 | + <div id="divOptPeriodo60" class="infraDivRadio"> | ||
651 | + <input type="radio" name="rdoData" id="optPeriodo60" value="60" onclick="tratarPeriodo(this.value);" <?=($strStaData=='60'?'checked="checked"':'')?> class="infraRadio"/> | ||
652 | + <label id="lblPeriodo60" accesskey="" for="optPeriodo60" class="infraLabelRadio" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>">60 dias</label> | ||
653 | + </div> | ||
654 | + </div> | ||
655 | + | ||
656 | + <div id="divPeriodoExplicito" class="infraAreaDados" style="height:2.5em;width:99%;top:50%;margin-top:-20px"> | ||
657 | + <input type="text" id="txtDataInicio" name="txtDataInicio" onkeypress="return infraMascaraData(this, event)" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strDataInicio);?>" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
658 | + <img id="imgDataInicio" src="/infra_css/imagens/calendario.gif" onclick="infraCalendario('txtDataInicio',this);" alt="Selecionar Data Inicial" title="Selecionar Data Inicial" class="infraImg" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
659 | + <label id="lblDataE" for="txtDataE" accesskey="" class="infraLabelOpcional"> e </label> | ||
660 | + <input type="text" id="txtDataFim" name="txtDataFim" onkeypress="return infraMascaraData(this, event)" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strDataFim);?>" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
661 | + <img id="imgDataFim" src="/infra_css/imagens/calendario.gif" onclick="infraCalendario('txtDataFim',this);" alt="Selecionar Data Final" title="Selecionar Data Final" class="infraImg" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
662 | + </div> | ||
663 | + | ||
664 | + | ||
665 | + <input type="hidden" id="txtNumeroDocumentoPesquisa" name="txtNumeroDocumentoPesquisa" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strNumeroDocumentoPesquisa);?>" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
666 | + <input type="hidden" id="txtAssinante" name="txtAssinante" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strNomeAssinante);?>" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
667 | + <input type="hidden" id="hdnIdAssinante" name="hdnIdAssinante" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strIdAssinante)?>" /> | ||
668 | + <input type="hidden" id="txtDescricaoPesquisa" name="txtDescricaoPesquisa" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strDescricaoPesquisa);?>" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
669 | + <input type="hidden" id="txtAssunto" name="txtAssunto" class="infraText" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" value="<?=PaginaSEIExterna::tratarHTML($strDescricaoAssunto)?>" /> | ||
670 | + <input type="hidden" id="hdnIdAssunto" name="hdnIdAssunto" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strIdAssunto)?>" /> | ||
671 | + <input type="hidden" id="txtSiglaUsuario1" name="txtSiglaUsuario1" onfocus="sugerirUsuario(this);" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strSiglaUsuario1);?>" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
672 | + <input type="hidden" id="txtSiglaUsuario2" name="txtSiglaUsuario2" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strSiglaUsuario2);?>" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
673 | + <input type="hidden" id="txtSiglaUsuario3" name="txtSiglaUsuario3" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strSiglaUsuario3);?>" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
674 | + <input type="hidden" id="txtSiglaUsuario4" name="txtSiglaUsuario4" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strSiglaUsuario4);?>" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
675 | + <input type="hidden" id="hdnSiglasUsuarios" name="hdnSiglasUsuarios" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strUsuarios)?>" /> | ||
676 | + <input type="hidden" id="hdnSiglasUsuarios" name="hdnSiglasUsuarios" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strUsuarios)?>" /> | ||
677 | + <?if($bolCaptcha) { ?> | ||
678 | + <input type="hidden" id="hdnCaptchaMd5" name="hdnCaptchaMd5" class="infraText" value="<?=md5(InfraCaptcha::gerar(PaginaSEIExterna::tratarHTML($strCodigoParaGeracaoCaptcha)));?>" /> | ||
679 | + <?} ?> | ||
680 | + <input id="partialfields" name="partialfields" type="hidden" value="" /> | ||
681 | + <input id="requiredfields" name="requiredfields" type="hidden" value="" /> | ||
682 | + <input id="as_q" name="as_q" type="hidden" value="" /> | ||
683 | + | ||
684 | + <input type="hidden" id="hdnFlagPesquisa" name="hdnFlagPesquisa" value="1" /> | ||
685 | +<? | ||
686 | + | ||
687 | +if($strResultado != ''){ | ||
688 | + echo '<div id="conteudo" style="width:99%;" class="infraAreaTabela">'; | ||
689 | + echo $strResultado; | ||
690 | +} | ||
691 | + | ||
692 | + | ||
693 | + | ||
694 | + | ||
695 | + PaginaSEIExterna::getInstance()->montarAreaDebug(); | ||
696 | +?> | ||
697 | + </form> | ||
698 | +<? | ||
699 | +PaginaSEIExterna::getInstance()->fecharBody(); | ||
700 | +PaginaSEIExterna::getInstance()->fecharHtml(); | ||
701 | +?> | ||
0 | \ No newline at end of file | 702 | \ No newline at end of file |
sei/web/modulos/pesquisa/rn/InstaladorModuloPesquisaPublicaRN.php
0 → 100644
@@ -0,0 +1,159 @@ | @@ -0,0 +1,159 @@ | ||
1 | +<? | ||
2 | +/** | ||
3 | + * CONSELHO ADMINISTRATIVO DE DEFESA ECONOMICA | ||
4 | + * | ||
5 | + * 29/11/2016 - criado por alex braga | ||
6 | + * | ||
7 | + * | ||
8 | + */ | ||
9 | + | ||
10 | +require_once dirname(__FILE__).'/../../../SEI.php'; | ||
11 | + | ||
12 | +class InstaladorModuloPesquisaPublicaRN extends InfraRN{ | ||
13 | + | ||
14 | + private $numSeg = 0; | ||
15 | + private $versaoAtualDesteModulo = '3.0.0'; | ||
16 | + private $nomeDesteModulo = 'Pesquisa Pública'; | ||
17 | + private $nomeParametroModulo = 'VERSAO_MODULO_PESQUISA_PUBLICA'; | ||
18 | + private $historicoVersoes = array('1.0.0','2.0.0','3.0.0'); | ||
19 | + | ||
20 | + public function __construct(){ | ||
21 | + parent::__construct(); | ||
22 | + } | ||
23 | + | ||
24 | + protected function inicializarObjInfraIBanco(){ | ||
25 | + return BancoSEI::getInstance(); | ||
26 | + } | ||
27 | + | ||
28 | + private function inicializar($strTitulo){ | ||
29 | + | ||
30 | + ini_set('max_execution_time','0'); | ||
31 | + ini_set('memory_limit','-1'); | ||
32 | + | ||
33 | + try { | ||
34 | + @ini_set('zlib.output_compression','0'); | ||
35 | + @ini_set('implicit_flush', '1'); | ||
36 | + }catch(Exception $e){} | ||
37 | + | ||
38 | + ob_implicit_flush(); | ||
39 | + | ||
40 | + InfraDebug::getInstance()->setBolLigado(true); | ||
41 | + InfraDebug::getInstance()->setBolDebugInfra(true); | ||
42 | + InfraDebug::getInstance()->setBolEcho(true); | ||
43 | + InfraDebug::getInstance()->limpar(); | ||
44 | + | ||
45 | + $this->numSeg = InfraUtil::verificarTempoProcessamento(); | ||
46 | + | ||
47 | + $this->logar($strTitulo); | ||
48 | + } | ||
49 | + | ||
50 | + private function logar($strMsg){ | ||
51 | + InfraDebug::getInstance()->gravar($strMsg); | ||
52 | + flush(); | ||
53 | + } | ||
54 | + | ||
55 | + private function finalizar($strMsg=null, $bolErro){ | ||
56 | + | ||
57 | + if (!$bolErro) { | ||
58 | + $this->numSeg = InfraUtil::verificarTempoProcessamento($this->numSeg); | ||
59 | + $this->logar('TEMPO TOTAL DE EXECUÇÃO: ' . $this->numSeg . ' s'); | ||
60 | + }else{ | ||
61 | + $strMsg = 'ERRO: '.$strMsg; | ||
62 | + } | ||
63 | + | ||
64 | + if ($strMsg!=null){ | ||
65 | + $this->logar($strMsg); | ||
66 | + } | ||
67 | + | ||
68 | + InfraDebug::getInstance()->setBolLigado(false); | ||
69 | + InfraDebug::getInstance()->setBolDebugInfra(false); | ||
70 | + InfraDebug::getInstance()->setBolEcho(false); | ||
71 | + $this->numSeg = 0; | ||
72 | + | ||
73 | + } | ||
74 | + | ||
75 | + private function instalarv300(){ | ||
76 | + | ||
77 | + try { | ||
78 | + | ||
79 | + $objInfraMetaBD = new InfraMetaBD(BancoSEI::getInstance()); | ||
80 | + | ||
81 | + $this->logar('EXECUTANDO A INSTALACAO DA VERSAO 3.0.0 DO NODULO DE PESQUISA PUBLICA NA BASE DO SEI'); | ||
82 | + $this->logar('CRIANDO A TABELA md_parametro_pesquisa'); | ||
83 | + | ||
84 | + BancoSEI::getInstance()->executarSql(' CREATE TABLE md_parametro_pesquisa ( | ||
85 | + nome '.$objInfraMetaBD->tipoTextoFixo(100). ' NOT NULL , | ||
86 | + valor '.$objInfraMetaBD->tipoTextoGrande().' | ||
87 | + )'); | ||
88 | + $objInfraMetaBD->adicionarChavePrimaria('md_parametro_pesquisa', 'pk_md_parametro_pesquisa', array('nome')); | ||
89 | + | ||
90 | + $this->logar('TABELA md_parametro_pesquisa CRIADA COM SUCESSO'); | ||
91 | + $this->logar('INSERINDO DADOS NA TABELA md_parametro_pesquisa'); | ||
92 | + | ||
93 | + $arrParametroPesquisaDTO = array( | ||
94 | + array('Nome' => ParametroPesquisaRN::$TA_CAPTCHA , 'Valor' => 'S'), | ||
95 | + array('Nome' => ParametroPesquisaRN::$TA_CAPTCHA_PDF , 'Valor' => 'S'), | ||
96 | + array('Nome' => ParametroPesquisaRN::$TA_LISTA_ANDAMENTO_PROCESSO_PUBLICO , 'Valor' => 'S'), | ||
97 | + array('Nome' => ParametroPesquisaRN::$TA_PROCESSO_RESTRITO , 'Valor' => 'S'), | ||
98 | + array('Nome' => ParametroPesquisaRN::$TA_METADADOS_PROCESSO_RESTRITO , 'Valor' => 'S'), | ||
99 | + array('Nome' => ParametroPesquisaRN::$TA_LISTA_ANDAMENTO_PROCESSO_RESTRITO , 'Valor' => 'S'), | ||
100 | + array('Nome' => ParametroPesquisaRN::$TA_DESCRICAO_PROCEDIMENTO_ACESSO_RESTRITO , 'Valor' => 'Processo ou Documento de Acesso Restrito - Para condições de acesso verifique a <a style="font-size: 1em;" href="http://[orgao]/link_condicao_acesso" target="_blank">Condição de Acesso</a> ou entre em contato com o Núcleo Gestor do ORGAO pelo e-mail sei@orgao.gov.br.'), | ||
101 | + array('Nome' => ParametroPesquisaRN::$TA_DOCUMENTO_PROCESSO_PUBLICO , 'Valor' => 'S'), | ||
102 | + array('Nome' => ParametroPesquisaRN::$TA_LISTA_DOCUMENTO_PROCESSO_PUBLICO , 'Valor' => 'S'), | ||
103 | + array('Nome' => ParametroPesquisaRN::$TA_LISTA_DOCUMENTO_PROCESSO_RESTRITO , 'Valor' => 'S'), | ||
104 | + array('Nome' => ParametroPesquisaRN::$TA_AUTO_COMPLETAR_INTERESSADO , 'Valor' => 'S'), | ||
105 | + array('Nome' => ParametroPesquisaRN::$TA_MENU_USUARIO_EXTERNO , 'Valor' => 'S'), | ||
106 | + array('Nome' => ParametroPesquisaRN::$TA_CHAVE_CRIPTOGRAFIA , 'Valor' => 'ch@c3_cr1pt0gr@f1a'), | ||
107 | + | ||
108 | + | ||
109 | + ); | ||
110 | + | ||
111 | + $arrObjParametroPesquisaDTO = InfraArray::gerarArrInfraDTOMultiAtributos('ParametroPesquisaDTO', $arrParametroPesquisaDTO); | ||
112 | + | ||
113 | + $objParametroPesquisaRN = new ParametroPesquisaRN(); | ||
114 | + | ||
115 | + foreach ($arrObjParametroPesquisaDTO as $objParametroPesquisaDTO){ | ||
116 | + | ||
117 | + $objParametroPesquisaRN->cadastrar($objParametroPesquisaDTO); | ||
118 | + } | ||
119 | + | ||
120 | + | ||
121 | + } catch (Exception $e) { | ||
122 | + $this->logar($e->getTraceAsString()); | ||
123 | + print_r($e); | ||
124 | + die(); | ||
125 | + } | ||
126 | + } | ||
127 | + | ||
128 | + protected function instalarControlado(){ | ||
129 | + | ||
130 | + $this->inicializar('INICIANDO ATUALIZACAO DO MODULO DE PESQUISA PUBLICA NO SEI VERSAO '.SEI_VERSAO); | ||
131 | + | ||
132 | + //testando se esta usando BDs suportados | ||
133 | + if (!(BancoSEI::getInstance() instanceof InfraMySql) && | ||
134 | + !(BancoSEI::getInstance() instanceof InfraSqlServer) && | ||
135 | + !(BancoSEI::getInstance() instanceof InfraOracle)){ | ||
136 | + | ||
137 | + $this->finalizar('BANCO DE DADOS NAO SUPORTADO: '.get_parent_class(BancoSEI::getInstance()),true); | ||
138 | + | ||
139 | + } | ||
140 | + | ||
141 | + //testando permissoes de criacoes de tabelas | ||
142 | + $objInfraMetaBD = new InfraMetaBD(BancoSEI::getInstance()); | ||
143 | + | ||
144 | + if (count($objInfraMetaBD->obterTabelas('sei_teste'))==0){ | ||
145 | + BancoSEI::getInstance()->executarSql('CREATE TABLE sei_teste (id '.$objInfraMetaBD->tipoNumero().' null)'); | ||
146 | + } | ||
147 | + | ||
148 | + BancoSEI::getInstance()->executarSql('DROP TABLE sei_teste'); | ||
149 | + | ||
150 | + $this->logar('INSTALACAO DA VERSÃO ' . $this->versaoAtualDesteModulo . ' DO MÓDULO DE PESQUISA PUBLICA NA BASE DO SEI'); | ||
151 | + $this->instalarv300(); | ||
152 | + $this->logar('INSTALACAO DA VERSÃO ' . $this->versaoAtualDesteModulo . ' DO MÓDULO DE PESQUISA PUBLICA NA BASE DO SEI REALIZADO COM SUCESSO!'); | ||
153 | + $this->finalizar('FIM', false); | ||
154 | + | ||
155 | + } | ||
156 | + | ||
157 | +} | ||
158 | + | ||
159 | +?> | ||
0 | \ No newline at end of file | 160 | \ No newline at end of file |
@@ -0,0 +1,314 @@ | @@ -0,0 +1,314 @@ | ||
1 | +<? | ||
2 | +/** | ||
3 | +* CONSELHO ADMINISTRATIVO DE DEFESA ECONOMICA | ||
4 | +* | ||
5 | +* 29/11/2016 - criado por alex | ||
6 | +* | ||
7 | +* Versão do Gerador de Código: 1.39.0 | ||
8 | +*/ | ||
9 | + | ||
10 | +require_once dirname(__FILE__).'/../../../SEI.php'; | ||
11 | + | ||
12 | +class ParametroPesquisaRN extends InfraRN { | ||
13 | + | ||
14 | + public static $TA_AUTO_COMPLETAR_INTERESSADO = 'AUTO_COMPLETAR_INTERESSADO'; | ||
15 | + public static $TA_CAPTCHA = 'CAPTCHA'; | ||
16 | + public static $TA_CAPTCHA_PDF = 'CAPTCHA_PDF'; | ||
17 | + public static $TA_CHAVE_CRIPTOGRAFIA = 'CHAVE_CRIPTOGRAFIA'; | ||
18 | + public static $TA_DESCRICAO_PROCEDIMENTO_ACESSO_RESTRITO = 'DESCRICAO_PROCEDIMENTO_ACESSO_RESTRITO'; | ||
19 | + public static $TA_DOCUMENTO_PROCESSO_PUBLICO = 'DOCUMENTO_PROCESSO_PUBLICO'; | ||
20 | + public static $TA_LISTA_ANDAMENTO_PROCESSO_PUBLICO = 'LISTA_ANDAMENTO_PROCESSO_PUBLICO'; | ||
21 | + public static $TA_LISTA_ANDAMENTO_PROCESSO_RESTRITO = 'LISTA_ANDAMENTO_PROCESSO_RESTRITO'; | ||
22 | + public static $TA_LISTA_DOCUMENTO_PROCESSO_PUBLICO = 'LISTA_DOCUMENTO_PROCESSO_PUBLICO'; | ||
23 | + public static $TA_LISTA_DOCUMENTO_PROCESSO_RESTRITO = 'LISTA_DOCUMENTO_PROCESSO_RESTRITO'; | ||
24 | + public static $TA_MENU_USUARIO_EXTERNO = 'MENU_USUARIO_EXTERNO'; | ||
25 | + public static $TA_METADADOS_PROCESSO_RESTRITO = 'METADADOS_PROCESSO_RESTRITO'; | ||
26 | + public static $TA_PROCESSO_RESTRITO = 'PROCESSO_RESTRITO'; | ||
27 | + | ||
28 | + public function __construct(){ | ||
29 | + parent::__construct(); | ||
30 | + } | ||
31 | + | ||
32 | + protected function inicializarObjInfraIBanco(){ | ||
33 | + return BancoSEI::getInstance(); | ||
34 | + } | ||
35 | + | ||
36 | + protected function consultarConectado(ParametroPesquisaDTO $objParametroPesquisaDTO){ | ||
37 | + try { | ||
38 | + | ||
39 | + //Valida Permissao | ||
40 | + SessaoSEI::getInstance()->validarPermissao('md_parametro_pesquisa_consultar'); | ||
41 | + | ||
42 | + //Regras de Negocio | ||
43 | + //$objInfraException = new InfraException(); | ||
44 | + | ||
45 | + //$objInfraException->lancarValidacoes(); | ||
46 | + | ||
47 | + $objParametroPesquisaBD = new ParametroPesquisaBD($this->getObjInfraIBanco()); | ||
48 | + $ret = $objParametroPesquisaBD->consultar($objParametroPesquisaDTO); | ||
49 | + | ||
50 | + //Auditoria | ||
51 | + | ||
52 | + return $ret; | ||
53 | + }catch(Exception $e){ | ||
54 | + throw new InfraException('Erro consultando Parâmetro da Pesquisa.',$e); | ||
55 | + } | ||
56 | + } | ||
57 | + | ||
58 | + protected function alterarParametrosControlado($objArrParametroPesquisaDTO){ | ||
59 | + | ||
60 | + try { | ||
61 | + | ||
62 | + // validaPermissao | ||
63 | + SessaoSEI::getInstance()->validarPermissao('md_parametro_pesquisa_alterar'); | ||
64 | + foreach ($objArrParametroPesquisaDTO as $objParametroPesquisaDTO){ | ||
65 | + $this->alterar($objParametroPesquisaDTO); | ||
66 | + } | ||
67 | + | ||
68 | + } catch (Exception $e) { | ||
69 | + throw new InfraException('Erro alterando Configurações da Pesquisa.',$e); | ||
70 | + } | ||
71 | + } | ||
72 | + | ||
73 | + | ||
74 | + protected function alterarControlado(ParametroPesquisaDTO $objParametroPesquisaDTO){ | ||
75 | + try { | ||
76 | + | ||
77 | + //Valida Permissao | ||
78 | + SessaoSEI::getInstance()->validarPermissao('md_parametro_pesquisa_alterar'); | ||
79 | + | ||
80 | + //Regras de Negocio | ||
81 | + $objInfraException = new InfraException(); | ||
82 | + | ||
83 | + if ($objParametroPesquisaDTO->isSetStrNome()){ | ||
84 | + $this->validarStrNome($objParametroPesquisaDTO, $objInfraException); | ||
85 | + } | ||
86 | + if ($objParametroPesquisaDTO->isSetStrValor()){ | ||
87 | + $this->validarStrValor($objParametroPesquisaDTO, $objInfraException); | ||
88 | + } | ||
89 | + | ||
90 | + $objInfraException->lancarValidacoes(); | ||
91 | + | ||
92 | + $objParametroPesquisaBD = new ParametroPesquisaBD($this->getObjInfraIBanco()); | ||
93 | + $objParametroPesquisaBD->alterar($objParametroPesquisaDTO); | ||
94 | + | ||
95 | + //Auditoria | ||
96 | + | ||
97 | + }catch(Exception $e){ | ||
98 | + throw new InfraException('Erro alterando Parâmetro da Pesquisa.',$e); | ||
99 | + } | ||
100 | + } | ||
101 | + | ||
102 | + | ||
103 | + protected function listarConectado(ParametroPesquisaDTO $objParametroPesquisaDTO) { | ||
104 | + try { | ||
105 | + | ||
106 | + //Valida Permissao | ||
107 | + SessaoSEI::getInstance()->validarPermissao('md_parametro_pesquisa_listar'); | ||
108 | + | ||
109 | + //Regras de Negocio | ||
110 | + //$objInfraException = new InfraException(); | ||
111 | + | ||
112 | + //$objInfraException->lancarValidacoes(); | ||
113 | + | ||
114 | + $objParametroPesquisaBD = new ParametroPesquisaBD($this->getObjInfraIBanco()); | ||
115 | + $ret = $objParametroPesquisaBD->listar($objParametroPesquisaDTO); | ||
116 | + | ||
117 | + //Auditoria | ||
118 | + | ||
119 | + return $ret; | ||
120 | + | ||
121 | + }catch(Exception $e){ | ||
122 | + throw new InfraException('Erro listando Parâmetro da Pesquisas.',$e); | ||
123 | + } | ||
124 | + } | ||
125 | + | ||
126 | + | ||
127 | + | ||
128 | + private function validarStrNome(ParametroPesquisaDTO $objParametroPesquisaDTO, InfraException $objInfraException){ | ||
129 | + if (InfraString::isBolVazia($objParametroPesquisaDTO->getStrNome())){ | ||
130 | + $objInfraException->adicionarValidacao('Nome não informado.'); | ||
131 | + }else{ | ||
132 | + $objParametroPesquisaDTO->setStrNome(trim($objParametroPesquisaDTO->getStrNome())); | ||
133 | + | ||
134 | + if (strlen($objParametroPesquisaDTO->getStrNome())>100){ | ||
135 | + $objInfraException->adicionarValidacao('Nome possui tamanho superior a 100 caracteres.'); | ||
136 | + } | ||
137 | + } | ||
138 | + } | ||
139 | + | ||
140 | + private function validarStrValor(ParametroPesquisaDTO $objParametroPesquisaDTO, InfraException $objInfraException){ | ||
141 | + if (InfraString::isBolVazia($objParametroPesquisaDTO->getStrValor())){ | ||
142 | + $objParametroPesquisaDTO->setStrValor(null); | ||
143 | + }else{ | ||
144 | + $objParametroPesquisaDTO->setStrValor(trim($objParametroPesquisaDTO->getStrValor())); | ||
145 | + } | ||
146 | + } | ||
147 | + | ||
148 | + | ||
149 | + protected function cadastrarControlado(ParametroPesquisaDTO $objParametroPesquisaDTO) { | ||
150 | + try{ | ||
151 | + | ||
152 | + //Valida Permissao | ||
153 | + SessaoSEI::getInstance()->validarPermissao('md_parametro_pesquisa_cadastrar'); | ||
154 | + | ||
155 | + //Regras de Negocio | ||
156 | + $objInfraException = new InfraException(); | ||
157 | + | ||
158 | + $this->validarStrNome($objParametroPesquisaDTO, $objInfraException); | ||
159 | + $this->validarStrValor($objParametroPesquisaDTO, $objInfraException); | ||
160 | + | ||
161 | + $objInfraException->lancarValidacoes(); | ||
162 | + | ||
163 | + $objParametroPesquisaBD = new ParametroPesquisaBD($this->getObjInfraIBanco()); | ||
164 | + $ret = $objParametroPesquisaBD->cadastrar($objParametroPesquisaDTO); | ||
165 | + | ||
166 | + //Auditoria | ||
167 | + | ||
168 | + return $ret; | ||
169 | + | ||
170 | + }catch(Exception $e){ | ||
171 | + throw new InfraException('Erro cadastrando Parâmetro da Pesquisa.',$e); | ||
172 | + } | ||
173 | + } | ||
174 | + | ||
175 | + /* | ||
176 | + | ||
177 | + protected function consultarConectado(ParametroPesquisaDTO $objParametroPesquisaDTO){ | ||
178 | + try { | ||
179 | + | ||
180 | + //Valida Permissao | ||
181 | + SessaoSEI::getInstance()->validarPermissao('md_parametro_pesquisa_consultar'); | ||
182 | + | ||
183 | + //Regras de Negocio | ||
184 | + //$objInfraException = new InfraException(); | ||
185 | + | ||
186 | + //$objInfraException->lancarValidacoes(); | ||
187 | + | ||
188 | + $objParametroPesquisaBD = new ParametroPesquisaBD($this->getObjInfraIBanco()); | ||
189 | + $ret = $objParametroPesquisaBD->consultar($objParametroPesquisaDTO); | ||
190 | + | ||
191 | + //Auditoria | ||
192 | + | ||
193 | + return $ret; | ||
194 | + }catch(Exception $e){ | ||
195 | + throw new InfraException('Erro consultando Parâmetro da Pesquisa.',$e); | ||
196 | + } | ||
197 | + } | ||
198 | + | ||
199 | + protected function contarConectado(ParametroPesquisaDTO $objParametroPesquisaDTO){ | ||
200 | + try { | ||
201 | + | ||
202 | + //Valida Permissao | ||
203 | + SessaoSEI::getInstance()->validarPermissao('md_parametro_pesquisa_listar'); | ||
204 | + | ||
205 | + //Regras de Negocio | ||
206 | + //$objInfraException = new InfraException(); | ||
207 | + | ||
208 | + //$objInfraException->lancarValidacoes(); | ||
209 | + | ||
210 | + $objParametroPesquisaBD = new ParametroPesquisaBD($this->getObjInfraIBanco()); | ||
211 | + $ret = $objParametroPesquisaBD->contar($objParametroPesquisaDTO); | ||
212 | + | ||
213 | + //Auditoria | ||
214 | + | ||
215 | + return $ret; | ||
216 | + }catch(Exception $e){ | ||
217 | + throw new InfraException('Erro contando Parâmetro da Pesquisas.',$e); | ||
218 | + } | ||
219 | + } | ||
220 | + | ||
221 | + protected function excluirControlado($arrObjParametroPesquisaDTO){ | ||
222 | + try { | ||
223 | + | ||
224 | + //Valida Permissao | ||
225 | + SessaoSEI::getInstance()->validarPermissao('md_parametro_pesquisa_excluir'); | ||
226 | + | ||
227 | + //Regras de Negocio | ||
228 | + //$objInfraException = new InfraException(); | ||
229 | + | ||
230 | + //$objInfraException->lancarValidacoes(); | ||
231 | + | ||
232 | + $objParametroPesquisaBD = new ParametroPesquisaBD($this->getObjInfraIBanco()); | ||
233 | + for($i=0;$i<count($arrObjParametroPesquisaDTO);$i++){ | ||
234 | + $objParametroPesquisaBD->excluir($arrObjParametroPesquisaDTO[$i]); | ||
235 | + } | ||
236 | + | ||
237 | + //Auditoria | ||
238 | + | ||
239 | + }catch(Exception $e){ | ||
240 | + throw new InfraException('Erro excluindo Parâmetro da Pesquisa.',$e); | ||
241 | + } | ||
242 | + } | ||
243 | + | ||
244 | + protected function desativarControlado($arrObjParametroPesquisaDTO){ | ||
245 | + try { | ||
246 | + | ||
247 | + //Valida Permissao | ||
248 | + SessaoSEI::getInstance()->validarPermissao('md_parametro_pesquisa_desativar'); | ||
249 | + | ||
250 | + //Regras de Negocio | ||
251 | + //$objInfraException = new InfraException(); | ||
252 | + | ||
253 | + //$objInfraException->lancarValidacoes(); | ||
254 | + | ||
255 | + $objParametroPesquisaBD = new ParametroPesquisaBD($this->getObjInfraIBanco()); | ||
256 | + for($i=0;$i<count($arrObjParametroPesquisaDTO);$i++){ | ||
257 | + $objParametroPesquisaBD->desativar($arrObjParametroPesquisaDTO[$i]); | ||
258 | + } | ||
259 | + | ||
260 | + //Auditoria | ||
261 | + | ||
262 | + }catch(Exception $e){ | ||
263 | + throw new InfraException('Erro desativando Parâmetro da Pesquisa.',$e); | ||
264 | + } | ||
265 | + } | ||
266 | + | ||
267 | + protected function reativarControlado($arrObjParametroPesquisaDTO){ | ||
268 | + try { | ||
269 | + | ||
270 | + //Valida Permissao | ||
271 | + SessaoSEI::getInstance()->validarPermissao('md_parametro_pesquisa_reativar'); | ||
272 | + | ||
273 | + //Regras de Negocio | ||
274 | + //$objInfraException = new InfraException(); | ||
275 | + | ||
276 | + //$objInfraException->lancarValidacoes(); | ||
277 | + | ||
278 | + $objParametroPesquisaBD = new ParametroPesquisaBD($this->getObjInfraIBanco()); | ||
279 | + for($i=0;$i<count($arrObjParametroPesquisaDTO);$i++){ | ||
280 | + $objParametroPesquisaBD->reativar($arrObjParametroPesquisaDTO[$i]); | ||
281 | + } | ||
282 | + | ||
283 | + //Auditoria | ||
284 | + | ||
285 | + }catch(Exception $e){ | ||
286 | + throw new InfraException('Erro reativando Parâmetro da Pesquisa.',$e); | ||
287 | + } | ||
288 | + } | ||
289 | + | ||
290 | + protected function bloquearControlado(ParametroPesquisaDTO $objParametroPesquisaDTO){ | ||
291 | + try { | ||
292 | + | ||
293 | + //Valida Permissao | ||
294 | + SessaoSEI::getInstance()->validarPermissao('md_parametro_pesquisa_consultar'); | ||
295 | + | ||
296 | + //Regras de Negocio | ||
297 | + //$objInfraException = new InfraException(); | ||
298 | + | ||
299 | + //$objInfraException->lancarValidacoes(); | ||
300 | + | ||
301 | + $objParametroPesquisaBD = new ParametroPesquisaBD($this->getObjInfraIBanco()); | ||
302 | + $ret = $objParametroPesquisaBD->bloquear($objParametroPesquisaDTO); | ||
303 | + | ||
304 | + //Auditoria | ||
305 | + | ||
306 | + return $ret; | ||
307 | + }catch(Exception $e){ | ||
308 | + throw new InfraException('Erro bloqueando Parâmetro da Pesquisa.',$e); | ||
309 | + } | ||
310 | + } | ||
311 | + | ||
312 | + */ | ||
313 | +} | ||
314 | +?> | ||
0 | \ No newline at end of file | 315 | \ No newline at end of file |
711 Bytes
@@ -0,0 +1,716 @@ | @@ -0,0 +1,716 @@ | ||
1 | +var SEP_COOKIE = "#_"; | ||
2 | + | ||
3 | +/** | ||
4 | + * SISTEMA DA PAGINAÇÃO | ||
5 | + */ | ||
6 | + | ||
7 | +var pagina = function() { | ||
8 | + pagina.formulario = document.getElementById("seiSearch"); | ||
9 | + pagina.campoPartialFields = document.getElementById("partialfields"); | ||
10 | +} | ||
11 | + | ||
12 | +pagina.formulario = null; | ||
13 | +pagina.campoPartialFields = null; | ||
14 | + | ||
15 | +pagina.ir = function(endereco) { | ||
16 | + | ||
17 | + endereco = endereco.infraReplaceAll('&', '&'); | ||
18 | + endereco = endereco.infraReplaceAll('+', '%2B'); | ||
19 | + | ||
20 | + pagina.formulario.action = endereco; | ||
21 | + | ||
22 | + if (typeof(window.onSubmitForm)=='function' && !window.onSubmitForm()){ | ||
23 | + return; | ||
24 | + } | ||
25 | + | ||
26 | + pagina.formulario.submit(); | ||
27 | +} | ||
28 | + | ||
29 | +/** | ||
30 | + * FUNÇÃO PARA REMOVER ACENTOS | ||
31 | + * ALTERADO PARA TROCAR PARA ENTITIES TAMBEM | ||
32 | + */ | ||
33 | + | ||
34 | +function removerAcentos(texto) { | ||
35 | + | ||
36 | + var contador = 0; | ||
37 | + var letras = { | ||
38 | + procurar: ["á", "ã", "à", "â", "ä", "ç", "é", "ê", "è", "ë", "í", "ì", "ï", "ó", "õ", "ô", "ö", "ò", "ú", "ü", "ù", "ñ", ,"(" ,")"], | ||
39 | + substituir: ["a", "a", "a", "a", "a", "c", "e", "e", "e", "e", "i", "i", "i", "o", "o", "o", "o", "o", "u", "u", "u", "n", "(", ")"] | ||
40 | + } | ||
41 | + | ||
42 | + texto = texto.toLowerCase(); | ||
43 | + | ||
44 | + | ||
45 | + for (contador; contador < letras.procurar.length; contador += 1) { | ||
46 | + texto = texto.replace(letras.procurar[contador], letras.substituir[contador]); | ||
47 | + } | ||
48 | + | ||
49 | + return texto; | ||
50 | +} | ||
51 | + | ||
52 | +/** | ||
53 | + * CLASSE CAMPO | ||
54 | + */ | ||
55 | + | ||
56 | +var Campo = function(parametros) { | ||
57 | + if (typeof parametros == "function") { | ||
58 | + this.tratamento = parametros; | ||
59 | + } else if (typeof parametros == "object") { | ||
60 | + this.id = (typeof parametros.id == "object" || typeof parametros.id == "string") ? parametros.id : null; | ||
61 | + this.nome = typeof parametros.nome == "string" ? parametros.nome : null; | ||
62 | + this.opcoes = typeof parametros.opcoes == "object" ? parametros.opcoes : { }; | ||
63 | + this.tratamento = null; | ||
64 | + | ||
65 | + this.objeto = function(indice) { | ||
66 | + return document.getElementById(indice == null ? this.id : this.id[indice]); | ||
67 | + } | ||
68 | + } | ||
69 | +} | ||
70 | + | ||
71 | +/** | ||
72 | + * SISTEMA DE VALIDAÇÃO | ||
73 | + */ | ||
74 | + | ||
75 | +var validar = function() { | ||
76 | + var campo; | ||
77 | + var opcoes; | ||
78 | + var contador; | ||
79 | + var valor; | ||
80 | + | ||
81 | + // VARRE OS CAMPOS | ||
82 | + for (contador = 0; contador < validar.campos.length; contador += 1) { | ||
83 | + campo = validar.campos[contador]; | ||
84 | + | ||
85 | + // VERIFICA SE POSSUI UMA FUNÇÃO PRÓPRIA DE TRATAMENTO | ||
86 | + | ||
87 | + if (campo.tratamento instanceof Function) { | ||
88 | + | ||
89 | + } else { | ||
90 | + // VERIFICA SE É COMPOSTO POR MAIS DE UM CAMPO (CHECKBOX OU RADIO) | ||
91 | + | ||
92 | + if (campo.id instanceof Array) { | ||
93 | + | ||
94 | + } else { | ||
95 | + opcoes = campo.opcoes; | ||
96 | + | ||
97 | + // DETERMINA QUE ELEMENTO É | ||
98 | + switch (campo.objeto().tagName.toUpperCase()) { | ||
99 | + case "SELECT": | ||
100 | + | ||
101 | + | ||
102 | + break; | ||
103 | + case "INPUT": | ||
104 | + case "TEXTAREA": | ||
105 | + valor = validar.limpar(campo.objeto().value); | ||
106 | + if (valor.length > 0) { | ||
107 | + if (opcoes.dividir) { | ||
108 | + valor = validar.dividir(valor); | ||
109 | + | ||
110 | + if (valor.length > 1) { | ||
111 | + valor = "(" + campo.nome + ":" + escape(escape(valor.join(" OR " + campo.nome + ":"))).replace(/%253A/g, ":").replace(/%257C/g, " OR ") + ")"; | ||
112 | + } else { | ||
113 | + valor = campo.nome + ":" + escape(escape(valor[0])); | ||
114 | + } | ||
115 | + } else { | ||
116 | + valor = campo.nome + ":" + escape(escape(valor)); | ||
117 | + } | ||
118 | + } | ||
119 | + | ||
120 | + break; | ||
121 | + } | ||
122 | + } | ||
123 | + } | ||
124 | + } | ||
125 | +} | ||
126 | + | ||
127 | +validar.campos = [ ] | ||
128 | +validar.formulario = null; | ||
129 | + | ||
130 | +validar.dividir = function(valor, regra) { | ||
131 | + var contador = 0; | ||
132 | + var valorNovo = [ ] | ||
133 | + | ||
134 | + if ((regra instanceof RegExp) == false) { | ||
135 | + regra = /[ ,;]/; | ||
136 | + } | ||
137 | + | ||
138 | + // QUEBRA QUALQUER ESPAÇO EM BRANCO, VÍRGULA OU PONTO-E-VÍRGULA | ||
139 | + valor = valor.split(regra); | ||
140 | + | ||
141 | + for (contador = 0; contador < valor.length; contador += 1) { | ||
142 | + if (valor[contador].length > 0) { | ||
143 | + valorNovo.push(valor[contador]); | ||
144 | + } | ||
145 | + } | ||
146 | + | ||
147 | + return valorNovo; | ||
148 | +} | ||
149 | + | ||
150 | +// MÉTODO PARA LIMPEZA DO VALOR DE UM CAMPO | ||
151 | + | ||
152 | +validar.limpar = function(valor) { | ||
153 | + var contador = 0; | ||
154 | + var letras = { | ||
155 | + procurar: ["á", "ã", "à", "â", "ä", "ç", "é", "ê", "è", "ë", "í", "ì", "ï", "ó", "õ", "ô", "ö", "ò", "ú", "ü", "ù", "ñ"], | ||
156 | + substituir: ["a", "a", "a", "a", "a", "c", "e", "e", "e", "e", "i", "i", "i", "o", "o", "o", "o", "o", "u", "u", "u", "n"] | ||
157 | + } | ||
158 | + | ||
159 | + valor = String(valor).replace(/^\s+|\s+$/g, "").toLowerCase(); | ||
160 | + | ||
161 | + for (contador; contador < letras.procurar.length; contador += 1) { | ||
162 | + valor = valor.replace(letras.procurar[contador], letras.substituir[contador]); | ||
163 | + } | ||
164 | + | ||
165 | + return valor; | ||
166 | +} | ||
167 | + | ||
168 | +/** | ||
169 | + * FUNÇÃO INVOCADA PELO ONLOAD DO BODY | ||
170 | + */ | ||
171 | + | ||
172 | +function sistemaInicializar() { | ||
173 | + // VALIDAÇÃO DO FORMULÁRIO AVANÇADO | ||
174 | + | ||
175 | + validar.formulario = document.getElementById("seiSearch"); | ||
176 | + | ||
177 | + // PESQUISAR EM | ||
178 | + validar.campos.push(new Campo({ | ||
179 | + id: ["chkSinProcessos", "chkSinDocumentosGerados", "chkSinDocumentosRecebidos"], | ||
180 | + nome: "sta_prot" | ||
181 | + })); | ||
182 | + | ||
183 | + // INTERESSADO / REMETENTE | ||
184 | + validar.campos.push(new Campo({ | ||
185 | + id: "hdnIdParticipante", | ||
186 | + nome: "id_int" | ||
187 | + })); | ||
188 | + | ||
189 | + // ASSINANTE | ||
190 | + validar.campos.push(new Campo({ | ||
191 | + id: "hdnIdAssinante", | ||
192 | + nome: "id_assin" | ||
193 | + })); | ||
194 | + | ||
195 | + // ASSUNTO | ||
196 | + validar.campos.push(new Campo({ | ||
197 | + id: "hdnIdAssunto", | ||
198 | + nome: "id_assun" | ||
199 | + })); | ||
200 | + | ||
201 | + // UNIDADES | ||
202 | + validar.campos.push(new Campo({ | ||
203 | + id: "hdnIdUnidade", | ||
204 | + nome: "id_uni_ger" | ||
205 | + })); | ||
206 | + | ||
207 | + // NÚMERO SEI! | ||
208 | + validar.campos.push(new Campo({ | ||
209 | + id: "txtProtocoloPesquisa", | ||
210 | + nome: "prot_pesq" | ||
211 | + })); | ||
212 | + | ||
213 | + // TIPO DO PROCESSO | ||
214 | + validar.campos.push(new Campo({ | ||
215 | + id: "selTipoProcedimentoPesquisa", | ||
216 | + nome: "id_tipo_proc" | ||
217 | + })); | ||
218 | + | ||
219 | + // TIPO DO DOCUMENTO | ||
220 | + validar.campos.push(new Campo({ | ||
221 | + id: "selSeriePesquisa", | ||
222 | + nome: "id_serie" | ||
223 | + })); | ||
224 | + | ||
225 | + // NÚMERO DO DOCUMENTO | ||
226 | + validar.campos.push(new Campo({ | ||
227 | + id: "txtNumeroDocumentoPesquisa", | ||
228 | + nome: "numero" | ||
229 | + })); | ||
230 | + | ||
231 | + // SIGLA DO USUÁRIO | ||
232 | + validar.campos.push(new Campo({ | ||
233 | + id: "hdnSiglasUsuarios", | ||
234 | + nome: "id_usu_ger", | ||
235 | + opcoes: { | ||
236 | + dividir: true | ||
237 | + } | ||
238 | + })); | ||
239 | + | ||
240 | + // DATA | ||
241 | + validar.campos.push(new Campo(function() { | ||
242 | + | ||
243 | + })); | ||
244 | + | ||
245 | + // PAGINAÇÃO | ||
246 | + | ||
247 | + pagina(); | ||
248 | +} | ||
249 | + | ||
250 | +/** | ||
251 | + * SISTEMA PARA A MANIPULAÇÃO DO FORMULÁRIO AVANÇADO | ||
252 | + */ | ||
253 | + | ||
254 | +function ResBusca(dados) | ||
255 | +{ | ||
256 | + this.query = dados[0]; | ||
257 | + this.totalRes = dados[1]; | ||
258 | + this.url = dados[2]; | ||
259 | + this.toString = function(){return "{" + this.query + SEP_COOKIE + this.totalRes + SEP_COOKIE + this.url + "}";}; | ||
260 | +} | ||
261 | + | ||
262 | +var CookieResultado = | ||
263 | +{ | ||
264 | + addResultado: function (resultado) | ||
265 | + { | ||
266 | + var testeDuplicado = CookieResultado.isDuplicado(resultado.query); | ||
267 | + if (testeDuplicado != -1) | ||
268 | + CookieResultado.remove(testeDuplicado); | ||
269 | + var valorCookie = Cookies.getCookie("res") == null ? "" : Cookies.getCookie("res"); | ||
270 | + valorCookie = resultado.toString() + valorCookie; | ||
271 | + if (valorCookie.split("}{").length > 6) | ||
272 | + valorCookie = valorCookie.substring(0, valorCookie.lastIndexOf("{")); | ||
273 | + Cookies.setCookie("res", valorCookie); | ||
274 | + }, | ||
275 | + | ||
276 | + getListaResultados: function() | ||
277 | + { | ||
278 | + var valorCookie = Cookies.getCookie("res"); | ||
279 | + if (valorCookie != null && valorCookie.length > 0) | ||
280 | + { | ||
281 | + valorCookie = valorCookie.substring(1, valorCookie.length - 1); | ||
282 | + valorCookie = valorCookie.split("}{"); | ||
283 | + var arrayResultados = new Array(); | ||
284 | + for (var i = 0; i < valorCookie.length; i++) | ||
285 | + arrayResultados[arrayResultados.length] = new ResBusca(valorCookie[i].split(SEP_COOKIE)); | ||
286 | + return arrayResultados; | ||
287 | + } | ||
288 | + return null; | ||
289 | + }, | ||
290 | + | ||
291 | + isDuplicado: function(termo) | ||
292 | + { | ||
293 | + var valorCookie = Cookies.getCookie("res"); | ||
294 | + if (valorCookie != null && valorCookie.length > 0) | ||
295 | + { | ||
296 | + valorCookie = valorCookie.substring(1, valorCookie.length - 1); | ||
297 | + valorCookie = valorCookie.split("}{"); | ||
298 | + for (var i = 0; i < valorCookie.length; i++) | ||
299 | + { | ||
300 | + var temp = valorCookie[i].split(SEP_COOKIE); | ||
301 | + if (temp[0].toLowerCase() == termo.toLowerCase()) | ||
302 | + return i; | ||
303 | + } | ||
304 | + } | ||
305 | + return -1; | ||
306 | + }, | ||
307 | + | ||
308 | + remove: function(posicao) | ||
309 | + { | ||
310 | + var listaResultados = CookieResultado.getListaResultados(); | ||
311 | + Cookies.setCookie("res", ''); | ||
312 | + for (var i = (listaResultados.length - 1); i >= 0; i = i - 1) | ||
313 | + { | ||
314 | + if (posicao != i) | ||
315 | + { | ||
316 | + CookieResultado.addResultado(new ResBusca(new Array(listaResultados[i].query, listaResultados[i].totalRes, listaResultados[i].url))); | ||
317 | + } | ||
318 | + } | ||
319 | + } | ||
320 | +} | ||
321 | + | ||
322 | +var Cookies = | ||
323 | +{ | ||
324 | + setCookie: function (name, value, expires, path, domain, secure) | ||
325 | + { | ||
326 | + document.cookie = "busca_" + name + "=" + value + | ||
327 | + ((expires) ? "; expires=" + expires : "") + | ||
328 | + ((path) ? "; path=" + path : "") + | ||
329 | + ((domain) ? "; domain=" + domain : "") + | ||
330 | + ((secure) ? "; secure" : ""); | ||
331 | + }, | ||
332 | + | ||
333 | + getCookie: function(name) | ||
334 | + { | ||
335 | + var nameEQ = "busca_" + name + "="; | ||
336 | + var ca = document.cookie.split(';'); | ||
337 | + for(var i=0; i < ca.length; i++) | ||
338 | + { | ||
339 | + var c = ca[i]; | ||
340 | + while (c.charAt(0)==' ') c = c.substring(1,c.length); | ||
341 | + if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); | ||
342 | + } | ||
343 | + return null; | ||
344 | + }, | ||
345 | + | ||
346 | + clearAllCookies: function() | ||
347 | + { | ||
348 | + var ca = document.cookie.split(';'); | ||
349 | + | ||
350 | + for (var i=0;i < ca.length;i++) | ||
351 | + { | ||
352 | + var c = trim(ca[i]); | ||
353 | + // Don't allow for cookies that start with two underscores or that are one | ||
354 | + // character. | ||
355 | + if (c.match(/^busca_/) != null) | ||
356 | + { | ||
357 | + var cookieName = c; | ||
358 | + cookieName = cookieName.replace(/\=.*$/, ""); | ||
359 | + cookieName = cookieName.replace(/^busca_/, ""); | ||
360 | + Cookies.setCookie(cookieName, ''); | ||
361 | + } | ||
362 | + } | ||
363 | + } | ||
364 | +} | ||
365 | + | ||
366 | +var Util = { | ||
367 | + | ||
368 | + getParametro: function(parametro) | ||
369 | + { | ||
370 | + var url = location.href; | ||
371 | + var paramValue = null; | ||
372 | + if (url.indexOf("&" + parametro + "=") != -1) | ||
373 | + { | ||
374 | + var paramValue = url.substring(url.indexOf("&" + parametro + "=") + parametro.length + 1); | ||
375 | + } | ||
376 | + else if (url.indexOf("?" + parametro + "=") != -1) | ||
377 | + { | ||
378 | + var paramValue = url.substring(url.indexOf("?" + parametro + "=") + parametro.length + 1); | ||
379 | + } | ||
380 | + if (paramValue != null) | ||
381 | + { | ||
382 | + if (paramValue.indexOf("&") != -1) | ||
383 | + paramValue = paramValue.substring(0, paramValue.indexOf("&")); | ||
384 | + } | ||
385 | + return paramValue; | ||
386 | + }, | ||
387 | + | ||
388 | + getUrl: function(uri) | ||
389 | + { | ||
390 | + var url = location.href; | ||
391 | + if (!uri) | ||
392 | + { | ||
393 | + url = url.substring(url.indexOf("://") + 3); | ||
394 | + url = url.substring(url.indexOf("/")); | ||
395 | + } | ||
396 | + return url; | ||
397 | + } | ||
398 | +} | ||
399 | + | ||
400 | +/* | ||
401 | + * exemplo new Array("nome da meta tag", "id do input") new Array("DT_nome da | ||
402 | + * meta tag") Você pode colocar ids de campos input (type=text) e select | ||
403 | + */ | ||
404 | + | ||
405 | +var mt = new Array( | ||
406 | + | ||
407 | + // INTERESSADO | ||
408 | + new Array("id_int", "hdnIdParticipante"), | ||
409 | + | ||
410 | +// // REMETENTE Sera implementado depois | ||
411 | +// new Array("id_rem", "hdnIdParticipante"), | ||
412 | +// | ||
413 | +// // DESTINATARIO | ||
414 | +// new Array("id_dest", "hdnIdParticipante"), | ||
415 | + | ||
416 | + // ASSINANTE | ||
417 | + new Array("id_assin", "hdnIdAssinante"), | ||
418 | + | ||
419 | + // ASSUNTO | ||
420 | + new Array("id_assun", "hdnIdAssunto"), | ||
421 | + | ||
422 | + // UNIDADES | ||
423 | + new Array("id_uni_ger", "hdnIdUnidade"), | ||
424 | + | ||
425 | + // NÚMERO SEI | ||
426 | + new Array("prot_pesq", "txtProtocoloPesquisa"), | ||
427 | + | ||
428 | + // TIPO DO PROCESSO | ||
429 | + new Array("id_tipo_proc", "selTipoProcedimentoPesquisa"), | ||
430 | + | ||
431 | + // TIPO DO DOCUMENTO | ||
432 | + new Array("id_serie", "selSeriePesquisa"), | ||
433 | + | ||
434 | + // NÚMERO DO DOCUMENTO | ||
435 | + new Array("numero", "txtNumeroDocumentoPesquisa") | ||
436 | +); | ||
437 | + | ||
438 | +var mtCheckbox = new Array( | ||
439 | + new Array("sta_prot", "chkSinProcessos", "chkSinDocumentosGerados", "chkSinDocumentosRecebidos") | ||
440 | +); | ||
441 | + | ||
442 | +/* | ||
443 | + * exemplo new Array("nome da meta tag", "id campo data inicial", "id campo data final", "nome para exibição") | ||
444 | + */ | ||
445 | +var mtRangeData = new Array( | ||
446 | + // DATA | ||
447 | + new Array("dta_ger", "txtDataInicio", "txtDataFim", "Período") | ||
448 | +); | ||
449 | + | ||
450 | +var rangeMetaTags = ""; | ||
451 | + | ||
452 | +function trim(stringToTrim) { | ||
453 | + return String(stringToTrim).replace(/^\s+|\s+$/g, ""); | ||
454 | +} | ||
455 | + | ||
456 | +function getFullNumber(number) | ||
457 | +{ | ||
458 | + return number.length > 1 ? number : "0" + number; | ||
459 | +} | ||
460 | + | ||
461 | + | ||
462 | +function utf8Decode(utftext) { | ||
463 | + var string = ""; | ||
464 | + if (utftext != null) { | ||
465 | + var i = 0; | ||
466 | + var c = c1 = c2 = 0; | ||
467 | + while (i < utftext.length) { | ||
468 | + c = utftext.charCodeAt(i); | ||
469 | + if (c < 128) { | ||
470 | + string += String.fromCharCode(c); | ||
471 | + i++; | ||
472 | + } else if ((c > 191) && (c > 224)) { | ||
473 | + c2 = utftext.charCodeAt(i + 1); | ||
474 | + string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); | ||
475 | + i += 2; | ||
476 | + } else { | ||
477 | + c2 = utftext.charCodeAt(i + 1); | ||
478 | + c3 = utftext.charCodeAt(i + 2); | ||
479 | + string += String.fromCharCode(((c & 15) << 12) | ||
480 | + | ((c2 & 63) << 6) | (c3 & 63)); | ||
481 | + i += 3; | ||
482 | + } | ||
483 | + } | ||
484 | + } | ||
485 | + while (string.indexOf("+") != -1) | ||
486 | + string = string.replace("\+", " "); | ||
487 | + return string; | ||
488 | +} | ||
489 | + | ||
490 | +function utf8Encode(string) { | ||
491 | + var utftext = ""; | ||
492 | + if (string != null) { | ||
493 | + string = string.replace(/\r\n/g, "\n"); | ||
494 | + for ( var n = 0; n < string.length; n++) { | ||
495 | + var c = string.charCodeAt(n); | ||
496 | + var ch = string.charAt(n); | ||
497 | + if (c < 128) { | ||
498 | + utftext += String.fromCharCode(c); | ||
499 | + | ||
500 | + } else if ((c > 127) && (c < 2048)) { | ||
501 | + utftext += String.fromCharCode((c >> 6) | 192); | ||
502 | + utftext += String.fromCharCode((c & 63) | 128); | ||
503 | + } else { | ||
504 | + utftext += String.fromCharCode((c >> 12) | 224); | ||
505 | + utftext += String.fromCharCode(((c >> 6) & 63) | 128); | ||
506 | + utftext += String.fromCharCode((c & 63) | 128); | ||
507 | + } | ||
508 | + } | ||
509 | + } | ||
510 | + return utftext; | ||
511 | +} | ||
512 | + | ||
513 | +function URLEncode(string) { | ||
514 | + var returnString = escape(this.utf8Encode(string)); | ||
515 | + //returnString = returnString.replace(/\./g, "%2E"); | ||
516 | + //returnString = returnString.replace(/\|/g, "%7C"); | ||
517 | + return returnString.replace(/:/g, "%3A"); | ||
518 | +} | ||
519 | + | ||
520 | +function URLDecode(string) { | ||
521 | + return this.utf8Decode(unescape(string)); | ||
522 | +} | ||
523 | + | ||
524 | +function partialFields() { | ||
525 | + var contador; | ||
526 | + var erro = false; | ||
527 | + var idUnidadeAberto; | ||
528 | + var mtName; | ||
529 | + var mtValue; | ||
530 | + var partFields = document.getElementById("partialfields"); | ||
531 | + | ||
532 | + for (x = 0; x < mt.length; x++) { | ||
533 | + mtName = mt[x][0]; | ||
534 | + | ||
535 | + if (document.getElementById(mt[x][1]).tagName.toLowerCase() == "input") | ||
536 | + mtValue = utf8Encode(formatarCaracteresEspeciais(removerAcentos(trim(document.getElementById(mt[x][1]).value)))); | ||
537 | + else if (document.getElementById(mt[x][1]).tagName.toLowerCase() == "select") { | ||
538 | + mtValue = utf8Encode(trim(document.getElementById(mt[x][1]).options[document.getElementById(mt[x][1]).selectedIndex].value)); | ||
539 | + } | ||
540 | + | ||
541 | + switch (mtName) { | ||
542 | + | ||
543 | + case "prot_pesq": | ||
544 | + | ||
545 | + //mtValue = mtValue.replace(/[^0-9]/g, ""); | ||
546 | + mtValue = mtValue.replace(/[^0-9a-zA-Z]/g, ""); | ||
547 | + | ||
548 | + | ||
549 | + | ||
550 | + if (mtValue.length > 0 && mtValue.toUpperCase() != "NULL") { | ||
551 | + if (partFields.value.length > 0) { | ||
552 | + partFields.value += " AND "; | ||
553 | + } | ||
554 | + partFields.value += mtName + ":*" + mtValue +"*"; | ||
555 | + } | ||
556 | + break; | ||
557 | + | ||
558 | + default: | ||
559 | + if (mtValue.length > 0 && mtValue.toUpperCase() != "NULL") { | ||
560 | + | ||
561 | + var bolCampoMultiplo = false; | ||
562 | + | ||
563 | + if (mtName == 'id_int' || | ||
564 | + mtName == 'id_rem' || | ||
565 | + mtName == 'id_dest' || | ||
566 | + mtName == 'id_assun' || | ||
567 | + mtName == 'id_uni_aces' || | ||
568 | + mtName == 'id_uni_aces' || | ||
569 | + mtName == 'id_assin'){ | ||
570 | + | ||
571 | + bolCampoMultiplo = true; | ||
572 | + } | ||
573 | + | ||
574 | + if (partFields.value.length > 0) { | ||
575 | + partFields.value += " AND "; | ||
576 | + } | ||
577 | + if (bolCampoMultiplo){ | ||
578 | + partFields.value += mtName + ":*" + mtValue + "*"; | ||
579 | + }else{ | ||
580 | + partFields.value += mtName + ":" + mtValue; | ||
581 | + } | ||
582 | + | ||
583 | + } | ||
584 | + | ||
585 | + break; | ||
586 | + } | ||
587 | + | ||
588 | + | ||
589 | + } | ||
590 | + | ||
591 | + | ||
592 | + // SIGLAS DOS USUÁRIOS | ||
593 | + var strVerificacao = removerAcentos(trim(document.getElementById("hdnSiglasUsuarios").value)); | ||
594 | + | ||
595 | + if (strVerificacao != ''){ | ||
596 | + | ||
597 | + var siglas = strVerificacao.split(','); | ||
598 | + | ||
599 | + if (siglas.length > 0) { | ||
600 | + if (partFields.value.length > 0) { | ||
601 | + partFields.value += " AND "; | ||
602 | + } | ||
603 | + partFields.value += "(id_usu_ger:" + siglas.join(" OR id_usu_ger:") + ")"; | ||
604 | + } | ||
605 | + } | ||
606 | + | ||
607 | + // CHECKBOX DO PESQUISAR EM | ||
608 | + | ||
609 | + for (contador = 0; contador < mtCheckbox.length; contador += 1) { | ||
610 | + var campo; | ||
611 | + var campos; | ||
612 | + var dados = []; | ||
613 | + | ||
614 | + for (campos = 1; campos < mtCheckbox[contador].length; campos += 1) { | ||
615 | + campo = document.getElementById(mtCheckbox[contador][campos]); | ||
616 | + | ||
617 | + if (campo.checked) { | ||
618 | + dados.push(campo.value); | ||
619 | + } | ||
620 | + } | ||
621 | + | ||
622 | + if (dados.length > 0) { | ||
623 | + if (partFields.value.length > 0) { | ||
624 | + partFields.value += " AND "; | ||
625 | + } | ||
626 | + | ||
627 | + partFields.value += mtCheckbox[contador][0] + ":" + dados.join(";"); | ||
628 | + } | ||
629 | + } | ||
630 | + | ||
631 | + var dataInicio = infraTrim(document.getElementById('txtDataInicio').value); | ||
632 | + var dataFim = infraTrim(document.getElementById('txtDataFim').value); | ||
633 | + | ||
634 | + if (dataInicio!='' || dataFim!=''){ | ||
635 | + | ||
636 | + if (dataInicio != '' && !infraValidarData(document.getElementById('txtDataInicio'))){ | ||
637 | + return false; | ||
638 | + } | ||
639 | + | ||
640 | + if (dataFim!='' && !infraValidarData(document.getElementById('txtDataFim'))){ | ||
641 | + return false; | ||
642 | + } | ||
643 | + | ||
644 | + if (dataInicio!='' && dataFim!='' && infraCompararDatas(dataInicio,dataFim) < 0){ | ||
645 | + alert('Período de datas inválido.'); | ||
646 | + document.getElementById('txtDataInicio').focus(); | ||
647 | + return false; | ||
648 | + } | ||
649 | + | ||
650 | + var dia1 = dataInicio.substr(0,2); | ||
651 | + var mes1 = dataInicio.substr(3,2); | ||
652 | + var ano1 = dataInicio.substr(6,4); | ||
653 | + | ||
654 | + var dia2 = dataFim.substr(0,2); | ||
655 | + var mes2 = dataFim.substr(3,2); | ||
656 | + var ano2 = dataFim.substr(6,4); | ||
657 | + | ||
658 | + if (partFields.value.length > 0) { | ||
659 | + partFields.value += " AND "; | ||
660 | + } | ||
661 | + | ||
662 | + if (dataInicio != '' && dataFim != '') { | ||
663 | + partFields.value += 'dta_ger:[' + ano1 + '-' + mes1 + '-' + dia1 + 'T00:00:00Z TO ' + ano2 + '-' + mes2 + '-' + dia2 +'T00:00:00Z]'; | ||
664 | + }else if (dataInicio != ''){ | ||
665 | + partFields.value += 'dta_ger:"'+ ano1 + '-' + mes1 + '-' + dia1 + 'T00:00:00Z"'; | ||
666 | + }else{ | ||
667 | + partFields.value += 'dta_ger:"'+ ano2 + '-' + mes2 + '-' + dia2 + 'T00:00:00Z"'; | ||
668 | + } | ||
669 | + } | ||
670 | + | ||
671 | + return true; | ||
672 | +} | ||
673 | + | ||
674 | +function checkForInt(e) { | ||
675 | + var charCode = (e.which != null) ? e.which : event.keyCode; | ||
676 | + return (charCode < 32 || (charCode >= 48 && charCode <= 57)); | ||
677 | +} | ||
678 | + | ||
679 | +function checkForString(e) { | ||
680 | + var k; | ||
681 | + document.all ? k = e.keyCode : k = e.which; | ||
682 | + return ((k > 64 && k < 91) || (k > 96 && k < 123) || k == 8); | ||
683 | +} | ||
684 | + | ||
685 | +function selecionaOp(elId, op) { | ||
686 | + var el = document.getElementById(elId); | ||
687 | + for ( var i = 0; i < el.options.length; i++) | ||
688 | + if (el.options[i].value.toLowerCase() == op.toLowerCase()) { | ||
689 | + el.selectedIndex = i; | ||
690 | + break; | ||
691 | + } | ||
692 | +} | ||
693 | + | ||
694 | +function moveFoco(el, tamanho, idCampo) | ||
695 | +{ | ||
696 | + if (el.value.length == tamanho) | ||
697 | + { | ||
698 | + document.getElementById(idCampo).focus(); | ||
699 | + } | ||
700 | +} | ||
701 | + | ||
702 | +function limpaFields() { | ||
703 | + rangeMetaTags = ""; | ||
704 | + document.getElementById("partialfields").value = ""; | ||
705 | +} | ||
706 | + | ||
707 | +function formatarCaracteresEspeciais(txt){ | ||
708 | + | ||
709 | + arrExc = Array(String.fromCharCode(92),'/','+','-','&','|','!','(',')','{','}','[',']','^','~','*','?',':'); | ||
710 | + | ||
711 | + for(var i=0;i<arrExc.length;i++){ | ||
712 | + txt = txt.infraReplaceAll(arrExc[i],String.fromCharCode(92) + arrExc[i]); | ||
713 | + } | ||
714 | + | ||
715 | + return txt; | ||
716 | + } |
@@ -0,0 +1,569 @@ | @@ -0,0 +1,569 @@ | ||
1 | +<? | ||
2 | +/** | ||
3 | + * CONSELHO ADMINISTRATIVO DE DEFESA ECONOMICA | ||
4 | + * | ||
5 | + * 21/05/2016 - criado por alex.braga | ||
6 | + * | ||
7 | + * | ||
8 | + */ | ||
9 | + | ||
10 | +require_once dirname(__FILE__).'/Sip.php'; | ||
11 | + | ||
12 | +class AtualizadorSipModuloPesquisaRN extends InfraRN { | ||
13 | + | ||
14 | + private $numSeg = 0; | ||
15 | + private $versaoAtualDesteModulo = '3.0.0'; | ||
16 | + private $nomeParametroModulo = 'VERSAO_MODULO_PESQUISA_PUBLICA'; | ||
17 | + | ||
18 | + public function __construct(){ | ||
19 | + parent::__construct(); | ||
20 | + $this->inicializar(' SIP - INICIALIZAR '); | ||
21 | + } | ||
22 | + | ||
23 | + protected function inicializarObjInfraIBanco(){ | ||
24 | + return BancoSip::getInstance(); | ||
25 | + } | ||
26 | + | ||
27 | + private function inicializar($strTitulo){ | ||
28 | + | ||
29 | + ini_set('max_execution_time','0'); | ||
30 | + ini_set('memory_limit','-1'); | ||
31 | + | ||
32 | + try { | ||
33 | + @ini_set('zlib.output_compression','0'); | ||
34 | + @ini_set('implicit_flush', '1'); | ||
35 | + }catch(Exception $e){} | ||
36 | + | ||
37 | + ob_implicit_flush(); | ||
38 | + | ||
39 | + InfraDebug::getInstance()->setBolLigado(true); | ||
40 | + InfraDebug::getInstance()->setBolDebugInfra(true); | ||
41 | + InfraDebug::getInstance()->setBolEcho(true); | ||
42 | + InfraDebug::getInstance()->limpar(); | ||
43 | + | ||
44 | + $this->numSeg = InfraUtil::verificarTempoProcessamento(); | ||
45 | + | ||
46 | + $this->logar($strTitulo); | ||
47 | + } | ||
48 | + | ||
49 | + private function logar($strMsg){ | ||
50 | + InfraDebug::getInstance()->gravar($strMsg); | ||
51 | + flush(); | ||
52 | + } | ||
53 | + | ||
54 | + private function finalizar($strMsg=null, $bolErro){ | ||
55 | + | ||
56 | + if (!$bolErro) { | ||
57 | + $this->numSeg = InfraUtil::verificarTempoProcessamento($this->numSeg); | ||
58 | + $this->logar('TEMPO TOTAL DE EXECUÇÃO: ' . $this->numSeg . ' s'); | ||
59 | + }else{ | ||
60 | + $strMsg = 'ERRO: '.$strMsg; | ||
61 | + } | ||
62 | + | ||
63 | + if ($strMsg!=null){ | ||
64 | + $this->logar($strMsg); | ||
65 | + } | ||
66 | + | ||
67 | + InfraDebug::getInstance()->setBolLigado(false); | ||
68 | + InfraDebug::getInstance()->setBolDebugInfra(false); | ||
69 | + InfraDebug::getInstance()->setBolEcho(false); | ||
70 | + $this->numSeg = 0; | ||
71 | + | ||
72 | + } | ||
73 | + | ||
74 | + private function instalarV300(){ | ||
75 | + | ||
76 | + $strRotuloItemMenuPesquisaPublica = 'Pesquisa Pública'; | ||
77 | + $strRotuloItemMenuParametrosPesquisaPublica = 'Parâmetros de Pesquisa'; | ||
78 | + | ||
79 | + $objSistemaRN = new SistemaRN(); | ||
80 | + $objPerfilRN = new PerfilRN(); | ||
81 | + $objMenuRN = new MenuRN(); | ||
82 | + $objItemMenuRN = new ItemMenuRN(); | ||
83 | + $objRecursoRN = new RecursoRN(); | ||
84 | + | ||
85 | + $objSistemaDTO = new SistemaDTO(); | ||
86 | + $objSistemaDTO->retNumIdSistema(); | ||
87 | + $objSistemaDTO->setStrSigla('SEI'); | ||
88 | + | ||
89 | + $objSistemaDTO = $objSistemaRN->consultar($objSistemaDTO); | ||
90 | + | ||
91 | + if ($objSistemaDTO == null){ | ||
92 | + throw new InfraException('Sistema SEI não encontrado.'); | ||
93 | + } | ||
94 | + | ||
95 | + $numIdSistemaSei = $objSistemaDTO->getNumIdSistema(); | ||
96 | + | ||
97 | + $objPerfilDTO = new PerfilDTO(); | ||
98 | + $objPerfilDTO->retNumIdPerfil(); | ||
99 | + $objPerfilDTO->setNumIdSistema($numIdSistemaSei); | ||
100 | + $objPerfilDTO->setStrNome('Administrador'); | ||
101 | + $objPerfilDTO = $objPerfilRN->consultar($objPerfilDTO); | ||
102 | + | ||
103 | + if ($objPerfilDTO == null){ | ||
104 | + throw new InfraException('Perfil Administrador do sistema SEI não encontrado.'); | ||
105 | + } | ||
106 | + | ||
107 | + $numIdPerfilSeiAdministrador = $objPerfilDTO->getNumIdPerfil(); | ||
108 | + | ||
109 | + $objMenuDTO = new MenuDTO(); | ||
110 | + $objMenuDTO->retNumIdMenu(); | ||
111 | + $objMenuDTO->setNumIdSistema($numIdSistemaSei); | ||
112 | + $objMenuDTO->setStrNome('Principal'); | ||
113 | + $objMenuDTO = $objMenuRN->consultar($objMenuDTO); | ||
114 | + | ||
115 | + if ($objMenuDTO == null){ | ||
116 | + throw new InfraException('Menu do sistema SEI não encontrado.'); | ||
117 | + } | ||
118 | + | ||
119 | + $numIdMenuSei = $objMenuDTO->getNumIdMenu(); | ||
120 | + | ||
121 | + $objItemMenuDTO = new ItemMenuDTO(); | ||
122 | + $objItemMenuDTO->retNumIdItemMenu(); | ||
123 | + $objItemMenuDTO->setNumIdSistema($numIdSistemaSei); | ||
124 | + $objItemMenuDTO->setStrRotulo('Administração'); | ||
125 | + $objItemMenuDTO = $objItemMenuRN->consultar($objItemMenuDTO); | ||
126 | + | ||
127 | + if ($objItemMenuDTO == null){ | ||
128 | + throw new InfraException('Item de menu Administração do sistema SEI não encontrado.'); | ||
129 | + } | ||
130 | + | ||
131 | + $numIdItemMenuSeiAdministracao = $objItemMenuDTO->getNumIdItemMenu(); | ||
132 | + | ||
133 | + $this->logar('ATUALIZANDO RECURSOS, MENUS E PERFIS DO MÓDULO PETICIONAMENTO NA BASE DO SIP...'); | ||
134 | + | ||
135 | + //criando os recursos e vinculando-os aos perfil Administrador | ||
136 | + $this->adicionarRecursoPerfil($numIdSistemaSei, $numIdPerfilSeiAdministrador, 'md_parametro_pesquisa_alterar'); | ||
137 | + $this->adicionarRecursoPerfil($numIdSistemaSei, $numIdPerfilSeiAdministrador, 'md_parametro_pesquisa_consultar'); | ||
138 | + $this->adicionarRecursoPerfil($numIdSistemaSei, $numIdPerfilSeiAdministrador, 'md_parametro_pesquisa_cadastrar'); | ||
139 | + $objRecursoDTO = $this->adicionarRecursoPerfil($numIdSistemaSei, $numIdPerfilSeiAdministrador, 'md_parametro_pesquisa_listar'); | ||
140 | + | ||
141 | + //criando menu | ||
142 | + | ||
143 | + $objItemMenuPesquisaPublica = $this->adicionarItemMenu($numIdSistemaSei, $numIdPerfilSeiAdministrador, $numIdMenuSei, $numIdItemMenuSeiAdministracao, null, $strRotuloItemMenuPesquisaPublica, 0); | ||
144 | + $this->adicionarItemMenu($numIdSistemaSei, $numIdPerfilSeiAdministrador, $numIdMenuSei, $objItemMenuPesquisaPublica->getNumIdItemMenu(), $objRecursoDTO->getNumIdRecurso(), $strRotuloItemMenuParametrosPesquisaPublica, 10); | ||
145 | + | ||
146 | + | ||
147 | + //Adicionando regra de auditoria | ||
148 | + $objRegraAuditoriaDTO = new RegraAuditoriaDTO(); | ||
149 | + $objRegraAuditoriaDTO->retNumIdRegraAuditoria(); | ||
150 | + $objRegraAuditoriaDTO->setNumIdRegraAuditoria(null); | ||
151 | + $objRegraAuditoriaDTO->setStrSinAtivo('S'); | ||
152 | + $objRegraAuditoriaDTO->setNumIdSistema($numIdSistemaSei); | ||
153 | + $objRegraAuditoriaDTO->setArrObjRelRegraAuditoriaRecursoDTO( array() ); | ||
154 | + $objRegraAuditoriaDTO->setStrDescricao('Modulo_Pesquisa_Publica'); | ||
155 | + | ||
156 | + $objRegraAuditoriaRN = new RegraAuditoriaRN(); | ||
157 | + $objRegraAuditoriaDTO = $objRegraAuditoriaRN->cadastrar($objRegraAuditoriaDTO); | ||
158 | + | ||
159 | + $rs = BancoSip::getInstance()->consultarSql('select id_recurso from recurso where id_sistema='.$numIdSistemaSei.' and nome in ( | ||
160 | + \'md_parametro_pesquisa_alterar\', | ||
161 | + \'md_parametro_pesquisa_consultar\', | ||
162 | + \'md_parametro_pesquisa_cadastrar\', | ||
163 | + \'md_parametro_pesquisa_listar\')' | ||
164 | + ); | ||
165 | + | ||
166 | + //CRIANDO REGRA DE AUDITORIA PARA NOVOS RECURSOS RECEM ADICIONADOS | ||
167 | + foreach($rs as $recurso){ | ||
168 | + BancoSip::getInstance()->executarSql('insert into rel_regra_auditoria_recurso (id_regra_auditoria, id_sistema, id_recurso) values ('.$objRegraAuditoriaDTO->getNumIdRegraAuditoria().', '.$numIdSistemaSei.', '.$recurso['id_recurso'].')'); | ||
169 | + } | ||
170 | + | ||
171 | + $objReplicacaoRegraAuditoriaDTO = new ReplicacaoRegraAuditoriaDTO(); | ||
172 | + $objReplicacaoRegraAuditoriaDTO->setStrStaOperacao('A'); | ||
173 | + $objReplicacaoRegraAuditoriaDTO->setNumIdRegraAuditoria($objRegraAuditoriaDTO->getNumIdRegraAuditoria()); | ||
174 | + | ||
175 | + $objSistemaRN = new SistemaRN(); | ||
176 | + $objSistemaRN->replicarRegraAuditoria($objReplicacaoRegraAuditoriaDTO); | ||
177 | + | ||
178 | + | ||
179 | + } | ||
180 | + | ||
181 | + protected function instalarVersaoControlado(){ | ||
182 | + | ||
183 | + try { | ||
184 | + | ||
185 | + $this->inicializar('INICIANDO INSTALACAO DO MODULO PESQUISA PUBLICA NO SIP VERSAO '. SIP_VERSAO ); | ||
186 | + | ||
187 | + //checando versao do framework | ||
188 | + $numVersaoInfraRequerida = '1.208'; | ||
189 | + if (VERSAO_INFRA != $numVersaoInfraRequerida){ | ||
190 | + $this->finalizar('VERSAO DO FRAMEWORK PHP INCOMPATIVEL (VERSAO ATUAL '.VERSAO_INFRA.', VERSAO REQUERIDA '.$numVersaoInfraRequerida.')',true); | ||
191 | + } | ||
192 | + | ||
193 | + //checando BDs suportados | ||
194 | + if (!(BancoSip::getInstance() instanceof InfraMySql) && | ||
195 | + !(BancoSip::getInstance() instanceof InfraSqlServer) && | ||
196 | + !(BancoSip::getInstance() instanceof InfraOracle)){ | ||
197 | + $this->finalizar('BANCO DE DADOS NAO SUPORTADO: '.get_parent_class(BancoSip::getInstance()),true); | ||
198 | + } | ||
199 | + | ||
200 | + //checando permissoes na base de dados | ||
201 | + $objInfraMetaBD = new InfraMetaBD(BancoSip::getInstance()); | ||
202 | + | ||
203 | + if (count($objInfraMetaBD->obterTabelas('sip_teste'))==0){ | ||
204 | + BancoSip::getInstance()->executarSql('CREATE TABLE sip_teste (id '.$objInfraMetaBD->tipoNumero().' null)'); | ||
205 | + } | ||
206 | + | ||
207 | + BancoSip::getInstance()->executarSql('DROP TABLE sip_teste'); | ||
208 | + | ||
209 | + $this->instalarV300(); | ||
210 | + | ||
211 | + $this->logar('SIP - MÓDULO PESQUISA PUBLICA 3.0.0 CONFIGURADO COM SUCESSO'); | ||
212 | + $this->finalizar('FIM', true); | ||
213 | + | ||
214 | + } catch (Exception $e) { | ||
215 | + | ||
216 | + InfraDebug::getInstance()->setBolLigado(false); | ||
217 | + InfraDebug::getInstance()->setBolDebugInfra(false); | ||
218 | + InfraDebug::getInstance()->setBolEcho(false); | ||
219 | + throw new InfraException('Erro atualizando versão.', $e); | ||
220 | + } | ||
221 | + | ||
222 | + } | ||
223 | + | ||
224 | +private function adicionarRecursoPerfil($numIdSistema, $numIdPerfil, $strNome, $strCaminho = null){ | ||
225 | + | ||
226 | + $objRecursoDTO = new RecursoDTO(); | ||
227 | + $objRecursoDTO->retNumIdRecurso(); | ||
228 | + $objRecursoDTO->setNumIdSistema($numIdSistema); | ||
229 | + $objRecursoDTO->setStrNome($strNome); | ||
230 | + | ||
231 | + $objRecursoRN = new RecursoRN(); | ||
232 | + $objRecursoDTO = $objRecursoRN->consultar($objRecursoDTO); | ||
233 | + | ||
234 | + if ($objRecursoDTO==null){ | ||
235 | + | ||
236 | + $objRecursoDTO = new RecursoDTO(); | ||
237 | + $objRecursoDTO->setNumIdRecurso(null); | ||
238 | + $objRecursoDTO->setNumIdSistema($numIdSistema); | ||
239 | + $objRecursoDTO->setStrNome($strNome); | ||
240 | + $objRecursoDTO->setStrDescricao(null); | ||
241 | + | ||
242 | + if ($strCaminho == null){ | ||
243 | + $objRecursoDTO->setStrCaminho('controlador.php?acao='.$strNome); | ||
244 | + }else{ | ||
245 | + $objRecursoDTO->setStrCaminho($strCaminho); | ||
246 | + } | ||
247 | + | ||
248 | + $objRecursoDTO->setStrSinAtivo('S'); | ||
249 | + $objRecursoDTO = $objRecursoRN->cadastrar($objRecursoDTO); | ||
250 | + } | ||
251 | + | ||
252 | + if ($numIdPerfil!=null){ | ||
253 | + $objRelPerfilRecursoDTO = new RelPerfilRecursoDTO(); | ||
254 | + $objRelPerfilRecursoDTO->setNumIdSistema($numIdSistema); | ||
255 | + $objRelPerfilRecursoDTO->setNumIdPerfil($numIdPerfil); | ||
256 | + $objRelPerfilRecursoDTO->setNumIdRecurso($objRecursoDTO->getNumIdRecurso()); | ||
257 | + | ||
258 | + $objRelPerfilRecursoRN = new RelPerfilRecursoRN(); | ||
259 | + | ||
260 | + if ($objRelPerfilRecursoRN->contar($objRelPerfilRecursoDTO)==0){ | ||
261 | + $objRelPerfilRecursoRN->cadastrar($objRelPerfilRecursoDTO); | ||
262 | + } | ||
263 | + } | ||
264 | + | ||
265 | + return $objRecursoDTO; | ||
266 | + | ||
267 | + } | ||
268 | + | ||
269 | + private function removerRecursoPerfil($numIdSistema, $strNome, $numIdPerfil){ | ||
270 | + | ||
271 | + $objRecursoDTO = new RecursoDTO(); | ||
272 | + $objRecursoDTO->setBolExclusaoLogica(false); | ||
273 | + $objRecursoDTO->retNumIdRecurso(); | ||
274 | + $objRecursoDTO->setNumIdSistema($numIdSistema); | ||
275 | + $objRecursoDTO->setStrNome($strNome); | ||
276 | + | ||
277 | + $objRecursoRN = new RecursoRN(); | ||
278 | + $objRecursoDTO = $objRecursoRN->consultar($objRecursoDTO); | ||
279 | + | ||
280 | + if ($objRecursoDTO!=null){ | ||
281 | + $objRelPerfilRecursoDTO = new RelPerfilRecursoDTO(); | ||
282 | + $objRelPerfilRecursoDTO->retTodos(); | ||
283 | + $objRelPerfilRecursoDTO->setNumIdSistema($numIdSistema); | ||
284 | + $objRelPerfilRecursoDTO->setNumIdRecurso($objRecursoDTO->getNumIdRecurso()); | ||
285 | + $objRelPerfilRecursoDTO->setNumIdPerfil($numIdPerfil); | ||
286 | + | ||
287 | + $objRelPerfilRecursoRN = new RelPerfilRecursoRN(); | ||
288 | + $objRelPerfilRecursoRN->excluir($objRelPerfilRecursoRN->listar($objRelPerfilRecursoDTO)); | ||
289 | + | ||
290 | + $objRelPerfilItemMenuDTO = new RelPerfilItemMenuDTO(); | ||
291 | + $objRelPerfilItemMenuDTO->retTodos(); | ||
292 | + $objRelPerfilItemMenuDTO->setNumIdSistema($numIdSistema); | ||
293 | + $objRelPerfilItemMenuDTO->setNumIdRecurso($objRecursoDTO->getNumIdRecurso()); | ||
294 | + $objRelPerfilItemMenuDTO->setNumIdPerfil($numIdPerfil); | ||
295 | + | ||
296 | + $objRelPerfilItemMenuRN = new RelPerfilItemMenuRN(); | ||
297 | + $objRelPerfilItemMenuRN->excluir($objRelPerfilItemMenuRN->listar($objRelPerfilItemMenuDTO)); | ||
298 | + } | ||
299 | + } | ||
300 | + | ||
301 | + private function desativarRecurso($numIdSistema, $strNome){ | ||
302 | + $objRecursoDTO = new RecursoDTO(); | ||
303 | + $objRecursoDTO->retNumIdRecurso(); | ||
304 | + $objRecursoDTO->setNumIdSistema($numIdSistema); | ||
305 | + $objRecursoDTO->setStrNome($strNome); | ||
306 | + | ||
307 | + $objRecursoRN = new RecursoRN(); | ||
308 | + $objRecursoDTO = $objRecursoRN->consultar($objRecursoDTO); | ||
309 | + | ||
310 | + if ($objRecursoDTO!=null){ | ||
311 | + $objRecursoRN->desativar(array($objRecursoDTO)); | ||
312 | + } | ||
313 | + } | ||
314 | + | ||
315 | + private function removerRecurso($numIdSistema, $strNome){ | ||
316 | + | ||
317 | + $objRecursoDTO = new RecursoDTO(); | ||
318 | + $objRecursoDTO->setBolExclusaoLogica(false); | ||
319 | + $objRecursoDTO->retNumIdRecurso(); | ||
320 | + $objRecursoDTO->setNumIdSistema($numIdSistema); | ||
321 | + $objRecursoDTO->setStrNome($strNome); | ||
322 | + | ||
323 | + $objRecursoRN = new RecursoRN(); | ||
324 | + $objRecursoDTO = $objRecursoRN->consultar($objRecursoDTO); | ||
325 | + | ||
326 | + if ($objRecursoDTO!=null){ | ||
327 | + $objRelPerfilRecursoDTO = new RelPerfilRecursoDTO(); | ||
328 | + $objRelPerfilRecursoDTO->retTodos(); | ||
329 | + $objRelPerfilRecursoDTO->setNumIdSistema($numIdSistema); | ||
330 | + $objRelPerfilRecursoDTO->setNumIdRecurso($objRecursoDTO->getNumIdRecurso()); | ||
331 | + | ||
332 | + $objRelPerfilRecursoRN = new RelPerfilRecursoRN(); | ||
333 | + $objRelPerfilRecursoRN->excluir($objRelPerfilRecursoRN->listar($objRelPerfilRecursoDTO)); | ||
334 | + | ||
335 | + $objItemMenuDTO = new ItemMenuDTO(); | ||
336 | + $objItemMenuDTO->retNumIdMenu(); | ||
337 | + $objItemMenuDTO->retNumIdItemMenu(); | ||
338 | + $objItemMenuDTO->setNumIdSistema($numIdSistema); | ||
339 | + $objItemMenuDTO->setNumIdRecurso($objRecursoDTO->getNumIdRecurso()); | ||
340 | + | ||
341 | + $objItemMenuRN = new ItemMenuRN(); | ||
342 | + $arrObjItemMenuDTO = $objItemMenuRN->listar($objItemMenuDTO); | ||
343 | + | ||
344 | + $objRelPerfilItemMenuRN = new RelPerfilItemMenuRN(); | ||
345 | + | ||
346 | + foreach($arrObjItemMenuDTO as $objItemMenuDTO){ | ||
347 | + $objRelPerfilItemMenuDTO = new RelPerfilItemMenuDTO(); | ||
348 | + $objRelPerfilItemMenuDTO->retTodos(); | ||
349 | + $objRelPerfilItemMenuDTO->setNumIdSistema($numIdSistema); | ||
350 | + $objRelPerfilItemMenuDTO->setNumIdItemMenu($objItemMenuDTO->getNumIdItemMenu()); | ||
351 | + | ||
352 | + $objRelPerfilItemMenuRN->excluir($objRelPerfilItemMenuRN->listar($objRelPerfilItemMenuDTO)); | ||
353 | + } | ||
354 | + | ||
355 | + $objItemMenuRN->excluir($arrObjItemMenuDTO); | ||
356 | + $objRecursoRN->excluir(array($objRecursoDTO)); | ||
357 | + } | ||
358 | + } | ||
359 | + | ||
360 | + private function adicionarItemMenu($numIdSistema, $numIdPerfil, $numIdMenu, $numIdItemMenuPai, $numIdRecurso, $strRotulo, $numSequencia ){ | ||
361 | + | ||
362 | + $objItemMenuDTO = new ItemMenuDTO(); | ||
363 | + $objItemMenuDTO->retNumIdItemMenu(); | ||
364 | + $objItemMenuDTO->setNumIdMenu($numIdMenu); | ||
365 | + | ||
366 | + if ($numIdItemMenuPai==null){ | ||
367 | + $objItemMenuDTO->setNumIdMenuPai(null); | ||
368 | + $objItemMenuDTO->setNumIdItemMenuPai(null); | ||
369 | + }else{ | ||
370 | + $objItemMenuDTO->setNumIdMenuPai($numIdMenu); | ||
371 | + $objItemMenuDTO->setNumIdItemMenuPai($numIdItemMenuPai); | ||
372 | + } | ||
373 | + | ||
374 | + $objItemMenuDTO->setNumIdSistema($numIdSistema); | ||
375 | + $objItemMenuDTO->setNumIdRecurso($numIdRecurso); | ||
376 | + $objItemMenuDTO->setStrRotulo($strRotulo); | ||
377 | + | ||
378 | + $objItemMenuRN = new ItemMenuRN(); | ||
379 | + $objItemMenuDTO = $objItemMenuRN->consultar($objItemMenuDTO); | ||
380 | + | ||
381 | + if ($objItemMenuDTO==null){ | ||
382 | + | ||
383 | + $objItemMenuDTO = new ItemMenuDTO(); | ||
384 | + $objItemMenuDTO->setNumIdItemMenu(null); | ||
385 | + $objItemMenuDTO->setNumIdMenu($numIdMenu); | ||
386 | + | ||
387 | + if ($numIdItemMenuPai==null){ | ||
388 | + $objItemMenuDTO->setNumIdMenuPai(null); | ||
389 | + $objItemMenuDTO->setNumIdItemMenuPai(null); | ||
390 | + }else{ | ||
391 | + $objItemMenuDTO->setNumIdMenuPai($numIdMenu); | ||
392 | + $objItemMenuDTO->setNumIdItemMenuPai($numIdItemMenuPai); | ||
393 | + } | ||
394 | + | ||
395 | + $objItemMenuDTO->setNumIdSistema($numIdSistema); | ||
396 | + $objItemMenuDTO->setNumIdRecurso($numIdRecurso); | ||
397 | + $objItemMenuDTO->setStrRotulo($strRotulo); | ||
398 | + $objItemMenuDTO->setStrDescricao(null); | ||
399 | + $objItemMenuDTO->setNumSequencia($numSequencia); | ||
400 | + $objItemMenuDTO->setStrSinNovaJanela('N'); | ||
401 | + $objItemMenuDTO->setStrSinAtivo('S'); | ||
402 | + $objItemMenuDTO = $objItemMenuRN->cadastrar($objItemMenuDTO); | ||
403 | + } | ||
404 | + | ||
405 | + | ||
406 | + if ($numIdPerfil!=null && $numIdRecurso!=null){ | ||
407 | + | ||
408 | + $objRelPerfilRecursoDTO = new RelPerfilRecursoDTO(); | ||
409 | + $objRelPerfilRecursoDTO->setNumIdSistema($numIdSistema); | ||
410 | + $objRelPerfilRecursoDTO->setNumIdPerfil($numIdPerfil); | ||
411 | + $objRelPerfilRecursoDTO->setNumIdRecurso($numIdRecurso); | ||
412 | + | ||
413 | + $objRelPerfilRecursoRN = new RelPerfilRecursoRN(); | ||
414 | + | ||
415 | + if ($objRelPerfilRecursoRN->contar($objRelPerfilRecursoDTO)==0){ | ||
416 | + $objRelPerfilRecursoRN->cadastrar($objRelPerfilRecursoDTO); | ||
417 | + } | ||
418 | + | ||
419 | + $objRelPerfilItemMenuDTO = new RelPerfilItemMenuDTO(); | ||
420 | + $objRelPerfilItemMenuDTO->setNumIdPerfil($numIdPerfil); | ||
421 | + $objRelPerfilItemMenuDTO->setNumIdSistema($numIdSistema); | ||
422 | + $objRelPerfilItemMenuDTO->setNumIdRecurso($numIdRecurso); | ||
423 | + $objRelPerfilItemMenuDTO->setNumIdMenu($numIdMenu); | ||
424 | + $objRelPerfilItemMenuDTO->setNumIdItemMenu($objItemMenuDTO->getNumIdItemMenu()); | ||
425 | + | ||
426 | + $objRelPerfilItemMenuRN = new RelPerfilItemMenuRN(); | ||
427 | + | ||
428 | + if ($objRelPerfilItemMenuRN->contar($objRelPerfilItemMenuDTO)==0){ | ||
429 | + $objRelPerfilItemMenuRN->cadastrar($objRelPerfilItemMenuDTO); | ||
430 | + } | ||
431 | + } | ||
432 | + | ||
433 | + return $objItemMenuDTO; | ||
434 | + } | ||
435 | + | ||
436 | + private function removerItemMenu($numIdSistema, $numIdMenu, $numIdItemMenu){ | ||
437 | + | ||
438 | + $objItemMenuDTO = new ItemMenuDTO(); | ||
439 | + $objItemMenuDTO->retNumIdMenu(); | ||
440 | + $objItemMenuDTO->retNumIdItemMenu(); | ||
441 | + $objItemMenuDTO->setNumIdSistema($numIdSistema); | ||
442 | + $objItemMenuDTO->setNumIdMenu($numIdMenu); | ||
443 | + $objItemMenuDTO->setNumIdItemMenu($numIdItemMenu); | ||
444 | + | ||
445 | + $objItemMenuRN = new ItemMenuRN(); | ||
446 | + $objItemMenuDTO = $objItemMenuRN->consultar($objItemMenuDTO); | ||
447 | + | ||
448 | + if ($objItemMenuDTO!=null) { | ||
449 | + | ||
450 | + $objRelPerfilItemMenuDTO = new RelPerfilItemMenuDTO(); | ||
451 | + $objRelPerfilItemMenuDTO->retTodos(); | ||
452 | + $objRelPerfilItemMenuDTO->setNumIdSistema($numIdSistema); | ||
453 | + $objRelPerfilItemMenuDTO->setNumIdMenu($objItemMenuDTO->getNumIdMenu()); | ||
454 | + $objRelPerfilItemMenuDTO->setNumIdItemMenu($objItemMenuDTO->getNumIdItemMenu()); | ||
455 | + | ||
456 | + $objRelPerfilItemMenuRN = new RelPerfilItemMenuRN(); | ||
457 | + $objRelPerfilItemMenuRN->excluir($objRelPerfilItemMenuRN->listar($objRelPerfilItemMenuDTO)); | ||
458 | + | ||
459 | + $objItemMenuRN->excluir(array($objItemMenuDTO)); | ||
460 | + } | ||
461 | + } | ||
462 | + | ||
463 | + private function removerPerfil($numIdSistema, $strNome){ | ||
464 | + | ||
465 | + $objPerfilDTO = new PerfilDTO(); | ||
466 | + $objPerfilDTO->retNumIdPerfil(); | ||
467 | + $objPerfilDTO->setNumIdSistema($numIdSistema); | ||
468 | + $objPerfilDTO->setStrNome($strNome); | ||
469 | + | ||
470 | + $objPerfilRN = new PerfilRN(); | ||
471 | + $objPerfilDTO = $objPerfilRN->consultar($objPerfilDTO); | ||
472 | + | ||
473 | + if ($objPerfilDTO!=null){ | ||
474 | + | ||
475 | + $objPermissaoDTO = new PermissaoDTO(); | ||
476 | + $objPermissaoDTO->retNumIdSistema(); | ||
477 | + $objPermissaoDTO->retNumIdUsuario(); | ||
478 | + $objPermissaoDTO->retNumIdPerfil(); | ||
479 | + $objPermissaoDTO->retNumIdUnidade(); | ||
480 | + $objPermissaoDTO->setNumIdSistema($numIdSistema); | ||
481 | + $objPermissaoDTO->setNumIdPerfil($objPerfilDTO->getNumIdPerfil()); | ||
482 | + | ||
483 | + $objPermissaoRN = new PermissaoRN(); | ||
484 | + $objPermissaoRN->excluir($objPermissaoRN->listar($objPermissaoDTO)); | ||
485 | + | ||
486 | + $objRelPerfilItemMenuDTO = new RelPerfilItemMenuDTO(); | ||
487 | + $objRelPerfilItemMenuDTO->retTodos(); | ||
488 | + $objRelPerfilItemMenuDTO->setNumIdSistema($numIdSistema); | ||
489 | + $objRelPerfilItemMenuDTO->setNumIdPerfil($objPerfilDTO->getNumIdPerfil()); | ||
490 | + | ||
491 | + $objRelPerfilItemMenuRN = new RelPerfilItemMenuRN(); | ||
492 | + $objRelPerfilItemMenuRN->excluir($objRelPerfilItemMenuRN->listar($objRelPerfilItemMenuDTO)); | ||
493 | + | ||
494 | + $objRelPerfilRecursoDTO = new RelPerfilRecursoDTO(); | ||
495 | + $objRelPerfilRecursoDTO->retTodos(); | ||
496 | + $objRelPerfilRecursoDTO->setNumIdSistema($numIdSistema); | ||
497 | + $objRelPerfilRecursoDTO->setNumIdPerfil($objPerfilDTO->getNumIdPerfil()); | ||
498 | + | ||
499 | + $objRelPerfilRecursoRN = new RelPerfilRecursoRN(); | ||
500 | + $objRelPerfilRecursoRN->excluir($objRelPerfilRecursoRN->listar($objRelPerfilRecursoDTO)); | ||
501 | + | ||
502 | + $objCoordenadorPerfilDTO = new CoordenadorPerfilDTO(); | ||
503 | + $objCoordenadorPerfilDTO->retTodos(); | ||
504 | + $objCoordenadorPerfilDTO->setNumIdSistema($numIdSistema); | ||
505 | + $objCoordenadorPerfilDTO->setNumIdPerfil($objPerfilDTO->getNumIdPerfil()); | ||
506 | + | ||
507 | + $objCoordenadorPerfilRN = new CoordenadorPerfilRN(); | ||
508 | + $objCoordenadorPerfilRN->excluir($objCoordenadorPerfilRN->listar($objCoordenadorPerfilDTO)); | ||
509 | + | ||
510 | + $objPerfilRN->excluir(array($objPerfilDTO)); | ||
511 | + } | ||
512 | + } | ||
513 | + | ||
514 | + | ||
515 | + protected function instalarModuloPesquisaPublicaV300Controlado(){ | ||
516 | + | ||
517 | + try { | ||
518 | + | ||
519 | + $this->inicializar('INICIANDO ATUALIZACAO DO MODULO PETICIONAMENTO NO SIP VERSAO '. SIP_VERSAO ); | ||
520 | + | ||
521 | + //checando BDs suportados | ||
522 | + if (!(BancoSip::getInstance() instanceof InfraMySql) && | ||
523 | + !(BancoSip::getInstance() instanceof InfraSqlServer) && | ||
524 | + !(BancoSip::getInstance() instanceof InfraOracle)){ | ||
525 | + $this->finalizar('BANCO DE DADOS NAO SUPORTADO: '.get_parent_class(BancoSip::getInstance()),true); | ||
526 | + } | ||
527 | + | ||
528 | + //checando permissoes na base de dados | ||
529 | + $objInfraMetaBD = new InfraMetaBD(BancoSip::getInstance()); | ||
530 | + | ||
531 | + if (count($objInfraMetaBD->obterTabelas('sip_teste'))==0){ | ||
532 | + BancoSip::getInstance()->executarSql('CREATE TABLE sip_teste (id '.$objInfraMetaBD->tipoNumero().' null)'); | ||
533 | + } | ||
534 | + | ||
535 | + BancoSip::getInstance()->executarSql('DROP TABLE sip_teste'); | ||
536 | + | ||
537 | + $this->instalarV300(); | ||
538 | + | ||
539 | + $this->logar('CONFIGURACAO DO MODULO DE PESQUISA PUBLICA 3.0.0 INSTALADAS COM SUCESSO NA BASE DO SIP REALIZADA COM SUCESSO!'); | ||
540 | + $this->finalizar('FIM', false); | ||
541 | + | ||
542 | + | ||
543 | + | ||
544 | + } catch (Exception $e) { | ||
545 | + } | ||
546 | + | ||
547 | + | ||
548 | + } | ||
549 | + | ||
550 | +} | ||
551 | + | ||
552 | +//========================= INICIO SCRIPT EXECUÇAO ============= | ||
553 | + | ||
554 | +try{ | ||
555 | + | ||
556 | + session_start(); | ||
557 | + | ||
558 | + SessaoSip::getInstance(false); | ||
559 | + | ||
560 | + $objVersaoRN = new AtualizadorSipModuloPesquisaRN(); | ||
561 | + $objVersaoRN->instalarModuloPesquisaPublicaV300(); | ||
562 | + | ||
563 | +}catch(Exception $e){ | ||
564 | + echo(nl2br(InfraException::inspecionar($e))); | ||
565 | + try{LogSip::getInstance()->gravar(InfraException::inspecionar($e));}catch(Exception $e){} | ||
566 | +} | ||
567 | + | ||
568 | +//========================== FIM SCRIPT EXECUÇÂO ==================== | ||
569 | +?> | ||
0 | \ No newline at end of file | 570 | \ No newline at end of file |