Commit 863e0a6752bb6dbad8c673c280911b416729c933
0 parents
Exists in
master
and in
1 other branch
Módulo completo da versão 2.0.0 do módulo
Showing
40 changed files
with
5753 additions
and
0 deletions
Show diff stats
1 | +++ a/sei/institucional/pesquisa/BancoCADE.php | ||
@@ -0,0 +1,207 @@ | @@ -0,0 +1,207 @@ | ||
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 | + * BancoCADE | ||
11 | + * | ||
12 | + * | ||
13 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
14 | + */ | ||
15 | + | ||
16 | +/** | ||
17 | + * Classe infraestrutura para o banco de dados DBCade Sql Server 2012. | ||
18 | + * | ||
19 | + * | ||
20 | + * @package institucional_pesquisa_ProcedimentoSiscadeRN | ||
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 BancoCADE extends InfraSqlServer{ | ||
34 | + | ||
35 | + private static $instance = null; | ||
36 | + | ||
37 | + private $parametro = null; | ||
38 | + | ||
39 | + | ||
40 | + | ||
41 | + | ||
42 | + public function __construct($param){ | ||
43 | + parent::__construct(); | ||
44 | + $this->parametro = $param; | ||
45 | + | ||
46 | + } | ||
47 | + | ||
48 | + public static function getInstance($param) { | ||
49 | + if (self::$instance == null) { | ||
50 | + self::$instance = new BancoCADE($param); | ||
51 | + } | ||
52 | + return self::$instance; | ||
53 | + } | ||
54 | + | ||
55 | + public function getServidor() { | ||
56 | + return ConfiguracaoPesquisa::getInstance()->getValor($this->parametro,'Servidor'); | ||
57 | + } | ||
58 | + | ||
59 | + public function getPorta() { | ||
60 | + return ConfiguracaoPesquisa::getInstance()->getValor($this->parametro,'Porta'); | ||
61 | + } | ||
62 | + | ||
63 | + public function getBanco() { | ||
64 | + return ConfiguracaoPesquisa::getInstance()->getValor($this->parametro,'Banco'); | ||
65 | + } | ||
66 | + | ||
67 | + public function getUsuario(){ | ||
68 | + return ConfiguracaoPesquisa::getInstance()->getValor($this->parametro,'Usuario'); | ||
69 | + } | ||
70 | + | ||
71 | + public function getSenha(){ | ||
72 | + return ConfiguracaoPesquisa::getInstance()->getValor($this->parametro,'Senha'); | ||
73 | + } | ||
74 | + | ||
75 | + public function isBolForcarPesquisaCaseInsensitive(){ | ||
76 | + return false; | ||
77 | + } | ||
78 | + | ||
79 | + public function isBolValidarISO88591(){ | ||
80 | + return false; | ||
81 | + } | ||
82 | + | ||
83 | + | ||
84 | + | ||
85 | + public function paginarSql($sql,$ini,$qtd){ | ||
86 | + | ||
87 | + InfraDebug::getInstance()->gravarInfra('[InfraSqlServer->paginarSql] '); | ||
88 | + | ||
89 | + $arr = explode(' ',$sql); | ||
90 | + $select = ''; | ||
91 | + | ||
92 | + | ||
93 | + for($i=0;$i<count($arr);$i++){ | ||
94 | + | ||
95 | + if (strtoupper($arr[$i])=='FROM'){ | ||
96 | + break; | ||
97 | + } | ||
98 | + | ||
99 | + $select .= ' '.$arr[$i]; | ||
100 | + } | ||
101 | + | ||
102 | + $from = ''; | ||
103 | + for(;$i<count($arr);$i++){ | ||
104 | + if (strtoupper($arr[$i])=='ORDER'){ | ||
105 | + break; | ||
106 | + } | ||
107 | + $from .= ' '.$arr[$i]; | ||
108 | + } | ||
109 | + | ||
110 | + if (trim($from)==''){ | ||
111 | + throw new InfraException('Cláusula FROM não encontrada.'); | ||
112 | + } | ||
113 | + | ||
114 | + $order = ''; | ||
115 | + for(;$i<count($arr);$i++){ | ||
116 | + $order .= ' '.$arr[$i]; | ||
117 | + } | ||
118 | + | ||
119 | + if (trim($order)==''){ | ||
120 | + throw new InfraException('Para utilizar a paginação com este banco de dados é necessário que a consulta utilize pelo menos um campo para ordenação.'); | ||
121 | + } | ||
122 | + | ||
123 | + $sql = ''; | ||
124 | + $sql .= ' SELECT IDENTITY(int,1,1) as InfraRowNumber, * INTO #InfraTabela FROM ('; | ||
125 | + | ||
126 | + if (strpos(strtoupper($select),'DISTINCT')===false){ | ||
127 | + $sql .= $select; | ||
128 | + | ||
129 | + | ||
130 | + | ||
131 | + //$sql .= ',InfraRowCount = COUNT(*) OVER(),ROW_NUMBER() OVER ('.$order.') as InfraRowNumber '; | ||
132 | + $sql .= $from; | ||
133 | + | ||
134 | + }else{ | ||
135 | + /* | ||
136 | + Se tiver DISTINCT tem que montar de outra maneira, adicionando outro nível de consulta: | ||
137 | + SELECT TOP 100 * FROM ( | ||
138 | + SELECT * | ||
139 | + ,ROW_NUMBER() OVER (order by id_pessoa) as InfraRowNumber [order by sem o nome da tabela nos campos] | ||
140 | + ,InfraRowCount = COUNT(*) OVER() | ||
141 | + FROM ( | ||
142 | + [sql original sem o order by] | ||
143 | + ) as InfraTabelaDistinct | ||
144 | + ) AS InfraTabela | ||
145 | + WHERE InfraRowNumber > 10 | ||
146 | + */ | ||
147 | + | ||
148 | + $arrSelect = explode(' ',str_replace(',',' ',str_replace('CAST(','',str_replace(' as varchar)','',$select)))); | ||
149 | + $arrOrder = explode(' ',$order); | ||
150 | + $order = ''; | ||
151 | + | ||
152 | + for($i=0;$i<count($arrOrder);$i++){ | ||
153 | + $order .= ' '; | ||
154 | + for($j=0;$j<count($arrSelect);$j++){ | ||
155 | + if ($arrSelect[$j]==$arrOrder[$i] && isset($arrSelect[$j+1]) && strtoupper($arrSelect[$j+1])=='AS' && isset($arrSelect[$j+2])){ | ||
156 | + $order .= $arrSelect[$j+2]; | ||
157 | + break; | ||
158 | + } | ||
159 | + } | ||
160 | + | ||
161 | + if ($j == count($arrSelect) && strpos($arrOrder[$i],'.')!==false){ | ||
162 | + //se o campo nao tinha alias e possui ".", deve retirar o nome da tabela principal | ||
163 | + $order .= substr($arrOrder[$i],strpos($arrOrder[$i],'.')+1); | ||
164 | + }else if ($j == count($arrSelect)){ | ||
165 | + //se o campo nao tinha alias e nao possui ".", apenas copia order | ||
166 | + $order .= $arrOrder[$i]; | ||
167 | + } | ||
168 | + } | ||
169 | + | ||
170 | + $sql .= ' SELECT *'; | ||
171 | + $sql .= ',InfraRowCount = COUNT(*) OVER(),ROW_NUMBER() OVER ('.$order.') as InfraRowNumber '; | ||
172 | + $sql .= ' FROM ('; | ||
173 | + $sql .= $select; | ||
174 | + $sql .= $from; | ||
175 | + $sql .= ') AS InfraTabelaDistinct'; | ||
176 | + } | ||
177 | + | ||
178 | + //$sql.= ') as InfraTabela '.$order; | ||
179 | + //melhorar esta parte usar ORDER vindo da Infra | ||
180 | + $sql.= ') as InfraTabela ORDER BY pronumero ASC '; | ||
181 | + $sql.= 'select *, (select count(*) from #InfraTabela ) as InfraRowCount from #InfraTabela where InfraRowNumber BETWEEN '.($ini+1) .' AND ' .($ini+$qtd).' ORDER BY InfraRowNumber'; | ||
182 | + $sql.= ' drop table #InfraTabela '; | ||
183 | + | ||
184 | + | ||
185 | + //$sql .= ') AS InfraTabela WHERE InfraRowNumber BETWEEN '.($ini+1) .' AND ' .($ini+$qtd).' ORDER BY InfraRowNumber'; | ||
186 | + | ||
187 | + | ||
188 | + | ||
189 | + $rs = $this->consultarSql($sql); | ||
190 | + | ||
191 | + return array('totalRegistros'=>$rs[0]['InfraRowCount'],'registrosPagina'=>$rs); | ||
192 | + } | ||
193 | + | ||
194 | + | ||
195 | + | ||
196 | + | ||
197 | + | ||
198 | + | ||
199 | + | ||
200 | + | ||
201 | + | ||
202 | +} | ||
203 | + | ||
204 | + | ||
205 | + | ||
206 | + | ||
207 | +?> |
1 | +++ a/sei/institucional/pesquisa/BancoSISCADE.php | ||
@@ -0,0 +1,83 @@ | @@ -0,0 +1,83 @@ | ||
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 | + * BancoSISCADE | ||
11 | + * | ||
12 | + * | ||
13 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
14 | + */ | ||
15 | + | ||
16 | +/** | ||
17 | + * Classe infraestrutura banco de dados SISCADE SQL Server 2008 | ||
18 | + * | ||
19 | + * | ||
20 | + * @package institucional_pesquisa_BancoSISCADE | ||
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 BancoSISCADE extends InfraSqlServer{ | ||
34 | + | ||
35 | + private static $instance = null; | ||
36 | + | ||
37 | + private $parametro = null; | ||
38 | + | ||
39 | + public function __construct($param){ | ||
40 | + parent::__construct(); | ||
41 | + $this->parametro = $param; | ||
42 | + | ||
43 | + } | ||
44 | + | ||
45 | + public static function getInstance($param) { | ||
46 | + if (self::$instance == null) { | ||
47 | + self::$instance = new BancoSISCADE($param); | ||
48 | + } | ||
49 | + return self::$instance; | ||
50 | + } | ||
51 | + | ||
52 | + public function getServidor() { | ||
53 | + return ConfiguracaoPesquisa::getInstance()->getValor($this->parametro,'Servidor'); | ||
54 | + } | ||
55 | + | ||
56 | + public function getPorta() { | ||
57 | + return ConfiguracaoPesquisa::getInstance()->getValor($this->parametro,'Porta'); | ||
58 | + } | ||
59 | + | ||
60 | + public function getBanco() { | ||
61 | + return ConfiguracaoPesquisa::getInstance()->getValor($this->parametro,'Banco'); | ||
62 | + } | ||
63 | + | ||
64 | + public function getUsuario(){ | ||
65 | + return ConfiguracaoPesquisa::getInstance()->getValor($this->parametro,'Usuario'); | ||
66 | + } | ||
67 | + | ||
68 | + public function getSenha(){ | ||
69 | + return ConfiguracaoPesquisa::getInstance()->getValor($this->parametro,'Senha'); | ||
70 | + } | ||
71 | + | ||
72 | + public function isBolForcarPesquisaCaseInsensitive(){ | ||
73 | + return false; | ||
74 | + } | ||
75 | + | ||
76 | + public function isBolValidarISO88591(){ | ||
77 | + return false; | ||
78 | + } | ||
79 | + | ||
80 | + | ||
81 | +} | ||
82 | + | ||
83 | +?> | ||
0 | \ No newline at end of file | 84 | \ No newline at end of file |
1 | +++ a/sei/institucional/pesquisa/BuscaProtocoloExterno.php | ||
@@ -0,0 +1,641 @@ | @@ -0,0 +1,641 @@ | ||
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 | + $bolPesquisaDocumentoProcessoPublico = ConfiguracaoPesquisa::getInstance()->getValor('Pesquisa','DocumentoProcessoPublico'); | ||
42 | + $bolPesquisaProcessoRestrito = ConfiguracaoPesquisa::getInstance()->getValor('Pesquisa','ProcessoRestrito'); | ||
43 | + $bolLinkMetadadosProcessoRestrito = ConfiguracaoPesquisa::getInstance()->getValor('Pesquisa','MetaDadosProcessoRestrito'); | ||
44 | + $txtDescricaoProcedimentoAcessoRestrito = ConfiguracaoPesquisa::getInstance()->getValor('Pesquisa','DescricaoProcedimentoAcessoRestrito'); | ||
45 | + $bolAutocompletarInterressado = ConfiguracaoPesquisa::getInstance()->getValor('Pesquisa','AutoCompletarInteressado'); | ||
46 | + $parametros = new stdClass(); | ||
47 | + $filtro = new stdClass(); | ||
48 | + | ||
49 | + $partialfields = ''; | ||
50 | + | ||
51 | + //die($_REQUEST["partialfields"]); | ||
52 | + | ||
53 | + if(!$bolAutocompletarInterressado){ | ||
54 | + $partialfields = $strParticipanteSolr; | ||
55 | + } | ||
56 | + | ||
57 | + | ||
58 | + | ||
59 | + if (!InfraString::isBolVazia($_REQUEST["partialfields"])){ | ||
60 | + $partialfields = $partialfields.$_REQUEST["partialfields"]; | ||
61 | + | ||
62 | + | ||
63 | + $checkbox = array(); | ||
64 | + if (preg_match("/sta_protocolo:([A-Z;]+)/i", $partialfields, $checkbox) > 0) { | ||
65 | + $checkbox = explode(";", $checkbox[1]); | ||
66 | + } | ||
67 | + | ||
68 | + | ||
69 | + | ||
70 | + }else{ | ||
71 | + $checkbox = array('P','G','R'); | ||
72 | + } | ||
73 | + | ||
74 | + $grupo = array(); | ||
75 | + | ||
76 | + // PESQUISAR EM: PROCESSOS | ||
77 | + if (in_array("P", $checkbox)) { | ||
78 | + | ||
79 | + if($bolPesquisaProcessoRestrito){ | ||
80 | + array_push($grupo, "(sta_protocolo:P)"); | ||
81 | + }else{ | ||
82 | + array_push($grupo, "(sta_protocolo:P AND tipo_acesso:P)"); | ||
83 | + } | ||
84 | + | ||
85 | + } | ||
86 | + | ||
87 | + // PESQUISAR EM: DOCUMENTOS EXTERNOS | ||
88 | + if (in_array("R", $checkbox)) { | ||
89 | + | ||
90 | + array_push($grupo, "(sta_protocolo:R AND tipo_acesso:P)"); | ||
91 | + | ||
92 | + | ||
93 | + } | ||
94 | + | ||
95 | + // PESQUISAR EM: DOCUMENTOS GERADOS | ||
96 | + $filtroDocumentoInternoAssinado = ''; | ||
97 | + if (in_array("G", $checkbox)) { | ||
98 | + | ||
99 | + array_push($grupo, "(sta_protocolo:G AND tipo_acesso:P)"); | ||
100 | + | ||
101 | + | ||
102 | + } | ||
103 | + | ||
104 | + if (count($grupo)>0){ | ||
105 | + //Alteração para consulta externa sem login | ||
106 | + $staProtocolo = '('.implode(" OR ", $grupo).')'; | ||
107 | + //$staProtocolo = '('.implode(" OR ", $grupo).') AND tipo_acesso:P'; | ||
108 | + | ||
109 | + | ||
110 | + | ||
111 | + | ||
112 | + if (preg_match("/sta_protocolo:([A-Z;]+)/i", $partialfields)){ | ||
113 | + $partialfields = preg_replace("/sta_protocolo:[A-Z;]+/i", $staProtocolo, $partialfields); | ||
114 | + }else{ | ||
115 | + $partialfields .= $staProtocolo; | ||
116 | + } | ||
117 | + } | ||
118 | + | ||
119 | + | ||
120 | + | ||
121 | + /** | ||
122 | + * ELABORA A URL | ||
123 | + */ | ||
124 | + | ||
125 | + $parametros->q = SolrUtilExterno::formatarOperadores($q); | ||
126 | + | ||
127 | + if ($strDescricaoPesquisa!=''){ | ||
128 | + | ||
129 | + if ($parametros->q != ''){ | ||
130 | + $parametros->q .= ' AND '; | ||
131 | + } | ||
132 | + | ||
133 | + $parametros->q .= '('.SolrUtilExterno::formatarOperadores($strDescricaoPesquisa, 'idx_descricao').')'; | ||
134 | + } | ||
135 | + | ||
136 | + if ($strObservacaoPesquisa!=''){ | ||
137 | + if ($parametros->q != ''){ | ||
138 | + $parametros->q .= ' AND '; | ||
139 | + } | ||
140 | + $parametros->q .= '('.SolrUtilExterno::formatarOperadores($strObservacaoPesquisa,'idx_observacao_'.SessaoSEI::getInstance()->getNumIdUnidadeAtual()).')'; | ||
141 | + } | ||
142 | + | ||
143 | +// $objUnidadeDTO = new UnidadeDTO(); | ||
144 | +// $objUnidadeDTO->setBolExclusaoLogica(false); | ||
145 | +// $objUnidadeDTO->retStrSinProtocolo(); | ||
146 | +// $objUnidadeDTO->setNumIdUnidade(SessaoSEI::getInstance()->getNumIdUnidadeAtual()); | ||
147 | + | ||
148 | +// $objUnidadeRN = new UnidadeRN(); | ||
149 | +// $objUnidadeDTO = $objUnidadeRN->consultarRN0125($objUnidadeDTO); | ||
150 | + | ||
151 | +// if ($objUnidadeDTO->getStrSinProtocolo()=='N'){ | ||
152 | + | ||
153 | +// if ($partialfields != ''){ | ||
154 | +// $partialfields .= ' AND '; | ||
155 | +// } | ||
156 | + | ||
157 | +// $partialfields .= '(tipo_acesso:P OR id_unidade_acesso:*'.SessaoSEI::getInstance()->getNumIdUnidadeAtual().'*)'; | ||
158 | +// } | ||
159 | + | ||
160 | + | ||
161 | + /* | ||
162 | + if (SessaoSEI::getInstance()->getNumIdOrgaoUsuario()==X && SessaoSEI::getInstance()->getStrSiglaUsuario()=='XXXX'){ | ||
163 | + */ | ||
164 | + //die($partialfields); | ||
165 | + /*} | ||
166 | + */ | ||
167 | + | ||
168 | + $parametros->start = $inicio; | ||
169 | + | ||
170 | + if ($parametros->q != '' && $partialfields != ''){ | ||
171 | + $parametros->q .= ' AND ' .$partialfields; | ||
172 | + }else if ($partialfields != ''){ | ||
173 | + $parametros->q = $partialfields; | ||
174 | + } | ||
175 | + | ||
176 | + $parametros->sort = 'dta_geracao desc'; | ||
177 | + | ||
178 | + | ||
179 | + //////////////////////////////// | ||
180 | +// print_r($parametros); | ||
181 | +// die; | ||
182 | + ////////////////////////////// | ||
183 | + | ||
184 | + | ||
185 | + $parametros->q = utf8_encode($parametros->q); | ||
186 | + | ||
187 | + | ||
188 | + | ||
189 | + //Monta url de busca | ||
190 | + $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'; | ||
191 | + | ||
192 | + | ||
193 | + | ||
194 | + // @DEBUG | ||
195 | + | ||
196 | + //echo 'URL:'.$urlBusca; | ||
197 | + //echo "PARÂMETROS: " . print_r($parametros, true); | ||
198 | + | ||
199 | + //Objeto que contera o xml do resultado de busca | ||
200 | + //$resultados = new SolrXmlResults($urlBusca, $numMaximoResultados); | ||
201 | + | ||
202 | + $numSeg = InfraUtil::verificarTempoProcessamento(); | ||
203 | + $resultados = file_get_contents($urlBusca, false); | ||
204 | + $numSeg = InfraUtil::verificarTempoProcessamento($numSeg); | ||
205 | + | ||
206 | + if ($resultados == ''){ | ||
207 | + throw new InfraException('Nenhum retorno encontrado no resultado da pesquisa.'); | ||
208 | + } | ||
209 | + | ||
210 | + $xml = simplexml_load_string($resultados); | ||
211 | + | ||
212 | + $html = ''; | ||
213 | + | ||
214 | + $arrRet = $xml->xpath('/response/result/@numFound'); | ||
215 | + | ||
216 | + $itens = array_shift($arrRet); | ||
217 | + | ||
218 | + | ||
219 | + $registros = $xml->xpath('/response/result/doc'); | ||
220 | + | ||
221 | + | ||
222 | + if ($itens == 0){ | ||
223 | + | ||
224 | + $html .= "<div class=\"sem-resultado\">"; | ||
225 | + $html .= "Sua pesquisa pelo termo <b>" . preg_replace("/\"/", """, str_replace('\\','',$_REQUEST["q"])) . "</b> não encontrou nenhum processo ou documento correspondente."; | ||
226 | + $html .= "<br/>"; | ||
227 | + $html .= "<br/>"; | ||
228 | + $html .= "Sugestões:"; | ||
229 | + $html .= "<ul>"; | ||
230 | + $html .= "<li>Certifique-se de que todas as palavras estejam escritas corretamente.</li>"; | ||
231 | + $html .= "<li>Tente palavras-chave diferentes.</li>"; | ||
232 | + $html .= "<li>Tente palavras-chave mais genéricas.</li>"; | ||
233 | + $html .= "</ul>"; | ||
234 | + $html .= "</div>"; | ||
235 | + | ||
236 | +// }else if ($itens == 1) { | ||
237 | + | ||
238 | +// $linkArvoreDocumento = $xml->xpath("//str[@name='link_arvore']"); | ||
239 | +// if (is_array($linkArvoreDocumento)){ | ||
240 | +// //ALTERAÇÃO PARA PESQUISA DE PROCESSO EXTERNA. | ||
241 | +// $idProtocolo = $xml->xpath("//str[@name='id_protocolo']"); | ||
242 | +// $idProtocolo = trim(urldecode($idProtocolo[0])); | ||
243 | +// $objDocumentoRN = new DocumentoRN(); | ||
244 | +// $objDocumentoDTO = new DocumentoDTO(); | ||
245 | +// $objDocumentoDTO->setDblIdDocumento($idProtocolo); | ||
246 | +// $objDocumentoDTO->retDblIdProcedimento(); | ||
247 | +// $objDocumentoDTO = $objDocumentoRN->consultarRN0005($objDocumentoDTO); | ||
248 | +// $urlPesquisaProcesso = 'processo_exibir.php?id_orgao_acesso_externo=0&id_procedimento='.$objDocumentoDTO->getDblIdProcedimento(); | ||
249 | +// $arvore = $urlPesquisaProcesso; | ||
250 | +// header("Location: " . SessaoSEIExterna::getInstance()->assinarLink(SolrUtilExterno::prepararUrl($urlPesquisaProcesso))); | ||
251 | +// die; | ||
252 | +// } | ||
253 | + | ||
254 | + }else{ | ||
255 | + | ||
256 | + $html = SolrUtilExterno::criarBarraEstatisticas($itens,$inicio,($inicio+10)); | ||
257 | + | ||
258 | + | ||
259 | + $numRegistros = sizeof($registros); | ||
260 | +// Se descomentar verificar redundancia da consulta para montar o link da arvore Linha 322 | ||
261 | +// for ($i = 0; $i < $numRegistros; $i++) { | ||
262 | +// $teste = $registros[$i]->xpath("str[@name='tipo_acesso']"); | ||
263 | +// $idProtocolo = $registros[$i]->xpath("str[@name='id_protocolo']"); | ||
264 | +// $idProtocolo = trim(urldecode($idProtocolo[0])); | ||
265 | +// $objDocumentoDTO = new DocumentoDTO(); | ||
266 | +// $objDocumentoRN = new DocumentoRN(); | ||
267 | +// $objDocumentoDTO->setDblIdDocumento($idProtocolo); | ||
268 | +// $objDocumentoDTO->retDblIdProcedimento(); | ||
269 | +// $objDocumentoDTO->retStrStaNivelAcessoGlobalProtocolo(); | ||
270 | +// $objDocumentoDTO = $objDocumentoRN->consultarRN0005($objDocumentoDTO); | ||
271 | +// $teste = $objDocumentoDTO->getStrStaNivelAcessoGlobalProtocolo(); | ||
272 | +// if($objDocumentoDTO->getStrStaNivelAcessoGlobalProtocolo() != 0){ | ||
273 | +// $i++; | ||
274 | +// $itens = $itens -1; | ||
275 | +// unset($registros[$i]); | ||
276 | +// continue; | ||
277 | +// } | ||
278 | +// } | ||
279 | + | ||
280 | + | ||
281 | + | ||
282 | +// $registros = array_values($registros); | ||
283 | + | ||
284 | + | ||
285 | + for ($i = 0; $i < $numRegistros; $i++) { | ||
286 | + | ||
287 | + | ||
288 | + | ||
289 | + $dados = array(); | ||
290 | + $titulo = ""; | ||
291 | + $endereco = ""; | ||
292 | + | ||
293 | + // ABSTRAI OS DADOS DAS METATAGS DO XML | ||
294 | + $endereco = $registros[$i]->xpath("str[@name='id']"); | ||
295 | + $dados["tipo_acesso"] = $registros[$i]->xpath("str[@name='tipo_acesso']"); | ||
296 | + $dados["id_unidade_acesso"] = $registros[$i]->xpath("str[@name='id_unidade_acesso']"); | ||
297 | + $dados["id_unidade_geradora"] = $registros[$i]->xpath("str[@name='id_unidade_geradora']"); | ||
298 | + $dados["id_unidade_aberto"] = $registros[$i]->xpath("str[@name='id_unidade_aberto']"); | ||
299 | + $dados["identificacao_protocolo"] = $registros[$i]->xpath("str[@name='identificacao_protocolo']"); | ||
300 | + $dados["nome_tipo_processo"] = $registros[$i]->xpath("str[@name='nome_tipo_processo']"); | ||
301 | + $dados["protocolo_documento_formatado"] = $registros[$i]->xpath("str[@name='protocolo_documento_formatado']"); | ||
302 | + $dados["protocolo_processo_formatado"] = $registros[$i]->xpath("str[@name='protocolo_processo_formatado']"); | ||
303 | + | ||
304 | + | ||
305 | + $dados["tipo_acesso"] = utf8_decode($dados["tipo_acesso"][0]); | ||
306 | + $dados["id_unidade_acesso"] = utf8_decode($dados["id_unidade_acesso"][0]); | ||
307 | + $dados["id_unidade_geradora"] = utf8_decode($dados["id_unidade_geradora"][0]); | ||
308 | + $dados["id_unidade_aberto"] = utf8_decode($dados["id_unidade_aberto"][0]); | ||
309 | + $dados["identificacao_protocolo"] = utf8_decode($dados["identificacao_protocolo"][0]); | ||
310 | + $dados["nome_tipo_processo"] = utf8_decode($dados["nome_tipo_processo"][0]); | ||
311 | + $dados["protocolo_documento_formatado"] = utf8_decode($dados["protocolo_documento_formatado"][0]); | ||
312 | + $dados["protocolo_processo_formatado"] = utf8_decode($dados["protocolo_processo_formatado"][0]); | ||
313 | + $endereco = utf8_decode($endereco[0]); | ||
314 | + | ||
315 | + // VERIFICA OS DADOS | ||
316 | + $dados["tipo_acesso"] = strtoupper(trim(strip_tags($dados["tipo_acesso"]))) == "NULL" ? null : $dados["tipo_acesso"]; | ||
317 | + $dados["id_unidade_acesso"] = strtoupper(trim(strip_tags($dados["id_unidade_acesso"]))) == "NULL" ? null : $dados["id_unidade_acesso"]; | ||
318 | + $dados["id_unidade_geradora"] = strtoupper(trim(strip_tags($dados["id_unidade_geradora"]))) == "NULL" ? null : $dados["id_unidade_geradora"]; | ||
319 | + $dados["id_unidade_aberto"] = strtoupper(trim(strip_tags($dados["id_unidade_aberto"]))) == "NULL" ? null : $dados["id_unidade_aberto"]; | ||
320 | + $dados["identificacao_protocolo"] = strtoupper(trim(strip_tags($dados["identificacao_protocolo"]))) == "NULL" ? null : $dados["identificacao_protocolo"]; | ||
321 | + $dados["nome_tipo_processo"] = strtoupper(trim(strip_tags($dados["nome_tipo_processo"]))) == "NULL" ? null : $dados["nome_tipo_processo"]; | ||
322 | + $dados["protocolo_documento_formatado"] = strtoupper(trim(strip_tags($dados["protocolo_documento_formatado"]))) == "NULL" ? null : $dados["protocolo_documento_formatado"]; | ||
323 | + $dados["protocolo_processo_formatado"] = strtoupper(trim(strip_tags($dados["protocolo_processo_formatado"]))) == "NULL" ? null : $dados["protocolo_processo_formatado"]; | ||
324 | + | ||
325 | + // FORMATA OS DADOS | ||
326 | + $dados["id_unidade_aberto"] = preg_split("/ *, */", $dados["id_unidade_aberto"], -1, PREG_SPLIT_NO_EMPTY); | ||
327 | + $dados["id_unidade_acesso"] = preg_split("/ *, */", $dados["id_unidade_acesso"], -1, PREG_SPLIT_NO_EMPTY); | ||
328 | + $dados["id_unidade_geradora"] = preg_split("/ *, */", $dados["id_unidade_geradora"], -1, PREG_SPLIT_NO_EMPTY); | ||
329 | + | ||
330 | + | ||
331 | + //////////////////////////////////////////////// CONTROLE DE ACESSO //////////////////////////////////////////////// | ||
332 | + //Não mostra registros que não deveriam ter retornado (se falhar algum critério de busca na montagem do "q") | ||
333 | +// if ($objUnidadeDTO->getStrSinProtocolo()=='N'){ | ||
334 | +// if ($dados["tipo_acesso"]=='R' && !in_array(SessaoSEI::getInstance()->getNumIdUnidadeAtual(),explode(';',$dados["id_unidade_acesso"][0]))){ | ||
335 | +// continue; | ||
336 | +// } | ||
337 | +// } | ||
338 | + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
339 | + | ||
340 | + $titulo = $dados["nome_tipo_processo"] . " N° " . $dados["protocolo_processo_formatado"]; | ||
341 | + | ||
342 | + if (empty($dados["protocolo_documento_formatado"]) == false) { | ||
343 | + $titulo .= " "; | ||
344 | + $titulo .= "(<a target=\"_blank\" href=\"" . PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink(SolrUtilExterno::prepararUrl($endereco))) . "\""; | ||
345 | + | ||
346 | + if (in_array(SessaoSEI::getInstance()->getNumIdUnidadeAtual(), $dados["id_unidade_aberto"])) { | ||
347 | + $titulo .= " title=\"Aberto nesta unidade\" class=\"protocoloAberto\""; | ||
348 | + } else { | ||
349 | + $titulo .= " title=\"Fechado nesta unidade\" class=\"protocoloNormal\""; | ||
350 | + } | ||
351 | + | ||
352 | + $titulo .= ">" . $dados["identificacao_protocolo"] . "</a>)"; | ||
353 | + } | ||
354 | + | ||
355 | + //$tituloProtocolo = $dados["protocolo_documento_formatado"]; | ||
356 | + //$tituloProtocolo = 'N° SEI (Documento/Processo)'; | ||
357 | + | ||
358 | + $arrMetatags = array(); | ||
359 | + | ||
360 | + $strSiglaUnidadeGeradora = $registros[$i]->xpath("str[@name='sigla_unidade_geradora']"); | ||
361 | + $strSiglaUnidadeGeradora = utf8_decode($strSiglaUnidadeGeradora[0]); | ||
362 | + | ||
363 | + $strDescricaoUnidadeGeradora = $registros[$i]->xpath("str[@name='descricao_unidade_geradora']"); | ||
364 | + $strDescricaoUnidadeGeradora = utf8_decode($strDescricaoUnidadeGeradora[0]); | ||
365 | + | ||
366 | + $arrMetatags['Unidade Geradora'] = '<a alt="'.$strDescricaoUnidadeGeradora.'" title="'.$strDescricaoUnidadeGeradora.'" class="ancoraSigla">'.$strSiglaUnidadeGeradora.'</a>'; | ||
367 | + | ||
368 | + $strSiglaUsuarioGerador = $registros[$i]->xpath("str[@name='sigla_usuario_gerador']"); | ||
369 | + $strSiglaUsuarioGerador = utf8_decode($strSiglaUsuarioGerador[0]); | ||
370 | + | ||
371 | + $strNomeUsuarioGerador = $registros[$i]->xpath("str[@name='nome_usuario_gerador']"); | ||
372 | + $strNomeUsuarioGerador = utf8_decode($strNomeUsuarioGerador[0]); | ||
373 | + | ||
374 | + //$arrMetatags['Usuário'] = '<a alt="'.$strNomeUsuarioGerador.'" title="'.$strNomeUsuarioGerador.'" class="ancoraSigla">'.$strSiglaUsuarioGerador.'</a>'; | ||
375 | + | ||
376 | + $dtaGeracao = $registros[$i]->xpath("date[@name='dta_geracao']"); | ||
377 | + $dtaGeracao = utf8_decode($dtaGeracao[0]); | ||
378 | + | ||
379 | + $dtaGeracao = preg_replace("/(\d{4})-(\d{2})-(\d{2})(.*)/", "$3/$2/$1", $dtaGeracao); | ||
380 | + | ||
381 | + $arrMetatags['Data'] = $dtaGeracao; | ||
382 | + | ||
383 | + // SNIPPET | ||
384 | + $numId = $registros[$i]->xpath("str[@name='id']"); | ||
385 | + $numId = utf8_decode($numId[0]); | ||
386 | + $temp = $xml->xpath("/response/lst[@name='highlighting']/lst[@name='".$numId."']/arr[@name='content']/str"); | ||
387 | + | ||
388 | + $snippet = ''; | ||
389 | + for($j=0;$j<count($temp);$j++){ | ||
390 | + $snippetTemp = utf8_decode($temp[$j]); | ||
391 | + $snippetTemp = strtoupper(trim(strip_tags($snippetTemp))) == "NULL" ? null : $snippetTemp; | ||
392 | + $snippetTemp = preg_replace("/<br>/i", "<br />", $snippetTemp); | ||
393 | + $snippetTemp = preg_replace("/<.*?>/", "", $snippetTemp); | ||
394 | + $snippet .= $snippetTemp.'<b> ... </b>'; | ||
395 | + } | ||
396 | + | ||
397 | + | ||
398 | + | ||
399 | + // ÁRVORE | ||
400 | + $arvore = $registros[$i]->xpath("str[@name='link_arvore']"); | ||
401 | + $arvore = trim(urldecode($arvore[0])); | ||
402 | + //ALTERAÇÃO PARA PESQUISA DE PROCESSO EXTERNA. | ||
403 | + $idProtocolo = $registros[$i]->xpath("str[@name='id_protocolo']"); | ||
404 | + $idProtocolo = trim(urldecode($idProtocolo[0])); | ||
405 | + | ||
406 | + $objProtocoloRN = new ProtocoloRN(); | ||
407 | + $objProtocoloDTO = new ProtocoloDTO(); | ||
408 | + $objProtocoloDTO->setDblIdProtocolo($idProtocolo); | ||
409 | + $objProtocoloDTO->retDblIdProtocolo(); | ||
410 | + $objProtocoloDTO->retStrStaProtocolo(); | ||
411 | + $objProtocoloDTO->retStrStaNivelAcessoGlobal(); | ||
412 | + $objProtocoloDTO->retStrProtocoloFormatado(); | ||
413 | + $objProtocoloDTO->retNumIdHipoteseLegal(); | ||
414 | + $objProtocoloDTO = $objProtocoloRN->consultarRN0186($objProtocoloDTO); | ||
415 | + $idProcedimento = ''; | ||
416 | + if($objProtocoloDTO->getStrStaProtocolo() != ProtocoloRN::$TP_PROCEDIMENTO){ | ||
417 | + $objDocumentoRN = new DocumentoRN(); | ||
418 | + $objDocumentoDTO = new DocumentoDTO(); | ||
419 | + $objDocumentoDTO->setDblIdDocumento($idProtocolo); | ||
420 | + $objDocumentoDTO->retDblIdDocumento(); | ||
421 | + $objDocumentoDTO->retDblIdProcedimento(); | ||
422 | + $objDocumentoDTO->retNumIdSerie(); | ||
423 | + $objDocumentoDTO = $objDocumentoRN->consultarRN0005($objDocumentoDTO); | ||
424 | + $idProcedimento = $objDocumentoDTO->getDblIdProcedimento(); | ||
425 | + | ||
426 | + | ||
427 | + // INCLUIDO 21/12/2015 Substitui data de geração para data de assinatura de documentos gerados | ||
428 | + if($objProtocoloDTO->getStrStaProtocolo() == ProtocoloRN::$TP_DOCUMENTO_GERADO){ | ||
429 | + | ||
430 | + $objAssinaturaDTO = new AssinaturaDTO(); | ||
431 | + $objAssinaturaDTO->setDblIdDocumento($idProtocolo); | ||
432 | + $objAssinaturaDTO->setDthAberturaAtividade(InfraDTO::$TIPO_ORDENACAO_ASC); | ||
433 | + $objAssinaturaDTO->retDthAberturaAtividade(); | ||
434 | + | ||
435 | + $objAssinaturaRN = new AssinaturaRN(); | ||
436 | + $arrObjAssinaturaDTO = $objAssinaturaRN->listarRN1323($objAssinaturaDTO); | ||
437 | + | ||
438 | + if(is_array($arrObjAssinaturaDTO) && count($arrObjAssinaturaDTO) > 0) { | ||
439 | + | ||
440 | + $objAssinaturaDTO = $arrObjAssinaturaDTO[0]; | ||
441 | + if($objAssinaturaDTO != null && $objAssinaturaDTO->isSetDthAberturaAtividade()){ | ||
442 | + | ||
443 | + $dtaGeracao = substr($objAssinaturaDTO->getDthAberturaAtividade(),0,10); | ||
444 | + | ||
445 | + $arrMetatags['Data'] = $dtaGeracao; | ||
446 | + | ||
447 | + } | ||
448 | + } | ||
449 | + | ||
450 | + | ||
451 | + | ||
452 | + } | ||
453 | + | ||
454 | + if($objProtocoloDTO->getStrStaProtocolo() == ProtocoloRN::$TP_DOCUMENTO_RECEBIDO){ | ||
455 | + | ||
456 | + $objAtributoAndamentoDTO = new AtributoAndamentoDTO(); | ||
457 | + $objAtributoAndamentoDTO->setDblIdProtocoloAtividade($idProcedimento); | ||
458 | + $objAtributoAndamentoDTO->setNumIdTarefaAtividade(TarefaRN::$TI_RECEBIMENTO_DOCUMENTO); | ||
459 | + $objAtributoAndamentoDTO->setStrNome("DOCUMENTO"); | ||
460 | + $objAtributoAndamentoDTO->setStrIdOrigem($idProtocolo); | ||
461 | + | ||
462 | + $objAtributoAndamentoDTO->retDthAberturaAtividade(); | ||
463 | + | ||
464 | + $objAtributoAndamentoRN = new AtributoAndamentoRN(); | ||
465 | + | ||
466 | + $objAtributoAndamentoDTO = $objAtributoAndamentoRN->consultarRN1366($objAtributoAndamentoDTO); | ||
467 | + | ||
468 | + if($objAtributoAndamentoDTO != null && $objAtributoAndamentoDTO->isSetDthAberturaAtividade()){ | ||
469 | + | ||
470 | + $dtaGeracao = substr($objAtributoAndamentoDTO->getDthAberturaAtividade(),0,10); | ||
471 | + | ||
472 | + $arrMetatags['Data'] = $dtaGeracao; | ||
473 | + | ||
474 | + } | ||
475 | + } | ||
476 | + | ||
477 | + }else{ | ||
478 | + $idProcedimento = $objProtocoloDTO->getDblIdProtocolo(); | ||
479 | + } | ||
480 | + | ||
481 | + $parametrosCriptografadosProcesso = Criptografia::criptografa('id_orgao_acesso_externo=0&id_procedimento='.$idProcedimento); | ||
482 | + $urlPesquisaProcesso = 'processo_exibir.php?'.$parametrosCriptografadosProcesso; | ||
483 | + $arvore = $urlPesquisaProcesso; | ||
484 | + | ||
485 | + | ||
486 | + $tituloLinkNumeroProcesso = "<a href=\"" . PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink(SolrUtilExterno::prepararUrl($arvore))) . "\" target=\"_blank\" class=\"protocoloNormal\">"; | ||
487 | + $tituloLinkNumeroProcesso .= $dados["protocolo_processo_formatado"]; | ||
488 | + $tituloLinkNumeroProcesso .= "</a>"; | ||
489 | + | ||
490 | + $tituloProtocolo = $tituloLinkNumeroProcesso; | ||
491 | + | ||
492 | + | ||
493 | + $titulo = $dados["nome_tipo_processo"] . " N° " . $tituloLinkNumeroProcesso; | ||
494 | + | ||
495 | + if (empty($dados["protocolo_documento_formatado"]) == false) { | ||
496 | + $titulo .= " "; | ||
497 | + $parametrosCriptografadosDocumentos = Criptografia::criptografa('id_orgao_acesso_externo=0&id_documento='.$objDocumentoDTO->getDblIdDocumento()); | ||
498 | + $endereco = 'documento_consulta_externa.php?'.$parametrosCriptografadosDocumentos; | ||
499 | + $titulo .= "(<a target=\"_blank\" href=\"" . PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink($endereco)) . "\""; | ||
500 | + $titulo .= " class=\"protocoloNormal\""; | ||
501 | + $titulo .= ">" . $dados["identificacao_protocolo"] . "</a>)"; | ||
502 | + | ||
503 | + $tituloProtocolo = "<a target=\"_blank\" href=\"" . PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink($endereco)) . "\" class=\"protocoloNormal\" >".$dados["protocolo_documento_formatado"]. "</a>"; | ||
504 | + | ||
505 | + } | ||
506 | + | ||
507 | + | ||
508 | + | ||
509 | + | ||
510 | + $tituloCompleto = "<a href=\"" . PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink(SolrUtilExterno::prepararUrl($arvore))) . "\" target=\"_blank\" class=\"arvore\">"; | ||
511 | + $tituloCompleto .= "<img border=\"0\" src=\"solr/img/arvore.png\" alt=\"\" title=\"Visualizar árvore\" width=\"14\" height=\"16\" class=\"arvore\" />"; | ||
512 | + $tituloCompleto .= "</a>"; | ||
513 | + | ||
514 | + $tituloCompleto .= $titulo; | ||
515 | + | ||
516 | + // REMOVE TAGS DO TÍTULO | ||
517 | + $tituloCompleto = preg_replace("/<.*?>/", "", $tituloCompleto); | ||
518 | + | ||
519 | + | ||
520 | + | ||
521 | + | ||
522 | + if($objProtocoloDTO->getStrStaNivelAcessoGlobal() != ProtocoloRN::$NA_PUBLICO && $bolPesquisaProcessoRestrito){ | ||
523 | + | ||
524 | + if(!$bolLinkMetadadosProcessoRestrito || $objProtocoloDTO->getStrStaProtocolo() != ProtocoloRN::$TP_PROCEDIMENTO){ | ||
525 | + $tituloCompleto = $objProtocoloDTO->getStrProtocoloFormatado(); | ||
526 | + $titulo = $objProtocoloDTO->getStrProtocoloFormatado(); | ||
527 | + $tituloProtocolo = $objProtocoloDTO->getStrProtocoloFormatado(); | ||
528 | + //$tituloProtocolo = 'N° SEI (Documento/Processo)'; | ||
529 | + | ||
530 | + $objHipoteseLegalDTO = new HipoteseLegalDTO(); | ||
531 | + $objHipoteseLegalDTO->retTodos(false); | ||
532 | + $objHipoteseLegalDTO->setNumIdHipoteseLegal($objProtocoloDTO->getNumIdHipoteseLegal()); | ||
533 | + | ||
534 | + $objHipoteseLegalRN = new HipoteseLegalRN(); | ||
535 | + $objHipoteseLegalDTO = $objHipoteseLegalRN->consultar($objHipoteseLegalDTO); | ||
536 | + | ||
537 | + if($objHipoteseLegalDTO != null){ | ||
538 | + $snippet = '<b>Hipótese Legal de Restrição de Acesso: '.$objHipoteseLegalDTO->getStrNome().' ('.$objHipoteseLegalDTO->getStrBaseLegal().')</b>'; | ||
539 | + $txtDescricaoProcedimentoAcessoRestrito = trim($txtDescricaoProcedimentoAcessoRestrito); | ||
540 | + if( !empty($txtDescricaoProcedimentoAcessoRestrito)){ | ||
541 | + $snippet .= '<br/>'; | ||
542 | + $snippet .= $txtDescricaoProcedimentoAcessoRestrito; | ||
543 | + } | ||
544 | + }else{ | ||
545 | + if( !empty($txtDescricaoProcedimentoAcessoRestrito)){ | ||
546 | + $snippet = $txtDescricaoProcedimentoAcessoRestrito; | ||
547 | + }else{ | ||
548 | + $snippet = 'Processo de Acesso Restrito'; | ||
549 | + } | ||
550 | + | ||
551 | + } | ||
552 | + | ||
553 | + unset($arrMetatags['Usuário'] ); | ||
554 | + unset($arrMetatags['Unidade Geradora']); | ||
555 | + unset($arrMetatags['Data']); | ||
556 | + } | ||
557 | + | ||
558 | + | ||
559 | + | ||
560 | + | ||
561 | + } | ||
562 | + | ||
563 | + // Protege contra a não idexação no solr quando o processo passa de público para restrito. | ||
564 | + if(($objProtocoloDTO->getStrStaProtocolo() == ProtocoloRN::$TP_PROCEDIMENTO && $objProtocoloDTO->getStrStaNivelAcessoGlobal() != ProtocoloRN::$NA_PUBLICO && !$bolPesquisaProcessoRestrito) || ($objProtocoloDTO->getStrStaProtocolo() == ProtocoloRN::$TP_PROCEDIMENTO && $objProtocoloDTO->getStrStaNivelAcessoGlobal() == ProtocoloRN::$NA_SIGILOSO)){ | ||
565 | + | ||
566 | + $tituloCompleto = 'ACESSO RESTRITO'; | ||
567 | + $titulo = 'ACESSO RESTRITO'; | ||
568 | + $tituloProtocolo = 'ACESSO RESTRITO'; | ||
569 | + unset($arrMetatags['Usuário'] ); | ||
570 | + unset($arrMetatags['Unidade Geradora']); | ||
571 | + unset($arrMetatags['Data']); | ||
572 | + $snippet = 'ACESSO RESTRITO'; | ||
573 | + | ||
574 | + | ||
575 | + } | ||
576 | + | ||
577 | + // Protege contra a não idexação no solr quando o documento passa de público para restrito. | ||
578 | + //if($objProtocoloDTO->getStrStaProtocolo() != ProtocoloRN::$TP_PROCEDIMENTO && $objProtocoloDTO->getStrStaNivelAcessoGlobal() != ProtocoloRN::$NA_PUBLICO && !$bolPesquisaDocumentoProcessoRestrito){ | ||
579 | + if($objProtocoloDTO->getStrStaProtocolo() != ProtocoloRN::$TP_PROCEDIMENTO && $objProtocoloDTO->getStrStaNivelAcessoGlobal() != ProtocoloRN::$NA_PUBLICO){ | ||
580 | + | ||
581 | + $tituloCompleto = 'ACESSO RESTRITO'; | ||
582 | + $titulo = 'ACESSO RESTRITO'; | ||
583 | + $tituloProtocolo = 'ACESSO RESTRITO'; | ||
584 | + unset($arrMetatags['Usuário'] ); | ||
585 | + unset($arrMetatags['Unidade Geradora']); | ||
586 | + unset($arrMetatags['Data']); | ||
587 | + $snippet = 'ACESSO RESTRITO'; | ||
588 | + | ||
589 | + | ||
590 | + } | ||
591 | + | ||
592 | + $html .= "<table border=\"0\" class=\"resultado\">\n"; | ||
593 | + $html .= "<tr class=\"resTituloRegistro\">\n"; | ||
594 | + $html .= "<td class=\"resTituloEsquerda\">"; | ||
595 | + $html .= $tituloCompleto; | ||
596 | + $html .= "</td>\n"; | ||
597 | + $html .= "<td class=\"resTituloDireita\">"; | ||
598 | + $html .= $tituloProtocolo; | ||
599 | + $html .= "</td>\n"; | ||
600 | + $html .= "</tr>\n"; | ||
601 | + | ||
602 | + if (empty($snippet) == false) | ||
603 | + $html .= "<tr>\n | ||
604 | + <td colspan=\"2\" class=\"resSnippet\"> | ||
605 | + " . $snippet . " | ||
606 | + </td>\n | ||
607 | + </tr>\n"; | ||
608 | + | ||
609 | + if (count($arrMetatags)) { | ||
610 | + $html .= "<tr>\n"; | ||
611 | + $html .= "<td colspan=\"2\" class=\"metatag\">\n"; | ||
612 | + $html .= "<table>\n"; | ||
613 | + $html .= "<tbody>\n"; | ||
614 | + $html .= "<tr>\n"; | ||
615 | + | ||
616 | + foreach($arrMetatags as $nomeMetaTag => $valorMetaTag){ | ||
617 | + | ||
618 | + $html .= "<td>"; | ||
619 | + $html .= "<b>" . $nomeMetaTag . ":</b> " . $valorMetaTag; | ||
620 | + $html .= "</td>\n"; | ||
621 | + | ||
622 | + | ||
623 | + } | ||
624 | + | ||
625 | + $html .= "</tr>\n"; | ||
626 | + $html .= "</tbody>\n"; | ||
627 | + $html .= "</table>\n"; | ||
628 | + $html .= "</td>\n"; | ||
629 | + $html .= "</tr>\n"; | ||
630 | + } | ||
631 | + | ||
632 | + $html .= "</table>\n"; | ||
633 | + } | ||
634 | + | ||
635 | + $html .= SolrUtilExterno::criarBarraNavegacao($itens, $inicio, 10, PaginaSEIExterna::getInstance(), SessaoSEIExterna::getInstance(),$md5Captcha); | ||
636 | + } | ||
637 | + | ||
638 | + return $html; | ||
639 | + } | ||
640 | +} | ||
641 | +?> |
1 | +++ a/sei/institucional/pesquisa/ConfiguracaoPesquisa.php | ||
@@ -0,0 +1,68 @@ | @@ -0,0 +1,68 @@ | ||
1 | +<? | ||
2 | +/** | ||
3 | + * CONSELHO ADMINISTRATIVO DE DEFESA ECONÔMICA | ||
4 | + * 2015-05-20 | ||
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 configuração do módulo 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 | +require_once dirname(__FILE__).'/../../SEI.php'; | ||
32 | + | ||
33 | +class ConfiguracaoPesquisa extends InfraConfiguracao { | ||
34 | + | ||
35 | + private static $instance = null; | ||
36 | + | ||
37 | + public static function getInstance(){ | ||
38 | + if(ConfiguracaoPesquisa::$instance == null) { | ||
39 | + ConfiguracaoPesquisa::$instance = new ConfiguracaoPesquisa(); | ||
40 | + } | ||
41 | + | ||
42 | + return ConfiguracaoPesquisa::$instance; | ||
43 | + } | ||
44 | + | ||
45 | + public function getArrConfiguracoes() { | ||
46 | + return array( | ||
47 | + | ||
48 | + 'Pesquisa' => array( | ||
49 | + 'Legado' => false, // Habilita pesquisa de processos em sistema legado (anterior ao SEI) com banco de dados SQL Server 2000 ou 2008. Nativamente os códigos pertinetes a esta parte do módulo estão estruturados para a realidade interna dos Cade, podendo ser adaptados às necessidades da instalação local do órgão. | ||
50 | + 'Captcha' => true, // Habilita captcha na página principal da Pesquisa Pública, para minimizar ações de "robô". | ||
51 | + 'CaptchaPdf' => true, // Habilita captcha na ação "Gerar PDF" na página de processo, para minimizar ações de "robô". | ||
52 | + | ||
53 | + 'DocumentoProcessoPublico' => true, //Habilita a pesquisa diretamente em processos com nível de acesso global "Público", ou seja, que não tenha nenhum documento "Restrito". | ||
54 | + 'ListaDocumentoProcessoPublico' => true, //Habilita o acesso aos Documentos nos processos com nível de acesso global "Público", ou seja, que não tenha nenhum documento "Restrito". | ||
55 | + 'ListaAndamentoProcessoPublico' => true, //Habilita a exibição dos Andamentos nos processos com nível de acesso global "Público", ou seja, que não tenha nenhum documento "Restrito". | ||
56 | + | ||
57 | + 'ProcessoRestrito' => true, //Habilita a pesquisa diretamente em processos com nível de acesso global "Restrito", ou seja, que contenha qualquer documento "Restrito". O comportamento desta opção depende das próximas três opções abaixo. | ||
58 | + 'MetaDadosProcessoRestrito' => true, //Habilita o acesso aos metadados do Processo com nível de acesso global "Restrito", ou seja, que contenha qualquer documento "Restrito". | ||
59 | + 'ListaDocumentoProcessoRestrito' => true, //Habilita o acesso aos Documentos nos processos com nível de acesso global "Restrito", ou seja, que contenha qualquer documento "Restrito". | ||
60 | + 'ListaAndamentoProcessoRestrito' => true, //Habilita a exibição dos Andamentos nos processos com nível de acesso global "Restrito", ou seja, que contenha qualquer documento "Restrito". | ||
61 | + | ||
62 | + 'AutoCompletarInteressado' => true, //Habilita a função auto completar no campo "Interessado / Remetente" na página principal da Pesquisa Pública. | ||
63 | + 'DescricaoProcedimentoAcessoRestrito' => '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.', //Descrição de justificativa de restrição de acesso e orientações para meios alternativos de solicitação de acesso. | ||
64 | + ), | ||
65 | + ); | ||
66 | + } | ||
67 | +} | ||
68 | +?> | ||
0 | \ No newline at end of file | 69 | \ No newline at end of file |
1 | +++ a/sei/institucional/pesquisa/ConverteURI.php | ||
@@ -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 | +?> |
1 | +++ a/sei/institucional/pesquisa/Criptografia.php | ||
@@ -0,0 +1,133 @@ | @@ -0,0 +1,133 @@ | ||
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::$KEY), serialize($texto), MCRYPT_MODE_CBC, md5(md5(Criptografia::$KEY)))), '+/=', '-_,'); | ||
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::$KEY), base64_decode(strtr($texto, '-_,', '+/=')), MCRYPT_MODE_CBC, md5(md5(Criptografia::$KEY))), "\0")); | ||
63 | + } catch (Exception $e) { | ||
64 | + | ||
65 | + throw new InfraException('Erro validando link externo.',$e); | ||
66 | + } | ||
67 | + } | ||
68 | + | ||
69 | + //Esta criptografia é usada no site do cade; | ||
70 | + //Alterar metodo de criptografia por uma criptografia php. | ||
71 | + public static function criptografaSiteCade($texto){ | ||
72 | + | ||
73 | + $caminho = dirname(__FILE__).'/criptografia/mascaraArgumentos.jar'; | ||
74 | + $instrucao = 'java -jar '.$caminho.' \'criptografa\' \''.$texto.'\' \''.Criptografia::$KEY.'\' '; | ||
75 | + | ||
76 | + exec( $instrucao, $saida, $retorno); | ||
77 | + if($retorno !=0){ | ||
78 | + throw new InfraException('Erro validando link externo.',$e); | ||
79 | + }else{ | ||
80 | + return $saida; | ||
81 | + } | ||
82 | + | ||
83 | + } | ||
84 | + //Esta criptografia é usada no site do cade; | ||
85 | + //Alterar metodo de criptografia por uma criptografia php. | ||
86 | + public static function descriptografaSiteCade($texto){ | ||
87 | + | ||
88 | + $caminho = dirname(__FILE__).'/criptografia/mascaraArgumentos.jar'; | ||
89 | + $instrucao = 'java -jar '.$caminho.' \'descriptografa\' \''.$texto.'\' \''.Criptografia::$KEY.'\' '; | ||
90 | + | ||
91 | + exec( $instrucao, $saida, $retorno); | ||
92 | + if($retorno !=0){ | ||
93 | + throw new InfraException('Erro validando link externo.',$e); | ||
94 | + }else{ | ||
95 | + return $saida; | ||
96 | + } | ||
97 | + | ||
98 | + } | ||
99 | + | ||
100 | + //Esta criptografia é usada no site do cade; | ||
101 | + //Alterar metodo de criptografia por uma criptografia php. | ||
102 | + public static function descriptografaArgumentos($parametro){ | ||
103 | + | ||
104 | + $parametrosCriptografados = $_SERVER['QUERY_STRING']; | ||
105 | + $parametrosDescriptografados = Criptografia::descriptografa($parametrosCriptografados); | ||
106 | + $arrParametros = explode("&", $parametrosDescriptografados[0]); | ||
107 | + $bolRecuperParametro = false; | ||
108 | + $valorParametro = ''; | ||
109 | + foreach ($arrParametros as $arrParametro){ | ||
110 | + $parametroRetorno = explode("=", $arrParametro); | ||
111 | + if($parametroRetorno[0] == $parametro){ | ||
112 | + $bolRecuperParametro = true; | ||
113 | + $valorParametro = $parametroRetorno[1]; | ||
114 | + break; | ||
115 | + }else{ | ||
116 | + $bolRecuperParametro = false; | ||
117 | + } | ||
118 | + } | ||
119 | + | ||
120 | + if($bolRecuperParametro){ | ||
121 | + return $valorParametro; | ||
122 | + }else{ | ||
123 | + throw new InfraException('Erro recuperando parâmetro.'); | ||
124 | + } | ||
125 | + | ||
126 | + | ||
127 | + } | ||
128 | + | ||
129 | + } | ||
130 | + | ||
131 | + | ||
132 | + | ||
133 | +?> | ||
0 | \ No newline at end of file | 134 | \ No newline at end of file |
1 | +++ a/sei/institucional/pesquisa/Leia-me.txt | ||
@@ -0,0 +1,34 @@ | @@ -0,0 +1,34 @@ | ||
1 | +Roteiro de instalação. | ||
2 | + | ||
3 | +1 - Caso ainda não exista, criar a pasta "institucional" na raiz do SEI (é mandatório a manutenção deste nome de pasta conforme o padrão do SEI para módulos): | ||
4 | + | ||
5 | + /sei/institucional | ||
6 | + | ||
7 | +2- Copiar a pasta de código "pesquisa" para a pasta sei/institucional: | ||
8 | + | ||
9 | + /sei/institucional/pesquisa | ||
10 | + | ||
11 | +3- Instalar o modulo php-mycrypt nos servidores de aplicação (este módulo é necessário para criação dos hash nos links de acesso à processos e documentos): | ||
12 | + | ||
13 | + # wget http://ftp.riken.jp/Linux/fedora/epel/RPM-GPG-KEY-EPEL-6 | ||
14 | + # wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm | ||
15 | + # rpm -ivh epel-release-6-8.noarch.rpm | ||
16 | + # yum install php-mcrypt | ||
17 | + | ||
18 | +4- Modificar o arquivo ConfiguracaoSEI.php para reconhecer o módulo: | ||
19 | + | ||
20 | + Ex. 'SEI' => array( | ||
21 | + 'URL' => 'http://{nome_servidor}/sei/', | ||
22 | + 'Producao' => true, | ||
23 | + 'RepositorioArquivos' => '/sei-nfs/dados', | ||
24 | + 'Modulos' => array( | ||
25 | + 'Pesquisa' =>dirname(__FILE__).'/institucional/pesquisa', | ||
26 | + ), | ||
27 | + | ||
28 | +5- O link para acesso à página de Pesquisa Pública é o seguinte: | ||
29 | + | ||
30 | + http://{nome_servidor}/sei/institucional/pesquisa/processo_pesquisar.php?acao_externa=protocolo_pesquisar&acao_origem_externa=protocolo_pesquisar&id_orgao_acesso_externo=0 | ||
31 | + | ||
32 | +6- Diversas parametrizações de comportamento do módulo podem ser alteradas no arquivo sei/institucional/pesquia/ConfiguracaoPesquisa.php. | ||
33 | + | ||
34 | +7- Orientamos que este arquivo não seja mantido na pasta "sei/institucional/pesquisa" no servidor. | ||
0 | \ No newline at end of file | 35 | \ No newline at end of file |
1 | +++ a/sei/institucional/pesquisa/PesquisaCADE.php | ||
@@ -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 | +?> |
1 | +++ a/sei/institucional/pesquisa/PesquisaControlador.php | ||
@@ -0,0 +1,17 @@ | @@ -0,0 +1,17 @@ | ||
1 | +<? | ||
2 | + | ||
3 | + class PesquisaControlador implements ISeiControlador { | ||
4 | + | ||
5 | + public function processar($strAcao){ | ||
6 | + | ||
7 | + switch ($strAcao){ | ||
8 | + | ||
9 | + | ||
10 | + | ||
11 | + } | ||
12 | + | ||
13 | + return false; | ||
14 | + } | ||
15 | + | ||
16 | + } | ||
17 | +?> | ||
0 | \ No newline at end of file | 18 | \ No newline at end of file |
1 | +++ a/sei/institucional/pesquisa/PesquisaControladorAjax.php | ||
@@ -0,0 +1,13 @@ | @@ -0,0 +1,13 @@ | ||
1 | +<? | ||
2 | + class PesquisaControladorAjax implements ISeiControladorAjax { | ||
3 | + | ||
4 | + public function processar($strAcaoAjax){ | ||
5 | + | ||
6 | + $xml = null; | ||
7 | + | ||
8 | + return $xml; | ||
9 | + } | ||
10 | + | ||
11 | +} | ||
12 | + | ||
13 | +?> | ||
0 | \ No newline at end of file | 14 | \ No newline at end of file |
sei/institucional/pesquisa/PesquisaControladorWebServices.php
0 → 100644
1 | +++ a/sei/institucional/pesquisa/PesquisaControladorWebServices.php | ||
@@ -0,0 +1,13 @@ | @@ -0,0 +1,13 @@ | ||
1 | +<? | ||
2 | + class PesquisaControladorWebServices implements ISeiControladorWebServices { | ||
3 | + | ||
4 | + public function processar($strServico){ | ||
5 | + | ||
6 | + $strArq = null; | ||
7 | + | ||
8 | + | ||
9 | + return $strArq; | ||
10 | + } | ||
11 | + | ||
12 | +} | ||
13 | +?> | ||
0 | \ No newline at end of file | 14 | \ No newline at end of file |
1 | +++ a/sei/institucional/pesquisa/PesquisaIntegracao.php | ||
@@ -0,0 +1,44 @@ | @@ -0,0 +1,44 @@ | ||
1 | +<? | ||
2 | + class PesquisaIntegracao implements ISeiIntegracao { | ||
3 | + | ||
4 | + public function __construct(){ | ||
5 | + } | ||
6 | + | ||
7 | + public function montarBotaoProcedimento(SeiIntegracaoDTO $objSeiIntegracaoDTO){ | ||
8 | + | ||
9 | + } | ||
10 | + | ||
11 | + public function montarIconeProcedimento(SeiIntegracaoDTO $objSeiIntegracaoDTO){ | ||
12 | + return array(); | ||
13 | + } | ||
14 | + | ||
15 | + public function montarBotaoDocumento(SeiIntegracaoDTO $objSeiIntegracaoDTO){ | ||
16 | + return array(); | ||
17 | + } | ||
18 | + | ||
19 | + public function montarIconeDocumento(SeiIntegracaoDTO $objSeiIntegracaoDTO){ | ||
20 | + return array(); | ||
21 | + } | ||
22 | + | ||
23 | + public function excluirProcedimento(ProcedimentoDTO $objProcedimentoDTO){ | ||
24 | + } | ||
25 | + | ||
26 | + public function atualizarConteudoDocumento(DocumentoDTO $objDocumentoDTO){ | ||
27 | + } | ||
28 | + | ||
29 | + public function excluirDocumento(DocumentoDTO $objDocumentoDTO){ | ||
30 | + } | ||
31 | + | ||
32 | + public function montarBotaoControleProcessos(){} | ||
33 | + | ||
34 | + public function montarIconeControleProcessos($arrObjProcedimentoDTO){} | ||
35 | + | ||
36 | + public function montarIconeAcompanhamentoEspecial($arrObjProcedimentoDTO){ | ||
37 | + return null; | ||
38 | + } | ||
39 | + | ||
40 | + | ||
41 | + | ||
42 | + | ||
43 | + } | ||
44 | +?> |
1 | +++ a/sei/institucional/pesquisa/PesquisaSISCADE.php | ||
@@ -0,0 +1,83 @@ | @@ -0,0 +1,83 @@ | ||
1 | +<? | ||
2 | + | ||
3 | +class PesquisaSISCADE{ | ||
4 | + | ||
5 | + | ||
6 | + public static function executar($strProtocoloPesquisa,$strNomeParticipante,$md5Captcha = null,$inicio = 0,$paginaAtual = 0,$maxRetorno = 10){ | ||
7 | + | ||
8 | + $objProcedimentoSiscadeDTO = new ProcedimentoSiscadeDTO(); | ||
9 | + $objProcedimentoSiscadeDTO->setStrNrProcedimento(str_replace(' ', '', $strProtocoloPesquisa)); | ||
10 | + $objProcedimentoSiscadeDTO->setNumIdConfidencialidade(ProcedimentoSiscadeRN::$NA_PUBLICO); | ||
11 | + $objProcedimentoSiscadeDTO->setStrNomeParte(InfraString::excluirAcentos($strNomeParticipante)); | ||
12 | + $objProcedimentoSiscadeDTO->retTodos(true); | ||
13 | + //PaginaSEIExterna::getInstance()->prepararOrdenacao($objProcedimentoSiscadeDTO,'NrProcedimento',InfraDTO::$TIPO_ORDENACAO_ASC); | ||
14 | + | ||
15 | + | ||
16 | + $objProcedimentoSiscadeRN = new ProcedimentoSiscadeRN(); | ||
17 | + //conta registro | ||
18 | + //$totalRegistro = $objProcedimentoSiscadeRN->contarComFiltro($objProcedimentoSiscadeDTO); | ||
19 | + | ||
20 | + $totalRegistro = $objProcedimentoSiscadeRN->contarProcedimentoParte($objProcedimentoSiscadeDTO); | ||
21 | + | ||
22 | + | ||
23 | + | ||
24 | + //Pesquisa paginada | ||
25 | + | ||
26 | + | ||
27 | + $objProcedimentoSiscadeDTO->setNumPaginaAtual($paginaAtual); | ||
28 | + $objProcedimentoSiscadeDTO->setNumMaxRegistrosRetorno($maxRetorno); | ||
29 | + //PaginaSEIExterna::getInstance()->processarPaginacao($objProcedimentoSiscadeDTO); | ||
30 | + //$arrObjProcedimentoSiscadeDTO = $objProcedimentoSiscadeRN->listarTodosComFiltro($objProcedimentoSiscadeDTO); | ||
31 | + $arrObjProcedimentoSiscadeDTO = $objProcedimentoSiscadeRN->listarProcedimentoParte($objProcedimentoSiscadeDTO); | ||
32 | + | ||
33 | + | ||
34 | + if ($totalRegistro != 0){ | ||
35 | + | ||
36 | + //$bolHttps = ConfiguracaoSEI::getInstance()->getValor('SessaoSEIExterna','https'); | ||
37 | + | ||
38 | + $html = PesquisaUtil::criarBarraEstatisticas($totalRegistro,$inicio,($inicio+10)); | ||
39 | + $html .= '<a name="Pesquisa_Siscade"></a>'; | ||
40 | + $html .= '<p style="text-align:center; font-size: 1.6em;"> Pesquisa Processual Siscade </p>'; | ||
41 | + $html .= '<table id="infraTableSiscade" width="99%" class="resultado">'."\n"; | ||
42 | + $html.= '<th>Resultado de pesquisa processual Siscade</th>'; | ||
43 | + | ||
44 | + foreach ($arrObjProcedimentoSiscadeDTO as $objProtocoloDTO){ | ||
45 | + $html .= '<tr class="resTituloRegistro">'; | ||
46 | + $html .= '<td class="metatag" colspan="2">'."\n"; | ||
47 | + $strLinkArvoreCADE = "http://200.198.193.169/SiCADEExternoPesquisaProcessosPublicos.html"; | ||
48 | + | ||
49 | + // if ($bolHttps){ | ||
50 | + // $strLinkArvoreCADE = str_replace('http://','https://',$strLinkArvoreCADE); | ||
51 | + // } | ||
52 | + | ||
53 | + $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> '; | ||
54 | + //Tipo do Procedimento | ||
55 | + $html .= '<a href="'.$strLinkArvoreCADE.'" target="_blank" style="font-size: 1em;" onclick="return confirm(\'Você será redirecionado para o Siscade. Digite o N° '.$objProtocoloDTO->getStrNrProcedimento().' para realizar a pesquisa \')" >' . $objProtocoloDTO->getStrNmEspecie() .': Nº '. $objProtocoloDTO->getStrNrProcedimento() . '</a>'; | ||
56 | + $html .= '</td>'; | ||
57 | + $html .= '<td align="right">'.$objProtocoloDTO->getStrNrProcedimento().'</td>'; | ||
58 | + $html .= '</tr>'."\n"; | ||
59 | + $html .= '<tr class="infraTrClara">'; | ||
60 | + $html .= '<td colspan="2" class="metatag" style="padding: 0.8em 0.5em;">'; | ||
61 | + //$html .= utf8_decode(iconv('CP850', 'UTF-8', $objProtocoloDTO->getStrTxResumo())); | ||
62 | + $html .= $objProtocoloDTO->getStrTxResumo(); | ||
63 | + $html .= '<td/>'; | ||
64 | + $html .= '<tr/>'; | ||
65 | + | ||
66 | + | ||
67 | + } | ||
68 | + | ||
69 | + $html .= '</table>'; | ||
70 | + $html .= PesquisaUtil::criarBarraNavegacao($totalRegistro, $inicio, 10, PaginaSEIExterna::getInstance(), SessaoSEIExterna::getInstance(),'siscade',$md5Captcha); | ||
71 | + | ||
72 | + return $html; | ||
73 | + } | ||
74 | + | ||
75 | + | ||
76 | + } | ||
77 | + | ||
78 | + | ||
79 | + | ||
80 | +} | ||
81 | + | ||
82 | + | ||
83 | +?> |
1 | +++ a/sei/institucional/pesquisa/PesquisaUtil.php | ||
@@ -0,0 +1,157 @@ | @@ -0,0 +1,157 @@ | ||
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 | + $objContatoDTO->setStrSinContexto('S'); | ||
107 | + | ||
108 | + $objContatoDTO->setNumMaxRegistrosRetorno(50); | ||
109 | + | ||
110 | + $objContatoDTO->setOrdStrNome(InfraDTO::$TIPO_ORDENACAO_ASC); | ||
111 | + | ||
112 | + $objContatoRN = new ContatoRN(); | ||
113 | + $arrObjContatoDTO = $objContatoRN->pesquisarRN0471($objContatoDTO); | ||
114 | + | ||
115 | + $ret = PesquisaUtil::preparaIdParticipantes($arrObjContatoDTO); | ||
116 | + | ||
117 | + return $ret; | ||
118 | + | ||
119 | + | ||
120 | + | ||
121 | + } | ||
122 | + | ||
123 | + private static function preparaIdParticipantes($arrObjContatoDTO){ | ||
124 | + $strIdParticipante = ''; | ||
125 | + if(!empty($arrObjContatoDTO) && count($arrObjContatoDTO) == 1){ | ||
126 | + $strIdParticipante = $strIdParticipante.'id_participante:*'.$arrObjContatoDTO[0]->getNumIdContato().'* AND '; | ||
127 | + } | ||
128 | + else if (!empty($arrObjContatoDTO) && count($arrObjContatoDTO) > 1){ | ||
129 | + $count = 0; | ||
130 | + $strIdParticipante = 'id_participante:('; | ||
131 | + for($i=0;$i < count($arrObjContatoDTO); $i++){ | ||
132 | + $count = $count + 1; | ||
133 | + $strIdParticipante = $strIdParticipante.'*'.$arrObjContatoDTO[$i]->getNumIdContato().'*'; | ||
134 | + if($count < count($arrObjContatoDTO)){ | ||
135 | + $strIdParticipante = $strIdParticipante.' OR '; | ||
136 | + } | ||
137 | + | ||
138 | + if($count == count($arrObjContatoDTO)){ | ||
139 | + $strIdParticipante = $strIdParticipante.') AND '; | ||
140 | + } | ||
141 | + } | ||
142 | + | ||
143 | +// foreach ($arrObjContatoDTO as $objContatoDTO){ | ||
144 | +// $strIdParticipante = $strIdParticipante.'*'.$objContatoDTO->getNumIdContato().'*'; | ||
145 | +// if(end(array_keys($arrObjContatoDTO->NumIdContato())) == $objContatoDTO->NumIdContato()){ | ||
146 | +// $strIdParticipante = $strIdParticipante.' OR '; | ||
147 | +// } | ||
148 | +// } | ||
149 | + } | ||
150 | + | ||
151 | + return $strIdParticipante; | ||
152 | + | ||
153 | + } | ||
154 | + | ||
155 | +} | ||
156 | + | ||
157 | +?> |
1 | +++ a/sei/institucional/pesquisa/SolrUtilExterno.php | ||
@@ -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 |
1 | +++ a/sei/institucional/pesquisa/ajuda_exibir_externo.php | ||
@@ -0,0 +1,56 @@ | @@ -0,0 +1,56 @@ | ||
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 | + // SessaoSEI::getInstance()->validarPermissao($_GET['acao']); | ||
24 | + | ||
25 | + $strNomeArquivo = ''; | ||
26 | + | ||
27 | + switch($_GET['acao_externa']){ | ||
28 | + | ||
29 | + case 'pesquisa_solr_ajuda_externa': | ||
30 | + $strConteudo = file_get_contents('../../ajuda/ajuda_solr.html'); | ||
31 | + break; | ||
32 | + | ||
33 | + case 'pesquisa_fts_ajuda_externa': | ||
34 | + $strConteudo = file_get_contents('../../ajuda/ajuda_fts.html'); | ||
35 | + break; | ||
36 | + | ||
37 | + case 'assinatura_digital_ajuda_externa': | ||
38 | + $strConteudo = file_get_contents('../../ajuda/assinatura_digital_ajuda.html'); | ||
39 | + $strConteudo = str_replace('[servidor]', ConfiguracaoSEI::getInstance()->getValor('SEI','URL'), $strConteudo); | ||
40 | + break; | ||
41 | + | ||
42 | + default: | ||
43 | + throw new InfraException("Ação '".$_GET['acao']."' não reconhecida."); | ||
44 | + } | ||
45 | + | ||
46 | + header('Content-Type: text/html; charset=iso-8859-1'); | ||
47 | + header('Vary: Accept'); | ||
48 | + header('Cache-Control: no-cache, must-revalidate'); | ||
49 | + header('Pragma: no-cache'); | ||
50 | + | ||
51 | + echo $strConteudo; | ||
52 | + | ||
53 | +}catch(Exception $e){ | ||
54 | + die('Erro realizando download do anexo:'.$e->__toString()); | ||
55 | +} | ||
56 | +?> | ||
0 | \ No newline at end of file | 57 | \ No newline at end of file |
1 | +++ a/sei/institucional/pesquisa/bd/ProcedimentoSiscadeBD.php | ||
@@ -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 | + |
1 | +++ a/sei/institucional/pesquisa/bd/ProcessoBD.php | ||
@@ -0,0 +1,190 @@ | @@ -0,0 +1,190 @@ | ||
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 | + | ||
34 | + | ||
35 | +require_once dirname(__FILE__).'/../../../SEI.php'; | ||
36 | + | ||
37 | +class ProcessoBD extends InfraBD { | ||
38 | + | ||
39 | + private $sqlRepresentada = 'select distinct(pro.pro_codigo), pro.pro_numero, CAST(pro.pro_sumula AS varchar(1000)) as pro_sumula, tip.tippro_nome | ||
40 | + from processos pro inner join processoXrepresentada representada | ||
41 | + on pro.pro_codigo = representada.pro_codigo | ||
42 | + inner join pessoas pes | ||
43 | + on representada.pes_codigo = pes.pes_codigo | ||
44 | + inner join tipos_processos tip | ||
45 | + on tip.tippro_codigo = pro.tippro_codigo '; | ||
46 | + | ||
47 | + private $sqlRepresentante = 'select distinct(pro.pro_codigo), pro.pro_numero, CAST(pro.pro_sumula AS varchar(1000)) as pro_sumula, tip.tippro_nome | ||
48 | + from processos pro inner join processoXrepresentante representante | ||
49 | + on pro.pro_codigo = representante.pro_codigo | ||
50 | + inner join pessoas pes | ||
51 | + on representante.pes_codigo = pes.pes_codigo | ||
52 | + inner join tipos_processos tip | ||
53 | + on tip.tippro_codigo = pro.tippro_codigo '; | ||
54 | + | ||
55 | + private $sqlRequerente = 'select distinct(pro.pro_codigo), pro.pro_numero, CAST(pro.pro_sumula AS varchar(1000)) as pro_sumula , tip.tippro_nome | ||
56 | + from processos pro inner join processoXrequerente requerente | ||
57 | + on pro.pro_codigo = requerente.pro_codigo | ||
58 | + inner join pessoas pes | ||
59 | + on requerente.pes_codigo = pes.pes_codigo | ||
60 | + inner join tipos_processos tip | ||
61 | + on tip.tippro_codigo = pro.tippro_codigo '; | ||
62 | + | ||
63 | + private $operadoUnion = ' union '; | ||
64 | + | ||
65 | + private $operadorWhere = ' where '; | ||
66 | + | ||
67 | + | ||
68 | + | ||
69 | + public function __construct(InfraIBanco $objInfraIBanco){ | ||
70 | + parent::__construct($objInfraIBanco); | ||
71 | + } | ||
72 | + | ||
73 | + | ||
74 | + public function contarPronumeroParte(ProcessoDTO $objProcessoDTO){ | ||
75 | + | ||
76 | + try { | ||
77 | + | ||
78 | + $where = $this->operadorWhere; | ||
79 | + | ||
80 | + | ||
81 | + if (!InfraString::isBolVazia($objProcessoDTO->getStrProNumero())){ | ||
82 | + $proNumero = (string)addslashes('%'.$objProcessoDTO->getStrProNumero().'%'); | ||
83 | + $where .= "pro.pro_numero like '{$proNumero}'"; | ||
84 | + | ||
85 | + } | ||
86 | + | ||
87 | + | ||
88 | + if(!InfraString::isBolVazia($objProcessoDTO->getStrProNumero()) && !InfraString::isBolVazia($objProcessoDTO->getNomeParte())){ | ||
89 | + $where .= ' and '; | ||
90 | + } | ||
91 | + | ||
92 | + if(!InfraString::isBolVazia($objProcessoDTO->getNomeParte())){ | ||
93 | + $nomeParte = (string)addslashes('%'.$objProcessoDTO->getNomeParte().'%'); | ||
94 | + $where .= "pes.pes_nome like '{$nomeParte}'"; | ||
95 | + } | ||
96 | + | ||
97 | + | ||
98 | + $sql = 'select count(*) as total from ( '. | ||
99 | + $this->sqlRepresentada . $where . $this->operadoUnion . | ||
100 | + $this->sqlRepresentante . $where . $this->operadoUnion . | ||
101 | + $this->sqlRequerente . $where . ' ) as pro_partes '; | ||
102 | + | ||
103 | + | ||
104 | + $rs = $this->getObjInfraIBanco()->consultarSql($sql); | ||
105 | + | ||
106 | + | ||
107 | + | ||
108 | + return $rs[0]['total']; | ||
109 | + | ||
110 | + | ||
111 | + | ||
112 | + | ||
113 | + } catch (Exception $e) { | ||
114 | + throw new InfraException('Error contando processos DBCade',$e); | ||
115 | + } | ||
116 | + } | ||
117 | + | ||
118 | + | ||
119 | + public function listarPaginadoPronumeroParte(ProcessoDTO $objProcessoDTO){ | ||
120 | + | ||
121 | + try { | ||
122 | + | ||
123 | + | ||
124 | + | ||
125 | + $where = $this->operadorWhere; | ||
126 | + | ||
127 | + | ||
128 | + if (!InfraString::isBolVazia($objProcessoDTO->getStrProNumero())){ | ||
129 | + $proNumero = (string)addslashes('%'.$objProcessoDTO->getStrProNumero().'%'); | ||
130 | + $where .= "pro.pro_numero like '{$proNumero}'"; | ||
131 | + | ||
132 | + } | ||
133 | + | ||
134 | + | ||
135 | + if(!InfraString::isBolVazia($objProcessoDTO->getStrProNumero()) && !InfraString::isBolVazia($objProcessoDTO->getNomeParte())){ | ||
136 | + $where .= ' and '; | ||
137 | + } | ||
138 | + | ||
139 | + if(!InfraString::isBolVazia($objProcessoDTO->getNomeParte())){ | ||
140 | + $nomeParte = (string)addslashes('%'.$objProcessoDTO->getNomeParte().'%'); | ||
141 | + $where .= "pes.pes_nome like '{$nomeParte}'"; | ||
142 | + } | ||
143 | + | ||
144 | + $inicioPaginacao = ($objProcessoDTO->getNumPaginaAtual() * $objProcessoDTO->getNumMaxRegistrosRetorno() ) + 1; | ||
145 | + $numRegistro = ($objProcessoDTO->getNumMaxRegistrosRetorno() * $objProcessoDTO->getNumPaginaAtual()) + $objProcessoDTO->getNumMaxRegistrosRetorno(); | ||
146 | + $sql = 'select identity(int,1,1) as InfraRowNumber, * INTO #InfraTabela FROM ( '. | ||
147 | + $this->sqlRepresentada . $where . $this->operadoUnion . | ||
148 | + $this->sqlRepresentante . $where . $this->operadoUnion . | ||
149 | + $this->sqlRequerente . $where . ' ) ' . | ||
150 | + 'as InfraTabela ORDER BY pro_numero ASC select *, | ||
151 | + (select count(*) from #InfraTabela ) as InfraRowCount | ||
152 | + from #InfraTabela where InfraRowNumber BETWEEN '. $inicioPaginacao . ' AND '. $numRegistro .' ORDER BY InfraRowNumber | ||
153 | + drop table #InfraTabela'; | ||
154 | + | ||
155 | + | ||
156 | + | ||
157 | + | ||
158 | + $rs = $this->getObjInfraIBanco()->consultarSql($sql); | ||
159 | + | ||
160 | + $arrObjProcessoDTO = array(); | ||
161 | + | ||
162 | + for($i = 0; $i < count($rs); $i++){ | ||
163 | + $objProcessoDTO = new ProcessoDTO(); | ||
164 | + $objProcessoDTO->setStrProNumero($rs[$i]['pro_numero']); | ||
165 | + $objProcessoDTO->setStrProSumula($rs[$i]['pro_sumula']); | ||
166 | + $objProcessoDTO->setStrTipproNome($rs[$i]['tippro_nome']); | ||
167 | + $objProcessoDTO->setNumProCodigo($rs[$i]['pro_codigo']); | ||
168 | + $arrObjProcessoDTO[] = $objProcessoDTO; | ||
169 | + } | ||
170 | + | ||
171 | + | ||
172 | + return $arrObjProcessoDTO; | ||
173 | + | ||
174 | + | ||
175 | + | ||
176 | + | ||
177 | + | ||
178 | + | ||
179 | + | ||
180 | + | ||
181 | + } catch (Exception $e) { | ||
182 | + throw new InfraException('Error listando processos DBCade',$e); | ||
183 | + } | ||
184 | + } | ||
185 | + | ||
186 | + | ||
187 | +} | ||
188 | + | ||
189 | + | ||
190 | +?> | ||
0 | \ No newline at end of file | 191 | \ No newline at end of file |
1 | +++ a/sei/institucional/pesquisa/controlador_ajax_externo.php | ||
@@ -0,0 +1,85 @@ | @@ -0,0 +1,85 @@ | ||
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 | + | ||
43 | + switch($_GET['acao_ajax_externo']){ | ||
44 | + | ||
45 | + case 'contato_auto_completar_contexto_pesquisa': | ||
46 | + | ||
47 | + //alterado para atender anatel exibir apenas nome contato | ||
48 | + $objContatoDTO = new ContatoDTO(); | ||
49 | + $objContatoDTO->retNumIdContato(); | ||
50 | + $objContatoDTO->retStrSigla(); | ||
51 | + $objContatoDTO->retStrNome(); | ||
52 | + | ||
53 | + $objContatoDTO->setStrPalavrasPesquisa($_POST['palavras_pesquisa']); | ||
54 | + | ||
55 | + if ($numIdGrupoContato!=''){ | ||
56 | + $objContatoDTO->setNumIdGrupoContato($_POST['id_grupo_contato']); | ||
57 | + } | ||
58 | + | ||
59 | + $objContatoDTO->setStrSinContexto('S'); | ||
60 | + $objContatoDTO->setNumMaxRegistrosRetorno(50); | ||
61 | + $objContatoDTO->setOrdStrNome(InfraDTO::$TIPO_ORDENACAO_ASC); | ||
62 | + | ||
63 | + $objContatoRN = new ContatoRN(); | ||
64 | + $arrObjContatoDTO = $objContatoRN->pesquisarRN0471($objContatoDTO); | ||
65 | + | ||
66 | +// $arrObjContatoDTO = ContatoINT::autoCompletarContextoPesquisa($_POST['palavras_pesquisa'],$_POST['id_grupo_contato']); | ||
67 | + $xml = InfraAjax::gerarXMLItensArrInfraDTO($arrObjContatoDTO,'IdContato', 'Nome'); | ||
68 | + break; | ||
69 | + case 'unidade_auto_completar_todas': | ||
70 | + $arrObjUnidadeDTO = UnidadeINT::autoCompletarUnidades($_POST['palavras_pesquisa'],true,$_POST['id_orgao']); | ||
71 | + $xml = InfraAjax::gerarXMLItensArrInfraDTO($arrObjUnidadeDTO,'IdUnidade', 'Sigla'); | ||
72 | + break; | ||
73 | + | ||
74 | + default: | ||
75 | + throw new InfraException("Ação '".$_GET['acao_ajax_externo']."' não reconhecida pelo controlador AJAX externo."); | ||
76 | + } | ||
77 | + | ||
78 | + | ||
79 | + InfraAjax::enviarXML($xml); | ||
80 | + | ||
81 | +}catch(Exception $e){ | ||
82 | + //LogSEI::getInstance()->gravar('ERRO AJAX: '.$e->__toString()); | ||
83 | + InfraAjax::processarExcecao($e); | ||
84 | +} | ||
85 | +?> | ||
0 | \ No newline at end of file | 86 | \ No newline at end of file |
1 | +++ a/sei/institucional/pesquisa/css/infra-esquema-local.css | ||
@@ -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 | +} |
sei/institucional/pesquisa/documento_consulta_externa.php
0 → 100644
1 | +++ a/sei/institucional/pesquisa/documento_consulta_externa.php | ||
@@ -0,0 +1,263 @@ | @@ -0,0 +1,263 @@ | ||
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 | + | ||
17 | + session_start(); | ||
18 | + | ||
19 | + ////////////////////////////////////////////////////////////////////////////// | ||
20 | + //InfraDebug::getInstance()->setBolLigado(false); | ||
21 | + //InfraDebug::getInstance()->setBolDebugInfra(false); | ||
22 | + //InfraDebug::getInstance()->limpar(); | ||
23 | + ////////////////////////////////////////////////////////////////////////////// | ||
24 | + ConverteURI::converterURI(); | ||
25 | + if (isset($_GET['id_acesso_externo'])){ | ||
26 | + SessaoSEIExterna::getInstance($_GET['id_acesso_externo'])->validarLink(); | ||
27 | + }else{ | ||
28 | + SessaoSEIExterna::getInstance()->validarLink(); | ||
29 | + } | ||
30 | + | ||
31 | + | ||
32 | + $bolListaDocumentoProcessoRestrito = $bolListaDocumentoProcessoRestrito = ConfiguracaoPesquisa::getInstance()->getValor('Pesquisa','ListaDocumentoProcessoRestrito'); | ||
33 | + | ||
34 | + $objDocumentoDTO = new DocumentoDTO(); | ||
35 | + $objDocumentoDTO->retDblIdDocumento(); | ||
36 | + $objDocumentoDTO->retDblIdProcedimento(); | ||
37 | + $objDocumentoDTO->retStrConteudo(); | ||
38 | + $objDocumentoDTO->retStrNomeSerie(); | ||
39 | + $objDocumentoDTO->retStrStaEditor(); | ||
40 | + $objDocumentoDTO->retStrSiglaUnidadeGeradoraProtocolo(); | ||
41 | + $objDocumentoDTO->retStrProtocoloDocumentoFormatado(); | ||
42 | + $objDocumentoDTO->retStrStaProtocoloProtocolo(); | ||
43 | + $objDocumentoDTO->retDblIdDocumentoEdoc(); | ||
44 | + $objDocumentoDTO->retStrStaEstadoProtocolo(); | ||
45 | + // $objDocumentoDTO->retStrSinAssinaturaBloqueada(); | ||
46 | + $objDocumentoDTO->retNumIdUnidadeGeradoraProtocolo(); | ||
47 | + $objDocumentoDTO->retStrStaNivelAcessoGlobalProtocolo(); | ||
48 | + $objDocumentoDTO->retStrStaNivelAcessoLocalProtocolo(); | ||
49 | + $objDocumentoDTO->setDblIdDocumento($_GET['id_documento']); | ||
50 | + | ||
51 | + $objDocumentoRN = new DocumentoRN(); | ||
52 | + $objDocumentoDTO = $objDocumentoRN->consultarRN0005($objDocumentoDTO); | ||
53 | + | ||
54 | + | ||
55 | + | ||
56 | + if ($objDocumentoDTO==null){ | ||
57 | + die('Documento não encontrado.'); | ||
58 | + } | ||
59 | + | ||
60 | + $objProtocoloProcedimentoDTO = new ProtocoloDTO(); | ||
61 | + $objProtocoloProcedimentoDTO->setDblIdProtocolo($objDocumentoDTO->getDblIdProcedimento()); | ||
62 | + $objProtocoloProcedimentoDTO->retStrStaNivelAcessoLocal(); | ||
63 | + | ||
64 | + $objProtocoloRN = new ProtocoloRN(); | ||
65 | + $objProtocoloProcedimentoDTO = $objProtocoloRN->consultarRN0186($objProtocoloProcedimentoDTO); | ||
66 | + | ||
67 | + if($objProtocoloProcedimentoDTO != null && $objProtocoloProcedimentoDTO->getStrStaNivelAcessoLocal() != ProtocoloRN::$NA_PUBLICO){ | ||
68 | + die('Documento não encontrado.'); | ||
69 | + } | ||
70 | + | ||
71 | + if ($objDocumentoDTO->getStrStaEstadoProtocolo()==ProtocoloRN::$TE_CANCELADO){ | ||
72 | + die('Documento '.$objDocumentoDTO->getStrProtocoloDocumentoFormatado().' foi cancelado.'); | ||
73 | + } | ||
74 | + | ||
75 | + if(!$bolListaDocumentoProcessoRestrito){ | ||
76 | + if ($objDocumentoDTO->getStrStaNivelAcessoGlobalProtocolo()!= ProtocoloRN::$NA_PUBLICO){ | ||
77 | + die('Documento não encontrado.'); | ||
78 | + } | ||
79 | + } | ||
80 | + | ||
81 | + if($bolListaDocumentoProcessoRestrito){ | ||
82 | + | ||
83 | + if($objDocumentoDTO->getStrStaNivelAcessoGlobalProtocolo() == ProtocoloRN::$NA_SIGILOSO || $objDocumentoDTO->getStrStaNivelAcessoLocalProtocolo() != ProtocoloRN::$NA_PUBLICO){ | ||
84 | + | ||
85 | + die('Documento não encontrado.'); | ||
86 | + | ||
87 | + } | ||
88 | + } | ||
89 | + | ||
90 | + // Exibe apenas documentos de processos públicos. | ||
91 | + | ||
92 | + | ||
93 | + //Carregar dados do cabeçalho | ||
94 | + $objProcedimentoDTO = new ProcedimentoDTO(); | ||
95 | + $objProcedimentoDTO->setDblIdProcedimento($objDocumentoDTO->getDblIdProcedimento()); | ||
96 | + $objProcedimentoDTO->setStrSinDocTodos('S'); | ||
97 | + $objProcedimentoDTO->setArrDblIdProtocoloAssociado(array($objDocumentoDTO->getDblIdDocumento())); | ||
98 | + | ||
99 | + $objProcedimentoRN = new ProcedimentoRN(); | ||
100 | + $arr = $objProcedimentoRN->listarCompleto($objProcedimentoDTO); | ||
101 | + | ||
102 | + if (count($arr)==0){ | ||
103 | + die('Processo não encontrado.'); | ||
104 | + } | ||
105 | + | ||
106 | + $objAcessoExternoRN = new AcessoExternoRN(); | ||
107 | + | ||
108 | + $objProcedimentoDTO = $arr[0]; | ||
109 | + $bolFlag = false; | ||
110 | + foreach($objProcedimentoDTO->getArrObjDocumentoDTO() as $dto){ | ||
111 | + if ($dto->getDblIdDocumento() == $objDocumentoDTO->getDblIdDocumento()){ | ||
112 | + if (SessaoSEIExterna::getInstance()->getNumIdUsuarioExterno()==null){ | ||
113 | + if (!$objDocumentoRN->verificarSelecaoAcessoExterno($dto)){ | ||
114 | + if ($dto->getStrStaProtocoloProtocolo()==ProtocoloRN::$TP_DOCUMENTO_GERADO && $dto->getStrSinAssinado()=='N'){ | ||
115 | + die('Documento '.$objDocumentoDTO->getStrProtocoloDocumentoFormatado().' ainda não foi assinado.'); | ||
116 | + }else{ | ||
117 | + die('Documento '.$objDocumentoDTO->getStrProtocoloDocumentoFormatado().' não está disponível para visualização externa.'); | ||
118 | + } | ||
119 | + } | ||
120 | + }else{ | ||
121 | + | ||
122 | + if (!$objDocumentoRN->verificarSelecaoAcessoExterno($dto)){ | ||
123 | + | ||
124 | + if ($dto->getStrStaProtocoloProtocolo()!=ProtocoloRN::$TP_DOCUMENTO_GERADO){ | ||
125 | + die('Documento '.$objDocumentoDTO->getStrProtocoloDocumentoFormatado().' não está disponível para visualização externa.'); | ||
126 | + }else{ | ||
127 | + | ||
128 | + $objAcessoExternoDTO = new AcessoExternoDTO(); | ||
129 | + $objAcessoExternoDTO->setDblIdDocumento($_GET['id_documento']); | ||
130 | + $objAcessoExternoDTO->setNumIdAcessoExterno($_GET['id_acesso_externo_assinatura']); | ||
131 | + | ||
132 | + if ($objAcessoExternoRN->contar($objAcessoExternoDTO)==0){ | ||
133 | + | ||
134 | + if ($dto->getStrSinAssinado()=='N'){ | ||
135 | + die('Documento '.$objDocumentoDTO->getStrProtocoloDocumentoFormatado().' ainda não foi assinado.'); | ||
136 | + }else{ | ||
137 | + die('Documento '.$objDocumentoDTO->getStrProtocoloDocumentoFormatado().' não está disponível para assinatura externa.'); | ||
138 | + } | ||
139 | + | ||
140 | + } | ||
141 | + } | ||
142 | + } | ||
143 | + | ||
144 | + } | ||
145 | + $bolFlag = true; | ||
146 | + break; | ||
147 | + } | ||
148 | + } | ||
149 | + | ||
150 | + if (!$bolFlag){ | ||
151 | + die('Documento não encontrado no processo.'); | ||
152 | + } | ||
153 | + | ||
154 | + $strTitulo = $objDocumentoDTO->getStrNomeSerie().' '.$objDocumentoDTO->getStrSiglaUnidadeGeradoraProtocolo().' '.$objDocumentoDTO->getStrProtocoloDocumentoFormatado(); | ||
155 | + | ||
156 | + if ($objDocumentoDTO->getStrStaEditor()==EditorRN::$TE_EDOC){ | ||
157 | + if ($objDocumentoDTO->getDblIdDocumentoEdoc()!=null){ | ||
158 | + | ||
159 | + $objDocumentoRN->bloquearAssinaturaVisualizada($objDocumentoDTO); | ||
160 | + | ||
161 | + $objEDocRN = new EDocRN(); | ||
162 | + //echo EDocINT::montarVisualizacaoDocumento($objDocumentoDTO->getDblIdDocumentoEdoc()); | ||
163 | + echo $objEDocRN->consultarHTMLDocumentoRN1204($objDocumentoDTO); | ||
164 | + | ||
165 | + }else{ | ||
166 | + echo 'Documento sem conteúdo.'; | ||
167 | + } | ||
168 | + }else if ($objDocumentoDTO->getStrStaEditor()==EditorRN::$TE_INTERNO){ | ||
169 | + $objEditorDTO = new EditorDTO(); | ||
170 | + $objEditorDTO->setDblIdDocumento($objDocumentoDTO->getDblIdDocumento()); | ||
171 | + $objEditorDTO->setNumIdBaseConhecimento(null); | ||
172 | + $objEditorDTO->setStrSinCabecalho('S'); | ||
173 | + $objEditorDTO->setStrSinRodape('S'); | ||
174 | + $objEditorDTO->setStrSinIdentificacaoVersao('N'); | ||
175 | + | ||
176 | + $objEditorRN = new EditorRN(); | ||
177 | + echo $objEditorRN->consultarHtmlVersao($objEditorDTO); | ||
178 | + | ||
179 | + }else if (isset($_GET['id_anexo'])){ | ||
180 | + | ||
181 | + $objDocumentoRN->bloquearAssinaturaVisualizada($objDocumentoDTO); | ||
182 | + | ||
183 | + $objAnexoDTO = new AnexoDTO(); | ||
184 | + $objAnexoDTO->retNumIdAnexo(); | ||
185 | + $objAnexoDTO->retStrNome(); | ||
186 | + $objAnexoDTO->setNumIdAnexo($_GET['id_anexo']); | ||
187 | + $objAnexoDTO->retDthInclusao(); | ||
188 | + | ||
189 | + $objAnexoRN = new AnexoRN(); | ||
190 | + $objAnexoDTO = $objAnexoRN->consultarRN0736($objAnexoDTO); | ||
191 | + | ||
192 | + header("Pragma: public"); // required | ||
193 | + header('Pragma: no-cache'); | ||
194 | + header("Expires: 0"); | ||
195 | + header("Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0"); | ||
196 | + header("Cache-Control: private","false"); // required for certain browsers | ||
197 | + | ||
198 | + PaginaSEIExterna::getInstance()->montarHeaderDownload($objAnexoDTO->getStrNome()); | ||
199 | + | ||
200 | + $fp = fopen($objAnexoRN->obterLocalizacao($objAnexoDTO), "rb"); | ||
201 | + while (!feof($fp)) { | ||
202 | + echo fread($fp, TAM_BLOCO_LEITURA_ARQUIVO); | ||
203 | + } | ||
204 | + fclose($fp); | ||
205 | + | ||
206 | + | ||
207 | + }else if ($objDocumentoDTO->getStrStaProtocoloProtocolo()==ProtocoloRN::$TP_DOCUMENTO_RECEBIDO){ | ||
208 | + | ||
209 | + // $objDocumentoRN->bloquearAssinaturaVisualizada($objDocumentoDTO); | ||
210 | + | ||
211 | + | ||
212 | + $objAnexoDTO = new AnexoDTO(); | ||
213 | + $objAnexoDTO->retNumIdAnexo(); | ||
214 | + $objAnexoDTO->retStrNome(); | ||
215 | + $objAnexoDTO->retNumIdAnexo(); | ||
216 | + $objAnexoDTO->setDblIdProtocolo($objDocumentoDTO->getDblIdDocumento()); | ||
217 | + $objAnexoDTO->retDblIdProtocolo(); | ||
218 | + $objAnexoDTO->retDthInclusao(); | ||
219 | + | ||
220 | + $objAnexoRN = new AnexoRN(); | ||
221 | + $arrObjAnexoDTO = $objAnexoRN->listarRN0218($objAnexoDTO); | ||
222 | + | ||
223 | + if (count($arrObjAnexoDTO)!=1){ | ||
224 | + $strResultado = ''; | ||
225 | + }else{ | ||
226 | + $objAnexoDTO = $arrObjAnexoDTO[0]; | ||
227 | + | ||
228 | + header("Pragma: public"); | ||
229 | + header('Pragma: no-cache'); | ||
230 | + header("Expires: 0"); | ||
231 | + header("Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0"); | ||
232 | + header("Cache-Control: private","false"); | ||
233 | + | ||
234 | + PaginaSEI::getInstance()->montarHeaderDownload($objAnexoDTO->getStrNome()); | ||
235 | + | ||
236 | + $fp = fopen($objAnexoRN->obterLocalizacao($objAnexoDTO), "rb"); | ||
237 | + while (!feof($fp)) { | ||
238 | + echo fread($fp, TAM_BLOCO_LEITURA_ARQUIVO); | ||
239 | + } | ||
240 | + fclose($fp); | ||
241 | + | ||
242 | + } | ||
243 | + | ||
244 | + }else{ | ||
245 | + echo '<html>'; | ||
246 | + echo '<head>'; | ||
247 | + echo '<title>:: '.PaginaSEIExterna::getInstance()->getStrNomeSistema().' - '.$strTitulo.' ::</title>'; | ||
248 | + echo '</head>'; | ||
249 | + echo '<body>'; | ||
250 | + //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']); | ||
251 | + echo DocumentoExternoINT::formatarExibicaoConteudo(DocumentoINT::$TV_HTML, $objDocumentoDTO->getStrConteudo(), PaginaSEIExterna::getInstance(), SessaoSEIExterna::getInstance(), ''); | ||
252 | + echo '</body>'; | ||
253 | + echo '</html>'; | ||
254 | + } | ||
255 | + | ||
256 | + $objDocumentoDTO->unSetStrConteudo(); | ||
257 | + AuditoriaSEI::getInstance()->auditar('documento_consulta_externa',__FILE__,$objDocumentoDTO); | ||
258 | + | ||
259 | +}catch(Exception $e){ | ||
260 | + try{ LogSEI::getInstance()->gravar(InfraException::inspecionar($e)); }catch(Exception $e2){} | ||
261 | + die('Erro consultando documento em acesso externo.'); | ||
262 | +} | ||
263 | +?> | ||
0 | \ No newline at end of file | 264 | \ No newline at end of file |
1 | +++ a/sei/institucional/pesquisa/dto/ProcedimentoParteDTO.php | ||
@@ -0,0 +1,68 @@ | @@ -0,0 +1,68 @@ | ||
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 | + * ProcedimentoParteDTO | ||
11 | + * | ||
12 | + * | ||
13 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
14 | + */ | ||
15 | + | ||
16 | +/** | ||
17 | + * Classe mantem dados procedimento siscade. | ||
18 | + * | ||
19 | + * | ||
20 | + * @package institucional_pesquisa_dto_ProcedimentoParteDTO | ||
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 ProcedimentoParteDTO extends InfraDTO { | ||
34 | + | ||
35 | + public function getStrNomeTabela(){ | ||
36 | + return 'S_PROCEDIMENTO_PARTE'; | ||
37 | + } | ||
38 | + | ||
39 | + public function montar(){ | ||
40 | + | ||
41 | + | ||
42 | + $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM, 'IdProcedimentoParte', 'ID_PROCEDIMENTOPARTE'); | ||
43 | + $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM, 'IdTipoParte', 'ID_TIPOPARTE'); | ||
44 | + $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM, 'IdPessoaFisica', 'ID_PESSOAFISICA'); | ||
45 | + $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM, 'IdPessoaJuridica', 'ID_PESSOAJURIDICA'); | ||
46 | + $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM, 'IdEnteAdministracao', 'ID_ENTEADMINISTRACAO'); | ||
47 | + $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM, 'IdTipoPessoaParte', 'ID_TIPOPESSOAPARTE'); | ||
48 | + $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM, 'nrOrdem', 'NR_ORDEM'); | ||
49 | + $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM, 'IdProcedimento', 'ID_PROCEDIMENTO'); | ||
50 | + | ||
51 | + $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_STR,'NrProcedimento', 'NR_PROCEDIMENTO', 'S_PROCEDIMENTO'); | ||
52 | + | ||
53 | + $this->configurarPK('IdProcedimentoParte', InfraDTO::$TIPO_PK_NATIVA); | ||
54 | + $this->configurarFK('IdPessoaFisica','S_PESSOA_FISICA', 'ID_PESSOAFISICA'); | ||
55 | + $this->configurarFK('IdPessoaJuridica','S_PESSOA_JURIDICA', 'ID_PESSOAJURIDICA'); | ||
56 | + $this->configurarFK('IdEnteAdministracao','S_ENTE_ADMINISTRATIVO', 'ID_ENTEADMINISTRACAO'); | ||
57 | + | ||
58 | + | ||
59 | + | ||
60 | + | ||
61 | + | ||
62 | + | ||
63 | + | ||
64 | + | ||
65 | + } | ||
66 | + | ||
67 | + | ||
68 | +} |
sei/institucional/pesquisa/dto/ProcedimentoSiscadeDTO.php
0 → 100644
1 | +++ a/sei/institucional/pesquisa/dto/ProcedimentoSiscadeDTO.php | ||
@@ -0,0 +1,61 @@ | @@ -0,0 +1,61 @@ | ||
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 | + * ProcedimentoSiscadeDTO | ||
11 | + * | ||
12 | + * | ||
13 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
14 | + */ | ||
15 | + | ||
16 | +/** | ||
17 | + * Classe mantem dados procedimento siscade. | ||
18 | + * | ||
19 | + * | ||
20 | + * @package institucional_pesquisa_ProcedimentoSiscadeDTO | ||
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 ProcedimentoSiscadeDTO extends InfraDTO { | ||
34 | + | ||
35 | + public function getStrNomeTabela(){ | ||
36 | + return 'S_PROCEDIMENTO'; | ||
37 | + } | ||
38 | + | ||
39 | + public function montar(){ | ||
40 | + | ||
41 | + $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM, 'IdProcedimento', 'ID_PROCEDIMENTO'); | ||
42 | + $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_STR, 'NrProcedimento', 'NR_PROCEDIMENTO'); | ||
43 | + $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_STR, 'TxResumo', 'TX_RESUMO'); | ||
44 | + $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM, 'IdConfidencialidade', 'ID_CONFIDENCIALIDADE'); | ||
45 | + $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM, 'IdEspecie', 'ID_ESPECIE'); | ||
46 | + $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_STR,'NmEspecie', 'NM_ESPECIE', 'S_ESPECIE'); | ||
47 | + | ||
48 | + $this->adicionarAtributo(InfraDTO::$PREFIXO_STR, 'NomeParte'); | ||
49 | + | ||
50 | + | ||
51 | + $this->configurarPK('IdProcedimento', InfraDTO::$TIPO_PK_NATIVA); | ||
52 | + $this->configurarFK('IdEspecie','S_ESPECIE', 'ID_ESPECIE'); | ||
53 | + | ||
54 | + | ||
55 | + | ||
56 | + | ||
57 | + | ||
58 | + } | ||
59 | + | ||
60 | + | ||
61 | +} |
1 | +++ a/sei/institucional/pesquisa/dto/ProcessoDTO.php | ||
@@ -0,0 +1,76 @@ | @@ -0,0 +1,76 @@ | ||
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 | + | ||
33 | +require_once dirname(__FILE__).'/../../../SEI.php'; | ||
34 | + | ||
35 | +class ProcessoDTO extends InfraDTO { | ||
36 | + | ||
37 | + private $nomeParte; | ||
38 | + | ||
39 | + public function setNomeParte($nomeParte){ | ||
40 | + $this->nomeParte = $nomeParte; | ||
41 | + } | ||
42 | + | ||
43 | + public function getNomeParte(){ | ||
44 | + return $this->nomeParte; | ||
45 | + } | ||
46 | + | ||
47 | + public function getStrNomeTabela(){ | ||
48 | + return 'processos'; | ||
49 | + } | ||
50 | + | ||
51 | + | ||
52 | + | ||
53 | + public function montar(){ | ||
54 | + | ||
55 | + $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM, 'ProCodigo', 'pro_codigo'); | ||
56 | + $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_STR, 'ProNumero', 'pro_numero'); | ||
57 | + $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM, 'TipproCodigo', 'tippro_codigo'); | ||
58 | + // Verificar como realizar cast nas funções DTO | ||
59 | + $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_STR, 'ProSumula', 'pro_codigo , CAST('.$this->getStrNomeTabela().'.pro_sumula AS TEXT)'); | ||
60 | + $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_STR,'TipproNome', 'tippro_nome', 'tipos_processos'); | ||
61 | + | ||
62 | + | ||
63 | + $this->configurarPK('ProCodigo', InfraDTO::$TIPO_PK_NATIVA); | ||
64 | + | ||
65 | + | ||
66 | + | ||
67 | + $this->configurarFK('TipproCodigo','tipos_processos', 'tippro_codigo'); | ||
68 | + | ||
69 | + } | ||
70 | + | ||
71 | + | ||
72 | + | ||
73 | + | ||
74 | + | ||
75 | + | ||
76 | +} |
sei/institucional/pesquisa/dto/ProtocoloPesquisaPublicaDTO.php
0 → 100644
1 | +++ a/sei/institucional/pesquisa/dto/ProtocoloPesquisaPublicaDTO.php | ||
@@ -0,0 +1,66 @@ | @@ -0,0 +1,66 @@ | ||
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 | + | ||
33 | +require_once dirname(__FILE__).'/../../../SEI.php'; | ||
34 | + | ||
35 | +class ProtocoloPesquisaPublicaDTO extends InfraDTO { | ||
36 | + | ||
37 | + | ||
38 | + | ||
39 | + public function getStrNomeTabela(){ | ||
40 | + return null; | ||
41 | + } | ||
42 | + | ||
43 | + | ||
44 | + | ||
45 | + public function montar(){ | ||
46 | + | ||
47 | + $this->adicionarAtributo(InfraDTO::$PREFIXO_STR, 'NumeroSEI'); | ||
48 | + $this->adicionarAtributo(InfraDTO::$PREFIXO_STR, 'TipoDocumento'); | ||
49 | + $this->adicionarAtributo(InfraDTO::$PREFIXO_DTA, 'Documento'); | ||
50 | + $this->adicionarAtributo(InfraDTO::$PREFIXO_DTA, 'Registro'); | ||
51 | + $this->adicionarAtributo(InfraDTO::$PREFIXO_STR, 'Unidade' ); | ||
52 | + $this->adicionarAtributo(InfraDTO::$PREFIXO_STR, 'StaAssociacao'); | ||
53 | + $this->adicionarAtributo(InfraDTO::$PREFIXO_OBJ, 'DocumentoDTO'); | ||
54 | + $this->adicionarAtributo(InfraDTO::$PREFIXO_OBJ, 'ProcedimentoDTO'); | ||
55 | + | ||
56 | + | ||
57 | + | ||
58 | + | ||
59 | + } | ||
60 | + | ||
61 | + | ||
62 | + | ||
63 | + | ||
64 | + | ||
65 | + | ||
66 | +} |
No preview for this file type
1 | +++ a/sei/institucional/pesquisa/field.js | ||
@@ -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
1 | +++ a/sei/institucional/pesquisa/int/DocumentoExternoINT.php | ||
@@ -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 |
1 | +++ a/sei/institucional/pesquisa/processo_exibe_arquivo.php | ||
@@ -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 |
1 | +++ a/sei/institucional/pesquisa/processo_exibir.php | ||
@@ -0,0 +1,869 @@ | @@ -0,0 +1,869 @@ | ||
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 | + session_start(); | ||
16 | + | ||
17 | + ////////////////////////////////////////////////////////////////////////////// | ||
18 | + InfraDebug::getInstance()->setBolLigado(false); | ||
19 | + InfraDebug::getInstance()->setBolDebugInfra(true); | ||
20 | + InfraDebug::getInstance()->limpar(); | ||
21 | + ////////////////////////////////////////////////////////////////////////////// | ||
22 | + | ||
23 | + if (isset($_GET['id_acesso_externo'])){ | ||
24 | + SessaoSEIExterna::getInstance($_GET['id_acesso_externo'])->validarLink(); | ||
25 | + }else{ | ||
26 | + ConverteURI::converterURI(); | ||
27 | + SessaoSEIExterna::getInstance()->validarLink(); | ||
28 | + | ||
29 | + } | ||
30 | + | ||
31 | + //carrega configurações pesquisa | ||
32 | + $bolListaDocumentoProcessoPublico = ConfiguracaoPesquisa::getInstance()->getValor('Pesquisa','ListaDocumentoProcessoPublico'); | ||
33 | + $bolListaAndamentoProcessoPublico = ConfiguracaoPesquisa::getInstance()->getValor('Pesquisa','ListaAndamentoProcessoPublico'); | ||
34 | + $bolCaptchaGerarPdf = ConfiguracaoPesquisa::getInstance()->getValor('Pesquisa','CaptchaPdf'); | ||
35 | + $bolLinkMetadadosProcessoRestrito = ConfiguracaoPesquisa::getInstance()->getValor('Pesquisa','MetaDadosProcessoRestrito'); | ||
36 | + $bolListaAndamentoProcessoRestrito = ConfiguracaoPesquisa::getInstance()->getValor('Pesquisa','ListaAndamentoProcessoRestrito'); | ||
37 | + $bolListaDocumentoProcessoRestrito = ConfiguracaoPesquisa::getInstance()->getValor('Pesquisa','ListaDocumentoProcessoRestrito'); | ||
38 | + | ||
39 | + if($bolCaptchaGerarPdf) { | ||
40 | + $strCodigoParaGeracaoCaptcha = InfraCaptcha::obterCodigo(); | ||
41 | + $md5Captcha = md5(InfraCaptcha::gerar($strCodigoParaGeracaoCaptcha)); | ||
42 | + }else { | ||
43 | + $md5Captcha = null; | ||
44 | + } | ||
45 | + | ||
46 | + PaginaSEIExterna::getInstance()->setTipoPagina(PaginaSEIExterna::$TIPO_PAGINA_SEM_MENU); | ||
47 | + | ||
48 | + $strTitulo = 'Pesquisa Processual'; | ||
49 | + | ||
50 | + //SessaoSEIExterna::getInstance()->validarPermissao($_GET['acao']); | ||
51 | + | ||
52 | + | ||
53 | + //Carregar id do participante | ||
54 | +// $objAcessoExternoDTO = new AcessoExternoDTO(); | ||
55 | +// $objAcessoExternoDTO->retDblIdDocumento(); | ||
56 | +// $objAcessoExternoDTO->retStrSinProcesso(); | ||
57 | +// $objAcessoExternoDTO->retNumIdParticipante(); | ||
58 | + | ||
59 | +// $numIdAcessoExterno = null; | ||
60 | +// if (isset($_GET['id_acesso_externo']) && $_GET['id_acesso_externo']!=''){ | ||
61 | +// $numIdAcessoExterno = $_GET['id_acesso_externo']; | ||
62 | +// }else if (isset($_GET['id_acesso_externo_assinatura']) && $_GET['id_acesso_externo_assinatura']!=''){ | ||
63 | +// $numIdAcessoExterno = $_GET['id_acesso_externo_assinatura']; | ||
64 | +// } | ||
65 | + | ||
66 | +// $objAcessoExternoDTO->setNumIdAcessoExterno($numIdAcessoExterno); | ||
67 | + | ||
68 | +// $objAcessoExternoRN = new AcessoExternoRN(); | ||
69 | +// $objAcessoExternoDTO = $objAcessoExternoRN->consultar($objAcessoExternoDTO); | ||
70 | + | ||
71 | +// if ($objAcessoExternoDTO==null){ | ||
72 | +// SessaoSEIExterna::getInstance()->sair(null, 'Registro de acesso externo não encontrado.'); | ||
73 | +// } | ||
74 | + | ||
75 | +// if ($objAcessoExternoDTO->getStrSinProcesso()=='N'){ | ||
76 | +// SessaoSEIExterna::getInstance()->sair(null, 'Usuário externo sem acesso ao processo solicitado.'); | ||
77 | +// } | ||
78 | + | ||
79 | +// //Carregar id do protocolo | ||
80 | +// $objParticipanteDTO = new ParticipanteDTO(); | ||
81 | +// $objParticipanteDTO->retDblIdProtocolo(); | ||
82 | +// $objParticipanteDTO->setNumIdParticipante($objAcessoExternoDTO->getNumIdParticipante()); | ||
83 | + | ||
84 | +// $objParticipanteRN = new ParticipanteRN(); | ||
85 | +// $objParticipanteDTO = $objParticipanteRN->consultarRN1008($objParticipanteDTO); | ||
86 | + | ||
87 | +// if (isset($_GET['id_procedimento_anexado'])){ | ||
88 | + | ||
89 | +// $objRelProtocoloProtocoloDTO = new RelProtocoloProtocoloDTO(); | ||
90 | +// $objRelProtocoloProtocoloDTO->setDblIdProtocolo1($objParticipanteDTO->getDblIdProtocolo()); | ||
91 | +// $objRelProtocoloProtocoloDTO->setDblIdProtocolo2($_GET['id_procedimento_anexado']); | ||
92 | +// $objRelProtocoloProtocoloDTO->setStrStaAssociacao(RelProtocoloProtocoloRN::$TA_PROCEDIMENTO_ANEXADO); | ||
93 | + | ||
94 | +// $objRelProtocoloProtocoloRN = new RelProtocoloProtocoloRN(); | ||
95 | +// if ($objRelProtocoloProtocoloRN->contarRN0843($objRelProtocoloProtocoloDTO)==0){ | ||
96 | +// SessaoSEIExterna::getInstance()->sair(null, 'Processo solicitado não está anexado ao processo original.'); | ||
97 | +// } | ||
98 | + | ||
99 | +// $dblIdProcedimento = $_GET['id_procedimento_anexado']; | ||
100 | + | ||
101 | +// }else{ | ||
102 | +// $dblIdProcedimento = $objParticipanteDTO->getDblIdProtocolo(); | ||
103 | +// } | ||
104 | + | ||
105 | + $dblIdProcedimento = $_GET['id_procedimento']; | ||
106 | + | ||
107 | + //Carregar dados do cabeçalho | ||
108 | + $objProcedimentoDTO = new ProcedimentoDTO(); | ||
109 | + $objProcedimentoDTO->retStrNomeTipoProcedimento(); | ||
110 | + $objProcedimentoDTO->retStrProtocoloProcedimentoFormatado(); | ||
111 | + $objProcedimentoDTO->retDtaGeracaoProtocolo(); | ||
112 | + $objProcedimentoDTO->retStrStaNivelAcessoGlobalProtocolo(); | ||
113 | + $objProcedimentoDTO->retStrStaNivelAcessoLocalProtocolo(); | ||
114 | + $objProcedimentoDTO->retNumIdHipoteseLegalProtocolo(); | ||
115 | + | ||
116 | + $objProcedimentoDTO->setDblIdProcedimento($dblIdProcedimento); | ||
117 | + $objProcedimentoDTO->setStrSinDocTodos('S'); | ||
118 | + $objProcedimentoDTO->setStrSinProcAnexados('S'); | ||
119 | + //$objProcedimentoDTO->setStrSinDocAnexos('S'); | ||
120 | + //$objProcedimentoDTO->setStrSinDocConteudo('S'); | ||
121 | + | ||
122 | + $objProcedimentoRN = new ProcedimentoRN(); | ||
123 | + $arr = $objProcedimentoRN->listarCompleto($objProcedimentoDTO); | ||
124 | + | ||
125 | + if (count($arr)==0){ | ||
126 | + //SessaoSEIExterna::getInstance()->sair(null, 'Processo não encontrado.'); | ||
127 | + die('Processo não encontrado.'); | ||
128 | + } | ||
129 | + | ||
130 | + $objProcedimentoDTO = $arr[0]; | ||
131 | + | ||
132 | + | ||
133 | + if(!$bolLinkMetadadosProcessoRestrito){ | ||
134 | + if ($objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo()!= ProtocoloRN::$NA_PUBLICO){ | ||
135 | + die('Processo não encontrado.'); | ||
136 | + } | ||
137 | + } | ||
138 | + | ||
139 | + if($bolLinkMetadadosProcessoRestrito){ | ||
140 | + | ||
141 | + if($objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo() == ProtocoloRN::$NA_SIGILOSO ){ | ||
142 | + | ||
143 | + die('Processo não encontrado.'); | ||
144 | + | ||
145 | + } | ||
146 | + } | ||
147 | + | ||
148 | + //Carregar interessados no processo | ||
149 | + $objInteressadosParticipanteDTO = new ParticipanteDTO(); | ||
150 | + $objInteressadosParticipanteDTO->retStrNomeContato(); | ||
151 | + $objInteressadosParticipanteDTO->setDblIdProtocolo($dblIdProcedimento); | ||
152 | + $objInteressadosParticipanteDTO->setStrStaParticipacao(ParticipanteRN::$TP_INTERESSADO); | ||
153 | + | ||
154 | + | ||
155 | + $objInteressadosParticipanteRN = new ParticipanteRN(); | ||
156 | + | ||
157 | + $objInteressadosParticipanteDTO = $objInteressadosParticipanteRN->listarRN0189($objInteressadosParticipanteDTO); | ||
158 | + | ||
159 | + if (count($objInteressadosParticipanteDTO)==0){ | ||
160 | + $strInteressados = ' '; | ||
161 | + }else{ | ||
162 | + $strInteressados = ''; | ||
163 | + foreach($objInteressadosParticipanteDTO as $objInteressadoParticipanteDTO){ | ||
164 | + $strInteressados .= $objInteressadoParticipanteDTO->getStrNomeContato()."<br /> "; | ||
165 | + } | ||
166 | + } | ||
167 | + | ||
168 | + | ||
169 | + //Mensagem Processo Restrito | ||
170 | + $strMensagemProcessoRestrito = ''; | ||
171 | + $strHipoteseLegal = ''; | ||
172 | + if($objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo() == ProtocoloRN::$NA_RESTRITO && $bolLinkMetadadosProcessoRestrito){ | ||
173 | + | ||
174 | + $objHipoteseLegalDTO = new HipoteseLegalDTO(); | ||
175 | + $objHipoteseLegalDTO->setNumIdHipoteseLegal($objProcedimentoDTO->getNumIdHipoteseLegalProtocolo()); | ||
176 | + $objHipoteseLegalDTO->retStrBaseLegal(); | ||
177 | + $objHipoteseLegalDTO->retStrNome(); | ||
178 | + | ||
179 | + $objHipoteseLegalRN = new HipoteseLegalRN(); | ||
180 | + $objHipoteseLegalDTO = $objHipoteseLegalRN->consultar($objHipoteseLegalDTO); | ||
181 | + | ||
182 | + if($objHipoteseLegalDTO != null){ | ||
183 | + | ||
184 | + $strHipoteseLegal .= '<img src="/infra_css/imagens/espaco.gif">'; | ||
185 | + $strHipoteseLegal .= '<img src="imagens/sei_chave_restrito.gif" align="absbottom" title="Acesso Restrito.
'.PaginaSEIExterna::getInstance()->formatarXHTML($objHipoteseLegalDTO->getStrNome().' ('.$objHipoteseLegalDTO->getStrBaseLegal().')').'">'; | ||
186 | + | ||
187 | + } | ||
188 | + | ||
189 | + $strMensagemProcessoRestrito = '<p style="font-size: 1.2em;"> '.ConfiguracaoPesquisa::getInstance()->getValor('Pesquisa','DescricaoProcedimentoAcessoRestrito').'</p>'; | ||
190 | + | ||
191 | + } | ||
192 | + | ||
193 | + | ||
194 | + $strResultadoCabecalho = ''; | ||
195 | + $strResultadoCabecalho .= '<table id="tblCabecalho" width="99.3%" class="infraTable" summary="Cabeçalho de Processo" >'."\n"; | ||
196 | + $strResultadoCabecalho .= '<tr><th class="infraTh" colspan="2">Autuação</th></tr>'."\n"; | ||
197 | + $strResultadoCabecalho .= '<tr class="infraTrClara"><td width="20%">Processo:</td><td>'.$objProcedimentoDTO->getStrProtocoloProcedimentoFormatado().$strHipoteseLegal.'</td></tr>'."\n"; | ||
198 | + $strResultadoCabecalho .= '<tr class="infraTrClara"><td width="20%">Tipo:</td><td>'.PaginaSEIExterna::getInstance()->formatarXHTML($objProcedimentoDTO->getStrNomeTipoProcedimento()).'</td></tr>'."\n"; | ||
199 | + $strResultadoCabecalho .= '<tr class="infraTrClara"><td width="20%">Data de Registro:</td><td>'.$objProcedimentoDTO->getDtaGeracaoProtocolo().'</td></tr>'."\n"; | ||
200 | + $strResultadoCabecalho .= '<tr class="infraTrClara"><td width="20%">Interessados:</td><td> '.$strInteressados.'</td></tr>'."\n"; | ||
201 | + $strResultadoCabecalho .= '</table>'."\n"; | ||
202 | + | ||
203 | + | ||
204 | + | ||
205 | + | ||
206 | + | ||
207 | + | ||
208 | + //$arrObjDocumentoDTO = InfraArray::indexarArrInfraDTO($objProcedimentoDTO->getArrObjDocumentoDTO(),'IdDocumento'); | ||
209 | + $arrObjRelProtocoloProtocoloDTO = array(); | ||
210 | + | ||
211 | + if($bolListaDocumentoProcessoPublico && $objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo() == ProtocoloRN::$NA_PUBLICO ){ | ||
212 | + $arrObjRelProtocoloProtocoloDTO = $objProcedimentoDTO->getArrObjRelProtocoloProtocoloDTO(); | ||
213 | + }else if($bolListaDocumentoProcessoRestrito && $objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo() == ProtocoloRN::$NA_RESTRITO){ | ||
214 | + $arrObjRelProtocoloProtocoloDTO = $objProcedimentoDTO->getArrObjRelProtocoloProtocoloDTO(); | ||
215 | + } | ||
216 | + | ||
217 | + // Objeto Fake para paginação. | ||
218 | + $objProtocoloPesquisaPublicaPaginacaoDTO = new ProtocoloPesquisaPublicaDTO(); | ||
219 | + $objProtocoloPesquisaPublicaPaginacaoDTO->retTodos(true); | ||
220 | + PaginaSEIExterna::getInstance()->prepararOrdenacao($objProtocoloPesquisaPublicaPaginacaoDTO, 'Registro', InfraDTO::$TIPO_ORDENACAO_ASC); | ||
221 | + //PaginaSEIExterna::getInstance()->prepararPaginacao($objProtocoloPesquisaPublicaPaginacaoDTO,4); | ||
222 | + //PaginaSEIExterna::getInstance()->processarPaginacao($objProtocoloPesquisaPublicaPaginacaoDTO); | ||
223 | + $arrObjProtocoloPesquisaPublicaDTO = array(); | ||
224 | + | ||
225 | + $objDocumentoRN = new DocumentoRN(); | ||
226 | + | ||
227 | + $numProtocolos = 0; | ||
228 | + $numDocumentosPdf = 0; | ||
229 | + $strCssMostrarAcoes = '.colunaAcoes {display:none;}'."\n"; | ||
230 | + | ||
231 | + $strThCheck = PaginaSEIExterna::getInstance()->getThCheck(); | ||
232 | + | ||
233 | + foreach($arrObjRelProtocoloProtocoloDTO as $objRelProtocoloProtocoloDTO){ | ||
234 | + | ||
235 | + if ($objRelProtocoloProtocoloDTO->getStrStaAssociacao()==RelProtocoloProtocoloRN::$TA_DOCUMENTO_ASSOCIADO){ | ||
236 | + | ||
237 | + $objDocumentoDTO = $objRelProtocoloProtocoloDTO->getObjProtocoloDTO2(); | ||
238 | + //valida documentos para retornar | ||
239 | + if ($objDocumentoRN->verificarSelecaoAcessoExterno($objDocumentoDTO)){ | ||
240 | + | ||
241 | + $objProtocoloPesquisaPublicaDTO = new ProtocoloPesquisaPublicaDTO(); | ||
242 | + $objProtocoloPesquisaPublicaDTO->setStrNumeroSEI($objDocumentoDTO->getStrProtocoloDocumentoFormatado()); | ||
243 | + $objProtocoloPesquisaPublicaDTO->setStrTipoDocumento(PaginaSEIExterna::getInstance()->formatarXHTML($objDocumentoDTO->getStrNomeSerie().' '.$objDocumentoDTO->getStrNumero())); | ||
244 | + | ||
245 | + | ||
246 | + if($objDocumentoDTO->getStrStaProtocoloProtocolo() == ProtocoloRN::$TP_DOCUMENTO_RECEBIDO){ | ||
247 | + | ||
248 | + $objAtributoAndamentoDTO = new AtributoAndamentoDTO(); | ||
249 | + $objAtributoAndamentoDTO->setDblIdProtocoloAtividade($objProcedimentoDTO->getDblIdProcedimento()); | ||
250 | + $objAtributoAndamentoDTO->setNumIdTarefaAtividade(TarefaRN::$TI_RECEBIMENTO_DOCUMENTO); | ||
251 | + $objAtributoAndamentoDTO->setStrNome("DOCUMENTO"); | ||
252 | + $objAtributoAndamentoDTO->setStrIdOrigem($objDocumentoDTO->getDblIdDocumento()); | ||
253 | + | ||
254 | + $objAtributoAndamentoDTO->retDthAberturaAtividade(); | ||
255 | + | ||
256 | + $objAtributoAndamentoRN = new AtributoAndamentoRN(); | ||
257 | + | ||
258 | + $objAtributoAndamentoDTO = $objAtributoAndamentoRN->consultarRN1366($objAtributoAndamentoDTO); | ||
259 | + | ||
260 | + if($objAtributoAndamentoDTO != null && $objAtributoAndamentoDTO->isSetDthAberturaAtividade()){ | ||
261 | + | ||
262 | + $dtaRecebimento = substr($objAtributoAndamentoDTO->getDthAberturaAtividade(),0,10); | ||
263 | + | ||
264 | + $objProtocoloPesquisaPublicaDTO->setDtaRegistro($dtaRecebimento); | ||
265 | + | ||
266 | + }else{ | ||
267 | + | ||
268 | + $objProtocoloPesquisaPublicaDTO->setDtaRegistro($objDocumentoDTO->getDtaGeracaoProtocolo()); | ||
269 | + } | ||
270 | + | ||
271 | + $objProtocoloPesquisaPublicaDTO->setDtaDocumento($objDocumentoDTO->getDtaGeracaoProtocolo()); | ||
272 | + | ||
273 | + }else if ($objDocumentoDTO->getStrStaProtocoloProtocolo() == ProtocoloRN::$TP_DOCUMENTO_GERADO){ | ||
274 | + | ||
275 | + $objAssinaturaDTO = new AssinaturaDTO(); | ||
276 | + $objAssinaturaDTO->setDblIdDocumento($objDocumentoDTO->getDblIdDocumento()); | ||
277 | + $objAssinaturaDTO->setOrdNumIdAssinatura(InfraDTO::$TIPO_ORDENACAO_ASC); | ||
278 | + $objAssinaturaDTO->retDthAberturaAtividade(); | ||
279 | + | ||
280 | + $objAssinaturaRN = new AssinaturaRN(); | ||
281 | + $arrObjAssinaturaDTO = $objAssinaturaRN->listarRN1323($objAssinaturaDTO); | ||
282 | + | ||
283 | + if(is_array($arrObjAssinaturaDTO) && count($arrObjAssinaturaDTO) > 0) { | ||
284 | + | ||
285 | + $objAssinaturaDTO = $arrObjAssinaturaDTO[0]; | ||
286 | + | ||
287 | + if($objAssinaturaDTO != null && $objAssinaturaDTO->isSetDthAberturaAtividade()){ | ||
288 | + | ||
289 | + $dtaAssinatura = substr($objAssinaturaDTO->getDthAberturaAtividade(),0,10); | ||
290 | + | ||
291 | + $objProtocoloPesquisaPublicaDTO->setDtaRegistro($dtaAssinatura); | ||
292 | + $objProtocoloPesquisaPublicaDTO->setDtaDocumento($dtaAssinatura); | ||
293 | + | ||
294 | + }else{ | ||
295 | + $objProtocoloPesquisaPublicaDTO->setDtaRegistro($objDocumentoDTO->getDtaGeracaoProtocolo()); | ||
296 | + $objProtocoloPesquisaPublicaDTO->setDtaDocumento($objDocumentoDTO->getDtaGeracaoProtocolo()); | ||
297 | + } | ||
298 | + }else{ | ||
299 | + | ||
300 | + $objProtocoloPesquisaPublicaDTO->setDtaRegistro($objDocumentoDTO->getDtaGeracaoProtocolo()); | ||
301 | + $objProtocoloPesquisaPublicaDTO->setDtaDocumento($objDocumentoDTO->getDtaGeracaoProtocolo()); | ||
302 | + } | ||
303 | + | ||
304 | + | ||
305 | + | ||
306 | + | ||
307 | + } | ||
308 | + | ||
309 | + | ||
310 | + $objProtocoloPesquisaPublicaDTO->setStrUnidade($objDocumentoDTO->getStrSiglaUnidadeGeradoraProtocolo()); | ||
311 | + $objProtocoloPesquisaPublicaDTO->setStrStaAssociacao($objRelProtocoloProtocoloDTO->getStrStaAssociacao()); | ||
312 | + $objProtocoloPesquisaPublicaDTO->setObjDocumentoDTO($objDocumentoDTO); | ||
313 | + | ||
314 | + | ||
315 | + $arrObjProtocoloPesquisaPublicaDTO[] = $objProtocoloPesquisaPublicaDTO; | ||
316 | + $numProtocolos++; | ||
317 | + } | ||
318 | + }else if ($objRelProtocoloProtocoloDTO->getStrStaAssociacao()==RelProtocoloProtocoloRN::$TA_PROCEDIMENTO_ANEXADO){ | ||
319 | + | ||
320 | + $objProcedimentoDTOAnexado = $objRelProtocoloProtocoloDTO->getObjProtocoloDTO2(); | ||
321 | + | ||
322 | + $objProtocoloPesquisaPublicaDTO = new ProtocoloPesquisaPublicaDTO(); | ||
323 | + $objProtocoloPesquisaPublicaDTO->setStrNumeroSEI($objProcedimentoDTOAnexado->getStrProtocoloProcedimentoFormatado()); | ||
324 | + $objProtocoloPesquisaPublicaDTO->setStrTipoDocumento(PaginaSEIExterna::getInstance()->formatarXHTML($objProcedimentoDTOAnexado->getStrNomeTipoProcedimento())); | ||
325 | + $objProtocoloPesquisaPublicaDTO->setDtaDocumento($objProcedimentoDTOAnexado->getDtaGeracaoProtocolo()); | ||
326 | + $objProtocoloPesquisaPublicaDTO->setDtaRegistro($objProcedimentoDTOAnexado->getDtaGeracaoProtocolo()); | ||
327 | + $objProtocoloPesquisaPublicaDTO->setStrUnidade($objProcedimentoDTOAnexado->getStrSiglaUnidadeGeradoraProtocolo()); | ||
328 | + $objProtocoloPesquisaPublicaDTO->setStrStaAssociacao($objRelProtocoloProtocoloDTO->getStrStaAssociacao()); | ||
329 | + $objProtocoloPesquisaPublicaDTO->setObjProcedimentoDTO($objProcedimentoDTOAnexado); | ||
330 | + | ||
331 | + $arrObjProtocoloPesquisaPublicaDTO[] = $objProtocoloPesquisaPublicaDTO; | ||
332 | + | ||
333 | + | ||
334 | + $numProtocolos++; | ||
335 | + } | ||
336 | + } | ||
337 | + | ||
338 | + | ||
339 | + if ($numProtocolos > 0){ | ||
340 | + | ||
341 | + | ||
342 | + | ||
343 | + $strResultado = '<table id="tblDocumentos" width="99.3%" class="infraTable" summary="Lista de Documentos" > | ||
344 | + <caption class="infraCaption" >'.PaginaSEIExterna::getInstance()->gerarCaptionTabela("Protocolos",$numProtocolos).'</caption> | ||
345 | + <tr> | ||
346 | + <th class="infraTh" width="1%">'.$strThCheck.'</th> | ||
347 | + <th class="infraTh" width="15%">'.PaginaSEIExterna::getInstance()->getThOrdenacao($objProtocoloPesquisaPublicaPaginacaoDTO,'Documento / Processo','NumeroSEI',$arrObjProtocoloPesquisaPublicaDTO,true).'</th> | ||
348 | + <th class="infraTh" width="15%">'.PaginaSEIExterna::getInstance()->getThOrdenacao($objProtocoloPesquisaPublicaPaginacaoDTO,'Tipo de Documento','TipoDocumento',$arrObjProtocoloPesquisaPublicaDTO,true).'</th> | ||
349 | + <th class="infraTh" width="15%">'.PaginaSEIExterna::getInstance()->getThOrdenacao($objProtocoloPesquisaPublicaPaginacaoDTO,'Data do Documento','Documento',$arrObjProtocoloPesquisaPublicaDTO,true).'</th> | ||
350 | + <th class="infraTh" width="15%">'.PaginaSEIExterna::getInstance()->getThOrdenacao($objProtocoloPesquisaPublicaPaginacaoDTO,'Data de Registro','Registro',$arrObjProtocoloPesquisaPublicaDTO,true).'</th> | ||
351 | + <th class="infraTh" width="15%">'.PaginaSEIExterna::getInstance()->getThOrdenacao($objProtocoloPesquisaPublicaPaginacaoDTO,'Unidade','Unidade',$arrObjProtocoloPesquisaPublicaDTO,true).'</th> | ||
352 | + | ||
353 | + </tr>'; | ||
354 | + | ||
355 | + // monta tabela documentos | ||
356 | + foreach ($arrObjProtocoloPesquisaPublicaDTO as $objProtocoloPesquisaPublicaDTO){ | ||
357 | + | ||
358 | + if($objProtocoloPesquisaPublicaDTO->getStrStaAssociacao() == RelProtocoloProtocoloRN::$TA_DOCUMENTO_ASSOCIADO){ | ||
359 | + | ||
360 | + $objDocumentoDTO = $objProtocoloPesquisaPublicaDTO->getObjDocumentoDTO(); | ||
361 | + $urlCripografadaDocumeto = Criptografia::criptografa('id_documento='.$objDocumentoDTO->getDblIdDocumento().'&id_orgao_acesso_externo=0'); | ||
362 | + $strLinkDocumento = PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink('documento_consulta_externa.php?'.$urlCripografadaDocumeto)); | ||
363 | + | ||
364 | + $strResultado .= '<tr class="infraTrClara">'; | ||
365 | + | ||
366 | + //Cria checkbox para gerar PDF, verifica se o Processo é público e o Acesso Local do Protocolo é Público | ||
367 | + if($objDocumentoDTO->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_PUBLICO && $objProcedimentoDTO->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_PUBLICO){ | ||
368 | + if($objDocumentoRN->verificarSelecaoGeracaoPdf($objDocumentoDTO)){ | ||
369 | + $strResultado .= '<td align="center">'.PaginaSEIExterna::getInstance()->getTrCheck($numDocumentosPdf++, $objDocumentoDTO->getDblIdDocumento(), $objDocumentoDTO->getStrNomeSerie()).'</td>'; | ||
370 | + }else{ | ||
371 | + $strResultado .= '<td> </td>'; | ||
372 | + } | ||
373 | + }else{ | ||
374 | + $strResultado .= '<td> </td>'; | ||
375 | + } | ||
376 | + | ||
377 | + | ||
378 | + //Exibe link de documentos com nivel de acesso local Público de processo público | ||
379 | + if($objDocumentoDTO->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_PUBLICO && $objProcedimentoDTO->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_PUBLICO ){ | ||
380 | + $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>'; | ||
381 | + }else{ | ||
382 | + if($objDocumentoDTO->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_RESTRITO){ | ||
383 | + | ||
384 | + //necessario para retornar id hipotese legal do documento | ||
385 | + $strHipoteseLegalDocumento = ''; | ||
386 | + $objProtocoloDocumentoDTO = new ProtocoloDTO(); | ||
387 | + $objProtocoloDocumentoDTO->setDblIdProtocolo($objDocumentoDTO->getDblIdDocumento()); | ||
388 | + $objProtocoloDocumentoDTO->retNumIdHipoteseLegal(); | ||
389 | + | ||
390 | + $objProtocoloRN = new ProtocoloRN(); | ||
391 | + $objProtocoloDocumentoDTO = $objProtocoloRN->consultarRN0186($objProtocoloDocumentoDTO); | ||
392 | + | ||
393 | + if($objProtocoloDocumentoDTO != null){ | ||
394 | + | ||
395 | + $objHipoteseLegaDocumentoDTO = new HipoteseLegalDTO(); | ||
396 | + $objHipoteseLegaDocumentoDTO->setNumIdHipoteseLegal($objProtocoloDocumentoDTO->getNumIdHipoteseLegal()); | ||
397 | + $objHipoteseLegaDocumentoDTO->retStrNome(); | ||
398 | + $objHipoteseLegaDocumentoDTO->retStrBaseLegal(); | ||
399 | + | ||
400 | + $objHipoteseLegalRN = new HipoteseLegalRN(); | ||
401 | + $objHipoteseLegaDocumentoDTO = $objHipoteseLegalRN->consultar($objHipoteseLegaDocumentoDTO); | ||
402 | + | ||
403 | + | ||
404 | + if($objHipoteseLegaDocumentoDTO != null){ | ||
405 | + | ||
406 | + $strHipoteseLegalDocumento .= $objHipoteseLegaDocumentoDTO->getStrNome().' ('.$objHipoteseLegaDocumentoDTO->getStrBaseLegal().')'; | ||
407 | + } | ||
408 | + } | ||
409 | + | ||
410 | + | ||
411 | + | ||
412 | + $strResultado .= '<td align="center" ><span class="retiraAncoraPadraoAzul">'.$objDocumentoDTO->getStrProtocoloDocumentoFormatado().'</span>'; | ||
413 | + $strResultado .= '<img src="/infra_css/imagens/espaco.gif">'; | ||
414 | + $strResultado .= '<img src="imagens/sei_chave_restrito.gif" align="absbottom" title="Acesso Restrito.
'.PaginaSEIExterna::getInstance()->formatarXHTML($strHipoteseLegalDocumento).'">'; | ||
415 | + $strResultado .= '</td>'; | ||
416 | + | ||
417 | + }else{ | ||
418 | + $strResultado .= '<td align="center" style="padding-right:22px" ><span class="retiraAncoraPadraoAzul">'.$objDocumentoDTO->getStrProtocoloDocumentoFormatado().'</span>'; | ||
419 | + } | ||
420 | + | ||
421 | + | ||
422 | + } | ||
423 | + | ||
424 | + $strResultado .= '<td align="center">'.PaginaSEIExterna::getInstance()->formatarXHTML($objDocumentoDTO->getStrNomeSerie().' '.$objDocumentoDTO->getStrNumero()).'</td> | ||
425 | + <td align="center">'.$objProtocoloPesquisaPublicaDTO->getDtaDocumento().'</td> | ||
426 | + <td align="center">'.$objProtocoloPesquisaPublicaDTO->getDtaRegistro().'</td> | ||
427 | + <td align="center"><a alt="'.$objDocumentoDTO->getStrDescricaoUnidadeGeradoraProtocolo().'" title="'.$objDocumentoDTO->getStrDescricaoUnidadeGeradoraProtocolo().'" class="ancoraSigla">'.$objDocumentoDTO->getStrSiglaUnidadeGeradoraProtocolo().'</a></td> | ||
428 | + <td align="center" class="colunaAcoes">'; | ||
429 | + | ||
430 | + $strResultado .='</td></tr>'; | ||
431 | + | ||
432 | + }else if($objProtocoloPesquisaPublicaDTO->getStrStaAssociacao() == RelProtocoloProtocoloRN::$TA_PROCEDIMENTO_ANEXADO){ | ||
433 | + | ||
434 | + | ||
435 | + $strResultado .= '<tr class="infraTrClara">'; | ||
436 | + $strResultado .= '<td> </td>'; | ||
437 | + $strHipoteseLegalAnexo .= ''; | ||
438 | + | ||
439 | + $objProcedimentoDTOAnexado = $objProtocoloPesquisaPublicaDTO->getObjProcedimentoDTO(); | ||
440 | + | ||
441 | + // cria indicação de acesso restrito com hipotese legal. | ||
442 | + if($objProcedimentoDTOAnexado->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_RESTRITO){ | ||
443 | + | ||
444 | + $strHipoteseLegalAnexo = ''; | ||
445 | + $objProtocoloAnexoDTO = new ProtocoloDTO(); | ||
446 | + $objProtocoloAnexoDTO->setDblIdProtocolo($objProcedimentoDTOAnexado->getDblIdProcedimento()); | ||
447 | + $objProtocoloAnexoDTO->retNumIdHipoteseLegal(); | ||
448 | + | ||
449 | + $objProtocoloRN = new ProtocoloRN(); | ||
450 | + $objProtocoloAnexoDTO = $objProtocoloRN->consultarRN0186($objProtocoloAnexoDTO); | ||
451 | + | ||
452 | + if($objProtocoloAnexoDTO != null){ | ||
453 | + | ||
454 | + $objHipoteseLegaAnexoDTO = new HipoteseLegalDTO(); | ||
455 | + $objHipoteseLegaAnexoDTO->setNumIdHipoteseLegal($objProtocoloAnexoDTO->getNumIdHipoteseLegal()); | ||
456 | + $objHipoteseLegaAnexoDTO->retStrNome(); | ||
457 | + $objHipoteseLegaAnexoDTO->retStrBaseLegal(); | ||
458 | + | ||
459 | + $objHipoteseLegalRN = new HipoteseLegalRN(); | ||
460 | + $objHipoteseLegaDocumentoDTO = $objHipoteseLegalRN->consultar($objHipoteseLegaAnexoDTO); | ||
461 | + | ||
462 | + | ||
463 | + if($objHipoteseLegaDocumentoDTO != null){ | ||
464 | + | ||
465 | + $strHipoteseLegalAnexo .= $objHipoteseLegaDocumentoDTO->getStrNome().' ('.$objHipoteseLegaDocumentoDTO->getStrBaseLegal().')'; | ||
466 | + } | ||
467 | + } | ||
468 | + $strProtocoloRestrito .= '<img src="imagens/sei_chave_restrito.gif" align="absbottom" title="Acesso Restrito.
'.$strHipoteseLegalAnexo.'">'; | ||
469 | + } | ||
470 | + | ||
471 | + if($objProcedimentoDTOAnexado->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_PUBLICO && $objProcedimentoDTO->getStrStaNivelAcessoLocalProtocolo() == ProtocoloRN::$NA_PUBLICO ){ | ||
472 | + $parametrosCriptografadosProcesso = Criptografia::criptografa('id_orgao_acesso_externo=0&id_procedimento='.$objProcedimentoDTOAnexado->getDblIdProcedimento()); | ||
473 | + $urlPesquisaProcesso = 'processo_exibir.php?'.$parametrosCriptografadosProcesso; | ||
474 | + | ||
475 | + // $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())); | ||
476 | + | ||
477 | + $strLinkProcessoAnexado = PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink(SolrUtilExterno::prepararUrl($urlPesquisaProcesso))); | ||
478 | + | ||
479 | + | ||
480 | + $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>'; | ||
481 | + | ||
482 | + }else{ | ||
483 | + | ||
484 | + $strResultado .= '<td align="center" style="padding-right:22px" ><span class="retiraAncoraPadraoAzul">'.PaginaSEIExterna::getInstance()->formatarXHTML($objProcedimentoDTOAnexado->getStrProtocoloProcedimentoFormatado()).' </span>'.$strProtocoloRestrito.'</td>'; | ||
485 | + | ||
486 | + } | ||
487 | + | ||
488 | + $strResultado.= '<td align="center">'.PaginaSEIExterna::getInstance()->formatarXHTML($objProcedimentoDTOAnexado->getStrNomeTipoProcedimento()).'</td> | ||
489 | + <td align="center">'.$objProtocoloPesquisaPublicaDTO->getDtaDocumento().'</td> | ||
490 | + <td align="center">'.$objProtocoloPesquisaPublicaDTO->getDtaRegistro().'</td> | ||
491 | + <td align="center"><a alt="'.$objProcedimentoDTOAnexado->getStrDescricaoUnidadeGeradoraProtocolo().'" title="'.$objProcedimentoDTOAnexado->getStrDescricaoUnidadeGeradoraProtocolo().'" class="ancoraSigla">'.$objProcedimentoDTOAnexado->getStrSiglaUnidadeGeradoraProtocolo().'</a></td> | ||
492 | + <td align="center" class="colunaAcoes"> </td>'; | ||
493 | + $strResultado .='</tr>'; | ||
494 | + | ||
495 | + } | ||
496 | + } | ||
497 | + | ||
498 | + $strResultado.='</table>'; | ||
499 | + | ||
500 | + } | ||
501 | + | ||
502 | + | ||
503 | + $arrComandos = array(); | ||
504 | + if ($numDocumentosPdf > 0){ | ||
505 | + if($bolCaptchaGerarPdf){ | ||
506 | + $strComando = '<button type="button" accesskey="G" name="btnGerarPdfModal" value="Gerar PDF" onclick="gerarPdfModal();" class="infraButton"><span class="infraTeclaAtalho">G</span>erar PDF</button>'; | ||
507 | + }else{ | ||
508 | + $strComando = '<button type="button" accesskey="G" name="btnGerarPdfModal" value="Gerar PDF" onclick="gerarPdf();" class="infraButton"><span class="infraTeclaAtalho">G</span>erar PDF</button>'; | ||
509 | + } | ||
510 | + | ||
511 | + $arrComandos[] = $strComando; | ||
512 | + | ||
513 | + } | ||
514 | + | ||
515 | + //Carregar histórico | ||
516 | + | ||
517 | + $numRegistrosAtividades = 0; | ||
518 | + | ||
519 | + | ||
520 | + if(($bolListaAndamentoProcessoPublico && $objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo() == ProtocoloRN::$NA_PUBLICO) || | ||
521 | + ($bolListaAndamentoProcessoRestrito && $objProcedimentoDTO->getStrStaNivelAcessoGlobalProtocolo() == ProtocoloRN::$NA_RESTRITO) ){ | ||
522 | + | ||
523 | + $objProcedimentoHistoricoDTO = new ProcedimentoHistoricoDTO(); | ||
524 | + $objProcedimentoHistoricoDTO->setDblIdProcedimento($dblIdProcedimento); | ||
525 | + $objProcedimentoHistoricoDTO->setStrStaHistorico(ProcedimentoRN::$TH_EXTERNO); | ||
526 | + $objProcedimentoHistoricoDTO->setStrSinGerarLinksHistorico('N'); | ||
527 | + | ||
528 | + //$arrIdTarefa = ConfiguracaoPesquisa::getInstance()->getValor('Pesquisa','ArrIdTarefaAndamento'); | ||
529 | + //$objProcedimentoHistoricoDTO->setNumIdTarefa($arrIdTarefa); | ||
530 | + | ||
531 | + $objProcedimentoRN = new ProcedimentoRN(); | ||
532 | + $objProcedimentoDTORet = $objProcedimentoRN->consultarHistoricoRN1025($objProcedimentoHistoricoDTO); | ||
533 | + $arrObjAtividadeDTO = $objProcedimentoDTORet->getArrObjAtividadeDTO(); | ||
534 | + | ||
535 | + $numRegistrosAtividades = count($arrObjAtividadeDTO); | ||
536 | + } | ||
537 | + | ||
538 | + | ||
539 | + | ||
540 | + | ||
541 | + if ($numRegistrosAtividades > 0){ | ||
542 | + | ||
543 | + $bolCheck = false; | ||
544 | + | ||
545 | + $strResultadoAndamentos = ''; | ||
546 | + | ||
547 | + $strResultadoAndamentos .= '<table id="tblHistorico" width="99.3%" class="infraTable" summary="Histórico de Andamentos">'."\n"; | ||
548 | + $strResultadoAndamentos .= '<caption class="infraCaption">'.PaginaSEIExterna::getInstance()->gerarCaptionTabela('Andamentos',$numRegistrosAtividades).'</caption>'; | ||
549 | + $strResultadoAndamentos .= '<tr>'; | ||
550 | + $strResultadoAndamentos .= '<th class="infraTh" width="20%">Data/Hora</th>'; | ||
551 | + $strResultadoAndamentos .= '<th class="infraTh" width="10%">Unidade</th>'; | ||
552 | + $strResultadoAndamentos .= '<th class="infraTh">Descrição</th>'; | ||
553 | + $strResultadoAndamentos .= '</tr>'."\n"; | ||
554 | + | ||
555 | + $strQuebraLinha = '<span style="line-height:.5em"><br /></span>'; | ||
556 | + | ||
557 | + | ||
558 | + foreach($arrObjAtividadeDTO as $objAtividadeDTO){ | ||
559 | + | ||
560 | + //InfraDebug::getInstance()->gravar($objAtividadeDTO->getNumIdAtividade()); | ||
561 | + | ||
562 | + $strResultadoAndamentos .= "\n\n".'<!-- '.$objAtividadeDTO->getNumIdAtividade().' -->'."\n"; | ||
563 | + | ||
564 | + if ($objAtividadeDTO->getStrSinUltimaUnidadeHistorico() == 'S'){ | ||
565 | + $strAbertas = 'class="andamentoAberto"'; | ||
566 | + }else{ | ||
567 | + $strAbertas = 'class="andamentoConcluido"'; | ||
568 | + } | ||
569 | + | ||
570 | + $strResultadoAndamentos .= '<tr '.$strAbertas.'>'; | ||
571 | + $strResultadoAndamentos .= "\n".'<td align="center">'; | ||
572 | + $strResultadoAndamentos .= substr($objAtividadeDTO->getDthAbertura(),0,16); | ||
573 | + $strResultadoAndamentos .= '</td>'; | ||
574 | + | ||
575 | + $strResultadoAndamentos .= "\n".'<td align="center">'; | ||
576 | + $strResultadoAndamentos .= '<a alt="'.$objAtividadeDTO->getStrDescricaoUnidade().'" title="'.$objAtividadeDTO->getStrDescricaoUnidade().'" class="ancoraSigla">'.$objAtividadeDTO->getStrSiglaUnidade().'</a>'; | ||
577 | + $strResultadoAndamentos .= '</td>'; | ||
578 | + | ||
579 | + $strResultadoAndamentos .= "\n"; | ||
580 | + $strResultadoAndamentos .= "\n".'<td>'; | ||
581 | + | ||
582 | + if (!InfraString::isBolVazia($objAtividadeDTO->getStrNomeTarefa())){ | ||
583 | + $strResultadoAndamentos .= nl2br($objAtividadeDTO->getStrNomeTarefa()).$strQuebraLinha; | ||
584 | + } | ||
585 | + | ||
586 | + $strResultadoAndamentos .= '</td>'; | ||
587 | + | ||
588 | + $strResultadoAndamentos .= '</tr>'; | ||
589 | + } | ||
590 | + $strResultadoAndamentos .= '</table><br />'; | ||
591 | + } | ||
592 | + | ||
593 | + | ||
594 | + | ||
595 | + AuditoriaSEI::getInstance()->auditar('processo_consulta_externa', __FILE__, strip_tags($strResultadoCabecalho)."\n".strip_tags($strResultado)); | ||
596 | + | ||
597 | + if ($_POST['hdnFlagGerar']=='1'){ | ||
598 | + | ||
599 | + if(md5($_POST['txtCaptcha']) != $_POST['hdnCaptchaMd5'] && $_GET['hash'] != $_POST['hdnCaptchaMd5'] && $bolCaptchaGerarPdf == true){ | ||
600 | + PaginaSEIExterna::getInstance()->setStrMensagem('Código de confirmação inválido.'); | ||
601 | + | ||
602 | + }else { | ||
603 | + | ||
604 | + | ||
605 | + $objDocumentoRN = new DocumentoRN(); | ||
606 | + | ||
607 | + $parArrObjDocumentoDTO = InfraArray::converterArrInfraDTO(InfraArray::gerarArrInfraDTO('DocumentoDTO','IdDocumento',PaginaSEIExterna::getInstance()->getArrStrItensSelecionados()),'IdDocumento'); | ||
608 | + $objDocumentoDTO = new DocumentoDTO(); | ||
609 | + $objDocumentoDTO->retDblIdDocumento(); | ||
610 | + $objDocumentoDTO->setDblIdDocumento($parArrObjDocumentoDTO, InfraDTO::$OPER_IN); | ||
611 | + $objDocumentoDTO->retDblIdProcedimento(); | ||
612 | + $objDocumentoDTO->retStrStaNivelAcessoGlobalProtocolo(); | ||
613 | + $objDocumentoDTO->retStrStaNivelAcessoLocalProtocolo(); | ||
614 | + $arrObjDocumentoDTO = $objDocumentoRN->listarRN0008($objDocumentoDTO); | ||
615 | + | ||
616 | + foreach ($arrObjDocumentoDTO as $objDocumentoDTO){ | ||
617 | + | ||
618 | + //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 | ||
619 | + if($bolListaDocumentoProcessoRestrito){ | ||
620 | + if($objDocumentoDTO->getDblIdProcedimento() != $dblIdProcedimento || $objDocumentoDTO->getStrStaNivelAcessoLocalProtocolo() != ProtocoloRN::$NA_PUBLICO || $objProcedimentoDTO->getStrStaNivelAcessoLocalProtocolo() != ProtocoloRN::$NA_PUBLICO){ | ||
621 | + die ("Erro ao Gerar Pdf"); | ||
622 | + } | ||
623 | + }else if($bolListaDocumentoProcessoPublico){ | ||
624 | + if($objDocumentoDTO->getDblIdProcedimento() != $dblIdProcedimento || $objDocumentoDTO->getStrStaNivelAcessoGlobalProtocolo() != ProtocoloRN::$NA_PUBLICO){ | ||
625 | + die ("Erro ao Gerar Pdf"); | ||
626 | + } | ||
627 | + }else{ | ||
628 | + die ("Erro ao Gerar Pdf"); | ||
629 | + } | ||
630 | + | ||
631 | + | ||
632 | + } | ||
633 | + | ||
634 | + | ||
635 | + $objDocumentoRN = new DocumentoRN(); | ||
636 | + $objAnexoDTO = $objDocumentoRN->gerarPdf(InfraArray::gerarArrInfraDTO('DocumentoDTO','IdDocumento',PaginaSEIExterna::getInstance()->getArrStrItensSelecionados())); | ||
637 | + | ||
638 | + $bolGeracaoOK = true; | ||
639 | + | ||
640 | + } | ||
641 | + | ||
642 | + } | ||
643 | + | ||
644 | +}catch(Exception $e){ | ||
645 | + PaginaSEIExterna::getInstance()->processarExcecao($e); | ||
646 | +} | ||
647 | + | ||
648 | + | ||
649 | +PaginaSEIExterna::getInstance()->montarDocType(); | ||
650 | +PaginaSEIExterna::getInstance()->abrirHtml(); | ||
651 | +PaginaSEIExterna::getInstance()->abrirHead(); | ||
652 | +PaginaSEIExterna::getInstance()->montarMeta(); | ||
653 | +PaginaSEIExterna::getInstance()->montarTitle(':: '.PaginaSEIExterna::getInstance()->getStrNomeSistema().' - '.$strTitulo.' ::'); | ||
654 | +PaginaSEIExterna::getInstance()->montarStyle(); | ||
655 | +PaginaSEIExterna::getInstance()->abrirStyle(); | ||
656 | +echo $strCssMostrarAcoes; | ||
657 | +?> | ||
658 | + | ||
659 | +div.infraBarraSistemaE {width:90%} | ||
660 | +div.infraBarraSistemaD {width:5%} | ||
661 | +div.infraBarraComandos {width:99%} | ||
662 | + | ||
663 | +table caption { | ||
664 | + text-align:left !important; | ||
665 | + font-size: 1.2em; | ||
666 | + font-weight:bold; | ||
667 | +} | ||
668 | + | ||
669 | +.andamentoAberto { | ||
670 | + background-color:white; | ||
671 | +} | ||
672 | + | ||
673 | +.andamentoConcluido { | ||
674 | + background-color:white; | ||
675 | +} | ||
676 | + | ||
677 | + | ||
678 | +#tblCabecalho{margin-top:1;} | ||
679 | +#tblDocumentos {margin-top:1.5em;} | ||
680 | +#tblHistorico {margin-top:1.5em;} | ||
681 | + | ||
682 | +<? if($bolCaptchaGerarPdf) { ?> | ||
683 | +#lblCaptcha {position: absolute; top:30%; left: 20%; width: 80%} | ||
684 | +#txtCaptcha{position: absolute; top:56%; left: 20%; height:15%; width:56%;font-size: 3em;} | ||
685 | +#btnEnviarCaptcha {position: absolute; top:80%; left: 20%; width:56%} | ||
686 | + | ||
687 | +#divInfraModal{ | ||
688 | + | ||
689 | + display: none; | ||
690 | + position: fixed; | ||
691 | + z-index: 1; | ||
692 | + padding-top: 100px; | ||
693 | + left: 0; | ||
694 | + top: 0; | ||
695 | + width: 50%; | ||
696 | + height: 50%; | ||
697 | + overflow: auto; | ||
698 | + | ||
699 | +} | ||
700 | + | ||
701 | + | ||
702 | + | ||
703 | +.close { | ||
704 | + color: white; | ||
705 | + float: right; | ||
706 | + font-size: 28px; | ||
707 | + font-weight: bold; | ||
708 | +} | ||
709 | + | ||
710 | +.close:hover, | ||
711 | +.close:focus { | ||
712 | + color: #000; | ||
713 | + text-decoration: none; | ||
714 | + cursor: pointer; | ||
715 | +} | ||
716 | + | ||
717 | +.modal-header { | ||
718 | + padding: 2px 16px; | ||
719 | + background-image: url("imagens/bg_barra_sistema.jpg"); | ||
720 | + color: white; | ||
721 | +} | ||
722 | + | ||
723 | +.modal-body {padding: 2px 16px;} | ||
724 | + | ||
725 | +.modal-footer { | ||
726 | + padding: 2px 16px; | ||
727 | + background-color: #5cb85c; | ||
728 | + color: white; | ||
729 | +} | ||
730 | +<? } ?> | ||
731 | + | ||
732 | +span.retiraAncoraPadraoAzul{font-size: 1.2em;} | ||
733 | + | ||
734 | +<? | ||
735 | +PaginaSEIExterna::getInstance()->fecharStyle(); | ||
736 | +PaginaSEIExterna::getInstance()->montarJavaScript(); | ||
737 | +PaginaSEIExterna::getInstance()->abrirJavaScript(); | ||
738 | +?> | ||
739 | + | ||
740 | +function inicializar(){ | ||
741 | + | ||
742 | + <?if ($bolGeracaoOK){?> | ||
743 | + | ||
744 | + | ||
745 | + <!-- | ||
746 | + //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');?>'); | ||
747 | + --> | ||
748 | + | ||
749 | + 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');?>'); | ||
750 | + | ||
751 | + | ||
752 | + <?}?> | ||
753 | + | ||
754 | + infraEfeitoTabelas(); | ||
755 | +} | ||
756 | + | ||
757 | + | ||
758 | +<? | ||
759 | +if($bolCaptchaGerarPdf){ | ||
760 | +?> | ||
761 | + | ||
762 | +$(document).unbind("keyup").keyup(function(e){ | ||
763 | + e.preventDefault(); | ||
764 | + var code = e.which; | ||
765 | + if(code==13){ | ||
766 | + var modal = document.getElementById('divInfraModal'); | ||
767 | + if(modal.style.display == "block"){ | ||
768 | + fecharPdfModal(); | ||
769 | + gerarPdf(); | ||
770 | + | ||
771 | + } | ||
772 | + } | ||
773 | +}); | ||
774 | + | ||
775 | + | ||
776 | + | ||
777 | +function gerarPdfModal(){ | ||
778 | + | ||
779 | + if (document.getElementById('hdnInfraItensSelecionados').value==''){ | ||
780 | + alert('Nenhum documento selecionado.'); | ||
781 | + return; | ||
782 | + } | ||
783 | + var modal = document.getElementById('divInfraModal'); | ||
784 | + modal.style.display = "block"; | ||
785 | + | ||
786 | +} | ||
787 | + | ||
788 | +function fecharPdfModal(){ | ||
789 | + | ||
790 | + var modal = document.getElementById('divInfraModal'); | ||
791 | + modal.style.display = "none"; | ||
792 | +} | ||
793 | + | ||
794 | +window.onclick = function(event) { | ||
795 | + var modal = document.getElementById('divInfraModal'); | ||
796 | + if (event.target == modal) { | ||
797 | + modal.style.display = "none"; | ||
798 | + } | ||
799 | +} | ||
800 | + | ||
801 | +<? | ||
802 | +} | ||
803 | +?> | ||
804 | + | ||
805 | +function gerarPdf() { | ||
806 | + | ||
807 | + if (document.getElementById('hdnInfraItensSelecionados').value==''){ | ||
808 | + alert('Nenhum documento selecionado.'); | ||
809 | + return; | ||
810 | + } | ||
811 | + | ||
812 | + <? | ||
813 | + if($bolCaptchaGerarPdf){ | ||
814 | + ?> | ||
815 | + fecharPdfModal(); | ||
816 | + <? | ||
817 | + } | ||
818 | + ?> | ||
819 | + | ||
820 | + infraExibirAviso(false); | ||
821 | + | ||
822 | + document.getElementById('hdnFlagGerar').value = '1'; | ||
823 | + document.getElementById('frmProcessoAcessoExternoConsulta').submit(); | ||
824 | +} | ||
825 | + | ||
826 | +<? | ||
827 | +PaginaSEIExterna::getInstance()->fecharJavaScript(); | ||
828 | +PaginaSEIExterna::getInstance()->fecharHead(); | ||
829 | +PaginaSEIExterna::getInstance()->abrirBody($strTitulo,'onload="inicializar();"'); | ||
830 | +?> | ||
831 | + | ||
832 | +<form id="frmProcessoAcessoExternoConsulta" method="post"> | ||
833 | +<? | ||
834 | +if($bolCaptchaGerarPdf){ | ||
835 | + echo ' | ||
836 | + <div id="divInfraModal" class="infraFundoTransparente" style="position: fixed; width: 100%; height: 100%; visibility: visible;"> | ||
837 | + <div id="divCaptcha" class="infraAreaDados" style="height: 220px; width: 230px; background-color:white"> | ||
838 | + <div class="modal-header"> | ||
839 | + <span id="spnClose" class="close" onclick="fecharPdfModal();">×</span> | ||
840 | + <h2 style ="color: white;font-size: 1.2em;font-weight: bold;">Digite o Código da Imagem</h2> | ||
841 | + </div> | ||
842 | + <div class="modal-body"> | ||
843 | + <label id="lblCaptcha" accesskey="" class="infraLabelObrigatorio"> | ||
844 | + <img src="/infra_js/infra_gerar_captcha.php?codetorandom='.$strCodigoParaGeracaoCaptcha.'" alt="Não foi possível carregar imagem de confirmação" /> </label> | ||
845 | + <input type="text" id="txtCaptcha" name="txtCaptcha" class="infraText" maxlength="4" value="" /> | ||
846 | + <button id="btnEnviarCaptcha" type="submit" accesskey="G" name="btnEnviarCaptcha" value="Enviar" onclick="gerarPdf();" class="infraButton"><span class="infraTeclaAtalho">E</span>nviar</button> | ||
847 | + </div> | ||
848 | + | ||
849 | + </div> | ||
850 | + </div> | ||
851 | + '; | ||
852 | + | ||
853 | +} | ||
854 | +PaginaSEIExterna::getInstance()->montarBarraComandosSuperior($arrComandos); | ||
855 | +echo $strResultadoCabecalho; | ||
856 | +echo $strMensagemProcessoRestrito; | ||
857 | +PaginaSEIExterna::getInstance()->montarAreaTabela($strResultado,$numProtocolos); | ||
858 | +echo $strResultadoAndamentos; | ||
859 | +?> | ||
860 | +<input type="hidden" id="hdnFlagGerar" name="hdnFlagGerar" value="0" /> | ||
861 | + <?if($bolCaptchaGerarPdf) { ?> | ||
862 | + <input type="hidden" id="hdnCaptchaMd5" name="hdnCaptchaMd5" class="infraText" value="<?=md5(InfraCaptcha::gerar($strCodigoParaGeracaoCaptcha));?>" /> | ||
863 | + <?} ?> | ||
864 | +</form> | ||
865 | +<? | ||
866 | +PaginaSEIExterna::getInstance()->montarAreaDebug(); | ||
867 | +PaginaSEIExterna::getInstance()->fecharBody(); | ||
868 | +PaginaSEIExterna::getInstance()->fecharHtml(); | ||
869 | +?> | ||
0 | \ No newline at end of file | 870 | \ No newline at end of file |
1 | +++ a/sei/institucional/pesquisa/processo_pesquisar.php | ||
@@ -0,0 +1,861 @@ | @@ -0,0 +1,861 @@ | ||
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 ("ConverteURI.php"); | ||
35 | + | ||
36 | + session_start(); | ||
37 | + | ||
38 | + InfraDebug::getInstance()->setBolLigado(false); | ||
39 | + InfraDebug::getInstance()->setBolDebugInfra(false); | ||
40 | + InfraDebug::getInstance()->limpar(); | ||
41 | + | ||
42 | + $bolBanco = false; | ||
43 | + $bolFTS = false; | ||
44 | + $bolSolr = false; | ||
45 | + $bolLegado = false; | ||
46 | + $bolCaptcha = false; | ||
47 | + $bolAutocompletarInterressado = ConfiguracaoPesquisa::getInstance()->getValor('Pesquisa','AutoCompletarInteressado'); | ||
48 | + | ||
49 | + if (ConfiguracaoSEI::getInstance()->getValor('Pesquisa','Banco')){ | ||
50 | + $bolBanco = true; | ||
51 | + if (ConfiguracaoSEI::getInstance()->getValor('Pesquisa','SqlServerFullTextSearch')){ | ||
52 | + $bolFTS = true; | ||
53 | + } | ||
54 | + }else if (ConfiguracaoSEI::getInstance()->getValor('Pesquisa','Solr')){ | ||
55 | + $bolSolr = true; | ||
56 | + require_once dirname(__FILE__).'/BuscaProtocoloExterno.php'; | ||
57 | + } | ||
58 | + | ||
59 | + if (ConfiguracaoPesquisa::getInstance()->getValor('Pesquisa','Legado')){ | ||
60 | + $bolLegado = true; | ||
61 | + } | ||
62 | + | ||
63 | + if (ConfiguracaoPesquisa::getInstance()->getValor('Pesquisa','Captcha')){ | ||
64 | + $bolCaptcha = true; | ||
65 | + } | ||
66 | + | ||
67 | + SessaoSEIExterna::getInstance()->validarLink(); | ||
68 | + | ||
69 | + PaginaSEIExterna::getInstance()->setBolXHTML(false); | ||
70 | + | ||
71 | + if($bolCaptcha) { | ||
72 | + $strCodigoParaGeracaoCaptcha = InfraCaptcha::obterCodigo(); | ||
73 | + $md5Captcha = md5(InfraCaptcha::gerar($strCodigoParaGeracaoCaptcha)); | ||
74 | + }else { | ||
75 | + $md5Captcha = null; | ||
76 | + } | ||
77 | + if (isset($_POST['hdnFlagPesquisa']) || isset($_POST['sbmLimpar'])){ | ||
78 | + | ||
79 | + if(isset($_POST['sbmLimpar'])){ | ||
80 | + | ||
81 | + PaginaSEIExterna::getInstance()->limparCampos(); | ||
82 | + PaginaSEIExterna::getInstance()->salvarCampo('rdoData', ''); | ||
83 | + PaginaSEIExterna::getInstance()->salvarCampo('chkSinProcessos', 'P'); | ||
84 | + | ||
85 | + | ||
86 | + }else{ | ||
87 | + | ||
88 | + PaginaSEIExterna::getInstance()->salvarCampo('chkSinProcessos', $_POST['chkSinProcessos']); | ||
89 | + PaginaSEIExterna::getInstance()->salvarCampo('chkSinDocumentosGerados', $_POST['chkSinDocumentosGerados']); | ||
90 | + PaginaSEIExterna::getInstance()->salvarCampo('chkSinDocumentosRecebidos', $_POST['chkSinDocumentosRecebidos']); | ||
91 | + | ||
92 | + PaginaSEIExterna::getInstance()->salvarCamposPost(array('q', | ||
93 | + 'txtParticipante', | ||
94 | + 'hdnIdParticipante', | ||
95 | + 'txtAssinante', | ||
96 | + 'hdnIdAssinante', | ||
97 | + 'txtDescricaoPesquisa', | ||
98 | + 'txtObservacaoPesquisa', | ||
99 | + 'txtAssunto', | ||
100 | + 'hdnIdAssunto', | ||
101 | + 'txtUnidade', | ||
102 | + 'hdnIdUnidade', | ||
103 | + 'txtProtocoloPesquisa', | ||
104 | + 'selTipoProcedimentoPesquisa', | ||
105 | + 'selSeriePesquisa', | ||
106 | + 'txtNumeroDocumentoPesquisa', | ||
107 | + 'rdoData', | ||
108 | + 'txtDataInicio', | ||
109 | + 'txtDataFim', | ||
110 | + 'hdnSiglasUsuarios', | ||
111 | + 'txtSiglaUsuario1', | ||
112 | + 'txtSiglaUsuario2', | ||
113 | + 'txtSiglaUsuario3', | ||
114 | + 'txtSiglaUsuario4' | ||
115 | + )); | ||
116 | + | ||
117 | + } | ||
118 | + | ||
119 | + | ||
120 | + }else{ | ||
121 | + | ||
122 | + PaginaSEIExterna::getInstance()->salvarCampo('q', ''); | ||
123 | + PaginaSEIExterna::getInstance()->salvarCampo('txtProtocoloPesquisa', $strProtocoloFormatadoLimpo); | ||
124 | + PaginaSEIExterna::getInstance()->salvarCampo('chkSinProcessos', 'P'); | ||
125 | + PaginaSEIExterna::getInstance()->salvarCampo('chkSinDocumentosGerados', ''); | ||
126 | + PaginaSEIExterna::getInstance()->salvarCampo('chkSinDocumentosRecebidos', ''); | ||
127 | + PaginaSEIExterna::getInstance()->salvarCampo('txtParticipante', ''); | ||
128 | + PaginaSEIExterna::getInstance()->salvarCampo('hdnIdParticipante', ''); | ||
129 | + PaginaSEIExterna::getInstance()->salvarCampo('txtAssinante', ''); | ||
130 | + PaginaSEIExterna::getInstance()->salvarCampo('hdnIdAssinante', ''); | ||
131 | + PaginaSEIExterna::getInstance()->salvarCampo('txtDescricaoPesquisa', ''); | ||
132 | + PaginaSEIExterna::getInstance()->salvarCampo('txtObservacaoPesquisa', ''); | ||
133 | + PaginaSEIExterna::getInstance()->salvarCampo('txtAssunto', ''); | ||
134 | + PaginaSEIExterna::getInstance()->salvarCampo('hdnIdAssunto', ''); | ||
135 | + PaginaSEIExterna::getInstance()->salvarCampo('txtUnidade', ''); | ||
136 | + PaginaSEIExterna::getInstance()->salvarCampo('hdnIdUnidade', ''); | ||
137 | + //PaginaSEIExterna::getInstance()->salvarCampo('txtProtocoloPesquisa', ''); | ||
138 | + PaginaSEIExterna::getInstance()->salvarCampo('selTipoProcedimentoPesquisa', ''); | ||
139 | + PaginaSEIExterna::getInstance()->salvarCampo('selSeriePesquisa', ''); | ||
140 | + PaginaSEIExterna::getInstance()->salvarCampo('txtNumeroDocumentoPesquisa', ''); | ||
141 | + PaginaSEIExterna::getInstance()->salvarCampo('rdoData', ''); | ||
142 | + PaginaSEIExterna::getInstance()->salvarCampo('txtDataInicio', ''); | ||
143 | + PaginaSEIExterna::getInstance()->salvarCampo('txtDataFim', ''); | ||
144 | + PaginaSEIExterna::getInstance()->salvarCampo('txtSiglaUsuario1', ''); | ||
145 | + PaginaSEIExterna::getInstance()->salvarCampo('txtSiglaUsuario2', ''); | ||
146 | + PaginaSEIExterna::getInstance()->salvarCampo('txtSiglaUsuario3', ''); | ||
147 | + PaginaSEIExterna::getInstance()->salvarCampo('txtSiglaUsuario4', ''); | ||
148 | + PaginaSEIExterna::getInstance()->salvarCampo('hdnSiglasUsuarios', ''); | ||
149 | + } | ||
150 | + | ||
151 | + | ||
152 | + switch($_GET['acao_externa']){ | ||
153 | + | ||
154 | + case 'protocolo_pesquisar': | ||
155 | + case 'protocolo_pesquisa_rapida': | ||
156 | + | ||
157 | + | ||
158 | + $strTitulo = 'Pesquisa Pública'; | ||
159 | + | ||
160 | + | ||
161 | + // Altero os caracteres 'Coringas' por aspas Duplas para não dar erro de Js no IE | ||
162 | + $strPalavrasPesquisa = str_replace("$*",'\"',PaginaSEIExterna::getInstance()->recuperarCampo('q')); | ||
163 | + $strSinProcessos = PaginaSEIExterna::getInstance()->recuperarCampo('chkSinProcessos'); | ||
164 | + $strSinDocumentosGerados = PaginaSEIExterna::getInstance()->recuperarCampo('chkSinDocumentosGerados'); | ||
165 | + $strSinDocumentosRecebidos = PaginaSEIExterna::getInstance()->recuperarCampo('chkSinDocumentosRecebidos'); | ||
166 | + $strIdParticipante = PaginaSEIExterna::getInstance()->recuperarCampo('hdnIdParticipante'); | ||
167 | + $strNomeParticipante = PaginaSEIExterna::getInstance()->recuperarCampo('txtParticipante'); | ||
168 | + $strIdAssinante = PaginaSEIExterna::getInstance()->recuperarCampo('hdnIdAssinante'); | ||
169 | + $strNomeAssinante = PaginaSEIExterna::getInstance()->recuperarCampo('txtAssinante'); | ||
170 | + $strDescricaoPesquisa = PaginaSEIExterna::getInstance()->recuperarCampo('txtDescricaoPesquisa'); | ||
171 | + $strObservacaoPesquisa = PaginaSEIExterna::getInstance()->recuperarCampo('txtObservacaoPesquisa'); | ||
172 | + $strIdAssunto = PaginaSEIExterna::getInstance()->recuperarCampo('hdnIdAssunto'); | ||
173 | + $strDescricaoAssunto = PaginaSEIExterna::getInstance()->recuperarCampo('txtAssunto'); | ||
174 | + $strIdUnidade = PaginaSEIExterna::getInstance()->recuperarCampo('hdnIdUnidade'); | ||
175 | + $strDescricaoUnidade = PaginaSEIExterna::getInstance()->recuperarCampo('txtUnidade'); | ||
176 | + $strProtocoloPesquisa = PaginaSEIExterna::getInstance()->recuperarCampo('txtProtocoloPesquisa'); | ||
177 | + $numIdTipoProcedimento = PaginaSEIExterna::getInstance()->recuperarCampo('selTipoProcedimentoPesquisa','null'); | ||
178 | + $numIdSerie = PaginaSEIExterna::getInstance()->recuperarCampo('selSeriePesquisa','null'); | ||
179 | + $strNumeroDocumentoPesquisa = PaginaSEIExterna::getInstance()->recuperarCampo('txtNumeroDocumentoPesquisa'); | ||
180 | + $strStaData = PaginaSEIExterna::getInstance()->recuperarCampo('rdoData','0'); | ||
181 | + $strDataInicio = PaginaSEIExterna::getInstance()->recuperarCampo('txtDataInicio'); | ||
182 | + $strDataFim = PaginaSEIExterna::getInstance()->recuperarCampo('txtDataFim'); | ||
183 | + $strSiglaUsuario1 = PaginaSEIExterna::getInstance()->recuperarCampo('txtSiglaUsuario1'); | ||
184 | + $strSiglaUsuario2 = PaginaSEIExterna::getInstance()->recuperarCampo('txtSiglaUsuario2'); | ||
185 | + $strSiglaUsuario3 = PaginaSEIExterna::getInstance()->recuperarCampo('txtSiglaUsuario3'); | ||
186 | + $strSiglaUsuario4 = PaginaSEIExterna::getInstance()->recuperarCampo('txtSiglaUsuario4'); | ||
187 | + $strUsuarios = PaginaSEIExterna::getInstance()->recuperarCampo('hdnSiglasUsuarios'); | ||
188 | + $strParticipanteSolr = ''; | ||
189 | + | ||
190 | + //Opção de Auto Completar Interressado | ||
191 | + if(!$bolAutocompletarInterressado){ | ||
192 | + | ||
193 | + if(!InfraString::isBolVazia($strNomeParticipante)){ | ||
194 | + $strParticipanteSolr = PesquisaUtil::buscaParticipantes($strNomeParticipante); | ||
195 | + } | ||
196 | + | ||
197 | + } | ||
198 | + | ||
199 | + | ||
200 | + | ||
201 | + $strDisplayAvancado = 'block'; | ||
202 | + $bolPreencheuAvancado = false; | ||
203 | + if (($strSinProcessos=='P' || $strSinDocumentosGerados=='G' || $strSinDocumentosRecebidos=='R') && | ||
204 | + !InfraString::isBolVazia($strIdParticipante) || | ||
205 | + !InfraString::isBolVazia($strParticipanteSolr) || | ||
206 | + !InfraString::isBolVazia($strIdAssinante) || | ||
207 | + !InfraString::isBolVazia($strDescricaoPesquisa) || | ||
208 | + !InfraString::isBolVazia($strObservacaoPesquisa) || | ||
209 | + !InfraString::isBolVazia($strIdAssunto) || | ||
210 | + !InfraString::isBolVazia($strIdUnidade) || | ||
211 | + !InfraString::isBolVazia($strProtocoloPesquisa) || | ||
212 | + !InfraString::isBolVazia($numIdTipoProcedimento) || | ||
213 | + !InfraString::isBolVazia($numIdSerie) || | ||
214 | + !InfraString::isBolVazia($strNumeroDocumentoPesquisa) || | ||
215 | + !InfraString::isBolVazia($strDataInicio) || | ||
216 | + !InfraString::isBolVazia($strDataFim) || | ||
217 | + !InfraString::isBolVazia(str_replace(',','',$strUsuarios))){ | ||
218 | + | ||
219 | + //$strDisplayAvancado = 'none'; | ||
220 | + $bolPreencheuAvancado = true; | ||
221 | + } | ||
222 | + | ||
223 | + $q = PaginaSEIExterna::getInstance()->recuperarCampo('q'); | ||
224 | + | ||
225 | + $inicio = intval($_REQUEST["inicio"]); | ||
226 | + | ||
227 | + $strResultado = ''; | ||
228 | + | ||
229 | + if (isset($_POST['sbmPesquisar']) || ($_GET['acao_origem_externa'] == "protocolo_pesquisar_paginado")){ | ||
230 | + | ||
231 | + if(md5($_POST['txtCaptcha']) != $_POST['hdnCaptchaMd5'] && $_GET['hash'] != $_POST['hdnCaptchaMd5'] && $bolCaptcha == true){ | ||
232 | + PaginaSEIExterna::getInstance()->setStrMensagem('Código de confirmação inválido.'); | ||
233 | + }else{ | ||
234 | + //preencheu palavra de busca ou alguma opção avançada | ||
235 | + if (!InfraString::isBolVazia($q) || $bolPreencheuAvancado) { | ||
236 | + | ||
237 | + if ($bolSolr){ | ||
238 | + try{ | ||
239 | + $strResultado = BuscaProtocoloExterno::executar($q, $strDescricaoPesquisa, $strObservacaoPesquisa, $inicio, 100, $strParticipanteSolr,$md5Captcha); | ||
240 | + }catch(Exception $e){ | ||
241 | + LogSEI::getInstance()->gravar(InfraException::inspecionar($e)); | ||
242 | + throw new InfraException('Erro realizando pesquisa.',$e); | ||
243 | + } | ||
244 | + }else if ($bolBanco){ | ||
245 | + $objIndexacaoProtocoloDTO = new IndexacaoProtocoloDTO(); | ||
246 | + $objIndexacaoProtocoloDTO->setStrIdxConteudo($strPalavrasPesquisa); | ||
247 | + $objIndexacaoProtocoloDTO->setStrSinProcessos($strSinProcessos); | ||
248 | + $objIndexacaoProtocoloDTO->setStrSinDocumentosGerados($strSinDocumentosGerados); | ||
249 | + $objIndexacaoProtocoloDTO->setStrSinDocumentosRecebidos($strSinDocumentosRecebidos); | ||
250 | + $objIndexacaoProtocoloDTO->setStrIdxParticipante($strIdParticipante); | ||
251 | + $objIndexacaoProtocoloDTO->setStrIdxAssinante($strIdAssinante); | ||
252 | + $objIndexacaoProtocoloDTO->setStrIdxDescricao($strDescricaoPesquisa); | ||
253 | + $objIndexacaoProtocoloDTO->setStrIdxObservacao($strObservacaoPesquisa); | ||
254 | + $objIndexacaoProtocoloDTO->setStrIdxAssunto($strIdAssunto); | ||
255 | + $objIndexacaoProtocoloDTO->setNumIdUnidadeGeradora($strIdUnidade); | ||
256 | + $objIndexacaoProtocoloDTO->setStrProtocoloFormatadoPesquisa(InfraUtil::retirarFormatacao($strProtocoloPesquisa)); | ||
257 | + $objIndexacaoProtocoloDTO->setNumIdTipoProcedimento($numIdTipoProcedimento); | ||
258 | + $objIndexacaoProtocoloDTO->setNumIdSerie($numIdSerie); | ||
259 | + $objIndexacaoProtocoloDTO->setStrNumero($strNumeroDocumentoPesquisa); | ||
260 | + $objIndexacaoProtocoloDTO->setStrStaTipoData($strStaData); | ||
261 | + $objIndexacaoProtocoloDTO->setDtaInicio($strDataInicio); | ||
262 | + $objIndexacaoProtocoloDTO->setDtaFim($strDataFim); | ||
263 | + $objIndexacaoProtocoloDTO->setStrSiglaUsuarioGerador($strUsuarios); | ||
264 | + | ||
265 | + PaginaSEIExterna::getInstance()->prepararPaginacao($objIndexacaoProtocoloDTO); | ||
266 | + | ||
267 | + $objIndexacaoProtocoloRN = new IndexacaoProtocoloRN(); | ||
268 | + $arrObjIndexacaoProtocoloDTO = $objIndexacaoProtocoloRN->pesquisar($objIndexacaoProtocoloDTO); | ||
269 | + | ||
270 | + PaginaSEIExterna::getInstance()->processarPaginacao($objIndexacaoProtocoloDTO); | ||
271 | + | ||
272 | + //////////////////////////////////////// | ||
273 | + $numRegistros = count($arrObjIndexacaoProtocoloDTO); | ||
274 | + | ||
275 | + if ($numRegistros){ | ||
276 | + | ||
277 | + $bolHttps = ConfiguracaoSEI::getInstance()->getValor('SessaoSEIExterna','https'); | ||
278 | + | ||
279 | + $strSumarioTabela = 'Tabela de Resultados.'; | ||
280 | + $strCaptionTabela = 'Resultados'; | ||
281 | + | ||
282 | + $strResultado = ''; | ||
283 | + $strResultado .= '<table id="tblResultado" width="99%" class="infraTable">'."\n"; | ||
284 | + $strResultado .= '<caption class="infraCaption">'.PaginaSEIExterna::getInstance()->gerarCaptionTabela($strCaptionTabela,$numRegistros).'</caption>'; | ||
285 | + $strResultado .= '<th>Resultado de pesquisa sistema SEI CADE</th>'; | ||
286 | + for($i = 0;$i < $numRegistros; $i++){ | ||
287 | + $strResultado .= '<tr class="infraTrEscura">'; | ||
288 | + $strResultado .= '<td colspan="2">'."\n"; | ||
289 | + | ||
290 | + $strLinkArvore = $arrObjIndexacaoProtocoloDTO[$i]->getStrLinkArvore(); | ||
291 | + | ||
292 | + if ($bolHttps){ | ||
293 | + $strLinkArvore = str_replace('http://','https://',$strLinkArvore); | ||
294 | + } | ||
295 | + | ||
296 | + $strResultado .= '<a href="'.PaginaSEIExterna::getInstance()->formatarXHTML(SessaoSEIExterna::getInstance()->assinarLink($strLinkArvore)).'" 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> '; | ||
297 | + $strResultado .= $arrObjIndexacaoProtocoloDTO[$i]->getStrNomeTipoProcedimento().' Nº '.$arrObjIndexacaoProtocoloDTO[$i]->getStrProtocoloProcessoFormatado(); | ||
298 | + | ||
299 | + if ($arrObjIndexacaoProtocoloDTO[$i]->getStrStaProtocolo()!=ProtocoloRN::$TP_PROCEDIMENTO){ | ||
300 | + | ||
301 | + $strLinkDocumento = $arrObjIndexacaoProtocoloDTO[$i]->getStrUrl(); | ||
302 | + | ||
303 | + if ($bolHttps){ | ||
304 | + $strLinkDocumento = str_replace('http://','https://',$strLinkDocumento); | ||
305 | + } | ||
306 | + | ||
307 | + $strResultado .= ' (<a target="_blank" href="'.PaginaSEIExterna::getInstance()->formatarXHTML(SessaoSEIExterna::getInstance()->assinarLink($strLinkDocumento)).'" '; | ||
308 | + | ||
309 | + if (strpos($arrObjIndexacaoProtocoloDTO[$i]->getStrIdxUnidadeAberto(),';'.SessaoSEIExterna::getInstance()->getNumIdUnidadeAtual().';')!==false) { | ||
310 | + $strResultado .= " title=\"Aberto nesta unidade\" class=\"protocoloAberto\""; | ||
311 | + } else { | ||
312 | + $strResultado .= " title=\"Fechado nesta unidade\" class=\"protocoloNormal\""; | ||
313 | + } | ||
314 | + | ||
315 | + $strResultado .= ' style="font-size:1em !important;">'.$arrObjIndexacaoProtocoloDTO[$i]->getStrIdentificacaoProtocolo().'</a>)'; | ||
316 | + } | ||
317 | + $strResultado .= '</td>'; | ||
318 | + $strResultado .= '<td align="right">'.$arrObjIndexacaoProtocoloDTO[$i]->getStrProtocoloDocumentoFormatado().'</td>'; | ||
319 | + $strResultado .= '</tr>'."\n"; | ||
320 | + | ||
321 | + $strResultado .= '<tr class="infraTrClara">'; | ||
322 | + $strResultado .= '<td align="center" width="33%">Unidade Geradora: <a alt="'.$arrObjIndexacaoProtocoloDTO[$i]->getStrDescricaoUnidadeGeradora().'" title="'.$arrObjIndexacaoProtocoloDTO[$i]->getStrDescricaoUnidadeGeradora().'" class="ancoraSigla">'.$arrObjIndexacaoProtocoloDTO[$i]->getStrSiglaUnidadeGeradora().'</a></td>'; | ||
323 | + $strResultado .= '<td align="center" width="33%">Data: '.$arrObjIndexacaoProtocoloDTO[$i]->getDtaGeracao().'</td>'; | ||
324 | + $strResultado .= '<td align="center" width="33%"></td>'; | ||
325 | + $strResultado .= "</tr>"; | ||
326 | + | ||
327 | + } | ||
328 | + | ||
329 | + $strResultado .= '</table>'; | ||
330 | + } | ||
331 | + | ||
332 | + } | ||
333 | + | ||
334 | + } | ||
335 | + | ||
336 | + // Verifica se a opção de pesquisa em sistemas (ConfiguracaoPesquisa.php) está habilitada. | ||
337 | + if($bolLegado){ | ||
338 | + | ||
339 | + //PESQUISA PROCESSUAL SISCADE E INTRANET | ||
340 | + if (!InfraString::isBolVazia($strProtocoloPesquisa) || !InfraString::isBolVazia($strNomeParticipante)){ | ||
341 | + | ||
342 | + if(!isset($_GET['local_pesquisa']) || !isset($_GET['num_pagina']) || !isset($_GET['inicio_cade'])){ | ||
343 | + | ||
344 | + | ||
345 | + $strResultadoSISCADE = PesquisaSISCADE::executar($strProtocoloPesquisa,$strNomeParticipante,$md5Captcha); | ||
346 | + $strResultadoIntranet = PesquisaCADE::executar($strProtocoloPesquisa,$strNomeParticipante,$md5Captcha); | ||
347 | + | ||
348 | + | ||
349 | + }else{ | ||
350 | + $numPagina = $_GET['num_pagina']; | ||
351 | + $inicio = $_GET['inicio_cade']; | ||
352 | + $localPesquisa = $_GET['local_pesquisa']; | ||
353 | + | ||
354 | + switch ($localPesquisa) { | ||
355 | + case 'siscade': | ||
356 | + $strResultadoIntranet = PesquisaCADE::executar($strProtocoloPesquisa,$strNomeParticipante,$md5Captcha); | ||
357 | + $strResultadoSISCADE = PesquisaSISCADE::executar($strProtocoloPesquisa,$strNomeParticipante,$md5Captcha,$inicio,$numPagina); | ||
358 | + break; | ||
359 | + case 'intranet': | ||
360 | + $strResultadoIntranet = PesquisaCADE::executar($strProtocoloPesquisa,$strNomeParticipante,$md5Captcha,$inicio,$numPagina); | ||
361 | + $strResultadoSISCADE = PesquisaSISCADE::executar($strProtocoloPesquisa,$strNomeParticipante,$md5Captcha); | ||
362 | + } | ||
363 | + | ||
364 | + } | ||
365 | + | ||
366 | + | ||
367 | + | ||
368 | + | ||
369 | + } | ||
370 | + } | ||
371 | + //Exibe resultado de não encontrado apenas se em nenhuma pesquisa houve resultado | ||
372 | + | ||
373 | + if(strpos($strResultado, 'sem-resultado')){ | ||
374 | + | ||
375 | + if(!empty($strResultadoSISCADE) || !empty($strResultadoIntranet) ){ | ||
376 | + $strResultado = ''; | ||
377 | + } | ||
378 | + } | ||
379 | + | ||
380 | + | ||
381 | + } | ||
382 | + | ||
383 | + | ||
384 | + } | ||
385 | + | ||
386 | + | ||
387 | + | ||
388 | + break; | ||
389 | + | ||
390 | + default: | ||
391 | + throw new InfraException("Ação '".$_GET['acao']."' não reconhecida."); | ||
392 | + } | ||
393 | + | ||
394 | + $strItensSelTipoProcedimento = TipoProcedimentoINT::montarSelectNome('null',' ',$numIdTipoProcedimento); | ||
395 | + $strItensSelSerie = SerieINT::montarSelectNomeRI0802('null',' ',$numIdSerie); | ||
396 | + | ||
397 | + $strLinkAjaxContatos = SessaoSEIExterna::getInstance()->assinarLink('controlador_ajax_externo.php?acao_ajax_externo=contato_auto_completar_contexto_pesquisa&id_orgao_acesso_externo=0'); | ||
398 | + $strLinkAjaxUsuarios = SessaoSEIExterna::getInstance()->assinarLink('controlador_ajax.php?acao_ajax=usuario_auto_completar'); | ||
399 | + $strLinkAjaxAssuntoRI1223 = SessaoSEIExterna::getInstance()->assinarLink('controlador_ajax.php?acao_ajax=assunto_auto_completar_RI1223'); | ||
400 | + $strLinkAjaxUnidade = SessaoSEIExterna::getInstance()->assinarLink('controlador_ajax_externo.php?acao_ajax_externo=unidade_auto_completar_todas&id_orgao_acesso_externo=0'); | ||
401 | + | ||
402 | + | ||
403 | + if ($strStaData=='0'){ | ||
404 | + $strDisplayPeriodoExplicito = $strDisplayAvancado; | ||
405 | + }else{ | ||
406 | + $strDisplayPeriodoExplicito = 'none'; | ||
407 | + } | ||
408 | + | ||
409 | + $strLinkAjuda = ''; | ||
410 | + if ($bolFTS){ | ||
411 | + $strLinkAjuda = PaginaSEIExterna::getInstance()->formatarXHTML(SessaoSEIExterna::getInstance()->assinarLink('ajuda_exibir_externo.php?acao_externa=pesquisa_fts_ajuda_externa&id_orgao_acesso_externo=0')); | ||
412 | + }else if ($bolSolr){ | ||
413 | + $strLinkAjuda = PaginaSEIExterna::getInstance()->formatarXHTML(SessaoSEIExterna::getInstance()->assinarLink('ajuda_exibir_externo.php?acao_externa=pesquisa_solr_ajuda_externa&id_orgao_acesso_externo=0')); | ||
414 | + } | ||
415 | + | ||
416 | +}catch(Exception $e){ | ||
417 | + PaginaSEIExterna::getInstance()->processarExcecao($e); | ||
418 | +} | ||
419 | +PaginaSEIExterna::getInstance()->montarDocType(); | ||
420 | +PaginaSEIExterna::getInstance()->abrirHtml(); | ||
421 | +PaginaSEIExterna::getInstance()->abrirHead(); | ||
422 | +PaginaSEIExterna::getInstance()->montarMeta(); | ||
423 | +PaginaSEIExterna::getInstance()->montarTitle(':: '.PaginaSEIExterna::getInstance()->getStrNomeSistema().' - '.$strTitulo.' ::'); | ||
424 | +PaginaSEIExterna::getInstance()->montarStyle(); | ||
425 | +PaginaSEIExterna::getInstance()->abrirStyle(); | ||
426 | +?> | ||
427 | + | ||
428 | +#lblPalavrasPesquisa{position:absolute;left:0%;top:4%;width:20%;} | ||
429 | +#q{position:absolute;left:21%;top:1%;width:60%;} | ||
430 | +#ancAjuda{position:absolute;left:82%;top:%;visibility:<?= ($bolFTS || $bolSolr) ? 'visible' : 'hidden'?>} | ||
431 | +#sbmPesquisar {position:absolute;left:86%;top:5%; width:10%;} | ||
432 | +#lnkAvancado {position:absolute;left:96%;top:5%;display:none;} | ||
433 | + | ||
434 | +#lblPesquisarEm {position:absolute;left:0%;top:17%;width:20%;} | ||
435 | +#divSinProcessos {position:absolute;left:21%;top:15%;} | ||
436 | +#divSinDocumentosGerados {position:absolute;left:38%;top:15%;} | ||
437 | +#divSinDocumentosRecebidos {position:absolute;left:61%;top:15%;} | ||
438 | + | ||
439 | +#lblParticipante {position:absolute;left:0%;top:28%;width:20%;} | ||
440 | +#txtParticipante {position:absolute;left:21%;top:27%;width:60%;} | ||
441 | + | ||
442 | + | ||
443 | + | ||
444 | +#lblUnidade {position:absolute;left:0%;top:40%;width:20%;} | ||
445 | +#txtUnidade{position:absolute;left:21%;top:39%;width:60%;} | ||
446 | +#lblProtocoloPesquisa{position:absolute;left:0%;top:50%;width:20%;} | ||
447 | +#txtProtocoloPesquisa{position:absolute;left:21%;top:35%;width:20%;} | ||
448 | +#lblProtocoloPesquisaComplemento {position:absolute;left:42%;top:14%;width:25%;} | ||
449 | +#lblAssinante {position:absolute;left:0%;top:18%;width:20%;} | ||
450 | +#txtAssinante {position:absolute;left:21%;top:17%;width:60%;} | ||
451 | +#lblDescricaoPesquisa {position:absolute;left:0%;top:26%;width:20%;} | ||
452 | +#txtDescricaoPesquisa {position:absolute;left:21%;top:25%;width:60%;} | ||
453 | +#ancAjudaDescricao{position:absolute;left:82%;top:25%;visibility:<?= ($bolFTS || $bolSolr) ? 'visible' : 'hidden'?>} | ||
454 | +#lblObservacaoPesquisa {position:absolute;left:0%;top:34%;width:20%;} | ||
455 | +#txtObservacaoPesquisa {position:absolute;left:21%;top:33%;width:60%;} | ||
456 | +#ancAjudaObservacao {position:absolute;left:82%;top:33%;visibility:<?= ($bolFTS || $bolSolr) ? 'visible' : 'hidden'?>} | ||
457 | +#lblAssunto {position:absolute;left:0%;top:42%;width:20%;} | ||
458 | +#txtAssunto {position:absolute;left:21%;top:41%;width:60%;} | ||
459 | +#imgPesquisarAssuntos {position:absolute;top:41%;left:82%;} | ||
460 | +#lblTipoProcedimentoPesquisa {position:absolute;left:0%;top:52%;width:20%;} | ||
461 | +#selTipoProcedimentoPesquisa {position:absolute;left:21%;top:51%;width:60.5%;} | ||
462 | +#lblSeriePesquisa {position:absolute;left:0%;top:64%;width:20%;} | ||
463 | +#selSeriePesquisa {position:absolute;left:21%;top:63%;width:60.5%;} | ||
464 | + | ||
465 | +#lblNumeroDocumentoPesquisa | ||
466 | +{position:absolute;left:0%;top:76%;width:20%;} | ||
467 | +#txtNumeroDocumentoPesquisa | ||
468 | +{position:absolute;left:21%;top:75%;width:20%;} #lblData | ||
469 | +{position:absolute;left:0%;top:76%;width:20%;} #divOptPeriodoExplicito | ||
470 | +{position:absolute;left:21%;top:75%;} #divOptPeriodo30 | ||
471 | +{position:absolute;left:40%;top:75%;} #divOptPeriodo60 | ||
472 | +{position:absolute;left:55%;top:75%;} #txtDataInicio | ||
473 | +{position:absolute;left:21%;top:0%;width:9%;} #imgDataInicio | ||
474 | +{position:absolute;left:31%;top:10%;} #lblDataE | ||
475 | +{position:absolute;left:33%;top:10%;width:1%;} #txtDataFim | ||
476 | +{position:absolute;left:35%;top:0%;width:9%;} #imgDataFim | ||
477 | +{position:absolute;left:45%;top:10%;} #lblSiglaUsuario | ||
478 | +{position:absolute;left:0%;top:0%;width:20%;} #txtSiglaUsuario1 | ||
479 | +{position:absolute;left:21%;top:0%;width:9%;} #txtSiglaUsuario2 | ||
480 | +{position:absolute;left:31%;top:0%;width:9%;} #txtSiglaUsuario3 | ||
481 | +{position:absolute;left:41%;top:0%;width:9%;} #txtSiglaUsuario4 | ||
482 | +{position:absolute;left:51%;top:0%;width:9%;} | ||
483 | + | ||
484 | +#divAvancado {display: <?=$strDisplayAvancado?>;} | ||
485 | +#divPeriodoExplicito {display:<?=$strDisplayPeriodoExplicito?>;} | ||
486 | +#divUsuario {display:<?=$strDisplayAvancado?>;} | ||
487 | +#lnkAvancado{ border-bottom: 1px solid transparent; color: #0000b0;text-decoration: none; } | ||
488 | +.sugestao{ font-size: 1.2em; } | ||
489 | +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; } | ||
490 | +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; } | ||
491 | +div#conteudo > div.sem-resultado { font-size:1.2em; margin: .5em 0 0 0; } | ||
492 | +div#conteudo table { border-collapse: collapse; border-spacing: 0px; } | ||
493 | +div#conteudo > table { margin: 0 0 .5em; width: 100%; } | ||
494 | +table.resultado td {background: #f0f0f0; padding: .3em .5em; } | ||
495 | +div#conteudo > table > tbody > tr:first-child > td { background: #e0e0e0; } | ||
496 | +tr.resTituloRegistro td {background: #e0e0e0; } | ||
497 | +div#conteudo a.protocoloAberto, div#conteudo a.protocoloNormal{ font-size:1.1em !important; } | ||
498 | +div#conteudo a.protocoloAberto:hover, div#conteudo a.protocoloNormal:hover{text-decoration:underline !important; } | ||
499 | +div#conteudo td.metatag > table{ border-collapse: collapse; margin: 0px auto; white-space: nowrap; } | ||
500 | + | ||
501 | +div#conteudo td.metatag > table { text-align: left; width:75%; } | ||
502 | + | ||
503 | +div#conteudo td.metatag > table > tbody > tr > td { color: #333333; font-size: .9em; padding: 0 2em; width:30%; } | ||
504 | +div#conteudo td.metatag > table > tbody > tr > td:first-child { width:45%; } | ||
505 | +div#conteudo td.metatag > table > tbody > tr > td > b { color: #006600; font-weight:normal; } | ||
506 | +span.pequeno { font-size: .9em; } | ||
507 | +div#mensagem { background:#e0e0e0; border-color: #c0c0c0; border-style: solid; border-width: .1em; margin: 4em auto 0; padding: 2em; } | ||
508 | +div#mensagem > span.pequeno { color:#909090; font-size: .9em; } | ||
509 | +td.resTituloEsquerda img.arvore { margin:0px 5px -3px 0px; } | ||
510 | +td.resTituloDireita { text-align:right; width:20%; } | ||
511 | + | ||
512 | +div.paginas, div.paginas * { font-size: 12px; } div.paginas b {font-weight: bold; } | ||
513 | +div.paginas a { border-bottom: 1px solid transparent; color: #000080; text-decoration: none; } | ||
514 | +div.paginas a:hover { border-bottom: 1px solid #000000; color: #800000; } | ||
515 | +td.resSnippet b { font-weight:bold; } | ||
516 | +#divInfraAreaTabela tr.infraTrClara td {padding:.3em;} | ||
517 | +#divInfraAreaTabela table.infraTable {border-spacing:0;} | ||
518 | + | ||
519 | +<? if($bolCaptcha) { ?> | ||
520 | +#sbmPesquisar {position:absolute;left:86%;top:42%;width:10%;font-size: 1.2em} | ||
521 | +#sbmLimpar {position:absolute;left:86%;top:52%; width:10%;font-size: 1.2em} | ||
522 | +#lblCodigo {position:absolute;left:86%;top:8%;width:10%;} | ||
523 | +#lblCaptcha {position:absolute;left:86%;top:0%;} | ||
524 | +#txtCaptcha{position:absolute;left:86%;top:18%;width:10%;height:18%;font-size:3em;} | ||
525 | +<?}else { ?> | ||
526 | +#sbmPesquisar {position:absolute;left:86%;top:10%;width:10%;font-size: 1.2em} | ||
527 | +#sbmLimpar {position:absolute;left:86%;top:70%; width:10%;font-size: 1.2em} | ||
528 | +<?} ?> | ||
529 | + | ||
530 | +<? | ||
531 | +PaginaSEIExterna::getInstance()->fecharStyle(); | ||
532 | + | ||
533 | +PaginaSEIExterna::getInstance()->montarJavaScript(); | ||
534 | +if ($bolSolr){ | ||
535 | + PaginaSEIExterna::getInstance()->adicionarJavaScript('../../solr/js/sistema.js'); | ||
536 | +} | ||
537 | +PaginaSEIExterna::getInstance()->abrirJavaScript(); | ||
538 | +?> | ||
539 | + | ||
540 | + | ||
541 | +var objAutoCompletarInteressadoRI1225 = null; | ||
542 | +var objAutoCompletarUsuario = null; | ||
543 | +var objAutoCompletarAssuntoRI1223 = null; | ||
544 | +var objAutoCompletarUnidade = null; | ||
545 | + | ||
546 | + | ||
547 | + | ||
548 | +function inicializar(){ | ||
549 | + | ||
550 | + | ||
551 | + infraOcultarMenuSistemaEsquema(); | ||
552 | + | ||
553 | + <?if($bolAutocompletarInterressado) {?> | ||
554 | + | ||
555 | + //Interessado/Remetente | ||
556 | + objAutoCompletarInteressadoRI1225 = new infraAjaxAutoCompletar('hdnIdParticipante','txtParticipante','<?=$strLinkAjaxContatos?>'); | ||
557 | + //objAutoCompletarInteressadoRI1225.maiusculas = true; | ||
558 | + //objAutoCompletarInteressadoRI1225.mostrarAviso = true; | ||
559 | + //objAutoCompletarInteressadoRI1225.tempoAviso = 1000; | ||
560 | + //objAutoCompletarInteressadoRI1225.tamanhoMinimo = 3; | ||
561 | + objAutoCompletarInteressadoRI1225.limparCampo = true; | ||
562 | + //objAutoCompletarInteressadoRI1225.bolExecucaoAutomatica = false; | ||
563 | + | ||
564 | + | ||
565 | + | ||
566 | + objAutoCompletarInteressadoRI1225.prepararExecucao = function(){ | ||
567 | + return 'palavras_pesquisa='+document.getElementById('txtParticipante').value; | ||
568 | + }; | ||
569 | + objAutoCompletarInteressadoRI1225.selecionar('<?=$strIdParticipante;?>','<?=PaginaSEI::getInstance()->formatarParametrosJavascript($strNomeParticipante)?>'); | ||
570 | + | ||
571 | + <?}?> | ||
572 | + | ||
573 | + //Unidades | ||
574 | + objAutoCompletarUnidade = new infraAjaxAutoCompletar('hdnIdUnidade','txtUnidade','<?=$strLinkAjaxUnidade?>'); | ||
575 | + | ||
576 | + | ||
577 | + objAutoCompletarUnidade.limparCampo = true; | ||
578 | + objAutoCompletarUnidade.prepararExecucao = function(){ | ||
579 | + return 'palavras_pesquisa='+document.getElementById('txtUnidade').value; | ||
580 | + }; | ||
581 | + objAutoCompletarUnidade.selecionar('<?=$strIdUnidade;?>','<?=PaginaSEIExterna::getInstance()->formatarParametrosJavascript($strDescricaoUnidade)?>'); | ||
582 | + | ||
583 | + document.getElementById('txtProtocoloPesquisa').focus(); | ||
584 | + | ||
585 | + | ||
586 | + //remover a string null dos combos | ||
587 | + document.getElementById('selTipoProcedimentoPesquisa').options[0].value=''; | ||
588 | + document.getElementById('selSeriePesquisa').options[0].value=''; | ||
589 | + | ||
590 | + infraProcessarResize(); | ||
591 | + | ||
592 | + | ||
593 | + <? if ($strLinkVisualizarSigilosoPublicado != ''){ ?> | ||
594 | + infraAbrirJanela('<?=$strLinkVisualizarSigilosoPublicado?>','janelaSigilosoPublicado',750,550,'location=0,status=1,resizable=1,scrollbars=1',false); | ||
595 | + <? } ?> | ||
596 | + | ||
597 | + <? if ($bolSolr){?> | ||
598 | + sistemaInicializar(); | ||
599 | + <? } ?> | ||
600 | + | ||
601 | + <?$localPesquisa = $_GET['local_pesquisa']; ?> | ||
602 | + <?if($localPesquisa == 'siscade' ) {?> | ||
603 | + location.hash="#Pesquisa_Siscade"; | ||
604 | + <? } ?> | ||
605 | + <?if($localPesquisa == 'intranet' ) {?> | ||
606 | + location.hash="#Pesquisa_Intranet"; | ||
607 | + <? } ?> | ||
608 | +} | ||
609 | + | ||
610 | + | ||
611 | +function tratarPeriodo(valor){ | ||
612 | + if (valor=='0'){ | ||
613 | + document.getElementById('divPeriodoExplicito').style.display='block'; | ||
614 | + document.getElementById('txtDataInicio').value=''; | ||
615 | + document.getElementById('txtDataFim').value=''; | ||
616 | + }else if (valor =='30'){ | ||
617 | + document.getElementById('divPeriodoExplicito').style.display='none'; | ||
618 | + document.getElementById('txtDataInicio').value='<?php echo ProtocoloINT::calcularDataInicial(30); ?>'; | ||
619 | + document.getElementById('txtDataFim').value='<?php echo date('d/m/Y'); ?>'; | ||
620 | + }else if (valor =='60'){ | ||
621 | + document.getElementById('divPeriodoExplicito').style.display='none'; | ||
622 | + document.getElementById('txtDataInicio').value='<?php echo ProtocoloINT::calcularDataInicial(60); ?>'; | ||
623 | + document.getElementById('txtDataFim').value='<?php echo date('d/m/Y'); ?>'; | ||
624 | + } | ||
625 | +} | ||
626 | + | ||
627 | +function sugerirUsuario(obj){ | ||
628 | + if (infraTrim(obj.value)==''){ | ||
629 | + obj.value = '<?=SessaoSEIExterna::getInstance()->getStrSiglaUsuario()?>'; | ||
630 | + } | ||
631 | +} | ||
632 | + | ||
633 | + | ||
634 | + | ||
635 | +function obterUsuarios(){ | ||
636 | + var objHdnUsuarios = document.getElementById('hdnSiglasUsuarios'); | ||
637 | + objHdnUsuarios.value = ''; | ||
638 | + | ||
639 | + if (document.getElementById('txtSiglaUsuario1').value != ''){ | ||
640 | + if (objHdnUsuarios.value == ''){ | ||
641 | + objHdnUsuarios.value += infraTrim(document.getElementById('txtSiglaUsuario1').value); | ||
642 | + }else { | ||
643 | + objHdnUsuarios.value += ',' + infraTrim(document.getElementById('txtSiglaUsuario1').value); | ||
644 | + } | ||
645 | + } | ||
646 | + if (document.getElementById('txtSiglaUsuario2').value != ''){ | ||
647 | + if (objHdnUsuarios.value == ''){ | ||
648 | + objHdnUsuarios.value += infraTrim(document.getElementById('txtSiglaUsuario2').value); | ||
649 | + }else { | ||
650 | + objHdnUsuarios.value += ',' + infraTrim(document.getElementById('txtSiglaUsuario2').value); | ||
651 | + } | ||
652 | + } | ||
653 | + if (document.getElementById('txtSiglaUsuario3').value != ''){ | ||
654 | + if (objHdnUsuarios.value == ''){ | ||
655 | + objHdnUsuarios.value += infraTrim(document.getElementById('txtSiglaUsuario3').value); | ||
656 | + }else { | ||
657 | + objHdnUsuarios.value += ',' + infraTrim(document.getElementById('txtSiglaUsuario3').value); | ||
658 | + } | ||
659 | + } | ||
660 | + if (document.getElementById('txtSiglaUsuario4').value != ''){ | ||
661 | + if (objHdnUsuarios.value == ''){ | ||
662 | + objHdnUsuarios.value += infraTrim(document.getElementById('txtSiglaUsuario4').value); | ||
663 | + }else { | ||
664 | + objHdnUsuarios.value += ',' + infraTrim(document.getElementById('txtSiglaUsuario4').value); | ||
665 | + } | ||
666 | + } | ||
667 | +} | ||
668 | + | ||
669 | + | ||
670 | + | ||
671 | + | ||
672 | + | ||
673 | + | ||
674 | + | ||
675 | + | ||
676 | +function onSubmitForm(){ | ||
677 | + | ||
678 | + if (!document.getElementById('chkSinProcessos').checked && !document.getElementById('chkSinDocumentosGerados').checked && !document.getElementById('chkSinDocumentosRecebidos').checked){ | ||
679 | + alert('Selecione pelo menos uma das opções de pesquisa avançada: Processos, Documentos Gerados ou Documento Recebidos'); | ||
680 | + return false; | ||
681 | + } | ||
682 | + | ||
683 | + obterUsuarios(); | ||
684 | + | ||
685 | + | ||
686 | + | ||
687 | + | ||
688 | + <?if ($bolSolr){?> | ||
689 | + limpaFields(); | ||
690 | + return partialFields(); | ||
691 | + | ||
692 | + <?}else{?> | ||
693 | + return true; | ||
694 | + <?}?> | ||
695 | +} | ||
696 | + | ||
697 | +function exibirAvancado(){ | ||
698 | + | ||
699 | + if (document.getElementById('divAvancado').style.display=='none'){ | ||
700 | + document.getElementById('divAvancado').style.display = 'block'; | ||
701 | + | ||
702 | + if (document.getElementById('optPeriodoExplicito').checked){ | ||
703 | + document.getElementById('divPeriodoExplicito').style.display='block'; | ||
704 | + }else{ | ||
705 | + document.getElementById('divPeriodoExplicito').style.display='none'; | ||
706 | + } | ||
707 | + document.getElementById('divUsuario').style.display = 'block'; | ||
708 | + | ||
709 | + }else{ | ||
710 | + document.getElementById('divAvancado').style.display = 'none'; | ||
711 | + document.getElementById('divPeriodoExplicito').style.display='none'; | ||
712 | + document.getElementById('divUsuario').style.display='none'; | ||
713 | + document.getElementById('txtProtocoloPesquisa').focus(); | ||
714 | + } | ||
715 | + | ||
716 | + infraProcessarResize(); | ||
717 | +} | ||
718 | + | ||
719 | +<? | ||
720 | +PaginaSEIExterna::getInstance()->fecharJavaScript(); | ||
721 | +PaginaSEIExterna::getInstance()->fecharHead(); | ||
722 | +PaginaSEIExterna::getInstance()->abrirBody($strTitulo,'onload="inicializar();"'); | ||
723 | +?> | ||
724 | + <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))?>"> | ||
725 | + <br /> | ||
726 | + <br /> | ||
727 | + | ||
728 | + <div id="divGeral" class="infraAreaDados" style="height: 3.2em; width: 99%; overflow: visible;"> | ||
729 | + <label id="lblProtocoloPesquisa" for="txtProtocoloPesquisa" accesskey="" class="infraLabelOpcional">Nº do Processo ou Documento:</label> | ||
730 | + <input type="text" id="txtProtocoloPesquisa" name="txtProtocoloPesquisa" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strProtocoloPesquisa);?>" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
731 | + | ||
732 | + <?if($bolCaptcha) { ?> | ||
733 | + <label id="lblCaptcha" accesskey="" class="infraLabelObrigatorio"> | ||
734 | + <img src="/infra_js/infra_gerar_captcha.php?codetorandom=<?=$strCodigoParaGeracaoCaptcha;?>" alt="Não foi possível carregar imagem de confirmação" /> </label> | ||
735 | + <?} else {?> | ||
736 | + <input type="submit" id="sbmPesquisar"name="sbmPesquisar" value="Pesquisar" class="infraButton" /> | ||
737 | + <input type="submit" id="sbmLimpar"name="sbmLimpar" value="Limpar Campos" class="infraButton" /> | ||
738 | + <?}?> | ||
739 | + | ||
740 | + | ||
741 | + </div> | ||
742 | + <div id="divAvancado" class="infraAreaDados" style="height: 20em; width: 99%;"> | ||
743 | + <?if($bolCaptcha) { ?> | ||
744 | + <label id="lblCodigo" for="txtCaptcha" accesskey="" class="infraLabelOpcional">Digite o código da imagem</label> | ||
745 | + <input type="text" id="txtCaptcha" name="txtCaptcha" class="infraText" maxlength="4" value="" /> | ||
746 | + <input type="submit" id="sbmPesquisar"name="sbmPesquisar" value="Pesquisar" class="infraButton" /> | ||
747 | + <input type="submit" id="sbmLimpar"name="sbmLimpar" value="Limpar Campos" class="infraButton" /> | ||
748 | + <?}?> | ||
749 | + | ||
750 | + | ||
751 | + <label id="lblPalavrasPesquisa" for="q" accesskey="" class="infraLabelOpcional">Pesquisa Livre:</label> | ||
752 | + <input type="text" id="q" name="q" class="infraText" value="<?=str_replace('\\','',str_replace('"','"',PaginaSEIExterna::tratarHTML($strPalavrasPesquisa)))?>" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
753 | + <a id="ancAjuda" href="<?=$strLinkAjuda?>" target="janAjuda" title="Ajuda para Pesquisa" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>"><img src="<?=PaginaSEIExterna::getInstance()->getDiretorioImagensGlobal()?>/ajuda.gif" class="infraImg" /> </a> | ||
754 | + | ||
755 | + <label id="lblPesquisarEm" accesskey="" class="infraLabelObrigatorio">Pesquisar em:</label> | ||
756 | + | ||
757 | + <div id="divSinProcessos" class="infraDivCheckbox"> | ||
758 | + <input type="checkbox" id="chkSinProcessos" name="chkSinProcessos" value="P" class="infraCheckbox" <?=($strSinProcessos=='P'?'checked="checked"':'')?> tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
759 | + <label id="lblSinProcessos" for="chkSinProcessos" accesskey="" class="infraLabelCheckbox">Processos</label> | ||
760 | + </div> | ||
761 | + <div id="divSinDocumentosGerados" class="infraDivCheckbox" title="Documento nato do Sei"> | ||
762 | + <input type="checkbox" id="chkSinDocumentosGerados" name="chkSinDocumentosGerados" value="G" class="infraCheckbox" <?=($strSinDocumentosGerados=='G'?'checked="checked"':'')?> tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
763 | + <label id="lblSinDocumentosGerados" for="chkSinDocumentosGerados" accesskey="" class="infraLabelCheckbox">Documentos Gerados</label> | ||
764 | + </div> | ||
765 | + | ||
766 | + <div id="divSinDocumentosRecebidos" class="infraDivCheckbox" title="Arquivo anexo"> | ||
767 | + <input type="checkbox" id="chkSinDocumentosRecebidos" name="chkSinDocumentosRecebidos" value="R" class="infraCheckbox" <?=($strSinDocumentosRecebidos=='R'?'checked="checked"':'')?> tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
768 | + <label id="lblSinDocumentosRecebidos" for="chkSinDocumentosRecebidos" accesskey="" class="infraLabelCheckbox">Documentos Externos</label> | ||
769 | + </div> | ||
770 | + | ||
771 | + | ||
772 | + | ||
773 | + <label id="lblParticipante" for="txtParticipante" accesskey="" class="infraLabelOpcional">Interessado / Remetente:</label> | ||
774 | + <input type="text" id="txtParticipante" name="txtParticipante" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strNomeParticipante);?>" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
775 | + <input type="hidden" id="hdnIdParticipante" name="hdnIdParticipante" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strIdParticipante)?>" /> | ||
776 | + | ||
777 | + | ||
778 | + <label id="lblUnidade" for="txtUnidade" class="infraLabelOpcional">Unidade:</label> | ||
779 | + <input type="text" id="txtUnidade" name="txtUnidade" class="infraText" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" value="<?=PaginaSEIExterna::tratarHTML($strDescricaoUnidade)?>" /> | ||
780 | + <input type="hidden" id="hdnIdUnidade" name="hdnIdUnidade" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strIdUnidade)?>" /> | ||
781 | + | ||
782 | + <label id="lblTipoProcedimentoPesquisa" for="selTipoProcedimentoPesquisa" accesskey="" class="infraLabelOpcional">Tipo do Processo:</label> | ||
783 | + <select id="selTipoProcedimentoPesquisa" name="selTipoProcedimentoPesquisa" class="infraSelect" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" > | ||
784 | + <?=$strItensSelTipoProcedimento?> | ||
785 | + </select> | ||
786 | + | ||
787 | + <label id="lblSeriePesquisa" for="selSeriePesquisa" accesskey="" class="infraLabelOpcional">Tipo do Documento:</label> | ||
788 | + <select id="selSeriePesquisa" name="selSeriePesquisa" class="infraSelect" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" > | ||
789 | + <?=$strItensSelSerie?> | ||
790 | + </select> | ||
791 | + | ||
792 | + <label id="lblData" class="infraLabelOpcional">Data:</label> | ||
793 | + | ||
794 | + <div id="divOptPeriodoExplicito" class="infraDivRadio"> | ||
795 | + <input type="radio" name="rdoData" id="optPeriodoExplicito" value="0" onclick="tratarPeriodo(this.value);" <?=($strStaData=='0'?'checked="checked"':'')?> class="infraRadio"/> | ||
796 | + <label id="lblPeriodoExplicito" accesskey="" for="optPeriodoExplicito" class="infraLabelRadio" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>">Período explícito</label> | ||
797 | + </div> | ||
798 | + | ||
799 | + <div id="divOptPeriodo30" class="infraDivRadio"> | ||
800 | + <input type="radio" name="rdoData" id="optPeriodo30" value="30" onclick="tratarPeriodo(this.value);" <?=($strStaData=='30'?'checked="checked"':'')?> class="infraRadio"/> | ||
801 | + <label id="lblPeriodo30" accesskey="" for="optPeriodo30" class="infraLabelRadio" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>">30 dias</label> | ||
802 | + </div> | ||
803 | + | ||
804 | + <div id="divOptPeriodo60" class="infraDivRadio"> | ||
805 | + <input type="radio" name="rdoData" id="optPeriodo60" value="60" onclick="tratarPeriodo(this.value);" <?=($strStaData=='60'?'checked="checked"':'')?> class="infraRadio"/> | ||
806 | + <label id="lblPeriodo60" accesskey="" for="optPeriodo60" class="infraLabelRadio" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>">60 dias</label> | ||
807 | + </div> | ||
808 | + </div> | ||
809 | + | ||
810 | + <div id="divPeriodoExplicito" class="infraAreaDados" style="height:2.5em;width:99%;top:50%;margin-top:-20px"> | ||
811 | + <input type="text" id="txtDataInicio" name="txtDataInicio" onkeypress="return infraMascaraData(this, event)" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strDataInicio);?>" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
812 | + <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()?>" /> | ||
813 | + <label id="lblDataE" for="txtDataE" accesskey="" class="infraLabelOpcional"> e </label> | ||
814 | + <input type="text" id="txtDataFim" name="txtDataFim" onkeypress="return infraMascaraData(this, event)" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strDataFim);?>" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
815 | + <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()?>" /> | ||
816 | + </div> | ||
817 | + | ||
818 | + | ||
819 | + <input type="hidden" id="txtNumeroDocumentoPesquisa" name="txtNumeroDocumentoPesquisa" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strNumeroDocumentoPesquisa);?>" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
820 | + <input type="hidden" id="txtAssinante" name="txtAssinante" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strNomeAssinante);?>" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
821 | + <input type="hidden" id="hdnIdAssinante" name="hdnIdAssinante" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strIdAssinante)?>" /> | ||
822 | + <input type="hidden" id="txtDescricaoPesquisa" name="txtDescricaoPesquisa" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strDescricaoPesquisa);?>" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
823 | + <input type="hidden" id="txtAssunto" name="txtAssunto" class="infraText" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" value="<?=PaginaSEIExterna::tratarHTML($strDescricaoAssunto)?>" /> | ||
824 | + <input type="hidden" id="hdnIdAssunto" name="hdnIdAssunto" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strIdAssunto)?>" /> | ||
825 | + <input type="hidden" id="txtSiglaUsuario1" name="txtSiglaUsuario1" onfocus="sugerirUsuario(this);" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strSiglaUsuario1);?>" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
826 | + <input type="hidden" id="txtSiglaUsuario2" name="txtSiglaUsuario2" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strSiglaUsuario2);?>" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
827 | + <input type="hidden" id="txtSiglaUsuario3" name="txtSiglaUsuario3" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strSiglaUsuario3);?>" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
828 | + <input type="hidden" id="txtSiglaUsuario4" name="txtSiglaUsuario4" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strSiglaUsuario4);?>" tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>" /> | ||
829 | + <input type="hidden" id="hdnSiglasUsuarios" name="hdnSiglasUsuarios" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strUsuarios)?>" /> | ||
830 | + <input type="hidden" id="hdnSiglasUsuarios" name="hdnSiglasUsuarios" class="infraText" value="<?=PaginaSEIExterna::tratarHTML($strUsuarios)?>" /> | ||
831 | + <?if($bolCaptcha) { ?> | ||
832 | + <input type="hidden" id="hdnCaptchaMd5" name="hdnCaptchaMd5" class="infraText" value="<?=md5(InfraCaptcha::gerar(PaginaSEIExterna::tratarHTML($strCodigoParaGeracaoCaptcha)));?>" /> | ||
833 | + <?} ?> | ||
834 | + <input id="partialfields" name="partialfields" type="hidden" value="" /> | ||
835 | + <input id="requiredfields" name="requiredfields" type="hidden" value="" /> | ||
836 | + <input id="as_q" name="as_q" type="hidden" value="" /> | ||
837 | + | ||
838 | + <input type="hidden" id="hdnFlagPesquisa" name="hdnFlagPesquisa" value="1" /> | ||
839 | +<? | ||
840 | + if ($bolSolr){ | ||
841 | + echo '<div id="conteudo" style="width:99%;" class="infraAreaTabela">'; | ||
842 | + echo $strResultado; | ||
843 | + echo $strResultadoIntranet; | ||
844 | + echo $strResultadoSISCADE; | ||
845 | + | ||
846 | + }else if ($bolBanco){ | ||
847 | + PaginaSEIExterna::getInstance()->montarAreaTabela($strResultado,$numRegistros); | ||
848 | + echo $strResultadoIntranet; | ||
849 | + echo $strResultadoSISCADE; | ||
850 | + } | ||
851 | + | ||
852 | + | ||
853 | + | ||
854 | + | ||
855 | + PaginaSEIExterna::getInstance()->montarAreaDebug(); | ||
856 | +?> | ||
857 | + </form> | ||
858 | +<? | ||
859 | +PaginaSEIExterna::getInstance()->fecharBody(); | ||
860 | +PaginaSEIExterna::getInstance()->fecharHtml(); | ||
861 | +?> | ||
0 | \ No newline at end of file | 862 | \ No newline at end of file |
1 | +++ a/sei/institucional/pesquisa/rn/ProcedimentoSiscadeRN.php | ||
@@ -0,0 +1,187 @@ | @@ -0,0 +1,187 @@ | ||
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 | + * ProcedimentoSiscadeRN | ||
11 | + * | ||
12 | + * | ||
13 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
14 | + */ | ||
15 | + | ||
16 | +/** | ||
17 | + * Classe regra de negocio procedimento siscade. | ||
18 | + * | ||
19 | + * | ||
20 | + * @package institucional_pesquisa_ProcedimentoSiscadeRN | ||
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 ProcedimentoSiscadeRN extends InfraRN{ | ||
34 | + | ||
35 | + //NA = Nível de Acesso | ||
36 | + public static $NA_PUBLICO = '1'; | ||
37 | + public static $NA_RESTRITO = '2'; | ||
38 | + public static $NA_SIGILOSO = '3'; | ||
39 | + | ||
40 | + public function __construct(){ | ||
41 | + parent::__construct(); | ||
42 | + } | ||
43 | + | ||
44 | + protected function inicializarObjInfraIBanco(){ | ||
45 | + return BancoSISCADE::getInstance('BancoSISCADE'); | ||
46 | + } | ||
47 | + | ||
48 | + protected function listarTodosComFiltroConectado(ProcedimentoSiscadeDTO $objetoDTO){ | ||
49 | + try { | ||
50 | + | ||
51 | + | ||
52 | + | ||
53 | + if($objetoDTO->isSetStrNrProcedimento()){ | ||
54 | + if(trim($objetoDTO->getStrNrProcedimento())!=''){ | ||
55 | + | ||
56 | + $strProcessoPesquisa = InfraString::transformarCaixaAlta($objetoDTO->getStrNrProcedimento()); | ||
57 | + $arrProcessoPesquisa = explode(' ',$strProcessoPesquisa); | ||
58 | + | ||
59 | + | ||
60 | + | ||
61 | + for($i=0;$i<count($arrProcessoPesquisa);$i++){ | ||
62 | + $arrProcessoPesquisa[$i] = '%'.$arrProcessoPesquisa[$i].'%'; | ||
63 | + } | ||
64 | + | ||
65 | + if (count($arrProcessoPesquisa)==1){ | ||
66 | + $objetoDTO->setStrNrProcedimento($arrProcessoPesquisa[0],InfraDTO::$OPER_LIKE); | ||
67 | + | ||
68 | + | ||
69 | + }else{ | ||
70 | + $objetoDTO->unSetStrNrProcedimento(); | ||
71 | + $a = array_fill(0,count($arrProcessoPesquisa),'ProNumero'); | ||
72 | + $b = array_fill(0,count($arrProcessoPesquisa),InfraDTO::$OPER_LIKE); | ||
73 | + $d = array_fill(0,count($arrProcessoPesquisa)-1,InfraDTO::$OPER_LOGICO_AND); | ||
74 | + $objetoDTO->adicionarCriterio($a,$b,$arrProcessoPesquisa,$d); | ||
75 | + | ||
76 | + | ||
77 | + | ||
78 | + } | ||
79 | + }else{ | ||
80 | + $objetoDTO->unSetStrNrProcedimento(); | ||
81 | + } | ||
82 | + | ||
83 | + | ||
84 | + } | ||
85 | + | ||
86 | + | ||
87 | + | ||
88 | + $objetoBD = new ProcedimentoSiscadeBD($this->getObjInfraIBanco()); | ||
89 | + | ||
90 | + | ||
91 | + | ||
92 | + $ret = $objetoBD->listar($objetoDTO); | ||
93 | + | ||
94 | + return $ret; | ||
95 | + | ||
96 | + } catch (Exception $e) { | ||
97 | + throw new InfraException('Erro listando Processos Siscade com filtro.',$e); | ||
98 | + } | ||
99 | + } | ||
100 | + | ||
101 | + protected function contarComFiltroConectado(ProcedimentoSiscadeDTO $objetoDTO){ | ||
102 | + try { | ||
103 | + | ||
104 | + if($objetoDTO->isSetStrNrProcedimento()){ | ||
105 | + if(trim($objetoDTO->getStrNrProcedimento())!=''){ | ||
106 | + | ||
107 | + $strProcessoPesquisa = InfraString::transformarCaixaAlta($objetoDTO->getStrNrProcedimento()); | ||
108 | + $arrProcessoPesquisa = explode(' ',$strProcessoPesquisa); | ||
109 | + | ||
110 | + | ||
111 | + | ||
112 | + for($i=0;$i<count($arrProcessoPesquisa);$i++){ | ||
113 | + $arrProcessoPesquisa[$i] = '%'.$arrProcessoPesquisa[$i].'%'; | ||
114 | + } | ||
115 | + | ||
116 | + if (count($arrProcessoPesquisa)==1){ | ||
117 | + $objetoDTO->setStrNrProcedimento($arrProcessoPesquisa[0],InfraDTO::$OPER_LIKE); | ||
118 | + | ||
119 | + | ||
120 | + }else{ | ||
121 | + $objetoDTO->unSetStrNrProcedimento(); | ||
122 | + $a = array_fill(0,count($arrProcessoPesquisa),'ProNumero'); | ||
123 | + $b = array_fill(0,count($arrProcessoPesquisa),InfraDTO::$OPER_LIKE); | ||
124 | + $d = array_fill(0,count($arrProcessoPesquisa)-1,InfraDTO::$OPER_LOGICO_AND); | ||
125 | + $objetoDTO->adicionarCriterio($a,$b,$arrProcessoPesquisa,$d); | ||
126 | + | ||
127 | + | ||
128 | + | ||
129 | + } | ||
130 | + }else{ | ||
131 | + $objetoDTO->unSetStrNrProcedimento(); | ||
132 | + } | ||
133 | + | ||
134 | + | ||
135 | + } | ||
136 | + | ||
137 | + $objetoBD = new ProcedimentoSiscadeBD($this->getObjInfraIBanco()); | ||
138 | + | ||
139 | + $ret = $objetoBD->contar($objetoDTO); | ||
140 | + | ||
141 | + return $ret; | ||
142 | + | ||
143 | + } catch (Exception $e) { | ||
144 | + throw new InfraException('Erro listando Processos Siscade com filtro.',$e); | ||
145 | + } | ||
146 | + } | ||
147 | + | ||
148 | + protected function contarProcedimentoParteConectado(ProcedimentoSiscadeDTO $objProcedimentoSiscadeDTO){ | ||
149 | + | ||
150 | + try { | ||
151 | + | ||
152 | + $objProcedimentoSiscadeBD = new ProcedimentoSiscadeBD($this->getObjInfraIBanco()); | ||
153 | + $ret = $objProcedimentoSiscadeBD->contarProcedimentoParte($objProcedimentoSiscadeDTO); | ||
154 | + | ||
155 | + return $ret; | ||
156 | + | ||
157 | + } catch (Exception $e) { | ||
158 | + throw new InfraException('Erro contando Procedimento Siscade.',$e); | ||
159 | + } | ||
160 | + | ||
161 | + } | ||
162 | + | ||
163 | + protected function listarProcedimentoParteConectado(ProcedimentoSiscadeDTO $objProcedimentoSiscadeDTO){ | ||
164 | + | ||
165 | + try { | ||
166 | + | ||
167 | + $objProcedimentoSiscadeBD = new ProcedimentoSiscadeBD($this->getObjInfraIBanco()); | ||
168 | + $ret = $objProcedimentoSiscadeBD->listarPaginadoProcedimentoParte($objProcedimentoSiscadeDTO); | ||
169 | + | ||
170 | + | ||
171 | + return $ret; | ||
172 | + | ||
173 | + } catch (Exception $e) { | ||
174 | + throw new InfraException('Erro listando Procedimento Siscade.',$e); | ||
175 | + } | ||
176 | + } | ||
177 | + | ||
178 | + | ||
179 | + | ||
180 | + | ||
181 | + | ||
182 | + | ||
183 | +} | ||
184 | + | ||
185 | + | ||
186 | + | ||
187 | +?> |
1 | +++ a/sei/institucional/pesquisa/rn/ProcessoRN.php | ||
@@ -0,0 +1,177 @@ | @@ -0,0 +1,177 @@ | ||
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 | + * ProcessoRN | ||
11 | + * | ||
12 | + * | ||
13 | + * @author Alex Alves Braga <bsi.alexbraga@gmail.com> | ||
14 | + */ | ||
15 | + | ||
16 | +/** | ||
17 | + * Classe regra de negocio processo DBCade. | ||
18 | + * | ||
19 | + * | ||
20 | + * @package institucional_pesquisa_ProcessoRN | ||
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 ProcessoRN extends InfraRN{ | ||
34 | + | ||
35 | + | ||
36 | + | ||
37 | + public function __construct(){ | ||
38 | + parent::__construct(); | ||
39 | + } | ||
40 | + | ||
41 | + protected function inicializarObjInfraIBanco(){ | ||
42 | + return BancoCADE::getInstance('BancoDBCADE'); | ||
43 | + } | ||
44 | + | ||
45 | + protected function listarConectado(ProcessoDTO $objProcessoDTO){ | ||
46 | + try { | ||
47 | + | ||
48 | + $objProcessoBD = new ProcessoBD($this->getObjInfraIBanco()); | ||
49 | + $ret = $objProcessoBD->listar($objProcessoDTO); | ||
50 | + | ||
51 | + return $ret; | ||
52 | + } catch (Exception $e) { | ||
53 | + | ||
54 | + throw new InfraException('Erro listando Processos, ',$e); | ||
55 | + | ||
56 | + } | ||
57 | + } | ||
58 | + | ||
59 | + protected function listarTodosComFiltroConectado(ProcessoDTO $objProcessoDTO){ | ||
60 | + try { | ||
61 | + | ||
62 | + if($objProcessoDTO->isSetStrProNumero()){ | ||
63 | + if(trim($objProcessoDTO->getStrProNumero())!=''){ | ||
64 | + | ||
65 | + $strProcessoPesquisa = InfraString::transformarCaixaAlta($objProcessoDTO->getStrProNumero()); | ||
66 | + $arrProcessoPesquisa = explode(' ',$strProcessoPesquisa); | ||
67 | + | ||
68 | + | ||
69 | + for($i=0;$i<count($arrProcessoPesquisa);$i++){ | ||
70 | + $arrProcessoPesquisa[$i] = '%'.$arrProcessoPesquisa[$i].'%'; | ||
71 | + } | ||
72 | + | ||
73 | + if (count($arrProcessoPesquisa)==1){ | ||
74 | + $objProcessoDTO->setStrProNumero($arrProcessoPesquisa[0],InfraDTO::$OPER_LIKE); | ||
75 | + | ||
76 | + }else{ | ||
77 | + $objProcessoDTO->unSetStrProNumero(); | ||
78 | + $a = array_fill(0,count($arrProcessoPesquisa),'ProNumero'); | ||
79 | + $b = array_fill(0,count($arrProcessoPesquisa),InfraDTO::$OPER_LIKE); | ||
80 | + $d = array_fill(0,count($arrProcessoPesquisa)-1,InfraDTO::$OPER_LOGICO_AND); | ||
81 | + $objProcessoDTO->adicionarCriterio($a,$b,$arrProcessoPesquisa,$d); | ||
82 | + } | ||
83 | + }else{ | ||
84 | + $objProcessoDTO->unSetStrProNumero(); | ||
85 | + } | ||
86 | + | ||
87 | + | ||
88 | + } | ||
89 | + | ||
90 | + $objProcessoBD = new ProcessoBD($this->getObjInfraIBanco()); | ||
91 | + $ret = $objProcessoBD->listar($objProcessoDTO); | ||
92 | + | ||
93 | + return $ret; | ||
94 | + | ||
95 | + } catch (Exception $e) { | ||
96 | + throw new InfraException('Erro listando Processos com filtro.',$e); | ||
97 | + } | ||
98 | + | ||
99 | + } | ||
100 | + | ||
101 | + protected function contarComFiltroConectado(ProcessoDTO $objProcessoDTO){ | ||
102 | + | ||
103 | + try { | ||
104 | + | ||
105 | + if($objProcessoDTO->isSetStrProNumero()){ | ||
106 | + if(trim($objProcessoDTO->getStrProNumero())!=''){ | ||
107 | + | ||
108 | + $strProcessoPesquisa = InfraString::transformarCaixaAlta($objProcessoDTO->getStrProNumero()); | ||
109 | + $arrProcessoPesquisa = explode(' ',$strProcessoPesquisa); | ||
110 | + | ||
111 | + | ||
112 | + for($i=0;$i<count($arrProcessoPesquisa);$i++){ | ||
113 | + $arrProcessoPesquisa[$i] = '%'.$arrProcessoPesquisa[$i].'%'; | ||
114 | + } | ||
115 | + | ||
116 | + if (count($arrProcessoPesquisa)==1){ | ||
117 | + $objProcessoDTO->setStrProNumero($arrProcessoPesquisa[0],InfraDTO::$OPER_LIKE); | ||
118 | + | ||
119 | + }else{ | ||
120 | + $objProcessoDTO->unSetStrProNumero(); | ||
121 | + $a = array_fill(0,count($arrProcessoPesquisa),'ProNumero'); | ||
122 | + $b = array_fill(0,count($arrProcessoPesquisa),InfraDTO::$OPER_LIKE); | ||
123 | + $d = array_fill(0,count($arrProcessoPesquisa)-1,InfraDTO::$OPER_LOGICO_AND); | ||
124 | + $objProcessoDTO->adicionarCriterio($a,$b,$arrProcessoPesquisa,$d); | ||
125 | + } | ||
126 | + }else{ | ||
127 | + $objProcessoDTO->unSetStrProNumero(); | ||
128 | + } | ||
129 | + | ||
130 | + | ||
131 | + } | ||
132 | + | ||
133 | + $objProcessoBD = new ProcessoBD($this->getObjInfraIBanco()); | ||
134 | + $ret = $objProcessoBD->contar($objProcessoDTO); | ||
135 | + | ||
136 | + return $ret; | ||
137 | + | ||
138 | + } catch (Exception $e) { | ||
139 | + throw new InfraException('Error contando Processo DBCade.'); | ||
140 | + } | ||
141 | + } | ||
142 | + | ||
143 | + protected function contarProNumeroParteConectado(ProcessoDTO $objProcessoDTO){ | ||
144 | + | ||
145 | + try { | ||
146 | + | ||
147 | + $objProcessoBD = new ProcessoBD($this->getObjInfraIBanco()); | ||
148 | + $ret = $objProcessoBD->contarPronumeroParte($objProcessoDTO); | ||
149 | + | ||
150 | + return $ret; | ||
151 | + | ||
152 | + } catch (Exception $e) { | ||
153 | + throw new InfraException('Erro contando Processo DBCade.',$e); | ||
154 | + } | ||
155 | + } | ||
156 | + | ||
157 | + | ||
158 | + protected function listarProNumeroParteConectado(ProcessoDTO $objProcessoDTO){ | ||
159 | + | ||
160 | + try { | ||
161 | + | ||
162 | + | ||
163 | + | ||
164 | + $objProcessoBD = new ProcessoBD($this->getObjInfraIBanco()); | ||
165 | + $ret = $objProcessoBD->listarPaginadoPronumeroParte($objProcessoDTO); | ||
166 | + | ||
167 | + return $ret; | ||
168 | + | ||
169 | + } catch (Exception $e) { | ||
170 | + throw new InfraException('Error Listando Processo DBCade.'); | ||
171 | + } | ||
172 | + } | ||
173 | + | ||
174 | + | ||
175 | + | ||
176 | +} | ||
177 | +?> | ||
0 | \ No newline at end of file | 178 | \ No newline at end of file |
711 Bytes