Commit cf0f500de502fb3e512e65d82a029b2e90c0e8fa
1 parent
da96c308
Exists in
master
and in
21 other branches
OS076 e ajustes refs #8519 #8798 #8797 #8796
Showing
34 changed files
with
2518 additions
and
1362 deletions
Show diff stats
PENIntegracao.php
@@ -208,31 +208,46 @@ class PENIntegracao extends SeiIntegracao { | @@ -208,31 +208,46 @@ class PENIntegracao extends SeiIntegracao { | ||
208 | return true; | 208 | return true; |
209 | 209 | ||
210 | // Mapeamento de Hipóteses Legais de Envio | 210 | // Mapeamento de Hipóteses Legais de Envio |
211 | - case 'pen_map_hipotese_legal_enviado_cadastrar': | ||
212 | - case 'pen_map_hipotese_legal_enviado_visualizar': | ||
213 | - require_once dirname(__FILE__) . '/pen_map_hipotese_legal_enviado_cadastrar.php'; | 211 | + case 'pen_map_hipotese_legal_envio_cadastrar': |
212 | + case 'pen_map_hipotese_legal_envio_visualizar': | ||
213 | + require_once dirname(__FILE__) . '/pen_map_hipotese_legal_envio_cadastrar.php'; | ||
214 | return true; | 214 | return true; |
215 | 215 | ||
216 | - case 'pen_map_hipotese_legal_enviado_listar': | ||
217 | - case 'pen_map_hipotese_legal_enviado_excluir': | ||
218 | - require_once dirname(__FILE__) . '/pen_map_hipotese_legal_enviado_listar.php'; | 216 | + case 'pen_map_hipotese_legal_envio_listar': |
217 | + case 'pen_map_hipotese_legal_envio_excluir': | ||
218 | + require_once dirname(__FILE__) . '/pen_map_hipotese_legal_envio_listar.php'; | ||
219 | return true; | 219 | return true; |
220 | 220 | ||
221 | // Mapeamento de Hipóteses Legais de Recebimento | 221 | // Mapeamento de Hipóteses Legais de Recebimento |
222 | - case 'pen_map_hipotese_legal_recebido_cadastrar': | ||
223 | - case 'pen_map_hipotese_legal_recebido_visualizar': | ||
224 | - require_once dirname(__FILE__) . '/pen_map_hipotese_legal_recebido_cadastrar.php'; | 222 | + case 'pen_map_hipotese_legal_recebimento_cadastrar': |
223 | + case 'pen_map_hipotese_legal_recebimento_visualizar': | ||
224 | + require_once dirname(__FILE__) . '/pen_map_hipotese_legal_recebimento_cadastrar.php'; | ||
225 | return true; | 225 | return true; |
226 | 226 | ||
227 | - case 'pen_map_hipotese_legal_recebido_listar': | ||
228 | - case 'pen_map_hipotese_legal_recebido_excluir': | ||
229 | - require_once dirname(__FILE__) . '/pen_map_hipotese_legal_recebido_listar.php'; | 227 | + case 'pen_map_hipotese_legal_recebimento_listar': |
228 | + case 'pen_map_hipotese_legal_recebimento_excluir': | ||
229 | + require_once dirname(__FILE__) . '/pen_map_hipotese_legal_recebimento_listar.php'; | ||
230 | return true; | 230 | return true; |
231 | 231 | ||
232 | case 'pen_map_hipotese_legal_padrao_cadastrar': | 232 | case 'pen_map_hipotese_legal_padrao_cadastrar': |
233 | case 'pen_map_hipotese_legal_padrao_visualizar': | 233 | case 'pen_map_hipotese_legal_padrao_visualizar': |
234 | require_once dirname(__FILE__) . '/pen_map_hipotese_legal_padrao_cadastrar.php'; | 234 | require_once dirname(__FILE__) . '/pen_map_hipotese_legal_padrao_cadastrar.php'; |
235 | return true; | 235 | return true; |
236 | + | ||
237 | + case 'pen_map_unidade_cadastrar': | ||
238 | + case 'pen_map_unidade_visualizar': | ||
239 | + require_once dirname(__FILE__) . '/pen_map_unidade_cadastrar.php'; | ||
240 | + return true; | ||
241 | + | ||
242 | + case 'pen_map_unidade_listar': | ||
243 | + case 'pen_map_unidade_excluir': | ||
244 | + require_once dirname(__FILE__) . '/pen_map_unidade_listar.php'; | ||
245 | + return true; | ||
246 | + | ||
247 | + case 'pen_parametros_configuracao': | ||
248 | + case 'pen_parametros_configuracao_salvar': | ||
249 | + require_once dirname(__FILE__) . '/pen_parametros_configuracao.php'; | ||
250 | + return true; | ||
236 | } | 251 | } |
237 | 252 | ||
238 | return false; | 253 | return false; |
dto/PenHipoteseLegalDTO.php
@@ -16,6 +16,7 @@ class PenHipoteseLegalDTO extends InfraDTO { | @@ -16,6 +16,7 @@ class PenHipoteseLegalDTO extends InfraDTO { | ||
16 | public function montar() { | 16 | public function montar() { |
17 | $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM, 'IdHipoteseLegal', 'id_hipotese_legal'); | 17 | $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM, 'IdHipoteseLegal', 'id_hipotese_legal'); |
18 | $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_STR, 'Nome', 'nome'); | 18 | $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_STR, 'Nome', 'nome'); |
19 | + $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_NUM, 'Identificacao', 'identificacao'); | ||
19 | $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_STR, 'Ativo', 'sin_ativo'); | 20 | $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_STR, 'Ativo', 'sin_ativo'); |
20 | 21 | ||
21 | $this->configurarPK('IdHipoteseLegal',InfraDTO::$TIPO_PK_SEQUENCIAL); | 22 | $this->configurarPK('IdHipoteseLegal',InfraDTO::$TIPO_PK_SEQUENCIAL); |
dto/PenParametroDTO.php
@@ -18,6 +18,7 @@ class PenParametroDTO extends InfraDTO { | @@ -18,6 +18,7 @@ class PenParametroDTO extends InfraDTO { | ||
18 | 18 | ||
19 | $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_STR, 'Nome', 'nome'); | 19 | $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_STR, 'Nome', 'nome'); |
20 | $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_STR, 'Valor', 'valor'); | 20 | $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_STR, 'Valor', 'valor'); |
21 | + $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_STR, 'Descricao', 'descricao'); | ||
21 | 22 | ||
22 | $this->configurarPK('Nome',InfraDTO::$TIPO_PK_INFORMADO); | 23 | $this->configurarPK('Nome',InfraDTO::$TIPO_PK_INFORMADO); |
23 | } | 24 | } |
int/ProcessoEletronicoINT.php
@@ -25,32 +25,22 @@ class ProcessoEletronicoINT extends InfraINT { | @@ -25,32 +25,22 @@ class ProcessoEletronicoINT extends InfraINT { | ||
25 | private static function gerarHierarquiaEstruturas($estruturas = array()){ | 25 | private static function gerarHierarquiaEstruturas($estruturas = array()){ |
26 | 26 | ||
27 | if(empty($estruturas)) { | 27 | if(empty($estruturas)) { |
28 | - | ||
29 | return $estruturas; | 28 | return $estruturas; |
30 | } | 29 | } |
31 | 30 | ||
32 | - foreach($estruturas as &$estrutura) { | ||
33 | - | ||
34 | - $siglas = $estrutura->getArrHierarquia(); | ||
35 | - | ||
36 | - if(!empty($siglas)) { | ||
37 | - | ||
38 | - $nome = $estrutura->getStrNome(); | ||
39 | - $nome .= ' - '; | ||
40 | - | ||
41 | - $array = array($estrutura->getStrSigla()); | ||
42 | - | ||
43 | - foreach($estrutura->getArrHierarquia() as $sigla) { | ||
44 | - | ||
45 | - if(trim($sigla) !== '' && !in_array($sigla, array('PE', 'UNIAO'))) { | ||
46 | - | ||
47 | - $array[] = $sigla; | ||
48 | - } | ||
49 | - } | ||
50 | - | ||
51 | - $nome .= implode(' / ', $array); | ||
52 | - | ||
53 | - $estrutura->setStrNome($nome); | 31 | + foreach($estruturas as &$estrutura) { |
32 | + if($estrutura->isSetArrHierarquia()) { | ||
33 | + $siglas = $estrutura->getArrHierarquia(); | ||
34 | + $nome = $estrutura->getStrNome(); | ||
35 | + $nome .= ' - '; | ||
36 | + $array = array($estrutura->getStrSigla()); | ||
37 | + foreach($estrutura->getArrHierarquia() as $sigla) { | ||
38 | + if(trim($sigla) !== '' && !in_array($sigla, array('PR', 'UNIAO'))) { | ||
39 | + $array[] = $sigla; | ||
40 | + } | ||
41 | + } | ||
42 | + $nome .= implode(' / ', $array); | ||
43 | + $estrutura->setStrNome($nome); | ||
54 | } | 44 | } |
55 | } | 45 | } |
56 | 46 |
pen_map_hipotese_legal_enviado_cadastrar.php
@@ -1,221 +0,0 @@ | @@ -1,221 +0,0 @@ | ||
1 | -<?php | ||
2 | -/** | ||
3 | - * | ||
4 | - * @author Join Tecnologia | ||
5 | - */ | ||
6 | - | ||
7 | -require_once dirname(__FILE__) . '/../../SEI.php'; | ||
8 | - | ||
9 | -session_start(); | ||
10 | - | ||
11 | -define('PEN_RECURSO_ATUAL', 'pen_map_hipotese_legal_enviado_cadastrar'); | ||
12 | -define('PEN_RECURSO_BASE', 'pen_map_hipotese_legal_enviado'); | ||
13 | -define('PEN_PAGINA_TITULO', 'Mapeamento de Hipóteses Legais de Envio'); | ||
14 | -define('PEN_PAGINA_GET_ID', 'id_mapeamento'); | ||
15 | - | ||
16 | - | ||
17 | -$objPagina = PaginaSEI::getInstance(); | ||
18 | -$objBanco = BancoSEI::getInstance(); | ||
19 | -$objSessao = SessaoSEI::getInstance(); | ||
20 | - | ||
21 | - | ||
22 | -try { | ||
23 | - | ||
24 | - $objBanco->abrirConexao(); | ||
25 | - | ||
26 | - $objSessao->validarLink(); | ||
27 | - $objSessao->validarPermissao(PEN_RECURSO_ATUAL); | ||
28 | - | ||
29 | - $arrComandos = array(); | ||
30 | - | ||
31 | - $bolSomenteLeitura = false; | ||
32 | - | ||
33 | - switch ($_GET['acao']) { | ||
34 | - case PEN_RECURSO_BASE.'_cadastrar': | ||
35 | - $arrComandos[] = '<button type="submit" id="btnSalvar" value="Salvar" class="infraButton"><span class="infraTeclaAtalho">S</span>alvar</button>'; | ||
36 | - $arrComandos[] = '<button type="button" id="btnCancelar" value="Cancelar" onclick="location.href=\'' . $objPagina->formatarXHTML($objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_listar&acao_origem=' . $_GET['acao'])) . '\';" class="infraButton">Cancelar</button>'; | ||
37 | - | ||
38 | - if(array_key_exists(PEN_PAGINA_GET_ID, $_GET) && !empty($_GET[PEN_PAGINA_GET_ID])){ | ||
39 | - $strTitulo = sprintf('Editar %s', PEN_PAGINA_TITULO); | ||
40 | - } | ||
41 | - else { | ||
42 | - $strTitulo = sprintf('Novo %s', PEN_PAGINA_TITULO); | ||
43 | - } | ||
44 | - break; | ||
45 | - | ||
46 | - case PEN_RECURSO_BASE.'_visualizar': | ||
47 | - $arrComandos[] = '<button type="button" name="btnFechar" value="Fechar" class="infraButton" onclick="location.href=\'' . $objPagina->formatarXHTML($objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_listar&acao_origem=' . $_GET['acao'])) . '\';">Fechar</button>'; | ||
48 | - $bolSomenteLeitura = true; | ||
49 | - $strTitulo = sprintf('Consultar %s', PEN_PAGINA_TITULO); | ||
50 | - break; | ||
51 | - | ||
52 | - | ||
53 | - default: | ||
54 | - throw new InfraException("Ação '" . $_GET['acao'] . "' não reconhecida."); | ||
55 | - } | ||
56 | - | ||
57 | - $objPenRelHipoteseLegalRN = new PenRelHipoteseLegalEnvioRN(); | ||
58 | - | ||
59 | - //-------------------------------------------------------------------------- | ||
60 | - // Ao por POST esta salvando o formulrio | ||
61 | - if(strtoupper($_SERVER['REQUEST_METHOD']) === 'POST') { | ||
62 | - | ||
63 | - if(!array_key_exists('id_hipotese_legal', $_POST) || empty($_POST['id_hipotese_legal'])) { | ||
64 | - throw new InfraException('Nenhuma "Espécie Documental" foi selecionada'); | ||
65 | - } | ||
66 | - | ||
67 | - if(!array_key_exists('id_barramento', $_POST) || empty($_POST['id_barramento'])) { | ||
68 | - throw new InfraException('Nenhum "Tipo de Documento" foi selecionado'); | ||
69 | - } | ||
70 | - | ||
71 | - $objPenRelHipoteseLegalDTO = new PenRelHipoteseLegalDTO(); | ||
72 | - $objPenRelHipoteseLegalDTO->setNumIdHipoteseLegal($_POST['id_hipotese_legal']); | ||
73 | - $objPenRelHipoteseLegalDTO->setNumIdBarramento($_POST['id_barramento']); | ||
74 | - $objPenRelHipoteseLegalDTO->setStrTipo('E');// Enviado | ||
75 | - | ||
76 | - $numIdMapeamento = 0; | ||
77 | - if(array_key_exists(PEN_PAGINA_GET_ID, $_GET) && !empty($_GET[PEN_PAGINA_GET_ID])) { | ||
78 | - $objPenRelHipoteseLegalDTO->setDblIdMap($_GET[PEN_PAGINA_GET_ID]); | ||
79 | - $mapeamento = $objPenRelHipoteseLegalRN->alterar($objPenRelHipoteseLegalDTO); | ||
80 | - $numIdMapeamento = $_GET[PEN_PAGINA_GET_ID]; | ||
81 | - } | ||
82 | - else { | ||
83 | - $mapeamento = $objPenRelHipoteseLegalRN->cadastrar($objPenRelHipoteseLegalDTO); | ||
84 | - $numIdMapeamento = $mapeamento->getDblIdMap(); | ||
85 | - } | ||
86 | - | ||
87 | - header('Location: '.$objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_listar&acao_origem='.$_GET['acao'].'&id_mapeamento='.$numIdMapeamento.PaginaSEI::getInstance()->montarAncora($numIdMapeamento))); | ||
88 | - exit(0); | ||
89 | - } | ||
90 | - // Ao por GET + ID esta carregando o formulrio | ||
91 | - else if(array_key_exists(PEN_PAGINA_GET_ID, $_GET) && !empty($_GET[PEN_PAGINA_GET_ID])){ | ||
92 | - | ||
93 | - $objPenRelHipoteseLegalDTO = new PenRelHipoteseLegalDTO(); | ||
94 | - $objPenRelHipoteseLegalDTO->setDblIdMap($_GET[PEN_PAGINA_GET_ID]); | ||
95 | - $objPenRelHipoteseLegalDTO->retTodos(); | ||
96 | - | ||
97 | - $objEspecieDocumentalBD = new GenericoBD(BancoSEI::getInstance()); | ||
98 | - $objPenRelHipoteseLegalDTO = $objEspecieDocumentalBD->consultar($objPenRelHipoteseLegalDTO); | ||
99 | - } | ||
100 | - | ||
101 | - if(empty($objPenRelHipoteseLegalDTO)){ | ||
102 | - $objPenRelHipoteseLegalDTO = new PenRelHipoteseLegalDTO(); | ||
103 | - $objPenRelHipoteseLegalDTO->setNumIdHipoteseLegal(0); | ||
104 | - $objPenRelHipoteseLegalDTO->setNumIdBarramento(0); | ||
105 | - } | ||
106 | - | ||
107 | - | ||
108 | - if(array_key_exists(PEN_PAGINA_GET_ID, $_GET) && !empty($_GET[PEN_PAGINA_GET_ID])) { | ||
109 | - $objPenRelHipoteseLegalDTO->setDblIdMap($_GET[PEN_PAGINA_GET_ID]); | ||
110 | - } | ||
111 | - | ||
112 | - //-------------------------------------------------------------------------- | ||
113 | - // Auto-Complete | ||
114 | - //-------------------------------------------------------------------------- | ||
115 | - // Mapeamento da hipotese legal do local j utilizados | ||
116 | - $arrNumIdHipoteseLegal = $objPenRelHipoteseLegalRN->getIdHipoteseLegalEmUso($objPenRelHipoteseLegalDTO, 'E'); | ||
117 | - | ||
118 | - // Mapeamento da hipotese legal local | ||
119 | - $objHipoteseLegalDTO = new HipoteseLegalDTO(); | ||
120 | - if(!empty($arrNumIdHipoteseLegal)) { | ||
121 | - // Remove os que j esto em uso | ||
122 | - $objHipoteseLegalDTO->setNumIdHipoteseLegal($arrNumIdHipoteseLegal, InfraDTO::$OPER_NOT_IN); | ||
123 | - } | ||
124 | - $objHipoteseLegalDTO->setStrStaNivelAcesso(ProtocoloRN::$NA_RESTRITO); //Restrito | ||
125 | - $objHipoteseLegalDTO->setStrSinAtivo('S'); | ||
126 | - $objHipoteseLegalDTO->setOrdStrNome(InfraDTO::$TIPO_ORDENACAO_ASC); | ||
127 | - $objHipoteseLegalDTO->retNumIdHipoteseLegal(); | ||
128 | - $objHipoteseLegalDTO->retStrNome(); | ||
129 | - | ||
130 | - $objHipoteseLegalRN = new HipoteseLegalRN(); | ||
131 | - $arrMapIdHipoteseLegal = InfraArray::converterArrInfraDTO($objHipoteseLegalRN->listar($objHipoteseLegalDTO), 'Nome', 'IdHipoteseLegal'); | ||
132 | - | ||
133 | - // Mapeamento da hipotese legal remota | ||
134 | - $objPenHipoteseLegalDTO = new PenHipoteseLegalDTO(); | ||
135 | - $objPenHipoteseLegalDTO->setOrdStrNome(InfraDTO::$TIPO_ORDENACAO_ASC); | ||
136 | - $objPenHipoteseLegalDTO->retNumIdHipoteseLegal(); | ||
137 | - $objPenHipoteseLegalDTO->retStrNome(); | ||
138 | - | ||
139 | - $objPenHipoteseLegalRN = new PenHipoteseLegalRN(); | ||
140 | - $arrMapIdBarramento = InfraArray::converterArrInfraDTO($objPenHipoteseLegalRN->listar($objPenHipoteseLegalDTO), 'Nome', 'IdHipoteseLegal'); | ||
141 | - //-------------------------------------------------------------------------- | ||
142 | -} | ||
143 | -catch (InfraException $e) { | ||
144 | - $objPagina->processarExcecao($e); | ||
145 | -} | ||
146 | -catch(Exception $e) { | ||
147 | - $objPagina->processarExcecao($e); | ||
148 | -} | ||
149 | - | ||
150 | -// View | ||
151 | -ob_clean(); | ||
152 | - | ||
153 | -$objPagina->montarDocType(); | ||
154 | -$objPagina->abrirHtml(); | ||
155 | -$objPagina->abrirHead(); | ||
156 | -$objPagina->montarMeta(); | ||
157 | -$objPagina->montarTitle(':: ' . $objPagina->getStrNomeSistema() . ' - ' . $strTitulo . ' ::'); | ||
158 | -$objPagina->montarStyle(); | ||
159 | -?> | ||
160 | -<style type="text/css"> | ||
161 | - | ||
162 | -.input-label-first{position:absolute;left:0%;top:0%;width:25%; color: #666!important} | ||
163 | -.input-field-first{position:absolute;left:0%;top:15%;width:25%} | ||
164 | - | ||
165 | -.input-label-third {position:absolute;left:0%;top:40%;width:25%; color:#666!important} | ||
166 | -.input-field-third {position:absolute;left:0%;top:55%;width:25%;} | ||
167 | - | ||
168 | -</style> | ||
169 | -<?php $objPagina->montarJavaScript(); ?> | ||
170 | -<script type="text/javascript"> | ||
171 | - | ||
172 | -function inicializar(){ | ||
173 | - | ||
174 | - | ||
175 | -} | ||
176 | - | ||
177 | -function onSubmit() { | ||
178 | - | ||
179 | - var form = jQuery('#<?php print PEN_RECURSO_BASE; ?>_form'); | ||
180 | - var field = jQuery('select[name=id_hipotese_legal]', form); | ||
181 | - | ||
182 | - if(field.val() === 'null'){ | ||
183 | - alert('Nenhuma "Hipótese Legal - SEI <?php print $objSessao->getStrSiglaOrgaoUnidadeAtual(); ?>" foi selecionada'); | ||
184 | - field.focus(); | ||
185 | - return false; | ||
186 | - } | ||
187 | - | ||
188 | - field = jQuery('select[name=id_barramento]', form); | ||
189 | - | ||
190 | - if(field.val() === 'null'){ | ||
191 | - alert('Nenhum "Hipótese Legal - Tramitação PEN" foi selecionado'); | ||
192 | - field.focus(); | ||
193 | - return false; | ||
194 | - } | ||
195 | -} | ||
196 | - | ||
197 | -</script> | ||
198 | -<?php | ||
199 | -$objPagina->fecharHead(); | ||
200 | -$objPagina->abrirBody($strTitulo,'onload="inicializar();"'); | ||
201 | -?> | ||
202 | -<form id="<?php print PEN_RECURSO_BASE; ?>_form" onsubmit="return onSubmit();" method="post" action="<?php //print $objSessaoSEI->assinarLink($strProprioLink); ?>"> | ||
203 | - <?php $objPagina->montarBarraComandosSuperior($arrComandos); ?> | ||
204 | - <?php $objPagina->montarAreaValidacao(); ?> | ||
205 | - <?php $objPagina->abrirAreaDados('12em'); ?> | ||
206 | - | ||
207 | - <label for="id_hipotese_legal" class="infraLabelObrigatorio input-label-first">Hipótese Legal - SEI <?php print $objSessao->getStrSiglaOrgaoUnidadeAtual(); ?>:</label> | ||
208 | - | ||
209 | - <select name="id_hipotese_legal" class="infraSelect input-field-first"<?php if($bolSomenteLeitura): ?> disabled="disabled" readonly="readonly"<?php endif; ?>> | ||
210 | - <?php print InfraINT::montarSelectArray('', 'Selecione', $objPenRelHipoteseLegalDTO->getNumIdHipoteseLegal(), $arrMapIdHipoteseLegal); ?> | ||
211 | - </select> | ||
212 | - | ||
213 | - <label for="id_barramento" class="infraLabelObrigatorio input-label-third">Hipótese Legal - Tramitação PEN:</label> | ||
214 | - <select name="id_barramento" class="infraSelect input-field-third"<?php if($bolSomenteLeitura): ?> disabled="disabled" readonly="readonly"<?php endif; ?>> | ||
215 | - <?php print InfraINT::montarSelectArray('', 'Selecione', $objPenRelHipoteseLegalDTO->getNumIdBarramento(), $arrMapIdBarramento); ?> | ||
216 | - </select> | ||
217 | - | ||
218 | - <?php print $objPagina->fecharAreaDados(); ?> | ||
219 | -</form> | ||
220 | -<?php $objPagina->fecharBody(); ?> | ||
221 | -<?php $objPagina->fecharHtml(); ?> |
pen_map_hipotese_legal_enviado_listar.php
@@ -1,387 +0,0 @@ | @@ -1,387 +0,0 @@ | ||
1 | -<?php | ||
2 | - | ||
3 | -require_once dirname(__FILE__) . '/../../SEI.php'; | ||
4 | - | ||
5 | -/** | ||
6 | - * Consulta os logs do estado do procedimento ao ser expedido | ||
7 | - * | ||
8 | - * @author Join Tecnologia | ||
9 | - */ | ||
10 | - | ||
11 | -session_start(); | ||
12 | - | ||
13 | -define('PEN_RECURSO_ATUAL', 'pen_map_hipotese_legal_enviado_listar'); | ||
14 | -define('PEN_RECURSO_BASE', 'pen_map_hipotese_legal_enviado'); | ||
15 | -define('PEN_PAGINA_TITULO', 'Mapeamento de Hipóteses Legais de Envio'); | ||
16 | -define('PEN_PAGINA_GET_ID', 'id_mapeamento'); | ||
17 | - | ||
18 | - | ||
19 | -$objPagina = PaginaSEI::getInstance(); | ||
20 | -$objBanco = BancoSEI::getInstance(); | ||
21 | -$objSessao = SessaoSEI::getInstance(); | ||
22 | -$objDebug = InfraDebug::getInstance(); | ||
23 | - | ||
24 | - | ||
25 | -try { | ||
26 | - | ||
27 | - $objDebug->setBolLigado(false); | ||
28 | - $objDebug->setBolDebugInfra(true); | ||
29 | - $objDebug->limpar(); | ||
30 | - | ||
31 | - $objSessao->validarLink(); | ||
32 | - $objSessao->validarPermissao(PEN_RECURSO_ATUAL); | ||
33 | - | ||
34 | - $objBanco->abrirConexao(); | ||
35 | - | ||
36 | - | ||
37 | - //-------------------------------------------------------------------------- | ||
38 | - // Ações | ||
39 | - if(array_key_exists('acao', $_GET)) { | ||
40 | - | ||
41 | - $arrParam = array_merge($_GET, $_POST); | ||
42 | - | ||
43 | - switch($_GET['acao']) { | ||
44 | - | ||
45 | - case PEN_RECURSO_BASE.'_excluir': | ||
46 | - | ||
47 | - if(array_key_exists('hdnInfraItensSelecionados', $arrParam) && !empty($arrParam['hdnInfraItensSelecionados'])) { | ||
48 | - | ||
49 | - $objPenRelHipoteseLegalDTO = new PenRelHipoteseLegalDTO(); | ||
50 | - $objPenRelHipoteseLegalRN = new PenRelHipoteseLegalEnvioRN(); | ||
51 | - | ||
52 | - $arrParam['hdnInfraItensSelecionados'] = explode(',',$arrParam['hdnInfraItensSelecionados']); | ||
53 | - | ||
54 | - if(is_array($arrParam['hdnInfraItensSelecionados'])) { | ||
55 | - | ||
56 | - foreach($arrParam['hdnInfraItensSelecionados'] as $dblIdMap) { | ||
57 | - | ||
58 | - $objPenRelHipoteseLegalDTO->setDblIdMap($dblIdMap); | ||
59 | - $objPenRelHipoteseLegalRN->excluir($objPenRelHipoteseLegalDTO); | ||
60 | - } | ||
61 | - } | ||
62 | - else { | ||
63 | - | ||
64 | - $objPenRelHipoteseLegalDTO->setDblIdMap($arrParam['hdnInfraItensSelecionados']); | ||
65 | - $objPenRelHipoteseLegalRN->excluir($objPenRelHipoteseLegalDTO); | ||
66 | - } | ||
67 | - | ||
68 | - $objPagina->adicionarMensagem(sprintf('%s foi excluido com sucesso.', PEN_PAGINA_TITULO), InfraPagina::$TIPO_MSG_AVISO); | ||
69 | - | ||
70 | - header('Location: '.SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.$_GET['acao_retorno'].'&acao_origem='.$_GET['acao_origem'])); | ||
71 | - exit(0); | ||
72 | - } | ||
73 | - else { | ||
74 | - | ||
75 | - throw new InfraException('Nenhum Registro foi selecionado para executar esta ação'); | ||
76 | - } | ||
77 | - break; | ||
78 | - | ||
79 | - case PEN_RECURSO_BASE.'_desativar': | ||
80 | - | ||
81 | - if(array_key_exists('hdnInfraItensSelecionados', $arrParam) && !empty($arrParam['hdnInfraItensSelecionados'])) { | ||
82 | - | ||
83 | - PenRelHipoteseLegalRN::mudarEstado(explode(',', $arrParam['hdnInfraItensSelecionados']), 'N'); | ||
84 | - | ||
85 | - $objPagina->adicionarMensagem('Desativado com sucesso.', InfraPagina::$TIPO_MSG_AVISO); | ||
86 | - | ||
87 | - header('Location: '.SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.$_GET['acao_retorno'].'&acao_origem='.$_GET['acao_origem'])); | ||
88 | - exit(0); | ||
89 | - } | ||
90 | - else { | ||
91 | - | ||
92 | - throw new InfraException('Nenhum Registro foi selecionado para executar esta ação'); | ||
93 | - } | ||
94 | - break; | ||
95 | - | ||
96 | - case PEN_RECURSO_BASE.'_ativar': | ||
97 | - if(array_key_exists('hdnInfraItensSelecionados', $arrParam) && !empty($arrParam['hdnInfraItensSelecionados'])) { | ||
98 | - | ||
99 | - PenRelHipoteseLegalRN::mudarEstado(explode(',', $arrParam['hdnInfraItensSelecionados']), 'S'); | ||
100 | - | ||
101 | - $objPagina->adicionarMensagem('Ativado com sucesso.', InfraPagina::$TIPO_MSG_AVISO); | ||
102 | - | ||
103 | - header('Location: '.SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.$_GET['acao_retorno'].'&acao_origem='.$_GET['acao_origem'])); | ||
104 | - exit(0); | ||
105 | - } | ||
106 | - break; | ||
107 | - | ||
108 | - case PEN_RECURSO_BASE.'_listar': | ||
109 | - // Ação padrão desta tela | ||
110 | - break; | ||
111 | - | ||
112 | - default: | ||
113 | - throw new InfraException('Ação não permitida nesta tela'); | ||
114 | - | ||
115 | - } | ||
116 | - } | ||
117 | - //-------------------------------------------------------------------------- | ||
118 | - | ||
119 | - $arrComandos = array(); | ||
120 | - $arrComandos[] = '<button type="button" accesskey="P" onclick="onClickBtnPesquisar();" id="btnPesquisar" value="Pesquisar" class="infraButton">Pesquisar</button>'; | ||
121 | - $arrComandos[] = '<button type="button" value="Novo" onclick="onClickBtnNovo()" class="infraButton">Novo</button>'; | ||
122 | - //$arrComandos[] = '<button type="button" value="Ativar" onclick="onClickBtnAtivar()" class="infraButton">Ativar</button>'; | ||
123 | - //$arrComandos[] = '<button type="button" value="Desativar" onclick="onClickBtnDesativar()" class="infraButton">Desativar</button>'; | ||
124 | - $arrComandos[] = '<button type="button" value="Excluir" onclick="onClickBtnExcluir()" class="infraButton">Excluir</button>'; | ||
125 | - $arrComandos[] = '<button type="button" accesskey="I" id="btnImprimir" value="Imprimir" onclick="infraImprimirTabela();" class="infraButton">Imprimir</button>'; | ||
126 | - | ||
127 | - //-------------------------------------------------------------------------- | ||
128 | - // DTO de paginao | ||
129 | - | ||
130 | - $objPenRelHipoteseLegalDTO = new PenRelHipoteseLegalDTO(); | ||
131 | - $objPenRelHipoteseLegalDTO->setStrTipo('E'); | ||
132 | - $objPenRelHipoteseLegalDTO->retTodos(); | ||
133 | - //-------------------------------------------------------------------------- | ||
134 | - // Filtragem | ||
135 | - if(array_key_exists('id_barramento', $_POST) && (!empty($_POST['id_barramento']) && $_POST['id_barramento'] !== 'null')) { | ||
136 | - $objPenRelHipoteseLegalDTO->setNumIdBarramento($_POST['id_barramento']); | ||
137 | - } | ||
138 | - | ||
139 | - if(array_key_exists('id_hipotese_legal', $_POST) && (!empty($_POST['id_hipotese_legal']) && $_POST['id_barramento'] !== 'null')) { | ||
140 | - $objPenRelHipoteseLegalDTO->setNumIdHipoteseLegal($_POST['id_hipotese_legal']); | ||
141 | - } | ||
142 | - | ||
143 | - $objFiltroDTO = clone $objPenRelHipoteseLegalDTO; | ||
144 | - | ||
145 | - if(!$objFiltroDTO->isSetNumIdBarramento()) { | ||
146 | - $objFiltroDTO->setNumIdBarramento(''); | ||
147 | - } | ||
148 | - | ||
149 | - if(!$objFiltroDTO->isSetNumIdHipoteseLegal()) { | ||
150 | - $objFiltroDTO->setNumIdHipoteseLegal(''); | ||
151 | - } | ||
152 | - //-------------------------------------------------------------------------- | ||
153 | - $objGenericoBD = new GenericoBD($objBanco); | ||
154 | - | ||
155 | - // Mapeamento da hipotese legal remota | ||
156 | - $objPenHipoteseLegalDTO = new PenHipoteseLegalDTO(); | ||
157 | - $objPenHipoteseLegalDTO->setDistinct(true); | ||
158 | - $objPenHipoteseLegalDTO->setOrdStrNome(InfraDTO::$TIPO_ORDENACAO_ASC); | ||
159 | - $objPenHipoteseLegalDTO->retNumIdHipoteseLegal(); | ||
160 | - $objPenHipoteseLegalDTO->retStrNome(); | ||
161 | - | ||
162 | - $objPenHipoteseLegalRN = new PenHipoteseLegalRN(); | ||
163 | - $arrMapIdBarramento = InfraArray::converterArrInfraDTO($objPenHipoteseLegalRN->listar($objPenHipoteseLegalDTO), 'Nome', 'IdHipoteseLegal'); | ||
164 | - | ||
165 | - // Mapeamento da hipotese legal local | ||
166 | - $objHipoteseLegalDTO = new HipoteseLegalDTO(); | ||
167 | - $objHipoteseLegalDTO->setDistinct(true); | ||
168 | - $objHipoteseLegalDTO->setStrStaNivelAcesso(ProtocoloRN::$NA_RESTRITO); //Restrito | ||
169 | - $objHipoteseLegalDTO->setStrSinAtivo('S'); | ||
170 | - $objHipoteseLegalDTO->setOrdStrNome(InfraDTO::$TIPO_ORDENACAO_ASC); | ||
171 | - $objHipoteseLegalDTO->retNumIdHipoteseLegal(); | ||
172 | - $objHipoteseLegalDTO->retStrNome(); | ||
173 | - | ||
174 | - $objHipoteseLegalRN = new HipoteseLegalRN(); | ||
175 | - $arrMapIdHipoteseLegal = InfraArray::converterArrInfraDTO($objHipoteseLegalRN->listar($objHipoteseLegalDTO), 'Nome', 'IdHipoteseLegal'); | ||
176 | - //-------------------------------------------------------------------------- | ||
177 | - // | ||
178 | - //$objPagina->prepararOrdenacao($objPenRelHipoteseLegalDTO, 'IdMapeamento', InfraDTO::$TIPO_ORDENACAO_ASC); | ||
179 | - $objPagina->prepararPaginacao($objPenRelHipoteseLegalDTO); | ||
180 | - | ||
181 | - $arrObjPenRelHipoteseLegalDTO = $objGenericoBD->listar($objPenRelHipoteseLegalDTO); | ||
182 | - | ||
183 | - $objPagina->processarPaginacao($objPenRelHipoteseLegalDTO); | ||
184 | - | ||
185 | - $numRegistros = count($arrObjPenRelHipoteseLegalDTO); | ||
186 | - | ||
187 | - if(!empty($arrObjPenRelHipoteseLegalDTO)){ | ||
188 | - | ||
189 | - $strResultado = ''; | ||
190 | - | ||
191 | - $strResultado .= '<table width="99%" class="infraTable">'."\n"; | ||
192 | - $strResultado .= '<caption class="infraCaption">'.$objPagina->gerarCaptionTabela(PEN_PAGINA_TITULO, $numRegistros).'</caption>'; | ||
193 | - | ||
194 | - $strResultado .= '<tr>'; | ||
195 | - $strResultado .= '<th class="infraTh" width="1%">'.$objPagina->getThCheck().'</th>'."\n"; | ||
196 | - $strResultado .= '<th class="infraTh" width="35%">Hipótese Legal - SEI '.$objSessao->getStrSiglaOrgaoUnidadeAtual().'</th>'."\n"; | ||
197 | - $strResultado .= '<th class="infraTh" width="35%">Hipótese Legal - Tramitação PEN</th>'."\n"; | ||
198 | - $strResultado .= '<th class="infraTh" width="14%">Ações</th>'."\n"; | ||
199 | - $strResultado .= '</tr>'."\n"; | ||
200 | - $strCssTr = ''; | ||
201 | - | ||
202 | - $index = 0; | ||
203 | - foreach($arrObjPenRelHipoteseLegalDTO as $objPenRelHipoteseLegalDTO) { | ||
204 | - | ||
205 | - $strCssTr = ($strCssTr == 'infraTrClara') ? 'infraTrEscura' : 'infraTrClara'; | ||
206 | - | ||
207 | - $strResultado .= '<tr class="'.$strCssTr.'">'; | ||
208 | - $strResultado .= '<td>'.$objPagina->getTrCheck($index, $objPenRelHipoteseLegalDTO->getDblIdMap(), '').'</td>'; | ||
209 | - $strResultado .= '<td>'.$arrMapIdHipoteseLegal[$objPenRelHipoteseLegalDTO->getNumIdHipoteseLegal()].'</td>'; | ||
210 | - $strResultado .= '<td>'.$arrMapIdBarramento[$objPenRelHipoteseLegalDTO->getNumIdBarramento()].'</td>'; | ||
211 | - $strResultado .= '<td align="center">'; | ||
212 | - | ||
213 | - //$strResultado .= '<a href="'.$objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_visualizar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao'].'&'.PEN_PAGINA_GET_ID.'='.$objPenRelHipoteseLegalDTO->getDblIdMap()).'"><img src="imagens/consultar.gif" title="Consultar Mapeamento" alt="Consultar Mapeamento" class="infraImg"></a>'; | ||
214 | - if($objSessao->verificarPermissao('pen_map_hipotese_legal_enviado_alterar')) { | ||
215 | - $strResultado .= '<a href="'.$objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_cadastrar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao'].'&'.PEN_PAGINA_GET_ID.'='.$objPenRelHipoteseLegalDTO->getDblIdMap()).'"><img src="imagens/alterar.gif" title="Alterar Mapeamento" alt="Alterar Mapeamento" class="infraImg"></a>'; | ||
216 | - } | ||
217 | - | ||
218 | - if($objSessao->verificarPermissao('pen_map_hipotese_legal_enviado_excluir')) { | ||
219 | - $strResultado .= '<a href="#" onclick="onCLickLinkDelete(\''.$objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_excluir&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao'].'&hdnInfraItensSelecionados='.$objPenRelHipoteseLegalDTO->getDblIdMap()).'\', this)"><img src="imagens/excluir.gif" title="Excluir Mapeamento" alt="Excluir Mapeamento" class="infraImg"></a>'; | ||
220 | - } | ||
221 | - | ||
222 | - $strResultado .= '</td>'; | ||
223 | - $strResultado .= '</tr>'."\n"; | ||
224 | - | ||
225 | - $index++; | ||
226 | - } | ||
227 | - $strResultado .= '</table>'; | ||
228 | - } | ||
229 | -} | ||
230 | -catch(InfraException $e){ | ||
231 | - | ||
232 | - print '<pre>'; | ||
233 | - print_r($e); | ||
234 | - print '</pre>'; | ||
235 | - exit(0); | ||
236 | - //$objPagina->processarExcecao($e); | ||
237 | -} | ||
238 | - | ||
239 | - | ||
240 | -$objPagina->montarDocType(); | ||
241 | -$objPagina->abrirHtml(); | ||
242 | -$objPagina->abrirHead(); | ||
243 | -$objPagina->montarMeta(); | ||
244 | -$objPagina->montarTitle(':: '.$objPagina->getStrNomeSistema().' - '.PEN_PAGINA_TITULO.' ::'); | ||
245 | -$objPagina->montarStyle(); | ||
246 | -?> | ||
247 | -<style type="text/css"> | ||
248 | - | ||
249 | -.input-label-first{position:absolute;left:0%;top:0%;width:25%; color: #666!important} | ||
250 | -.input-field-first{position:absolute;left:0%;top:15%;width:25%} | ||
251 | - | ||
252 | -.input-label-second{position:absolute;left:30%;top:0%;width:25%; color: #666!important} | ||
253 | -.input-field-second{position:absolute;left:30%;top:15%;width:25%;} | ||
254 | - | ||
255 | -.input-label-third {position:absolute;left:0%;top:40%;width:25%; color:#666!important} | ||
256 | -.input-field-third {position:absolute;left:0%;top:55%;width:25%;} | ||
257 | - | ||
258 | -</style> | ||
259 | -<?php $objPagina->montarJavaScript(); ?> | ||
260 | -<script type="text/javascript"> | ||
261 | - | ||
262 | -function inicializar(){ | ||
263 | - | ||
264 | - infraEfeitoTabelas(); | ||
265 | - | ||
266 | -} | ||
267 | - | ||
268 | -function onClickBtnPesquisar(){ | ||
269 | - document.getElementById('frmAcompanharEstadoProcesso').action='<?php print $objSessao->assinarLink('controlador.php?acao='.$_GET['acao'].'&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao_retorno']); ?>'; | ||
270 | - document.getElementById('frmAcompanharEstadoProcesso').submit(); | ||
271 | -} | ||
272 | - | ||
273 | -function tratarEnter(ev){ | ||
274 | - var key = infraGetCodigoTecla(ev); | ||
275 | - if (key == 13){ | ||
276 | - onClickBtnPesquisar(); | ||
277 | - } | ||
278 | - return true; | ||
279 | -} | ||
280 | - | ||
281 | -function onCLickLinkDelete(url, link) { | ||
282 | - | ||
283 | - var row = jQuery(link).parents('tr:first'); | ||
284 | - | ||
285 | - var strEspecieDocumental = row.find('td:eq(1)').text(); | ||
286 | - var strTipoDocumento = row.find('td:eq(2)').text(); | ||
287 | - | ||
288 | - if(confirm('Confirma a exclusão do mapeamento "' + strEspecieDocumental + ' x ' + strTipoDocumento +'"?')){ | ||
289 | - | ||
290 | - window.location = url; | ||
291 | - } | ||
292 | - | ||
293 | -} | ||
294 | - | ||
295 | -function onClickBtnNovo(){ | ||
296 | - | ||
297 | - window.location = '<?php print $objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_cadastrar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao_origem']); ?>'; | ||
298 | -} | ||
299 | - | ||
300 | -function onClickBtnAtivar(){ | ||
301 | - | ||
302 | - try { | ||
303 | - | ||
304 | - var form = jQuery('#frmAcompanharEstadoProcesso'); | ||
305 | - form.attr('action', '<?php print $objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_ativar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.PEN_RECURSO_BASE.'_listar'); ?>'); | ||
306 | - form.submit(); | ||
307 | - } | ||
308 | - catch(e){ | ||
309 | - | ||
310 | - alert('Erro : ' + e.message); | ||
311 | - } | ||
312 | - | ||
313 | -} | ||
314 | - | ||
315 | -function onClickBtnDesativar(){ | ||
316 | - | ||
317 | - try { | ||
318 | - | ||
319 | - var form = jQuery('#frmAcompanharEstadoProcesso'); | ||
320 | - form.attr('action', '<?php print $objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_desativar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.PEN_RECURSO_BASE.'_listar'); ?>'); | ||
321 | - form.submit(); | ||
322 | - } | ||
323 | - catch(e){ | ||
324 | - | ||
325 | - alert('Erro : ' + e.message); | ||
326 | - } | ||
327 | -} | ||
328 | - | ||
329 | -function onClickBtnExcluir(){ | ||
330 | - | ||
331 | - try { | ||
332 | - | ||
333 | - var len = jQuery('input[name*=chkInfraItem]:checked').length; | ||
334 | - | ||
335 | - if(len > 0){ | ||
336 | - | ||
337 | - if(confirm('Confirma a exclusão de ' + len + ' mapeamento(s) ?')) { | ||
338 | - var form = jQuery('#frmAcompanharEstadoProcesso'); | ||
339 | - form.attr('action', '<?php print $objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_excluir&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.PEN_RECURSO_BASE.'_listar'); ?>'); | ||
340 | - form.submit(); | ||
341 | - } | ||
342 | - } | ||
343 | - else { | ||
344 | - | ||
345 | - alert('Selecione pelo menos um mapeamento para Excluir'); | ||
346 | - } | ||
347 | - } | ||
348 | - catch(e){ | ||
349 | - | ||
350 | - alert('Erro : ' + e.message); | ||
351 | - } | ||
352 | -} | ||
353 | - | ||
354 | -</script> | ||
355 | -<?php | ||
356 | -$objPagina->fecharHead(); | ||
357 | -$objPagina->abrirBody(PEN_PAGINA_TITULO,'onload="inicializar();"'); | ||
358 | -?> | ||
359 | -<form id="frmAcompanharEstadoProcesso" method="post" action="<?php// print $objSessao->assinarLink($strProprioLink); ?>"> | ||
360 | - | ||
361 | - <?php $objPagina->montarBarraComandosSuperior($arrComandos); ?> | ||
362 | - <?php //$objPagina->montarAreaValidacao(); ?> | ||
363 | - <?php $objPagina->abrirAreaDados('12em'); ?> | ||
364 | - | ||
365 | - <label for="id_hipotese_legal" class="infraLabelObrigatorio input-label-first">Hipótese Legal - SEI <?php print $objSessao->getStrSiglaOrgaoUnidadeAtual(); ?>:</label> | ||
366 | - <select name="id_hipotese_legal" class="infraSelect input-field-first"<?php if($bolSomenteLeitura): ?> disabled="disabled" readonly="readonly"<?php endif; ?>> | ||
367 | - <?php print InfraINT::montarSelectArray('', 'Selecione', $objFiltroDTO->getNumIdHipoteseLegal(), $arrMapIdHipoteseLegal); ?> | ||
368 | - </select> | ||
369 | - | ||
370 | - <label for="id_barramento" class="infraLabelObrigatorio input-label-second">Hipótese Legal - Tramitação PEN:</label> | ||
371 | - <select name="id_barramento" class="infraSelect input-field-second"<?php if($bolSomenteLeitura): ?> disabled="disabled" readonly="readonly"<?php endif; ?>> | ||
372 | - <?php print InfraINT::montarSelectArray('', 'Selecione', $objFiltroDTO->getNumIdBarramento(), $arrMapIdBarramento); ?> | ||
373 | - </select> | ||
374 | - | ||
375 | - | ||
376 | - <?php $objPagina->fecharAreaDados(); ?> | ||
377 | - | ||
378 | - <?php if($numRegistros > 0): ?> | ||
379 | - <?php $objPagina->montarAreaTabela($strResultado, $numRegistros); ?> | ||
380 | - <?php //$objPagina->montarAreaDebug(); ?> | ||
381 | - <?php else: ?> | ||
382 | - <div style="clear:both"></div> | ||
383 | - <p>Nenhum mapeamento foi encontrado</p> | ||
384 | - <?php endif; ?> | ||
385 | -</form> | ||
386 | -<?php $objPagina->fecharBody(); ?> | ||
387 | -<?php $objPagina->fecharHtml(); ?> |
@@ -0,0 +1,219 @@ | @@ -0,0 +1,219 @@ | ||
1 | +<?php | ||
2 | +/** | ||
3 | + * | ||
4 | + * @author Join Tecnologia | ||
5 | + */ | ||
6 | + | ||
7 | +require_once dirname(__FILE__) . '/../../SEI.php'; | ||
8 | + | ||
9 | +session_start(); | ||
10 | + | ||
11 | +define('PEN_RECURSO_ATUAL', 'pen_map_hipotese_legal_envio_cadastrar'); | ||
12 | +define('PEN_RECURSO_BASE', 'pen_map_hipotese_legal_envio'); | ||
13 | +define('PEN_PAGINA_TITULO', 'Mapeamento de Hipóteses Legais de Envio'); | ||
14 | +define('PEN_PAGINA_GET_ID', 'id_mapeamento'); | ||
15 | + | ||
16 | +$objPagina = PaginaSEI::getInstance(); | ||
17 | +$objBanco = BancoSEI::getInstance(); | ||
18 | +$objSessao = SessaoSEI::getInstance(); | ||
19 | + | ||
20 | +try { | ||
21 | + | ||
22 | + $objBanco->abrirConexao(); | ||
23 | + | ||
24 | + $objSessao->validarLink(); | ||
25 | + $objSessao->validarPermissao(PEN_RECURSO_ATUAL); | ||
26 | + | ||
27 | + $arrComandos = array(); | ||
28 | + | ||
29 | + $bolSomenteLeitura = false; | ||
30 | + | ||
31 | + switch ($_GET['acao']) { | ||
32 | + case PEN_RECURSO_BASE.'_cadastrar': | ||
33 | + $arrComandos[] = '<button type="submit" id="btnSalvar" value="Salvar" class="infraButton"><span class="infraTeclaAtalho">S</span>alvar</button>'; | ||
34 | + $arrComandos[] = '<button type="button" id="btnCancelar" value="Cancelar" onclick="location.href=\'' . $objPagina->formatarXHTML($objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_listar&acao_origem=' . $_GET['acao'])) . '\';" class="infraButton"><span class="infraTeclaAtalho">C</span>ancelar</button>'; | ||
35 | + | ||
36 | + if(array_key_exists(PEN_PAGINA_GET_ID, $_GET) && !empty($_GET[PEN_PAGINA_GET_ID])){ | ||
37 | + $strTitulo = sprintf('Editar %s', PEN_PAGINA_TITULO); | ||
38 | + } | ||
39 | + else { | ||
40 | + $strTitulo = sprintf('Novo %s', PEN_PAGINA_TITULO); | ||
41 | + } | ||
42 | + break; | ||
43 | + | ||
44 | + case PEN_RECURSO_BASE.'_visualizar': | ||
45 | + $arrComandos[] = '<button type="button" name="btnFechar" value="Fechar" class="infraButton" onclick="location.href=\'' . $objPagina->formatarXHTML($objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_listar&acao_origem=' . $_GET['acao'])) . '\';"><span class="infraTeclaAtalho">F</span>echar</button>'; | ||
46 | + $bolSomenteLeitura = true; | ||
47 | + $strTitulo = sprintf('Consultar %s', PEN_PAGINA_TITULO); | ||
48 | + break; | ||
49 | + | ||
50 | + | ||
51 | + default: | ||
52 | + throw new InfraException("Ação '" . $_GET['acao'] . "' não reconhecida."); | ||
53 | + } | ||
54 | + | ||
55 | + $objPenRelHipoteseLegalRN = new PenRelHipoteseLegalEnvioRN(); | ||
56 | + | ||
57 | + //-------------------------------------------------------------------------- | ||
58 | + // Ao por POST esta salvando o formulrio | ||
59 | + if(strtoupper($_SERVER['REQUEST_METHOD']) === 'POST') { | ||
60 | + | ||
61 | + if(!array_key_exists('id_hipotese_legal', $_POST) || empty($_POST['id_hipotese_legal'])) { | ||
62 | + throw new InfraException('Nenhuma "Espécie Documental" foi selecionada'); | ||
63 | + } | ||
64 | + | ||
65 | + if(!array_key_exists('id_barramento', $_POST) || empty($_POST['id_barramento'])) { | ||
66 | + throw new InfraException('Nenhum "Tipo de Documento" foi selecionado'); | ||
67 | + } | ||
68 | + | ||
69 | + $objPenRelHipoteseLegalDTO = new PenRelHipoteseLegalDTO(); | ||
70 | + $objPenRelHipoteseLegalDTO->setNumIdHipoteseLegal($_POST['id_hipotese_legal']); | ||
71 | + $objPenRelHipoteseLegalDTO->setNumIdBarramento($_POST['id_barramento']); | ||
72 | + $objPenRelHipoteseLegalDTO->setStrTipo('E');// Enviado | ||
73 | + | ||
74 | + $numIdMapeamento = 0; | ||
75 | + if(array_key_exists(PEN_PAGINA_GET_ID, $_GET) && !empty($_GET[PEN_PAGINA_GET_ID])) { | ||
76 | + $objPenRelHipoteseLegalDTO->setDblIdMap($_GET[PEN_PAGINA_GET_ID]); | ||
77 | + $mapeamento = $objPenRelHipoteseLegalRN->alterar($objPenRelHipoteseLegalDTO); | ||
78 | + $numIdMapeamento = $_GET[PEN_PAGINA_GET_ID]; | ||
79 | + } | ||
80 | + else { | ||
81 | + $mapeamento = $objPenRelHipoteseLegalRN->cadastrar($objPenRelHipoteseLegalDTO); | ||
82 | + $numIdMapeamento = $mapeamento->getDblIdMap(); | ||
83 | + } | ||
84 | + | ||
85 | + header('Location: '.$objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_listar&acao_origem='.$_GET['acao'].'&id_mapeamento='.$numIdMapeamento.PaginaSEI::getInstance()->montarAncora($numIdMapeamento))); | ||
86 | + exit(0); | ||
87 | + } | ||
88 | + // Ao por GET + ID esta carregando o formulrio | ||
89 | + else if(array_key_exists(PEN_PAGINA_GET_ID, $_GET) && !empty($_GET[PEN_PAGINA_GET_ID])){ | ||
90 | + | ||
91 | + $objPenRelHipoteseLegalDTO = new PenRelHipoteseLegalDTO(); | ||
92 | + $objPenRelHipoteseLegalDTO->setDblIdMap($_GET[PEN_PAGINA_GET_ID]); | ||
93 | + $objPenRelHipoteseLegalDTO->retTodos(); | ||
94 | + | ||
95 | + $objEspecieDocumentalBD = new GenericoBD(BancoSEI::getInstance()); | ||
96 | + $objPenRelHipoteseLegalDTO = $objEspecieDocumentalBD->consultar($objPenRelHipoteseLegalDTO); | ||
97 | + } | ||
98 | + | ||
99 | + if(empty($objPenRelHipoteseLegalDTO)){ | ||
100 | + $objPenRelHipoteseLegalDTO = new PenRelHipoteseLegalDTO(); | ||
101 | + $objPenRelHipoteseLegalDTO->setNumIdHipoteseLegal(0); | ||
102 | + $objPenRelHipoteseLegalDTO->setNumIdBarramento(0); | ||
103 | + } | ||
104 | + | ||
105 | + | ||
106 | + if(array_key_exists(PEN_PAGINA_GET_ID, $_GET) && !empty($_GET[PEN_PAGINA_GET_ID])) { | ||
107 | + $objPenRelHipoteseLegalDTO->setDblIdMap($_GET[PEN_PAGINA_GET_ID]); | ||
108 | + } | ||
109 | + | ||
110 | + //-------------------------------------------------------------------------- | ||
111 | + // Auto-Complete | ||
112 | + //-------------------------------------------------------------------------- | ||
113 | + // Mapeamento da hipotese legal do local j utilizados | ||
114 | + $arrNumIdHipoteseLegal = $objPenRelHipoteseLegalRN->getIdHipoteseLegalEmUso($objPenRelHipoteseLegalDTO, 'E'); | ||
115 | + | ||
116 | + // Mapeamento da hipotese legal local | ||
117 | + $objHipoteseLegalDTO = new HipoteseLegalDTO(); | ||
118 | + if(!empty($arrNumIdHipoteseLegal)) { | ||
119 | + // Remove os que j esto em uso | ||
120 | + $objHipoteseLegalDTO->setNumIdHipoteseLegal($arrNumIdHipoteseLegal, InfraDTO::$OPER_NOT_IN); | ||
121 | + } | ||
122 | + $objHipoteseLegalDTO->setStrStaNivelAcesso(ProtocoloRN::$NA_RESTRITO); //Restrito | ||
123 | + $objHipoteseLegalDTO->setStrSinAtivo('S'); | ||
124 | + $objHipoteseLegalDTO->setOrdStrNome(InfraDTO::$TIPO_ORDENACAO_ASC); | ||
125 | + $objHipoteseLegalDTO->retNumIdHipoteseLegal(); | ||
126 | + $objHipoteseLegalDTO->retStrNome(); | ||
127 | + | ||
128 | + $objHipoteseLegalRN = new HipoteseLegalRN(); | ||
129 | + $arrMapIdHipoteseLegal = InfraArray::converterArrInfraDTO($objHipoteseLegalRN->listar($objHipoteseLegalDTO), 'Nome', 'IdHipoteseLegal'); | ||
130 | + | ||
131 | + // Mapeamento da hipotese legal remota | ||
132 | + $objPenHipoteseLegalDTO = new PenHipoteseLegalDTO(); | ||
133 | + $objPenHipoteseLegalDTO->setOrdStrNome(InfraDTO::$TIPO_ORDENACAO_ASC); | ||
134 | + $objPenHipoteseLegalDTO->retNumIdHipoteseLegal(); | ||
135 | + $objPenHipoteseLegalDTO->retStrNome(); | ||
136 | + | ||
137 | + $objPenHipoteseLegalRN = new PenHipoteseLegalRN(); | ||
138 | + $arrMapIdBarramento = InfraArray::converterArrInfraDTO($objPenHipoteseLegalRN->listar($objPenHipoteseLegalDTO), 'Nome', 'IdHipoteseLegal'); | ||
139 | + //-------------------------------------------------------------------------- | ||
140 | +} | ||
141 | +catch (InfraException $e) { | ||
142 | + $objPagina->processarExcecao($e); | ||
143 | +} | ||
144 | +catch(Exception $e) { | ||
145 | + $objPagina->processarExcecao($e); | ||
146 | +} | ||
147 | + | ||
148 | +// View | ||
149 | +ob_clean(); | ||
150 | + | ||
151 | +$objPagina->montarDocType(); | ||
152 | +$objPagina->abrirHtml(); | ||
153 | +$objPagina->abrirHead(); | ||
154 | +$objPagina->montarMeta(); | ||
155 | +$objPagina->montarTitle(':: ' . $objPagina->getStrNomeSistema() . ' - ' . $strTitulo . ' ::'); | ||
156 | +$objPagina->montarStyle(); | ||
157 | +?> | ||
158 | +<style type="text/css"> | ||
159 | + | ||
160 | +.input-label-first{position:absolute;left:0%;top:0%;width:25%; color: #666!important} | ||
161 | +.input-field-first{position:absolute;left:0%;top:15%;width:25%} | ||
162 | + | ||
163 | +.input-label-third {position:absolute;left:0%;top:40%;width:25%; color:#666!important} | ||
164 | +.input-field-third {position:absolute;left:0%;top:55%;width:25%;} | ||
165 | + | ||
166 | +</style> | ||
167 | +<?php $objPagina->montarJavaScript(); ?> | ||
168 | +<script type="text/javascript"> | ||
169 | + | ||
170 | +function inicializar(){ | ||
171 | + | ||
172 | + | ||
173 | +} | ||
174 | + | ||
175 | +function onSubmit() { | ||
176 | + | ||
177 | + var form = jQuery('#<?php print PEN_RECURSO_BASE; ?>_form'); | ||
178 | + var field = jQuery('select[name=id_hipotese_legal]', form); | ||
179 | + | ||
180 | + if(field.val() === 'null'){ | ||
181 | + alert('Nenhuma "Hipótese Legal - SEI <?php print $objSessao->getStrSiglaOrgaoUnidadeAtual(); ?>" foi selecionada'); | ||
182 | + field.focus(); | ||
183 | + return false; | ||
184 | + } | ||
185 | + | ||
186 | + field = jQuery('select[name=id_barramento]', form); | ||
187 | + | ||
188 | + if(field.val() === 'null'){ | ||
189 | + alert('Nenhum "Hipótese Legal - Tramitação PEN" foi selecionado'); | ||
190 | + field.focus(); | ||
191 | + return false; | ||
192 | + } | ||
193 | +} | ||
194 | + | ||
195 | +</script> | ||
196 | +<?php | ||
197 | +$objPagina->fecharHead(); | ||
198 | +$objPagina->abrirBody($strTitulo,'onload="inicializar();"'); | ||
199 | +?> | ||
200 | +<form id="<?php print PEN_RECURSO_BASE; ?>_form" onsubmit="return onSubmit();" method="post" action="<?php //print $objSessaoSEI->assinarLink($strProprioLink); ?>"> | ||
201 | + <?php $objPagina->montarBarraComandosSuperior($arrComandos); ?> | ||
202 | + <?php $objPagina->montarAreaValidacao(); ?> | ||
203 | + <?php $objPagina->abrirAreaDados('12em'); ?> | ||
204 | + | ||
205 | + <label for="id_hipotese_legal" class="infraLabelObrigatorio input-label-first">Hipótese Legal - SEI <?php print $objSessao->getStrSiglaOrgaoUnidadeAtual(); ?>:</label> | ||
206 | + | ||
207 | + <select name="id_hipotese_legal" class="infraSelect input-field-first"<?php if($bolSomenteLeitura): ?> disabled="disabled" readonly="readonly"<?php endif; ?>> | ||
208 | + <?php print InfraINT::montarSelectArray('', 'Selecione', $objPenRelHipoteseLegalDTO->getNumIdHipoteseLegal(), $arrMapIdHipoteseLegal); ?> | ||
209 | + </select> | ||
210 | + | ||
211 | + <label for="id_barramento" class="infraLabelObrigatorio input-label-third">Hipótese Legal - Tramitação PEN:</label> | ||
212 | + <select name="id_barramento" class="infraSelect input-field-third"<?php if($bolSomenteLeitura): ?> disabled="disabled" readonly="readonly"<?php endif; ?>> | ||
213 | + <?php print InfraINT::montarSelectArray('', 'Selecione', $objPenRelHipoteseLegalDTO->getNumIdBarramento(), $arrMapIdBarramento); ?> | ||
214 | + </select> | ||
215 | + | ||
216 | + <?php print $objPagina->fecharAreaDados(); ?> | ||
217 | +</form> | ||
218 | +<?php $objPagina->fecharBody(); ?> | ||
219 | +<?php $objPagina->fecharHtml(); ?> |
@@ -0,0 +1,385 @@ | @@ -0,0 +1,385 @@ | ||
1 | +<?php | ||
2 | + | ||
3 | +require_once dirname(__FILE__) . '/../../SEI.php'; | ||
4 | + | ||
5 | +/** | ||
6 | + * Consulta os logs do estado do procedimento ao ser expedido | ||
7 | + * | ||
8 | + * @author Join Tecnologia | ||
9 | + */ | ||
10 | + | ||
11 | +session_start(); | ||
12 | + | ||
13 | +define('PEN_RECURSO_ATUAL', 'pen_map_hipotese_legal_envio_listar'); | ||
14 | +define('PEN_RECURSO_BASE', 'pen_map_hipotese_legal_envio'); | ||
15 | +define('PEN_PAGINA_TITULO', 'Mapeamento de Hipóteses Legais de Envio'); | ||
16 | +define('PEN_PAGINA_GET_ID', 'id_mapeamento'); | ||
17 | + | ||
18 | + | ||
19 | +$objPagina = PaginaSEI::getInstance(); | ||
20 | +$objBanco = BancoSEI::getInstance(); | ||
21 | +$objSessao = SessaoSEI::getInstance(); | ||
22 | +$objDebug = InfraDebug::getInstance(); | ||
23 | + | ||
24 | + | ||
25 | +try { | ||
26 | + | ||
27 | + $objDebug->setBolLigado(false); | ||
28 | + $objDebug->setBolDebugInfra(true); | ||
29 | + $objDebug->limpar(); | ||
30 | + | ||
31 | + $objSessao->validarLink(); | ||
32 | + $objSessao->validarPermissao(PEN_RECURSO_ATUAL); | ||
33 | + | ||
34 | + $objBanco->abrirConexao(); | ||
35 | + | ||
36 | + | ||
37 | + //-------------------------------------------------------------------------- | ||
38 | + // Ações | ||
39 | + if(array_key_exists('acao', $_GET)) { | ||
40 | + | ||
41 | + $arrParam = array_merge($_GET, $_POST); | ||
42 | + | ||
43 | + switch($_GET['acao']) { | ||
44 | + | ||
45 | + case PEN_RECURSO_BASE.'_excluir': | ||
46 | + | ||
47 | + if(array_key_exists('hdnInfraItensSelecionados', $arrParam) && !empty($arrParam['hdnInfraItensSelecionados'])) { | ||
48 | + | ||
49 | + $objPenRelHipoteseLegalDTO = new PenRelHipoteseLegalDTO(); | ||
50 | + $objPenRelHipoteseLegalRN = new PenRelHipoteseLegalEnvioRN(); | ||
51 | + | ||
52 | + $arrParam['hdnInfraItensSelecionados'] = explode(',',$arrParam['hdnInfraItensSelecionados']); | ||
53 | + | ||
54 | + if(is_array($arrParam['hdnInfraItensSelecionados'])) { | ||
55 | + | ||
56 | + foreach($arrParam['hdnInfraItensSelecionados'] as $dblIdMap) { | ||
57 | + | ||
58 | + $objPenRelHipoteseLegalDTO->setDblIdMap($dblIdMap); | ||
59 | + $objPenRelHipoteseLegalRN->excluir($objPenRelHipoteseLegalDTO); | ||
60 | + } | ||
61 | + } | ||
62 | + else { | ||
63 | + | ||
64 | + $objPenRelHipoteseLegalDTO->setDblIdMap($arrParam['hdnInfraItensSelecionados']); | ||
65 | + $objPenRelHipoteseLegalRN->excluir($objPenRelHipoteseLegalDTO); | ||
66 | + } | ||
67 | + | ||
68 | + $objPagina->adicionarMensagem(sprintf('%s foi excluido com sucesso.', PEN_PAGINA_TITULO), InfraPagina::$TIPO_MSG_AVISO); | ||
69 | + | ||
70 | + header('Location: '.SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.$_GET['acao_retorno'].'&acao_origem='.$_GET['acao_origem'])); | ||
71 | + exit(0); | ||
72 | + } | ||
73 | + else { | ||
74 | + | ||
75 | + throw new InfraException('Nenhum Registro foi selecionado para executar esta ação'); | ||
76 | + } | ||
77 | + break; | ||
78 | + | ||
79 | + case PEN_RECURSO_BASE.'_desativar': | ||
80 | + | ||
81 | + if(array_key_exists('hdnInfraItensSelecionados', $arrParam) && !empty($arrParam['hdnInfraItensSelecionados'])) { | ||
82 | + | ||
83 | + PenRelHipoteseLegalRN::mudarEstado(explode(',', $arrParam['hdnInfraItensSelecionados']), 'N'); | ||
84 | + | ||
85 | + $objPagina->adicionarMensagem('Desativado com sucesso.', InfraPagina::$TIPO_MSG_AVISO); | ||
86 | + | ||
87 | + header('Location: '.SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.$_GET['acao_retorno'].'&acao_origem='.$_GET['acao_origem'])); | ||
88 | + exit(0); | ||
89 | + } | ||
90 | + else { | ||
91 | + | ||
92 | + throw new InfraException('Nenhum Registro foi selecionado para executar esta ação'); | ||
93 | + } | ||
94 | + break; | ||
95 | + | ||
96 | + case PEN_RECURSO_BASE.'_ativar': | ||
97 | + if(array_key_exists('hdnInfraItensSelecionados', $arrParam) && !empty($arrParam['hdnInfraItensSelecionados'])) { | ||
98 | + | ||
99 | + PenRelHipoteseLegalRN::mudarEstado(explode(',', $arrParam['hdnInfraItensSelecionados']), 'S'); | ||
100 | + | ||
101 | + $objPagina->adicionarMensagem('Ativado com sucesso.', InfraPagina::$TIPO_MSG_AVISO); | ||
102 | + | ||
103 | + header('Location: '.SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.$_GET['acao_retorno'].'&acao_origem='.$_GET['acao_origem'])); | ||
104 | + exit(0); | ||
105 | + } | ||
106 | + break; | ||
107 | + | ||
108 | + case PEN_RECURSO_BASE.'_listar': | ||
109 | + // Ação padrão desta tela | ||
110 | + break; | ||
111 | + | ||
112 | + default: | ||
113 | + throw new InfraException('Ação não permitida nesta tela'); | ||
114 | + | ||
115 | + } | ||
116 | + } | ||
117 | + //-------------------------------------------------------------------------- | ||
118 | + | ||
119 | + $arrComandos = array(); | ||
120 | + $arrComandos[] = '<button type="button" accesskey="P" onclick="onClickBtnPesquisar();" id="btnPesquisar" value="Pesquisar" class="infraButton"><span class="infraTeclaAtalho">P</span>esquisar</button>'; | ||
121 | + $arrComandos[] = '<button type="button" value="Novo" onclick="onClickBtnNovo()" class="infraButton"><span class="infraTeclaAtalho">N</span>ovo</button>'; | ||
122 | + $arrComandos[] = '<button type="button" value="Excluir" onclick="onClickBtnExcluir()" class="infraButton"><span class="infraTeclaAtalho">E</span>xcluir</button>'; | ||
123 | + $arrComandos[] = '<button type="button" accesskey="I" id="btnImprimir" value="Imprimir" onclick="infraImprimirTabela();" class="infraButton"><span class="infraTeclaAtalho">I</span>mprimir</button>'; | ||
124 | + | ||
125 | + //-------------------------------------------------------------------------- | ||
126 | + // DTO de paginao | ||
127 | + | ||
128 | + $objPenRelHipoteseLegalDTO = new PenRelHipoteseLegalDTO(); | ||
129 | + $objPenRelHipoteseLegalDTO->setStrTipo('E'); | ||
130 | + $objPenRelHipoteseLegalDTO->retTodos(); | ||
131 | + //-------------------------------------------------------------------------- | ||
132 | + // Filtragem | ||
133 | + if(array_key_exists('id_barramento', $_POST) && (!empty($_POST['id_barramento']) && $_POST['id_barramento'] !== 'null')) { | ||
134 | + $objPenRelHipoteseLegalDTO->setNumIdBarramento($_POST['id_barramento']); | ||
135 | + } | ||
136 | + | ||
137 | + if(array_key_exists('id_hipotese_legal', $_POST) && (!empty($_POST['id_hipotese_legal']) && $_POST['id_barramento'] !== 'null')) { | ||
138 | + $objPenRelHipoteseLegalDTO->setNumIdHipoteseLegal($_POST['id_hipotese_legal']); | ||
139 | + } | ||
140 | + | ||
141 | + $objFiltroDTO = clone $objPenRelHipoteseLegalDTO; | ||
142 | + | ||
143 | + if(!$objFiltroDTO->isSetNumIdBarramento()) { | ||
144 | + $objFiltroDTO->setNumIdBarramento(''); | ||
145 | + } | ||
146 | + | ||
147 | + if(!$objFiltroDTO->isSetNumIdHipoteseLegal()) { | ||
148 | + $objFiltroDTO->setNumIdHipoteseLegal(''); | ||
149 | + } | ||
150 | + //-------------------------------------------------------------------------- | ||
151 | + $objGenericoBD = new GenericoBD($objBanco); | ||
152 | + | ||
153 | + // Mapeamento da hipotese legal remota | ||
154 | + $objPenHipoteseLegalDTO = new PenHipoteseLegalDTO(); | ||
155 | + $objPenHipoteseLegalDTO->setDistinct(true); | ||
156 | + $objPenHipoteseLegalDTO->setOrdStrNome(InfraDTO::$TIPO_ORDENACAO_ASC); | ||
157 | + $objPenHipoteseLegalDTO->retNumIdHipoteseLegal(); | ||
158 | + $objPenHipoteseLegalDTO->retStrNome(); | ||
159 | + | ||
160 | + $objPenHipoteseLegalRN = new PenHipoteseLegalRN(); | ||
161 | + $arrMapIdBarramento = InfraArray::converterArrInfraDTO($objPenHipoteseLegalRN->listar($objPenHipoteseLegalDTO), 'Nome', 'IdHipoteseLegal'); | ||
162 | + | ||
163 | + // Mapeamento da hipotese legal local | ||
164 | + $objHipoteseLegalDTO = new HipoteseLegalDTO(); | ||
165 | + $objHipoteseLegalDTO->setDistinct(true); | ||
166 | + $objHipoteseLegalDTO->setStrStaNivelAcesso(ProtocoloRN::$NA_RESTRITO); //Restrito | ||
167 | + $objHipoteseLegalDTO->setStrSinAtivo('S'); | ||
168 | + $objHipoteseLegalDTO->setOrdStrNome(InfraDTO::$TIPO_ORDENACAO_ASC); | ||
169 | + $objHipoteseLegalDTO->retNumIdHipoteseLegal(); | ||
170 | + $objHipoteseLegalDTO->retStrNome(); | ||
171 | + | ||
172 | + $objHipoteseLegalRN = new HipoteseLegalRN(); | ||
173 | + $arrMapIdHipoteseLegal = InfraArray::converterArrInfraDTO($objHipoteseLegalRN->listar($objHipoteseLegalDTO), 'Nome', 'IdHipoteseLegal'); | ||
174 | + //-------------------------------------------------------------------------- | ||
175 | + // | ||
176 | + //$objPagina->prepararOrdenacao($objPenRelHipoteseLegalDTO, 'IdMapeamento', InfraDTO::$TIPO_ORDENACAO_ASC); | ||
177 | + $objPagina->prepararPaginacao($objPenRelHipoteseLegalDTO); | ||
178 | + | ||
179 | + $arrObjPenRelHipoteseLegalDTO = $objGenericoBD->listar($objPenRelHipoteseLegalDTO); | ||
180 | + | ||
181 | + $objPagina->processarPaginacao($objPenRelHipoteseLegalDTO); | ||
182 | + | ||
183 | + $numRegistros = count($arrObjPenRelHipoteseLegalDTO); | ||
184 | + | ||
185 | + if(!empty($arrObjPenRelHipoteseLegalDTO)){ | ||
186 | + | ||
187 | + $strResultado = ''; | ||
188 | + | ||
189 | + $strResultado .= '<table width="99%" class="infraTable">'."\n"; | ||
190 | + $strResultado .= '<caption class="infraCaption">'.$objPagina->gerarCaptionTabela(PEN_PAGINA_TITULO, $numRegistros).'</caption>'; | ||
191 | + | ||
192 | + $strResultado .= '<tr>'; | ||
193 | + $strResultado .= '<th class="infraTh" width="1%">'.$objPagina->getThCheck().'</th>'."\n"; | ||
194 | + $strResultado .= '<th class="infraTh" width="35%">Hipótese Legal - SEI '.$objSessao->getStrSiglaOrgaoUnidadeAtual().'</th>'."\n"; | ||
195 | + $strResultado .= '<th class="infraTh" width="35%">Hipótese Legal - Tramitação PEN</th>'."\n"; | ||
196 | + $strResultado .= '<th class="infraTh" width="14%">Ações</th>'."\n"; | ||
197 | + $strResultado .= '</tr>'."\n"; | ||
198 | + $strCssTr = ''; | ||
199 | + | ||
200 | + $index = 0; | ||
201 | + foreach($arrObjPenRelHipoteseLegalDTO as $objPenRelHipoteseLegalDTO) { | ||
202 | + | ||
203 | + $strCssTr = ($strCssTr == 'infraTrClara') ? 'infraTrEscura' : 'infraTrClara'; | ||
204 | + | ||
205 | + $strResultado .= '<tr class="'.$strCssTr.'">'; | ||
206 | + $strResultado .= '<td>'.$objPagina->getTrCheck($index, $objPenRelHipoteseLegalDTO->getDblIdMap(), '').'</td>'; | ||
207 | + $strResultado .= '<td>'.$arrMapIdHipoteseLegal[$objPenRelHipoteseLegalDTO->getNumIdHipoteseLegal()].'</td>'; | ||
208 | + $strResultado .= '<td>'.$arrMapIdBarramento[$objPenRelHipoteseLegalDTO->getNumIdBarramento()].'</td>'; | ||
209 | + $strResultado .= '<td align="center">'; | ||
210 | + | ||
211 | + //$strResultado .= '<a href="'.$objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_visualizar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao'].'&'.PEN_PAGINA_GET_ID.'='.$objPenRelHipoteseLegalDTO->getDblIdMap()).'"><img src="imagens/consultar.gif" title="Consultar Mapeamento" alt="Consultar Mapeamento" class="infraImg"></a>'; | ||
212 | + if($objSessao->verificarPermissao('pen_map_hipotese_legal_envio_alterar')) { | ||
213 | + $strResultado .= '<a href="'.$objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_cadastrar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao'].'&'.PEN_PAGINA_GET_ID.'='.$objPenRelHipoteseLegalDTO->getDblIdMap()).'"><img src="imagens/alterar.gif" title="Alterar Mapeamento" alt="Alterar Mapeamento" class="infraImg"></a>'; | ||
214 | + } | ||
215 | + | ||
216 | + if($objSessao->verificarPermissao('pen_map_hipotese_legal_envio_excluir')) { | ||
217 | + $strResultado .= '<a href="#" onclick="onCLickLinkDelete(\''.$objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_excluir&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao'].'&hdnInfraItensSelecionados='.$objPenRelHipoteseLegalDTO->getDblIdMap()).'\', this)"><img src="imagens/excluir.gif" title="Excluir Mapeamento" alt="Excluir Mapeamento" class="infraImg"></a>'; | ||
218 | + } | ||
219 | + | ||
220 | + $strResultado .= '</td>'; | ||
221 | + $strResultado .= '</tr>'."\n"; | ||
222 | + | ||
223 | + $index++; | ||
224 | + } | ||
225 | + $strResultado .= '</table>'; | ||
226 | + } | ||
227 | +} | ||
228 | +catch(InfraException $e){ | ||
229 | + | ||
230 | + print '<pre>'; | ||
231 | + print_r($e); | ||
232 | + print '</pre>'; | ||
233 | + exit(0); | ||
234 | + //$objPagina->processarExcecao($e); | ||
235 | +} | ||
236 | + | ||
237 | + | ||
238 | +$objPagina->montarDocType(); | ||
239 | +$objPagina->abrirHtml(); | ||
240 | +$objPagina->abrirHead(); | ||
241 | +$objPagina->montarMeta(); | ||
242 | +$objPagina->montarTitle(':: '.$objPagina->getStrNomeSistema().' - '.PEN_PAGINA_TITULO.' ::'); | ||
243 | +$objPagina->montarStyle(); | ||
244 | +?> | ||
245 | +<style type="text/css"> | ||
246 | + | ||
247 | +.input-label-first{position:absolute;left:0%;top:0%;width:25%; color: #666!important} | ||
248 | +.input-field-first{position:absolute;left:0%;top:50%;width:25%} | ||
249 | + | ||
250 | +.input-label-second{position:absolute;left:30%;top:0%;width:25%; color: #666!important} | ||
251 | +.input-field-second{position:absolute;left:30%;top:50%;width:25%;} | ||
252 | + | ||
253 | +.input-label-third {position:absolute;left:0%;top:40%;width:25%; color:#666!important} | ||
254 | +.input-field-third {position:absolute;left:0%;top:55%;width:25%;} | ||
255 | + | ||
256 | +</style> | ||
257 | +<?php $objPagina->montarJavaScript(); ?> | ||
258 | +<script type="text/javascript"> | ||
259 | + | ||
260 | +function inicializar(){ | ||
261 | + | ||
262 | + infraEfeitoTabelas(); | ||
263 | + | ||
264 | +} | ||
265 | + | ||
266 | +function onClickBtnPesquisar(){ | ||
267 | + document.getElementById('frmAcompanharEstadoProcesso').action='<?php print $objSessao->assinarLink('controlador.php?acao='.$_GET['acao'].'&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao_retorno']); ?>'; | ||
268 | + document.getElementById('frmAcompanharEstadoProcesso').submit(); | ||
269 | +} | ||
270 | + | ||
271 | +function tratarEnter(ev){ | ||
272 | + var key = infraGetCodigoTecla(ev); | ||
273 | + if (key == 13){ | ||
274 | + onClickBtnPesquisar(); | ||
275 | + } | ||
276 | + return true; | ||
277 | +} | ||
278 | + | ||
279 | +function onCLickLinkDelete(url, link) { | ||
280 | + | ||
281 | + var row = jQuery(link).parents('tr:first'); | ||
282 | + | ||
283 | + var strEspecieDocumental = row.find('td:eq(1)').text(); | ||
284 | + var strTipoDocumento = row.find('td:eq(2)').text(); | ||
285 | + | ||
286 | + if(confirm('Confirma a exclusão do mapeamento "' + strEspecieDocumental + ' x ' + strTipoDocumento +'"?')){ | ||
287 | + | ||
288 | + window.location = url; | ||
289 | + } | ||
290 | + | ||
291 | +} | ||
292 | + | ||
293 | +function onClickBtnNovo(){ | ||
294 | + | ||
295 | + window.location = '<?php print $objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_cadastrar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao_origem']); ?>'; | ||
296 | +} | ||
297 | + | ||
298 | +function onClickBtnAtivar(){ | ||
299 | + | ||
300 | + try { | ||
301 | + | ||
302 | + var form = jQuery('#frmAcompanharEstadoProcesso'); | ||
303 | + form.attr('action', '<?php print $objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_ativar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.PEN_RECURSO_BASE.'_listar'); ?>'); | ||
304 | + form.submit(); | ||
305 | + } | ||
306 | + catch(e){ | ||
307 | + | ||
308 | + alert('Erro : ' + e.message); | ||
309 | + } | ||
310 | + | ||
311 | +} | ||
312 | + | ||
313 | +function onClickBtnDesativar(){ | ||
314 | + | ||
315 | + try { | ||
316 | + | ||
317 | + var form = jQuery('#frmAcompanharEstadoProcesso'); | ||
318 | + form.attr('action', '<?php print $objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_desativar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.PEN_RECURSO_BASE.'_listar'); ?>'); | ||
319 | + form.submit(); | ||
320 | + } | ||
321 | + catch(e){ | ||
322 | + | ||
323 | + alert('Erro : ' + e.message); | ||
324 | + } | ||
325 | +} | ||
326 | + | ||
327 | +function onClickBtnExcluir(){ | ||
328 | + | ||
329 | + try { | ||
330 | + | ||
331 | + var len = jQuery('input[name*=chkInfraItem]:checked').length; | ||
332 | + | ||
333 | + if(len > 0){ | ||
334 | + | ||
335 | + if(confirm('Confirma a exclusão de ' + len + ' mapeamento(s) ?')) { | ||
336 | + var form = jQuery('#frmAcompanharEstadoProcesso'); | ||
337 | + form.attr('action', '<?php print $objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_excluir&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.PEN_RECURSO_BASE.'_listar'); ?>'); | ||
338 | + form.submit(); | ||
339 | + } | ||
340 | + } | ||
341 | + else { | ||
342 | + | ||
343 | + alert('Selecione pelo menos um mapeamento para Excluir'); | ||
344 | + } | ||
345 | + } | ||
346 | + catch(e){ | ||
347 | + | ||
348 | + alert('Erro : ' + e.message); | ||
349 | + } | ||
350 | +} | ||
351 | + | ||
352 | +</script> | ||
353 | +<?php | ||
354 | +$objPagina->fecharHead(); | ||
355 | +$objPagina->abrirBody(PEN_PAGINA_TITULO,'onload="inicializar();"'); | ||
356 | +?> | ||
357 | +<form id="frmAcompanharEstadoProcesso" method="post" action="<?php// print $objSessao->assinarLink($strProprioLink); ?>"> | ||
358 | + | ||
359 | + <?php $objPagina->montarBarraComandosSuperior($arrComandos); ?> | ||
360 | + <?php //$objPagina->montarAreaValidacao(); ?> | ||
361 | + <?php $objPagina->abrirAreaDados('40px'); ?> | ||
362 | + | ||
363 | + <label for="id_hipotese_legal" class="infraLabelObrigatorio input-label-first">Hipótese Legal - SEI <?php print $objSessao->getStrSiglaOrgaoUnidadeAtual(); ?>:</label> | ||
364 | + <select name="id_hipotese_legal" class="infraSelect input-field-first"<?php if($bolSomenteLeitura): ?> disabled="disabled" readonly="readonly"<?php endif; ?>> | ||
365 | + <?php print InfraINT::montarSelectArray('', 'Selecione', $objFiltroDTO->getNumIdHipoteseLegal(), $arrMapIdHipoteseLegal); ?> | ||
366 | + </select> | ||
367 | + | ||
368 | + <label for="id_barramento" class="infraLabelObrigatorio input-label-second">Hipótese Legal - Tramitação PEN:</label> | ||
369 | + <select name="id_barramento" class="infraSelect input-field-second"<?php if($bolSomenteLeitura): ?> disabled="disabled" readonly="readonly"<?php endif; ?>> | ||
370 | + <?php print InfraINT::montarSelectArray('', 'Selecione', $objFiltroDTO->getNumIdBarramento(), $arrMapIdBarramento); ?> | ||
371 | + </select> | ||
372 | + | ||
373 | + | ||
374 | + <?php $objPagina->fecharAreaDados(); ?> | ||
375 | + | ||
376 | + <?php if($numRegistros > 0): ?> | ||
377 | + <?php $objPagina->montarAreaTabela($strResultado, $numRegistros); ?> | ||
378 | + <?php //$objPagina->montarAreaDebug(); ?> | ||
379 | + <?php else: ?> | ||
380 | + <div style="clear:both"></div> | ||
381 | + <p>Nenhum mapeamento foi encontrado</p> | ||
382 | + <?php endif; ?> | ||
383 | +</form> | ||
384 | +<?php $objPagina->fecharBody(); ?> | ||
385 | +<?php $objPagina->fecharHtml(); ?> |
pen_map_hipotese_legal_padrao_cadastrar.php
@@ -33,12 +33,12 @@ try { | @@ -33,12 +33,12 @@ try { | ||
33 | switch ($_GET['acao']) { | 33 | switch ($_GET['acao']) { |
34 | case PEN_RECURSO_BASE.'_cadastrar': | 34 | case PEN_RECURSO_BASE.'_cadastrar': |
35 | $arrComandos[] = '<button type="submit" id="btnSalvar" value="Salvar" class="infraButton"><span class="infraTeclaAtalho">S</span>alvar</button>'; | 35 | $arrComandos[] = '<button type="submit" id="btnSalvar" value="Salvar" class="infraButton"><span class="infraTeclaAtalho">S</span>alvar</button>'; |
36 | - $arrComandos[] = '<button type="button" id="btnCancelar" value="Cancelar" onclick="location.href=\'' . $objPagina->formatarXHTML($objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_listar&acao_origem=' . $_GET['acao'])) . '\';" class="infraButton">Cancelar</button>'; | 36 | + $arrComandos[] = '<button type="button" id="btnCancelar" value="Cancelar" onclick="location.href=\'' . $objPagina->formatarXHTML($objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_listar&acao_origem=' . $_GET['acao'])) . '\';" class="infraButton"><span class="infraTeclaAtalho">C</span>ancelar</button>'; |
37 | $strTitulo = PEN_PAGINA_TITULO; | 37 | $strTitulo = PEN_PAGINA_TITULO; |
38 | break; | 38 | break; |
39 | 39 | ||
40 | case PEN_RECURSO_BASE.'_visualizar': | 40 | case PEN_RECURSO_BASE.'_visualizar': |
41 | - $arrComandos[] = '<button type="button" name="btnFechar" value="Fechar class="infraButton" onclick="location.href=\'' . $objPagina->formatarXHTML($objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_listar&acao_origem=' . $_GET['acao'])) . '\';">Fechar</button>'; | 41 | + $arrComandos[] = '<button type="button" name="btnFechar" value="Fechar class="infraButton" onclick="location.href=\'' . $objPagina->formatarXHTML($objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_listar&acao_origem=' . $_GET['acao'])) . '\';"><span class="infraTeclaAtalho">F</span>echar</button>'; |
42 | $bolSomenteLeitura = true; | 42 | $bolSomenteLeitura = true; |
43 | $strTitulo = sprintf('Consultar %s', PEN_PAGINA_TITULO); | 43 | $strTitulo = sprintf('Consultar %s', PEN_PAGINA_TITULO); |
44 | break; | 44 | break; |
pen_map_hipotese_legal_recebido_cadastrar.php
@@ -1,221 +0,0 @@ | @@ -1,221 +0,0 @@ | ||
1 | -<?php | ||
2 | -/** | ||
3 | - * | ||
4 | - * @author Join Tecnologia | ||
5 | - */ | ||
6 | - | ||
7 | -require_once dirname(__FILE__) . '/../../SEI.php'; | ||
8 | - | ||
9 | -session_start(); | ||
10 | - | ||
11 | -define('PEN_RECURSO_ATUAL', 'pen_map_hipotese_legal_recebido_cadastrar'); | ||
12 | -define('PEN_RECURSO_BASE', 'pen_map_hipotese_legal_recebido'); | ||
13 | -define('PEN_PAGINA_TITULO', 'Mapeamento de Hipóteses Legais de Recebimento'); | ||
14 | -define('PEN_PAGINA_GET_ID', 'id_mapeamento'); | ||
15 | - | ||
16 | - | ||
17 | -$objPagina = PaginaSEI::getInstance(); | ||
18 | -$objBanco = BancoSEI::getInstance(); | ||
19 | -$objSessao = SessaoSEI::getInstance(); | ||
20 | - | ||
21 | - | ||
22 | -try { | ||
23 | - | ||
24 | - $objBanco->abrirConexao(); | ||
25 | - | ||
26 | - $objSessao->validarLink(); | ||
27 | - $objSessao->validarPermissao(PEN_RECURSO_ATUAL); | ||
28 | - | ||
29 | - $arrComandos = array(); | ||
30 | - | ||
31 | - $bolSomenteLeitura = false; | ||
32 | - | ||
33 | - switch ($_GET['acao']) { | ||
34 | - case PEN_RECURSO_BASE.'_cadastrar': | ||
35 | - $arrComandos[] = '<button type="submit" id="btnSalvar" value="Salvar" class="infraButton"><span class="infraTeclaAtalho">S</span>alvar</button>'; | ||
36 | - $arrComandos[] = '<button type="button" id="btnCancelar" value="Cancelar" onclick="location.href=\'' . $objPagina->formatarXHTML($objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_listar&acao_origem=' . $_GET['acao'])) . '\';" class="infraButton">Cancelar</button>'; | ||
37 | - | ||
38 | - if(array_key_exists(PEN_PAGINA_GET_ID, $_GET) && !empty($_GET[PEN_PAGINA_GET_ID])){ | ||
39 | - $strTitulo = sprintf('Editar %s', PEN_PAGINA_TITULO); | ||
40 | - } | ||
41 | - else { | ||
42 | - $strTitulo = sprintf('Novo %s', PEN_PAGINA_TITULO); | ||
43 | - } | ||
44 | - break; | ||
45 | - | ||
46 | - case PEN_RECURSO_BASE.'_visualizar': | ||
47 | - $arrComandos[] = '<button type="button" name="btnFechar" value="Fechar class="infraButton" onclick="location.href=\'' . $objPagina->formatarXHTML($objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_listar&acao_origem=' . $_GET['acao'])) . '\';">Fechar</button>'; | ||
48 | - $bolSomenteLeitura = true; | ||
49 | - $strTitulo = sprintf('Consultar %s', PEN_PAGINA_TITULO); | ||
50 | - break; | ||
51 | - | ||
52 | - | ||
53 | - default: | ||
54 | - throw new InfraException("Ação '" . $_GET['acao'] . "' não reconhecida."); | ||
55 | - } | ||
56 | - | ||
57 | - $objPenRelHipoteseLegalRN = new PenRelHipoteseLegalRecebidoRN(); | ||
58 | - | ||
59 | - //-------------------------------------------------------------------------- | ||
60 | - // Ao por POST esta salvando o formulrio | ||
61 | - if(strtoupper($_SERVER['REQUEST_METHOD']) === 'POST') { | ||
62 | - | ||
63 | - if(!array_key_exists('id_hipotese_legal', $_POST) || empty($_POST['id_hipotese_legal'])) { | ||
64 | - throw new InfraException('Nenhuma "Espécie Documental" foi selecionada'); | ||
65 | - } | ||
66 | - | ||
67 | - if(!array_key_exists('id_barramento', $_POST) || empty($_POST['id_barramento'])) { | ||
68 | - throw new InfraException('Nenhum "Tipo de Documento" foi selecionado'); | ||
69 | - } | ||
70 | - | ||
71 | - $objPenRelHipoteseLegalDTO = new PenRelHipoteseLegalDTO(); | ||
72 | - $objPenRelHipoteseLegalDTO->setNumIdHipoteseLegal($_POST['id_hipotese_legal']); | ||
73 | - $objPenRelHipoteseLegalDTO->setNumIdBarramento($_POST['id_barramento']); | ||
74 | - $objPenRelHipoteseLegalDTO->setStrTipo('R');// Recebido | ||
75 | - | ||
76 | - $numIdMapeamento = 0; | ||
77 | - if(array_key_exists(PEN_PAGINA_GET_ID, $_GET) && !empty($_GET[PEN_PAGINA_GET_ID])) { | ||
78 | - $objPenRelHipoteseLegalDTO->setDblIdMap($_GET[PEN_PAGINA_GET_ID]); | ||
79 | - $objPenRelHipoteseLegalRN->alterar($objPenRelHipoteseLegalDTO); | ||
80 | - $numIdMapeamento = $_GET[PEN_PAGINA_GET_ID]; | ||
81 | - } | ||
82 | - else { | ||
83 | - $mapeamento = $objPenRelHipoteseLegalRN->cadastrar($objPenRelHipoteseLegalDTO); | ||
84 | - $numIdMapeamento = $mapeamento->getDblIdMap(); | ||
85 | - } | ||
86 | - | ||
87 | - | ||
88 | - header('Location: '.$objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_listar&acao_origem='.$_GET['acao'].'&acao_origem='.$_GET['acao'].'&id_mapeamento='.$numIdMapeamento.PaginaSEI::getInstance()->montarAncora($numIdMapeamento))); | ||
89 | - exit(0); | ||
90 | - } | ||
91 | - // Ao por GET + ID esta carregando o formulrio | ||
92 | - else if(array_key_exists(PEN_PAGINA_GET_ID, $_GET) && !empty($_GET[PEN_PAGINA_GET_ID])){ | ||
93 | - | ||
94 | - $objPenRelHipoteseLegalDTO = new PenRelHipoteseLegalDTO(); | ||
95 | - $objPenRelHipoteseLegalDTO->setDblIdMap($_GET[PEN_PAGINA_GET_ID]); | ||
96 | - $objPenRelHipoteseLegalDTO->retTodos(); | ||
97 | - | ||
98 | - $objEspecieDocumentalBD = new GenericoBD(BancoSEI::getInstance()); | ||
99 | - $objPenRelHipoteseLegalDTO = $objEspecieDocumentalBD->consultar($objPenRelHipoteseLegalDTO); | ||
100 | - } | ||
101 | - | ||
102 | - if(empty($objPenRelHipoteseLegalDTO)){ | ||
103 | - $objPenRelHipoteseLegalDTO = new PenRelHipoteseLegalDTO(); | ||
104 | - $objPenRelHipoteseLegalDTO->setNumIdHipoteseLegal(0); | ||
105 | - $objPenRelHipoteseLegalDTO->setNumIdBarramento(0); | ||
106 | - } | ||
107 | - | ||
108 | - | ||
109 | - if(array_key_exists(PEN_PAGINA_GET_ID, $_GET) && !empty($_GET[PEN_PAGINA_GET_ID])) { | ||
110 | - $objPenRelHipoteseLegalDTO->setDblIdMap($_GET[PEN_PAGINA_GET_ID]); | ||
111 | - } | ||
112 | - | ||
113 | - //-------------------------------------------------------------------------- | ||
114 | - // Auto-Complete | ||
115 | - //-------------------------------------------------------------------------- | ||
116 | - // Mapeamento da hipotese legal local | ||
117 | - $objHipoteseLegalDTO = new HipoteseLegalDTO(); | ||
118 | - $objHipoteseLegalDTO->setStrStaNivelAcesso(1); | ||
119 | - $objHipoteseLegalDTO->setOrdStrNome(InfraDTO::$TIPO_ORDENACAO_ASC); | ||
120 | - $objHipoteseLegalDTO->retNumIdHipoteseLegal(); | ||
121 | - $objHipoteseLegalDTO->retStrNome(); | ||
122 | - | ||
123 | - $objHipoteseLegalRN = new HipoteseLegalRN(); | ||
124 | - $arrMapIdHipoteseLegal = InfraArray::converterArrInfraDTO($objHipoteseLegalRN->listar($objHipoteseLegalDTO), 'Nome', 'IdHipoteseLegal'); | ||
125 | - | ||
126 | - // Mapeamento da hipotese legal do barramento j utilizados | ||
127 | - $arrNumIdHipoteseLegal = $objPenRelHipoteseLegalRN->getIdBarramentoEmUso($objPenRelHipoteseLegalDTO, 'R'); | ||
128 | - | ||
129 | - // Mapeamento da hipotese legal remota | ||
130 | - $objPenHipoteseLegalDTO = new PenHipoteseLegalDTO(); | ||
131 | - $objPenHipoteseLegalDTO->setOrdStrNome(InfraDTO::$TIPO_ORDENACAO_ASC); | ||
132 | - if(!empty($arrNumIdHipoteseLegal)) { | ||
133 | - // Remove os que j esto em uso | ||
134 | - $objPenHipoteseLegalDTO->setNumIdHipoteseLegal($arrNumIdHipoteseLegal, InfraDTO::$OPER_NOT_IN); | ||
135 | - } | ||
136 | - $objPenHipoteseLegalDTO->retNumIdHipoteseLegal(); | ||
137 | - $objPenHipoteseLegalDTO->retStrNome(); | ||
138 | - | ||
139 | - $objPenHipoteseLegalRN = new PenHipoteseLegalRN(); | ||
140 | - $arrMapIdBarramento = InfraArray::converterArrInfraDTO($objPenHipoteseLegalRN->listar($objPenHipoteseLegalDTO), 'Nome', 'IdHipoteseLegal'); | ||
141 | - //-------------------------------------------------------------------------- | ||
142 | -} | ||
143 | -catch (InfraException $e) { | ||
144 | - $objPagina->processarExcecao($e); | ||
145 | -} | ||
146 | -catch(Exception $e) { | ||
147 | - $objPagina->processarExcecao($e); | ||
148 | -} | ||
149 | - | ||
150 | -// View | ||
151 | -ob_clean(); | ||
152 | - | ||
153 | -$objPagina->montarDocType(); | ||
154 | -$objPagina->abrirHtml(); | ||
155 | -$objPagina->abrirHead(); | ||
156 | -$objPagina->montarMeta(); | ||
157 | -$objPagina->montarTitle(':: ' . $objPagina->getStrNomeSistema() . ' - ' . $strTitulo . ' ::'); | ||
158 | -$objPagina->montarStyle(); | ||
159 | -?> | ||
160 | -<style type="text/css"> | ||
161 | - | ||
162 | -.input-label-first{position:absolute;left:0%;top:0%;width:25%; color: #666!important} | ||
163 | -.input-field-first{position:absolute;left:0%;top:15%;width:25%} | ||
164 | - | ||
165 | -.input-label-third {position:absolute;left:0%;top:40%;width:25%; color:#666!important} | ||
166 | -.input-field-third {position:absolute;left:0%;top:55%;width:25%;} | ||
167 | - | ||
168 | -</style> | ||
169 | -<?php $objPagina->montarJavaScript(); ?> | ||
170 | -<script type="text/javascript"> | ||
171 | - | ||
172 | -function inicializar(){ | ||
173 | - | ||
174 | - | ||
175 | -} | ||
176 | - | ||
177 | -function onSubmit() { | ||
178 | - | ||
179 | - var form = jQuery('#<?php print PEN_RECURSO_BASE; ?>_form'); | ||
180 | - var field = jQuery('select[name=id_hipotese_legal]', form); | ||
181 | - | ||
182 | - if(field.val() === 'null' || !field.val()){ | ||
183 | - alert('Nenhuma "Hipótese Legal - SEI <?php print $objSessao->getStrSiglaOrgaoUnidadeAtual(); ?>" foi selecionada'); | ||
184 | - field.focus(); | ||
185 | - return false; | ||
186 | - } | ||
187 | - | ||
188 | - field = jQuery('select[name=id_barramento]', form); | ||
189 | - | ||
190 | - if(field.val() === 'null' || !field.val()){ | ||
191 | - alert('Nenhum "Hipótese Legal - Tramitação PEN" foi selecionado'); | ||
192 | - field.focus(); | ||
193 | - return false; | ||
194 | - } | ||
195 | -} | ||
196 | - | ||
197 | -</script> | ||
198 | -<?php | ||
199 | -$objPagina->fecharHead(); | ||
200 | -$objPagina->abrirBody($strTitulo,'onload="inicializar();"'); | ||
201 | -?> | ||
202 | -<form id="<?php print PEN_RECURSO_BASE; ?>_form" onsubmit="return onSubmit();" method="post" action="<?php //print $objSessaoSEI->assinarLink($strProprioLink); ?>"> | ||
203 | - <?php $objPagina->montarBarraComandosSuperior($arrComandos); ?> | ||
204 | - <?php $objPagina->montarAreaValidacao(); ?> | ||
205 | - <?php $objPagina->abrirAreaDados('12em'); ?> | ||
206 | - | ||
207 | - <label for="id_hipotese_legal" class="infraLabelObrigatorio input-label-first">Hipótese Legal - SEI <?php print $objSessao->getStrSiglaOrgaoUnidadeAtual(); ?>:</label> | ||
208 | - | ||
209 | - <select name="id_hipotese_legal" class="infraSelect input-field-first"<?php if($bolSomenteLeitura): ?> disabled="disabled" readonly="readonly"<?php endif; ?>> | ||
210 | - <?php print InfraINT::montarSelectArray('', 'Selecione', $objPenRelHipoteseLegalDTO->getNumIdHipoteseLegal(), $arrMapIdHipoteseLegal); ?> | ||
211 | - </select> | ||
212 | - | ||
213 | - <label for="id_barramento" class="infraLabelObrigatorio input-label-third">Hipótese Legal - Tramitação PEN:</label> | ||
214 | - <select name="id_barramento" class="infraSelect input-field-third"<?php if($bolSomenteLeitura): ?> disabled="disabled" readonly="readonly"<?php endif; ?>> | ||
215 | - <?php print InfraINT::montarSelectArray('', 'Selecione', $objPenRelHipoteseLegalDTO->getNumIdBarramento(), $arrMapIdBarramento); ?> | ||
216 | - </select> | ||
217 | - | ||
218 | - <?php print $objPagina->fecharAreaDados(); ?> | ||
219 | -</form> | ||
220 | -<?php $objPagina->fecharBody(); ?> | ||
221 | -<?php $objPagina->fecharHtml(); ?> |
pen_map_hipotese_legal_recebido_listar.php
@@ -1,392 +0,0 @@ | @@ -1,392 +0,0 @@ | ||
1 | -<?php | ||
2 | - | ||
3 | -require_once dirname(__FILE__) . '/../../SEI.php'; | ||
4 | - | ||
5 | -/** | ||
6 | - * Consulta os logs do estado do procedimento ao ser expedido | ||
7 | - * | ||
8 | - * @author Join Tecnologia | ||
9 | - */ | ||
10 | - | ||
11 | -session_start(); | ||
12 | - | ||
13 | - | ||
14 | -require_once dirname(__FILE__) . '/../../SEI.php'; | ||
15 | - | ||
16 | -session_start(); | ||
17 | - | ||
18 | -define('PEN_RECURSO_ATUAL', 'pen_map_hipotese_legal_recebido_listar'); | ||
19 | -define('PEN_RECURSO_BASE', 'pen_map_hipotese_legal_recebido'); | ||
20 | -define('PEN_PAGINA_TITULO', 'Mapeamento de Hipóteses Legais de Recebimento'); | ||
21 | -define('PEN_PAGINA_GET_ID', 'id_mapeamento'); | ||
22 | - | ||
23 | - | ||
24 | -$objPagina = PaginaSEI::getInstance(); | ||
25 | -$objBanco = BancoSEI::getInstance(); | ||
26 | -$objSessao = SessaoSEI::getInstance(); | ||
27 | -$objDebug = InfraDebug::getInstance(); | ||
28 | - | ||
29 | - | ||
30 | -try { | ||
31 | - | ||
32 | - $objDebug->setBolLigado(false); | ||
33 | - $objDebug->setBolDebugInfra(true); | ||
34 | - $objDebug->limpar(); | ||
35 | - | ||
36 | - $objSessao->validarLink(); | ||
37 | - $objSessao->validarPermissao(PEN_RECURSO_ATUAL); | ||
38 | - | ||
39 | - $objBanco->abrirConexao(); | ||
40 | - | ||
41 | - //-------------------------------------------------------------------------- | ||
42 | - // Aes | ||
43 | - if(array_key_exists('acao', $_GET)) { | ||
44 | - | ||
45 | - $arrParam = array_merge($_GET, $_POST); | ||
46 | - | ||
47 | - switch($_GET['acao']) { | ||
48 | - | ||
49 | - case PEN_RECURSO_BASE.'_excluir': | ||
50 | - | ||
51 | - if(array_key_exists('hdnInfraItensSelecionados', $arrParam) && !empty($arrParam['hdnInfraItensSelecionados'])) { | ||
52 | - | ||
53 | - $objPenRelHipoteseLegalDTO = new PenRelHipoteseLegalDTO(); | ||
54 | - $objPenRelHipoteseLegalRN = new PenRelHipoteseLegalRecebidoRN(); | ||
55 | - | ||
56 | - $arrParam['hdnInfraItensSelecionados'] = explode(',', $arrParam['hdnInfraItensSelecionados']); | ||
57 | - | ||
58 | - if(is_array($arrParam['hdnInfraItensSelecionados'])) { | ||
59 | - | ||
60 | - foreach($arrParam['hdnInfraItensSelecionados'] as $dblIdMap) { | ||
61 | - | ||
62 | - $objPenRelHipoteseLegalDTO->setDblIdMap($dblIdMap); | ||
63 | - $objPenRelHipoteseLegalRN->excluir($objPenRelHipoteseLegalDTO); | ||
64 | - } | ||
65 | - } | ||
66 | - else { | ||
67 | - | ||
68 | - $objPenRelHipoteseLegalDTO->setDblIdMap($arrParam['hdnInfraItensSelecionados']); | ||
69 | - $objPenRelHipoteseLegalRN->excluir($objPenRelHipoteseLegalDTO); | ||
70 | - } | ||
71 | - | ||
72 | - $objPagina->adicionarMensagem(sprintf('%s foi excluido com sucesso.', PEN_PAGINA_TITULO), InfraPagina::$TIPO_MSG_AVISO); | ||
73 | - | ||
74 | - header('Location: '.SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.$_GET['acao_retorno'].'&acao_origem='.$_GET['acao_origem'])); | ||
75 | - exit(0); | ||
76 | - } | ||
77 | - else { | ||
78 | - | ||
79 | - throw new InfraException('Nenhum Registro foi selecionado para executar esta ação'); | ||
80 | - } | ||
81 | - break; | ||
82 | - | ||
83 | - case PEN_RECURSO_BASE.'_desativar': | ||
84 | - | ||
85 | - if(array_key_exists('hdnInfraItensSelecionados', $arrParam) && !empty($arrParam['hdnInfraItensSelecionados'])) { | ||
86 | - | ||
87 | - PenRelHipoteseLegalRN::mudarEstado(explode(',', $arrParam['hdnInfraItensSelecionados']), 'N'); | ||
88 | - | ||
89 | - $objPagina->adicionarMensagem('Desativado com sucesso.', InfraPagina::$TIPO_MSG_AVISO); | ||
90 | - | ||
91 | - header('Location: '.SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.$_GET['acao_retorno'].'&acao_origem='.$_GET['acao_origem'])); | ||
92 | - exit(0); | ||
93 | - } | ||
94 | - else { | ||
95 | - | ||
96 | - throw new InfraException('Nenhum Registro foi selecionado para executar esta ação'); | ||
97 | - } | ||
98 | - break; | ||
99 | - | ||
100 | - case PEN_RECURSO_BASE.'_ativar': | ||
101 | - if(array_key_exists('hdnInfraItensSelecionados', $arrParam) && !empty($arrParam['hdnInfraItensSelecionados'])) { | ||
102 | - | ||
103 | - PenRelHipoteseLegalRN::mudarEstado(explode(',', $arrParam['hdnInfraItensSelecionados']), 'S'); | ||
104 | - | ||
105 | - $objPagina->adicionarMensagem('Ativado com sucesso.', InfraPagina::$TIPO_MSG_AVISO); | ||
106 | - | ||
107 | - header('Location: '.SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.$_GET['acao_retorno'].'&acao_origem='.$_GET['acao_origem'])); | ||
108 | - exit(0); | ||
109 | - } | ||
110 | - break; | ||
111 | - | ||
112 | - case PEN_RECURSO_BASE.'_listar': | ||
113 | - // Ação padrão desta tela | ||
114 | - break; | ||
115 | - | ||
116 | - default: | ||
117 | - throw new InfraException('Ação não permitida nesta tela'); | ||
118 | - | ||
119 | - } | ||
120 | - } | ||
121 | - //-------------------------------------------------------------------------- | ||
122 | - | ||
123 | - $arrComandos = array(); | ||
124 | - $arrComandos[] = '<button type="button" accesskey="P" onclick="onClickBtnPesquisar();" id="btnPesquisar" value="Pesquisar" class="infraButton">Pesquisar</button>'; | ||
125 | - $arrComandos[] = '<button type="button" value="Novo" onclick="onClickBtnNovo()" class="infraButton">Novo</button>'; | ||
126 | - //$arrComandos[] = '<button type="button" value="Ativar" onclick="onClickBtnAtivar()" class="infraButton">Ativar</button>'; | ||
127 | - //$arrComandos[] = '<button type="button" value="Desativar" onclick="onClickBtnDesativar()" class="infraButton">Desativar</button>'; | ||
128 | - $arrComandos[] = '<button type="button" value="Excluir" onclick="onClickBtnExcluir()" class="infraButton">Excluir</button>'; | ||
129 | - $arrComandos[] = '<button type="button" accesskey="I" id="btnImprimir" value="Imprimir" onclick="infraImprimirTabela();" class="infraButton">Imprimir</button>'; | ||
130 | - | ||
131 | - //-------------------------------------------------------------------------- | ||
132 | - // DTO de paginao | ||
133 | - | ||
134 | - $objPenRelHipoteseLegalDTO = new PenRelHipoteseLegalDTO(); | ||
135 | - $objPenRelHipoteseLegalDTO->setStrTipo('R'); | ||
136 | - $objPenRelHipoteseLegalDTO->retTodos(); | ||
137 | - //-------------------------------------------------------------------------- | ||
138 | - // Filtragem | ||
139 | - if(array_key_exists('id_barramento', $_POST) && (!empty($_POST['id_barramento']) && $_POST['id_barramento'] !== 'null')) { | ||
140 | - $objPenRelHipoteseLegalDTO->setNumIdBarramento($_POST['id_barramento']); | ||
141 | - } | ||
142 | - | ||
143 | - if(array_key_exists('id_hipotese_legal', $_POST) && (!empty($_POST['id_hipotese_legal']) && $_POST['id_barramento'] !== 'null')) { | ||
144 | - $objPenRelHipoteseLegalDTO->setNumIdHipoteseLegal($_POST['id_hipotese_legal']); | ||
145 | - } | ||
146 | - | ||
147 | - $objFiltroDTO = clone $objPenRelHipoteseLegalDTO; | ||
148 | - | ||
149 | - if(!$objFiltroDTO->isSetNumIdBarramento()) { | ||
150 | - $objFiltroDTO->setNumIdBarramento(''); | ||
151 | - } | ||
152 | - | ||
153 | - if(!$objFiltroDTO->isSetNumIdHipoteseLegal()) { | ||
154 | - $objFiltroDTO->setNumIdHipoteseLegal(''); | ||
155 | - } | ||
156 | - //-------------------------------------------------------------------------- | ||
157 | - $objGenericoBD = new GenericoBD($objBanco); | ||
158 | - | ||
159 | - // Mapeamento da hipotese legal remota | ||
160 | - $objPenHipoteseLegalDTO = new PenHipoteseLegalDTO(); | ||
161 | - $objPenHipoteseLegalDTO->setDistinct(true); | ||
162 | - $objPenHipoteseLegalDTO->setOrdStrNome(InfraDTO::$TIPO_ORDENACAO_ASC); | ||
163 | - $objPenHipoteseLegalDTO->retNumIdHipoteseLegal(); | ||
164 | - $objPenHipoteseLegalDTO->retStrNome(); | ||
165 | - | ||
166 | - $objPenHipoteseLegalRN = new PenHipoteseLegalRN(); | ||
167 | - $arrMapIdBarramento = InfraArray::converterArrInfraDTO($objPenHipoteseLegalRN->listar($objPenHipoteseLegalDTO), 'Nome', 'IdHipoteseLegal'); | ||
168 | - | ||
169 | - // Mapeamento da hipotese legal local | ||
170 | - $objHipoteseLegalDTO = new HipoteseLegalDTO(); | ||
171 | - $objHipoteseLegalDTO->setStrStaNivelAcesso(ProtocoloRN::$NA_RESTRITO); //Restrito | ||
172 | - $objHipoteseLegalDTO->setStrSinAtivo('S'); | ||
173 | - $objHipoteseLegalDTO->setDistinct(true); | ||
174 | - $objHipoteseLegalDTO->setOrdStrNome(InfraDTO::$TIPO_ORDENACAO_ASC); | ||
175 | - $objHipoteseLegalDTO->retNumIdHipoteseLegal(); | ||
176 | - $objHipoteseLegalDTO->retStrNome(); | ||
177 | - | ||
178 | - $objHipoteseLegalRN = new HipoteseLegalRN(); | ||
179 | - $arrMapIdHipoteseLegal = InfraArray::converterArrInfraDTO($objHipoteseLegalRN->listar($objHipoteseLegalDTO), 'Nome', 'IdHipoteseLegal'); | ||
180 | - //-------------------------------------------------------------------------- | ||
181 | - // | ||
182 | - //$objPagina->prepararOrdenacao($objPenRelHipoteseLegalDTO, 'IdMapeamento', InfraDTO::$TIPO_ORDENACAO_ASC); | ||
183 | - $objPagina->prepararPaginacao($objPenRelHipoteseLegalDTO); | ||
184 | - | ||
185 | - $arrObjPenRelHipoteseLegalDTO = $objGenericoBD->listar($objPenRelHipoteseLegalDTO); | ||
186 | - | ||
187 | - $objPagina->processarPaginacao($objPenRelHipoteseLegalDTO); | ||
188 | - | ||
189 | - $numRegistros = count($arrObjPenRelHipoteseLegalDTO); | ||
190 | - | ||
191 | - if(!empty($arrObjPenRelHipoteseLegalDTO)){ | ||
192 | - | ||
193 | - $strResultado = ''; | ||
194 | - | ||
195 | - $strResultado .= '<table width="99%" class="infraTable">'."\n"; | ||
196 | - $strResultado .= '<caption class="infraCaption">'.$objPagina->gerarCaptionTabela(PEN_PAGINA_TITULO, $numRegistros).'</caption>'; | ||
197 | - | ||
198 | - $strResultado .= '<tr>'; | ||
199 | - $strResultado .= '<th class="infraTh" width="1%">'.$objPagina->getThCheck().'</th>'."\n"; | ||
200 | - $strResultado .= '<th class="infraTh" width="35%">Hipótese Legal - SEI '.$objSessao->getStrSiglaOrgaoUnidadeAtual().'</th>'."\n"; | ||
201 | - $strResultado .= '<th class="infraTh" width="35%">Hipótese Legal - Tramitação PEN</th>'."\n"; | ||
202 | - $strResultado .= '<th class="infraTh" width="14%">Ações</th>'."\n"; | ||
203 | - $strResultado .= '</tr>'."\n"; | ||
204 | - $strCssTr = ''; | ||
205 | - | ||
206 | - $index = 0; | ||
207 | - foreach($arrObjPenRelHipoteseLegalDTO as $objPenRelHipoteseLegalDTO) { | ||
208 | - | ||
209 | - $strCssTr = ($strCssTr == 'infraTrClara') ? 'infraTrEscura' : 'infraTrClara'; | ||
210 | - | ||
211 | - $strResultado .= '<tr class="'.$strCssTr.'">'; | ||
212 | - $strResultado .= '<td>'.$objPagina->getTrCheck($index, $objPenRelHipoteseLegalDTO->getDblIdMap(), '').'</td>'; | ||
213 | - $strResultado .= '<td>'.$arrMapIdHipoteseLegal[$objPenRelHipoteseLegalDTO->getNumIdHipoteseLegal()].'</td>'; | ||
214 | - $strResultado .= '<td>'.$arrMapIdBarramento[$objPenRelHipoteseLegalDTO->getNumIdBarramento()].'</td>'; | ||
215 | - $strResultado .= '<td align="center">'; | ||
216 | - | ||
217 | - //$strResultado .= '<a href="'.$objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_visualizar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao'].'&'.PEN_PAGINA_GET_ID.'='.$objPenRelHipoteseLegalDTO->getDblIdMap()).'"><img src="imagens/consultar.gif" title="Consultar Mapeamento" alt="Consultar Mapeamento" class="infraImg"></a>'; | ||
218 | - if($objSessao->verificarPermissao('pen_map_hipotese_legal_recebido_alterar')) { | ||
219 | - $strResultado .= '<a href="'.$objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_cadastrar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao'].'&'.PEN_PAGINA_GET_ID.'='.$objPenRelHipoteseLegalDTO->getDblIdMap()).'"><img src="imagens/alterar.gif" title="Alterar Mapeamento" alt="Alterar Mapeamento" class="infraImg"></a>'; | ||
220 | - } | ||
221 | - | ||
222 | - if($objSessao->verificarPermissao('pen_map_hipotese_legal_recebido_excluir')) { | ||
223 | - $strResultado .= '<a href="#" onclick="onCLickLinkDelete(\''.$objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_excluir&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao'].'&hdnInfraItensSelecionados='.$objPenRelHipoteseLegalDTO->getDblIdMap()).'\', this)"><img src="imagens/excluir.gif" title="Excluir Mapeamento" alt="Excluir Mapeamento" class="infraImg"></a>'; | ||
224 | - } | ||
225 | - | ||
226 | - $strResultado .= '</td>'; | ||
227 | - $strResultado .= '</tr>'."\n"; | ||
228 | - | ||
229 | - $index++; | ||
230 | - } | ||
231 | - $strResultado .= '</table>'; | ||
232 | - } | ||
233 | -} | ||
234 | -catch(InfraException $e){ | ||
235 | - | ||
236 | - print '<pre>'; | ||
237 | - print_r($e); | ||
238 | - print '</pre>'; | ||
239 | - exit(0); | ||
240 | - //$objPagina->processarExcecao($e); | ||
241 | -} | ||
242 | - | ||
243 | - | ||
244 | -$objPagina->montarDocType(); | ||
245 | -$objPagina->abrirHtml(); | ||
246 | -$objPagina->abrirHead(); | ||
247 | -$objPagina->montarMeta(); | ||
248 | -$objPagina->montarTitle(':: '.$objPagina->getStrNomeSistema().' - '.PEN_PAGINA_TITULO.' ::'); | ||
249 | -$objPagina->montarStyle(); | ||
250 | -?> | ||
251 | -<style type="text/css"> | ||
252 | - | ||
253 | -.input-label-first{position:absolute;left:0%;top:0%;width:25%; color: #666!important} | ||
254 | -.input-field-first{position:absolute;left:0%;top:15%;width:25%} | ||
255 | - | ||
256 | -.input-label-second{position:absolute;left:30%;top:0%;width:25%; color: #666!important} | ||
257 | -.input-field-second{position:absolute;left:30%;top:15%;width:25%;} | ||
258 | - | ||
259 | -.input-label-third {position:absolute;left:0%;top:40%;width:25%; color:#666!important} | ||
260 | -.input-field-third {position:absolute;left:0%;top:55%;width:25%;} | ||
261 | - | ||
262 | -</style> | ||
263 | -<?php $objPagina->montarJavaScript(); ?> | ||
264 | -<script type="text/javascript"> | ||
265 | - | ||
266 | -function inicializar(){ | ||
267 | - | ||
268 | - infraEfeitoTabelas(); | ||
269 | - | ||
270 | -} | ||
271 | - | ||
272 | -function onClickBtnPesquisar(){ | ||
273 | - document.getElementById('frmAcompanharEstadoProcesso').action='<?php print $objSessao->assinarLink('controlador.php?acao='.$_GET['acao'].'&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao_retorno']); ?>'; | ||
274 | - document.getElementById('frmAcompanharEstadoProcesso').submit(); | ||
275 | -} | ||
276 | - | ||
277 | -function tratarEnter(ev){ | ||
278 | - var key = infraGetCodigoTecla(ev); | ||
279 | - if (key == 13){ | ||
280 | - onClickBtnPesquisar(); | ||
281 | - } | ||
282 | - return true; | ||
283 | -} | ||
284 | - | ||
285 | -function onCLickLinkDelete(url, link) { | ||
286 | - | ||
287 | - var row = jQuery(link).parents('tr:first'); | ||
288 | - | ||
289 | - var strEspecieDocumental = row.find('td:eq(1)').text(); | ||
290 | - var strTipoDocumento = row.find('td:eq(2)').text(); | ||
291 | - | ||
292 | - if(confirm('Confirma a exclusão do mapeamento "' + strEspecieDocumental + ' x ' + strTipoDocumento +'"?')){ | ||
293 | - | ||
294 | - window.location = url; | ||
295 | - } | ||
296 | - | ||
297 | -} | ||
298 | - | ||
299 | -function onClickBtnNovo(){ | ||
300 | - | ||
301 | - window.location = '<?php print $objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_cadastrar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao_origem']); ?>'; | ||
302 | -} | ||
303 | - | ||
304 | -function onClickBtnAtivar(){ | ||
305 | - | ||
306 | - try { | ||
307 | - | ||
308 | - var form = jQuery('#frmAcompanharEstadoProcesso'); | ||
309 | - form.attr('action', '<?php print $objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_ativar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.PEN_RECURSO_BASE.'_listar'); ?>'); | ||
310 | - form.submit(); | ||
311 | - } | ||
312 | - catch(e){ | ||
313 | - | ||
314 | - alert('Erro : ' + e.message); | ||
315 | - } | ||
316 | - | ||
317 | -} | ||
318 | - | ||
319 | -function onClickBtnDesativar(){ | ||
320 | - | ||
321 | - try { | ||
322 | - | ||
323 | - var form = jQuery('#frmAcompanharEstadoProcesso'); | ||
324 | - form.attr('action', '<?php print $objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_desativar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.PEN_RECURSO_BASE.'_listar'); ?>'); | ||
325 | - form.submit(); | ||
326 | - } | ||
327 | - catch(e){ | ||
328 | - | ||
329 | - alert('Erro : ' + e.message); | ||
330 | - } | ||
331 | -} | ||
332 | - | ||
333 | -function onClickBtnExcluir(){ | ||
334 | - | ||
335 | - try { | ||
336 | - | ||
337 | - var len = jQuery('input[name*=chkInfraItem]:checked').length; | ||
338 | - | ||
339 | - if(len > 0){ | ||
340 | - | ||
341 | - if(confirm('Confirma a exclusão de ' + len + ' mapeamento(s) ?')) { | ||
342 | - | ||
343 | - var form = jQuery('#frmAcompanharEstadoProcesso'); | ||
344 | - form.attr('action', '<?php print $objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_excluir&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.PEN_RECURSO_BASE.'_listar'); ?>'); | ||
345 | - form.submit(); | ||
346 | - } | ||
347 | - } | ||
348 | - else { | ||
349 | - | ||
350 | - alert('Selecione pelo menos um mapeamento para Excluir'); | ||
351 | - } | ||
352 | - } | ||
353 | - catch(e){ | ||
354 | - | ||
355 | - alert('Erro : ' + e.message); | ||
356 | - } | ||
357 | -} | ||
358 | - | ||
359 | -</script> | ||
360 | -<?php | ||
361 | -$objPagina->fecharHead(); | ||
362 | -$objPagina->abrirBody(PEN_PAGINA_TITULO,'onload="inicializar();"'); | ||
363 | -?> | ||
364 | -<form id="frmAcompanharEstadoProcesso" method="post" action="<?php// print $objSessao->assinarLink($strProprioLink); ?>"> | ||
365 | - | ||
366 | - <?php $objPagina->montarBarraComandosSuperior($arrComandos); ?> | ||
367 | - <?php //$objPagina->montarAreaValidacao(); ?> | ||
368 | - <?php $objPagina->abrirAreaDados('12em'); ?> | ||
369 | - | ||
370 | - <label for="id_hipotese_legal" class="infraLabelObrigatorio input-label-first">Hipótese Legal - SEI <?php print $objSessao->getStrSiglaOrgaoUnidadeAtual(); ?>:</label> | ||
371 | - <select name="id_hipotese_legal" class="infraSelect input-field-first"<?php if($bolSomenteLeitura): ?> disabled="disabled" readonly="readonly"<?php endif; ?>> | ||
372 | - <?php print InfraINT::montarSelectArray('', 'Selecione', $objFiltroDTO->getNumIdHipoteseLegal(), $arrMapIdHipoteseLegal); ?> | ||
373 | - </select> | ||
374 | - | ||
375 | - <label for="id_barramento" class="infraLabelObrigatorio input-label-second">Hipótese Legal - Tramitação PEN:</label> | ||
376 | - <select name="id_barramento" class="infraSelect input-field-second"<?php if($bolSomenteLeitura): ?> disabled="disabled" readonly="readonly"<?php endif; ?>> | ||
377 | - <?php print InfraINT::montarSelectArray('', 'Selecione', $objFiltroDTO->getNumIdBarramento(), $arrMapIdBarramento); ?> | ||
378 | - </select> | ||
379 | - | ||
380 | - | ||
381 | - <?php $objPagina->fecharAreaDados(); ?> | ||
382 | - | ||
383 | - <?php if($numRegistros > 0): ?> | ||
384 | - <?php $objPagina->montarAreaTabela($strResultado, $numRegistros); ?> | ||
385 | - <?php //$objPagina->montarAreaDebug(); ?> | ||
386 | - <?php else: ?> | ||
387 | - <div style="clear:both"></div> | ||
388 | - <p>Nenhum mapeamento foi encontrado</p> | ||
389 | - <?php endif; ?> | ||
390 | -</form> | ||
391 | -<?php $objPagina->fecharBody(); ?> | ||
392 | -<?php $objPagina->fecharHtml(); ?> |
@@ -0,0 +1,221 @@ | @@ -0,0 +1,221 @@ | ||
1 | +<?php | ||
2 | +/** | ||
3 | + * | ||
4 | + * @author Join Tecnologia | ||
5 | + */ | ||
6 | + | ||
7 | +require_once dirname(__FILE__) . '/../../SEI.php'; | ||
8 | + | ||
9 | +session_start(); | ||
10 | + | ||
11 | +define('PEN_RECURSO_ATUAL', 'pen_map_hipotese_legal_recebimento_cadastrar'); | ||
12 | +define('PEN_RECURSO_BASE', 'pen_map_hipotese_legal_recebimento'); | ||
13 | +define('PEN_PAGINA_TITULO', 'Mapeamento de Hipóteses Legais de Recebimento'); | ||
14 | +define('PEN_PAGINA_GET_ID', 'id_mapeamento'); | ||
15 | + | ||
16 | + | ||
17 | +$objPagina = PaginaSEI::getInstance(); | ||
18 | +$objBanco = BancoSEI::getInstance(); | ||
19 | +$objSessao = SessaoSEI::getInstance(); | ||
20 | + | ||
21 | + | ||
22 | +try { | ||
23 | + | ||
24 | + $objBanco->abrirConexao(); | ||
25 | + | ||
26 | + $objSessao->validarLink(); | ||
27 | + $objSessao->validarPermissao(PEN_RECURSO_ATUAL); | ||
28 | + | ||
29 | + $arrComandos = array(); | ||
30 | + | ||
31 | + $bolSomenteLeitura = false; | ||
32 | + | ||
33 | + switch ($_GET['acao']) { | ||
34 | + case PEN_RECURSO_BASE.'_cadastrar': | ||
35 | + $arrComandos[] = '<button type="submit" id="btnSalvar" value="Salvar" class="infraButton"><span class="infraTeclaAtalho">S</span>alvar</button>'; | ||
36 | + $arrComandos[] = '<button type="button" id="btnCancelar" value="Cancelar" onclick="location.href=\'' . $objPagina->formatarXHTML($objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_listar&acao_origem=' . $_GET['acao'])) . '\';" class="infraButton"><span class="infraTeclaAtalho">C</span>ancelar</button>'; | ||
37 | + | ||
38 | + if(array_key_exists(PEN_PAGINA_GET_ID, $_GET) && !empty($_GET[PEN_PAGINA_GET_ID])){ | ||
39 | + $strTitulo = sprintf('Editar %s', PEN_PAGINA_TITULO); | ||
40 | + } | ||
41 | + else { | ||
42 | + $strTitulo = sprintf('Novo %s', PEN_PAGINA_TITULO); | ||
43 | + } | ||
44 | + break; | ||
45 | + | ||
46 | + case PEN_RECURSO_BASE.'_visualizar': | ||
47 | + $arrComandos[] = '<button type="button" name="btnFechar" value="Fechar class="infraButton" onclick="location.href=\'' . $objPagina->formatarXHTML($objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_listar&acao_origem=' . $_GET['acao'])) . '\';"><span class="infraTeclaAtalho">F</span>echar</button>'; | ||
48 | + $bolSomenteLeitura = true; | ||
49 | + $strTitulo = sprintf('Consultar %s', PEN_PAGINA_TITULO); | ||
50 | + break; | ||
51 | + | ||
52 | + | ||
53 | + default: | ||
54 | + throw new InfraException("Ação '" . $_GET['acao'] . "' não reconhecida."); | ||
55 | + } | ||
56 | + | ||
57 | + $objPenRelHipoteseLegalRN = new PenRelHipoteseLegalRecebidoRN(); | ||
58 | + | ||
59 | + //-------------------------------------------------------------------------- | ||
60 | + // Ao por POST esta salvando o formulrio | ||
61 | + if(strtoupper($_SERVER['REQUEST_METHOD']) === 'POST') { | ||
62 | + | ||
63 | + if(!array_key_exists('id_hipotese_legal', $_POST) || empty($_POST['id_hipotese_legal'])) { | ||
64 | + throw new InfraException('Nenhuma "Espécie Documental" foi selecionada'); | ||
65 | + } | ||
66 | + | ||
67 | + if(!array_key_exists('id_barramento', $_POST) || empty($_POST['id_barramento'])) { | ||
68 | + throw new InfraException('Nenhum "Tipo de Documento" foi selecionado'); | ||
69 | + } | ||
70 | + | ||
71 | + $objPenRelHipoteseLegalDTO = new PenRelHipoteseLegalDTO(); | ||
72 | + $objPenRelHipoteseLegalDTO->setNumIdHipoteseLegal($_POST['id_hipotese_legal']); | ||
73 | + $objPenRelHipoteseLegalDTO->setNumIdBarramento($_POST['id_barramento']); | ||
74 | + $objPenRelHipoteseLegalDTO->setStrTipo('R');// Recebido | ||
75 | + | ||
76 | + $numIdMapeamento = 0; | ||
77 | + if(array_key_exists(PEN_PAGINA_GET_ID, $_GET) && !empty($_GET[PEN_PAGINA_GET_ID])) { | ||
78 | + $objPenRelHipoteseLegalDTO->setDblIdMap($_GET[PEN_PAGINA_GET_ID]); | ||
79 | + $objPenRelHipoteseLegalRN->alterar($objPenRelHipoteseLegalDTO); | ||
80 | + $numIdMapeamento = $_GET[PEN_PAGINA_GET_ID]; | ||
81 | + } | ||
82 | + else { | ||
83 | + $mapeamento = $objPenRelHipoteseLegalRN->cadastrar($objPenRelHipoteseLegalDTO); | ||
84 | + $numIdMapeamento = $mapeamento->getDblIdMap(); | ||
85 | + } | ||
86 | + | ||
87 | + | ||
88 | + header('Location: '.$objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_listar&acao_origem='.$_GET['acao'].'&acao_origem='.$_GET['acao'].'&id_mapeamento='.$numIdMapeamento.PaginaSEI::getInstance()->montarAncora($numIdMapeamento))); | ||
89 | + exit(0); | ||
90 | + } | ||
91 | + // Ao por GET + ID esta carregando o formulrio | ||
92 | + else if(array_key_exists(PEN_PAGINA_GET_ID, $_GET) && !empty($_GET[PEN_PAGINA_GET_ID])){ | ||
93 | + | ||
94 | + $objPenRelHipoteseLegalDTO = new PenRelHipoteseLegalDTO(); | ||
95 | + $objPenRelHipoteseLegalDTO->setDblIdMap($_GET[PEN_PAGINA_GET_ID]); | ||
96 | + $objPenRelHipoteseLegalDTO->retTodos(); | ||
97 | + | ||
98 | + $objEspecieDocumentalBD = new GenericoBD(BancoSEI::getInstance()); | ||
99 | + $objPenRelHipoteseLegalDTO = $objEspecieDocumentalBD->consultar($objPenRelHipoteseLegalDTO); | ||
100 | + } | ||
101 | + | ||
102 | + if(empty($objPenRelHipoteseLegalDTO)){ | ||
103 | + $objPenRelHipoteseLegalDTO = new PenRelHipoteseLegalDTO(); | ||
104 | + $objPenRelHipoteseLegalDTO->setNumIdHipoteseLegal(0); | ||
105 | + $objPenRelHipoteseLegalDTO->setNumIdBarramento(0); | ||
106 | + } | ||
107 | + | ||
108 | + | ||
109 | + if(array_key_exists(PEN_PAGINA_GET_ID, $_GET) && !empty($_GET[PEN_PAGINA_GET_ID])) { | ||
110 | + $objPenRelHipoteseLegalDTO->setDblIdMap($_GET[PEN_PAGINA_GET_ID]); | ||
111 | + } | ||
112 | + | ||
113 | + //-------------------------------------------------------------------------- | ||
114 | + // Auto-Complete | ||
115 | + //-------------------------------------------------------------------------- | ||
116 | + // Mapeamento da hipotese legal local | ||
117 | + $objHipoteseLegalDTO = new HipoteseLegalDTO(); | ||
118 | + $objHipoteseLegalDTO->setStrStaNivelAcesso(1); | ||
119 | + $objHipoteseLegalDTO->setOrdStrNome(InfraDTO::$TIPO_ORDENACAO_ASC); | ||
120 | + $objHipoteseLegalDTO->retNumIdHipoteseLegal(); | ||
121 | + $objHipoteseLegalDTO->retStrNome(); | ||
122 | + | ||
123 | + $objHipoteseLegalRN = new HipoteseLegalRN(); | ||
124 | + $arrMapIdHipoteseLegal = InfraArray::converterArrInfraDTO($objHipoteseLegalRN->listar($objHipoteseLegalDTO), 'Nome', 'IdHipoteseLegal'); | ||
125 | + | ||
126 | + // Mapeamento da hipotese legal do barramento j utilizados | ||
127 | + $arrNumIdHipoteseLegal = $objPenRelHipoteseLegalRN->getIdBarramentoEmUso($objPenRelHipoteseLegalDTO, 'R'); | ||
128 | + | ||
129 | + // Mapeamento da hipotese legal remota | ||
130 | + $objPenHipoteseLegalDTO = new PenHipoteseLegalDTO(); | ||
131 | + $objPenHipoteseLegalDTO->setOrdStrNome(InfraDTO::$TIPO_ORDENACAO_ASC); | ||
132 | + if(!empty($arrNumIdHipoteseLegal)) { | ||
133 | + // Remove os que j esto em uso | ||
134 | + $objPenHipoteseLegalDTO->setNumIdHipoteseLegal($arrNumIdHipoteseLegal, InfraDTO::$OPER_NOT_IN); | ||
135 | + } | ||
136 | + $objPenHipoteseLegalDTO->retNumIdHipoteseLegal(); | ||
137 | + $objPenHipoteseLegalDTO->retStrNome(); | ||
138 | + | ||
139 | + $objPenHipoteseLegalRN = new PenHipoteseLegalRN(); | ||
140 | + $arrMapIdBarramento = InfraArray::converterArrInfraDTO($objPenHipoteseLegalRN->listar($objPenHipoteseLegalDTO), 'Nome', 'IdHipoteseLegal'); | ||
141 | + //-------------------------------------------------------------------------- | ||
142 | +} | ||
143 | +catch (InfraException $e) { | ||
144 | + $objPagina->processarExcecao($e); | ||
145 | +} | ||
146 | +catch(Exception $e) { | ||
147 | + $objPagina->processarExcecao($e); | ||
148 | +} | ||
149 | + | ||
150 | +// View | ||
151 | +ob_clean(); | ||
152 | + | ||
153 | +$objPagina->montarDocType(); | ||
154 | +$objPagina->abrirHtml(); | ||
155 | +$objPagina->abrirHead(); | ||
156 | +$objPagina->montarMeta(); | ||
157 | +$objPagina->montarTitle(':: ' . $objPagina->getStrNomeSistema() . ' - ' . $strTitulo . ' ::'); | ||
158 | +$objPagina->montarStyle(); | ||
159 | +?> | ||
160 | +<style type="text/css"> | ||
161 | + | ||
162 | +.input-label-first{position:absolute;left:0%;top:0%;width:25%; color: #666!important} | ||
163 | +.input-field-first{position:absolute;left:0%;top:15%;width:25%} | ||
164 | + | ||
165 | +.input-label-third {position:absolute;left:0%;top:40%;width:25%; color:#666!important} | ||
166 | +.input-field-third {position:absolute;left:0%;top:55%;width:25%;} | ||
167 | + | ||
168 | +</style> | ||
169 | +<?php $objPagina->montarJavaScript(); ?> | ||
170 | +<script type="text/javascript"> | ||
171 | + | ||
172 | +function inicializar(){ | ||
173 | + | ||
174 | + | ||
175 | +} | ||
176 | + | ||
177 | +function onSubmit() { | ||
178 | + | ||
179 | + var form = jQuery('#<?php print PEN_RECURSO_BASE; ?>_form'); | ||
180 | + var field = jQuery('select[name=id_hipotese_legal]', form); | ||
181 | + | ||
182 | + if(field.val() === 'null' || !field.val()){ | ||
183 | + alert('Nenhuma "Hipótese Legal - SEI <?php print $objSessao->getStrSiglaOrgaoUnidadeAtual(); ?>" foi selecionada'); | ||
184 | + field.focus(); | ||
185 | + return false; | ||
186 | + } | ||
187 | + | ||
188 | + field = jQuery('select[name=id_barramento]', form); | ||
189 | + | ||
190 | + if(field.val() === 'null' || !field.val()){ | ||
191 | + alert('Nenhum "Hipótese Legal - Tramitação PEN" foi selecionado'); | ||
192 | + field.focus(); | ||
193 | + return false; | ||
194 | + } | ||
195 | +} | ||
196 | + | ||
197 | +</script> | ||
198 | +<?php | ||
199 | +$objPagina->fecharHead(); | ||
200 | +$objPagina->abrirBody($strTitulo,'onload="inicializar();"'); | ||
201 | +?> | ||
202 | +<form id="<?php print PEN_RECURSO_BASE; ?>_form" onsubmit="return onSubmit();" method="post" action="<?php //print $objSessaoSEI->assinarLink($strProprioLink); ?>"> | ||
203 | + <?php $objPagina->montarBarraComandosSuperior($arrComandos); ?> | ||
204 | + <?php $objPagina->montarAreaValidacao(); ?> | ||
205 | + <?php $objPagina->abrirAreaDados('12em'); ?> | ||
206 | + | ||
207 | + <label for="id_hipotese_legal" class="infraLabelObrigatorio input-label-first">Hipótese Legal - SEI <?php print $objSessao->getStrSiglaOrgaoUnidadeAtual(); ?>:</label> | ||
208 | + | ||
209 | + <select name="id_hipotese_legal" class="infraSelect input-field-first"<?php if($bolSomenteLeitura): ?> disabled="disabled" readonly="readonly"<?php endif; ?>> | ||
210 | + <?php print InfraINT::montarSelectArray('', 'Selecione', $objPenRelHipoteseLegalDTO->getNumIdHipoteseLegal(), $arrMapIdHipoteseLegal); ?> | ||
211 | + </select> | ||
212 | + | ||
213 | + <label for="id_barramento" class="infraLabelObrigatorio input-label-third">Hipótese Legal - Tramitação PEN:</label> | ||
214 | + <select name="id_barramento" class="infraSelect input-field-third"<?php if($bolSomenteLeitura): ?> disabled="disabled" readonly="readonly"<?php endif; ?>> | ||
215 | + <?php print InfraINT::montarSelectArray('', 'Selecione', $objPenRelHipoteseLegalDTO->getNumIdBarramento(), $arrMapIdBarramento); ?> | ||
216 | + </select> | ||
217 | + | ||
218 | + <?php print $objPagina->fecharAreaDados(); ?> | ||
219 | +</form> | ||
220 | +<?php $objPagina->fecharBody(); ?> | ||
221 | +<?php $objPagina->fecharHtml(); ?> |
@@ -0,0 +1,390 @@ | @@ -0,0 +1,390 @@ | ||
1 | +<?php | ||
2 | + | ||
3 | +require_once dirname(__FILE__) . '/../../SEI.php'; | ||
4 | + | ||
5 | +/** | ||
6 | + * Consulta os logs do estado do procedimento ao ser expedido | ||
7 | + * | ||
8 | + * @author Join Tecnologia | ||
9 | + */ | ||
10 | + | ||
11 | +session_start(); | ||
12 | + | ||
13 | + | ||
14 | +require_once dirname(__FILE__) . '/../../SEI.php'; | ||
15 | + | ||
16 | +session_start(); | ||
17 | + | ||
18 | +define('PEN_RECURSO_ATUAL', 'pen_map_hipotese_legal_recebimento_listar'); | ||
19 | +define('PEN_RECURSO_BASE', 'pen_map_hipotese_legal_recebimento'); | ||
20 | +define('PEN_PAGINA_TITULO', 'Mapeamento de Hipóteses Legais de Recebimento'); | ||
21 | +define('PEN_PAGINA_GET_ID', 'id_mapeamento'); | ||
22 | + | ||
23 | + | ||
24 | +$objPagina = PaginaSEI::getInstance(); | ||
25 | +$objBanco = BancoSEI::getInstance(); | ||
26 | +$objSessao = SessaoSEI::getInstance(); | ||
27 | +$objDebug = InfraDebug::getInstance(); | ||
28 | + | ||
29 | + | ||
30 | +try { | ||
31 | + | ||
32 | + $objDebug->setBolLigado(false); | ||
33 | + $objDebug->setBolDebugInfra(true); | ||
34 | + $objDebug->limpar(); | ||
35 | + | ||
36 | + $objSessao->validarLink(); | ||
37 | + $objSessao->validarPermissao(PEN_RECURSO_ATUAL); | ||
38 | + | ||
39 | + $objBanco->abrirConexao(); | ||
40 | + | ||
41 | + //-------------------------------------------------------------------------- | ||
42 | + // Aes | ||
43 | + if(array_key_exists('acao', $_GET)) { | ||
44 | + | ||
45 | + $arrParam = array_merge($_GET, $_POST); | ||
46 | + | ||
47 | + switch($_GET['acao']) { | ||
48 | + | ||
49 | + case PEN_RECURSO_BASE.'_excluir': | ||
50 | + | ||
51 | + if(array_key_exists('hdnInfraItensSelecionados', $arrParam) && !empty($arrParam['hdnInfraItensSelecionados'])) { | ||
52 | + | ||
53 | + $objPenRelHipoteseLegalDTO = new PenRelHipoteseLegalDTO(); | ||
54 | + $objPenRelHipoteseLegalRN = new PenRelHipoteseLegalRecebidoRN(); | ||
55 | + | ||
56 | + $arrParam['hdnInfraItensSelecionados'] = explode(',', $arrParam['hdnInfraItensSelecionados']); | ||
57 | + | ||
58 | + if(is_array($arrParam['hdnInfraItensSelecionados'])) { | ||
59 | + | ||
60 | + foreach($arrParam['hdnInfraItensSelecionados'] as $dblIdMap) { | ||
61 | + | ||
62 | + $objPenRelHipoteseLegalDTO->setDblIdMap($dblIdMap); | ||
63 | + $objPenRelHipoteseLegalRN->excluir($objPenRelHipoteseLegalDTO); | ||
64 | + } | ||
65 | + } | ||
66 | + else { | ||
67 | + | ||
68 | + $objPenRelHipoteseLegalDTO->setDblIdMap($arrParam['hdnInfraItensSelecionados']); | ||
69 | + $objPenRelHipoteseLegalRN->excluir($objPenRelHipoteseLegalDTO); | ||
70 | + } | ||
71 | + | ||
72 | + $objPagina->adicionarMensagem(sprintf('%s foi excluido com sucesso.', PEN_PAGINA_TITULO), InfraPagina::$TIPO_MSG_AVISO); | ||
73 | + | ||
74 | + header('Location: '.SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.$_GET['acao_retorno'].'&acao_origem='.$_GET['acao_origem'])); | ||
75 | + exit(0); | ||
76 | + } | ||
77 | + else { | ||
78 | + | ||
79 | + throw new InfraException('Nenhum Registro foi selecionado para executar esta ação'); | ||
80 | + } | ||
81 | + break; | ||
82 | + | ||
83 | + case PEN_RECURSO_BASE.'_desativar': | ||
84 | + | ||
85 | + if(array_key_exists('hdnInfraItensSelecionados', $arrParam) && !empty($arrParam['hdnInfraItensSelecionados'])) { | ||
86 | + | ||
87 | + PenRelHipoteseLegalRN::mudarEstado(explode(',', $arrParam['hdnInfraItensSelecionados']), 'N'); | ||
88 | + | ||
89 | + $objPagina->adicionarMensagem('Desativado com sucesso.', InfraPagina::$TIPO_MSG_AVISO); | ||
90 | + | ||
91 | + header('Location: '.SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.$_GET['acao_retorno'].'&acao_origem='.$_GET['acao_origem'])); | ||
92 | + exit(0); | ||
93 | + } | ||
94 | + else { | ||
95 | + | ||
96 | + throw new InfraException('Nenhum Registro foi selecionado para executar esta ação'); | ||
97 | + } | ||
98 | + break; | ||
99 | + | ||
100 | + case PEN_RECURSO_BASE.'_ativar': | ||
101 | + if(array_key_exists('hdnInfraItensSelecionados', $arrParam) && !empty($arrParam['hdnInfraItensSelecionados'])) { | ||
102 | + | ||
103 | + PenRelHipoteseLegalRN::mudarEstado(explode(',', $arrParam['hdnInfraItensSelecionados']), 'S'); | ||
104 | + | ||
105 | + $objPagina->adicionarMensagem('Ativado com sucesso.', InfraPagina::$TIPO_MSG_AVISO); | ||
106 | + | ||
107 | + header('Location: '.SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.$_GET['acao_retorno'].'&acao_origem='.$_GET['acao_origem'])); | ||
108 | + exit(0); | ||
109 | + } | ||
110 | + break; | ||
111 | + | ||
112 | + case PEN_RECURSO_BASE.'_listar': | ||
113 | + // Ação padrão desta tela | ||
114 | + break; | ||
115 | + | ||
116 | + default: | ||
117 | + throw new InfraException('Ação não permitida nesta tela'); | ||
118 | + | ||
119 | + } | ||
120 | + } | ||
121 | + //-------------------------------------------------------------------------- | ||
122 | + | ||
123 | + $arrComandos = array(); | ||
124 | + $arrComandos[] = '<button type="button" accesskey="P" onclick="onClickBtnPesquisar();" id="btnPesquisar" value="Pesquisar" class="infraButton"><span class="infraTeclaAtalho">P</span>esquisar</button>'; | ||
125 | + $arrComandos[] = '<button type="button" value="Novo" onclick="onClickBtnNovo()" class="infraButton"><span class="infraTeclaAtalho">N</span>ovo</button>'; | ||
126 | + $arrComandos[] = '<button type="button" value="Excluir" onclick="onClickBtnExcluir()" class="infraButton"><span class="infraTeclaAtalho">E</span>xcluir</button>'; | ||
127 | + $arrComandos[] = '<button type="button" accesskey="I" id="btnImprimir" value="Imprimir" onclick="infraImprimirTabela();" class="infraButton"><span class="infraTeclaAtalho">I</span>mprimir</button>'; | ||
128 | + | ||
129 | + //-------------------------------------------------------------------------- | ||
130 | + // DTO de paginao | ||
131 | + | ||
132 | + $objPenRelHipoteseLegalDTO = new PenRelHipoteseLegalDTO(); | ||
133 | + $objPenRelHipoteseLegalDTO->setStrTipo('R'); | ||
134 | + $objPenRelHipoteseLegalDTO->retTodos(); | ||
135 | + //-------------------------------------------------------------------------- | ||
136 | + // Filtragem | ||
137 | + if(array_key_exists('id_barramento', $_POST) && (!empty($_POST['id_barramento']) && $_POST['id_barramento'] !== 'null')) { | ||
138 | + $objPenRelHipoteseLegalDTO->setNumIdBarramento($_POST['id_barramento']); | ||
139 | + } | ||
140 | + | ||
141 | + if(array_key_exists('id_hipotese_legal', $_POST) && (!empty($_POST['id_hipotese_legal']) && $_POST['id_barramento'] !== 'null')) { | ||
142 | + $objPenRelHipoteseLegalDTO->setNumIdHipoteseLegal($_POST['id_hipotese_legal']); | ||
143 | + } | ||
144 | + | ||
145 | + $objFiltroDTO = clone $objPenRelHipoteseLegalDTO; | ||
146 | + | ||
147 | + if(!$objFiltroDTO->isSetNumIdBarramento()) { | ||
148 | + $objFiltroDTO->setNumIdBarramento(''); | ||
149 | + } | ||
150 | + | ||
151 | + if(!$objFiltroDTO->isSetNumIdHipoteseLegal()) { | ||
152 | + $objFiltroDTO->setNumIdHipoteseLegal(''); | ||
153 | + } | ||
154 | + //-------------------------------------------------------------------------- | ||
155 | + $objGenericoBD = new GenericoBD($objBanco); | ||
156 | + | ||
157 | + // Mapeamento da hipotese legal remota | ||
158 | + $objPenHipoteseLegalDTO = new PenHipoteseLegalDTO(); | ||
159 | + $objPenHipoteseLegalDTO->setDistinct(true); | ||
160 | + $objPenHipoteseLegalDTO->setOrdStrNome(InfraDTO::$TIPO_ORDENACAO_ASC); | ||
161 | + $objPenHipoteseLegalDTO->retNumIdHipoteseLegal(); | ||
162 | + $objPenHipoteseLegalDTO->retStrNome(); | ||
163 | + | ||
164 | + $objPenHipoteseLegalRN = new PenHipoteseLegalRN(); | ||
165 | + $arrMapIdBarramento = InfraArray::converterArrInfraDTO($objPenHipoteseLegalRN->listar($objPenHipoteseLegalDTO), 'Nome', 'IdHipoteseLegal'); | ||
166 | + | ||
167 | + // Mapeamento da hipotese legal local | ||
168 | + $objHipoteseLegalDTO = new HipoteseLegalDTO(); | ||
169 | + $objHipoteseLegalDTO->setStrStaNivelAcesso(ProtocoloRN::$NA_RESTRITO); //Restrito | ||
170 | + $objHipoteseLegalDTO->setStrSinAtivo('S'); | ||
171 | + $objHipoteseLegalDTO->setDistinct(true); | ||
172 | + $objHipoteseLegalDTO->setOrdStrNome(InfraDTO::$TIPO_ORDENACAO_ASC); | ||
173 | + $objHipoteseLegalDTO->retNumIdHipoteseLegal(); | ||
174 | + $objHipoteseLegalDTO->retStrNome(); | ||
175 | + | ||
176 | + $objHipoteseLegalRN = new HipoteseLegalRN(); | ||
177 | + $arrMapIdHipoteseLegal = InfraArray::converterArrInfraDTO($objHipoteseLegalRN->listar($objHipoteseLegalDTO), 'Nome', 'IdHipoteseLegal'); | ||
178 | + //-------------------------------------------------------------------------- | ||
179 | + // | ||
180 | + //$objPagina->prepararOrdenacao($objPenRelHipoteseLegalDTO, 'IdMapeamento', InfraDTO::$TIPO_ORDENACAO_ASC); | ||
181 | + $objPagina->prepararPaginacao($objPenRelHipoteseLegalDTO); | ||
182 | + | ||
183 | + $arrObjPenRelHipoteseLegalDTO = $objGenericoBD->listar($objPenRelHipoteseLegalDTO); | ||
184 | + | ||
185 | + $objPagina->processarPaginacao($objPenRelHipoteseLegalDTO); | ||
186 | + | ||
187 | + $numRegistros = count($arrObjPenRelHipoteseLegalDTO); | ||
188 | + | ||
189 | + if(!empty($arrObjPenRelHipoteseLegalDTO)){ | ||
190 | + | ||
191 | + $strResultado = ''; | ||
192 | + | ||
193 | + $strResultado .= '<table width="99%" class="infraTable">'."\n"; | ||
194 | + $strResultado .= '<caption class="infraCaption">'.$objPagina->gerarCaptionTabela(PEN_PAGINA_TITULO, $numRegistros).'</caption>'; | ||
195 | + | ||
196 | + $strResultado .= '<tr>'; | ||
197 | + $strResultado .= '<th class="infraTh" width="1%">'.$objPagina->getThCheck().'</th>'."\n"; | ||
198 | + $strResultado .= '<th class="infraTh" width="35%">Hipótese Legal - SEI '.$objSessao->getStrSiglaOrgaoUnidadeAtual().'</th>'."\n"; | ||
199 | + $strResultado .= '<th class="infraTh" width="35%">Hipótese Legal - Tramitação PEN</th>'."\n"; | ||
200 | + $strResultado .= '<th class="infraTh" width="14%">Ações</th>'."\n"; | ||
201 | + $strResultado .= '</tr>'."\n"; | ||
202 | + $strCssTr = ''; | ||
203 | + | ||
204 | + $index = 0; | ||
205 | + foreach($arrObjPenRelHipoteseLegalDTO as $objPenRelHipoteseLegalDTO) { | ||
206 | + | ||
207 | + $strCssTr = ($strCssTr == 'infraTrClara') ? 'infraTrEscura' : 'infraTrClara'; | ||
208 | + | ||
209 | + $strResultado .= '<tr class="'.$strCssTr.'">'; | ||
210 | + $strResultado .= '<td>'.$objPagina->getTrCheck($index, $objPenRelHipoteseLegalDTO->getDblIdMap(), '').'</td>'; | ||
211 | + $strResultado .= '<td>'.$arrMapIdHipoteseLegal[$objPenRelHipoteseLegalDTO->getNumIdHipoteseLegal()].'</td>'; | ||
212 | + $strResultado .= '<td>'.$arrMapIdBarramento[$objPenRelHipoteseLegalDTO->getNumIdBarramento()].'</td>'; | ||
213 | + $strResultado .= '<td align="center">'; | ||
214 | + | ||
215 | + //$strResultado .= '<a href="'.$objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_visualizar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao'].'&'.PEN_PAGINA_GET_ID.'='.$objPenRelHipoteseLegalDTO->getDblIdMap()).'"><img src="imagens/consultar.gif" title="Consultar Mapeamento" alt="Consultar Mapeamento" class="infraImg"></a>'; | ||
216 | + if($objSessao->verificarPermissao('pen_map_hipotese_legal_recebido_alterar')) { | ||
217 | + $strResultado .= '<a href="'.$objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_cadastrar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao'].'&'.PEN_PAGINA_GET_ID.'='.$objPenRelHipoteseLegalDTO->getDblIdMap()).'"><img src="imagens/alterar.gif" title="Alterar Mapeamento" alt="Alterar Mapeamento" class="infraImg"></a>'; | ||
218 | + } | ||
219 | + | ||
220 | + if($objSessao->verificarPermissao('pen_map_hipotese_legal_recebido_excluir')) { | ||
221 | + $strResultado .= '<a href="#" onclick="onCLickLinkDelete(\''.$objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_excluir&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao'].'&hdnInfraItensSelecionados='.$objPenRelHipoteseLegalDTO->getDblIdMap()).'\', this)"><img src="imagens/excluir.gif" title="Excluir Mapeamento" alt="Excluir Mapeamento" class="infraImg"></a>'; | ||
222 | + } | ||
223 | + | ||
224 | + $strResultado .= '</td>'; | ||
225 | + $strResultado .= '</tr>'."\n"; | ||
226 | + | ||
227 | + $index++; | ||
228 | + } | ||
229 | + $strResultado .= '</table>'; | ||
230 | + } | ||
231 | +} | ||
232 | +catch(InfraException $e){ | ||
233 | + | ||
234 | + print '<pre>'; | ||
235 | + print_r($e); | ||
236 | + print '</pre>'; | ||
237 | + exit(0); | ||
238 | + //$objPagina->processarExcecao($e); | ||
239 | +} | ||
240 | + | ||
241 | + | ||
242 | +$objPagina->montarDocType(); | ||
243 | +$objPagina->abrirHtml(); | ||
244 | +$objPagina->abrirHead(); | ||
245 | +$objPagina->montarMeta(); | ||
246 | +$objPagina->montarTitle(':: '.$objPagina->getStrNomeSistema().' - '.PEN_PAGINA_TITULO.' ::'); | ||
247 | +$objPagina->montarStyle(); | ||
248 | +?> | ||
249 | +<style type="text/css"> | ||
250 | + | ||
251 | +.input-label-first{position:absolute;left:0%;top:0%;width:25%; color: #666!important} | ||
252 | +.input-field-first{position:absolute;left:0%;top:50%;width:25%} | ||
253 | + | ||
254 | +.input-label-second{position:absolute;left:30%;top:0%;width:25%; color: #666!important} | ||
255 | +.input-field-second{position:absolute;left:30%;top:50%;width:25%;} | ||
256 | + | ||
257 | +.input-label-third {position:absolute;left:0%;top:40%;width:25%; color:#666!important} | ||
258 | +.input-field-third {position:absolute;left:0%;top:55%;width:25%;} | ||
259 | + | ||
260 | +</style> | ||
261 | +<?php $objPagina->montarJavaScript(); ?> | ||
262 | +<script type="text/javascript"> | ||
263 | + | ||
264 | +function inicializar(){ | ||
265 | + | ||
266 | + infraEfeitoTabelas(); | ||
267 | + | ||
268 | +} | ||
269 | + | ||
270 | +function onClickBtnPesquisar(){ | ||
271 | + document.getElementById('frmAcompanharEstadoProcesso').action='<?php print $objSessao->assinarLink('controlador.php?acao='.$_GET['acao'].'&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao_retorno']); ?>'; | ||
272 | + document.getElementById('frmAcompanharEstadoProcesso').submit(); | ||
273 | +} | ||
274 | + | ||
275 | +function tratarEnter(ev){ | ||
276 | + var key = infraGetCodigoTecla(ev); | ||
277 | + if (key == 13){ | ||
278 | + onClickBtnPesquisar(); | ||
279 | + } | ||
280 | + return true; | ||
281 | +} | ||
282 | + | ||
283 | +function onCLickLinkDelete(url, link) { | ||
284 | + | ||
285 | + var row = jQuery(link).parents('tr:first'); | ||
286 | + | ||
287 | + var strEspecieDocumental = row.find('td:eq(1)').text(); | ||
288 | + var strTipoDocumento = row.find('td:eq(2)').text(); | ||
289 | + | ||
290 | + if(confirm('Confirma a exclusão do mapeamento "' + strEspecieDocumental + ' x ' + strTipoDocumento +'"?')){ | ||
291 | + | ||
292 | + window.location = url; | ||
293 | + } | ||
294 | + | ||
295 | +} | ||
296 | + | ||
297 | +function onClickBtnNovo(){ | ||
298 | + | ||
299 | + window.location = '<?php print $objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_cadastrar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao_origem']); ?>'; | ||
300 | +} | ||
301 | + | ||
302 | +function onClickBtnAtivar(){ | ||
303 | + | ||
304 | + try { | ||
305 | + | ||
306 | + var form = jQuery('#frmAcompanharEstadoProcesso'); | ||
307 | + form.attr('action', '<?php print $objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_ativar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.PEN_RECURSO_BASE.'_listar'); ?>'); | ||
308 | + form.submit(); | ||
309 | + } | ||
310 | + catch(e){ | ||
311 | + | ||
312 | + alert('Erro : ' + e.message); | ||
313 | + } | ||
314 | + | ||
315 | +} | ||
316 | + | ||
317 | +function onClickBtnDesativar(){ | ||
318 | + | ||
319 | + try { | ||
320 | + | ||
321 | + var form = jQuery('#frmAcompanharEstadoProcesso'); | ||
322 | + form.attr('action', '<?php print $objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_desativar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.PEN_RECURSO_BASE.'_listar'); ?>'); | ||
323 | + form.submit(); | ||
324 | + } | ||
325 | + catch(e){ | ||
326 | + | ||
327 | + alert('Erro : ' + e.message); | ||
328 | + } | ||
329 | +} | ||
330 | + | ||
331 | +function onClickBtnExcluir(){ | ||
332 | + | ||
333 | + try { | ||
334 | + | ||
335 | + var len = jQuery('input[name*=chkInfraItem]:checked').length; | ||
336 | + | ||
337 | + if(len > 0){ | ||
338 | + | ||
339 | + if(confirm('Confirma a exclusão de ' + len + ' mapeamento(s) ?')) { | ||
340 | + | ||
341 | + var form = jQuery('#frmAcompanharEstadoProcesso'); | ||
342 | + form.attr('action', '<?php print $objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_excluir&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.PEN_RECURSO_BASE.'_listar'); ?>'); | ||
343 | + form.submit(); | ||
344 | + } | ||
345 | + } | ||
346 | + else { | ||
347 | + | ||
348 | + alert('Selecione pelo menos um mapeamento para Excluir'); | ||
349 | + } | ||
350 | + } | ||
351 | + catch(e){ | ||
352 | + | ||
353 | + alert('Erro : ' + e.message); | ||
354 | + } | ||
355 | +} | ||
356 | + | ||
357 | +</script> | ||
358 | +<?php | ||
359 | +$objPagina->fecharHead(); | ||
360 | +$objPagina->abrirBody(PEN_PAGINA_TITULO,'onload="inicializar();"'); | ||
361 | +?> | ||
362 | +<form id="frmAcompanharEstadoProcesso" method="post" action="<?php// print $objSessao->assinarLink($strProprioLink); ?>"> | ||
363 | + | ||
364 | + <?php $objPagina->montarBarraComandosSuperior($arrComandos); ?> | ||
365 | + <?php //$objPagina->montarAreaValidacao(); ?> | ||
366 | + <?php $objPagina->abrirAreaDados('40px'); ?> | ||
367 | + | ||
368 | + <label for="id_hipotese_legal" class="infraLabelObrigatorio input-label-first">Hipótese Legal - SEI <?php print $objSessao->getStrSiglaOrgaoUnidadeAtual(); ?>:</label> | ||
369 | + <select name="id_hipotese_legal" class="infraSelect input-field-first"<?php if($bolSomenteLeitura): ?> disabled="disabled" readonly="readonly"<?php endif; ?>> | ||
370 | + <?php print InfraINT::montarSelectArray('', 'Selecione', $objFiltroDTO->getNumIdHipoteseLegal(), $arrMapIdHipoteseLegal); ?> | ||
371 | + </select> | ||
372 | + | ||
373 | + <label for="id_barramento" class="infraLabelObrigatorio input-label-second">Hipótese Legal - Tramitação PEN:</label> | ||
374 | + <select name="id_barramento" class="infraSelect input-field-second"<?php if($bolSomenteLeitura): ?> disabled="disabled" readonly="readonly"<?php endif; ?>> | ||
375 | + <?php print InfraINT::montarSelectArray('', 'Selecione', $objFiltroDTO->getNumIdBarramento(), $arrMapIdBarramento); ?> | ||
376 | + </select> | ||
377 | + | ||
378 | + | ||
379 | + <?php $objPagina->fecharAreaDados(); ?> | ||
380 | + | ||
381 | + <?php if($numRegistros > 0): ?> | ||
382 | + <?php $objPagina->montarAreaTabela($strResultado, $numRegistros); ?> | ||
383 | + <?php //$objPagina->montarAreaDebug(); ?> | ||
384 | + <?php else: ?> | ||
385 | + <div style="clear:both"></div> | ||
386 | + <p>Nenhum mapeamento foi encontrado</p> | ||
387 | + <?php endif; ?> | ||
388 | +</form> | ||
389 | +<?php $objPagina->fecharBody(); ?> | ||
390 | +<?php $objPagina->fecharHtml(); ?> |
pen_map_tipo_doc_enviado_cadastrar.php
@@ -25,7 +25,7 @@ try { | @@ -25,7 +25,7 @@ try { | ||
25 | switch ($_GET['acao']) { | 25 | switch ($_GET['acao']) { |
26 | case 'pen_map_tipo_doc_enviado_cadastrar': | 26 | case 'pen_map_tipo_doc_enviado_cadastrar': |
27 | $arrComandos[] = '<button type="submit" name="sbmCadastrarSerie" value="Salvar" class="infraButton"><span class="infraTeclaAtalho">S</span>alvar</button>'; | 27 | $arrComandos[] = '<button type="submit" name="sbmCadastrarSerie" value="Salvar" class="infraButton"><span class="infraTeclaAtalho">S</span>alvar</button>'; |
28 | - $arrComandos[] = '<button type="button" value="Cancelar" onclick="location.href=\'' . $objPaginaSEI->formatarXHTML(SessaoSEI::getInstance()->assinarLink('controlador.php?acao=pen_map_tipo_doc_enviado_listar&acao_origem=' . $_GET['acao'])) . '\';" class="infraButton">Cancelar</button>'; | 28 | + $arrComandos[] = '<button type="button" value="Cancelar" onclick="location.href=\'' . $objPaginaSEI->formatarXHTML(SessaoSEI::getInstance()->assinarLink('controlador.php?acao=pen_map_tipo_doc_enviado_listar&acao_origem=' . $_GET['acao'])) . '\';" class="infraButton"><span class="infraTeclaAtalho">C</span>ancelar</button>'; |
29 | 29 | ||
30 | if(array_key_exists('codigo_especie', $_GET) && !empty($_GET['codigo_especie'])){ | 30 | if(array_key_exists('codigo_especie', $_GET) && !empty($_GET['codigo_especie'])){ |
31 | $strTitulo = 'Editar Mapeamento de Envio'; | 31 | $strTitulo = 'Editar Mapeamento de Envio'; |
@@ -36,7 +36,7 @@ try { | @@ -36,7 +36,7 @@ try { | ||
36 | break; | 36 | break; |
37 | 37 | ||
38 | case 'pen_map_tipo_doc_enviado_visualizar': | 38 | case 'pen_map_tipo_doc_enviado_visualizar': |
39 | - $arrComandos[] = '<button type="button" name="btnFechar" value="Fechar class="infraButton" onclick="location.href=\'' . $objPaginaSEI->formatarXHTML(SessaoSEI::getInstance()->assinarLink('controlador.php?acao=pen_map_tipo_doc_enviado_listar&acao_origem=' . $_GET['acao'])) . '\';">Fechar</button>'; | 39 | + $arrComandos[] = '<button type="button" name="btnFechar" value="Fechar class="infraButton" onclick="location.href=\'' . $objPaginaSEI->formatarXHTML(SessaoSEI::getInstance()->assinarLink('controlador.php?acao=pen_map_tipo_doc_enviado_listar&acao_origem=' . $_GET['acao'])) . '\';"><span class="infraTeclaAtalho">F</span>echar</button>'; |
40 | $bolSomenteLeitura = true; | 40 | $bolSomenteLeitura = true; |
41 | $strTitulo = 'Consultar Mapeamento de Envio'; | 41 | $strTitulo = 'Consultar Mapeamento de Envio'; |
42 | break; | 42 | break; |
pen_map_tipo_doc_enviado_listar.php
@@ -95,12 +95,12 @@ try { | @@ -95,12 +95,12 @@ try { | ||
95 | $strTitulo = 'Lista dos Mapeamentos de Envio'; | 95 | $strTitulo = 'Lista dos Mapeamentos de Envio'; |
96 | 96 | ||
97 | $arrComandos = array(); | 97 | $arrComandos = array(); |
98 | - $arrComandos[] = '<button type="button" accesskey="P" onclick="onClickBtnPesquisar();" id="btnPesquisar" value="Pesquisar" class="infraButton">Pesquisar</button>'; | ||
99 | - $arrComandos[] = '<button type="button" value="Novo" onclick="onClickBtnNovo()" class="infraButton">Novo</button>'; | 98 | + $arrComandos[] = '<button type="button" accesskey="P" onclick="onClickBtnPesquisar();" id="btnPesquisar" value="Pesquisar" class="infraButton"><span class="infraTeclaAtalho">P</span>esquisar</button>'; |
99 | + $arrComandos[] = '<button type="button" value="Novo" onclick="onClickBtnNovo()" class="infraButton"><span class="infraTeclaAtalho">N</span>ovo</button>'; | ||
100 | //$arrComandos[] = '<button type="button" value="Ativar" onclick="onClickBtnAtivar()" class="infraButton">Ativar</button>'; | 100 | //$arrComandos[] = '<button type="button" value="Ativar" onclick="onClickBtnAtivar()" class="infraButton">Ativar</button>'; |
101 | //$arrComandos[] = '<button type="button" value="Desativar" onclick="onClickBtnDesativar()" class="infraButton">Desativar</button>'; | 101 | //$arrComandos[] = '<button type="button" value="Desativar" onclick="onClickBtnDesativar()" class="infraButton">Desativar</button>'; |
102 | - $arrComandos[] = '<button type="button" value="Excluir" onclick="onClickBtnExcluir()" class="infraButton">Excluir</button>'; | ||
103 | - $arrComandos[] = '<button type="button" accesskey="I" id="btnImprimir" value="Imprimir" onclick="infraImprimirTabela();" class="infraButton">Imprimir</button>'; | 102 | + $arrComandos[] = '<button type="button" value="Excluir" onclick="onClickBtnExcluir()" class="infraButton"><span class="infraTeclaAtalho">E</span>xcluir</button>'; |
103 | + $arrComandos[] = '<button type="button" accesskey="I" id="btnImprimir" value="Imprimir" onclick="infraImprimirTabela();" class="infraButton"><span class="infraTeclaAtalho">I</span>mprimir</button>'; | ||
104 | 104 | ||
105 | //-------------------------------------------------------------------------- | 105 | //-------------------------------------------------------------------------- |
106 | // DTO de paginação | 106 | // DTO de paginação |
@@ -190,10 +190,10 @@ $objPaginaSEI->montarStyle(); | @@ -190,10 +190,10 @@ $objPaginaSEI->montarStyle(); | ||
190 | <style type="text/css"> | 190 | <style type="text/css"> |
191 | 191 | ||
192 | .input-label-first{position:absolute;left:0%;top:0%;width:25%; color: #666!important} | 192 | .input-label-first{position:absolute;left:0%;top:0%;width:25%; color: #666!important} |
193 | -.input-field-first{position:absolute;left:0%;top:15%;width:25%} | 193 | +.input-field-first{position:absolute;left:0%;top:50%;width:25%} |
194 | 194 | ||
195 | .input-label-second{position:absolute;left:30%;top:0%;width:25%; color: #666!important} | 195 | .input-label-second{position:absolute;left:30%;top:0%;width:25%; color: #666!important} |
196 | -.input-field-second{position:absolute;left:30%;top:15%;width:25%;} | 196 | +.input-field-second{position:absolute;left:30%;top:50%;width:25%;} |
197 | 197 | ||
198 | .input-label-third {position:absolute;left:0%;top:40%;width:25%; color:#666!important} | 198 | .input-label-third {position:absolute;left:0%;top:40%;width:25%; color:#666!important} |
199 | .input-field-third {position:absolute;left:0%;top:55%;width:25%;} | 199 | .input-field-third {position:absolute;left:0%;top:55%;width:25%;} |
@@ -312,7 +312,7 @@ $objPaginaSEI->abrirBody($strTitulo,'onload="inicializar();"'); | @@ -312,7 +312,7 @@ $objPaginaSEI->abrirBody($strTitulo,'onload="inicializar();"'); | ||
312 | 312 | ||
313 | <?php $objPaginaSEI->montarBarraComandosSuperior($arrComandos); ?> | 313 | <?php $objPaginaSEI->montarBarraComandosSuperior($arrComandos); ?> |
314 | <?php //$objPaginaSEI->montarAreaValidacao(); ?> | 314 | <?php //$objPaginaSEI->montarAreaValidacao(); ?> |
315 | - <?php $objPaginaSEI->abrirAreaDados('12em'); ?> | 315 | + <?php $objPaginaSEI->abrirAreaDados('40px'); ?> |
316 | 316 | ||
317 | <label for="nome_especie" class="infraLabelObrigatorio input-label-first">Espécie Documental:</label> | 317 | <label for="nome_especie" class="infraLabelObrigatorio input-label-first">Espécie Documental:</label> |
318 | <input type="text" name="nome_especie" class="infraText input-field-first" onkeyup="return tratarEnter(event)" value="<?php print $_POST['nome_especie']; ?>"/> | 318 | <input type="text" name="nome_especie" class="infraText input-field-first" onkeyup="return tratarEnter(event)" value="<?php print $_POST['nome_especie']; ?>"/> |
pen_map_tipo_doc_recebido_cadastrar.php
@@ -25,7 +25,7 @@ try { | @@ -25,7 +25,7 @@ try { | ||
25 | switch ($_GET['acao']) { | 25 | switch ($_GET['acao']) { |
26 | case 'pen_map_tipo_doc_recebido_cadastrar': | 26 | case 'pen_map_tipo_doc_recebido_cadastrar': |
27 | $arrComandos[] = '<button type="submit" name="sbmCadastrarSerie" value="Salvar" class="infraButton"><span class="infraTeclaAtalho">S</span>alvar</button>'; | 27 | $arrComandos[] = '<button type="submit" name="sbmCadastrarSerie" value="Salvar" class="infraButton"><span class="infraTeclaAtalho">S</span>alvar</button>'; |
28 | - $arrComandos[] = '<button type="button" value="Cancelar" onclick="location.href=\'' . $objPaginaSEI->formatarXHTML(SessaoSEI::getInstance()->assinarLink('controlador.php?acao=pen_map_tipo_doc_recebido_listar&acao_origem=' . $_GET['acao'])) . '\';" class="infraButton">Cancelar</button>'; | 28 | + $arrComandos[] = '<button type="button" value="Cancelar" onclick="location.href=\'' . $objPaginaSEI->formatarXHTML(SessaoSEI::getInstance()->assinarLink('controlador.php?acao=pen_map_tipo_doc_recebido_listar&acao_origem=' . $_GET['acao'])) . '\';" class="infraButton"><span class="infraTeclaAtalho">C</span>ancelar</button>'; |
29 | $bolDesativarCampos = false; | 29 | $bolDesativarCampos = false; |
30 | 30 | ||
31 | if(array_key_exists('codigo_especie', $_GET) && !empty($_GET['codigo_especie'])){ | 31 | if(array_key_exists('codigo_especie', $_GET) && !empty($_GET['codigo_especie'])){ |
pen_map_tipo_doc_recebido_listar.php
@@ -76,10 +76,10 @@ try { | @@ -76,10 +76,10 @@ try { | ||
76 | $strTitulo = 'Lista dos Mapeamentos de Recebimento'; | 76 | $strTitulo = 'Lista dos Mapeamentos de Recebimento'; |
77 | 77 | ||
78 | $arrComandos = array(); | 78 | $arrComandos = array(); |
79 | - $arrComandos[] = '<button type="button" accesskey="P" onclick="onClickBtnPesquisar();" id="btnPesquisar" value="Pesquisar" class="infraButton">Pesquisar</button>'; | ||
80 | - $arrComandos[] = '<button type="button" value="Novo" onclick="onClickBtnNovo()" class="infraButton">Novo</button>'; | ||
81 | - $arrComandos[] = '<button type="button" value="Excluir" onclick="onClickBtnExcluir()" class="infraButton">Excluir</button>'; | ||
82 | - $arrComandos[] = '<button type="button" accesskey="I" id="btnImprimir" value="Imprimir" onclick="infraImprimirTabela();" class="infraButton">Imprimir</button>'; | 79 | + $arrComandos[] = '<button type="button" accesskey="P" onclick="onClickBtnPesquisar();" id="btnPesquisar" value="Pesquisar" class="infraButton"><span class="infraTeclaAtalho">P</span>esquisar</button>'; |
80 | + $arrComandos[] = '<button type="button" value="Novo" onclick="onClickBtnNovo()" class="infraButton"><span class="infraTeclaAtalho">N</span>ovo</button>'; | ||
81 | + $arrComandos[] = '<button type="button" value="Excluir" onclick="onClickBtnExcluir()" class="infraButton"><span class="infraTeclaAtalho">E</span>xcluir</button>'; | ||
82 | + $arrComandos[] = '<button type="button" accesskey="I" id="btnImprimir" value="Imprimir" onclick="infraImprimirTabela();" class="infraButton"><span class="infraTeclaAtalho">I</span>mprimir</button>'; | ||
83 | 83 | ||
84 | //-------------------------------------------------------------------------- | 84 | //-------------------------------------------------------------------------- |
85 | // DTO de paginação | 85 | // DTO de paginação |
@@ -162,10 +162,10 @@ $objPaginaSEI->montarStyle(); | @@ -162,10 +162,10 @@ $objPaginaSEI->montarStyle(); | ||
162 | <style type="text/css"> | 162 | <style type="text/css"> |
163 | 163 | ||
164 | .input-label-first{position:absolute;left:0%;top:0%;width:25%; color: #666!important} | 164 | .input-label-first{position:absolute;left:0%;top:0%;width:25%; color: #666!important} |
165 | -.input-field-first{position:absolute;left:0%;top:15%;width:25%} | 165 | +.input-field-first{position:absolute;left:0%;top:50%;width:25%} |
166 | 166 | ||
167 | .input-label-second{position:absolute;left:30%;top:0%;width:25%; color: #666!important} | 167 | .input-label-second{position:absolute;left:30%;top:0%;width:25%; color: #666!important} |
168 | -.input-field-second{position:absolute;left:30%;top:15%;width:25%;} | 168 | +.input-field-second{position:absolute;left:30%;top:50%;width:25%;} |
169 | 169 | ||
170 | .input-label-third {position:absolute;left:0%;top:40%;width:25%; color:#666!important} | 170 | .input-label-third {position:absolute;left:0%;top:40%;width:25%; color:#666!important} |
171 | .input-field-third {position:absolute;left:0%;top:55%;width:25%;} | 171 | .input-field-third {position:absolute;left:0%;top:55%;width:25%;} |
@@ -253,7 +253,7 @@ $objPaginaSEI->abrirBody($strTitulo,'onload="inicializar();"'); | @@ -253,7 +253,7 @@ $objPaginaSEI->abrirBody($strTitulo,'onload="inicializar();"'); | ||
253 | 253 | ||
254 | <?php $objPaginaSEI->montarBarraComandosSuperior($arrComandos); ?> | 254 | <?php $objPaginaSEI->montarBarraComandosSuperior($arrComandos); ?> |
255 | <?php //$objPaginaSEI->montarAreaValidacao(); ?> | 255 | <?php //$objPaginaSEI->montarAreaValidacao(); ?> |
256 | - <?php $objPaginaSEI->abrirAreaDados('12em'); ?> | 256 | + <?php $objPaginaSEI->abrirAreaDados('40px'); ?> |
257 | <label for="nome_especie" class="infraLabelObrigatorio input-label-first">Espécie Documental:</label> | 257 | <label for="nome_especie" class="infraLabelObrigatorio input-label-first">Espécie Documental:</label> |
258 | <input type="text" name="nome_especie" class="infraText input-field-first" onkeyup="return tratarEnter(event)" value="<?php print $_POST['nome_especie']; ?>"/> | 258 | <input type="text" name="nome_especie" class="infraText input-field-first" onkeyup="return tratarEnter(event)" value="<?php print $_POST['nome_especie']; ?>"/> |
259 | 259 |
@@ -0,0 +1,218 @@ | @@ -0,0 +1,218 @@ | ||
1 | +<?php | ||
2 | +/** | ||
3 | + * | ||
4 | + * @author Join Tecnologia (Thiago Farias) | ||
5 | + * Construção e moldura do arquivo, equivalente a exemplos já existentes no sistema. | ||
6 | + */ | ||
7 | + | ||
8 | +require_once dirname(__FILE__) . '/../../SEI.php'; | ||
9 | + | ||
10 | +session_start(); | ||
11 | + | ||
12 | +define('PEN_RECURSO_ATUAL', 'pen_map_unidade_cadastrar'); | ||
13 | +define('PEN_RECURSO_BASE', 'pen_map_unidade'); | ||
14 | +define('PEN_PAGINA_TITULO', 'Mapeamento de Unidades'); | ||
15 | +define('PEN_PAGINA_GET_ID', 'id_unidade'); | ||
16 | + | ||
17 | +$objPagina = PaginaSEI::getInstance(); | ||
18 | +$objBanco = BancoSEI::getInstance(); | ||
19 | +$objSessao = SessaoSEI::getInstance(); | ||
20 | + | ||
21 | +try { | ||
22 | + | ||
23 | + $objBanco->abrirConexao(); | ||
24 | + | ||
25 | + $objSessao->validarLink(); | ||
26 | + $objSessao->validarPermissao(PEN_RECURSO_ATUAL); | ||
27 | + | ||
28 | + $arrComandos = array(); | ||
29 | + | ||
30 | + $bolSomenteLeitura = false; | ||
31 | + | ||
32 | + switch ($_GET['acao']) { | ||
33 | + case PEN_RECURSO_BASE.'_cadastrar': | ||
34 | + $arrComandos[] = '<button type="submit" id="btnSalvar" value="Salvar" class="infraButton"><span class="infraTeclaAtalho">S</span>alvar</button>'; | ||
35 | + $arrComandos[] = '<button type="button" id="btnCancelar" value="Cancelar" onclick="location.href=\'' . $objPagina->formatarXHTML($objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_listar&acao_origem=' . $_GET['acao'])) . '\';" class="infraButton">Cancelar</button>'; | ||
36 | + | ||
37 | + if(array_key_exists(PEN_PAGINA_GET_ID, $_GET) && !empty($_GET[PEN_PAGINA_GET_ID])){ | ||
38 | + $strTitulo = sprintf('Editar %s', PEN_PAGINA_TITULO); | ||
39 | + } | ||
40 | + else { | ||
41 | + $strTitulo = sprintf('Novo %s', PEN_PAGINA_TITULO); | ||
42 | + } | ||
43 | + break; | ||
44 | + | ||
45 | + case PEN_RECURSO_BASE.'_visualizar': | ||
46 | + $arrComandos[] = '<button type="button" name="btnFechar" value="Fechar" class="infraButton" onclick="location.href=\'' . $objPagina->formatarXHTML($objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_listar&acao_origem=' . $_GET['acao'])) . '\';">Fechar</button>'; | ||
47 | + $bolSomenteLeitura = true; | ||
48 | + $strTitulo = sprintf('Consultar %s', PEN_PAGINA_TITULO); | ||
49 | + break; | ||
50 | + | ||
51 | + | ||
52 | + default: | ||
53 | + throw new InfraException("Ação '" . $_GET['acao'] . "' não reconhecida."); | ||
54 | + } | ||
55 | + | ||
56 | + $objPenUnidadeRN = new PenUnidadeRN(); | ||
57 | + | ||
58 | + //-------------------------------------------------------------------------- | ||
59 | + // Ao por POST esta salvando o formulrio | ||
60 | + if(strtoupper($_SERVER['REQUEST_METHOD']) === 'POST') { | ||
61 | + | ||
62 | + if(!array_key_exists('id_unidade', $_POST) || empty($_POST['id_unidade'])) { | ||
63 | + throw new InfraException('Nenhuma "Unidade" foi selecionada'); | ||
64 | + } | ||
65 | + | ||
66 | + if(!array_key_exists('id_unidade_rh', $_POST) || $_POST['id_unidade_rh'] === '' || $_POST['id_unidade_rh'] === null) { | ||
67 | + throw new InfraException('Nenhuma "Unidade RH" foi selecionada'); | ||
68 | + } | ||
69 | + | ||
70 | + $objGenericoBD = new GenericoBD($objBanco); | ||
71 | + $objPenUnidadeRHDTO = new PenUnidadeDTO(); | ||
72 | + if ($_POST['id_unidade']) { | ||
73 | + $objPenUnidadeRHDTO->setNumIdUnidade($_POST['id_unidade'], InfraDTO::$OPER_DIFERENTE); | ||
74 | + } | ||
75 | + $objPenUnidadeRHDTO->setNumIdUnidadeRH($_POST['id_unidade_rh']); | ||
76 | + $objPenUnidadeRHDTO->retTodos(); | ||
77 | + $objResultado = $objGenericoBD->listar($objPenUnidadeRHDTO); | ||
78 | + | ||
79 | + if (count($objResultado) > 0) { | ||
80 | + throw new InfraException('Já existe um registro com a "Unidade RH" para o código: ' .$_POST['id_unidade_rh'] ); | ||
81 | + } | ||
82 | + | ||
83 | + $objPenUnidadeDTO = new PenUnidadeDTO(); | ||
84 | + $objPenUnidadeDTO->setNumIdUnidade($_POST['id_unidade']); | ||
85 | + $objPenUnidadeDTO->setNumIdUnidadeRH($_POST['id_unidade_rh']); | ||
86 | + | ||
87 | + $numIdUnidade = 0; | ||
88 | + if(array_key_exists(PEN_PAGINA_GET_ID, $_GET) && !empty($_GET[PEN_PAGINA_GET_ID])) { | ||
89 | + $objPenUnidadeDTO->setNumIdUnidade($_GET[PEN_PAGINA_GET_ID]); | ||
90 | + $unidade = $objPenUnidadeRN->alterar($objPenUnidadeDTO); | ||
91 | + $numIdUnidade = $_GET[PEN_PAGINA_GET_ID]; | ||
92 | + } | ||
93 | + else { | ||
94 | + $unidade = $objPenUnidadeRN->cadastrar($objPenUnidadeDTO); | ||
95 | + $numIdUnidade = $unidade->getNumIdUnidade(); | ||
96 | + } | ||
97 | + | ||
98 | + header('Location: '.$objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_listar&acao_origem='.$_GET['acao'].'&id_mapeamento='.$numIdUnidade.PaginaSEI::getInstance()->montarAncora($numIdUnidade))); | ||
99 | + exit(0); | ||
100 | + } | ||
101 | + // Ao por GET + ID esta carregando o formulrio | ||
102 | + else if(array_key_exists(PEN_PAGINA_GET_ID, $_GET) && !empty($_GET[PEN_PAGINA_GET_ID])){ | ||
103 | + | ||
104 | + $objPenUnidadeDTO = new PenUnidadeDTO(); | ||
105 | + $objPenUnidadeDTO->setNumIdUnidade($_GET[PEN_PAGINA_GET_ID]); | ||
106 | + $objPenUnidadeDTO->retTodos(); | ||
107 | + | ||
108 | + $objEspecieDocumentalBD = new GenericoBD(BancoSEI::getInstance()); | ||
109 | + $objPenUnidadeDTO = $objEspecieDocumentalBD->consultar($objPenUnidadeDTO); | ||
110 | + } | ||
111 | + | ||
112 | + if(empty($objPenUnidadeDTO)){ | ||
113 | + $objPenUnidadeDTO = new PenUnidadeDTO(); | ||
114 | + $objPenUnidadeDTO->setNumIdUnidade(0); | ||
115 | + $objPenUnidadeDTO->setNumIdUnidadeRH(0); | ||
116 | + } | ||
117 | + | ||
118 | + | ||
119 | + if(array_key_exists(PEN_PAGINA_GET_ID, $_GET) && !empty($_GET[PEN_PAGINA_GET_ID])) { | ||
120 | + $objPenUnidadeDTO->setNumIdUnidade($_GET[PEN_PAGINA_GET_ID]); | ||
121 | + } | ||
122 | + | ||
123 | + //Monta o select das unidades | ||
124 | + $objUnidadeDTO = new UnidadeDTO(); | ||
125 | + $arrNumIdUnidadeUsados = $objPenUnidadeRN->getIdUnidadeEmUso($objPenUnidadeDTO); | ||
126 | + | ||
127 | + if(!empty($arrNumIdUnidadeUsados)) { | ||
128 | + // Remove os que já estão em uso | ||
129 | + $objUnidadeDTO->setNumIdUnidade($arrNumIdUnidadeUsados, InfraDTO::$OPER_NOT_IN); | ||
130 | + } | ||
131 | + | ||
132 | + $objUnidadeDTO->retNumIdUnidade(); | ||
133 | + $objUnidadeDTO->retStrSigla(); | ||
134 | + | ||
135 | + $objPenUnidadeRN = new PenUnidadeRN(); | ||
136 | + $arrMapIdUnidade = InfraArray::converterArrInfraDTO($objPenUnidadeRN->listar($objUnidadeDTO), 'Sigla', 'IdUnidade'); | ||
137 | +} | ||
138 | +catch (InfraException $e) { | ||
139 | + $objPagina->processarExcecao($e); | ||
140 | +} | ||
141 | +catch(Exception $e) { | ||
142 | + $objPagina->processarExcecao($e); | ||
143 | +} | ||
144 | + | ||
145 | +// View | ||
146 | +ob_clean(); | ||
147 | + | ||
148 | +$objPagina->montarDocType(); | ||
149 | +$objPagina->abrirHtml(); | ||
150 | +$objPagina->abrirHead(); | ||
151 | +$objPagina->montarMeta(); | ||
152 | +$objPagina->montarTitle(':: ' . $objPagina->getStrNomeSistema() . ' - ' . $strTitulo . ' ::'); | ||
153 | +$objPagina->montarStyle(); | ||
154 | +?> | ||
155 | +<style type="text/css"> | ||
156 | + | ||
157 | +.input-label-first{position:absolute;left:0%;top:0%;width:25%; color: #666!important} | ||
158 | +.input-field-first{position:absolute;left:0%;top:15%;width:25%} | ||
159 | + | ||
160 | +.input-label-third {position:absolute;left:0%;top:40%;width:25%; color:#666!important} | ||
161 | +.input-field-third {position:absolute;left:0%;top:55%;width:25%;} | ||
162 | + | ||
163 | +</style> | ||
164 | +<?php $objPagina->montarJavaScript(); ?> | ||
165 | +<script type="text/javascript"> | ||
166 | + | ||
167 | +function inicializar(){ | ||
168 | + | ||
169 | + | ||
170 | +} | ||
171 | + | ||
172 | +function onSubmit() { | ||
173 | + | ||
174 | + var form = jQuery('#<?php print PEN_RECURSO_BASE; ?>_form'); | ||
175 | + var field = jQuery('select[name=id_unidade]', form); | ||
176 | + | ||
177 | + if(field.val() === 'null'){ | ||
178 | + alert('Nenhuma "Unidade" foi selecionada'); | ||
179 | + field.focus(); | ||
180 | + return false; | ||
181 | + } | ||
182 | + | ||
183 | + field = jQuery('select[name=id_unidade_rh]', form); | ||
184 | + | ||
185 | + if(field.val() === 'null'){ | ||
186 | + alert('Nenhum "Unidade RH" foi selecionada'); | ||
187 | + field.focus(); | ||
188 | + return false; | ||
189 | + } | ||
190 | +} | ||
191 | + | ||
192 | +</script> | ||
193 | +<?php | ||
194 | +$objPagina->fecharHead(); | ||
195 | +$objPagina->abrirBody($strTitulo,'onload="inicializar();"'); | ||
196 | +?> | ||
197 | +<form id="<?php print PEN_RECURSO_BASE; ?>_form" onsubmit="return onSubmit();" method="post" action="<?php //print $objSessaoSEI->assinarLink($strProprioLink); ?>"> | ||
198 | + <?php $objPagina->montarBarraComandosSuperior($arrComandos); ?> | ||
199 | + <?php $objPagina->montarAreaValidacao(); ?> | ||
200 | + <?php $objPagina->abrirAreaDados('12em'); ?> | ||
201 | + | ||
202 | + <div> | ||
203 | + <label for="id_unidade" class="infraLabelObrigatorio">Unidade:</label> | ||
204 | + | ||
205 | + <select name="id_unidade" class="input-field-first" > | ||
206 | + <?php print InfraINT::montarSelectArray('', 'Selecione', $objPenUnidadeDTO->getNumIdUnidade(), $arrMapIdUnidade); ?> | ||
207 | + </select> | ||
208 | + </div><br><br><br> | ||
209 | + | ||
210 | + <div class="infraAreaDados"> | ||
211 | + <label for="selUnidadeRh" class="infraLabelObrigatorio">Unidade RH:</label> <br> | ||
212 | + <input type="number" id="selUnidadeRh" value="<?php echo $objPenUnidadeDTO->getNumIdUnidadeRH(); ?>" name="id_unidade_rh" class="infraText"/> | ||
213 | + </div> | ||
214 | + | ||
215 | + <?php print $objPagina->fecharAreaDados(); ?> | ||
216 | +</form> | ||
217 | +<?php $objPagina->fecharBody(); ?> | ||
218 | +<?php $objPagina->fecharHtml(); ?> |
@@ -0,0 +1,378 @@ | @@ -0,0 +1,378 @@ | ||
1 | +<?php | ||
2 | + | ||
3 | +require_once dirname(__FILE__) . '/../../SEI.php'; | ||
4 | + | ||
5 | +/** | ||
6 | + * Consulta os logs do estado do procedimento ao ser expedido | ||
7 | + * | ||
8 | + * @author Join Tecnologia | ||
9 | + */ | ||
10 | + | ||
11 | +session_start(); | ||
12 | + | ||
13 | +define('PEN_RECURSO_ATUAL', 'pen_map_unidade_listar'); | ||
14 | +define('PEN_RECURSO_BASE', 'pen_map_unidade'); | ||
15 | +define('PEN_PAGINA_TITULO', 'Mapeamento de Unidade'); | ||
16 | +define('PEN_PAGINA_GET_ID', 'id_unidade'); | ||
17 | + | ||
18 | + | ||
19 | +$objPagina = PaginaSEI::getInstance(); | ||
20 | +$objBanco = BancoSEI::getInstance(); | ||
21 | +$objSessao = SessaoSEI::getInstance(); | ||
22 | +$objDebug = InfraDebug::getInstance(); | ||
23 | + | ||
24 | + | ||
25 | +try { | ||
26 | + | ||
27 | + $objDebug->setBolLigado(false); | ||
28 | + $objDebug->setBolDebugInfra(true); | ||
29 | + $objDebug->limpar(); | ||
30 | + | ||
31 | + $objSessao->validarLink(); | ||
32 | + $objSessao->validarPermissao(PEN_RECURSO_ATUAL); | ||
33 | + | ||
34 | + $objBanco->abrirConexao(); | ||
35 | + | ||
36 | + | ||
37 | + //-------------------------------------------------------------------------- | ||
38 | + // Ações | ||
39 | + if(array_key_exists('acao', $_GET)) { | ||
40 | + | ||
41 | + $arrParam = array_merge($_GET, $_POST); | ||
42 | + | ||
43 | + switch($_GET['acao']) { | ||
44 | + | ||
45 | + case PEN_RECURSO_BASE.'_excluir': | ||
46 | + | ||
47 | + if(array_key_exists('hdnInfraItensSelecionados', $arrParam) && !empty($arrParam['hdnInfraItensSelecionados'])) { | ||
48 | + | ||
49 | + $objPenUnidadeDTO = new PenUnidadeDTO(); | ||
50 | + $objPenUnidadeRN = new PenUnidadeRN(); | ||
51 | + | ||
52 | + $arrParam['hdnInfraItensSelecionados'] = explode(',',$arrParam['hdnInfraItensSelecionados']); | ||
53 | + | ||
54 | + if(is_array($arrParam['hdnInfraItensSelecionados'])) { | ||
55 | + | ||
56 | + foreach($arrParam['hdnInfraItensSelecionados'] as $NumIdUnidade) { | ||
57 | + | ||
58 | + $objPenUnidadeDTO->setNumIdUnidade($NumIdUnidade); | ||
59 | + $objPenUnidadeRN->excluir($objPenUnidadeDTO); | ||
60 | + } | ||
61 | + } | ||
62 | + else { | ||
63 | + | ||
64 | + $objPenUnidadeDTO->setNumIdUnidade($arrParam['hdnInfraItensSelecionados']); | ||
65 | + $objPenUnidadeRN->excluir($objPenUnidadeDTO); | ||
66 | + } | ||
67 | + | ||
68 | + $objPagina->adicionarMensagem(sprintf('%s foi excluido com sucesso.', PEN_PAGINA_TITULO), InfraPagina::$TIPO_MSG_AVISO); | ||
69 | + | ||
70 | + header('Location: '.SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.$_GET['acao_retorno'].'&acao_origem='.$_GET['acao_origem'])); | ||
71 | + exit(0); | ||
72 | + } | ||
73 | + else { | ||
74 | + | ||
75 | + throw new InfraException('Nenhum Registro foi selecionado para executar esta ação'); | ||
76 | + } | ||
77 | + break; | ||
78 | + | ||
79 | + case PEN_RECURSO_BASE.'_desativar': | ||
80 | + | ||
81 | + if(array_key_exists('hdnInfraItensSelecionados', $arrParam) && !empty($arrParam['hdnInfraItensSelecionados'])) { | ||
82 | + | ||
83 | + PenUnidadeRN::mudarEstado(explode(',', $arrParam['hdnInfraItensSelecionados']), 'N'); | ||
84 | + | ||
85 | + $objPagina->adicionarMensagem('Desativado com sucesso.', InfraPagina::$TIPO_MSG_AVISO); | ||
86 | + | ||
87 | + header('Location: '.SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.$_GET['acao_retorno'].'&acao_origem='.$_GET['acao_origem'])); | ||
88 | + exit(0); | ||
89 | + } | ||
90 | + else { | ||
91 | + | ||
92 | + throw new InfraException('Nenhum Registro foi selecionado para executar esta ação'); | ||
93 | + } | ||
94 | + break; | ||
95 | + | ||
96 | + case PEN_RECURSO_BASE.'_ativar': | ||
97 | + if(array_key_exists('hdnInfraItensSelecionados', $arrParam) && !empty($arrParam['hdnInfraItensSelecionados'])) { | ||
98 | + | ||
99 | + PenUnidadeRN::mudarEstado(explode(',', $arrParam['hdnInfraItensSelecionados']), 'S'); | ||
100 | + | ||
101 | + $objPagina->adicionarMensagem('Ativado com sucesso.', InfraPagina::$TIPO_MSG_AVISO); | ||
102 | + | ||
103 | + header('Location: '.SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.$_GET['acao_retorno'].'&acao_origem='.$_GET['acao_origem'])); | ||
104 | + exit(0); | ||
105 | + } | ||
106 | + break; | ||
107 | + | ||
108 | + case PEN_RECURSO_BASE.'_listar': | ||
109 | + // Ação padrão desta tela | ||
110 | + break; | ||
111 | + | ||
112 | + default: | ||
113 | + throw new InfraException('Ação não permitida nesta tela'); | ||
114 | + | ||
115 | + } | ||
116 | + } | ||
117 | + //-------------------------------------------------------------------------- | ||
118 | + | ||
119 | + $arrComandos = array(); | ||
120 | + $arrComandos[] = '<button type="button" accesskey="P" onclick="onClickBtnPesquisar();" id="btnPesquisar" value="Pesquisar" class="infraButton">Pesquisar</button>'; | ||
121 | + $arrComandos[] = '<button type="button" value="Novo" onclick="onClickBtnNovo()" class="infraButton">Novo</button>'; | ||
122 | + //$arrComandos[] = '<button type="button" value="Ativar" onclick="onClickBtnAtivar()" class="infraButton">Ativar</button>'; | ||
123 | + //$arrComandos[] = '<button type="button" value="Desativar" onclick="onClickBtnDesativar()" class="infraButton">Desativar</button>'; | ||
124 | + $arrComandos[] = '<button type="button" value="Excluir" onclick="onClickBtnExcluir()" class="infraButton">Excluir</button>'; | ||
125 | + $arrComandos[] = '<button type="button" accesskey="I" id="btnImprimir" value="Imprimir" onclick="infraImprimirTabela();" class="infraButton">Imprimir</button>'; | ||
126 | + | ||
127 | + //-------------------------------------------------------------------------- | ||
128 | + // DTO de paginao | ||
129 | + | ||
130 | + $objPenUnidadeDTOFiltro = new PenUnidadeDTO(); | ||
131 | + $objPenUnidadeDTOFiltro->retTodos(); | ||
132 | + | ||
133 | + //-------------------------------------------------------------------------- | ||
134 | + // Filtragem | ||
135 | + if(array_key_exists('id_unidade_rh', $_POST) && (!empty($_POST['id_unidade_rh']) && $_POST['id_unidade_rh'] !== 'null')) { | ||
136 | + $objPenUnidadeDTOFiltro->setNumIdUnidadeRH($_POST['id_unidade_rh']); | ||
137 | + } | ||
138 | + | ||
139 | + if(array_key_exists('id_unidade', $_POST) && (!empty($_POST['id_unidade']) && $_POST['id_unidade_rh'] !== 'null')) { | ||
140 | + $objPenUnidadeDTOFiltro->setNumIdUnidade($_POST['id_unidade']); | ||
141 | + } | ||
142 | + | ||
143 | + $objFiltroDTO = clone $objPenUnidadeDTOFiltro; | ||
144 | + | ||
145 | + if(!$objFiltroDTO->isSetNumIdUnidadeRH()) { | ||
146 | + $objFiltroDTO->setNumIdUnidadeRH(''); | ||
147 | + } | ||
148 | + | ||
149 | + if(!$objFiltroDTO->isSetNumIdUnidade()) { | ||
150 | + $objFiltroDTO->setNumIdUnidade(''); | ||
151 | + } | ||
152 | + //-------------------------------------------------------------------------- | ||
153 | + $objGenericoBD = new GenericoBD($objBanco); | ||
154 | + | ||
155 | + // Unidade Local | ||
156 | + $objPenUnidadeDTO = new PenUnidadeDTO(); | ||
157 | + $objPenUnidadeDTO->setDistinct(true); | ||
158 | + $objPenUnidadeDTO->retNumIdUnidade(); | ||
159 | + $objPenUnidadeDTO->retNumIdUnidadeRH(); | ||
160 | + | ||
161 | + $objPenUnidadeRN = new PenUnidadeRN(); | ||
162 | + $arrMapIdUnidade = InfraArray::converterArrInfraDTO($objPenUnidadeRN->listar($objPenUnidadeDTO), 'IdUnidade', 'IdUnidade'); | ||
163 | + $arrMapIdUnidadeRH = InfraArray::converterArrInfraDTO($objPenUnidadeRN->listar($objPenUnidadeDTO), 'IdUnidadeRH', 'IdUnidadeRH'); | ||
164 | + | ||
165 | + | ||
166 | + $objPagina->prepararPaginacao($objPenUnidadeDTOFiltro); | ||
167 | + $arrObjPenUnidadeDTO = $objGenericoBD->listar($objPenUnidadeDTOFiltro); | ||
168 | + $objPagina->processarPaginacao($objPenUnidadeDTOFiltro); | ||
169 | + | ||
170 | + $numRegistros = count($arrObjPenUnidadeDTO); | ||
171 | + if(!empty($arrObjPenUnidadeDTO)){ | ||
172 | + | ||
173 | + $strResultado = ''; | ||
174 | + | ||
175 | + $strResultado .= '<table width="99%" class="infraTable">'."\n"; | ||
176 | + $strResultado .= '<caption class="infraCaption">'.$objPagina->gerarCaptionTabela(PEN_PAGINA_TITULO, $numRegistros).'</caption>'; | ||
177 | + | ||
178 | + $strResultado .= '<tr>'; | ||
179 | + $strResultado .= '<th class="infraTh" width="1%">'.$objPagina->getThCheck().'</th>'."\n"; | ||
180 | + $strResultado .= '<th class="infraTh" width="35%">Unidade</th>'."\n"; | ||
181 | + $strResultado .= '<th class="infraTh" width="35%">Unidade RH</th>'."\n"; | ||
182 | + $strResultado .= '<th class="infraTh" width="14%">Ações</th>'."\n"; | ||
183 | + $strResultado .= '</tr>'."\n"; | ||
184 | + $strCssTr = ''; | ||
185 | + | ||
186 | + $index = 0; | ||
187 | + | ||
188 | + foreach($arrObjPenUnidadeDTO as $objPenUnidadeDTO) { | ||
189 | + $strCssTr = ($strCssTr == 'infraTrClara') ? 'infraTrEscura' : 'infraTrClara'; | ||
190 | + | ||
191 | + $objPenUnidadeSiglaDTO = new UnidadeDTO(); | ||
192 | + $objPenUnidadeSiglaDTO->setNumIdUnidade($objPenUnidadeDTO->getNumIdUnidade()); | ||
193 | + $objPenUnidadeSiglaDTO->retStrSigla(); | ||
194 | + | ||
195 | + $objPenUnidadeRN = new UnidadeRN(); | ||
196 | + $objResultadoSigla = $objGenericoBD->consultar($objPenUnidadeSiglaDTO); | ||
197 | + | ||
198 | + $strResultado .= '<tr class="'.$strCssTr.'">'; | ||
199 | + $strResultado .= '<td>'.$objPagina->getTrCheck($index, $objPenUnidadeDTO->getNumIdUnidade(), '').'</td>'; | ||
200 | + $strResultado .= '<td>'.$objResultadoSigla->getStrSigla().'</td>'; | ||
201 | + $strResultado .= '<td>'.$arrMapIdUnidadeRH[$objPenUnidadeDTO->getNumIdUnidadeRH()].'</td>'; | ||
202 | + $strResultado .= '<td align="center">'; | ||
203 | + | ||
204 | + //$strResultado .= '<a href="'.$objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_visualizar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao'].'&'.PEN_PAGINA_GET_ID.'='.$objPenUnidadeDTO->getNumIdUnidade()).'"><img src="imagens/consultar.gif" title="Consultar Mapeamento" alt="Consultar Mapeamento" class="infraImg"></a>'; | ||
205 | + if($objSessao->verificarPermissao('pen_map_unidade_alterar')) { | ||
206 | + $strResultado .= '<a href="'.$objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_cadastrar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao'].'&'.PEN_PAGINA_GET_ID.'='.$objPenUnidadeDTO->getNumIdUnidade()).'"><img src="imagens/alterar.gif" title="Alterar Mapeamento" alt="Alterar Mapeamento" class="infraImg"></a>'; | ||
207 | + } | ||
208 | + | ||
209 | + if($objSessao->verificarPermissao('pen_map_unidade_excluir')) { | ||
210 | + $strResultado .= '<a href="#" onclick="onCLickLinkDelete(\''.$objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_excluir&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao'].'&hdnInfraItensSelecionados='.$objPenUnidadeDTO->getNumIdUnidade()).'\', this)"><img src="imagens/excluir.gif" title="Excluir Mapeamento" alt="Excluir Mapeamento" class="infraImg"></a>'; | ||
211 | + } | ||
212 | + | ||
213 | + $strResultado .= '</td>'; | ||
214 | + $strResultado .= '</tr>'."\n"; | ||
215 | + | ||
216 | + $index++; | ||
217 | + } | ||
218 | + $strResultado .= '</table>'; | ||
219 | + } | ||
220 | +} | ||
221 | +catch(InfraException $e){ | ||
222 | + | ||
223 | + print '<pre>'; | ||
224 | + print_r($e); | ||
225 | + print '</pre>'; | ||
226 | + exit(0); | ||
227 | + //$objPagina->processarExcecao($e); | ||
228 | +} | ||
229 | + | ||
230 | + | ||
231 | +$objPagina->montarDocType(); | ||
232 | +$objPagina->abrirHtml(); | ||
233 | +$objPagina->abrirHead(); | ||
234 | +$objPagina->montarMeta(); | ||
235 | +$objPagina->montarTitle(':: '.$objPagina->getStrNomeSistema().' - '.PEN_PAGINA_TITULO.' ::'); | ||
236 | +$objPagina->montarStyle(); | ||
237 | +?> | ||
238 | +<style type="text/css"> | ||
239 | + | ||
240 | +.input-label-first{position:absolute;left:0%;top:0%;width:25%; color: #666!important} | ||
241 | +.input-field-first{position:absolute;left:0%;top:15%;width:25%} | ||
242 | + | ||
243 | +.input-label-second{position:absolute;left:30%;top:0%;width:25%; color: #666!important} | ||
244 | +.input-field-second{position:absolute;left:30%;top:15%;width:25%;} | ||
245 | + | ||
246 | +.input-label-third {position:absolute;left:0%;top:40%;width:25%; color:#666!important} | ||
247 | +.input-field-third {position:absolute;left:0%;top:55%;width:25%;} | ||
248 | + | ||
249 | +</style> | ||
250 | +<?php $objPagina->montarJavaScript(); ?> | ||
251 | +<script type="text/javascript"> | ||
252 | + | ||
253 | +function inicializar(){ | ||
254 | + | ||
255 | + infraEfeitoTabelas(); | ||
256 | + | ||
257 | +} | ||
258 | + | ||
259 | +function onClickBtnPesquisar(){ | ||
260 | + document.getElementById('frmAcompanharEstadoProcesso').action='<?php print $objSessao->assinarLink('controlador.php?acao='.$_GET['acao'].'&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao_retorno']); ?>'; | ||
261 | + document.getElementById('frmAcompanharEstadoProcesso').submit(); | ||
262 | +} | ||
263 | + | ||
264 | +function tratarEnter(ev){ | ||
265 | + var key = infraGetCodigoTecla(ev); | ||
266 | + if (key == 13){ | ||
267 | + onClickBtnPesquisar(); | ||
268 | + } | ||
269 | + return true; | ||
270 | +} | ||
271 | + | ||
272 | +function onCLickLinkDelete(url, link) { | ||
273 | + | ||
274 | + var row = jQuery(link).parents('tr:first'); | ||
275 | + | ||
276 | + var strEspecieDocumental = row.find('td:eq(1)').text(); | ||
277 | + var strTipoDocumento = row.find('td:eq(2)').text(); | ||
278 | + | ||
279 | + if(confirm('Confirma a exclusão do mapeamento da unidade?')){ | ||
280 | + | ||
281 | + window.location = url; | ||
282 | + } | ||
283 | + | ||
284 | +} | ||
285 | + | ||
286 | +function onClickBtnNovo(){ | ||
287 | + | ||
288 | + window.location = '<?php print $objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_cadastrar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.$_GET['acao_origem']); ?>'; | ||
289 | +} | ||
290 | + | ||
291 | +function onClickBtnAtivar(){ | ||
292 | + | ||
293 | + try { | ||
294 | + | ||
295 | + var form = jQuery('#frmAcompanharEstadoProcesso'); | ||
296 | + form.attr('action', '<?php print $objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_ativar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.PEN_RECURSO_BASE.'_listar'); ?>'); | ||
297 | + form.submit(); | ||
298 | + } | ||
299 | + catch(e){ | ||
300 | + | ||
301 | + alert('Erro : ' + e.message); | ||
302 | + } | ||
303 | + | ||
304 | +} | ||
305 | + | ||
306 | +function onClickBtnDesativar(){ | ||
307 | + | ||
308 | + try { | ||
309 | + | ||
310 | + var form = jQuery('#frmAcompanharEstadoProcesso'); | ||
311 | + form.attr('action', '<?php print $objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_desativar&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.PEN_RECURSO_BASE.'_listar'); ?>'); | ||
312 | + form.submit(); | ||
313 | + } | ||
314 | + catch(e){ | ||
315 | + | ||
316 | + alert('Erro : ' + e.message); | ||
317 | + } | ||
318 | +} | ||
319 | + | ||
320 | +function onClickBtnExcluir(){ | ||
321 | + | ||
322 | + try { | ||
323 | + | ||
324 | + var len = jQuery('input[name*=chkInfraItem]:checked').length; | ||
325 | + | ||
326 | + if(len > 0){ | ||
327 | + | ||
328 | + if(confirm('Confirma a exclusão de ' + len + ' mapeamento(s) ?')) { | ||
329 | + var form = jQuery('#frmAcompanharEstadoProcesso'); | ||
330 | + form.attr('action', '<?php print $objSessao->assinarLink('controlador.php?acao='.PEN_RECURSO_BASE.'_excluir&acao_origem='.$_GET['acao_origem'].'&acao_retorno='.PEN_RECURSO_BASE.'_listar'); ?>'); | ||
331 | + form.submit(); | ||
332 | + } | ||
333 | + } | ||
334 | + else { | ||
335 | + | ||
336 | + alert('Selecione pelo menos um mapeamento para Excluir'); | ||
337 | + } | ||
338 | + } | ||
339 | + catch(e){ | ||
340 | + | ||
341 | + alert('Erro : ' + e.message); | ||
342 | + } | ||
343 | +} | ||
344 | + | ||
345 | +</script> | ||
346 | +<?php | ||
347 | +$objPagina->fecharHead(); | ||
348 | +$objPagina->abrirBody(PEN_PAGINA_TITULO,'onload="inicializar();"'); | ||
349 | +?> | ||
350 | +<form id="frmAcompanharEstadoProcesso" method="post" action="<?php// print $objSessao->assinarLink($strProprioLink); ?>"> | ||
351 | + | ||
352 | + <?php $objPagina->montarBarraComandosSuperior($arrComandos); ?> | ||
353 | + <?php //$objPagina->montarAreaValidacao(); ?> | ||
354 | + <?php $objPagina->abrirAreaDados('12em'); ?> | ||
355 | + | ||
356 | + <label for="id_unidade" class="infraLabelObrigatorio input-label-first">Unidade:</label> | ||
357 | + <select name="id_unidade" class="infraSelect input-field-first"<?php if($bolSomenteLeitura): ?> disabled="disabled" readonly="readonly"<?php endif; ?>> | ||
358 | + <?php print InfraINT::montarSelectArray('', 'Selecione', $objFiltroDTO->getNumIdUnidade(), $arrMapIdUnidade); ?> | ||
359 | + </select> | ||
360 | + | ||
361 | + <label for="id_unidade_rh" class="infraLabelObrigatorio input-label-second">Unidade RH</label> | ||
362 | + <select name="id_unidade_rh" class="infraSelect input-field-second"<?php if($bolSomenteLeitura): ?> disabled="disabled" readonly="readonly"<?php endif; ?>> | ||
363 | + <?php print InfraINT::montarSelectArray('', 'Selecione', $objFiltroDTO->getNumIdUnidadeRH(), $arrMapIdUnidadeRH); ?> | ||
364 | + </select> | ||
365 | + | ||
366 | + | ||
367 | + <?php $objPagina->fecharAreaDados(); ?> | ||
368 | + | ||
369 | + <?php if($numRegistros > 0): ?> | ||
370 | + <?php $objPagina->montarAreaTabela($strResultado, $numRegistros); ?> | ||
371 | + <?php //$objPagina->montarAreaDebug(); ?> | ||
372 | + <?php else: ?> | ||
373 | + <div style="clear:both"></div> | ||
374 | + <p>Nenhum mapeamento foi encontrado</p> | ||
375 | + <?php endif; ?> | ||
376 | +</form> | ||
377 | +<?php $objPagina->fecharBody(); ?> | ||
378 | +<?php $objPagina->fecharHtml(); ?> |
@@ -0,0 +1,158 @@ | @@ -0,0 +1,158 @@ | ||
1 | +<? | ||
2 | +/** | ||
3 | + * Join Tecnologia | ||
4 | + */ | ||
5 | +try { | ||
6 | + require_once dirname(__FILE__) . '/../../SEI.php'; | ||
7 | + | ||
8 | + session_start(); | ||
9 | + | ||
10 | + define('PEN_RECURSO_ATUAL', 'pen_parametros_configuracao'); | ||
11 | + define('PEN_PAGINA_TITULO', 'Parâmetros de Configuração do Módulo de Tramitações PEN'); | ||
12 | + | ||
13 | + $objPagina = PaginaSEI::getInstance(); | ||
14 | + $objBanco = BancoSEI::getInstance(); | ||
15 | + $objSessao = SessaoSEI::getInstance(); | ||
16 | + | ||
17 | + $objSessao->validarPermissao('pen_parametros_configuracao'); | ||
18 | + | ||
19 | + $objPENParametroDTO = new PenParametroDTO(); | ||
20 | + $objPENParametroDTO->retTodos(); | ||
21 | + | ||
22 | + $objPENParametroRN = new PENParametroRN(); | ||
23 | + $retParametros = $objPENParametroRN->listar($objPENParametroDTO); | ||
24 | + | ||
25 | + if ($objPENParametroDTO===null){ | ||
26 | + throw new PENException("Registros não encontrados."); | ||
27 | + } | ||
28 | + | ||
29 | + switch ($_GET['acao']) { | ||
30 | + case 'pen_parametros_configuracao_salvar': | ||
31 | + try { | ||
32 | + $objPENParametroRN = new PENParametroRN(); | ||
33 | + | ||
34 | + if (!empty(count($_POST['parametro']))) { | ||
35 | + foreach ($_POST['parametro'] as $nome => $valor) { | ||
36 | + $objPENParametroDTO = new PENParametroDTO(); | ||
37 | + $objPENParametroDTO->setStrNome($nome); | ||
38 | + $objPENParametroDTO->retStrNome(); | ||
39 | + | ||
40 | + if($objPENParametroRN->contar($objPENParametroDTO) > 0) { | ||
41 | + $objPENParametroDTO->setStrValor($valor); | ||
42 | + $objPENParametroRN->alterar($objPENParametroDTO); | ||
43 | + } | ||
44 | + } | ||
45 | + } | ||
46 | + | ||
47 | + } catch (Exception $e) { | ||
48 | + $objPagina->processarExcecao($e); | ||
49 | + } | ||
50 | + header('Location: ' . $objSessao->assinarLink('controlador.php?acao=' . $_GET['acao_origem'] . '&acao_origem=' . $_GET['acao'])); | ||
51 | + die; | ||
52 | + | ||
53 | + case 'pen_parametros_configuracao': | ||
54 | + $strTitulo = 'Parâmetros de Configuração do Módulo de Tramitações PEN'; | ||
55 | + break; | ||
56 | + | ||
57 | + default: | ||
58 | + throw new PENException("Ação '" . $_GET['acao'] . "' não reconhecida."); | ||
59 | + } | ||
60 | + | ||
61 | +} catch (Exception $e) { | ||
62 | + $objPagina->processarExcecao($e); | ||
63 | +} | ||
64 | + | ||
65 | +//Monta os botões do topo | ||
66 | +if ($objSessao->verificarPermissao('pen_parametros_configuracao_alterar')) { | ||
67 | + $arrComandos[] = '<button type="submit" id="btnSalvar" value="Salvar" class="infraButton"><span class="infraTeclaAtalho">S</span>alvar</button>'; | ||
68 | +} | ||
69 | +$arrComandos[] = '<button type="button" id="btnCancelar" value="Cancelar" onclick="location.href=\'' . $objPagina->formatarXHTML($objSessao->assinarLink('controlador.php?acao=pen_parametros_configuracao&acao_origem=' . $_GET['acao'])) . '\';" class="infraButton"><span class="infraTeclaAtalho">C</span>ancelar</button>'; | ||
70 | + | ||
71 | +$objPagina->montarDocType(); | ||
72 | +$objPagina->abrirHtml(); | ||
73 | +$objPagina->abrirHead(); | ||
74 | +$objPagina->montarMeta(); | ||
75 | +$objPagina->montarTitle($objPagina->getStrNomeSistema() . ' - ' . $strTitulo); | ||
76 | +$objPagina->montarStyle(); | ||
77 | +$objPagina->abrirStyle(); | ||
78 | +?> | ||
79 | +<? | ||
80 | +$objPagina->fecharStyle(); | ||
81 | +$objPagina->montarJavaScript(); | ||
82 | +$objPagina->abrirJavaScript(); | ||
83 | +?> | ||
84 | + | ||
85 | +function inicializar(){ | ||
86 | + if ('<?= $_GET['acao'] ?>'=='pen_parametros_configuracao_selecionar'){ | ||
87 | + infraReceberSelecao(); | ||
88 | + document.getElementById('btnFecharSelecao').focus(); | ||
89 | + }else{ | ||
90 | + document.getElementById('btnFechar').focus(); | ||
91 | + } | ||
92 | + infraEfeitoImagens(); | ||
93 | + infraEfeitoTabelas(); | ||
94 | +} | ||
95 | + | ||
96 | +<? | ||
97 | +$objPagina->fecharJavaScript(); | ||
98 | +$objPagina->fecharHead(); | ||
99 | +$objPagina->abrirBody($strTitulo, 'onload="inicializar();"'); | ||
100 | +?> | ||
101 | +<style> | ||
102 | + .input-field-input { | ||
103 | + width: 35%; | ||
104 | + margin-bottom: 8px; | ||
105 | + margin-top: 2px; | ||
106 | + } | ||
107 | + .input-field { | ||
108 | + margin-bottom: 8px; | ||
109 | + margin-top: 2px; | ||
110 | + } | ||
111 | +</style> | ||
112 | + | ||
113 | +<form id="frmInfraParametroCadastro" method="post" onsubmit="return OnSubmitForm();" action="<?=$objSessao->assinarLink('controlador.php?acao='.$_GET['acao'].'_salvar&acao_origem='.$_GET['acao'])?>"> | ||
114 | + <? | ||
115 | + $objPagina->montarBarraComandosSuperior($arrComandos); | ||
116 | + foreach ($retParametros as $parametro) { | ||
117 | + | ||
118 | + //Constroi o label | ||
119 | + ?> <label id="lbl<?php echo $parametro->getStrNome(); ?>" for="txt<?php echo $parametro->getStrNome(); ?>" accesskey="N" class="infraLabelObrigatorio"><?php echo $parametro->getStrDescricao(); ?>:</label><br> <?php | ||
120 | + | ||
121 | + //Constroi o campo de valor | ||
122 | + switch ($parametro->getStrNome()) { | ||
123 | + case 'PEN_SENHA_CERTIFICADO_DIGITAL': | ||
124 | + echo '<input type="password" id="PARAMETRO_'.$parametro->getStrNome().'" name="parametro['.$parametro->getStrNome().']" class="infraText input-field-input" value="'.$objPagina->tratarHTML($parametro->getStrValor()).'" onkeypress="return infraMascaraTexto(this,event);" tabindex="'.$objPagina->getProxTabDados().'" maxlength="100" /><br>'; | ||
125 | + break; | ||
126 | + | ||
127 | + case 'PEN_ENVIA_EMAIL_NOTIFICACAO_RECEBIMENTO': | ||
128 | + echo '<select id="PARAMETRO_PEN_ENVIA_EMAIL_NOTIFICACAO_RECEBIMENTO" name="parametro[PEN_ENVIA_EMAIL_NOTIFICACAO_RECEBIMENTO]" class="input-field" >'; | ||
129 | + echo ' <option value="S" ' . ($parametro->getStrValor() == 'S' ? 'selected="selected"' : '') . '>Sim</option>'; | ||
130 | + echo ' <option value="N" ' . ($parametro->getStrValor() == 'N' ? 'selected="selected"' : '') . '>Não</option>'; | ||
131 | + echo '<select>'; | ||
132 | + break; | ||
133 | + | ||
134 | +// case 'PEN_TIPO_PROCESSO_EXTERNO': | ||
135 | +// echo '<select name="PEN_TIPO_PROCESSO_EXTERNO" class="input-field" >'; | ||
136 | +// | ||
137 | +// echo '<select>'; | ||
138 | +// break; | ||
139 | +// | ||
140 | +// case 'PEN_UNIDADE_GERADORA_DOCUMENTO_RECEBIDO': | ||
141 | +// echo '<select name="PEN_UNIDADE_GERADORA_DOCUMENTO_RECEBIDO" class="input-field" >'; | ||
142 | +// | ||
143 | +// echo '<select>'; | ||
144 | +// break; | ||
145 | + | ||
146 | + default: | ||
147 | + echo '<input type="text" id="PARAMETRO_'.$parametro->getStrNome().'" name="parametro['.$parametro->getStrNome().']" class="infraText input-field-input" value="'.$objPagina->tratarHTML($parametro->getStrValor()).'" onkeypress="return infraMascaraTexto(this,event);" tabindex="'.$objPagina->getProxTabDados().'" maxlength="100" /><br>'; | ||
148 | + break; | ||
149 | + } | ||
150 | + echo '<br>'; | ||
151 | + } | ||
152 | + ?> | ||
153 | +</form> | ||
154 | + | ||
155 | +<? | ||
156 | +$objPagina->fecharBody(); | ||
157 | +$objPagina->fecharHtml(); | ||
158 | +?> | ||
0 | \ No newline at end of file | 159 | \ No newline at end of file |
pen_procedimento_expedir.php
@@ -62,9 +62,9 @@ try { | @@ -62,9 +62,9 @@ try { | ||
62 | 62 | ||
63 | //TODO: Avaliar a necessidade de validar cada um dos parâmetros do PEN exigidos por essa funcionalidade | 63 | //TODO: Avaliar a necessidade de validar cada um dos parâmetros do PEN exigidos por essa funcionalidade |
64 | //Obter dados do repositório em que o SEI está registrado (Repositório de Origem) | 64 | //Obter dados do repositório em que o SEI está registrado (Repositório de Origem) |
65 | - $objInfraParametro = new InfraParametro(BancoSEI::getInstance()); | ||
66 | - $numIdRepositorioOrigem = $objInfraParametro->getValor('PEN_ID_REPOSITORIO_ORIGEM'); | ||
67 | - | 65 | + $objPENParametroRN = new PENParametroRN(); |
66 | + $numIdRepositorioOrigem = $objPENParametroRN->getParametro('PEN_ID_REPOSITORIO_ORIGEM'); | ||
67 | + | ||
68 | //Preparação dos dados para montagem da tela de expedição de processos | 68 | //Preparação dos dados para montagem da tela de expedição de processos |
69 | $repositorios = $objExpedirProcedimentosRN->listarRepositoriosDeEstruturas(); | 69 | $repositorios = $objExpedirProcedimentosRN->listarRepositoriosDeEstruturas(); |
70 | $motivosDeUrgencia = $objExpedirProcedimentosRN->consultarMotivosUrgencia(); | 70 | $motivosDeUrgencia = $objExpedirProcedimentosRN->consultarMotivosUrgencia(); |
rn/ExpedirProcedimentoRN.php
@@ -30,6 +30,9 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -30,6 +30,9 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
30 | //Esse estado será utilizado juntamente com os estados da expedição | 30 | //Esse estado será utilizado juntamente com os estados da expedição |
31 | const TE_PROCEDIMENTO_BLOQUEADO = '4'; | 31 | const TE_PROCEDIMENTO_BLOQUEADO = '4'; |
32 | const TE_PROCEDIMENTO_EM_PROCESSAMENTO = '5'; | 32 | const TE_PROCEDIMENTO_EM_PROCESSAMENTO = '5'; |
33 | + | ||
34 | + //Versão com mudança na API relacionada à obrigatoriedade do carimbo de publicação | ||
35 | + const VERSAO_CARIMBO_PUBLICACAO_OBRIGATORIO = '3.0.7'; | ||
33 | 36 | ||
34 | private $objProcessoEletronicoRN; | 37 | private $objProcessoEletronicoRN; |
35 | private $objParticipanteRN; | 38 | private $objParticipanteRN; |
@@ -1041,7 +1044,13 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1041,7 +1044,13 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1041 | $objEditorDTO->setStrSinRodape('S'); | 1044 | $objEditorDTO->setStrSinRodape('S'); |
1042 | $objEditorDTO->setStrSinIdentificacaoVersao('S'); | 1045 | $objEditorDTO->setStrSinIdentificacaoVersao('S'); |
1043 | $objEditorDTO->setStrSinProcessarLinks('S'); | 1046 | $objEditorDTO->setStrSinProcessarLinks('S'); |
1044 | - | 1047 | + |
1048 | + $numVersaoAtual = intval(str_replace('.', '', SEI_VERSAO)); | ||
1049 | + $numVersaoCarimboObrigatorio = intval(str_replace('.', '', self::VERSAO_CARIMBO_PUBLICACAO_OBRIGATORIO)); | ||
1050 | + if ($numVersaoAtual >= $numVersaoCarimboObrigatorio) { | ||
1051 | + $objEditorDTO->setStrSinCarimboPublicacao('N'); | ||
1052 | + } | ||
1053 | + | ||
1045 | $objEditorRN = new EditorRN(); | 1054 | $objEditorRN = new EditorRN(); |
1046 | $strConteudoAssinatura = $objEditorRN->consultarHtmlVersao($objEditorDTO); | 1055 | $strConteudoAssinatura = $objEditorRN->consultarHtmlVersao($objEditorDTO); |
1047 | 1056 | ||
@@ -1061,8 +1070,9 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -1061,8 +1070,9 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
1061 | } | 1070 | } |
1062 | 1071 | ||
1063 | //VALIDAÇÃO DE TAMANHO DE DOCUMENTOS EXTERNOS PARA A EXPEDIÇÃO | 1072 | //VALIDAÇÃO DE TAMANHO DE DOCUMENTOS EXTERNOS PARA A EXPEDIÇÃO |
1064 | - if($objAnexoDTO->getNumTamanho() > ($objInfraParametro->getValor('PEN_TAMANHO_MAXIMO_DOCUMENTO_EXPEDIDO') * 1024 * 1024) && $objDocumentoDTO->getStrStaEstadoProtocolo() != ProtocoloRN::$TE_DOCUMENTO_CANCELADO){ | ||
1065 | - throw new InfraException("O tamanho do documento {$objAnexoDTO->getStrProtocoloFormatadoProtocolo()} é maior que os {$objInfraParametro->getValor('PEN_TAMANHO_MAXIMO_DOCUMENTO_EXPEDIDO')} MB permitidos para a expedição de documentos externos."); | 1073 | + $objPENParametroRN = new PENParametroRN(); |
1074 | + if($objAnexoDTO->getNumTamanho() > ($objPENParametroRN->getParametro('PEN_TAMANHO_MAXIMO_DOCUMENTO_EXPEDIDO') * 1024 * 1024) && $objDocumentoDTO->getStrStaEstadoProtocolo() != ProtocoloRN::$TE_DOCUMENTO_CANCELADO){ | ||
1075 | + throw new InfraException("O tamanho do documento {$objAnexoDTO->getStrProtocoloFormatadoProtocolo()} é maior que os {$objPENParametroRN->getParametro('PEN_TAMANHO_MAXIMO_DOCUMENTO_EXPEDIDO')} MB permitidos para a expedição de documentos externos."); | ||
1066 | } | 1076 | } |
1067 | 1077 | ||
1068 | //Obtenção do conteudo do documento externo | 1078 | //Obtenção do conteudo do documento externo |
@@ -2093,9 +2103,10 @@ class ExpedirProcedimentoRN extends InfraRN { | @@ -2093,9 +2103,10 @@ class ExpedirProcedimentoRN extends InfraRN { | ||
2093 | 2103 | ||
2094 | protected function cancelarTramiteInternoControlado(ProtocoloDTO $objDtoProtocolo) { | 2104 | protected function cancelarTramiteInternoControlado(ProtocoloDTO $objDtoProtocolo) { |
2095 | 2105 | ||
2106 | + | ||
2096 | //Obtem o id_rh que representa a unidade no barramento | 2107 | //Obtem o id_rh que representa a unidade no barramento |
2097 | - $objInfraParametro = new InfraParametro($this->inicializarObjInfraIBanco()); | ||
2098 | - $numIdRespositorio = $objInfraParametro->getValor('PEN_ID_REPOSITORIO_ORIGEM'); | 2108 | + $objPENParametroRN = new PENParametroRN(); |
2109 | + $numIdRespositorio = $objPENParametroRN->getParametro('PEN_ID_REPOSITORIO_ORIGEM'); | ||
2099 | 2110 | ||
2100 | //Obtem os dados da unidade | 2111 | //Obtem os dados da unidade |
2101 | $objPenUnidadeDTO = new PenUnidadeDTO(); | 2112 | $objPenUnidadeDTO = new PenUnidadeDTO(); |
rn/PENAgendamentoRN.php
@@ -277,14 +277,30 @@ class PENAgendamentoRN extends InfraRN { | @@ -277,14 +277,30 @@ class PENAgendamentoRN extends InfraRN { | ||
277 | //Para cada hipótese vinda do PEN será verificado a existencia. | 277 | //Para cada hipótese vinda do PEN será verificado a existencia. |
278 | foreach ($hipotesesPen as $hipotese) { | 278 | foreach ($hipotesesPen as $hipotese) { |
279 | $objDTO = new PenHipoteseLegalDTO(); | 279 | $objDTO = new PenHipoteseLegalDTO(); |
280 | - $objDTO->setStrNome($hipotese->hipotese->nome); | 280 | + $objDTO->setNumIdentificacao($hipotese->hipotese->identificacao); |
281 | $objDTO->setNumMaxRegistrosRetorno(1); | 281 | $objDTO->setNumMaxRegistrosRetorno(1); |
282 | - $objDTO->retNumIdHipoteseLegal(); | 282 | + $objDTO->retStrNome(); |
283 | $objConsulta = $objBD->consultar($objDTO); | 283 | $objConsulta = $objBD->consultar($objDTO); |
284 | 284 | ||
285 | + //Caso não haja um nome para a hipótese legal, ele pula para a próxima. | ||
286 | + if (empty($hipotese->hipotese->nome)) { | ||
287 | + continue; | ||
288 | + } | ||
289 | + | ||
290 | + $objDTO->setStrNome($hipotese->hipotese->nome); | ||
291 | + | ||
292 | + if ($hipotese->hipotese->status) { | ||
293 | + $objDTO->setStrAtivo('S'); | ||
294 | + } else { | ||
295 | + $objDTO->setStrAtivo('N'); | ||
296 | + } | ||
297 | + | ||
285 | //Caso não exista a hipótese irá cadastra-la no sei. | 298 | //Caso não exista a hipótese irá cadastra-la no sei. |
286 | if (empty($objConsulta)) { | 299 | if (empty($objConsulta)) { |
287 | $objBD->cadastrar($objDTO); | 300 | $objBD->cadastrar($objDTO); |
301 | + } else { | ||
302 | + //Caso contrário apenas irá atualizar os dados. | ||
303 | + $objBD->alterar($objDTO); | ||
288 | } | 304 | } |
289 | } | 305 | } |
290 | 306 |
rn/PenAtualizarSeiRN.php
@@ -51,9 +51,12 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { | @@ -51,9 +51,12 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { | ||
51 | //nao tem nenhuma versao ainda, instalar todas | 51 | //nao tem nenhuma versao ainda, instalar todas |
52 | $this->instalarV100(); | 52 | $this->instalarV100(); |
53 | $this->instalarV101(); | 53 | $this->instalarV101(); |
54 | + $this->instalarV102(); | ||
54 | } else if ($strVersaoModuloPen == '1.0.0') { | 55 | } else if ($strVersaoModuloPen == '1.0.0') { |
55 | $this->instalarV101(); | 56 | $this->instalarV101(); |
56 | } else if ($strVersaoModuloPen == '1.0.1') { | 57 | } else if ($strVersaoModuloPen == '1.0.1') { |
58 | + $this->instalarV102(); | ||
59 | + } else if ($strVersaoModuloPen == '1.0.2') { | ||
57 | } | 60 | } |
58 | 61 | ||
59 | 62 | ||
@@ -66,6 +69,23 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { | @@ -66,6 +69,23 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { | ||
66 | throw new InfraException('Erro atualizando VERSAO.', $e); | 69 | throw new InfraException('Erro atualizando VERSAO.', $e); |
67 | } | 70 | } |
68 | } | 71 | } |
72 | + | ||
73 | + /** | ||
74 | + * Cria um novo parâmetro | ||
75 | + * @return int Código do Parametro gerado | ||
76 | + */ | ||
77 | + protected function criarParametro($strNome, $strValor, $strDescricao) { | ||
78 | + $objDTO = new PENParametroDTO(); | ||
79 | + $objDTO->setStrNome($strNome); | ||
80 | + $objDTO->setStrValor($strValor); | ||
81 | + $objDTO->setStrDescricao($strDescricao); | ||
82 | + $objDTO->retStrNome(); | ||
83 | + | ||
84 | + $objBD = new PenParametroBD($this->getObjInfraIBanco()); | ||
85 | + $objDTOCadastrado = $objBD->cadastrar($objDTO); | ||
86 | + | ||
87 | + return $objDTOCadastrado->getStrNome(); | ||
88 | + } | ||
69 | 89 | ||
70 | /* Contem atualizações da versao 1.0.0 do modulo */ | 90 | /* Contem atualizações da versao 1.0.0 do modulo */ |
71 | protected function instalarV100() { | 91 | protected function instalarV100() { |
@@ -1032,19 +1052,6 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { | @@ -1032,19 +1052,6 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { | ||
1032 | ), | 1052 | ), |
1033 | 'pk' => array('nome') | 1053 | 'pk' => array('nome') |
1034 | )); | 1054 | )); |
1035 | - | ||
1036 | - | ||
1037 | - /* altera o parâmetro da versão de banco */ | ||
1038 | - $objInfraParametroDTO = new InfraParametroDTO(); | ||
1039 | - $objInfraParametroDTO->setStrNome($this->nomeParametroModulo); | ||
1040 | - $objInfraParametroDTO->setStrValor('1.0.0'); | ||
1041 | - $objInfraParametroDTO->retTodos(); | ||
1042 | - | ||
1043 | - $objInfraParametroBD = new InfraParametroBD($this->inicializarObjInfraIBanco()); | ||
1044 | - $objInfraParametroDTO = $objInfraParametroBD->consultar($objInfraParametroDTO); | ||
1045 | - $objInfraParametroDTO->setStrValor('1.0.1'); | ||
1046 | - $objInfraParametroBD->alterar($objInfraParametroDTO); | ||
1047 | - | ||
1048 | 1055 | ||
1049 | //Agendamento | 1056 | //Agendamento |
1050 | $objDTO = new InfraAgendamentoTarefaDTO(); | 1057 | $objDTO = new InfraAgendamentoTarefaDTO(); |
@@ -1067,6 +1074,60 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { | @@ -1067,6 +1074,60 @@ class PenAtualizarSeiRN extends PenAtualizadorRN { | ||
1067 | }; | 1074 | }; |
1068 | 1075 | ||
1069 | $fnCadastrar('PENAgendamentoRN::atualizarHipotesesLegais', 'Verificação se há novas hipóteses legais do barramento.'); | 1076 | $fnCadastrar('PENAgendamentoRN::atualizarHipotesesLegais', 'Verificação se há novas hipóteses legais do barramento.'); |
1077 | + | ||
1078 | + /* altera o parâmetro da versão de banco */ | ||
1079 | + $objInfraParametroDTO = new InfraParametroDTO(); | ||
1080 | + $objInfraParametroDTO->setStrNome($this->nomeParametroModulo); | ||
1081 | + $objInfraParametroDTO->setStrValor('1.0.0'); | ||
1082 | + $objInfraParametroDTO->retTodos(); | ||
1083 | + | ||
1084 | + $objInfraParametroBD = new InfraParametroBD($this->inicializarObjInfraIBanco()); | ||
1085 | + $objInfraParametroDTO = $objInfraParametroBD->consultar($objInfraParametroDTO); | ||
1086 | + $objInfraParametroDTO->setStrValor('1.0.1'); | ||
1087 | + $objInfraParametroBD->alterar($objInfraParametroDTO); | ||
1088 | + } | ||
1089 | + | ||
1090 | + /* Contem atualizações da versao 1.0.2 do modulo */ | ||
1091 | + protected function instalarV102() { | ||
1092 | + $objMetaBD = $this->objMeta; | ||
1093 | + | ||
1094 | + //Adiciona a coluna de indentificação nas hipóteses que vem do barramento | ||
1095 | + $objMetaBD->adicionarColuna('md_pen_hipotese_legal', 'identificacao', $this->inicializarObjMetaBanco()->tipoNumero(), PenMetaBD::SNULLO); | ||
1096 | + | ||
1097 | + //Cria os parâmetros do módulo PEN barramento (md_pen_parametro [ nome, valor ]) | ||
1098 | + $this->criarParametro('PEN_ENDERECO_WEBSERVICE', 'https://pen-api.trafficmanager.net/interoperabilidade/soap/v2/', 'Endereço do Web Service'); | ||
1099 | + $this->criarParametro('PEN_ENDERECO_WEBSERVICE_PENDENCIAS', 'https://pen-pendencias.trafficmanager.net/', 'Endereço do Web Service de Pendências'); | ||
1100 | + $this->criarParametro('PEN_ENVIA_EMAIL_NOTIFICACAO_RECEBIMENTO', 'N', 'Envia E-mail de Notificação de Recebimento'); | ||
1101 | + $this->criarParametro('PEN_ID_REPOSITORIO_ORIGEM', '1', 'ID do Repositório de Origem'); | ||
1102 | + $this->criarParametro('PEN_LOCALIZACAO_CERTIFICADO_DIGITAL', '/opt/sei/web/modulos/mod-sei-barramento/CONITall.pem', 'Localização do Certificado Digital'); | ||
1103 | + $this->criarParametro('PEN_NUMERO_TENTATIVAS_TRAMITE_RECEBIMENTO', '3', 'Número Máximo de Tentativas de Recebimento'); | ||
1104 | + $this->criarParametro('PEN_SENHA_CERTIFICADO_DIGITAL', '1234', 'Senha do Certificado Digital'); | ||
1105 | + $this->criarParametro('PEN_TAMANHO_MAXIMO_DOCUMENTO_EXPEDIDO', '50', 'Tamanho Máximo de Documento Expedido'); | ||
1106 | + $this->criarParametro('PEN_TIPO_PROCESSO_EXTERNO', '100000320', 'Tipo de Processo Externo'); | ||
1107 | + $this->criarParametro('PEN_UNIDADE_GERADORA_DOCUMENTO_RECEBIDO', '110000001', 'Unidade Geradora de Processo e Documento Recebido'); | ||
1108 | + | ||
1109 | + //Alterar nomeclatura do recurso | ||
1110 | + $objDTO = new PenParametroDTO(); | ||
1111 | + $objDTO->setStrNome('HIPOTESE_LEGAL_PADRAO'); | ||
1112 | + $objDTO->retStrNome(); | ||
1113 | + $objBD = new PenParametroBD($this->getObjInfraIBanco()); | ||
1114 | + $objDTO = $objBD->consultar($objDTO); | ||
1115 | + $objDTO->setStrDescricao('Hipótese Legal Padrão'); | ||
1116 | + $objBD->alterar($objDTO); | ||
1117 | + | ||
1118 | + //Adiciona a coluna de descricao nos parâmetros | ||
1119 | + $objMetaBD->adicionarColuna('md_pen_parametro', 'descricao', $this->inicializarObjMetaBanco()->tipoTextoVariavel(255), PenMetaBD::SNULLO); | ||
1120 | + | ||
1121 | + /* altera o parâmetro da versão de banco */ | ||
1122 | +// $objInfraParametroDTO = new InfraParametroDTO(); | ||
1123 | +// $objInfraParametroDTO->setStrNome($this->nomeParametroModulo); | ||
1124 | +// $objInfraParametroDTO->setStrValor('1.0.1'); | ||
1125 | +// $objInfraParametroDTO->retTodos(); | ||
1126 | +// | ||
1127 | +// $objInfraParametroBD = new InfraParametroBD($this->inicializarObjInfraIBanco()); | ||
1128 | +// $objInfraParametroDTO = $objInfraParametroBD->consultar($objInfraParametroDTO); | ||
1129 | +// $objInfraParametroDTO->setStrValor('1.0.2'); | ||
1130 | +// $objInfraParametroBD->alterar($objInfraParametroDTO); | ||
1070 | } | 1131 | } |
1071 | 1132 | ||
1072 | } | 1133 | } |
rn/PenParametroRN.php
@@ -141,4 +141,19 @@ class PenParametroRN extends InfraRN { | @@ -141,4 +141,19 @@ class PenParametroRN extends InfraRN { | ||
141 | 141 | ||
142 | return $objBD->isSetValor($strNome); | 142 | return $objBD->isSetValor($strNome); |
143 | } | 143 | } |
144 | + | ||
145 | + /** | ||
146 | + * Resgata o valor do parâmetro | ||
147 | + * @param string $strNome | ||
148 | + */ | ||
149 | + public function getParametro($strNome) { | ||
150 | + $objPENParametroDTO = new PENParametroDTO(); | ||
151 | + $objPENParametroDTO->setStrNome($strNome); | ||
152 | + $objPENParametroDTO->retStrValor(); | ||
153 | + | ||
154 | + if($this->contar($objPENParametroDTO) > 0) { | ||
155 | + $objPENParametroDTO = $this->consultarControlado($objPENParametroDTO); | ||
156 | + return $objPENParametroDTO->getStrValor(); | ||
157 | + } | ||
158 | + } | ||
144 | } | 159 | } |
rn/PenRelHipoteseLegalEnvioRN.php
@@ -10,19 +10,19 @@ require_once dirname(__FILE__) . '/../../../SEI.php'; | @@ -10,19 +10,19 @@ require_once dirname(__FILE__) . '/../../../SEI.php'; | ||
10 | class PenRelHipoteseLegalEnvioRN extends PenRelHipoteseLegalRN { | 10 | class PenRelHipoteseLegalEnvioRN extends PenRelHipoteseLegalRN { |
11 | 11 | ||
12 | public function listar(PenRelHipoteseLegalDTO $objDTO){ | 12 | public function listar(PenRelHipoteseLegalDTO $objDTO){ |
13 | - SessaoSEI::getInstance()->validarAuditarPermissao('pen_map_hipotese_legal_enviado_listar', __METHOD__, $objDTO); | 13 | + SessaoSEI::getInstance()->validarAuditarPermissao('pen_map_hipotese_legal_envio_listar', __METHOD__, $objDTO); |
14 | return parent::listarConectado($objDTO); | 14 | return parent::listarConectado($objDTO); |
15 | } | 15 | } |
16 | public function alterar(PenRelHipoteseLegalDTO $objDTO){ | 16 | public function alterar(PenRelHipoteseLegalDTO $objDTO){ |
17 | - SessaoSEI::getInstance()->validarAuditarPermissao('pen_map_hipotese_legal_enviado_alterar', __METHOD__, $objDTO); | 17 | + SessaoSEI::getInstance()->validarAuditarPermissao('pen_map_hipotese_legal_envio_alterar', __METHOD__, $objDTO); |
18 | return parent::alterarConectado($objDTO); | 18 | return parent::alterarConectado($objDTO); |
19 | } | 19 | } |
20 | public function cadastrar(PenRelHipoteseLegalDTO $objDTO){ | 20 | public function cadastrar(PenRelHipoteseLegalDTO $objDTO){ |
21 | - SessaoSEI::getInstance()->validarAuditarPermissao('pen_map_hipotese_legal_enviado_cadastrar', __METHOD__, $objDTO); | 21 | + SessaoSEI::getInstance()->validarAuditarPermissao('pen_map_hipotese_legal_envio_cadastrar', __METHOD__, $objDTO); |
22 | return parent::cadastrarConectado($objDTO); | 22 | return parent::cadastrarConectado($objDTO); |
23 | } | 23 | } |
24 | public function excluir(PenRelHipoteseLegalDTO $objDTO){ | 24 | public function excluir(PenRelHipoteseLegalDTO $objDTO){ |
25 | - SessaoSEI::getInstance()->validarAuditarPermissao('pen_map_hipotese_legal_enviado_excluir', __METHOD__, $objDTO); | 25 | + SessaoSEI::getInstance()->validarAuditarPermissao('pen_map_hipotese_legal_envio_excluir', __METHOD__, $objDTO); |
26 | return parent::excluirConectado($objDTO); | 26 | return parent::excluirConectado($objDTO); |
27 | } | 27 | } |
28 | } | 28 | } |
rn/PenRelHipoteseLegalRecebidoRN.php
@@ -10,19 +10,19 @@ require_once dirname(__FILE__) . '/../../../SEI.php'; | @@ -10,19 +10,19 @@ require_once dirname(__FILE__) . '/../../../SEI.php'; | ||
10 | class PenRelHipoteseLegalRecebidoRN extends PenRelHipoteseLegalRN { | 10 | class PenRelHipoteseLegalRecebidoRN extends PenRelHipoteseLegalRN { |
11 | 11 | ||
12 | public function listar(PenRelHipoteseLegalDTO $objDTO){ | 12 | public function listar(PenRelHipoteseLegalDTO $objDTO){ |
13 | - SessaoSEI::getInstance()->validarAuditarPermissao('pen_map_hipotese_legal_recebido_listar', __METHOD__, $objDTO); | 13 | + SessaoSEI::getInstance()->validarAuditarPermissao('pen_map_hipotese_legal_recebimento_listar', __METHOD__, $objDTO); |
14 | return parent::listarConectado($objDTO); | 14 | return parent::listarConectado($objDTO); |
15 | } | 15 | } |
16 | public function alterar(PenRelHipoteseLegalDTO $objDTO){ | 16 | public function alterar(PenRelHipoteseLegalDTO $objDTO){ |
17 | - SessaoSEI::getInstance()->validarAuditarPermissao('pen_map_hipotese_legal_recebido_alterar', __METHOD__, $objDTO); | 17 | + SessaoSEI::getInstance()->validarAuditarPermissao('pen_map_hipotese_legal_recebimento_alterar', __METHOD__, $objDTO); |
18 | return parent::alterarConectado($objDTO); | 18 | return parent::alterarConectado($objDTO); |
19 | } | 19 | } |
20 | public function cadastrar(PenRelHipoteseLegalDTO $objDTO){ | 20 | public function cadastrar(PenRelHipoteseLegalDTO $objDTO){ |
21 | - SessaoSEI::getInstance()->validarAuditarPermissao('pen_map_hipotese_legal_recebido_cadastrar', __METHOD__, $objDTO); | 21 | + SessaoSEI::getInstance()->validarAuditarPermissao('pen_map_hipotese_legal_recebimento_cadastrar', __METHOD__, $objDTO); |
22 | return parent::cadastrarConectado($objDTO); | 22 | return parent::cadastrarConectado($objDTO); |
23 | } | 23 | } |
24 | public function excluir(PenRelHipoteseLegalDTO $objDTO){ | 24 | public function excluir(PenRelHipoteseLegalDTO $objDTO){ |
25 | - SessaoSEI::getInstance()->validarAuditarPermissao('pen_map_hipotese_legal_recebido_excluir', __METHOD__, $objDTO); | 25 | + SessaoSEI::getInstance()->validarAuditarPermissao('pen_map_hipotese_legal_recebimento_excluir', __METHOD__, $objDTO); |
26 | return parent::excluirConectado($objDTO); | 26 | return parent::excluirConectado($objDTO); |
27 | } | 27 | } |
28 | } | 28 | } |
rn/PenTramiteProcessadoRN.php
@@ -68,8 +68,8 @@ class PenTramiteProcessadoRN extends InfraRN { | @@ -68,8 +68,8 @@ class PenTramiteProcessadoRN extends InfraRN { | ||
68 | } | 68 | } |
69 | else { | 69 | else { |
70 | 70 | ||
71 | - $objInfraParametro = new InfraParametro($this->inicializarObjInfraIBanco()); | ||
72 | - $numTentativas = $objInfraParametro->getValor(self::PARAM_NUMERO_TENTATIVAS); | 71 | + $objPENParametroRN = new PENParametroRN(); |
72 | + $numTentativas = $objPENParametroRN->getParametro(self::PARAM_NUMERO_TENTATIVAS); | ||
73 | 73 | ||
74 | // Verifica o número de tentativas já realizadas é igual ao configurado | 74 | // Verifica o número de tentativas já realizadas é igual ao configurado |
75 | // no parâmetro | 75 | // no parâmetro |
@@ -0,0 +1,111 @@ | @@ -0,0 +1,111 @@ | ||
1 | +<?php | ||
2 | + | ||
3 | +require_once dirname(__FILE__) . '/../../../SEI.php'; | ||
4 | + | ||
5 | +/** | ||
6 | + * Description of PenUnidadeEnvioRN | ||
7 | + * | ||
8 | + * @author Join Tecnologia (Thiago Farias) | ||
9 | + */ | ||
10 | +class PenUnidadeRN extends InfraRN { | ||
11 | + | ||
12 | + /** | ||
13 | + * Inicializa o obj do banco da Infra | ||
14 | + * @return obj | ||
15 | + */ | ||
16 | + protected function inicializarObjInfraIBanco(){ | ||
17 | + return BancoSEI::getInstance(); | ||
18 | + } | ||
19 | + | ||
20 | + /** | ||
21 | + * Método para buscar apenas as unidades que já estão em uso | ||
22 | + * @param PenUnidadeDTO $objFiltroDTO | ||
23 | + * @return arrayDTO | ||
24 | + */ | ||
25 | + public function getIdUnidadeEmUso(PenUnidadeDTO $objFiltroDTO){ | ||
26 | + $objDTO = new PenUnidadeDTO(); | ||
27 | + $objDTO->setDistinct(true); | ||
28 | + $objDTO->retNumIdUnidade(); | ||
29 | + | ||
30 | + if($objFiltroDTO->isSetNumIdUnidade()) { | ||
31 | + $objDTO->setNumIdUnidade($objFiltroDTO->getNumIdUnidade(), InfraDTO::$OPER_DIFERENTE); | ||
32 | + } | ||
33 | + | ||
34 | + $arrObjDTO = $this->listar($objDTO); | ||
35 | + | ||
36 | + $arrIdUnidade = array(); | ||
37 | + | ||
38 | + if(!empty($arrObjDTO)) { | ||
39 | + $arrIdUnidade = InfraArray::converterArrInfraDTO($arrObjDTO, 'IdUnidade'); | ||
40 | + } | ||
41 | + return $arrIdUnidade; | ||
42 | + } | ||
43 | + | ||
44 | + /** | ||
45 | + * Método utilizado para listagem de dados. | ||
46 | + * @param UnidadeDTO $objUnidadeDTO | ||
47 | + * @return array | ||
48 | + * @throws InfraException | ||
49 | + */ | ||
50 | + protected function listarConectado(UnidadeDTO $objUnidadeDTO) { | ||
51 | + try { | ||
52 | + //Valida Permissao | ||
53 | + SessaoSEI::getInstance()->validarAuditarPermissao('pen_map_unidade_listar',__METHOD__,$objUnidadeDTO); | ||
54 | + | ||
55 | + $objUnidadeBD = new UnidadeBD($this->getObjInfraIBanco()); | ||
56 | + $ret = $objUnidadeBD->listar($objUnidadeDTO); | ||
57 | + | ||
58 | + return $ret; | ||
59 | + }catch(Exception $e){ | ||
60 | + throw new InfraException('Erro listando Unidades.',$e); | ||
61 | + } | ||
62 | + } | ||
63 | + | ||
64 | + /** | ||
65 | + * Método utilizado para alteração de dados. | ||
66 | + * @param UnidadeDTO $objDTO | ||
67 | + * @return array | ||
68 | + * @throws InfraException | ||
69 | + */ | ||
70 | + protected function alterarConectado(PenUnidadeDTO $objDTO){ | ||
71 | + try { | ||
72 | + $objBD = new GenericoBD($this->inicializarObjInfraIBanco()); | ||
73 | + return $objBD->alterar($objDTO); | ||
74 | + } | ||
75 | + catch (Exception $e) { | ||
76 | + throw new InfraException('Erro excluindo E-mail do Sistema.', $e); | ||
77 | + } | ||
78 | + } | ||
79 | + | ||
80 | + /** | ||
81 | + * Método utilizado para cadastro de dados. | ||
82 | + * @param UnidadeDTO $objDTO | ||
83 | + * @return array | ||
84 | + * @throws InfraException | ||
85 | + */ | ||
86 | + protected function cadastrarConectado(PenUnidadeDTO $objDTO){ | ||
87 | + try { | ||
88 | + $objBD = new GenericoBD($this->inicializarObjInfraIBanco()); | ||
89 | + return $objBD->cadastrar($objDTO); | ||
90 | + } | ||
91 | + catch (Exception $e) { | ||
92 | + throw new InfraException('Erro excluindo E-mail do Sistema.', $e); | ||
93 | + } | ||
94 | + } | ||
95 | + | ||
96 | + /** | ||
97 | + * Método utilizado para exclusão de dados. | ||
98 | + * @param UnidadeDTO $objDTO | ||
99 | + * @return array | ||
100 | + * @throws InfraException | ||
101 | + */ | ||
102 | + protected function excluirConectado(PenUnidadeDTO $objDTO){ | ||
103 | + try { | ||
104 | + $objBD = new GenericoBD($this->inicializarObjInfraIBanco()); | ||
105 | + return $objBD->excluir($objDTO); | ||
106 | + } | ||
107 | + catch (Exception $e) { | ||
108 | + throw new InfraException('Erro excluindo E-mail do Sistema.', $e); | ||
109 | + } | ||
110 | + } | ||
111 | +} |
rn/PendenciasTramiteRN.php
@@ -25,12 +25,12 @@ class PendenciasTramiteRN extends InfraRN { | @@ -25,12 +25,12 @@ class PendenciasTramiteRN extends InfraRN { | ||
25 | } | 25 | } |
26 | 26 | ||
27 | public function __construct() { | 27 | public function __construct() { |
28 | - | ||
29 | - $objInfraParametro = new InfraParametro($this->inicializarObjInfraIBanco()); | ||
30 | - $this->strLocalizacaoCertificadoDigital = $objInfraParametro->getValor('PEN_LOCALIZACAO_CERTIFICADO_DIGITAL'); | ||
31 | - $this->strEnderecoServicoPendencias = $objInfraParametro->getValor('PEN_ENDERECO_WEBSERVICE_PENDENCIAS'); | 28 | + $objPENParametroRN = new PENParametroRN(); |
29 | + | ||
30 | + $this->strLocalizacaoCertificadoDigital = $objPENParametroRN->getParametro('PEN_LOCALIZACAO_CERTIFICADO_DIGITAL'); | ||
31 | + $this->strEnderecoServicoPendencias = $objPENParametroRN->getParametro('PEN_ENDERECO_WEBSERVICE_PENDENCIAS'); | ||
32 | //TODO: Urgente - Remover senha do certificado de autenticação dos serviços do PEN da tabela de parâmetros | 32 | //TODO: Urgente - Remover senha do certificado de autenticação dos serviços do PEN da tabela de parâmetros |
33 | - $this->strSenhaCertificadoDigital = $objInfraParametro->getValor('PEN_SENHA_CERTIFICADO_DIGITAL'); | 33 | + $this->strSenhaCertificadoDigital = $objPENParametroRN->getParametro('PEN_SENHA_CERTIFICADO_DIGITAL'); |
34 | 34 | ||
35 | if (InfraString::isBolVazia($this->strEnderecoServicoPendencias)) { | 35 | if (InfraString::isBolVazia($this->strEnderecoServicoPendencias)) { |
36 | throw new InfraException('Endereço do serviço de pendências de trâmite do Processo Eletrônico Nacional (PEN) não informado.'); | 36 | throw new InfraException('Endereço do serviço de pendências de trâmite do Processo Eletrônico Nacional (PEN) não informado.'); |
@@ -55,8 +55,8 @@ class PendenciasTramiteRN extends InfraRN { | @@ -55,8 +55,8 @@ class PendenciasTramiteRN extends InfraRN { | ||
55 | InfraDebug::getInstance()->setBolEcho(false); | 55 | InfraDebug::getInstance()->setBolEcho(false); |
56 | InfraDebug::getInstance()->limpar(); | 56 | InfraDebug::getInstance()->limpar(); |
57 | 57 | ||
58 | - $objInfraParametro = new InfraParametro(BancoSEI::getInstance()); | ||
59 | - SessaoSEI::getInstance(false)->simularLogin('SEI', null, null, $objInfraParametro->getValor('PEN_UNIDADE_GERADORA_DOCUMENTO_RECEBIDO')); | 58 | + $objPENParametroRN = new PENParametroRN(); |
59 | + SessaoSEI::getInstance(false)->simularLogin('SEI', null, null, $objPENParametroRN->getParametro('PEN_UNIDADE_GERADORA_DOCUMENTO_RECEBIDO')); | ||
60 | 60 | ||
61 | $numSeg = InfraUtil::verificarTempoProcessamento(); | 61 | $numSeg = InfraUtil::verificarTempoProcessamento(); |
62 | InfraDebug::getInstance()->gravar('MONITORANDO OS TRÂMITES PENDENTES ENVIADOS PARA O ÓRGÃO (PEN)'); | 62 | InfraDebug::getInstance()->gravar('MONITORANDO OS TRÂMITES PENDENTES ENVIADOS PARA O ÓRGÃO (PEN)'); |
rn/ProcessarPendenciasRN.php
@@ -36,8 +36,8 @@ class ProcessarPendenciasRN extends InfraAgendamentoTarefa { | @@ -36,8 +36,8 @@ class ProcessarPendenciasRN extends InfraAgendamentoTarefa { | ||
36 | InfraDebug::getInstance()->setBolEcho(false); | 36 | InfraDebug::getInstance()->setBolEcho(false); |
37 | InfraDebug::getInstance()->limpar(); | 37 | InfraDebug::getInstance()->limpar(); |
38 | 38 | ||
39 | - $objInfraParametro = new InfraParametro(BancoSEI::getInstance()); | ||
40 | - SessaoSEI::getInstance(false)->simularLogin('SEI', null, null, $objInfraParametro->getValor('PEN_UNIDADE_GERADORA_DOCUMENTO_RECEBIDO')); | 39 | + $objPENParametroRN = new PENParametroRN(); |
40 | + SessaoSEI::getInstance(false)->simularLogin('SEI', null, null, $objPENParametroRN->getParametro('PEN_UNIDADE_GERADORA_DOCUMENTO_RECEBIDO')); | ||
41 | 41 | ||
42 | $numSeg = InfraUtil::verificarTempoProcessamento(); | 42 | $numSeg = InfraUtil::verificarTempoProcessamento(); |
43 | 43 |
rn/ProcessoEletronicoRN.php
@@ -79,11 +79,11 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -79,11 +79,11 @@ class ProcessoEletronicoRN extends InfraRN { | ||
79 | private $options = null; | 79 | private $options = null; |
80 | 80 | ||
81 | public function __construct() { | 81 | public function __construct() { |
82 | - $objInfraParametro = new InfraParametro(BancoSEI::getInstance()); | ||
83 | - | ||
84 | - $strEnderecoWebService = $objInfraParametro->getValor('PEN_ENDERECO_WEBSERVICE'); | ||
85 | - $strLocalizacaoCertificadoDigital = $objInfraParametro->getValor('PEN_LOCALIZACAO_CERTIFICADO_DIGITAL'); | ||
86 | - $strSenhaCertificadoDigital = $objInfraParametro->getValor('PEN_SENHA_CERTIFICADO_DIGITAL'); | 82 | + $objPENParametroRN = new PENParametroRN(); |
83 | + | ||
84 | + $strEnderecoWebService = $objPENParametroRN->getParametro('PEN_ENDERECO_WEBSERVICE'); | ||
85 | + $strLocalizacaoCertificadoDigital = $objPENParametroRN->getParametro('PEN_LOCALIZACAO_CERTIFICADO_DIGITAL'); | ||
86 | + $strSenhaCertificadoDigital = $objPENParametroRN->getParametro('PEN_SENHA_CERTIFICADO_DIGITAL'); | ||
87 | 87 | ||
88 | if (InfraString::isBolVazia($strEnderecoWebService)) { | 88 | if (InfraString::isBolVazia($strEnderecoWebService)) { |
89 | throw new InfraException('Endereço do serviço de integração do Processo Eletrônico Nacional (PEN) não informado.'); | 89 | throw new InfraException('Endereço do serviço de integração do Processo Eletrônico Nacional (PEN) não informado.'); |
@@ -112,7 +112,7 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -112,7 +112,7 @@ class ProcessoEletronicoRN extends InfraRN { | ||
112 | , 'encoding' => 'UTF-8' | 112 | , 'encoding' => 'UTF-8' |
113 | , 'attachment_type' => BeSimple\SoapCommon\Helper::ATTACHMENTS_TYPE_MTOM | 113 | , 'attachment_type' => BeSimple\SoapCommon\Helper::ATTACHMENTS_TYPE_MTOM |
114 | , 'ssl' => array( | 114 | , 'ssl' => array( |
115 | - 'allow_self_signed' => true | 115 | + 'allow_self_signed' => true, |
116 | ) | 116 | ) |
117 | ); | 117 | ); |
118 | } | 118 | } |
@@ -257,7 +257,7 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -257,7 +257,7 @@ class ProcessoEletronicoRN extends InfraRN { | ||
257 | $parametros->filtroDeEstruturas->identificacaoDoRepositorioDeEstruturas = $idRepositorioEstrutura; | 257 | $parametros->filtroDeEstruturas->identificacaoDoRepositorioDeEstruturas = $idRepositorioEstrutura; |
258 | $parametros->filtroDeEstruturas->numeroDeIdentificacaoDaEstrutura = $numeroDeIdentificacaoDaEstrutura; | 258 | $parametros->filtroDeEstruturas->numeroDeIdentificacaoDaEstrutura = $numeroDeIdentificacaoDaEstrutura; |
259 | $parametros->filtroDeEstruturas->apenasAtivas = false; | 259 | $parametros->filtroDeEstruturas->apenasAtivas = false; |
260 | - | 260 | + |
261 | $result = $this->getObjPenWs()->consultarEstruturas($parametros); | 261 | $result = $this->getObjPenWs()->consultarEstruturas($parametros); |
262 | 262 | ||
263 | if ($result->estruturasEncontradas->totalDeRegistros == 1) { | 263 | if ($result->estruturasEncontradas->totalDeRegistros == 1) { |
@@ -312,9 +312,13 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -312,9 +312,13 @@ class ProcessoEletronicoRN extends InfraRN { | ||
312 | $parametros = new stdClass(); | 312 | $parametros = new stdClass(); |
313 | $parametros->filtroDeEstruturas = new stdClass(); | 313 | $parametros->filtroDeEstruturas = new stdClass(); |
314 | $parametros->filtroDeEstruturas->identificacaoDoRepositorioDeEstruturas = $idRepositorioEstrutura; | 314 | $parametros->filtroDeEstruturas->identificacaoDoRepositorioDeEstruturas = $idRepositorioEstrutura; |
315 | - //$parametros->filtroDeEstruturas->numeroDeIdentificacaoDaEstrutura = 218794;//$numeroDeIdentificacaoDaEstrutura; | ||
316 | - $parametros->filtroDeEstruturas->nome = utf8_encode($nome); | ||
317 | $parametros->filtroDeEstruturas->apenasAtivas = false; | 315 | $parametros->filtroDeEstruturas->apenasAtivas = false; |
316 | + | ||
317 | + if(is_numeric($nome)) { | ||
318 | + $parametros->filtroDeEstruturas->numeroDeIdentificacaoDaEstrutura = intval($nome); | ||
319 | + } else { | ||
320 | + $parametros->filtroDeEstruturas->nome = utf8_encode($nome); | ||
321 | + } | ||
318 | 322 | ||
319 | $result = $this->getObjPenWs()->consultarEstruturas($parametros); | 323 | $result = $this->getObjPenWs()->consultarEstruturas($parametros); |
320 | 324 | ||
@@ -1041,8 +1045,9 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -1041,8 +1045,9 @@ class ProcessoEletronicoRN extends InfraRN { | ||
1041 | $objTramite = array_pop($arrObjTramite); | 1045 | $objTramite = array_pop($arrObjTramite); |
1042 | 1046 | ||
1043 | if (empty($numIdRepositorio)) { | 1047 | if (empty($numIdRepositorio)) { |
1044 | - $objInfraParametro = new InfraParametro($this->inicializarObjInfraIBanco()); | ||
1045 | - $numIdRepositorio = $objInfraParametro->getValor('PEN_ID_REPOSITORIO_ORIGEM'); | 1048 | + $objPENParametroRN = new PENParametroRN(); |
1049 | + $numIdRepositorio = $objPENParametroRN->getParametro('PEN_ID_REPOSITORIO_ORIGEM'); | ||
1050 | + | ||
1046 | } | 1051 | } |
1047 | 1052 | ||
1048 | if (empty($numIdEstrutura)) { | 1053 | if (empty($numIdEstrutura)) { |
@@ -1360,8 +1365,8 @@ class ProcessoEletronicoRN extends InfraRN { | @@ -1360,8 +1365,8 @@ class ProcessoEletronicoRN extends InfraRN { | ||
1360 | public function isDisponivelCancelarTramite($strProtocolo = ''){ | 1365 | public function isDisponivelCancelarTramite($strProtocolo = ''){ |
1361 | 1366 | ||
1362 | //Obtem o id_rh que representa a unidade no barramento | 1367 | //Obtem o id_rh que representa a unidade no barramento |
1363 | - $objInfraParametro = new InfraParametro($this->inicializarObjInfraIBanco()); | ||
1364 | - $numIdRespositorio = $objInfraParametro->getValor('PEN_ID_REPOSITORIO_ORIGEM'); | 1368 | + $objPENParametroRN = new PENParametroRN(); |
1369 | + $numIdRespositorio = $objPENParametroRN->getParametro('PEN_ID_REPOSITORIO_ORIGEM'); | ||
1365 | 1370 | ||
1366 | //Obtem os dados da unidade | 1371 | //Obtem os dados da unidade |
1367 | $objPenUnidadeDTO = new PenUnidadeDTO(); | 1372 | $objPenUnidadeDTO = new PenUnidadeDTO(); |
rn/ReceberProcedimentoRN.php
@@ -80,9 +80,8 @@ class ReceberProcedimentoRN extends InfraRN | @@ -80,9 +80,8 @@ class ReceberProcedimentoRN extends InfraRN | ||
80 | // TODO: Adicionar comandos de debug. Vide SeiWs.php gerarProcedimento | 80 | // TODO: Adicionar comandos de debug. Vide SeiWs.php gerarProcedimento |
81 | protected function receberProcedimentoControlado($parNumIdentificacaoTramite) | 81 | protected function receberProcedimentoControlado($parNumIdentificacaoTramite) |
82 | { | 82 | { |
83 | - | ||
84 | - $objInfraParametro = new InfraParametro(BancoSEI::getInstance()); | ||
85 | - SessaoSEI::getInstance(false)->simularLogin('SEI', null, null, $objInfraParametro->getValor('PEN_UNIDADE_GERADORA_DOCUMENTO_RECEBIDO')); | 83 | + $objPENParametroRN = new PENParametroRN(); |
84 | + SessaoSEI::getInstance(false)->simularLogin('SEI', null, null, $objPENParametroRN->getParametro('PEN_UNIDADE_GERADORA_DOCUMENTO_RECEBIDO')); | ||
86 | 85 | ||
87 | $objSeiRN = new SeiRN(); | 86 | $objSeiRN = new SeiRN(); |
88 | 87 | ||
@@ -608,7 +607,8 @@ class ReceberProcedimentoRN extends InfraRN | @@ -608,7 +607,8 @@ class ReceberProcedimentoRN extends InfraRN | ||
608 | $objProcedimentoDTO->setArrObjDocumentoDTO(array()); | 607 | $objProcedimentoDTO->setArrObjDocumentoDTO(array()); |
609 | 608 | ||
610 | //TODO: Identificar o tipo de procedimento correto para atribuição ao novo processo | 609 | //TODO: Identificar o tipo de procedimento correto para atribuição ao novo processo |
611 | - $numIdTipoProcedimento = $this->objInfraParametro->getValor('PEN_TIPO_PROCESSO_EXTERNO'); | 610 | + $objPENParametroRN = new PENParametroRN(); |
611 | + $numIdTipoProcedimento = $objPENParametroRN->getParametro('PEN_TIPO_PROCESSO_EXTERNO'); | ||
612 | $this->atribuirTipoProcedimento($objProcedimentoDTO, $numIdTipoProcedimento, $objProcesso->processoDeNegocio); | 612 | $this->atribuirTipoProcedimento($objProcedimentoDTO, $numIdTipoProcedimento, $objProcesso->processoDeNegocio); |
613 | 613 | ||
614 | //TODO: Obter código da unidade através de mapeamento entre SEI e Barramento | 614 | //TODO: Obter código da unidade através de mapeamento entre SEI e Barramento |
@@ -1221,7 +1221,9 @@ class ReceberProcedimentoRN extends InfraRN | @@ -1221,7 +1221,9 @@ class ReceberProcedimentoRN extends InfraRN | ||
1221 | } | 1221 | } |
1222 | 1222 | ||
1223 | $objDestinatario = $objMetadadosProcedimento->metadados->destinatario; | 1223 | $objDestinatario = $objMetadadosProcedimento->metadados->destinatario; |
1224 | - $numIdRepositorioOrigem = $this->objInfraParametro->getValor('PEN_ID_REPOSITORIO_ORIGEM'); | 1224 | + |
1225 | + $objPENParametroRN = new PENParametroRN(); | ||
1226 | + $numIdRepositorioOrigem = $objPENParametroRN->getParametro('PEN_ID_REPOSITORIO_ORIGEM'); | ||
1225 | $numIdRepositorioDestinoProcesso = $objDestinatario->identificacaoDoRepositorioDeEstruturas; | 1227 | $numIdRepositorioDestinoProcesso = $objDestinatario->identificacaoDoRepositorioDeEstruturas; |
1226 | $numeroDeIdentificacaoDaEstrutura = $objDestinatario->numeroDeIdentificacaoDaEstrutura; | 1228 | $numeroDeIdentificacaoDaEstrutura = $objDestinatario->numeroDeIdentificacaoDaEstrutura; |
1227 | 1229 | ||
@@ -1504,9 +1506,11 @@ class ReceberProcedimentoRN extends InfraRN | @@ -1504,9 +1506,11 @@ class ReceberProcedimentoRN extends InfraRN | ||
1504 | $objAtividadeDTO->setNumIdUnidade($objUnidadeDTO->getNumIdUnidade()); | 1506 | $objAtividadeDTO->setNumIdUnidade($objUnidadeDTO->getNumIdUnidade()); |
1505 | $objAtividadeDTO->setNumIdUnidadeOrigem(SessaoSEI::getInstance()->getNumIdUnidadeAtual()); | 1507 | $objAtividadeDTO->setNumIdUnidadeOrigem(SessaoSEI::getInstance()->getNumIdUnidadeAtual()); |
1506 | $objEnviarProcessoDTO->setArrAtividades(array($objAtividadeDTO)); | 1508 | $objEnviarProcessoDTO->setArrAtividades(array($objAtividadeDTO)); |
1507 | - | 1509 | + |
1510 | + $objPENParametroRN = new PENParametroRN(); | ||
1511 | + | ||
1508 | $objEnviarProcessoDTO->setStrSinManterAberto('N'); | 1512 | $objEnviarProcessoDTO->setStrSinManterAberto('N'); |
1509 | - $strEnviaEmailNotificacao = ($this->objInfraParametro->getValor('PEN_ENVIA_EMAIL_NOTIFICACAO_RECEBIMENTO', false) == 'S') ? 'S' : 'N'; | 1513 | + $strEnviaEmailNotificacao = $objPENParametroRN->getParametro('PEN_ENVIA_EMAIL_NOTIFICACAO_RECEBIMENTO'); |
1510 | $objEnviarProcessoDTO->setStrSinEnviarEmailNotificacao($strEnviaEmailNotificacao); | 1514 | $objEnviarProcessoDTO->setStrSinEnviarEmailNotificacao($strEnviaEmailNotificacao); |
1511 | $objEnviarProcessoDTO->setStrSinRemoverAnotacoes('S'); | 1515 | $objEnviarProcessoDTO->setStrSinRemoverAnotacoes('S'); |
1512 | $objEnviarProcessoDTO->setDtaPrazo(null); | 1516 | $objEnviarProcessoDTO->setDtaPrazo(null); |
sip_atualizar_versao_modulo_pen.php
@@ -575,16 +575,28 @@ class PenAtualizarSipRN extends PenAtualizadorRN { | @@ -575,16 +575,28 @@ class PenAtualizarSipRN extends PenAtualizadorRN { | ||
575 | 575 | ||
576 | //$strVersaoAtual = $objInfraParametro->getValor('SEI_VERSAO', false); | 576 | //$strVersaoAtual = $objInfraParametro->getValor('SEI_VERSAO', false); |
577 | $strVersaoModuloPen = $objInfraParametro->getValor($this->sip_versao, false); | 577 | $strVersaoModuloPen = $objInfraParametro->getValor($this->sip_versao, false); |
578 | - | 578 | + |
579 | //VERIFICANDO QUAL VERSAO DEVE SER INSTALADA NESTA EXECUCAO | 579 | //VERIFICANDO QUAL VERSAO DEVE SER INSTALADA NESTA EXECUCAO |
580 | if (InfraString::isBolVazia($strVersaoModuloPen)) { | 580 | if (InfraString::isBolVazia($strVersaoModuloPen)) { |
581 | - //nao tem nenhuma versao ainda, instalar todas | ||
582 | $this->instalarV100(); | 581 | $this->instalarV100(); |
583 | $this->instalarV101(); | 582 | $this->instalarV101(); |
584 | - } else if ($strVersaoModuloPen == '1.0.0') { | ||
585 | - $this->instalarV101(); | ||
586 | - } | 583 | + $this->instalarV102(); |
584 | + $this->instalarV103(); | ||
585 | + } else { | ||
586 | + switch ($strVersaoModuloPen) { | ||
587 | + case '1.0.0': | ||
588 | + $this->instalarV101(); | ||
589 | + break; | ||
587 | 590 | ||
591 | + case '1.0.1': | ||
592 | + $this->instalarV102(); | ||
593 | + break; | ||
594 | + | ||
595 | + case '1.0.2': //Remover depois de usar | ||
596 | + $this->instalarV103(); | ||
597 | + break; | ||
598 | + } | ||
599 | + } | ||
588 | 600 | ||
589 | InfraDebug::getInstance()->setBolDebugInfra(true); | 601 | InfraDebug::getInstance()->setBolDebugInfra(true); |
590 | } catch (Exception $e) { | 602 | } catch (Exception $e) { |
@@ -796,7 +808,6 @@ class PenAtualizarSipRN extends PenAtualizadorRN { | @@ -796,7 +808,6 @@ class PenAtualizarSipRN extends PenAtualizadorRN { | ||
796 | } | 808 | } |
797 | 809 | ||
798 | public function atribuirPerfil($numIdSistema) { | 810 | public function atribuirPerfil($numIdSistema) { |
799 | - | ||
800 | $objDTO = new PerfilDTO(); | 811 | $objDTO = new PerfilDTO(); |
801 | $objBD = new PerfilBD($this->objInfraBanco); | 812 | $objBD = new PerfilBD($this->objInfraBanco); |
802 | $objRN = $this; | 813 | $objRN = $this; |
@@ -818,7 +829,7 @@ class PenAtualizarSipRN extends PenAtualizadorRN { | @@ -818,7 +829,7 @@ class PenAtualizarSipRN extends PenAtualizadorRN { | ||
818 | } | 829 | } |
819 | }; | 830 | }; |
820 | 831 | ||
821 | - //$fnCadastrar('ADMINISTRADOR', $numIdSistema); | 832 | + $fnCadastrar('ADMINISTRADOR', $numIdSistema); |
822 | //$fnCadastrar('BASICO', $numIdSistema); | 833 | //$fnCadastrar('BASICO', $numIdSistema); |
823 | } | 834 | } |
824 | 835 | ||
@@ -968,30 +979,30 @@ class PenAtualizarSipRN extends PenAtualizadorRN { | @@ -968,30 +979,30 @@ class PenAtualizarSipRN extends PenAtualizadorRN { | ||
968 | $objItemMenuDTO = new ItemMenuDTO(); | 979 | $objItemMenuDTO = new ItemMenuDTO(); |
969 | $objItemMenuDTO->setNumIdSistema($numIdSistema); | 980 | $objItemMenuDTO->setNumIdSistema($numIdSistema); |
970 | $objItemMenuDTO->setNumIdMenu($numIdMenu); | 981 | $objItemMenuDTO->setNumIdMenu($numIdMenu); |
971 | - $objItemMenuDTO->setStrRotulo('Processo Eletrnico Nacional'); | 982 | + $objItemMenuDTO->setStrRotulo('Processo Eletrônico Nacional'); |
972 | $objItemMenuDTO->setNumMaxRegistrosRetorno(1); | 983 | $objItemMenuDTO->setNumMaxRegistrosRetorno(1); |
973 | $objItemMenuDTO->retNumIdItemMenu(); | 984 | $objItemMenuDTO->retNumIdItemMenu(); |
974 | 985 | ||
975 | $objItemMenuDTO = $objItemMenuBD->consultar($objItemMenuDTO); | 986 | $objItemMenuDTO = $objItemMenuBD->consultar($objItemMenuDTO); |
976 | 987 | ||
977 | if(empty($objItemMenuDTO)) { | 988 | if(empty($objItemMenuDTO)) { |
978 | - throw new InfraException('Menu "Processo Eletrnico Nacional" no foi localizado'); | 989 | + throw new InfraException('Menu "Processo Eletrônico Nacional" não foi localizado'); |
979 | } | 990 | } |
980 | 991 | ||
981 | // Administrao > Mapeamento de Hipteses Legais de Envio | 992 | // Administrao > Mapeamento de Hipteses Legais de Envio |
982 | - $numIdItemMenu = $this->criarMenu('Mapeamento de Hipteses Legais', 20, $objItemMenuDTO->getNumIdItemMenu(), $numIdMenu, null, $numIdSistema); | 993 | + $numIdItemMenu = $this->criarMenu('Mapeamento de Hipóteses Legais', 20, $objItemMenuDTO->getNumIdItemMenu(), $numIdMenu, null, $numIdSistema); |
983 | 994 | ||
984 | // Administrao > Mapeamento de Hipteses Legais de Envio > Envio | 995 | // Administrao > Mapeamento de Hipteses Legais de Envio > Envio |
985 | $numIdItemMenu = $this->criarMenu('Envio', 10, $numIdItemMenu, $numIdMenu, null, $numIdSistema); | 996 | $numIdItemMenu = $this->criarMenu('Envio', 10, $numIdItemMenu, $numIdMenu, null, $numIdSistema); |
986 | 997 | ||
987 | // Administrao > Mapeamento de Hipteses Legais de Envio > Envio > Cadastrar | 998 | // Administrao > Mapeamento de Hipteses Legais de Envio > Envio > Cadastrar |
988 | - $numIdRecurso = $this->criarRecurso('pen_map_hipotese_legal_enviado_alterar', 'Alterar de mapeamento de Hipteses Legais de Envio', $numIdSistema); | ||
989 | - $numIdRecurso = $this->criarRecurso('pen_map_hipotese_legal_enviado_cadastrar', 'Cadastro de mapeamento de Hipteses Legais de Envio', $numIdSistema); | 999 | + $numIdRecurso = $this->criarRecurso('pen_map_hipotese_legal_enviado_alterar', 'Alterar de mapeamento de Hipóteses Legais de Envio', $numIdSistema); |
1000 | + $numIdRecurso = $this->criarRecurso('pen_map_hipotese_legal_enviado_cadastrar', 'Cadastro de mapeamento de Hipóteses Legais de Envio', $numIdSistema); | ||
990 | $this->criarMenu('Cadastrar', 10, $numIdItemMenu, $numIdMenu, $numIdRecurso, $numIdSistema); | 1001 | $this->criarMenu('Cadastrar', 10, $numIdItemMenu, $numIdMenu, $numIdRecurso, $numIdSistema); |
991 | 1002 | ||
992 | // Administrao > Mapeamento de Hipteses Legais de Envio > Envio > Listar | 1003 | // Administrao > Mapeamento de Hipteses Legais de Envio > Envio > Listar |
993 | - $numIdRecurso = $this->criarRecurso('pen_map_hipotese_legal_enviado_excluir', 'Excluir mapeamento de Hipteses Legais de Envio', $numIdSistema); | ||
994 | - $numIdRecurso = $this->criarRecurso('pen_map_hipotese_legal_enviado_listar', 'Listagem de mapeamento de Hipteses Legais de Envio', $numIdSistema); | 1004 | + $numIdRecurso = $this->criarRecurso('pen_map_hipotese_legal_enviado_excluir', 'Excluir mapeamento de Hipóteses Legais de Envio', $numIdSistema); |
1005 | + $numIdRecurso = $this->criarRecurso('pen_map_hipotese_legal_enviado_listar', 'Listagem de mapeamento de Hipóteses Legais de Envio', $numIdSistema); | ||
995 | $this->criarMenu('Listar', 20, $numIdItemMenu, $numIdMenu, $numIdRecurso, $numIdSistema); | 1006 | $this->criarMenu('Listar', 20, $numIdItemMenu, $numIdMenu, $numIdRecurso, $numIdSistema); |
996 | 1007 | ||
997 | //Atribui as permisses aos recursos e menus | 1008 | //Atribui as permisses aos recursos e menus |
@@ -1010,27 +1021,27 @@ class PenAtualizarSipRN extends PenAtualizadorRN { | @@ -1010,27 +1021,27 @@ class PenAtualizarSipRN extends PenAtualizadorRN { | ||
1010 | $objDTO = new ItemMenuDTO(); | 1021 | $objDTO = new ItemMenuDTO(); |
1011 | $objDTO->setNumIdSistema($numIdSistema); | 1022 | $objDTO->setNumIdSistema($numIdSistema); |
1012 | $objDTO->setNumIdMenu($numIdMenu); | 1023 | $objDTO->setNumIdMenu($numIdMenu); |
1013 | - $objDTO->setStrRotulo('Mapeamento de Hipteses Legais'); | 1024 | + $objDTO->setStrRotulo('Mapeamento de Hipóteses Legais'); |
1014 | $objDTO->setNumMaxRegistrosRetorno(1); | 1025 | $objDTO->setNumMaxRegistrosRetorno(1); |
1015 | $objDTO->retNumIdItemMenu(); | 1026 | $objDTO->retNumIdItemMenu(); |
1016 | 1027 | ||
1017 | $objDTO = $objBD->consultar($objDTO); | 1028 | $objDTO = $objBD->consultar($objDTO); |
1018 | 1029 | ||
1019 | if(empty($objDTO)) { | 1030 | if(empty($objDTO)) { |
1020 | - throw new InfraException('Menu "Processo Eletrnico Nacional" no foi localizado'); | 1031 | + throw new InfraException('Menu "Processo Eletrônico Nacional" no foi localizado'); |
1021 | } | 1032 | } |
1022 | 1033 | ||
1023 | // Administrao > Mapeamento de Hipteses Legais de Envio > Envio | 1034 | // Administrao > Mapeamento de Hipteses Legais de Envio > Envio |
1024 | $numIdItemMenu = $this->criarMenu('Recebimento', 20, $objDTO->getNumIdItemMenu(), $numIdMenu, null, $numIdSistema); | 1035 | $numIdItemMenu = $this->criarMenu('Recebimento', 20, $objDTO->getNumIdItemMenu(), $numIdMenu, null, $numIdSistema); |
1025 | 1036 | ||
1026 | // Administrao > Mapeamento de Hipteses Legais de Envio > Envio > Cadastrar | 1037 | // Administrao > Mapeamento de Hipteses Legais de Envio > Envio > Cadastrar |
1027 | - $numIdRecurso = $this->criarRecurso('pen_map_hipotese_legal_recebido_alterar', 'Alterar de mapeamento de Hipteses Legais de Recebimento', $numIdSistema); | ||
1028 | - $numIdRecurso = $this->criarRecurso('pen_map_hipotese_legal_recebido_cadastrar', 'Cadastro de mapeamento de Hipteses Legais de Recebimento', $numIdSistema); | 1038 | + $numIdRecurso = $this->criarRecurso('pen_map_hipotese_legal_recebido_alterar', 'Alteração de mapeamento de Hipóteses Legais de Recebimento', $numIdSistema); |
1039 | + $numIdRecurso = $this->criarRecurso('pen_map_hipotese_legal_recebido_cadastrar', 'Cadastro de mapeamento de Hipóteses Legais de Recebimento', $numIdSistema); | ||
1029 | $this->criarMenu('Cadastrar', 10, $numIdItemMenu, $numIdMenu, $numIdRecurso, $numIdSistema); | 1040 | $this->criarMenu('Cadastrar', 10, $numIdItemMenu, $numIdMenu, $numIdRecurso, $numIdSistema); |
1030 | 1041 | ||
1031 | // Administrao > Mapeamento de Hipteses Legais de Envio > Envio > Listar | 1042 | // Administrao > Mapeamento de Hipteses Legais de Envio > Envio > Listar |
1032 | - $numIdRecurso = $this->criarRecurso('pen_map_hipotese_legal_recebido_excluir', 'Excluir mapeamento de Hipteses Legais de Recebimento', $numIdSistema); | ||
1033 | - $numIdRecurso = $this->criarRecurso('pen_map_hipotese_legal_recebido_listar', 'Listagem de mapeamento de Hipteses Legais de Recebimento', $numIdSistema); | 1043 | + $numIdRecurso = $this->criarRecurso('pen_map_hipotese_legal_recebido_excluir', 'Excluisão de mapeamento de Hipóteses Legais de Recebimento', $numIdSistema); |
1044 | + $numIdRecurso = $this->criarRecurso('pen_map_hipotese_legal_recebido_listar', 'Listagem de mapeamento de Hipóteses Legais de Recebimento', $numIdSistema); | ||
1034 | $this->criarMenu('Listar', 20, $numIdItemMenu, $numIdMenu, $numIdRecurso, $numIdSistema); | 1045 | $this->criarMenu('Listar', 20, $numIdItemMenu, $numIdMenu, $numIdRecurso, $numIdSistema); |
1035 | 1046 | ||
1036 | //Atribui as permisses aos recursos e menus | 1047 | //Atribui as permisses aos recursos e menus |
@@ -1045,20 +1056,20 @@ class PenAtualizarSipRN extends PenAtualizadorRN { | @@ -1045,20 +1056,20 @@ class PenAtualizarSipRN extends PenAtualizadorRN { | ||
1045 | $objDTO = new ItemMenuDTO(); | 1056 | $objDTO = new ItemMenuDTO(); |
1046 | $objDTO->setNumIdSistema($numIdSistema); | 1057 | $objDTO->setNumIdSistema($numIdSistema); |
1047 | $objDTO->setNumIdMenu($numIdMenu); | 1058 | $objDTO->setNumIdMenu($numIdMenu); |
1048 | - $objDTO->setStrRotulo('Mapeamento de Hipteses Legais'); | 1059 | + $objDTO->setStrRotulo('Mapeamento de Hipóteses Legais'); |
1049 | $objDTO->setNumMaxRegistrosRetorno(1); | 1060 | $objDTO->setNumMaxRegistrosRetorno(1); |
1050 | $objDTO->retNumIdItemMenu(); | 1061 | $objDTO->retNumIdItemMenu(); |
1051 | 1062 | ||
1052 | $objDTO = $objBD->consultar($objDTO); | 1063 | $objDTO = $objBD->consultar($objDTO); |
1053 | 1064 | ||
1054 | if(empty($objDTO)) { | 1065 | if(empty($objDTO)) { |
1055 | - throw new InfraException('Menu "Processo Eletrnico Nacional" no foi localizado'); | 1066 | + throw new InfraException('Menu "Processo Eletrônico Nacional" não foi localizado'); |
1056 | } | 1067 | } |
1057 | 1068 | ||
1058 | - $numIdRecurso = $this->criarRecurso('pen_map_hipotese_legal_padrao_cadastrar', 'Acesso ao formulrio de cadastro de mapeamento de Hipteses Legais Padro', $numIdSistema); | 1069 | + $numIdRecurso = $this->criarRecurso('pen_map_hipotese_legal_padrao_cadastrar', 'Acesso ao formulário de cadastro de mapeamento de Hipóteses Legais Padrão', $numIdSistema); |
1059 | 1070 | ||
1060 | - $this->criarMenu('Indicar Hiptese de Restrio Padro', 30, $objDTO->getNumIdItemMenu(), $numIdMenu, $numIdRecurso, $numIdSistema); | ||
1061 | - $this->criarRecurso('pen_map_hipotese_legal_padrao', 'Mtodo Cadastrar Padro da RN de mapeamento de Hipteses Legais', $numIdSistema); | 1071 | + $this->criarMenu('Indicar Hipótese de Restrição Padrão', 30, $objDTO->getNumIdItemMenu(), $numIdMenu, $numIdRecurso, $numIdSistema); |
1072 | + $this->criarRecurso('pen_map_hipotese_legal_padrao', 'Método Cadastrar Padrão da RN de mapeamento de Hipóteses Legais', $numIdSistema); | ||
1062 | $this->atribuirPerfil($numIdSistema); | 1073 | $this->atribuirPerfil($numIdSistema); |
1063 | 1074 | ||
1064 | /* altera o parâmetro da versão de banco */ | 1075 | /* altera o parâmetro da versão de banco */ |
@@ -1072,6 +1083,173 @@ class PenAtualizarSipRN extends PenAtualizadorRN { | @@ -1072,6 +1083,173 @@ class PenAtualizarSipRN extends PenAtualizadorRN { | ||
1072 | $objInfraParametroBD->alterar($objInfraParametroDTO); | 1083 | $objInfraParametroBD->alterar($objInfraParametroDTO); |
1073 | 1084 | ||
1074 | } | 1085 | } |
1086 | + | ||
1087 | + /** | ||
1088 | + * Instala/Atualiza os módulo PEN para versão 1.0.2 | ||
1089 | + */ | ||
1090 | + protected function instalarV102() { | ||
1091 | + | ||
1092 | + $objBD = new ItemMenuBD($this->inicializarObjInfraIBanco()); | ||
1093 | + | ||
1094 | + //---------------------------------------------------------------------- | ||
1095 | + // Achar o sistema | ||
1096 | + $numIdSistema = $this->getNumIdSistema('SEI'); | ||
1097 | + $numIdMenu = $this->getNumIdMenu('Principal', $numIdSistema); | ||
1098 | + | ||
1099 | + $objDTO = new ItemMenuDTO(); | ||
1100 | + $objDTO->setNumIdSistema($numIdSistema); | ||
1101 | + $objDTO->setNumIdMenu($numIdMenu); | ||
1102 | + $objDTO->setStrRotulo('Processo Eletrônico Nacional'); | ||
1103 | + $objDTO->setNumMaxRegistrosRetorno(1); | ||
1104 | + $objDTO->retNumIdItemMenu(); | ||
1105 | + | ||
1106 | + $objDTO = $objBD->consultar($objDTO); | ||
1107 | + | ||
1108 | + if(empty($objDTO)) { | ||
1109 | + throw new InfraException('Menu "Processo Eletrônico Nacional" não foi localizado'); | ||
1110 | + } | ||
1111 | + | ||
1112 | + // Administrao > Mapeamento de Hipteses Legais de Envio > Envio | ||
1113 | + $numIdItemMenu = $this->criarMenu('Mapeamento de Unidades', 20, $objDTO->getNumIdItemMenu(), $numIdMenu, null, $numIdSistema); | ||
1114 | + | ||
1115 | + // Cadastro do menu de administração parâmetros | ||
1116 | + $numIdRecurso = $this->criarRecurso('pen_parametros_configuracao', 'Parametros de Configuração', $numIdSistema); | ||
1117 | + $this->criarMenu('Parâmetros de Configuração', 20, $objDTO->getNumIdItemMenu(), $numIdMenu, $numIdRecurso, $numIdSistema); | ||
1118 | + | ||
1119 | + // Administrao > Mapeamento de Hipteses Legais de Envio > Envio > Cadastrar | ||
1120 | + $this->criarRecurso('pen_map_unidade_alterar', 'Alteração de mapeamento de Unidades', $numIdSistema); | ||
1121 | + $numIdRecurso = $this->criarRecurso('pen_map_unidade_cadastrar', 'Cadastro de mapeamento de Unidades', $numIdSistema); | ||
1122 | + $this->criarMenu('Cadastrar', 10, $numIdItemMenu, $numIdMenu, $numIdRecurso, $numIdSistema); | ||
1123 | + | ||
1124 | + // Administrao > Mapeamento de Hipteses Legais de Envio > Envio > Listar | ||
1125 | + $this->criarRecurso('pen_map_unidade_excluir', 'Exclusão de mapeamento de Unidades', $numIdSistema); | ||
1126 | + $numIdRecurso = $this->criarRecurso('pen_map_unidade_listar', 'Listagem de mapeamento de Unidades', $numIdSistema); | ||
1127 | + $this->criarMenu('Listar', 20, $numIdItemMenu, $numIdMenu, $numIdRecurso, $numIdSistema); | ||
1128 | + | ||
1129 | + | ||
1130 | + // ------------------ Atribui as permisses aos recursos e menus ----------------------// | ||
1131 | + $this->atribuirPerfil($numIdSistema); | ||
1132 | + | ||
1133 | + /* altera o parâmetro da versão de banco */ | ||
1134 | + $objInfraParametroDTO = new InfraParametroDTO(); | ||
1135 | + $objInfraParametroDTO->setStrNome($this->sip_versao); | ||
1136 | + $objInfraParametroDTO->retTodos(); | ||
1137 | + | ||
1138 | + $objInfraParametroBD = new InfraParametroBD($this->inicializarObjInfraIBanco()); | ||
1139 | + $objInfraParametroDTO = $objInfraParametroBD->consultar($objInfraParametroDTO); | ||
1140 | + $objInfraParametroDTO->setStrValor('1.0.2'); | ||
1141 | + $objInfraParametroBD->alterar($objInfraParametroDTO); | ||
1142 | + | ||
1143 | + } | ||
1144 | + | ||
1145 | + /** | ||
1146 | + * Instala/Atualiza os módulo PEN para versão 1.0.3 | ||
1147 | + */ | ||
1148 | + protected function instalarV103() { | ||
1149 | + $numIdSistema = $this->getNumIdSistema('SEI'); | ||
1150 | + | ||
1151 | + //Alterar rotulo do menu | ||
1152 | + $objDTO = new ItemMenuDTO(); | ||
1153 | + $objDTO->setStrRotulo('Indicar Hiptese de Restrio Padro'); | ||
1154 | + $objDTO->retNumIdItemMenu(); | ||
1155 | + $objDTO->retNumIdMenu(); | ||
1156 | + $objBD = new ItemMenuBD($this->getObjInfraIBanco()); | ||
1157 | + $objDTO = $objBD->consultar($objDTO); | ||
1158 | + $objDTO->setStrRotulo('Indicar Hipótese de Restrição Padrão'); | ||
1159 | + $objBD->alterar($objDTO); | ||
1160 | + | ||
1161 | + //Alterar nomeclatura do recurso | ||
1162 | + $objDTO = new RecursoDTO(); | ||
1163 | + $objDTO->setStrNome('pen_map_hipotese_legal_recebido_listar'); | ||
1164 | + $objDTO->retNumIdRecurso(); | ||
1165 | + $objBD = new RecursoBD($this->getObjInfraIBanco()); | ||
1166 | + $objDTO = $objBD->consultar($objDTO); | ||
1167 | + $objDTO->setStrNome('pen_map_hipotese_legal_recebimento_listar'); | ||
1168 | + $objDTO->setStrCaminho('controlador.php?acao=pen_map_hipotese_legal_recebimento_listar'); | ||
1169 | + $objBD->alterar($objDTO); | ||
1170 | + | ||
1171 | + //Alterar nomeclatura do recurso | ||
1172 | + $objDTO = new RecursoDTO(); | ||
1173 | + $objDTO->setStrNome('pen_map_hipotese_legal_recebido_excluir'); | ||
1174 | + $objDTO->retNumIdRecurso(); | ||
1175 | + $objBD = new RecursoBD($this->getObjInfraIBanco()); | ||
1176 | + $objDTO = $objBD->consultar($objDTO); | ||
1177 | + $objDTO->setStrNome('pen_map_hipotese_legal_recebimento_excluir'); | ||
1178 | + $objDTO->setStrCaminho('controlador.php?acao=pen_map_hipotese_legal_recebimento_excluir'); | ||
1179 | + $objBD->alterar($objDTO); | ||
1180 | + | ||
1181 | + //Alterar nomeclatura do recurso | ||
1182 | + $objDTO = new RecursoDTO(); | ||
1183 | + $objDTO->setStrNome('pen_map_hipotese_legal_recebido_cadastrar'); | ||
1184 | + $objDTO->retNumIdRecurso(); | ||
1185 | + $objBD = new RecursoBD($this->getObjInfraIBanco()); | ||
1186 | + $objDTO = $objBD->consultar($objDTO); | ||
1187 | + $objDTO->setStrNome('pen_map_hipotese_legal_recebimento_cadastrar'); | ||
1188 | + $objDTO->setStrCaminho('controlador.php?acao=pen_map_hipotese_legal_recebimento_cadastrar'); | ||
1189 | + $objBD->alterar($objDTO); | ||
1190 | + | ||
1191 | + //Alterar nomeclatura do recurso | ||
1192 | + $objDTO = new RecursoDTO(); | ||
1193 | + $objDTO->setStrNome('pen_map_hipotese_legal_recebido_alterar'); | ||
1194 | + $objDTO->retNumIdRecurso(); | ||
1195 | + $objBD = new RecursoBD($this->getObjInfraIBanco()); | ||
1196 | + $objDTO = $objBD->consultar($objDTO); | ||
1197 | + $objDTO->setStrNome('pen_map_hipotese_legal_recebimento_alterar'); | ||
1198 | + $objDTO->setStrCaminho('controlador.php?acao=pen_map_hipotese_legal_recebimento_alterar'); | ||
1199 | + $objBD->alterar($objDTO); | ||
1200 | + | ||
1201 | + //Alterar nomeclatura do recurso | ||
1202 | + $objDTO = new RecursoDTO(); | ||
1203 | + $objDTO->setStrNome('pen_map_hipotese_legal_enviado_listar'); | ||
1204 | + $objDTO->retNumIdRecurso(); | ||
1205 | + $objBD = new RecursoBD($this->getObjInfraIBanco()); | ||
1206 | + $objDTO = $objBD->consultar($objDTO); | ||
1207 | + $objDTO->setStrNome('pen_map_hipotese_legal_envio_listar'); | ||
1208 | + $objDTO->setStrCaminho('controlador.php?acao=pen_map_hipotese_legal_envio_listar'); | ||
1209 | + $objBD->alterar($objDTO); | ||
1210 | + | ||
1211 | + //Alterar nomeclatura do recurso | ||
1212 | + $objDTO = new RecursoDTO(); | ||
1213 | + $objDTO->setStrNome('pen_map_hipotese_legal_enviado_excluir'); | ||
1214 | + $objDTO->retNumIdRecurso(); | ||
1215 | + $objBD = new RecursoBD($this->getObjInfraIBanco()); | ||
1216 | + $objDTO = $objBD->consultar($objDTO); | ||
1217 | + $objDTO->setStrNome('pen_map_hipotese_legal_envio_excluir'); | ||
1218 | + $objDTO->setStrCaminho('controlador.php?acao=pen_map_hipotese_legal_envio_excluir'); | ||
1219 | + $objBD->alterar($objDTO); | ||
1220 | + | ||
1221 | + //Alterar nomeclatura do recurso | ||
1222 | + $objDTO = new RecursoDTO(); | ||
1223 | + $objDTO->setStrNome('pen_map_hipotese_legal_enviado_cadastrar'); | ||
1224 | + $objDTO->retNumIdRecurso(); | ||
1225 | + $objBD = new RecursoBD($this->getObjInfraIBanco()); | ||
1226 | + $objDTO = $objBD->consultar($objDTO); | ||
1227 | + $objDTO->setStrNome('pen_map_hipotese_legal_envio_cadastrar'); | ||
1228 | + $objDTO->setStrCaminho('controlador.php?acao=pen_map_hipotese_legal_envio_cadastrar'); | ||
1229 | + $objBD->alterar($objDTO); | ||
1230 | + | ||
1231 | + //Alterar nomeclatura do recurso | ||
1232 | + $objDTO = new RecursoDTO(); | ||
1233 | + $objDTO->setStrNome('pen_map_hipotese_legal_enviado_alterar'); | ||
1234 | + $objDTO->retNumIdRecurso(); | ||
1235 | + $objBD = new RecursoBD($this->getObjInfraIBanco()); | ||
1236 | + $objDTO = $objBD->consultar($objDTO); | ||
1237 | + $objDTO->setStrNome('pen_map_hipotese_legal_envio_alterar'); | ||
1238 | + $objDTO->setStrCaminho('controlador.php?acao=pen_map_hipotese_legal_envio_alterar'); | ||
1239 | + $objBD->alterar($objDTO); | ||
1240 | + | ||
1241 | + //Cadastrar recurso de alteração dos parâmetros | ||
1242 | + $this->criarRecurso('pen_parametros_configuracao_alterar', 'Alteração de parametros de configuração do módulo PEN', $numIdSistema); | ||
1243 | + | ||
1244 | + /* altera o parâmetro da versão de banco */ | ||
1245 | + $objInfraParametroDTO = new InfraParametroDTO(); | ||
1246 | + $objInfraParametroDTO->setStrNome($this->sip_versao); | ||
1247 | + $objInfraParametroDTO->retTodos(); | ||
1248 | + $objInfraParametroBD = new InfraParametroBD($this->inicializarObjInfraIBanco()); | ||
1249 | + $objInfraParametroDTO = $objInfraParametroBD->consultar($objInfraParametroDTO); | ||
1250 | + $objInfraParametroDTO->setStrValor('1.0.3'); | ||
1251 | + $objInfraParametroBD->alterar($objInfraParametroDTO); | ||
1252 | + } | ||
1075 | } | 1253 | } |
1076 | 1254 | ||
1077 | try { | 1255 | try { |