Commit bd5ccb3b848d2802fd0e9713725992d62c989191

Authored by Nei Jobson da Costa Carneiro
1 parent 2c13e033

Atualização dos códigos do módulo para avaliação do Guilherme Cantoni.

Showing 30 changed files with 1191 additions and 1199 deletions   Show diff stats
sei/web/modulos/peticionamento/PeticionamentoIntegracao.php
... ... @@ -142,7 +142,7 @@ class PeticionamentoIntegracao extends SeiIntegracao {
142 142 case 'md_pet_int_serie_cadastrar':
143 143 require_once dirname ( __FILE__ ).'/md_pet_int_serie_cadastro.php';
144 144 return true;
145   -
  145 +
146 146 }
147 147  
148 148 return false;
... ... @@ -165,7 +165,17 @@ class PeticionamentoIntegracao extends SeiIntegracao {
165 165 break;
166 166  
167 167 case 'tipo_processo_auto_completar':
168   - $arrObjTipoProcessoDTO = TipoProcedimentoINT::autoCompletarTipoProcedimento($_POST['palavras_pesquisa'] );
  168 + $arrObjTipoProcessoDTO = TipoProcedimentoINT::autoCompletarTipoProcedimento($_POST['palavras_pesquisa']);
  169 + $xml = InfraAjax::gerarXMLItensArrInfraDTO($arrObjTipoProcessoDTO,'IdTipoProcedimento', 'Nome');
  170 + break;
  171 +
  172 + case 'tipo_processo_auto_completar_intercorretne':
  173 + $arrObjTipoProcessoDTO = TipoProcessoPeticionamentoINT::autoCompletarTipoProcedimento($_POST['palavras_pesquisa'], $_POST['itens_selecionados'] );
  174 + $xml = InfraAjax::gerarXMLItensArrInfraDTO($arrObjTipoProcessoDTO,'IdTipoProcedimento', 'Nome');
  175 + break;
  176 +
  177 + case 'tipo_processo_auto_completar_com_assunto':
  178 + $arrObjTipoProcessoDTO = TipoProcedimentoINT::autoCompletarTipoProcessoComAssunto($_POST['palavras_pesquisa'] );
169 179 $xml = InfraAjax::gerarXMLItensArrInfraDTO($arrObjTipoProcessoDTO,'IdTipoProcedimento', 'Nome');
170 180 break;
171 181  
... ... @@ -180,6 +190,14 @@ class PeticionamentoIntegracao extends SeiIntegracao {
180 190 //$xml = InfraAjax::gerarXMLItensArrInfraDTO($arrObjUnidadeDTO,'IdUnidade', 'Sigla');
181 191 break;
182 192  
  193 + case 'nivel_acesso_validar':
  194 + $xml = TipoProcessoPeticionamentoINT::validarNivelAcesso($_POST);
  195 + break;
  196 +
  197 + case 'tipo_peticionamento_assunto_validar':
  198 + $xml = TipoProcessoPeticionamentoINT::validarTipoProcessoComAssunto($_POST);
  199 + break;
  200 +
183 201 //SEIv2
184 202 //case 'tipo_contexto_contato_listar':
185 203 //$arrObjTipoContextoDTO = GerirTipoContextoPeticionamentoINT::montarSelectNome(null, null, $_POST['txtPrincipal']);
... ... @@ -188,7 +206,7 @@ class PeticionamentoIntegracao extends SeiIntegracao {
188 206  
189 207 //Ajustes SEIV3
190 208 case 'tipo_contexto_contato_listar':
191   - $arrObjTipoContextoDTO = GerirTipoContextoPeticionamentoINT::montarSelectNome(null, null, $_POST['txtPrincipal']);
  209 + $arrObjTipoContextoDTO = GerirTipoContextoPeticionamentoINT::montarSelectNome(null, null, $_POST['extensao']);
192 210 $xml = InfraAjax::gerarXMLItensArrInfraDTO($arrObjTipoContextoDTO, 'IdTipoContato', 'Nome');
193 211 break;
194 212  
... ... @@ -783,5 +801,17 @@ class PeticionamentoIntegracao extends SeiIntegracao {
783 801  
784 802 }
785 803  
  804 + public function montarTipoTarjaAssinaturaCustomizada()
  805 + {
  806 + $objArrTipoDTO = array();
  807 +
  808 + $objTipoDTO = new TipoDTO();
  809 + $objTipoDTO->setStrStaTipo(AssinaturaPeticionamentoRN::$TT_ASSINATURA_SENHA_PETICIONAMENTO);
  810 + $objTipoDTO->setStrDescricao('Assinatura Eletrônica - Módulo de Peticionamento e Intimação Eletrônicos');
  811 + $objArrTipoDTO[] = $objTipoDTO;
  812 +
  813 + return $objArrTipoDTO;
  814 + }
  815 +
786 816 }
787 817 ?>
788 818 \ No newline at end of file
... ...
sei/web/modulos/peticionamento/criterio_intercorrente_peticionamento_cadastro.php
... ... @@ -12,7 +12,6 @@ try {
12 12 session_start();
13 13  
14 14 SessaoSEI::getInstance()->validarLink();
15   -
16 15 //PaginaSEI::getInstance()->verificarSelecao('criterio_intercorrente_peticionamento_cadastrar');
17 16  
18 17 //SessaoSEI::getInstance()->validarPermissao($_GET['acao']);
... ... @@ -22,6 +21,8 @@ try {
22 21 $arrComandos = array();
23 22 //Tipo Processo - Nivel de Acesso
24 23 $strLinkAjaxNivelAcesso = SessaoSEI::getInstance()->assinarLink('controlador_ajax.php?acao_ajax=nivel_acesso_auto_completar');
  24 + $strUrlAjaxValidarNivelAcesso = SessaoSEI::getInstance()->assinarLink('controlador_ajax.php?acao_ajax=nivel_acesso_validar');
  25 + $strUrlAjaxTipoPeticionamentoAssuntoValidar = SessaoSEI::getInstance()->assinarLink('controlador_ajax.php?acao_ajax=tipo_peticionamento_assunto_validar');
25 26  
26 27 //Tipo Documento Complementar
27 28 $strLinkTipoDocumentoSelecao = SessaoSEI::getInstance()->assinarLink('controlador.php?acao=serie_peticionamento_selecionar&filtro=1&tipo_selecao=2&id_object=objLupaTipoDocumento&tipoDoc=E');
... ... @@ -31,8 +32,11 @@ try {
31 32 $strLinkTipoDocumentoEssencialSelecao = SessaoSEI::getInstance()->assinarLink('controlador.php?acao=serie_peticionamento_selecionar&filtro=1&tipo_selecao=2&id_object=objLupaTipoDocumentoEssencial&tipoDoc=E');
32 33  
33 34 //Tipo Processo
34   - $strLinkTipoProcessoSelecao = SessaoSEI::getInstance()->assinarLink('controlador.php?acao=tipo_procedimento_selecionar&tipo_selecao=1&id_object=objLupaTipoProcesso');
35   - $strLinkAjaxTipoProcesso = SessaoSEI::getInstance()->assinarLink('controlador_ajax.php?acao_ajax=tipo_processo_auto_completar');
  35 + $strLinkTipoProcessoSelecao = SessaoSEI::getInstance()->assinarLink('controlador.php?acao=tipo_procedimento_selecionar&tipo_selecao=2&id_object=objLupaTipoProcesso');
  36 + $strLinkAjaxTipoProcesso = SessaoSEI::getInstance()->assinarLink('controlador_ajax.php?acao_ajax=tipo_processo_auto_completar_intercorretne');
  37 + if ($_GET['acao'] == 'criterio_intercorrente_peticionamento_alterar') {
  38 + $strLinkTipoProcessoSelecao = SessaoSEI::getInstance()->assinarLink('controlador.php?acao=tipo_procedimento_selecionar&tipo_selecao=1&id_object=objLupaTipoProcesso');
  39 + }
36 40  
37 41 //Unidade
38 42 $strLinkUnidadeSelecao = SessaoSEI::getInstance()->assinarLink('controlador.php?acao=unidade_selecionar_todas&tipo_selecao=1&id_object=objLupaUnidade');
... ... @@ -66,104 +70,85 @@ try {
66 70 $mutipla = false;
67 71 $arrObjUnidadesMultiplas = array();
68 72 $alterar = false;
69   -
  73 + $strTipoProcesso = '';
  74 + $valorParametroHipoteseLegal = '';
70 75 $strItensSelNivelAcesso = '';
71 76 $strItensSelHipoteseLegal = '';
72   - //$strItensSelHipoteseLegal = TipoProcessoPeticionamentoINT::montarSelectHipoteseLegal(null, null, ProtocoloRN::$NA_RESTRITO );
73   -
74   - //Preencher Array de Unidades para buscar posteriormente
75   - $objUnidadeDTO = new UnidadeDTO();
76   - $objUnidadeDTO->retNumIdContato();
77   - $objUnidadeDTO->retNumIdUnidade();
78   - $objUnidadeDTO->retStrSigla();
79   - $objUnidadeDTO->retStrDescricao();
80   - //seiv2
81   - //$objUnidadeDTO->retStrSiglaUf();
82   -
83   - //alteracoes seiv3
84   - $contatoRN = new ContatoRN();
85   - $objUnidadeRN = new UnidadeRN();
86   -
87   - $arrObjUnidadeDTO = $objUnidadeRN->listarTodasComFiltro($objUnidadeDTO);
88   -
89   - foreach ($arrObjUnidadeDTO as $key => $objUnidadeDTO) {
90   -
91   - $arrObjUnidadeDTOFormatado[$objUnidadeDTO->getNumIdUnidade()]['sigla'] = $objUnidadeDTO->getStrSigla();
92   - $arrObjUnidadeDTOFormatado[$objUnidadeDTO->getNumIdUnidade()]['descricao'] = utf8_encode($objUnidadeDTO->getStrDescricao());
93   -
94   - $contatoDTO = new ContatoDTO();
95   - $contatoDTO->retNumIdContato();
96   - $contatoDTO->retStrSiglaUf();
97   - $contatoDTO->setNumIdContato( $objUnidadeDTO->getNumIdContato() );
98   -
99   - $contatoDTO = $contatoRN->consultarRN0324( $contatoDTO );
100   -
101   - //seiv2
102   - //$arrObjUnidadeDTOFormatado[$objUnidadeDTO->getNumIdUnidade()]['uf'] = $objUnidadeDTO->getStrSiglaUf();
103   -
104   - //alteracoes seiv3
105   - $arrObjUnidadeDTOFormatado[$objUnidadeDTO->getNumIdUnidade()]['uf'] = $contatoDTO->getStrSiglaUf();
106   -
107   - }
  77 + $strItensSelHipoteseLegal = TipoProcessoPeticionamentoINT::montarSelectHipoteseLegal(null, null, ProtocoloRN::$NA_RESTRITO );
  78 + $optionTemplate = '<option value="%s" %s>%s</option>';
  79 + $arrNivelAcesso = array(
  80 + 'P' => 'Público',
  81 + 'I' => 'Restrito'
  82 + );
  83 + foreach($arrNivelAcesso as $i => $nivelAcesso){
  84 + $selected = '';
  85 + $strItensSelNivelAcesso .= sprintf($optionTemplate, $i, $selected, $nivelAcesso);
  86 + }
  87 +
  88 + $objInfraParametroDTO = new InfraParametroDTO();
  89 + $objInfraParametroDTO->retTodos();
  90 + $objInfraParametroDTO->setStrNome('SEI_HABILITAR_HIPOTESE_LEGAL');
  91 + $objMdPetParametroRN = new MdPetParametroRN();
  92 + $objInfraParametroDTO = $objMdPetParametroRN->consultar($objInfraParametroDTO);
  93 + $valorParametroHipoteseLegal = $objInfraParametroDTO->getStrValor();
  94 +
  95 + if( in_array($_GET['acao'], array('criterio_intercorrente_peticionamento_cadastrar', 'criterio_intercorrente_peticionamento_consultar', 'criterio_intercorrente_peticionamento_alterar'))){
  96 +
  97 + if (isset($_REQUEST['id_criterio_intercorrente_peticionamento']) || isset($_POST['hdnIdTipoProcesso'])){
  98 + if (isset($_REQUEST['id_criterio_intercorrente_peticionamento'])){
  99 + $alterar = true;
  100 + $objCriterioIntercorrentePeticionamentoDTO = new CriterioIntercorrentePeticionamentoDTO();
  101 + $objCriterioIntercorrentePeticionamentoDTO->setNumIdCriterioIntercorrentePeticionamento($_GET['id_criterio_intercorrente_peticionamento']);
  102 + $objCriterioIntercorrentePeticionamentoDTO->retStrNomeProcesso();
  103 + $objCriterioIntercorrentePeticionamentoDTO->retTodos(true);
  104 +
  105 + $objCriterioIntercorrentePeticionamentoRN = new CriterioIntercorrentePeticionamentoRN();
  106 + $objCriterioIntercorrentePeticionamentoDTO = $objCriterioIntercorrentePeticionamentoRN->consultar($objCriterioIntercorrentePeticionamentoDTO);
  107 + $IdCriterioIntercorrentePeticionamento = $_REQUEST['id_criterio_intercorrente_peticionamento'];
  108 + $nomeTipoProcesso = $objCriterioIntercorrentePeticionamentoDTO->getStrNomeProcesso();
  109 + $idTipoProcesso = $objCriterioIntercorrentePeticionamentoDTO->getNumIdTipoProcedimento();
  110 + //$strItensSelNivelAcesso = TipoProcessoPeticionamentoINT::montarSelectNivelAcesso(null, null, $objCriterioIntercorrentePeticionamentoDTO->getStrStaNivelAcesso(), $idTipoProcesso);
  111 + } else {
  112 + if (isset($_POST['hdnIdTipoProcesso'])) {
  113 +
  114 + $objCriterioIntercorrentePeticionamentoDTO = new CriterioIntercorrentePeticionamentoDTO();
  115 + $objCriterioIntercorrentePeticionamentoDTO->setStrStaNivelAcesso($_POST['rdNivelAcesso'][0]);
  116 + $objCriterioIntercorrentePeticionamentoDTO->setNumIdHipoteseLegal($_POST['selHipoteseLegal']);
  117 +
  118 + if (isset($_POST['selNivelAcesso']) && !empty($_POST['selNivelAcesso']) && $_POST['rdNivelAcesso'][0] == '2') {
  119 + $strStaTipoNivelAcesso = $_POST['selNivelAcesso'];
  120 + if ($_POST['selNivelAcesso'] == 'I') {
  121 + $objCriterioIntercorrentePeticionamentoDTO->setNumIdHipoteseLegal($_POST['selHipoteseLegal']);
  122 + }
  123 + $objCriterioIntercorrentePeticionamentoDTO->setStrStaTipoNivelAcesso($strStaTipoNivelAcesso);
  124 + }
  125 +
  126 + $idTipoProcesso = $_POST['hdnIdTipoProcesso'];
  127 + $arrHdnIdTipoProcesso = PaginaSEI::getInstance()->getArrItensTabelaDinamica($_POST['hdnIdTipoProcesso']);
  128 + foreach($arrHdnIdTipoProcesso as $tipoProcesso) {
  129 + $strTipoProcesso .= sprintf($optionTemplate, $tipoProcesso[0], 'selected="selected"', $tipoProcesso[1]);
  130 + }
  131 + }
  132 + }
108 133  
109   - $objInfraParametroDTO = new InfraParametroDTO();
110   - $objInfraParametroRN = new InfraParametroRN();
111   - $objInfraParametroDTO->retTodos();
112   - $objInfraParametroDTO->setStrNome('SEI_HABILITAR_HIPOTESE_LEGAL');
113   - $objInfraParametroDTO = $objInfraParametroRN->consultar($objInfraParametroDTO);
114   - $valorParametroHipoteseLegal = $objInfraParametroDTO->getStrValor();
115   -
116   - if($_GET['acao'] === 'criterio_intercorrente_peticionamento_cadastrar'){
117   - $nivelAcessoTemplate = '<option value="%s" %s>%s</option>';
118   - $arrNivelAcesso = array(
119   - 'P' => 'Público',
120   - 'I' => 'Restrito'
121   - );
122   - $strItensSelNivelAcesso = '';
123   - foreach($arrNivelAcesso as $i => $nivelAcesso){
124   - $strItensSelNivelAcesso .= sprintf($nivelAcessoTemplate, $i, '', $nivelAcesso);
125   - }
  134 +// $sinCriterioPadrao = $objCriterioIntercorrentePeticionamentoDTO->getStrSinCriterioPadrao() == 'S' ? 'checked = checked' : '';
  135 + $sinNAUsuExt = $objCriterioIntercorrentePeticionamentoDTO->getStrStaNivelAcesso() == 1 ? 'checked = checked' : '';
  136 + $sinNAPadrao = $objCriterioIntercorrentePeticionamentoDTO->getStrStaNivelAcesso() == 2 ? 'checked = checked' : '';
  137 + if ($objCriterioIntercorrentePeticionamentoDTO->getStrStaNivelAcesso() == 2) {
  138 + $hipoteseLegal = $objCriterioIntercorrentePeticionamentoDTO->getStrStaTipoNivelAcesso() === 'I' && $valorParametroHipoteseLegal != '0' ? 'style="display:inherit"' : 'style="display:none"';
126 139  
127   - }
  140 + }
128 141  
129   - if($_GET['acao'] === 'criterio_intercorrente_peticionamento_consultar' || $_GET['acao'] === 'criterio_intercorrente_peticionamento_alterar'){
130   -
131   - if (isset($_GET['id_criterio_intercorrente_peticionamento'])){
132   - $alterar = true;
133   - $objCriterioIntercorrentePeticionamentoDTO = new CriterioIntercorrentePeticionamentoDTO();
134   - $objCriterioIntercorrentePeticionamentoDTO->setNumIdCriterioIntercorrentePeticionamento($_GET['id_criterio_intercorrente_peticionamento']);
135   - $objCriterioIntercorrentePeticionamentoDTO->retTodos(true);
136   - $objCriterioIntercorrentePeticionamentoDTO->retStrNomeProcesso();
137   -
138   - $objCriterioIntercorrentePeticionamentoRN = new CriterioIntercorrentePeticionamentoRN();
139   - $objCriterioIntercorrentePeticionamentoDTO = $objCriterioIntercorrentePeticionamentoRN->consultar($objCriterioIntercorrentePeticionamentoDTO);
140   -
141   - $strItensSelHipoteseLegal = TipoProcessoPeticionamentoINT::montarSelectHipoteseLegal(null, null, $objCriterioIntercorrentePeticionamentoDTO->getNumIdHipoteseLegal() );
142   -
143   - $IdCriterioIntercorrentePeticionamento = $_GET['id_criterio_intercorrente_peticionamento'];
144   - $nomeTipoProcesso = $objCriterioIntercorrentePeticionamentoDTO->getStrNomeProcesso();
145   - $idTipoProcesso = $objCriterioIntercorrentePeticionamentoDTO->getNumIdTipoProcedimento();
146   - $sinCriterioPadrao = $objCriterioIntercorrentePeticionamentoDTO->getStrSinCriterioPadrao() == 'S' ? 'checked = checked' : '';
147   - $sinNAUsuExt = $objCriterioIntercorrentePeticionamentoDTO->getStrStaNivelAcesso() == 1 ? 'checked = checked' : '';
148   - $sinNAPadrao = $objCriterioIntercorrentePeticionamentoDTO->getStrStaNivelAcesso() == 2 ? 'checked = checked' : '';
149   - $hipoteseLegal = $objCriterioIntercorrentePeticionamentoDTO->getStrStaTipoNivelAcesso() === 'I' && $valorParametroHipoteseLegal != '0' ? 'style="display:inherit"' : 'style="display:none"';
150   -
151   - //$strItensSelNivelAcesso = TipoProcessoPeticionamentoINT::montarSelectNivelAcesso(null, null, $objCriterioIntercorrentePeticionamentoDTO->getStrStaNivelAcesso(), $idTipoProcesso);
152   -
153   - $nivelAcessoTemplate = '<option value="%s" %s>%s</option>';
154   - $arrNivelAcesso = array(
155   - 'P' => 'Público',
156   - 'I' => 'Restrito'
157   - );
158   - $strItensSelNivelAcesso = sprintf($nivelAcessoTemplate, $objCriterioIntercorrentePeticionamentoDTO->getStrStaTipoNivelAcesso(), '', $arrNivelAcesso[$objCriterioIntercorrentePeticionamentoDTO->getStrStaTipoNivelAcesso()]);
159   - if ($_GET['acao'] == 'criterio_intercorrente_peticionamento_alterar') {
160   - $strItensSelNivelAcesso = '';
161   - foreach($arrNivelAcesso as $i => $nivelAcesso){
162   - $selected = ($i == $objCriterioIntercorrentePeticionamentoDTO->getStrStaTipoNivelAcesso()) ? ' selected="selected" ': '';
163   - $strItensSelNivelAcesso .= sprintf($nivelAcessoTemplate, $i, $selected, $nivelAcesso);
164   - }
165   - }
166   - }
  142 + $strItensSelHipoteseLegal = TipoProcessoPeticionamentoINT::montarSelectHipoteseLegal(null, null, $objCriterioIntercorrentePeticionamentoDTO->getNumIdHipoteseLegal() );
  143 + $strItensSelNivelAcesso = '';
  144 + foreach($arrNivelAcesso as $i => $nivelAcesso){
  145 + $selected = '';
  146 + if ($objCriterioIntercorrentePeticionamentoDTO->getStrStaNivelAcesso() == '2') {
  147 + $selected = ($i == $objCriterioIntercorrentePeticionamentoDTO->getStrStaTipoNivelAcesso()) ? ' selected="selected" ': '';
  148 + }
  149 + $strItensSelNivelAcesso .= sprintf($optionTemplate, $i, $selected, $nivelAcesso);
  150 + }
  151 + }
167 152 }
168 153  
169 154 switch ($_GET['acao']) {
... ... @@ -171,19 +156,57 @@ try {
171 156 $strTitulo = 'Consultar Critério Intercorrente';
172 157 $arrComandos[] = '<button type="button" accesskey="c" name="btnCancelar" id="btnCancelar" value="Cancelar" onclick="location.href=\''.PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.PaginaSEI::getInstance()->getAcaoRetorno().'&acao_origem='.$_GET['acao'].PaginaSEI::getInstance()->montarAncora($_GET['id_criterio_intercorrente_peticionamento']))).'\';" class="infraButton"><span class="infraTeclaAtalho">C</span>ancelar</button>';
173 158  
174   - $strItensSelTipoProcesso = TipoProcessoPeticionamentoINT::montarSelectTipoProcesso(null, null, $_POST['selTipoProcesso']);
175   - $strItensSelDoc = SerieINT::montarSelectNomeRI0802(null, null, $_POST['selDocumento']);
  159 + //$strItensSelTipoProcesso = TipoProcessoPeticionamentoINT::montarSelectTipoProcesso(null, null, $_POST['selTipoProcesso']);
  160 + //$strItensSelDoc = SerieINT::montarSelectNomeRI0802(null, null, $_POST['selDocumento']);
176 161 break;
177 162 case 'criterio_intercorrente_peticionamento_alterar':
178   - $strTitulo = 'Alterar Critério para intercorrente';
  163 + $strTitulo = 'Alterar Critério para Intercorrente';
179 164 $arrComandos[] = '<button type="submit" accesskey="s" name="sbmAlterarCriterio" id="sbmAlterarCriterio" value="Salvar" class="infraButton"><span class="infraTeclaAtalho">S</span>alvar</button>';
180 165 $arrComandos[] = '<button type="button" accesskey="c" name="btnCancelar" id="btnCancelar" value="Cancelar" onclick="location.href=\''.PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink('controlador.php?acao='.PaginaSEI::getInstance()->getAcaoRetorno().'&acao_origem='.$_GET['acao'].PaginaSEI::getInstance()->montarAncora($_GET['id_criterio_intercorrente_peticionamento']))).'\';" class="infraButton"><span class="infraTeclaAtalho">C</span>ancelar</button>';
181 166  
182 167 if (isset($_POST['sbmAlterarCriterio'])) {
  168 + /*
  169 + $id = $_POST['hdnIdCriterioIntercorrentePeticionamento'];
  170 + $objCriterioIntercorrentePeticionamentoDTO = new CriterioIntercorrentePeticionamentoDTO();
  171 + $objCriterioIntercorrentePeticionamentoDTO->setNumIdCriterioIntercorrentePeticionamento($id);
  172 + $objCriterioIntercorrentePeticionamentoDTO->retTodos(true);
  173 + $objCriterioIntercorrentePeticionamentoDTO->retStrNomeProcesso();
  174 +
  175 + $objCriterioIntercorrentePeticionamentoRN = new CriterioIntercorrentePeticionamentoRN();
  176 + $objCriterioIntercorrentePeticionamentoDTO = $objCriterioIntercorrentePeticionamentoRN->consultar($objCriterioIntercorrentePeticionamentoDTO);
  177 +
  178 + //$strItensSelHipoteseLegal = TipoProcessoPeticionamentoINT::montarSelectHipoteseLegal(null, null, $objCriterioIntercorrentePeticionamentoDTO->getNumIdHipoteseLegal() );
  179 +
  180 + $IdCriterioIntercorrentePeticionamento = $id;
  181 + $nomeTipoProcesso = $objCriterioIntercorrentePeticionamentoDTO->getStrNomeProcesso();
  182 + $idTipoProcesso = $objCriterioIntercorrentePeticionamentoDTO->getNumIdTipoProcedimento();
  183 + $sinCriterioPadrao = $objCriterioIntercorrentePeticionamentoDTO->getStrSinCriterioPadrao() == 'S' ? 'checked = checked' : '';
  184 + $sinNAUsuExt = $objCriterioIntercorrentePeticionamentoDTO->getStrStaNivelAcesso() == 1 ? 'checked = checked' : '';
  185 + $sinNAPadrao = $objCriterioIntercorrentePeticionamentoDTO->getStrStaNivelAcesso() == 2 ? 'checked = checked' : '';
  186 + $hipoteseLegal = $objCriterioIntercorrentePeticionamentoDTO->getStrStaTipoNivelAcesso() === 'I' && $valorParametroHipoteseLegal != '0' ? 'style="display:inherit"' : 'style="display:none"';
  187 +
  188 + //$strItensSelNivelAcesso = TipoProcessoPeticionamentoINT::montarSelectNivelAcesso(null, null, $objCriterioIntercorrentePeticionamentoDTO->getStrStaNivelAcesso(), $idTipoProcesso);
  189 +
  190 + $nivelAcessoTemplate = '<option value="%s" %s>%s</option>';
  191 + $arrNivelAcesso = array(
  192 + 'P' => 'Público',
  193 + 'I' => 'Restrito'
  194 + );
  195 + $strItensSelNivelAcesso = sprintf($nivelAcessoTemplate, $objCriterioIntercorrentePeticionamentoDTO->getStrStaTipoNivelAcesso(), '', $arrNivelAcesso[$objCriterioIntercorrentePeticionamentoDTO->getStrStaTipoNivelAcesso()]);
  196 + $strTipoProcesso = sprintf($nivelAcessoTemplate, $idTipoProcesso, 'selected="selected"', $nomeTipoProcesso);
  197 + if ($_GET['acao'] == 'criterio_intercorrente_peticionamento_alterar') {
  198 + $strItensSelNivelAcesso = '';
  199 + foreach($arrNivelAcesso as $i => $nivelAcesso){
  200 + $selected = ($i == $objCriterioIntercorrentePeticionamentoDTO->getStrStaTipoNivelAcesso()) ? ' selected="selected" ': '';
  201 + $strItensSelNivelAcesso .= sprintf($nivelAcessoTemplate, $i, $selected, $nivelAcesso);
  202 + }
  203 + }
  204 + */
183 205 $objCriterioIntercorrentePeticionamentoDTO = new CriterioIntercorrentePeticionamentoDTO();
184 206 $objCriterioIntercorrentePeticionamentoDTO->setStrStaNivelAcesso($_POST['rdNivelAcesso'][0]);
185 207 $objCriterioIntercorrentePeticionamentoDTO->setNumIdHipoteseLegal($_POST['selHipoteseLegal']);
186 208 $objCriterioIntercorrentePeticionamentoDTO->setNumIdTipoProcedimento($_POST['hdnIdTipoProcesso']);
  209 + $objCriterioIntercorrentePeticionamentoDTO->setStrSinCriterioPadrao('N');
187 210 $objCriterioIntercorrentePeticionamentoDTO->setNumIdCriterioIntercorrentePeticionamento($_POST['hdnIdCriterioIntercorrentePeticionamento']);
188 211 if (isset($_POST['selNivelAcesso'])) {
189 212 $objCriterioIntercorrentePeticionamentoDTO->setStrStaTipoNivelAcesso($_POST['selNivelAcesso']);
... ... @@ -196,10 +219,10 @@ try {
196 219 case 'criterio_intercorrente_peticionamento_cadastrar':
197 220 case 'criterio_intercorrente_peticionamento_padrao':
198 221  
199   - $strItensSelHipoteseLegal = TipoProcessoPeticionamentoINT::montarSelectHipoteseLegal(null, null, null);
  222 + //$strItensSelHipoteseLegal = TipoProcessoPeticionamentoINT::montarSelectHipoteseLegal(null, null, null);
200 223  
201 224 //Carregando campos select
202   - $strItensSelTipoProcesso = TipoProcessoPeticionamentoINT::montarSelectTipoProcesso(null, null, $_POST['selTipoProcesso']);
  225 + //$strItensSelTipoProcesso = TipoProcessoPeticionamentoINT::montarSelectTipoProcesso(null, null, $_POST['selTipoProcesso']);
203 226  
204 227 $arrComandos[] = '<button type="submit" accesskey="s" name="sbmCadastrarTpProcessoPeticionamento" id="sbmCadastrarTpProcessoPeticionamento" value="Salvar" class="infraButton"><span class="infraTeclaAtalho">S</span>alvar</button>';
205 228 $arrComandos[] = '<button type="button" accesskey="c" name="btnCancelar" id="btnCancelar" value="Cancelar" onclick="location.href=\'' . PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink('controlador.php?acao=' . PaginaSEI::getInstance()->getAcaoRetorno() . '&acao_origem=' . $_GET['acao'])) . '\';" class="infraButton"><span class="infraTeclaAtalho">C</span>ancelar</button>';
... ... @@ -214,23 +237,32 @@ try {
214 237 $objCriterioIntercorrentePeticionamentoDTO = new CriterioIntercorrentePeticionamentoDTO();
215 238 $objCriterioIntercorrentePeticionamentoDTO->setStrStaNivelAcesso($_POST['rdNivelAcesso'][0]);
216 239 $objCriterioIntercorrentePeticionamentoDTO->setNumIdHipoteseLegal($_POST['selHipoteseLegal']);
217   - $objCriterioIntercorrentePeticionamentoDTO->setNumIdTipoProcedimento($_POST['hdnIdTipoProcesso']);
  240 + $objCriterioIntercorrentePeticionamentoDTO->setNumIdCriterioIntercorrentePeticionamento('');
218 241  
219   - if (isset($_POST['selNivelAcesso'])) {
220   - $strStaTipoNivelAcesso = 'I';
221   - if ($_POST['selNivelAcesso'] == 0) {
222   - $strStaTipoNivelAcesso = 'P';
223   - }
224   - $objCriterioIntercorrentePeticionamentoDTO->setStrStaTipoNivelAcesso($strStaTipoNivelAcesso);
225   - }
  242 + if (isset($_POST['selNivelAcesso']) && !empty($_POST['selNivelAcesso']) && $_POST['rdNivelAcesso'][0] == '2') {
  243 + $strStaTipoNivelAcesso = $_POST['selNivelAcesso'];
  244 + if ($_POST['selNivelAcesso'] == 'I') {
  245 + $objCriterioIntercorrentePeticionamentoDTO->setNumIdHipoteseLegal($_POST['selHipoteseLegal']);
  246 + }
  247 + $objCriterioIntercorrentePeticionamentoDTO->setStrStaTipoNivelAcesso($strStaTipoNivelAcesso);
  248 + }
226 249  
227   - $objCriterioIntercorrentePeticionamentoRN = new CriterioIntercorrentePeticionamentoRN();
  250 + $objCriterioIntercorrentePeticionamentoRN = new CriterioIntercorrentePeticionamentoRN();
228 251 if ($_GET['acao'] == 'criterio_intercorrente_peticionamento_padrao') {
229 252 $objCriterioIntercorrentePeticionamentoRN->cadastrarPadrao($objCriterioIntercorrentePeticionamentoDTO);
230 253 } else {
231   - $objCriterioIntercorrentePeticionamentoRN->cadastrar($objCriterioIntercorrentePeticionamentoDTO);
  254 + if(empty($_POST['hdnIdTipoProcesso'])){
  255 + $objCriterioIntercorrentePeticionamentoDTO->setNumIdTipoProcedimento($_POST['selTipoProcesso']);
  256 + $objCriterioIntercorrentePeticionamentoRN->cadastrar($objCriterioIntercorrentePeticionamentoDTO);
  257 + } else {
  258 + $arrTipoProcesso = PaginaSEI::getInstance()->getArrValuesSelect($_POST['hdnIdTipoProcesso']);
  259 + foreach($arrTipoProcesso as $numTipoProcesso){
  260 + $objCriterioIntercorrentePeticionamentoDTO->setNumIdTipoProcedimento($numTipoProcesso);
  261 + $objCriterioIntercorrentePeticionamentoRN->cadastrar($objCriterioIntercorrentePeticionamentoDTO);
  262 + }
  263 + }
232 264 }
233   - header('Location: ' . SessaoSEI::getInstance()->assinarLink('controlador.php?acao=' . PaginaSEI::getInstance()->getAcaoRetorno() . '&acao_origem=' . $_GET['acao'] . '&id_criterio_intercorrente_peticionamento=' . $objCriterioIntercorrentePeticionamentoDTO->getNumIdCriterioIntercorrentePeticionamento() . PaginaSEI::getInstance()->montarAncora($objCriterioIntercorrentePeticionamentoDTO->getNumIdCriterioIntercorrentePeticionamento()) ));
  265 + header('Location: ' . SessaoSEI::getInstance()->assinarLink('controlador.php?acao=' . PaginaSEI::getInstance()->getAcaoRetorno() . '&acao_origem=' . $_GET['acao'] ));
234 266 }
235 267 break;
236 268 default:
... ... @@ -255,422 +287,76 @@ PaginaSEI::getInstance()-&gt;abrirJavaScript();
255 287 PaginaSEI::getInstance()->fecharJavaScript();
256 288 ?>
257 289  
258   -
259 290 <style type="text/css">
260   - <?php
261   - $browser = $_SERVER['HTTP_USER_AGENT'];
262   - $firefox = strpos($browser, 'Firefox') ? true : false;
263   - ?>
264   -
265   - #lblTipoProcesso {
266   - position: absolute;
267   - left: 0%;
268   - top: 2px;
269   - width: 50%;
270   - }
271   -
272   - #txtTipoProcesso {
273   - position: absolute;
274   - left: 0%;
275   - top: 18px;
276   - width: 50%;
277   - }
278   -
279   - #fldProrrogacao {
280   - height: 20%;
281   - width: 86%;
282   - }
283   -
284   - <?php if($firefox): ?>
285   -
286   - .sizeFieldset {
287   - height: 30%;
288   - width: 86%;
289   - }
290   -
291   - .tamanhoFieldset {
292   - height: auto;
293   - width: 86%;
294   - }
295   -
296   - #divIndicacaoInteressado {
297   - }
298   -
299   - #divUnidade {
300   - margin-top: 138px !important;
301   - }
302   -
303   - #imgLupaTipoProcesso {
304   - position: absolute;
305   - left: 51%;
306   - top: 18px;
307   - }
308   -
309   - #imgExcluirTipoProcesso {
310   - position: absolute;
311   - left: 53.6%;
312   - top: 18px;
313   - }
314   -
315   - #lblUnidade {
316   - position: absolute;
317   - left: 0%;
318   - width: 50%;
319   - }
320   -
321   - #txtUnidade {
322   - left: 12px;
323   - width: 65%;
324   - margin-top: 0.5%;
325   - }
326   -
327   - #imgLupaUnidade {
328   - position: absolute;
329   - left: 51%;
330   - margin-top: 0.5%;
331   - }
332   -
333   - #imgExcluirUnidade {
334   - position: absolute;
335   - left: 52.7%;
336   - margin-top: 0.5%;
337   - }
338   -
339   - #txtUnidadeMultipla {
340   - left: 12px;
341   - width: 65%;
342   - margin-top: 0.5%;
343   - }
344   -
345   - #imgLupaUnidadeMultipla {
346   - position: absolute;
347   - left: 51%;
348   - margin-top: 0.5%;
349   - }
350   -
351   - #sbmAdicionarUnidade {
352   - position: absolute;
353   - left: 53.7%;
354   - margin-top: 0.5%;
355   - }
356   -
357   - #lblOrientacoes {
358   - position: absolute;
359   - left: 0%;
360   - top: 50px;
361   - width: 20%;
362   - }
363   -
364   - #txtOrientacoes {
365   - position: absolute;
366   - left: 0%;
367   - top: 66px;
368   - width: 75%;
369   - }
370   -
371   - #lblNivelAcesso {
372   - width: 50%;
373   - }
374   -
375   - #selNivelAcesso {
376   - width: 20%;
377   - }
378   -
379   - #lblHipoteseLegal {
380   - width: 50%;
381   - }
382   -
383   - #selHipoteseLegal {
384   - width: 50%;
385   - }
386   -
387   - #lblModelo {
388   - width: 50%;
389   - }
390   -
391   - #selModelo {
392   - width: 40%;
393   - }
394   -
395   - #lblTipoDocPrincipal {
396   - width: 50%;
397   - }
398   -
399   - #txtTipoDocPrinc {
400   - width: 39.5%;
401   - }
402   -
403   - #imgLupaTipoDocPrinc {
404   - top: 198%
405   - }
406   -
407   - #imgExcluirTipoDocPrinc {
408   - top: 198%
409   - }
410   -
411   - #txtSerie {
412   - width: 50%;
413   - }
414   -
415   - #lblDescricao {
416   - width: 50%;
417   - }
418   -
419   - #selDescricao {
420   - width: 75%;
421   - }
422   -
423   - #imgLupaTipoDocumento {
424   - margin-top: 2px;
425   - margin-left: 4px;
426   - }
427   -
428   - #txtSerieEssencial {
429   - width: 50%;
430   - }
431   -
432   - #lblDescricaoEssencial {
433   - width: 50%;
434   - }
435   -
436   - #selDescricaoEssencial {
437   - width: 75%;
438   - }
439   -
440   - #imgLupaTipoDocumentoEssencial {
441   - margin-top: 2px;
442   - margin-left: 4px;
443   - }
444   -
445   - .fieldNone {
446   - border: none !important;
447   - }
448   -
449   - .sizeFieldset#fldDocPrincipal {
450   - height: 50% !important;
451   - }
452   -
453   - <?php else: ?>
454   - .sizeFieldset {
455   - height: 30%;
456   - width: 86%;
457   - }
458   -
459   - .tamanhoFieldset {
460   - height: auto;
461   - width: 86%;
462   - }
463   -
464   - #divIndicacaoInteressado {
465   - }
466   -
467   - #imgLupaTipoProcesso {
468   - position: absolute;
469   - left: 51%;
470   - top: 18px;
471   - }
472   -
473   - #imgExcluirTipoProcesso {
474   - position: absolute;
475   - left: 53.1%;
476   - top: 18px;
477   - }
478   -
479   - #divUnidade {
480   - margin-top: 111px !important;
481   - }
482   -
483   - #lblUnidade {
484   - left: 0%;
485   - top: 15.7%;
486   - width: 65%;
487   - }
488   -
489   - #txtUnidade {
490   - left: 0%;
491   - top: 17.6%;
492   - width: 65%;
493   - margin-top: 0.5%;
494   - }
495   -
496   - #imgLupaUnidade {
497   - position: absolute;
498   - left: 50.4%;
499   - }
500   -
501   - #imgExcluirUnidade {
502   - position: absolute;
503   - left: 52.1%;
504   - }
505   -
506   - #txtUnidadeMultipla {
507   - left: 12px;
508   - width: 65%;
509   - margin-top: 0.5%;
510   - }
511   -
512   - #imgLupaUnidadeMultipla {
513   - position: absolute;
514   - left: 50.5%;
515   - margin-top: 0.5%;
516   - }
517   -
518   - #sbmAdicionarUnidade {
519   - position: absolute;
520   - left: 53.2%;
521   - margin-top: 0.5%;
522   - }
523   -
524   - #lblOrientacoes {
525   - position: absolute;
526   - left: 0%;
527   - top: 50px;
528   - width: 20%;
529   - }
530   -
531   - #txtOrientacoes {
532   - position: absolute;
533   - left: 0%;
534   - top: 66px;
535   - width: 75%;
536   - }
537   -
538   - #lblNivelAcesso {
539   - width: 50%;
540   - }
541   -
542   - #selNivelAcesso {
543   - width: 20%;
544   - }
545   -
546   - #lblHipoteseLegal {
547   - width: 50%;
548   - }
549   -
550   - #selHipoteseLegal {
551   - width: 50%;
552   - }
553   -
554   - #lblModelo {
555   - width: 50%;
556   - }
557   -
558   - #selModelo {
559   - width: 40%;
560   - }
561   -
562   - #lblTipoDocPrincipal {
563   - width: 50%;
564   - }
565   -
566   - #txtTipoDocPrinc {
567   - width: 39.5%;
568   - }
569   -
570   - #imgLupaTipoDocPrinc {
571   - top: 198%
572   - }
573   -
574   - #imgExcluirTipoDocPrinc {
575   - top: 198%
576   - }
577   -
578   - #txtSerie {
579   - width: 50%;
580   - }
581   -
582   - #lblDescricao {
583   - width: 50%;
584   - }
  291 + #lblTipoProcesso { position: absolute; left: 0%; top: 2px; width: 50%; }
  292 + #txtTipoProcesso { position: absolute; left: 0%; top: 18px; width: 50%; }
585 293  
586   - #selDescricao {
587   - width: 75%;
588   - }
589   -
590   - #imgLupaTipoDocumento {
591   - margin-top: 2px;
592   - margin-left: 4px;
593   - }
594   -
595   - #imgExcluirTipoDocumento {
596   - }
597   -
598   - .fieldNone {
599   - border: none !important;
600   - }
  294 + <? if ($_GET['acao'] == 'criterio_intercorrente_peticionamento_alterar'){ ?>
  295 + #imgLupaTipoProcesso { position: absolute; left: 52%; top: 9%; }
  296 + #imgExcluirTipoProcesso { position: absolute; left: 55%; top: 9%; }
  297 + #imgAjuda { display: none; }
  298 + #selTipoProcesso {display: none; }
  299 + <?} else{ ?>
  300 + #imgLupaTipoProcesso { position: absolute; left: 72%; top: 18%; }
  301 + #imgExcluirTipoProcesso { position: absolute; left: 72%; top: 26%; }
  302 + #imgAjuda { position: absolute; left: 75%; top: 18%; }
  303 + <?} ?>
  304 + #lblNivelAcesso { width: 50%; }
  305 + #selNivelAcesso { width: 20%; }
601 306  
602   - .sizeFieldset#fldDocPrincipal {
603   - height: 50% !important;
604   - }
605   -
606   - #txtSerieEssencial {
607   - width: 50%;
608   - }
  307 + #lblHipoteseLegal { width: 50%; }
  308 + #selHipoteseLegal { width: 50%; }
609 309  
610   - #lblDescricaoEssencial {
611   - width: 50%;
612   - }
  310 + #selTipoProcesso { position: absolute; left: 0%; top: 45px; width: 70.5%; }
613 311  
614   - #selDescricaoEssencial {
615   - width: 75%;
616   - }
617   -
618   - #imgLupaTipoDocumentoEssencial {
619   - margin-top: 2px;
620   - margin-left: 4px;
621   - }
  312 + .fieldsetClear { border: none !important; }
622 313  
623   - <?php endif; ?>
624   -
625   - .fieldsetClear {
626   - border: none !important;
627   - }
628   -
629   - .rdIndicacaoIndiretaHide {
630   - margin-left: 2.8% !important;
631   - }
632 314 </style>
633 315 <?php
634 316 PaginaSEI::getInstance()->fecharHead();
635 317 PaginaSEI::getInstance()->abrirBody($strTitulo, 'onload="inicializar();"');
636 318 ?>
637   -<form id="frmCriterioCadastro" method="post" onsubmit="return OnSubmitForm();"
638   - action="<?= PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink('controlador.php?acao=' . $_GET['acao'] . '&acao_origem=' . $_GET['acao'])) ?>">
  319 +<form id="frmCriterioCadastro" method="post" onsubmit="return OnSubmitForm();" action="<?= PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink('controlador.php?acao=' . $_GET['acao'] . '&acao_origem=' . $_GET['acao'])) ?>">
639 320 <?
640 321 PaginaSEI::getInstance()->montarBarraComandosSuperior($arrComandos);
641 322 PaginaSEI::getInstance()->abrirAreaDados('98%');
642 323 ?>
643 324  
644   - <input type="hidden" name="hdnParametroHipoteseLegal" id="hdnParametroHipoteseLegal"
645   - value="<?php echo $valorParametroHipoteseLegal; ?>"/>
  325 + <input type="hidden" name="hdnParametroHipoteseLegal" id="hdnParametroHipoteseLegal" value="<?php echo $valorParametroHipoteseLegal; ?>"/>
646 326 <!-- Tipo de Processo -->
647 327 <div class="fieldsetClear">
648   - <label id="lblTipoProcesso" for="txtTipoProcesso" class="infraLabelObrigatorio">Tipo de Processo: </label>
649   - <input type="text" onchange="removerProcessoAssociado(0);" id="txtTipoProcesso" name="txtTipoProcesso"
650   - class="infraText" value="<?php echo $nomeTipoProcesso; ?>" tabindex="<?= PaginaSEI::getInstance()->getProxTabDados() ?>"/>
  328 + <label id="lblTipoProcesso" for="txtTipoProcesso" class="infraLabelObrigatorio">Tipos de Processos: </label>
  329 + <input type="text" onchange="removerProcessoAssociado(0);" id="txtTipoProcesso" name="txtTipoProcesso" class="infraText InfraAutoCompletar" value="<?= $nomeTipoProcesso ?>" tabindex="<?= PaginaSEI::getInstance()->getProxTabDados() ?>"/>
  330 + <select name="selTipoProcesso" id="selTipoProcesso" size="8" class="infraSelect" multiple="multiple" tabindex="<?= PaginaSEI::getInstance()->getProxTabDados() ?>">
  331 + <?= $strTipoProcesso; ?>
  332 + </select>
651 333 <input type="hidden" id="hdnIdTipoProcesso" name="hdnIdTipoProcesso" value="<?php echo $idTipoProcesso ?>"/>
652   - <input type="hidden" id="hdnIdCriterioIntercorrentePeticionamento" name="hdnIdCriterioIntercorrentePeticionamento"
653   - value="<?php echo $IdCriterioIntercorrentePeticionamento ?>"/>
  334 + <input type="hidden" id="hdnIdCriterioIntercorrentePeticionamento" name="hdnIdCriterioIntercorrentePeticionamento" value="<?php echo $IdCriterioIntercorrentePeticionamento ?>"/>
654 335 <img id="imgLupaTipoProcesso" onclick="objLupaTipoProcesso.selecionar(700,500);" src="/infra_css/imagens/lupa.gif" alt="Selecionar Tipo de Processo" title="Selecionar Tipo de Processo" class="infraImg"/>
  336 + <img id="imgAjuda" src="<?= PaginaSEI::getInstance()->getDiretorioImagensGlobal() ?>/ajuda.gif" name="ajuda" <?= PaginaSEI::montarTitleTooltip('A indicação de mais de um Tipo de Processo apenas facilita aplicar o mesmo Critério para os Tipos indicados. Ou seja, em seguida, cada um terá registro próprio de Critério para Intercorrente.') ?> alt="Ajuda" class="infraImg"/>
655 337 <img id="imgExcluirTipoProcesso" onclick="removerProcessoAssociado(0);objLupaTipoProcesso.remover();" src="/infra_css/imagens/remover.gif" alt="Remover Tipo de Processo" title="Remover Tipo de Processo" class="infraImg"/>
656 338 </div>
657 339 <!-- Fim do Tipo de Processo -->
658 340  
659 341 <div style="clear:both;">&nbsp;</div>
660   - <div style="margin-top: 40px!important;">
  342 + <? if ($_GET['acao'] == 'criterio_intercorrente_peticionamento_alterar'){ ?>
  343 + <div style="margin-top: 40px!important;">
  344 + <? } else { ?>
  345 + <div style="margin-top: 166px!important;">
  346 + <? } ?>
661 347 <fieldset class="infraFieldset" style="width:75%;">
662 348 <legend class="infraLegend">&nbsp;Nível de Acesso dos Documentos&nbsp;</legend>
663 349 <div>
664   - <input <?php echo $sinNAUsuExt; ?> type="radio" name="rdNivelAcesso[]" id="rdUsuExternoIndicarEntrePermitidos" onclick="changeNivelAcesso();" value="1">
665   - <label for="rdUsuExternoIndicarEntrePermitidos" id="lblUsuExterno" class="infraLabelRadio">Usuário Externo indicar diretamente</label><br/>
  350 + <input <?php echo $sinNAUsuExt; ?> type="radio" name="rdNivelAcesso[]" id="rdUsuExternoIndicarEntrePermitidos" onclick="changeNivelAcesso();" value="1" tabindex="<?= PaginaSEI::getInstance()->getProxTabDados() ?>">
  351 + <label for="rdUsuExternoIndicarEntrePermitidos" id="lblUsuExterno" class="infraLabelRadio">Usuário Externo indica diretamente</label><br/>
666 352  
667   - <input <?php echo $sinNAPadrao; ?> type="radio" name="rdNivelAcesso[]" id="rdPadrao" onclick="changeNivelAcesso();" value="2">
  353 + <input <?php echo $sinNAPadrao; ?> type="radio" name="rdNivelAcesso[]" id="rdPadrao" onclick="changeNivelAcesso();" value="2" tabindex="<?= PaginaSEI::getInstance()->getProxTabDados() ?>">
668 354 <label name="lblPadrao" id="lblPadrao" for="rdPadrao" class="infraLabelRadio">Padrão pré definido</label>
669 355  
670 356 <div id="divNivelAcesso" <?php echo $sinNAPadrao != '' ? 'style="display: inherit;"' : 'style="display: none;"' ?>>
671 357 <div style="clear:both;">&nbsp;</div>
672 358 <label name="lblNivelAcesso" id="lblNivelAcesso" for="selNivelAcesso" class="infraLabelObrigatorio">Nível de Acesso: </label><br/>
673   - <select id="selNivelAcesso" name="selNivelAcesso" onchange="changeSelectNivelAcesso()">
  359 + <select id="selNivelAcesso" name="selNivelAcesso" onchange="changeSelectNivelAcesso()" tabindex="<?= PaginaSEI::getInstance()->getProxTabDados() ?>">
674 360 <?= $strItensSelNivelAcesso ?>
675 361 </select>
676 362 </div>
... ... @@ -678,7 +364,7 @@ PaginaSEI::getInstance()-&gt;abrirBody($strTitulo, &#39;onload=&quot;inicializar();&quot;&#39;);
678 364 <div id="divHipoteseLegal" <?php echo $hipoteseLegal; ?>>
679 365 <div style="clear:both;">&nbsp;</div>
680 366 <label name="lblHipoteseLegal" id="lblHipoteseLegal" for="selHipoteseLegal" class="infraLabelObrigatorio">Hipótese Legal:</label><br/>
681   - <select id="selHipoteseLegal" name="selHipoteseLegal">
  367 + <select id="selHipoteseLegal" name="selHipoteseLegal" tabindex="<?= PaginaSEI::getInstance()->getProxTabDados() ?>">
682 368 <?= $strItensSelHipoteseLegal ?>
683 369 </select>
684 370 </div>
... ... @@ -701,13 +387,13 @@ PaginaSEI::getInstance()-&gt;fecharHtml();
701 387 //Processo
702 388 var objLupaTipoProcesso = null;
703 389 var objAutoCompletarTipoProcesso = null;
  390 + var objAjaxIdNivelAcesso = null;
704 391  
705 392 function changeNivelAcesso() {
706 393 document.getElementById('divNivelAcesso').style.display = "none";
707 394 var padrao = document.getElementsByName('rdNivelAcesso[]')[1].checked;
708 395  
709 396 document.getElementById('selNivelAcesso').value = '';
710   - document.getElementById('selNivelAcesso').value = '';
711 397 document.getElementById('selHipoteseLegal').value = '';
712 398 document.getElementById('divHipoteseLegal').style.display = 'none';
713 399  
... ... @@ -730,54 +416,105 @@ PaginaSEI::getInstance()-&gt;fecharHtml();
730 416  
731 417 function inicializar() {
732 418 inicializarTela();
  419 + //carregarDependenciaNivelAcesso();
733 420  
734   - if ('<?=$_GET['acao']?>' == 'criterio_intercorrente_peticionamento_cadastrar' || '<?=$_GET['acao']?>' == 'criterio_intercorrente_peticionamento_alterar') {
735   - carregarComponenteTipoProcesso();
736   - //carregarDependenciaNivelAcesso();
  421 + if ('<?=$_GET['acao']?>' == 'criterio_intercorrente_peticionamento_cadastrar') {
  422 + carregarComponenteTipoProcessoNovo();
  423 + document.getElementById('txtTipoProcesso').focus();
  424 + }else if ('<?=$_GET['acao']?>' == 'criterio_intercorrente_peticionamento_alterar') {
  425 + carregarComponenteTipoProcessoAlterar();
737 426 document.getElementById('txtTipoProcesso').focus();
738 427 } else if ('<?=$_GET['acao']?>'=='criterio_intercorrente_peticionamento_consultar'){
739 428 //document.getElementById("filArquivo").disabled = 'disabled';
740 429 infraDesabilitarCamposAreaDados();
741 430 }
742 431  
  432 + /*
  433 + */
743 434 infraEfeitoTabelas();
744 435 }
745 436  
  437 + /*
746 438 function carregarDependenciaNivelAcesso() {
747 439 //Ajax para carregar os niveis de acesso após a escolha do tipo de processo
748   - objAjaxIdNivelAcesso = new infraAjaxMontarSelectDependente('txtTipoProcesso', 'selNivelAcesso', '<?=$strLinkAjaxNivelAcesso?>');
  440 + objAjaxIdNivelAcesso = new infraAjaxMontarSelectDependente('selTipoProcesso', 'selNivelAcesso', '< ? =$strLinkAjaxNivelAcesso?>');
749 441 objAjaxIdNivelAcesso.prepararExecucao = function () {
750   - document.getElementById('selNivelAcesso').innerHTML = '';
  442 + //document.getElementById('selNivelAcesso').innerHTML = '';
751 443 return infraAjaxMontarPostPadraoSelect('null', '', 'null') + '&idTipoProcesso=' + document.getElementById('hdnIdTipoProcesso').value;
752 444 }
753 445 }
  446 + */
754 447  
755 448 function inicializarTela() {
756 449 }
757 450  
758   - function carregarComponenteLupaTpDocComplementar(acaoComponente) {
759   - acaoComponente == 'S' ? objLupaTipoDocumento.selecionar(700, 500) : objLupaTipoDocumento.remover();
760   - }
  451 + function carregarComponenteTipoProcessoNovo() {
  452 + objLupaTipoProcesso = new infraLupaSelect('selTipoProcesso', 'hdnIdTipoProcesso', '<?=$strLinkTipoProcessoSelecao?>');
761 453  
762   - function returnLinkModificado(link, tipo) {
763   - var arrayLink = link.split('&filtro=1');
  454 + objLupaTipoProcesso.finalizarSelecao = function () {
  455 + var options = document.getElementById('selTipoProcesso').options;
  456 + if(options.length < 1){
  457 + return;
  458 + }
  459 + for(var i = 0; i < options.length; i++){
  460 + options[i].selected = true;
  461 + }
  462 + objLupaTipoProcesso.atualizar();
  463 + //objAjaxIdNivelAcesso.executar();
  464 + };
764 465  
765   - var linkFim = '';
766   - if (arrayLink.length == 2) {
767   - linkFim = arrayLink[0] + '&filtro=1&tipoDoc=' + tipo + arrayLink[1];
768   - } else {
769   - linkFim = link;
770   - }
  466 + objAutoCompletarTipoProcesso = new infraAjaxAutoCompletar('hdnIdTipoProcesso', 'txtTipoProcesso', '<?=$strLinkAjaxTipoProcesso?>');
  467 + objAutoCompletarTipoProcesso.limparCampo = false;
  468 +
  469 + objAutoCompletarTipoProcesso.prepararExecucao = function () {
  470 + var itensSelecionados = '';
  471 + var options = document.getElementById('selTipoProcesso').options;
  472 +
  473 + if (options.length > 0){
  474 + for(var i = 0; i < options.length; i++){
  475 + itensSelecionados += '&itens_selecionados[]=' + options[i].value;
  476 + }
  477 + }
  478 + return 'palavras_pesquisa=' + document.getElementById('txtTipoProcesso').value + '&' + itensSelecionados;
  479 + };
  480 +
  481 + objAutoCompletarTipoProcesso.processarResultado = function (id, descricao, complemento) {
  482 + if (id!=''){
  483 + var options = document.getElementById('selTipoProcesso').options;
  484 +
  485 + for(var i=0;i < options.length;i++){
  486 + if (options[i].value == id){
  487 + self.setTimeout('alert(\'Tipo de Processo [' + descricao + '] já consta na lista.\')',100);
  488 + break;
  489 + }
  490 + }
  491 +
  492 + if (i==options.length){
  493 +
  494 + for(i=0;i < options.length;i++){
  495 + options[i].selected = false;
  496 + }
  497 +
  498 + opt = infraSelectAdicionarOption(document.getElementById('selTipoProcesso'),descricao,id);
771 499  
772   - return linkFim;
  500 + objLupaTipoProcesso.atualizar();
  501 +
  502 + opt.selected = true;
  503 + }
  504 +
  505 + document.getElementById('txtTipoProcesso').value = '';
  506 + document.getElementById('txtTipoProcesso').focus();
  507 + }
  508 + }
  509 + objAutoCompletarTipoProcesso.selecionar('<?=$strIdTipoProcesso?>', '<?=PaginaSEI::getInstance()->formatarParametrosJavascript($strNomeRemetente);?>');
773 510 }
774 511  
775   - function carregarComponenteTipoProcesso() {
  512 + function carregarComponenteTipoProcessoAlterar() {
776 513 objLupaTipoProcesso = new infraLupaText('txtTipoProcesso', 'hdnIdTipoProcesso', '<?=$strLinkTipoProcessoSelecao?>');
777 514  
778 515 objLupaTipoProcesso.finalizarSelecao = function () {
779 516 objAutoCompletarTipoProcesso.selecionar(document.getElementById('hdnIdTipoProcesso').value, document.getElementById('txtTipoProcesso').value);
780   - objAjaxIdNivelAcesso.executar();
  517 + //objAjaxIdNivelAcesso.executar();
781 518 }
782 519  
783 520 objAutoCompletarTipoProcesso = new infraAjaxAutoCompletar('hdnIdTipoProcesso', 'txtTipoProcesso', '<?=$strLinkAjaxTipoProcesso?>');
... ... @@ -791,28 +528,28 @@ PaginaSEI::getInstance()-&gt;fecharHtml();
791 528 if (id != '') {
792 529 document.getElementById('hdnIdTipoProcesso').value = id;
793 530 document.getElementById('txtTipoProcesso').value = descricao;
794   - //objAjaxIdNivelAcesso.executar();
795 531 }
796 532 }
797 533 objAutoCompletarTipoProcesso.selecionar('<?=$strIdTipoProcesso?>', '<?=PaginaSEI::getInstance()->formatarParametrosJavascript($strNomeRemetente);?>');
798 534 }
799 535  
800 536 function removerProcessoAssociado(remover) {
801   - document.getElementById('selNivelAcesso').innerHTML = '';
802   - document.getElementById('divHipoteseLegal').style.display = "none";
803   - console.log(remover);
  537 + //document.getElementById('selNivelAcesso').innerHTML = '';
  538 + //document.getElementById('divHipoteseLegal').style.display = "none";
  539 + //console.log(remover);
804 540 if (remover === '1') {
805 541 objLupaTipoProcesso.remover();
806 542 }
807 543 }
808 544  
809 545 function validarCadastro() {
  546 + objLupaTipoProcesso.atualizar();
810 547  
811 548 var valorHipoteseLegal = document.getElementById('hdnParametroHipoteseLegal').value;
812 549  
813   - if (infraTrim(document.getElementById('txtTipoProcesso').value) == '') {
  550 + if (document.getElementById('selTipoProcesso').options < 1) {
814 551 alert('Informe o Tipo de Processo.');
815   - document.getElementById('txtTipoProcesso').focus();
  552 + // document.getElementById('selTipoProcesso').focus();
816 553 return false;
817 554 }
818 555  
... ... @@ -847,6 +584,60 @@ PaginaSEI::getInstance()-&gt;fecharHtml();
847 584 return false;
848 585 }
849 586 }
  587 +
  588 + if(valorNA == 2) {
  589 + var validacaoSelNivelAcesso = false;
  590 + $.ajax({
  591 + url: '<?=$strUrlAjaxValidarNivelAcesso?>',
  592 + type: 'POST',
  593 + dataType: 'XML',
  594 + data: $('form#frmCriterioCadastro').serialize(),
  595 + async: false,
  596 + success: function (r) {
  597 + if ($(r).find('MensagemValidacao').text()) {
  598 + alert($(r).find('MensagemValidacao').text());
  599 + } else {
  600 + validacaoSelNivelAcesso = true;
  601 + }
  602 + },
  603 + error: function (e) {
  604 + if ($(e.responseText).find('MensagemValidacao').text()) {
  605 + alert($(e.responseText).find('MensagemValidacao').text());
  606 + }
  607 + }
  608 + });
  609 +
  610 + if(validacaoSelNivelAcesso == false ){
  611 + return validacaoSelNivelAcesso;
  612 + }
  613 + }
  614 + /*
  615 + var validacaoAssunto = false;
  616 + $.ajax({
  617 + url: '< ? //= $strUrlAjaxTipoPeticionamentoAssuntoValidar?>',
  618 + type: 'POST',
  619 + dataType: 'XML',
  620 + data: $('form#frmCriterioCadastro').serialize(),
  621 + async: false,
  622 + success: function (r) {
  623 + if ($(r).find('MensagemValidacao').text()) {
  624 + alert($(r).find('MensagemValidacao').text());
  625 + } else {
  626 + validacaoAssunto = true;
  627 + }
  628 + },
  629 + error: function (e) {
  630 + if ($(e.responseText).find('MensagemValidacao').text()) {
  631 + alert($(e.responseText).find('MensagemValidacao').text());
  632 + }
  633 + }
  634 + });
  635 +
  636 + if(validacaoAssunto == false ){
  637 + return validacaoAssunto;
  638 + }
  639 + */
  640 +
850 641 return true;
851 642 }
852 643  
... ...
sei/web/modulos/peticionamento/criterio_intercorrente_peticionamento_lista.php
... ... @@ -26,14 +26,14 @@ try {
26 26 case 'criterio_intercorrente_peticionamento_excluir':
27 27 try{
28 28 $arrStrIds = PaginaSEI::getInstance()->getArrStrItensSelecionados();
29   - $arrObjIndisponibilidadePeticionamentoDTO = array();
  29 + $arrObjCriterioIntercorrentePeticionamentoDTO = array();
30 30 for ($i=0;$i<count($arrStrIds);$i++){
31   - $objIndisponibilidadePeticionamentoDTO = new IndisponibilidadePeticionamentoDTO();
32   - $objIndisponibilidadePeticionamentoDTO->setNumIdIndisponibilidade($arrStrIds[$i]);
33   - $arrObjIndisponibilidadePeticionamentoDTO[] = $objIndisponibilidadePeticionamentoDTO;
  31 + $objCriterioIntercorrentePeticionamentoDTO = new CriterioIntercorrentePeticionamentoDTO();
  32 + $objCriterioIntercorrentePeticionamentoDTO->setNumIdCriterioIntercorrentePeticionamento($arrStrIds[$i]);
  33 + $arrObjCriterioIntercorrentePeticionamentoDTO[] = $objCriterioIntercorrentePeticionamentoDTO;
34 34 }
35   - $objIndisponibilidadePeticionamentoRN = new IndisponibilidadePeticionamentoRN();
36   - $objIndisponibilidadePeticionamentoRN->excluir($arrObjIndisponibilidadePeticionamentoDTO);
  35 + $objCriterioIntercorrentePeticionamentoRN = new CriterioIntercorrentePeticionamentoRN();
  36 + $objCriterioIntercorrentePeticionamentoRN->excluir($arrObjCriterioIntercorrentePeticionamentoDTO);
37 37  
38 38 }catch(Exception $e){
39 39 PaginaSEI::getInstance()->processarExcecao($e);
... ... @@ -115,6 +115,7 @@ try {
115 115 }
116 116  
117 117 $objCriterioIntercorrentePeticionamentoDTO = new CriterioIntercorrentePeticionamentoDTO();
  118 + $objCriterioIntercorrentePeticionamentoDTO->setStrSinCriterioPadrao('N');
118 119 $objCriterioIntercorrentePeticionamentoDTO->retTodos(true);
119 120  
120 121 //NomeProcesso
... ...
sei/web/modulos/peticionamento/criterio_intercorrente_peticionamento_padrao.php
... ... @@ -105,64 +105,73 @@ try {
105 105 }
106 106  
107 107 $objInfraParametroDTO = new InfraParametroDTO();
108   - $objInfraParametroRN = new InfraParametroRN();
  108 + $objMdPetParametroRN = new MdPetParametroRN();
109 109 $objInfraParametroDTO->retTodos();
110 110 $objInfraParametroDTO->setStrNome('SEI_HABILITAR_HIPOTESE_LEGAL');
111   - $objInfraParametroDTO = $objInfraParametroRN->consultar($objInfraParametroDTO);
  111 + $objInfraParametroDTO = $objMdPetParametroRN->consultar($objInfraParametroDTO);
112 112 $valorParametroHipoteseLegal = $objInfraParametroDTO->getStrValor();
113 113  
114 114 switch ($_GET['acao']) {
115 115 case 'criterio_intercorrente_peticionamento_padrao':
116   -
117   - $strItensSelHipoteseLegal = TipoProcessoPeticionamentoINT::montarSelectHipoteseLegal(null, null, null);
118   -
119   - //Carregando campos select
120   - $strItensSelTipoProcesso = TipoProcessoPeticionamentoINT::montarSelectTipoProcesso(null, null, $_POST['selTipoProcesso']);
121   - //$strItensSelUnidades = UnidadeINT::montarSelectSiglaDescricao(null, null, $_POST['selUnidade']);
122   -
123   - //$strItensSelDoc = SerieINT::montarSelectNomeRI0802(null, null, $_POST['selDocumento']);
124   -
125 116 $strTitulo = 'Intercorrente Padrão';
126 117  
127 118 $arrComandos[] = '<button type="submit" accesskey="s" name="sbmCadastrarTpProcessoPeticionamento" id="sbmCadastrarTpProcessoPeticionamento" value="Salvar" class="infraButton"><span class="infraTeclaAtalho">S</span>alvar</button>';
128 119 $arrComandos[] = '<button type="button" accesskey="c" name="btnCancelar" id="btnCancelar" value="Cancelar" onclick="location.href=\'' . PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink('controlador.php?acao=' . PaginaSEI::getInstance()->getAcaoRetorno() . '&acao_origem=' . $_GET['acao'])) . '\';" class="infraButton"><span class="infraTeclaAtalho">C</span>ancelar</button>';
129 120  
130   - /*
131   - $objTipoProcessoPeticionamentoRN = new TipoProcessoPeticionamentoRN();
132   - $objTipoProcessoPeticionamentoDTO = new TipoProcessoPeticionamentoDTO();
133   - $objTipoProcessoPeticionamentoDTO->setNumIdProcedimento($_POST['hdnIdTipoProcesso']);
134   - $objTipoProcessoPeticionamentoDTO->setStrSinIIProprioUsuarioExterno('N');
135   - $objTipoProcessoPeticionamentoDTO->setStrSinIIIndicacaoDireta('N');
136   - $objTipoProcessoPeticionamentoDTO->setStrSinIIIndicacaoDiretaCpfCnpj('N');
137   - $objTipoProcessoPeticionamentoDTO->setStrSinIIIndicacaoDiretaContato('N');
138   - $objTipoProcessoPeticionamentoDTO->setStrSinNaUsuarioExterno('N');
139   - $objTipoProcessoPeticionamentoDTO->setStrSinNaPadrao('N');
140   - $objTipoProcessoPeticionamentoDTO->setStrSinDocGerado('N');
141   - $objTipoProcessoPeticionamentoDTO->setStrSinDocExterno('N');
142   - */
143   -
144 121 // cadastrando o critério intercorrente
145 122 if (isset($_POST['sbmCadastrarTpProcessoPeticionamento'])) {
146   - $strStaTipoNivelAcesso = 'I';
147   - if ($_POST['rdNivelAcesso'][0] == 1) {
148   - $strStaTipoNivelAcesso = 'P';
149   - }
150   - /*
151   - echo '<pre>';
152   - var_dump($_POST);
153   - exit;
154   - */
155 123 $objCriterioIntercorrentePeticionamentoDTO = new CriterioIntercorrentePeticionamentoDTO();
156   - //$objCriterioIntercorrentePeticionamentoDTO->setNumIdCriterioIntercorrentePeticionamento();
157   -
158   - $objCriterioIntercorrentePeticionamentoDTO->setStrStaTipoNivelAcesso($strStaTipoNivelAcesso);
159   - $objCriterioIntercorrentePeticionamentoDTO->setStrStaNivelAcesso($_POST['rdNivelAcesso'][0]);
160   - $objCriterioIntercorrentePeticionamentoDTO->setNumIdHipoteseLegal($_POST['selHipoteseLegal']);
161 124 $objCriterioIntercorrentePeticionamentoDTO->setNumIdTipoProcedimento($_POST['hdnIdTipoProcesso']);
  125 + $objCriterioIntercorrentePeticionamentoDTO->setStrStaNivelAcesso($_POST['rdNivelAcesso'][0]);
162 126  
  127 + if (isset($_POST['selNivelAcesso']) && !empty($_POST['selNivelAcesso']) && $_POST['rdNivelAcesso'][0] == '2') {
  128 + $strStaTipoNivelAcesso = $_POST['selNivelAcesso'];
  129 + if ($_POST['selNivelAcesso'] == 'I') {
  130 + $objCriterioIntercorrentePeticionamentoDTO->setNumIdHipoteseLegal($_POST['selHipoteseLegal']);
  131 + }
  132 + $objCriterioIntercorrentePeticionamentoDTO->setStrStaTipoNivelAcesso($strStaTipoNivelAcesso);
  133 + }
  134 +
  135 + $objCriterioIntercorrentePeticionamentoRN = new CriterioIntercorrentePeticionamentoRN();
  136 + $objCriterioIntercorrentePeticionamentoRN->cadastrarPadrao($objCriterioIntercorrentePeticionamentoDTO);
  137 +
  138 + header('Location: '.SessaoSEI::getInstance()->assinarLink('controlador.php?acao=' . PaginaSEI::getInstance()->getAcaoRetorno() . '&acao_origem=' . $_GET['acao']));
  139 + die;
  140 + } else {
  141 + $objCriterioIntercorrentePadraoConsultaDTO = new CriterioIntercorrentePeticionamentoDTO();
  142 + $objCriterioIntercorrentePadraoConsultaDTO->setStrSinCriterioPadrao('S');
  143 + $objCriterioIntercorrentePadraoConsultaDTO->retTodos(true);
  144 + $objCriterioIntercorrentePadraoConsultaDTO->retStrNomeProcesso();
163 145 $objCriterioIntercorrentePeticionamentoRN = new CriterioIntercorrentePeticionamentoRN();
164   - if ($_GET['acao'] == 'criterio_intercorrente_peticionamento_padrao') {
165   - $objCriterioIntercorrentePeticionamentoRN->cadastrarPadrao($objCriterioIntercorrentePeticionamentoDTO);
  146 + $objCriterioIntercorrentePadraoDTO = $objCriterioIntercorrentePeticionamentoRN->consultar($objCriterioIntercorrentePadraoConsultaDTO);
  147 + $strItensSelHipoteseLegal = TipoProcessoPeticionamentoINT::montarSelectHipoteseLegal(null, null, null);
  148 +
  149 + //Carregando campos select
  150 + $strItensSelTipoProcesso = TipoProcessoPeticionamentoINT::montarSelectTipoProcesso(null, null, $_POST['selTipoProcesso']);
  151 +
  152 + if($objCriterioIntercorrentePadraoDTO){
  153 + $nomeTipoProcesso = $objCriterioIntercorrentePadraoDTO->getStrNomeProcesso();
  154 + $idTipoProcesso = $objCriterioIntercorrentePadraoDTO->getNumIdTipoProcedimento();
  155 + $sinCriterioPadrao = $objCriterioIntercorrentePadraoDTO->getStrSinCriterioPadrao() == 'S' ? 'checked = checked' : '';
  156 + $sinNAUsuExt = $objCriterioIntercorrentePadraoDTO->getStrStaNivelAcesso() == 1 ? 'checked = checked' : '';
  157 + $sinNAPadrao = $objCriterioIntercorrentePadraoDTO->getStrStaNivelAcesso() == 2 ? 'checked = checked' : '';
  158 + $hipoteseLegal = $objCriterioIntercorrentePadraoDTO->getStrStaTipoNivelAcesso() === 'I' && $valorParametroHipoteseLegal != '0' ? 'style="display:inherit"' : 'style="display:none"';
  159 + $strItensSelTipoProcesso = TipoProcessoPeticionamentoINT::montarSelectTipoProcesso(null, null, $idTipoProcesso);
  160 + $strItensSelHipoteseLegal = TipoProcessoPeticionamentoINT::montarSelectHipoteseLegal(null, null, $objCriterioIntercorrentePadraoDTO->getNumIdHipoteseLegal());
  161 + $nivelAcessoTemplate = '<option value="%s" %s>%s</option>';
  162 + $arrNivelAcesso = array(
  163 + '' => '',
  164 + 'P' => 'Público',
  165 + 'I' => 'Restrito'
  166 + );
  167 + $strTipoProcesso = sprintf($nivelAcessoTemplate, $idTipoProcesso, 'selected="selected"', $nomeTipoProcesso);
  168 +
  169 + $strItensSelNivelAcesso = '';
  170 + foreach($arrNivelAcesso as $i => $nivelAcesso){
  171 + $selected = ($i == $objCriterioIntercorrentePadraoDTO->getStrStaTipoNivelAcesso()) ? ' selected="selected" ': '';
  172 + $strItensSelNivelAcesso .= sprintf($nivelAcessoTemplate, $i, $selected, $nivelAcesso);
  173 + }
  174 +
166 175 }
167 176 }
168 177 break;
... ... @@ -209,30 +218,8 @@ PaginaSEI::getInstance()-&gt;fecharJavaScript();
209 218 width: 50%;
210 219 }
211 220  
212   - #fldProrrogacao {
213   - height: 20%;
214   - width: 86%;
215   - }
216   -
217 221 <?php if($firefox): ?>
218 222  
219   - .sizeFieldset {
220   - height: 30%;
221   - width: 86%;
222   - }
223   -
224   - .tamanhoFieldset {
225   - height: auto;
226   - width: 86%;
227   - }
228   -
229   - #divIndicacaoInteressado {
230   - }
231   -
232   - #divUnidade {
233   - margin-top: 138px !important;
234   - }
235   -
236 223 #imgLupaTipoProcesso {
237 224 position: absolute;
238 225 left: 51%;
... ... @@ -245,62 +232,6 @@ PaginaSEI::getInstance()-&gt;fecharJavaScript();
245 232 top: 18px;
246 233 }
247 234  
248   - #lblUnidade {
249   - position: absolute;
250   - left: 0%;
251   - width: 50%;
252   - }
253   -
254   - #txtUnidade {
255   - left: 12px;
256   - width: 65%;
257   - margin-top: 0.5%;
258   - }
259   -
260   - #imgLupaUnidade {
261   - position: absolute;
262   - left: 51%;
263   - margin-top: 0.5%;
264   - }
265   -
266   - #imgExcluirUnidade {
267   - position: absolute;
268   - left: 52.7%;
269   - margin-top: 0.5%;
270   - }
271   -
272   - #txtUnidadeMultipla {
273   - left: 12px;
274   - width: 65%;
275   - margin-top: 0.5%;
276   - }
277   -
278   - #imgLupaUnidadeMultipla {
279   - position: absolute;
280   - left: 51%;
281   - margin-top: 0.5%;
282   - }
283   -
284   - #sbmAdicionarUnidade {
285   - position: absolute;
286   - left: 53.7%;
287   - margin-top: 0.5%;
288   - }
289   -
290   - #lblOrientacoes {
291   - position: absolute;
292   - left: 0%;
293   - top: 50px;
294   - width: 20%;
295   - }
296   -
297   - #txtOrientacoes {
298   - position: absolute;
299   - left: 0%;
300   - top: 66px;
301   - width: 75%;
302   - }
303   -
304 235 #lblNivelAcesso {
305 236 width: 50%;
306 237 }
... ... @@ -317,85 +248,7 @@ PaginaSEI::getInstance()-&gt;fecharJavaScript();
317 248 width: 50%;
318 249 }
319 250  
320   - #lblModelo {
321   - width: 50%;
322   - }
323   -
324   - #selModelo {
325   - width: 40%;
326   - }
327   -
328   - #lblTipoDocPrincipal {
329   - width: 50%;
330   - }
331   -
332   - #txtTipoDocPrinc {
333   - width: 39.5%;
334   - }
335   -
336   - #imgLupaTipoDocPrinc {
337   - top: 198%
338   - }
339   -
340   - #imgExcluirTipoDocPrinc {
341   - top: 198%
342   - }
343   -
344   - #txtSerie {
345   - width: 50%;
346   - }
347   -
348   - #lblDescricao {
349   - width: 50%;
350   - }
351   -
352   - #selDescricao {
353   - width: 75%;
354   - }
355   -
356   - #imgLupaTipoDocumento {
357   - margin-top: 2px;
358   - margin-left: 4px;
359   - }
360   -
361   - #txtSerieEssencial {
362   - width: 50%;
363   - }
364   -
365   - #lblDescricaoEssencial {
366   - width: 50%;
367   - }
368   -
369   - #selDescricaoEssencial {
370   - width: 75%;
371   - }
372   -
373   - #imgLupaTipoDocumentoEssencial {
374   - margin-top: 2px;
375   - margin-left: 4px;
376   - }
377   -
378   - .fieldNone {
379   - border: none !important;
380   - }
381   -
382   - .sizeFieldset#fldDocPrincipal {
383   - height: 50% !important;
384   - }
385   -
386 251 <?php else: ?>
387   - .sizeFieldset {
388   - height: 30%;
389   - width: 86%;
390   - }
391   -
392   - .tamanhoFieldset {
393   - height: auto;
394   - width: 86%;
395   - }
396   -
397   - #divIndicacaoInteressado {
398   - }
399 252  
400 253 #imgLupaTipoProcesso {
401 254 position: absolute;
... ... @@ -409,65 +262,6 @@ PaginaSEI::getInstance()-&gt;fecharJavaScript();
409 262 top: 18px;
410 263 }
411 264  
412   - #divUnidade {
413   - margin-top: 111px !important;
414   - }
415   -
416   - #lblUnidade {
417   - left: 0%;
418   - top: 15.7%;
419   - width: 65%;
420   - }
421   -
422   - #txtUnidade {
423   - left: 0%;
424   - top: 17.6%;
425   - width: 65%;
426   - margin-top: 0.5%;
427   - }
428   -
429   - #imgLupaUnidade {
430   - position: absolute;
431   - left: 50.4%;
432   - }
433   -
434   - #imgExcluirUnidade {
435   - position: absolute;
436   - left: 52.1%;
437   - }
438   -
439   - #txtUnidadeMultipla {
440   - left: 12px;
441   - width: 65%;
442   - margin-top: 0.5%;
443   - }
444   -
445   - #imgLupaUnidadeMultipla {
446   - position: absolute;
447   - left: 50.5%;
448   - margin-top: 0.5%;
449   - }
450   -
451   - #sbmAdicionarUnidade {
452   - position: absolute;
453   - left: 53.2%;
454   - margin-top: 0.5%;
455   - }
456   -
457   - #lblOrientacoes {
458   - position: absolute;
459   - left: 0%;
460   - top: 50px;
461   - width: 20%;
462   - }
463   -
464   - #txtOrientacoes {
465   - position: absolute;
466   - left: 0%;
467   - top: 66px;
468   - width: 75%;
469   - }
470   -
471 265 #lblNivelAcesso {
472 266 width: 50%;
473 267 }
... ... @@ -484,113 +278,31 @@ PaginaSEI::getInstance()-&gt;fecharJavaScript();
484 278 width: 50%;
485 279 }
486 280  
487   - #lblModelo {
488   - width: 50%;
489   - }
490   -
491   - #selModelo {
492   - width: 40%;
493   - }
494   -
495   - #lblTipoDocPrincipal {
496   - width: 50%;
497   - }
498   -
499   - #txtTipoDocPrinc {
500   - width: 39.5%;
501   - }
502   -
503   - #imgLupaTipoDocPrinc {
504   - top: 198%
505   - }
506   -
507   - #imgExcluirTipoDocPrinc {
508   - top: 198%
509   - }
510   -
511   - #txtSerie {
512   - width: 50%;
513   - }
514   -
515   - #lblDescricao {
516   - width: 50%;
517   - }
518   -
519   - #selDescricao {
520   - width: 75%;
521   - }
522   -
523   - #imgLupaTipoDocumento {
524   - margin-top: 2px;
525   - margin-left: 4px;
526   - }
527   -
528   - #imgExcluirTipoDocumento {
529   - }
530   -
531   - .fieldNone {
532   - border: none !important;
533   - }
534   -
535   - .sizeFieldset#fldDocPrincipal {
536   - height: 50% !important;
537   - }
538   -
539   - #txtSerieEssencial {
540   - width: 50%;
541   - }
542   -
543   - #lblDescricaoEssencial {
544   - width: 50%;
545   - }
546   -
547   - #selDescricaoEssencial {
548   - width: 75%;
549   - }
550   -
551   - #imgLupaTipoDocumentoEssencial {
552   - margin-top: 2px;
553   - margin-left: 4px;
554   - }
555   -
556 281 <?php endif; ?>
557 282  
558 283 .fieldsetClear {
559 284 border: none !important;
560 285 }
561   -
562   - .rdIndicacaoIndiretaHide {
563   - margin-left: 2.8% !important;
564   - }
565 286 </style>
566 287 <?php
567 288 PaginaSEI::getInstance()->fecharHead();
568 289 PaginaSEI::getInstance()->abrirBody($strTitulo, 'onload="inicializar();"');
569 290 ?>
570   -<form id="frmCriterioCadastro" method="post" onsubmit="return OnSubmitForm();"
571   - action="<?= PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink('controlador.php?acao=' . $_GET['acao'] . '&acao_origem=' . $_GET['acao'])) ?>">
  291 +<form id="frmCriterioCadastro" method="post" onsubmit="return OnSubmitForm();" action="<?= PaginaSEI::getInstance()->formatarXHTML(SessaoSEI::getInstance()->assinarLink('controlador.php?acao=' . $_GET['acao'] . '&acao_origem=' . $_GET['acao'])) ?>">
572 292 <?
573 293 PaginaSEI::getInstance()->montarBarraComandosSuperior($arrComandos);
574 294 PaginaSEI::getInstance()->abrirAreaDados('98%');
575 295 ?>
576 296  
577   - <input type="hidden" name="hdnParametroHipoteseLegal" id="hdnParametroHipoteseLegal"
578   - value="<?php echo $valorParametroHipoteseLegal; ?>"/>
  297 + <input type="hidden" name="hdnParametroHipoteseLegal" id="hdnParametroHipoteseLegal" value="<?php echo $valorParametroHipoteseLegal; ?>"/>
579 298 <!-- Tipo de Processo -->
580 299 <div class="fieldsetClear">
581 300 <label id="lblTipoProcesso" for="txtTipoProcesso" class="infraLabelObrigatorio">Tipo de Processo: </label>
582   - <input type="text" onchange="removerProcessoAssociado(0);" id="txtTipoProcesso" name="txtTipoProcesso"
583   - class="infraText" value="<?php echo $nomeTipoProcesso; ?>"
584   - tabindex="<?= PaginaSEI::getInstance()->getProxTabDados() ?>"/>
  301 + <input type="text" onchange="removerProcessoAssociado(0);" id="txtTipoProcesso" name="txtTipoProcesso" class="infraText" value="<?php echo $nomeTipoProcesso; ?>" tabindex="<?= PaginaSEI::getInstance()->getProxTabDados() ?>"/>
585 302 <input type="hidden" id="hdnIdTipoProcesso" name="hdnIdTipoProcesso" value="<?php echo $idTipoProcesso ?>"/>
586   - <input type="hidden" id="hdnIdMdPetTipoProcesso" name="hdnIdMdPetTipoProcesso"
587   - value="<?php echo $idMdPetTipoProcesso ?>"/>
588   - <img id="imgLupaTipoProcesso" onclick="objLupaTipoProcesso.selecionar(700,500);"
589   - src="/infra_css/imagens/lupa.gif" alt="Selecionar Tipo de Processo" title="Selecionar Tipo de Processo"
590   - class="infraImg"/>
591   - <img id="imgExcluirTipoProcesso" onclick="removerProcessoAssociado(0);objLupaTipoProcesso.remover();"
592   - src="/infra_css/imagens/remover.gif" alt="Remover Tipo de Processo" title="Remover Tipo de Processo"
593   - class="infraImg"/>
  303 + <input type="hidden" id="hdnIdMdPetTipoProcesso" name="hdnIdMdPetTipoProcesso" value="<?php echo $idMdPetTipoProcesso ?>"/>
  304 + <img id="imgLupaTipoProcesso" onclick="objLupaTipoProcesso.selecionar(700,500);" src="/infra_css/imagens/lupa.gif" alt="Selecionar Tipo de Processo" title="Selecionar Tipo de Processo" class="infraImg"/>
  305 + <img id="imgExcluirTipoProcesso" onclick="removerProcessoAssociado(0);objLupaTipoProcesso.remover();" src="/infra_css/imagens/remover.gif" alt="Remover Tipo de Processo" title="Remover Tipo de Processo" class="infraImg"/>
594 306  
595 307 </div>
596 308 <!-- Fim do Tipo de Processo -->
... ... @@ -600,23 +312,15 @@ PaginaSEI::getInstance()-&gt;abrirBody($strTitulo, &#39;onload=&quot;inicializar();&quot;&#39;);
600 312 <fieldset class="infraFieldset" style="width:75%;">
601 313 <legend class="infraLegend">&nbsp;Nível de Acesso dos Documentos&nbsp;</legend>
602 314 <div>
603   - <input <?php echo $sinNAUsuExt; ?> type="radio" name="rdNivelAcesso[]"
604   - id="rdUsuExternoIndicarEntrePermitidos"
605   - onclick="changeNivelAcesso();" value="1">
606   -
607   - <label for="rdUsuExternoIndicarEntrePermitidos" id="lblUsuExterno" class="infraLabelRadio">Usuário
608   - Externo indicar diretamente</label><br/>
  315 + <input <?php echo $sinNAUsuExt; ?> type="radio" name="rdNivelAcesso[]" id="rdUsuExternoIndicarEntrePermitidos" onclick="changeNivelAcesso();" value="1">
  316 + <label for="rdUsuExternoIndicarEntrePermitidos" id="lblUsuExterno" class="infraLabelRadio">Usuário Externo indicar diretamente</label><br/>
609 317  
610   - <input <?php echo $sinNAPadrao; ?> type="radio" name="rdNivelAcesso[]" id="rdPadrao"
611   - onclick="changeNivelAcesso();" value="2">
612   - <label name="lblPadrao" id="lblPadrao" for="rdPadrao" class="infraLabelRadio">Padrão pré
613   - definido</label>
  318 + <input <?php echo $sinNAPadrao; ?> type="radio" name="rdNivelAcesso[]" id="rdPadrao" onclick="changeNivelAcesso();" value="2">
  319 + <label name="lblPadrao" id="lblPadrao" for="rdPadrao" class="infraLabelRadio">Padrão pré definido</label>
614 320  
615   - <div
616   - id="divNivelAcesso" <?php echo $sinNAPadrao != '' ? 'style="display: inherit;"' : 'style="display: none;"' ?>>
  321 + <div id="divNivelAcesso" <?php echo $sinNAPadrao != '' ? 'style="display: inherit;"' : 'style="display: none;"' ?>>
617 322 <div style="clear:both;">&nbsp;</div>
618   - <label name="lblNivelAcesso" id="lblNivelAcesso" for="selNivelAcesso" class="infraLabelObrigatorio">Nível
619   - de Acesso: </label><br/>
  323 + <label name="lblNivelAcesso" id="lblNivelAcesso" for="selNivelAcesso" class="infraLabelObrigatorio">Nível de Acesso: </label><br/>
620 324 <select id="selNivelAcesso" name="selNivelAcesso" onchange="changeSelectNivelAcesso()">
621 325 <?= $strItensSelNivelAcesso ?>
622 326 </select>
... ... @@ -624,8 +328,7 @@ PaginaSEI::getInstance()-&gt;abrirBody($strTitulo, &#39;onload=&quot;inicializar();&quot;&#39;);
624 328  
625 329 <div id="divHipoteseLegal" <?php echo $hipoteseLegal; ?>>
626 330 <div style="clear:both;">&nbsp;</div>
627   - <label name="lblHipoteseLegal" id="lblHipoteseLegal" for="selHipoteseLegal"
628   - class="infraLabelObrigatorio">Hipótese Legal:</label><br/>
  331 + <label name="lblHipoteseLegal" id="lblHipoteseLegal" for="selHipoteseLegal" class="infraLabelObrigatorio">Hipótese Legal:</label><br/>
629 332 <select id="selHipoteseLegal" name="selHipoteseLegal">
630 333 <?= $strItensSelHipoteseLegal ?>
631 334 </select>
... ... @@ -635,19 +338,6 @@ PaginaSEI::getInstance()-&gt;abrirBody($strTitulo, &#39;onload=&quot;inicializar();&quot;&#39;);
635 338 </div>
636 339  
637 340 <div style="clear:both;">&nbsp;</div>
638   - <!--
639   - <input type="hidden" id="hdnCorpoTabela" name="hdnCorpoTabela" value=""/>
640   - <input type="hidden" id="hdnUnidadesSelecionadas" name="hdnUnidadesSelecionadas" value=""/>
641   - <input type="hidden" id="hdnTodasUnidades" name="hdnTodasUnidades" value='<?= json_encode($arrObjUnidadeDTOFormatado); ?>' />
642   - <input type="hidden" id="hdnIdTipoDocumento" name="hdnIdTipoDocumento" value="" />
643   - <input type="hidden" id="hdnSerie" name="hdnSerie" value="<?= $_POST['hdnSerie'] ?>" />
644   - <input type="hidden" id="hdnIdTipoDocumento" name="hdnIdTipoDocumento" value="<?= $_POST['hdnIdTipoDocumento'] ?>" />
645   - <input type="hidden" id="hdnIdIndisponibilidadePeticionamento" name="hdnIdIndisponibilidadePeticionamento" value="" />
646   - <input type="hidden" id="hdnIdSerie" name="hdnIdSerie" value="<?= $_POST['hdnIdSerie'] ?>" />
647   - <input type="hidden" id="hdnIdSerieEssencial" name="hdnIdSerieEssencial" value="<?= $_POST['hdnIdSerieEssencial'] ?>" />
648   - <input type="hidden" id="hdnSerieEssencial" name="hdnSerieEssencial" value="<?= $_POST['hdnSerieEssencial'] ?>" />
649   - -->
650   -
651 341 <?
652 342 PaginaSEI::getInstance()->fecharAreaDados();
653 343 ?>
... ... @@ -666,10 +356,9 @@ PaginaSEI::getInstance()-&gt;fecharHtml();
666 356 document.getElementById('divNivelAcesso').style.display = "none";
667 357 var padrao = document.getElementsByName('rdNivelAcesso[]')[1].checked;
668 358  
669   - document.getElementById('selNivelAcesso').value = '';
670   - document.getElementById('selNivelAcesso').value = '';
671 359 document.getElementById('selHipoteseLegal').value = '';
672 360 document.getElementById('divHipoteseLegal').style.display = 'none';
  361 + document.getElementById('selNivelAcesso').value = '';
673 362  
674 363 if (padrao) {
675 364 document.getElementById('divNivelAcesso').style.display = "inherit";
... ... @@ -682,7 +371,7 @@ PaginaSEI::getInstance()-&gt;fecharHtml();
682 371 var valorSelectNivelAcesso = document.getElementById('selNivelAcesso').value;
683 372 var valorHipoteseLegal = document.getElementById('hdnParametroHipoteseLegal').value;
684 373  
685   - if (valorSelectNivelAcesso == '<?= ProtocoloRN::$NA_RESTRITO ?>' && valorHipoteseLegal != '0') {
  374 + if (valorSelectNivelAcesso == 'I' && valorHipoteseLegal != '0') {
686 375 document.getElementById('divHipoteseLegal').style.display = 'inherit';
687 376 } else {
688 377 document.getElementById('divHipoteseLegal').style.display = 'none';
... ... @@ -703,14 +392,16 @@ PaginaSEI::getInstance()-&gt;fecharHtml();
703 392 infraEfeitoTabelas();
704 393 }
705 394  
  395 + /*
706 396 function carregarDependenciaNivelAcesso() {
707 397 //Ajax para carregar os niveis de acesso após a escolha do tipo de processo
708   - objAjaxIdNivelAcesso = new infraAjaxMontarSelectDependente('txtTipoProcesso', 'selNivelAcesso', '<?=$strLinkAjaxNivelAcesso?>');
  398 + objAjaxIdNivelAcesso = new infraAjaxMontarSelectDependente('txtTipoProcesso', 'selNivelAcesso', '< ?=$strLinkAjaxNivelAcesso?>');
709 399 objAjaxIdNivelAcesso.prepararExecucao = function () {
710 400 document.getElementById('selNivelAcesso').innerHTML = '';
711 401 return infraAjaxMontarPostPadraoSelect('null', '', 'null') + '&idTipoProcesso=' + document.getElementById('hdnIdTipoProcesso').value;
712 402 }
713 403 }
  404 + */
714 405  
715 406 function inicializarTela() {
716 407 }
... ... @@ -751,7 +442,9 @@ PaginaSEI::getInstance()-&gt;fecharHtml();
751 442 if (id != '') {
752 443 document.getElementById('hdnIdTipoProcesso').value = id;
753 444 document.getElementById('txtTipoProcesso').value = descricao;
754   - objAjaxIdNivelAcesso.executar();
  445 + //objAjaxIdNivelAcesso.executar();
  446 + document.getElementById('selNivelAcesso').value = '';
  447 + changeSelectNivelAcesso();
755 448 }
756 449 }
757 450 objAutoCompletarTipoProcesso.selecionar('<?=$strIdTipoProcesso?>', '<?=PaginaSEI::getInstance()->formatarParametrosJavascript($strNomeRemetente);?>');
... ... @@ -760,7 +453,6 @@ PaginaSEI::getInstance()-&gt;fecharHtml();
760 453 function removerProcessoAssociado(remover) {
761 454 document.getElementById('selNivelAcesso').innerHTML = '';
762 455 document.getElementById('divHipoteseLegal').style.display = "none";
763   - console.log(remover);
764 456 if (remover === '1') {
765 457 objLupaTipoProcesso.remover();
766 458 }
... ... @@ -785,7 +477,6 @@ PaginaSEI::getInstance()-&gt;fecharHtml();
785 477 if (elemsNA[i].checked === true) {
786 478 validoNA = true;
787 479 valorNA = parseInt(elemsNA[i].value);
788   - //console.log(elemsNA[i].value);
789 480 }
790 481 }
791 482  
... ... @@ -798,7 +489,7 @@ PaginaSEI::getInstance()-&gt;fecharHtml();
798 489 alert('Informe o Nível de Acesso.');
799 490 document.getElementById('selNivelAcesso').focus();
800 491 return false;
801   - } else if (document.getElementById('selNivelAcesso').value == <?= ProtocoloRN::$NA_RESTRITO ?> && valorHipoteseLegal != '0') {
  492 + } else if (document.getElementById('selNivelAcesso').value == 'I' && valorHipoteseLegal != '0') {
802 493  
803 494 //validar hipotese legal
804 495 if (document.getElementById('selHipoteseLegal').value == '') {
... ... @@ -808,10 +499,6 @@ PaginaSEI::getInstance()-&gt;fecharHtml();
808 499 }
809 500 }
810 501  
811   -
812   - //console.log('validação efetuada com sucesso');
813   - //return false;
814   -
815 502 return true;
816 503 }
817 504  
... ...
sei/web/modulos/peticionamento/dto/ReciboPeticionamentoDTO.php
... ... @@ -57,7 +57,7 @@ class ReciboPeticionamentoDTO extends InfraDTO {
57 57  
58 58 $this->adicionarAtributoTabela(InfraDTO::$PREFIXO_DBL,
59 59 'IdProtocoloRelacionado',
60   - 'id_protocolo');
  60 + 'id_protocolo_relacionado');
61 61  
62 62 $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_STR,
63 63 'NomeTipoPeticionamento',
... ...
sei/web/modulos/peticionamento/dto/RelTipoContextoPeticionamentoDTO.php
... ... @@ -50,6 +50,11 @@ class RelTipoContextoPeticionamentoDTO extends InfraDTO {
50 50 'tp.nome',
51 51 'tipo_contato tp');
52 52  
  53 + $this->adicionarAtributoTabelaRelacionada(InfraDTO::$PREFIXO_STR,
  54 + 'SinSistema',
  55 + 'tp.sin_sistema',
  56 + 'tipo_contato tp');
  57 +
53 58 $this->configurarPK('IdTipoContextoPeticionamento', InfraDTO::$TIPO_PK_NATIVA );
54 59  
55 60 //versao SEIv2
... ...
sei/web/modulos/peticionamento/editor_peticionamento_processar.php
... ... @@ -190,7 +190,7 @@ PaginaSEIExterna::getInstance()-&gt;fecharHead();
190 190 <textarea id="txaConteudo" name="txaConteudo" rows="10" class="infraTextarea"
191 191 tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>"><?=$txtConteudo?></textarea>
192 192 <script type="text/javascript">
193   - CKEDITOR.replace('txaConteudo',{ 'autoGrow_onStartup':'true', 'toolbar':[["Save"],["Find","Replace","-","RemoveFormat","Bold","Italic","Underline","Strike","Subscript","Superscript","Maiuscula","Minuscula","TextColor","BGColor"],["Cut","Copy","PasteFromWord","PasteText","-","Undo","Redo","ShowBlocks","Symbol","Scayt"],["NumberedList","BulletedList","-","Outdent","Indent","base64image"],["Table","SpecialChar","SimpleLink","linksei","Extenso","Zoom"],["Styles"]]});
  193 + CKEDITOR.replace('txaConteudo',{ 'autoGrow_onStartup':'true', 'toolbar':[["Save"],["Find","Replace","-","RemoveFormat","Bold","Italic","Underline","Strike","Subscript","Superscript","Maiuscula","Minuscula","TextColor","BGColor"],["Cut","Copy","PasteFromWord","PasteText","-","Undo","Redo","ShowBlocks","Symbol","Scayt"],["NumberedList","BulletedList","-","Outdent","Indent","base64image"],["Table","SpecialChar","SimpleLink","Extenso","Zoom"],["Styles"]]});
194 194 </script>
195 195 </div>
196 196 </td>
... ...
sei/web/modulos/peticionamento/gerir_tipo_contexto_peticionamento_cadastro.php
... ... @@ -9,72 +9,37 @@ try {
9 9 require_once dirname(__FILE__).'/../../SEI.php';
10 10  
11 11 session_start();
  12 +
  13 + //////////////////////////////////////////////////////////////////////////////
  14 + InfraDebug::getInstance()->setBolLigado(false);
  15 + InfraDebug::getInstance()->setBolDebugInfra(false);
  16 + InfraDebug::getInstance()->limpar();
  17 + //////////////////////////////////////////////////////////////////////////////
  18 +
12 19 SessaoSei::getInstance()->validarLink();
13 20 SessaoSei::getInstance()->validarPermissao($_GET['acao']);
14   -
15   - }catch(Exception $e){
16   - PaginaSEI::getInstance()->processarExcecao($e);
17   - }
18 21  
19 22 $objRN = new GerirTipoContextoPeticionamentoRN();
20 23  
21 24 if( isset( $_POST['hdnPrincipal'] ) && $_POST['hdnPrincipal'] != "") {
22 25  
23   - $objInfraException = new InfraException();
24   -
25   - // excluindo registros anteriores
26   - $objDTO = new RelTipoContextoPeticionamentoDTO();
27   - $objDTO->retTodos();
28   - $objDTO->setStrSinCadastroInteressado('S');
29   - $objDTO->setStrSinSelecaoInteressado('N');
30   - $objRN->excluir($objRN->listar($objDTO));
31   -
32   - $arrPrincipal = PaginaSEI::getInstance()->getArrValuesSelect($_POST['hdnPrincipal']);
33   -
34   - if(!$arrPrincipal) {
35   - $objInfraException->adicionarValidacao('Informe pelo menos um tipo de interessado.');
36   - }
37   -
38   - $objInfraException->lancarValidacoes();
39   -
40   - foreach($arrPrincipal as $numPrincipal){
41   - $objDTO = new RelTipoContextoPeticionamentoDTO();
42   - $objDTO->setNumIdTipoContextoContato($numPrincipal);
43   - $objDTO->setStrSinCadastroInteressado('S');
44   - $objDTO->setStrSinSelecaoInteressado('N');
45   - $objDTO = $objRN->cadastrar($objDTO);
46   - }
  26 + $arrPrincipal = PaginaSEI::getInstance()->getArrValuesSelect($_POST['hdnPrincipal']);
  27 + $arrPrincipal['cadastro'] = 'S';
  28 + $objRN->cadastrarMultiplo( $arrPrincipal );
47 29  
48 30 }
49 31  
50 32 if( isset( $_POST['hdnPrincipal2'] ) && $_POST['hdnPrincipal2'] != "") {
51 33  
52   - $objInfraException = new InfraException();
53   -
54   - // excluindo registros anteriores
55   - $objDTO2 = new RelTipoContextoPeticionamentoDTO();
56   - $objDTO2->retTodos();
57   - $objDTO2->setStrSinCadastroInteressado('N');
58   - $objDTO2->setStrSinSelecaoInteressado('S');
59   - $objRN->excluir($objRN->listar($objDTO2));
60   -
61   - $arrPrincipal2 = PaginaSEI::getInstance()->getArrValuesSelect($_POST['hdnPrincipal2']);
62   -
63   - if(!$arrPrincipal2) {
64   - $objInfraException->adicionarValidacao('Informe pelo menos um tipo de interessado.');
65   - }
66   -
67   - $objInfraException->lancarValidacoes();
68   -
69   - foreach($arrPrincipal2 as $numPrincipal){
70   - $objDTO2 = new RelTipoContextoPeticionamentoDTO();
71   - $objDTO2->setNumIdTipoContextoContato($numPrincipal);
72   - $objDTO2->setStrSinCadastroInteressado('N');
73   - $objDTO2->setStrSinSelecaoInteressado('S');
74   - $objDTO2 = $objRN->cadastrar($objDTO2);
75   - }
  34 + $arrPrincipal2 = PaginaSEI::getInstance()->getArrValuesSelect($_POST['hdnPrincipal2']);
  35 + $arrPrincipal2['cadastro'] = 'N';
  36 + $objRN->cadastrarMultiplo( $arrPrincipal2 );
  37 +
  38 + }
76 39  
77   - }
  40 + }catch(Exception $e){
  41 + PaginaSEI::getInstance()->processarExcecao($e);
  42 + }
78 43  
79 44 $objDTO = new RelTipoContextoPeticionamentoDTO();
80 45 $objDTO->retTodos();
... ... @@ -163,7 +128,7 @@ $strTitulo = &quot;Peticionamento - Tipos de Contatos Permitidos&quot;;
163 128  
164 129 $arrComandos[] = '<button type="submit" accesskey="s" name="sbmCadastrarGrupoUnidade" value="Salvar" class="infraButton"><span class="infraTeclaAtalho">S</span>alvar</button>';
165 130 $arrComandos[] = '<button type="button" accesskey="c" name="btnFechar" id="btnFechar" value="Fechar" onclick="location.href=\''.PaginaSEI::getInstance()->formatarXHTML(SessaoSei::getInstance()->assinarLink('controlador.php?acao=procedimento_controlar&acao_origem='.$_GET['acao'])).'\';" class="infraButton">Fe<span class="infraTeclaAtalho">c</span>har</button>';
166   -
  131 +
167 132 PaginaSEI::getInstance()->montarDocType();
168 133 PaginaSEI::getInstance()->abrirHtml();
169 134 PaginaSEI::getInstance()->abrirHead();
... ... @@ -369,6 +334,7 @@ PaginaSEI::getInstance()-&gt;abrirBody($strTitulo,&#39;onload=&quot;inicializar();&quot;&#39;);
369 334 ?>
370 335 </form>
371 336 <?
  337 +PaginaSEI::getInstance()->montarAreaDebug();
372 338 PaginaSEI::getInstance()->fecharBody();
373 339 PaginaSEI::getInstance()->fecharHtml();
374 340 ?>
375 341 \ No newline at end of file
... ...
sei/web/modulos/peticionamento/indisponibilidade_peticionamento_cadastro.php
... ... @@ -808,7 +808,7 @@ function OnSubmitForm() {
808 808 var prorrogacaoSim = document.getElementsByName('rdProrrogacao[]')[0].checked;
809 809 if(prorrogacaoSim)
810 810 {
811   - var msg = 'Ao marcar que a presente indisponibilidade justifica a prorrogação automática dos prazos, as intimações eletrônicas com respostas ainda pendentes terão seus prazos prorrogados até as 23h59min59s do primeiro dia útil seguinte ao fim da indisponibilidade indicada. Confirma a prorrogação automática dos prazos?';
  811 + var msg = 'Ao marcar que a presente indisponibilidade justifica a prorrogação automática dos prazos, as Intimações Eletrônicas ainda pendentes de resposta terão seus Prazos Externos que venceriam durante o período da indisponibilidade prorrogados até as 23h59min59s do primeiro dia útil seguinte ao fim da indisponibilidade.\n\nConfirma a prorrogação automática dos prazos?';
812 812  
813 813 if(confirm(msg)){
814 814 return validarCadastro();
... ...
sei/web/modulos/peticionamento/int/GerirTipoContextoPeticionamentoINT.php
... ... @@ -25,10 +25,18 @@ class GerirTipoContextoPeticionamentoINT extends InfraINT {
25 25 if ($strValorItemSelecionado!=null){
26 26  
27 27 $objTipoContextoContatoDTO->setBolExclusaoLogica(false);
28   - $objTipoContextoContatoDTO->adicionarCriterio(array('SinAtivo','Nome'),
29   - array(InfraDTO::$OPER_IGUAL,InfraDTO::$OPER_IGUAL),
30   - array('S',$strValorItemSelecionado),
31   - InfraDTO::$OPER_LOGICO_OR);
  28 + $objTipoContextoContatoDTO->adicionarCriterio(array('SinSistema', 'SinAtivo','Nome'),
  29 + array( InfraDTO::$OPER_IGUAL, InfraDTO::$OPER_IGUAL,InfraDTO::$OPER_LIKE),
  30 + array('N', 'S', '%' . $strValorItemSelecionado . '%'),
  31 + array( InfraDTO::$OPER_LOGICO_AND , InfraDTO::$OPER_LOGICO_AND ) );
  32 + } else {
  33 +
  34 + $objTipoContextoContatoDTO->setBolExclusaoLogica(false);
  35 +
  36 + $objTipoContextoContatoDTO->adicionarCriterio(array('SinSistema', 'SinAtivo' ),
  37 + array( InfraDTO::$OPER_IGUAL, InfraDTO::$OPER_IGUAL ),
  38 + array('N', 'S' ),
  39 + InfraDTO::$OPER_LOGICO_AND );
32 40 }
33 41  
34 42 //SEIv2
... ... @@ -54,6 +62,8 @@ class GerirTipoContextoPeticionamentoINT extends InfraINT {
54 62 $objTipoContextoContatoDTO->setStrSinSelecaoInteressado('S');
55 63 }
56 64  
  65 + $objTipoContextoContatoDTO->setStrSinSistema('N');
  66 +
57 67 $objRelTipoContextoContatoRN = new GerirTipoContextoPeticionamentoRN();
58 68 $arrObjTipoContextoContatoDTO = $objRelTipoContextoContatoRN->listar($objTipoContextoContatoDTO);
59 69 return parent::montarSelectArrInfraDTO($strPrimeiroItemValor, $strPrimeiroItemDescricao, $strValorItemSelecionado, $arrObjTipoContextoContatoDTO , 'IdTipoContextoContato', 'NomeTipoContexto');
... ...
sei/web/modulos/peticionamento/int/TipoProcessoPeticionamentoINT.php
... ... @@ -87,6 +87,55 @@ class TipoProcessoPeticionamentoINT extends InfraINT {
87 87  
88 88 return $stringFim;
89 89 }
  90 +
  91 + public static function validarNivelAcesso($params)
  92 + {
  93 + $objNivelAcessoRN = new NivelAcessoPermitidoRN();
  94 + $objNivelAcessoDTO = new NivelAcessoPermitidoDTO();
  95 + $objNivelAcessoDTO->retTodos();
  96 + $objNivelAcessoDTO->setOrd('StaNivelAcesso', InfraDTO::$TIPO_ORDENACAO_ASC);
  97 + $arrayDescricoes = array(
  98 + 'P' => 'Público',
  99 + 'I' => 'Restrito'
  100 + );
  101 + $msg = '';
  102 + $xml = '<Validacao>';
  103 + $staTipoNivelAcesso = 1;
  104 + if ($params['selNivelAcesso'] == 'P') {
  105 + $staTipoNivelAcesso = 0;
  106 + }
  107 + if($params['hdnIdTipoProcesso'] != '' ){
  108 + $arrTipoProcedimento = PaginaSEI::getInstance()->getArrItensTabelaDinamica($params['hdnIdTipoProcesso']);
  109 + foreach($arrTipoProcedimento as $tipoProcedimento) {
  110 + $objNivelAcessoDTO->setNumIdTipoProcedimento($tipoProcedimento[0]);
  111 + $objNivelAcessoDTO->setStrStaNivelAcesso($staTipoNivelAcesso);
  112 + $contador = $objNivelAcessoRN->contar($objNivelAcessoDTO);
  113 + if($contador <= 0){
  114 + $msg .= $tipoProcedimento[1] . "\r\n";
  115 + }
  116 + }
  117 + } else {
  118 + $objNivelAcessoDTO->setNumIdTipoProcedimento($params['selTipoProcesso']);
  119 + $objNivelAcessoDTO->setStrStaNivelAcesso($staTipoNivelAcesso);
  120 + $contador = $objNivelAcessoRN->contar($objNivelAcessoDTO);
  121 + if($contador <= 0){
  122 + $objTipoProcedimentoConsultaDTO = new TipoProcedimentoDTO();
  123 + $objTipoProcedimentoConsultaDTO->setNumIdTipoProcedimento($params['selTipoProcesso']);
  124 + $objTipoProcedimentoConsultaDTO->retTodos();
  125 + $objTipoProcedimentoRN = new TipoProcedimentoRN();
  126 + $objTipoProcedimentoDTO = $objTipoProcedimentoRN->consultarRN0267($objTipoProcedimentoConsultaDTO);
  127 + $msg .= $objTipoProcedimentoDTO->getStrNome() . "\r\n";
  128 + }
  129 + }
  130 +
  131 + if($msg != ''){
  132 + $msg = 'O Critério não pôde ser cadastrado, pois os Tipo de Processo abaixo não permite o Nível de Acesso [ ' . $arrayDescricoes[$params['selNivelAcesso']] . " ]\n\r" . $msg;
  133 + $xml .= '<MensagemValidacao>' . $msg . '</MensagemValidacao>';
  134 + }
  135 +
  136 + $xml .= '</Validacao>';
  137 + return $xml;
  138 + }
90 139  
91 140 public static function montarSelectNivelAcesso($strPrimeiroItemValor, $strPrimeiroItemDescricao, $strValorItemSelecionado, $idTipoProcedimento = null){
92 141 $objNivelAcessoRN = new NivelAcessoPermitidoRN();
... ... @@ -94,15 +143,32 @@ class TipoProcessoPeticionamentoINT extends InfraINT {
94 143 $objNivelAcessoDTO = new NivelAcessoPermitidoDTO();
95 144 $objNivelAcessoDTO->retTodos();
96 145 $objNivelAcessoDTO->setOrd('StaNivelAcesso', InfraDTO::$TIPO_ORDENACAO_ASC);
97   -
98   - if(!(is_null($idTipoProcedimento))){
99   - $objNivelAcessoDTO->setNumIdTipoProcedimento($idTipoProcedimento);
100   - }
101   -
  146 +
  147 + if($idTipoProcedimento != null ){
  148 + if(!is_int($idTipoProcedimento)){
  149 + $arrTipoProcedimento = PaginaSEI::getInstance()->getArrItensTabelaDinamica($idTipoProcedimento);
  150 + $arrIdTipoProcedimento = array();
  151 + foreach($arrTipoProcedimento as $tipoProcedimento) {
  152 + $arrIdTipoProcedimento[] = $tipoProcedimento[0];
  153 + }
  154 +
  155 + $objNivelAcessoDTO->adicionarCriterio(array('IdTipoProcedimento'), array( InfraDTO::$OPER_IN), array($arrIdTipoProcedimento));
  156 + $objNivelAcessoDTO->setDistinct(true);
  157 + } else {
  158 + $objNivelAcessoDTO->setNumIdTipoProcedimento($idTipoProcedimento);
  159 + }
  160 + }
  161 +
102 162 //listarRN0244Conectado
103 163 $arrObjNivelAcessoDTO = $objNivelAcessoRN->listar($objNivelAcessoDTO);
  164 +
  165 + // removendo as duplicidades na colecao de objetos
  166 + $arrObjNivelAcessoUnicoDTO = array();
  167 + foreach($arrObjNivelAcessoDTO as $objNivelAcessoDTO){
  168 + $arrObjNivelAcessoUnicoDTO[$objNivelAcessoDTO->getStrStaNivelAcesso()] = $objNivelAcessoDTO;
  169 + }
  170 +
104 171 //montarItemSelect
105   -
106 172 $stringFim = '';
107 173 $arrayDescricoes = array();
108 174 $arrayDescricoes[ProtocoloRN::$NA_PUBLICO] = 'Público';
... ... @@ -112,8 +178,8 @@ class TipoProcessoPeticionamentoINT extends InfraINT {
112 178  
113 179 $stringFim = '<option value=""> </option>';
114 180  
115   - if(count($arrObjNivelAcessoDTO) > 0 ){
116   - foreach($arrObjNivelAcessoDTO as $objNivelAcessoDTO){
  181 + if(count($arrObjNivelAcessoUnicoDTO) > 0 ){
  182 + foreach($arrObjNivelAcessoUnicoDTO as $objNivelAcessoDTO){
117 183  
118 184 if( $objNivelAcessoDTO->getStrStaNivelAcesso() != ProtocoloRN::$NA_SIGILOSO ){
119 185  
... ... @@ -134,6 +200,81 @@ class TipoProcessoPeticionamentoINT extends InfraINT {
134 200  
135 201 return $stringFim;
136 202 }
137   -
138   -
  203 +
  204 + public static function validarTipoProcessoComAssunto($params){
  205 + $msg = '';
  206 + $xml = '<Validacao>';
  207 + $relTipoProcedimentoDTO = new RelTipoProcedimentoAssuntoDTO();
  208 + $relTipoProcedimentoDTO->retTodos();
  209 + $relTipoProcedimentoRN = new RelTipoProcedimentoAssuntoRN();
  210 +
  211 + if($params['hdnIdTipoProcesso'] != '' ){
  212 + $arrTipoProcedimento = PaginaSEI::getInstance()->getArrItensTabelaDinamica($params['hdnIdTipoProcesso']);
  213 + foreach($arrTipoProcedimento as $tipoProcedimento) {
  214 + $relTipoProcedimentoDTO->setNumIdTipoProcedimento($tipoProcedimento[0]);
  215 + $arrLista = $relTipoProcedimentoRN->listarRN0192( $relTipoProcedimentoDTO );
  216 +
  217 + if( !is_array( $arrLista ) || count( $arrLista ) == 0 ){
  218 + $objTipoProcedimentoConsultaDTO = new TipoProcedimentoDTO();
  219 + $objTipoProcedimentoConsultaDTO->setNumIdTipoProcedimento($tipoProcedimento[0]);
  220 + $objTipoProcedimentoConsultaDTO->retTodos();
  221 + $objTipoProcedimentoRN = new TipoProcedimentoRN();
  222 + $objTipoProcedimentoDTO = $objTipoProcedimentoRN->consultarRN0267($objTipoProcedimentoConsultaDTO);
  223 + $msg .= $objTipoProcedimentoDTO->getStrNome() . "\r\n";
  224 + }
  225 + }
  226 + } else {
  227 + $relTipoProcedimentoDTO->setNumIdTipoProcedimento($params['selTipoProcesso']);
  228 + $arrLista = $relTipoProcedimentoRN->listarRN0192( $relTipoProcedimentoDTO );
  229 + if( !is_array( $arrLista ) || count( $arrLista ) == 0 ){
  230 + $objTipoProcedimentoConsultaDTO = new TipoProcedimentoDTO();
  231 + $objTipoProcedimentoConsultaDTO->setNumIdTipoProcedimento($params['selTipoProcesso']);
  232 + $objTipoProcedimentoConsultaDTO->retTodos();
  233 + $objTipoProcedimentoRN = new TipoProcedimentoRN();
  234 + $objTipoProcedimentoDTO = $objTipoProcedimentoRN->consultarRN0267($objTipoProcedimentoConsultaDTO);
  235 + $msg .= $objTipoProcedimentoDTO->getStrNome() . "\r\n";
  236 + }
  237 + }
  238 +
  239 + if($msg != ''){
  240 + $msg = 'O Critério não pôde ser cadastrado, pois existe Tipo de Processo que não possue indicação de pelo menos uma sugestão de assunto' . "\n\r" . $msg;
  241 + $xml .= '<MensagemValidacao>' . $msg . '</MensagemValidacao>';
  242 + }
  243 +
  244 + $xml .= '</Validacao>';
  245 + return $xml;
  246 + }
  247 +
  248 + public static function autoCompletarTipoProcedimento($strPalavrasPesquisa, $itensSelecionados = null){
  249 +
  250 + $objTipoProcedimentoDTO = new TipoProcedimentoDTO();
  251 + $objTipoProcedimentoDTO->retNumIdTipoProcedimento();
  252 + $objTipoProcedimentoDTO->retStrNome();
  253 +
  254 + $objTipoProcedimentoDTO->setOrdStrNome(InfraDTO::$TIPO_ORDENACAO_ASC);
  255 +
  256 + $objTipoProcedimentoRN = new TipoProcedimentoRN();
  257 +
  258 + $arrObjTipoProcedimentoDTO = $objTipoProcedimentoRN->listarRN0244($objTipoProcedimentoDTO);
  259 +
  260 + $strPalavrasPesquisa = trim($strPalavrasPesquisa);
  261 +
  262 + $ret = $arrObjTipoProcedimentoDTO;
  263 + if ($strPalavrasPesquisa != '' || $itensSelecionados != null) {
  264 + $ret = array();
  265 + $strPalavrasPesquisa = strtolower($strPalavrasPesquisa);
  266 + foreach($arrObjTipoProcedimentoDTO as $objTipoProcedimentoDTO){
  267 + if($itensSelecionados != null && in_array($objTipoProcedimentoDTO->getNumIdTipoProcedimento(), $itensSelecionados)){
  268 + continue;
  269 + }
  270 + if ($strPalavrasPesquisa != '' && strpos(strtolower($objTipoProcedimentoDTO->getStrNome()),$strPalavrasPesquisa)==false){
  271 + continue;
  272 + }
  273 + $ret[] = $objTipoProcedimentoDTO;
  274 + }
  275 + }
  276 +
  277 + return $ret;
  278 + }
  279 +
139 280 }
140 281 \ No newline at end of file
... ...
sei/web/modulos/peticionamento/md_pet_intercorrente_usu_ext_cadastro_bloco_documentos.php
... ... @@ -25,7 +25,7 @@
25 25 <div class="clear"></div>
26 26  
27 27 <div class="bloco">
28   - <label class="infraLabelObrigatorio" for="selTipoDocumento">Tipo de Documento: <img src="<?= PaginaSEI::getInstance()->getDiretorioImagensGlobal() ?>/ajuda.gif" name="ajuda" <?= PaginaSEI::montarTitleTooltip($strMsgTooltipTipoDocumento) ?> alt="Ajuda" class="infraImg"/></label>
  28 + <label class="infraLabelObrigatorio" for="selTipoDocumento">Tipo de Documento: <img src="<?= PaginaSEI::getInstance()->getDiretorioImagensGlobal() ?>/ajuda.gif" name="ajuda" <?= PaginaSEI::montarTitleTooltip($strMsgTooltipTipoDocumentoPrincipal) ?> alt="Ajuda" class="infraImg"/></label>
29 29 <select id="selTipoDocumento" class="infraSelect" tabindex="<?= PaginaSEI::getInstance()->getProxTabDados(); ?>"></select>
30 30 </div>
31 31  
... ... @@ -37,37 +37,36 @@
37 37 <div class="clear"></div>
38 38  
39 39 <div class="bloco" style="min-width: 200px;" id="divBlcNivelAcesso">
40   - <label class="infraLabelObrigatorio" for="selNivelAcesso">Nível de Acesso:</label>
  40 + <label class="infraLabelObrigatorio" for="selNivelAcesso">Nível de Acesso: <img src="<?= PaginaSEI::getInstance()->getDiretorioImagensGlobal() ?>/ajuda.gif" name="ajuda" <?= PaginaSEI::montarTitleTooltip($strMsgTooltipNivelAcesso) ?> alt="Ajuda" class="infraImg"/></label>
41 41 <div id="divNivelAcesso"></div>
42 42 </div>
43 43  
44 44 <?php if ($exibirHipoteseLegal): ?>
45 45 <div class="bloco" id="divBlcHipoteseLegal" style="display: none">
46   - <label class="infraLabelObrigatorio" for="selHipoteseLegal">Hipótese Legal:</label>
  46 + <label class="infraLabelObrigatorio" for="selHipoteseLegal">Hipótese Legal: <img src="<?= PaginaSEI::getInstance()->getDiretorioImagensGlobal() ?>/ajuda.gif" name="ajuda" <?= PaginaSEI::montarTitleTooltip($strMsgTooltipHipoteseLegal) ?> alt="Ajuda" class="infraImg"/></label>
47 47 <div id="divHipoteseLegal"></div>
48 48 </div>
49 49 <?php endif; ?>
50 50  
51 51 <div class="clear"></div>
52 52  
53   - <div class="bloco" style="width: 272px; margin-top: 23px;">
  53 + <div class="bloco" style="width:290px; margin: 23px 0 11px 0;">
54 54 <label class="infraLabelObrigatorio">Formato: <img src="<?= PaginaSEI::getInstance()->getDiretorioImagensGlobal() ?>/ajuda.gif" name="ajuda" <?= PaginaSEI::montarTitleTooltip($strMsgTooltipFormato) ?> class="infraImg"/></label>
55   - <input type="radio" class="infraRadio" id="rdoNatoDigital" name="rdoFormato" style="margin-left: 5%;" value="N" onclick="exibirTipoConferencia();" tabindex="<?= PaginaSEI::getInstance()->getProxTabDados(); ?>">
  55 + <input type="radio" class="infraRadio" id="rdoNatoDigital" name="rdoFormato" style="margin-left: 5%;" value="N" onclick="exibirTipoConferencia();" tabindex="<?= PaginaSEI::getInstance()->getProxTabDados() +2; ?>">
56 56 <label for="rdoNatoDigital" class="infraLabelRadio">Nato-Digital</label>
57   - <input type="radio" class="infraRadio" id="rdoDigitalizado" name="rdoFormato" style="margin-left: 5%;" value="D" onclick="exibirTipoConferencia();" tabindex="<?= PaginaSEI::getInstance()->getProxTabDados(); ?>">
  57 + <input type="radio" class="infraRadio" id="rdoDigitalizado" name="rdoFormato" style="margin-left: 5%;" value="D" onclick="exibirTipoConferencia();" tabindex="<?= PaginaSEI::getInstance()->getProxTabDados() +2; ?>">
58 58 <label for="rdoDigitalizado" class="infraLabelRadio">Digitalizado</label>
59 59 </div>
60 60  
61 61 <div class="bloco">
62 62 <div id="divTipoConferencia" style="display: none">
63 63 <label class="infraLabelObrigatorio" for="selTipoConferencia">Conferência com o documento digitalizado:</label>
64   - <select id="selTipoConferencia" name="selTipoConferencia" class="infraSelect" tabindex="<?= PaginaSEI::getInstance()->getProxTabDados(); ?>"><?= $strSelectTipoConferencia ?></select>
  64 + <select id="selTipoConferencia" name="selTipoConferencia" class="infraSelect" tabindex="<?= PaginaSEI::getInstance()->getProxTabDados() +2; ?>"><?= $strSelectTipoConferencia ?></select>
65 65 </div>
66   - <button type="button" class="infraButton" id="btnAdicionarDocumento" onclick="adicionarDocumento();" tabindex="<?= PaginaSEI::getInstance()->getProxTabDados(); ?>">Adicionar</button>
  66 + <button type="button" class="infraButton" id="btnAdicionarDocumento" onclick="adicionarDocumento();" tabindex="<?= PaginaSEI::getInstance()->getProxTabDados() +2; ?>">Adicionar</button>
67 67 </div>
68   -
69   - <table width="99%" class="infraTable" summary="Documento" id="tbDocumento" style="display: none">
70   - <caption class="infraCaption">&nbsp;</caption>
  68 + <div style="clear: both"></div>
  69 + <table width="99%" class="infraTable" id="tbDocumento" style="width:99%;">
71 70 <tr>
72 71 <th class="infraTh" width="0" style="display: none;">ID Linha</th> <!--0-->
73 72 <th class="infraTh" width="0" style="display: none;">ID Tipo Documento</th> <!--1-->
... ...
sei/web/modulos/peticionamento/md_pet_intercorrente_usu_ext_cadastro_inicializar.php
... ... @@ -18,10 +18,23 @@
18 18 $strMsgTooltipFormato = 'Selecione a opção “Nato-digital” se o arquivo a ser carregado foi criado originalmente em meio eletrônico.\n\n\n Selecione a opção “Digitalizado” somente se o arquivo a ser carregado foi produzido da digitalização de um documento em papel.';
19 19 $strMsgTooltipTipoDocumento = 'Selecione o Tipo de Documento que melhor identifique o documento a ser carregado e complemente o Tipo no campo ao lado.';
20 20 $strMsgTooltipComplementoTipoDocumento = 'O Complemento do Tipo de Documento é o texto que completa a identificação do documento a ser carregado, adicionando ao nome do Tipo o texto que for digitado no referido campo (Tipo “Recurso” e Complemento “de 1ª Instância” identificará o documento como “Recurso de 1ª Instância”).\n\n\n Exemplos: O Complemento do Tipo “Nota” pode ser “Fiscal Eletrônica” ou “Fiscal nº 75/2016”. O Complemento do Tipo “Comprovante” pode ser “de Pagamento” ou “de Endereço”.';
  21 + //Msgs dos Tooltips de Ajuda
  22 + $strMsgTooltipInteressadoProprioUsuarioExterno = 'Para o Tipo de Processo escolhido o Interessado do processo a ser aberto somente pode ser o próprio Usuário Externo logado no sistema.';
  23 + $strMsgTooltipInteressadoInformandoCPFeCNPJ = 'Para o Tipo de Processo escolhido é possível adicionar os Interessados do processo a ser aberto por meio da indicação de CPF ou CNPJ válidos, devendo complementar seus cadastros caso necessário.';
  24 + $strMsgTooltipInteressadoDigitadoNomeExistente = 'Para o Tipo de Processo escolhido é possível adicionar os Interessados do processo a ser aberto a partir da base de Interessados já existentes. Caso necessário, clique na Lupa "Localizar Interessados" para uma pesquisa mais detalhada ou, na janela aberta, acessar o botão "Cadastrar Novo Interessado".';
  25 + $strMsgTooltipTipoDocumentoPrincipal = 'Como somente pode ter um Documento Principal, o Tipo de Documento correspondente já é previamente definido. Deve, ainda, ser complementado no campo ao lado.';
  26 + $strMsgTooltipTipoDocumento = 'Selecione o Tipo de Documento que melhor identifique o documento a ser carregado e complemente o Tipo no campo ao lado.';
  27 + $strMsgTooltipComplementoTipoDocumento = 'O Complemento do Tipo de Documento é o texto que completa a identificação do documento a ser carregado, adicionando ao nome do Tipo o texto que for digitado no referido campo (Tipo “Recurso” e Complemento “de 1ª Instância” identificará o documento como “Recurso de 1ª Instância”).\n\n\n Exemplos: O Complemento do Tipo “Nota” pode ser “Fiscal Eletrônica” ou “Fiscal nº 75/2016”. O Complemento do Tipo “Comprovante” pode ser “de Pagamento” ou “de Endereço”.';
  28 + $strMsgTooltipNivelAcesso = 'O Nível de Acesso que for indicado é de sua exclusiva responsabilidade e estará condicionado à análise por servidor público, que poderá, motivadamente, alterá-lo a qualquer momento sem necessidade de prévio aviso.\n\n\n Selecione "Público" se no teor do documento a ser carregado não existir informações restritas. Se no teor do documento existir informações restritas, selecione "Restrito" e, em seguida, a Hipótese Legal correspondente.';
  29 + $strMsgTooltipHipoteseLegal = 'Para o Nível de Acesso "Restrito" é obrigatória a indicação da Hipótese Legal correspondente à informação restrita constante no teor do documento a ser carregado, sendo de sua exclusiva responsabilidade a referida indicação. Em caso de dúvidas, pesquise sobre a legislação indicada entre parênteses em cada Hipótese listada.';
  30 + $strMsgTooltipNivelAcessoPadraoPreDefinido = 'Para o Tipo de Processo escolhido o Nível de Acesso é previamente definido.';
  31 + $strMsgTooltipHipoteseLegalPadraoPreDefinido = 'Para o Tipo de Processo escolhido o Nível de Acesso é previamente definido como "Restrito" e, assim, a Hipótese Legal também é previamente definida.';
  32 + $strMsgTooltipFormato = 'Selecione a opção “Nato-digital” se o arquivo a ser carregado foi criado originalmente em meio eletrônico.\n\n\n Selecione a opção “Digitalizado” somente se o arquivo a ser carregado foi produzido da digitalização de um documento em papel.';
21 33 //Fim Msgs
22 34  
23 35  
24   - //RN Tamanho Maximo Arquivo
  36 +
  37 +//RN Tamanho Maximo Arquivo
25 38 $tamanhoMaximo = MdPetIntercorrenteINT::tamanhoMaximoArquivoPermitido();
26 39 //Fim RN
27 40  
... ...
sei/web/modulos/peticionamento/md_pet_intercorrente_usu_ext_cadastro_js.php
1 1 <?php
2 2 /**
3   - * @since 25/11/2016
4   - * @author Jaqueline Mendes <jaqueline.mendes@castgroup.com.br>
5   - * @author André Luiz <andre.luiz@castgroup.com.br>
6   - *
7 3 * Include de JS chamado pela pagina principal de cadastro/ediçao de peticionamento intercorrente
8 4 */
9 5  
... ... @@ -21,8 +17,6 @@
21 17  
22 18 /**
23 19 * Inicia Grid Dinâmica do Processo
24   - * @author: Jaqueline Mendes <jaqueline.mendes@castgroup.com.br>
25   - * @since: 28/11/2016
26 20 */
27 21 function iniciarGridDinamicaProcesso() {
28 22 objTabelaDinamicaProcesso = new infraTabelaDinamica('tbProcesso', 'hdnTbProcesso', false, true);
... ... @@ -40,10 +34,9 @@
40 34  
41 35 /**
42 36 * Add um processo na Grid Dinâmica
43   - * @author: Jaqueline Mendes <jaqueline.mendes@castgroup.com.br>
44   - * @since: 28/11/2016
45 37 */
46 38 function adicionarProcesso() {
  39 + iniciarGridDinamicaProcesso();
47 40 var numeroProcesso = document.getElementById('txtNumeroProcesso');
48 41 var tipoProcesso = document.getElementById('txtTipo');
49 42 var processoIntercorrente = document.getElementById("hdnProcessoIntercorrente");
... ... @@ -60,13 +53,10 @@
60 53  
61 54 //Carrega os campos de documento junto com suas RN's
62 55 carregarFieldDocumentos();
63   -
64 56 }
65 57  
66 58 /**
67 59 * Salva um peticionamento
68   - * @author: Jaqueline Mendes <jaqueline.mendes@castgroup.com.br>
69   - * @since: 28/11/2016
70 60 */
71 61 function abrirPeticionar() {
72 62 if (validarCamposObrigatorios()) {
... ... @@ -84,31 +74,25 @@
84 74  
85 75 /**
86 76 * Validar Campos obrigataórios
87   - * @author: Jaqueline Mendes <jaqueline.mendes@castgroup.com.br>
88   - * @since: 08/12/2016
89 77 */
90 78 function validarCamposObrigatorios() {
91 79 var linhasTbProcesso = document.getElementById('tbProcesso').rows.length;
92   -
93 80 if (linhasTbProcesso == 1) {
94 81 alert('Informe o Processo.');
95 82 return false;
96 83 }
97 84  
98   - /*var linhaTbDocumento = document.getElementById('tbDocumento').rows.length;
99   -
100   - if (linhaTbDocumento == 1) {
101   - alert('Informe ao menos um Documento.');
102   - return false;
103   - }*/
  85 + var linhasTbArquivo = document.getElementById('tbDocumento').rows.length;
  86 + if (linhasTbArquivo == 1) {
  87 + alert('Adicione um Documento.');
  88 + return false;
  89 + }
104 90  
105 91 return true;
106 92 }
107 93  
108 94 /**
109 95 * Funções responsáveis pela validação do processo
110   - * @author: Jaqueline Mendes <jaqueline.mendes@castgroup.com.br>
111   - * @since: 28/11/2016
112 96 */
113 97 function validarNumeroProcesso() {
114 98  
... ... @@ -160,8 +144,6 @@
160 144  
161 145 /**
162 146 * Funções responsáveis pelo controle do fieldset Documentos
163   - * @author: André Luiz <andre.luiz@castgroup.com>
164   - * @since: 28/11/2016
165 147 */
166 148 var NATO_DIGITAL = 'N';
167 149 var DIGITAL = 'D';
... ... @@ -176,7 +158,10 @@
176 158 var objAjaxSelectTipoDocumento = null;
177 159 var objAjaxSelectNivelAcesso = null;
178 160 var objAjaxSelectHipoteseLegal = null;
179   -
  161 + var labelFormato = {
  162 + 'N': 'Nato-Digital',
  163 + 'D': 'Digitalizado'
  164 + };
180 165  
181 166 function inicializarDocumento() {
182 167 iniciarTabelaDinamicaDocumento();
... ... @@ -195,11 +180,8 @@
195 180 //=======================================================//
196 181 //------------------ Fim da Validação -------------------//
197 182 //=======================================================//
198   -
199   -
200 183 }
201 184  
202   -
203 185 function iniciarObjAjaxSelectTipoDocumento() {
204 186 objAjaxSelectTipoDocumento = new infraAjaxMontarSelect('selTipoDocumento', '<?= $strUrlAjaxMontarSelectTipoDocumento?>');
205 187 }
... ... @@ -209,7 +191,6 @@
209 191 objAjaxSelectNivelAcesso.prepararExecucao = function () {
210 192 return 'id_tipo_procedimento=' + document.getElementById('hdnIdTipoProcedimento').value;
211 193 };
212   -
213 194 }
214 195  
215 196 function iniciarObjAjaxSelectHipoteseLegal() {
... ... @@ -217,7 +198,6 @@
217 198 objAjaxSelectHipoteseLegal.processarResultado = function () {
218 199 return 'nivelAcesso=' + RESTRITO;
219 200 }
220   -
221 201 }
222 202  
223 203 function carregarFieldDocumentos() {
... ... @@ -228,7 +208,7 @@
228 208 //RN da Hipotese Legal
229 209 verificarCriterioIntercorrente();
230 210  
231   - document.getElementById('field_documentos').style.display = '';
  211 + document.getElementById('field_documentos').style.display = 'block';
232 212 }
233 213  
234 214 function verificarCriterioIntercorrente() {
... ... @@ -267,13 +247,16 @@
267 247 function criarSelectNivelAcesso() {
268 248 var selNivelAcesso = document.createElement("select");
269 249 var divNivelAcesso = document.getElementById('divNivelAcesso');
  250 + var txtComplementoTipoDocumento = document.getElementById('txtComplementoTipoDocumento');
270 251  
271 252 divNivelAcesso.innerHTML = '';
272 253 selNivelAcesso.name = 'selNivelAcesso';
273 254 selNivelAcesso.id = 'selNivelAcesso';
274 255 selNivelAcesso.className = 'infraSelect';
  256 + selNivelAcesso.tabIndex = txtComplementoTipoDocumento.tabIndex + 1;
  257 +
275 258 selNivelAcesso.addEventListener('change', function () {
276   - exibirHipoteseLegal(selNivelAcesso);
  259 + exibirHipoteseLegal(selNivelAcesso.value);
277 260 });
278 261 divNivelAcesso.appendChild(selNivelAcesso);
279 262  
... ... @@ -303,21 +286,22 @@
303 286 }
304 287  
305 288 function criarSelectHipoteseLegal() {
306   -
307 289 var selHipoteseLegal = document.createElement("select");
308 290 var divHipoteseLegal = document.getElementById('divHipoteseLegal');
309 291 var divBlcHipoteseLegal = document.getElementById('divBlcHipoteseLegal');
  292 + var selNivelAcesso = document.getElementById('selNivelAcesso');
310 293  
311 294 divHipoteseLegal.innerHTML = '';
312 295 divBlcHipoteseLegal.style.display = 'none';
313 296 selHipoteseLegal.id = 'selHipoteseLegal';
314 297 selHipoteseLegal.name = 'selHipoteseLegal';
315 298 selHipoteseLegal.className = 'infraSelect';
  299 + selHipoteseLegal.tabIndex = selNivelAcesso.tabIndex + 1;
  300 +
316 301 divHipoteseLegal.appendChild(selHipoteseLegal);
317 302  
318 303 iniciarObjAjaxSelectHipoteseLegal();
319 304 objAjaxSelectHipoteseLegal.executar();
320   -
321 305 }
322 306  
323 307 function criarHiddenHipoteseLegal(hipoteseLegal) {
... ... @@ -344,12 +328,21 @@
344 328  
345 329  
346 330 function exibirTipoConferencia() {
347   - var formato = document.querySelector('input[name="rdoFormato"]:checked').value;
  331 + var formato = '';
348 332 var divTipoConferencia = document.getElementById('divTipoConferencia');
349 333 var selTipoConferencia = document.getElementById('selTipoConferencia');
350 334 divTipoConferencia.style.display = 'none';
351 335 selTipoConferencia.value = 'null';
352 336  
  337 + var radiosFormato = document.getElementsByName("rdoFormato");
  338 +
  339 + for (var i = 0; i < radiosFormato.length; i++) {
  340 + if (radiosFormato[i].checked == true) {
  341 + formato = radiosFormato[i].value;
  342 + break;
  343 + }
  344 + }
  345 +
353 346 //Ajusta a posição quando o browser é o IE;
354 347 if (isInternetExplorer()) {
355 348 selTipoConferencia.style.marginTop = '-3px';
... ... @@ -360,11 +353,9 @@
360 353 divTipoConferencia.style.marginTop = '-5px';
361 354 divTipoConferencia.style.display = '';
362 355 }
363   -
364 356 }
365 357  
366   - function exibirHipoteseLegal(select) {
367   - var nivelAcesso = select.querySelector('option:checked').value;
  358 + function exibirHipoteseLegal(nivelAcesso) {
368 359 var divBlcHipoteseLegal = document.getElementById('divBlcHipoteseLegal');
369 360  
370 361 document.getElementById('selHipoteseLegal').value = '';
... ... @@ -372,7 +363,6 @@
372 363 if (nivelAcesso == RESTRITO) {
373 364 divBlcHipoteseLegal.style.display = '';
374 365 }
375   -
376 366 }
377 367  
378 368 function verificarTabelaVazia(qtdLinha) {
... ... @@ -435,49 +425,47 @@
435 425 }
436 426  
437 427 function validarDocumento() {
438   - var tipoDocumento = document.querySelector('#selTipoDocumento option:checked');
439   - var complementoTipoDocumento = document.getElementById('txtComplementoTipoDocumento').value.trim();
440   - var nivelAcesso = document.querySelector('#selNivelAcesso option:checked');
441   - var hipoteseLegal = document.querySelector('#selHipoteseLegal option:checked');
442   - var selHipoteseLegal = document.getElementById('selHipoteseLegal');
443   - var formato = document.querySelector('input[name="rdoFormato"]:checked');
444   - var selTipoConferencia = document.getElementById('selTipoConferencia');
445   - var tipoConferencia = document.querySelector('#selTipoConferencia option:checked');
446 428 var fileArquivo = document.getElementById('fileArquivo');
447   -
448 429 if (fileArquivo.value.trim() == '') {
449 430 alert('Informe o arquivo para upload.');
450 431 fileArquivo.focus();
451 432 return false;
452 433 }
453   -
  434 + var tipoDocumento = document.getElementById('selTipoDocumento');
454 435 if (tipoDocumento == null || tipoDocumento.value == 'null') {
455 436 alert('Informe o Tipo de Documento.');
456 437 document.getElementById('selTipoDocumento').focus();
457 438 return false;
458 439 }
459   -
  440 + var complementoTipoDocumento = document.getElementById('txtComplementoTipoDocumento').value.trim();
460 441 if (complementoTipoDocumento == '') {
461 442 alert('Informe o Complemento do Tipo de Documento. Para mais informações, clique no ícone de Ajuda ao lado do nome do campo.');
462 443 document.getElementById('txtComplementoTipoDocumento').focus();
463 444 return false;
464 445 }
  446 + var nivelAcesso = document.getElementById('selNivelAcesso');
465 447  
466   - if (document.querySelector('[name="selNivelAcesso"]').nodeName.toLowerCase() == 'select') {
  448 + if (nivelAcesso) {
467 449 if (nivelAcesso == null || nivelAcesso.value == '') {
468 450 alert('Informe o Nível de Acesso.');
469 451 document.getElementById('selNivelAcesso').focus();
470 452 return false;
471 453 }
472 454 }
  455 + var selHipoteseLegal = document.getElementById('selHipoteseLegal');
473 456  
474   - if (document.querySelector('[name="selHipoteseLegal"]').nodeName.toLowerCase() == 'select') {
475   - if (selHipoteseLegal.offsetHeight > 0) {
476   - if (hipoteseLegal == null || hipoteseLegal.value == '') {
477   - alert('Informe a Hipótese Legal.');
478   - selHipoteseLegal.focus();
479   - return false;
480   - }
  457 + if (EXIBIR_HIPOTESE_LEGAL && nivelAcesso.value == RESTRITO && selHipoteseLegal && selHipoteseLegal.value == '') {
  458 + alert('Informe a Hipótese Legal');
  459 + selHipoteseLegal.focus();
  460 + return false;
  461 + }
  462 +
  463 + var formato = null;
  464 + var rdoFormato = document.getElementsByName('rdoFormato');
  465 + for (var i = 0; i < rdoFormato.length; i++) {
  466 + if (rdoFormato[i].checked == true) {
  467 + formato = parseInt(rdoFormato[i].value);
  468 + break;
481 469 }
482 470 }
483 471  
... ... @@ -487,8 +475,9 @@
487 475 return false;
488 476 }
489 477  
  478 + var selTipoConferencia = document.getElementById('selTipoConferencia');
490 479 if (selTipoConferencia.offsetHeight > 0) {
491   - if (tipoConferencia == null || tipoConferencia.value == 'null') {
  480 + if (selTipoConferencia == null || selTipoConferencia.value == 'null') {
492 481 alert('Informe a Conferência com o documento digitalizado.');
493 482 selTipoConferencia.focus();
494 483 return false;
... ... @@ -496,7 +485,6 @@
496 485 }
497 486  
498 487 return true;
499   -
500 488 }
501 489  
502 490 function dataHoraLocal() {
... ... @@ -523,34 +511,64 @@
523 511 var tamanhoArquivoFormatado = infraFormatarTamanhoBytes(tamanhoArquivo);
524 512 var dataHora = arr['data_hora'];
525 513  
526   - var formato = document.querySelector('input[name="rdoFormato"]:checked').nextSibling.nextSibling.innerHTML.trim();
527   - var tipoDocumento = document.querySelector('#selTipoDocumento option:checked').text;
  514 + var formato = '';
  515 + var rdoFormato = document.getElementsByName('rdoFormato');
  516 +
  517 +
  518 + var elTipoDocumento = document.getElementById('selTipoDocumento');
  519 + var tipoDocumento = elTipoDocumento.options[elTipoDocumento.selectedIndex].text;
  520 +
  521 + // montando o nome do documento
528 522 var complementoTipoDocumento = document.getElementById('txtComplementoTipoDocumento').value.trim();
529 523 complementoTipoDocumento = $("<pre>").text(complementoTipoDocumento).html();
530 524 var documento = tipoDocumento + ' ' + complementoTipoDocumento;
531 525  
  526 + // pegando o nivel de acesso selecionado
532 527 var nivelAcesso = '-';
533   - if (document.querySelector('[name="selNivelAcesso"]').nodeName.toLowerCase() == 'select') {
534   - nivelAcesso = document.querySelector('#selNivelAcesso option:checked').text;
  528 + var idNivelAcesso = '';
  529 + var elNivelAcesso = document.getElementById('selNivelAcesso');
  530 + if (elNivelAcesso) {
  531 + nivelAcesso = elNivelAcesso.options[elNivelAcesso.selectedIndex].text;
  532 + idNivelAcesso = elNivelAcesso.value;
535 533 } else {
536 534 nivelAcesso = document.getElementById('lblNivelAcesso').innerHTML.trim();
  535 + idNivelAcesso = document.getElementById('hdnNivelAcesso').value;
537 536 }
538 537  
539 538 //ids
540 539 var idLinha = gerarIdDocumento();
541 540 var idTipoDocumento = document.getElementById('selTipoDocumento').value;
542 541 var complementoTipoDocumento = document.getElementById('txtComplementoTipoDocumento').value;
543   - var idNivelAcesso = document.getElementById('selNivelAcesso').value;
544   - var idHipoteseLegal = document.getElementById('selHipoteseLegal').value;
545   - var idFormato = document.querySelector('input[name="rdoFormato"]:checked').value;
546   - var idTipoConferencia = document.getElementById('selTipoConferencia').value;
  542 + //var idNivelAcesso = nivelAcesso;
  543 + var idHipoteseLegal = '';
  544 + var selHipoteseLegal = document.getElementById('selHipoteseLegal');
  545 + if(selHipoteseLegal){
  546 + idHipoteseLegal = selHipoteseLegal.value;
  547 + } else {
  548 + idHipoteseLegal = document.getElementById('hdnHipoteseLegal').value;
  549 + }
  550 +
  551 + var idTipoConferencia = '';
  552 + var idFormato = '';
  553 +
  554 + for (var i = 0; i < rdoFormato.length; i++) {
  555 + if (rdoFormato[i].checked == true) {
  556 + idFormato = rdoFormato[i].value;
  557 + break;
  558 + }
  559 + }
  560 +
  561 + if(idFormato == DIGITAL) {
  562 + idTipoConferencia = document.getElementById('selTipoConferencia').value;
  563 + }
  564 +
  565 + formato = labelFormato[idFormato];
547 566  
548 567 var dados = [
549 568 idLinha, idTipoDocumento, complementoTipoDocumento, idNivelAcesso,
550 569 idHipoteseLegal, idFormato, idTipoConferencia, nomeArquivoHash, tamanhoArquivo, nomeArquivo,
551 570 dataHora, tamanhoArquivoFormatado, documento, nivelAcesso, formato
552 571 ];
553   -
554 572 objTabelaDinamicaDocumento.adicionar(dados);
555 573 }
556 574  
... ... @@ -568,13 +586,11 @@
568 586 document.getElementById('selTipoDocumento').value = 'null';
569 587 document.getElementById('txtComplementoTipoDocumento').value = '';
570 588  
571   - var selNivelAcesso = document.querySelector('[name="selNivelAcesso"]');
572   - if (selNivelAcesso.nodeName.toLowerCase() == 'select') {
  589 + if (document.getElementById('selNivelAcesso')) {
573 590 document.getElementById('selNivelAcesso').value = '';
574 591 }
575 592  
576   - var selHipoteseLegal = document.querySelector('[name="selHipoteseLegal"]');
577   - if (selHipoteseLegal.nodeName.toLowerCase() == 'select') {
  593 + if (document.getElementById('selHipoteseLegal')) {
578 594 document.getElementById('selHipoteseLegal').value = '';
579 595 document.getElementById('divBlcHipoteseLegal').style.display = 'none';
580 596 }
... ... @@ -595,10 +611,7 @@
595 611 var tbDocumento = document.getElementById('tbDocumento');
596 612  
597 613 if (tbDocumento.rows.length > 1) {
598   - remover = confirm('Ao remover este processo os documentos abaixo carregados serão desconsiderados e somente' +
599   - ' poderão ser carregados novamente após adicionar novo número de processo.\n\n' +
600   - 'Deseja continuar?');
601   -
  614 + remover = confirm('Ao remover este processo os documentos abaixo carregados serão desconsiderados e somente poderão ser carregados novamente após adicionar novo número de processo.\n\n Deseja continuar?');
602 615 }
603 616  
604 617 if (remover) {
... ... @@ -629,7 +642,6 @@
629 642 //===========================================//
630 643 //--------- Validações pós-upload ----------//
631 644 //===========================================//
632   -
633 645 //Tamanho do Arquivo
634 646 var fileArquivo = document.getElementById('fileArquivo');
635 647 var tamanhoArquivo = (arr['tamanho'] / 1024 / 1024).toFixed(2);
... ... @@ -641,7 +653,6 @@
641 653 return false;
642 654 }
643 655  
644   -
645 656 //Arquivo com o mesmo nome já adicionado
646 657 for (var i = 0; i < tbDocumento.rows.length; i++) {
647 658 var tr = tbDocumento.getElementsByTagName('tr')[i];
... ... @@ -667,7 +678,6 @@
667 678 var fileArquivo = document.getElementById('fileArquivo');
668 679 var ext = fileArquivo.value.split('.').pop();
669 680 var extensaoConfigurada = arrExtensoesPermitidas.length > 0;
670   -
671 681 var tamanhoConfigurado = parseInt(TAMANHO_MAXIMO) > 0;
672 682 if (!tamanhoConfigurado) {
673 683 alert('Limite não configurado na Administração do Sistema.');
... ... @@ -685,13 +695,12 @@
685 695  
686 696 var arquivoPermitido = arrExtensoesPermitidas.indexOf(ext) != -1;
687 697 if (!arquivoPermitido) {
688   - alert("O arquivo selecionado não é permitido.\n" +
689   - "Somente são permitidos arquivos com as extensões:\n" +
690   - arrExtensoesPermitidas.join().replace(/,/g, ' '));
  698 + alert("O arquivo selecionado não é permitido.\n Somente são permitidos arquivos com as extensões:\n" + arrExtensoesPermitidas.join().replace(/,/g, ' '));
691 699 fileArquivo.value = '';
692 700 fileArquivo.focus();
693 701 return false;
694 702 }
  703 +
695 704 return true;
696 705 };
697 706 }
... ...
sei/web/modulos/peticionamento/md_pet_intercorrente_usu_ext_concluir.php
... ... @@ -53,14 +53,16 @@ try {
53 53  
54 54 case 'md_pet_intercorrente_usu_ext_concluir':
55 55 $objMdPetIntercorrenteProcessoRN = new MdPetIntercorrenteProcessoRN();
56   - $objReciboDTO = $objMdPetIntercorrenteProcessoRN->cadastrar($_POST);
  56 + $resultado = $objMdPetIntercorrenteProcessoRN->cadastrar($_POST);
  57 + $objReciboDTO = $resultado['recibo'];
  58 + $documentoDTO = $resultado['documento'];
57 59 /*
58 60 if(! $objReciboDTO){
59 61  
60 62 }
61 63 */
62 64  
63   - $url = "controlador_externo.php?id_md_pet_rel_recibo_protoc=" . $objReciboDTO->getNumIdReciboPeticionamento() . "&acao=recibo_pet_intercorrente_usuario_externo_consultar&acao_origem=recibo_peticionamento_usuario_externo_listar&acao_retorno=recibo_peticionamento_usuario_externo_listar&id_orgao_acesso_externo=0";
  65 + $url = "controlador_externo.php?id_md_pet_rel_recibo_protoc=" . $objReciboDTO->getNumIdReciboPeticionamento() . "&id_documento=" . $documentoDTO->getDblIdDocumento() . "&acao=recibo_pet_intercorrente_usuario_externo_consultar&acao_origem=recibo_peticionamento_usuario_externo_listar&acao_retorno=recibo_peticionamento_usuario_externo_listar&id_orgao_acesso_externo=0";
64 66 $urlAssinada = SessaoSEIExterna::getInstance()->assinarLink($url);
65 67  
66 68 echo "<script>";
... ...
sei/web/modulos/peticionamento/peticionamento_contato_selecionar.php
... ... @@ -80,11 +80,7 @@ try {
80 80  
81 81 $objRelUnidadeTipoContContatoDTO->retNumIdTipoContato();
82 82 $objRelUnidadeTipoContContatoDTO->setNumIdUnidade(SessaoSEIExterna::getInstance()->getNumIdUnidadeAtual());
83   -
84   - //seiv2
85   - //$arrTiposContextosUnidade = InfraArray::converterArrInfraDTO($objRelUnidadeTipoContContatoRN->listarRN0547($objRelUnidadeTipoContContatoDTO),'IdTipoContextoContato');
86   - //alteracoes seiv3
87   - $arrTiposContextosUnidade = InfraArray::converterArrInfraDTO($objRelUnidadeTipoContContatoRN->listarRN0547($objRelUnidadeTipoContContatoDTO),'IdTipoContato');
  83 + $arrTiposContextosUnidade = InfraArray::converterArrInfraDTO($objRelUnidadeTipoContContatoRN->listarRN0547($objRelUnidadeTipoContContatoDTO),'IdTipoContextoContato');
88 84  
89 85 $objContatoDTO = new ContatoDTO();
90 86 $objContatoDTO->retNumIdContato();
... ... @@ -117,11 +113,9 @@ try {
117 113 //$objContatoDTO->retStrSinContatosTipoContextoContato();
118 114 //$objContatoDTO->retStrSinContatosTipoContextoContatoContato();
119 115 //$objContatoDTO->retStrSinContexto();
  116 +
120 117 if (count($arrTiposContextosUnidade)) {
121   - //seiv2
122   - //$objContatoDTO->adicionarCriterio(array('SinLiberadoTipoContextoContatoContato', 'IdTipoContextoContatoContato'),
123   - //alteracoes seiv3
124   - $objContatoDTO->adicionarCriterio(array('SinAtivo', 'IdTipoContato'),
  118 + $objContatoDTO->adicionarCriterio(array('SinLiberadoTipoContextoContatoContato', 'IdTipoContextoContatoContato'),
125 119 array(InfraDTO::$OPER_IGUAL, InfraDTO::$OPER_IN),
126 120 array('S', $arrTiposContextosUnidade),
127 121 InfraDTO::$OPER_LOGICO_OR);
... ... @@ -157,12 +151,9 @@ try {
157 151 $objInfraParametro = new InfraParametro(BancoSEI::getInstance());
158 152  
159 153 if ($_GET['acao']=='contexto_selecionar_unidade' || $_GET['acao']=='contexto_selecionar_usuario'){
160   - //seiv2
161   - //$objContatoDTO->setNumIdTipoContextoContatoContato($_GET['id_tipo_contexto_contato']);
162   - //alteracoes seiv3
163   - $objContatoDTO->setNumIdTipoContato($_GET['id_tipo_contexto_contato']);
  154 + $objContatoDTO->setNumIdTipoContextoContatoContato($_GET['id_tipo_contexto_contato']);
164 155 }
165   -
  156 +
166 157 $strPalavrasPesquisa = PaginaSEIExterna::getInstance()->recuperarCampo('txtPalavrasPesquisaContatos');
167 158  
168 159 if ($strPalavrasPesquisa!=''){
... ... @@ -171,10 +162,7 @@ try {
171 162  
172 163 $numTipoContextoContato = PaginaSEIExterna::getInstance()->recuperarCampo('selTipoContextoContato');
173 164 if ($numTipoContextoContato!='' && $numTipoContextoContato!='null'){
174   - //seiv2
175   - //$objContatoDTO->setNumIdTipoContextoContatoContato($numTipoContextoContato);
176   - //alteracoes seiv3
177   - $objContatoDTO->setNumIdTipoContato($numTipoContextoContato);
  165 + $objContatoDTO->setNumIdTipoContextoContatoContato($numTipoContextoContato);
178 166 }else if(!empty($arrobjRelTipoContextoPeticionamentoDTO)){
179 167 $arrId = array();
180 168 foreach($arrobjRelTipoContextoPeticionamentoDTO as $item){
... ... @@ -268,7 +256,8 @@ try {
268 256 foreach($arrObjContatoDTO as $dto){
269 257  
270 258 $strCssTr='<tr class="infraTrClara">';
271   -
  259 +
  260 +/*
272 261 //seiv2
273 262 //if($dto->getStrSinContexto()=='S'){
274 263  
... ... @@ -301,10 +290,10 @@ try {
301 290 //alteracoes seiv3
302 291 $strResultado .= '<td align="center">'.PaginaSEIExterna::getInstance()->getTrCheck($n,$dto->getNumIdContato(),$strNomeSiglaContato).'</td>';
303 292 }
304   -
305   - $strResultado .= '<td>'.$strNegritoContextoIni.PaginaSEIExterna::getInstance()->formatarXHTML($strNomeSiglaContextoContato).$strNegritoContextoFim.'</td>';
  293 +
  294 + $strResultado .= '<td>'.$strNegritoContextoIni.PaginaSEIExterna::getInstance()->formatarXHTML($strNomeSiglaContextoContato).$strNegritoContextoFim.'</td>';
306 295 $strResultado .= '<td align="center">';
307   -
  296 +
308 297 //seiv2
309 298 //$strResultado .= PaginaSEIExterna::getInstance()->getAcaoTransportarItem($n++,$dto->getNumIdContextoContato());
310 299  
... ... @@ -327,22 +316,21 @@ try {
327 316  
328 317 //se aceita contatos
329 318 //seiv2
330   - /*
331   - if($dto->getStrSinContatosTipoContextoContatoContato()=='S'){
332   - if($_GET['acao']=='peticionamento_contato_selecionar' || $_GET['acao']=='peticionamento_contato_listar'){
333   - if($bolAcaoCadastrar && $bolTipoContextoUnidade){
334   - $strResultado .= '<a href="'.PaginaSEIExterna::getInstance()->formatarXHTML(SessaoSEIExterna::getInstance()->assinarLink('controlador_externo.php?acao_externa=contato_cadastrar&acao_origem='.$_GET['acao'].'&acao_retorno='.$_GET['acao'].'&sin_contexto=N&id_tipo_contexto_contato='.$dto->getNumIdTipoContextoContatoContato().'&id_contexto_contato='.$dto->getNumIdContextoContato())).'" tabindex="'.PaginaSEIExterna::getInstance()->getProxTabTabela().'"><img src="/infra_css/imagens/mais.gif" title="Adicionar Contato" alt="Adicionar Contato" class="infraImg" /></a>&nbsp;';
335   - }
336   - }
337   - }
338   - */
339   -
340   - $strResultado .= '</td></tr>'."\n";
  319 +
  320 + //if($dto->getStrSinContatosTipoContextoContatoContato()=='S'){
  321 + // if($_GET['acao']=='peticionamento_contato_selecionar' || $_GET['acao']=='peticionamento_contato_listar'){
  322 + // if($bolAcaoCadastrar && $bolTipoContextoUnidade){
  323 + // $strResultado .= '<a href="'.PaginaSEIExterna::getInstance()->formatarXHTML(SessaoSEIExterna::getInstance()->assinarLink('controlador_externo.php?acao_externa=contato_cadastrar&acao_origem='.$_GET['acao'].'&acao_retorno='.$_GET['acao'].'&sin_contexto=N&id_tipo_contexto_contato='.$dto->getNumIdTipoContextoContatoContato().'&id_contexto_contato='.$dto->getNumIdContextoContato())).'" tabindex="'.PaginaSEIExterna::getInstance()->getProxTabTabela().'"><img src="/infra_css/imagens/mais.gif" title="Adicionar Contato" alt="Adicionar Contato" class="infraImg" /></a>&nbsp;';
  324 + // }
  325 + // }
  326 + // }
  327 +
  328 + $strResultado .= '</td></tr>'."\n";
341 329 }
342 330  
343 331 //seiv2
344 332 //}
345   -
  333 +*/
346 334 $strResultado .= $strCssTr;
347 335 $strTitle = '';
348 336 $strNomeSigla = $dto->getStrNome();
... ...
sei/web/modulos/peticionamento/peticionamento_interessado_cadastro.php
... ... @@ -348,7 +348,7 @@ try {
348 348 $objContatoDTO->retTodos(true);
349 349 $objContatoDTO->setNumIdContato( $_POST['hdnIdEdicaoAuxiliar'] );
350 350 $objContatoDTO = $objContatoRN->consultarRN0324($objContatoDTO);
351   -
  351 +
352 352 //seiv2
353 353 //$strItensSelSiglaEstado = UfINT::montarSelectSiglaRI0892('null','&nbsp;', $objContatoDTO->getStrSiglaEstado());
354 354  
... ... @@ -412,7 +412,10 @@ try {
412 412 //alteracoes seiv3
413 413 $_POST['hdnIdContextoContato'] = $objContatoDTO->getNumIdContato();
414 414  
415   - if( $_POST['hdnIdContextoContato'] != "" && $_POST['hdnIdContextoContato'] != null ){
  415 +
  416 + //if( $objContatoDTO->getStrStaNaturezaContatoAssociado() == ContatoRN::$TN_PESSOA_JURIDICA ){
  417 +
  418 + //if( $_POST['hdnIdContextoContato'] != "" && $_POST['hdnIdContextoContato'] != null ){
416 419  
417 420 $objContatoPJVinculadaDTO = new ContatoDTO();
418 421 $objContatoPJVinculadaDTO->retNumIdContato();
... ... @@ -430,12 +433,19 @@ try {
430 433 //$_POST['tipoInteressado'] = $objContatoPJVinculadaDTO->getNumIdTipoContextoContato();
431 434  
432 435 //alteracoes seiv3
433   - $_POST['tipoInteressado'] = $objContatoPJVinculadaDTO->getNumIdTipoContato();
  436 + //$_POST['tipoInteressado'] = $objContatoPJVinculadaDTO->getNumIdTipoContato();
  437 + $_POST['tipoInteressado'] = $objContatoDTO->getNumIdTipoContato();
  438 +
  439 + if( $objContatoDTO->getStrStaNaturezaContatoAssociado() == ContatoRN::$TN_PESSOA_JURIDICA ){
  440 + $_POST['txtPjVinculada'] = $objContatoDTO->getStrNomeContatoAssociado();
  441 + } else {
  442 + $_POST['txtPjVinculada'] = "";
  443 + }
434 444  
435 445 $numIdTipoContextoContato = $_POST['tipoInteressado'];
436   - $_POST['txtPjVinculada'] = $objContatoPJVinculadaDTO->getStrNome();
  446 + //$_POST['txtPjVinculada'] = $objContatoPJVinculadaDTO->getStrNome();
437 447  
438   - }
  448 + //}
439 449  
440 450 $strItensSelTipoInteressado = GerirTipoContextoPeticionamentoINT::montarSelectTipoInteressado($strPrimeiroItemValor, $strPrimeiroItemDescricao, $numIdTipoContextoContato, $strTipo);
441 451  
... ... @@ -584,17 +594,26 @@ $strLinkEdicaHash = PaginaSEIExterna::getInstance()-&gt;formatarXHTML(
584 594 <br/><br/>
585 595 </label>
586 596  
587   - <label id="lblPjVinculada" style="display: none;" class="infraLabelObrigatorio">Razão Social da Pessoa Jurídica vinculada:<br/>
588 597  
589 598 <?php if( $_POST['hdnIdContextoContato'] == '') {?>
590 599  
  600 + <label id="lblPjVinculada" style="display: none;" class="infraLabelObrigatorio">Razão Social da Pessoa Jurídica vinculada:<br/>
  601 +
591 602 <input type="text" class="infraText"
592 603 tabindex="<?=PaginaSEIExterna::getInstance()->getProxTabDados()?>"
593 604 onkeypress="return infraMascaraTexto(this,event,250);" maxlength="250"
594 605 name="txtPjVinculada" id="txtPjVinculada"
595 606 autocomplete="off" style="width: 580px; display: none;" />
  607 +
  608 + <input type="hidden" name="hdnIdContextoContato" id="hdnIdContextoContato"
  609 + value="<?php echo $_POST['hdnIdContextoContato']; ?>" />
  610 +
  611 + <br/><br/>
  612 + </label>
596 613  
597   - <?php } else { ?>
  614 + <?php } else if( $_POST['txtPjVinculada'] != "" ) { ?>
  615 +
  616 + <label id="lblPjVinculada" style="display: none;" class="infraLabelObrigatorio">Razão Social da Pessoa Jurídica vinculada:<br/>
598 617  
599 618 <input type="text" class="infraText"
600 619 value="<?php echo $_POST['txtPjVinculada']; ?>"
... ... @@ -602,15 +621,15 @@ $strLinkEdicaHash = PaginaSEIExterna::getInstance()-&gt;formatarXHTML(
602 621 onkeypress="return infraMascaraTexto(this,event,250);" maxlength="250"
603 622 name="txtPjVinculada" id="txtPjVinculada"
604 623 autocomplete="off" style="width: 580px;" />
605   -
606   - <?php } ?>
607   -
608   - <input type="hidden" name="hdnIdContextoContato" id="hdnIdContextoContato"
  624 +
  625 + <input type="hidden" name="hdnIdContextoContato" id="hdnIdContextoContato"
609 626 value="<?php echo $_POST['hdnIdContextoContato']; ?>" />
610 627  
611 628 <br/><br/>
612 629 </label>
613   -
  630 +
  631 + <?php } ?>
  632 +
614 633 <label id="lblCPF" style="display: none;" class="infraLabelObrigatorio">CPF:<br/>
615 634 <input type="text" class="infraText" name="txtCPF" id="txtCPF"
616 635 value="<?php echo $_POST['txtCPF']; ?>"
... ...
sei/web/modulos/peticionamento/peticionamento_interessado_cadastro_js.php
... ... @@ -37,14 +37,26 @@ function selecionarPF2(){
37 37 }
38 38  
39 39 function ocultarComboPJVinculada(){
40   - document.getElementById('lblPjVinculada').style.display = 'none';
41   - document.getElementById('txtPjVinculada').style.display = 'none';
42   - document.getElementById('txtPjVinculada').value = '';
  40 +
  41 + if( document.getElementById('lblPjVinculada') != null ){
  42 + document.getElementById('lblPjVinculada').style.display = 'none';
  43 + }
  44 +
  45 + if( document.getElementById('txtPjVinculada') != null ){
  46 +
  47 + document.getElementById('txtPjVinculada').style.display = 'none';
  48 + document.getElementById('txtPjVinculada').value = '';
  49 +
  50 + }
  51 +
43 52 }
44 53  
45 54 function mostrarComboPJVinculada(){
46   - document.getElementById('lblPjVinculada').style.display = '';
47   - document.getElementById('txtPjVinculada').style.display = '';
  55 +
  56 + if( document.getElementById('lblPjVinculada') != null ){
  57 + document.getElementById('lblPjVinculada').style.display = '';
  58 + document.getElementById('txtPjVinculada').style.display = '';
  59 + }
48 60 }
49 61  
50 62 function selecionarPJ(){
... ... @@ -253,7 +265,7 @@ function inicializar(){
253 265 document.getElementById("txtCPF").value = "<?= InfraUtil::formatarCpf( $_POST['txtCPF'] ) ?>";
254 266 <?php } ?>
255 267  
256   - <?php if( isset( $_POST['hdnIdContextoContato'] ) && isset( $_GET['cpf'] ) ) { ?>
  268 + <?php if( isset( $_POST['hdnIdContextoContato'] ) && $_POST['txtPjVinculada'] != "" && isset( $_GET['cpf'] ) ) { ?>
257 269  
258 270 //rdPF2 com vinculo
259 271 document.getElementById("rdPF2").checked = 'checked';
... ... @@ -329,13 +341,24 @@ function inicializar(){
329 341  
330 342 <?php if( isset($_GET['edicaoExibir']) ) { ?>
331 343  
  344 + if( document.getElementById('txtPjVinculada') != null) {
332 345 document.getElementById('txtPjVinculada').disabled = true;
333 346 document.getElementById('txtPjVinculada').disabled = 'disabled';
  347 + }
  348 +
  349 + document.getElementById('tipoInteressado').disabled = true;
  350 + document.getElementById('tipoInteressado').disabled = 'disabled';
  351 +
  352 + document.getElementById("rdPF").disabled = true;
  353 + document.getElementById("rdPF").disabled = 'disabled';
334 354  
335   - document.getElementById('tipoInteressado').disabled = true;
336   - document.getElementById('tipoInteressado').disabled = 'disabled';
  355 + document.getElementById("rdPF1").disabled = true;
  356 + document.getElementById("rdPF1").disabled = 'disabled';
337 357  
338   - <?php if( isset( $_GET['cpf'] ) ) { ?>
  358 + document.getElementById("rdPF2").disabled = true;
  359 + document.getElementById("rdPF2").disabled = 'disabled';
  360 +
  361 + <?php if( isset( $_GET['cpf'] ) ) { ?>
339 362  
340 363 document.getElementById("rdPF").disabled = true;
341 364 document.getElementById("rdPF").disabled = 'disabled';
... ... @@ -378,6 +401,7 @@ function inicializar(){
378 401 <?php } ?>
379 402  
380 403 mostrarCampos();
  404 +
381 405 }
382 406  
383 407 function returnDateTime(valor){
... ...
sei/web/modulos/peticionamento/recibo_peticionamento_intercorrente_usuario_externo_consulta.php
... ... @@ -89,6 +89,7 @@ try {
89 89 $documentoReciboDTO->retStrProtocoloDocumentoFormatado();
90 90 $documentoReciboDTO->setDblIdProcedimento( $objReciboPeticionamentoDTO->getNumIdProtocolo() );
91 91 $documentoReciboDTO->setNumIdSerie( $idSerieParam );
  92 + $documentoReciboDTO->setDblIdDocumento( $_GET['id_documento'] );
92 93 $documentoReciboDTO = $documentoRN->consultarRN0005( $documentoReciboDTO );
93 94  
94 95 if( $documentoReciboDTO != null ){
... ...
sei/web/modulos/peticionamento/rn/AtualizadorModuloPeticionamentoRN.php
... ... @@ -111,6 +111,17 @@ class AtualizadorModuloPeticionamentoRN extends InfraRN
111 111 BancoSEI::getInstance()->criarSequencialNativa('seq_md_pet_criterio', 1);
112 112 }
113 113 // FIM 7048
  114 +
  115 + //Criando campo md_pet_rel_recibo_protoc.id_protocolo_relacionado caso ainda nao exista
  116 + $coluna = $objInfraMetaBD->obterColunasTabela('md_pet_rel_recibo_protoc', 'id_protocolo_relacionado');
  117 +
  118 + if( $coluna == null || !is_array( $coluna ) ){
  119 +
  120 + $objInfraMetaBD->adicionarColuna('md_pet_rel_recibo_protoc', 'id_protocolo_relacionado', '' . $objInfraMetaBD->tipoNumeroGrande() , 'NULL');
  121 +
  122 + $objInfraMetaBD->adicionarChaveEstrangeira('fk5_md_pet_rel_recibo_protoc', 'md_pet_rel_recibo_protoc', array('id_protocolo_relacionado'), 'protocolo', array('id_protocolo'));
  123 +
  124 + }
114 125  
115 126 //Atualizando parametro para controlar versao do modulo
116 127 $this->logar('ATUALIZANDO PARAMETRO ' . $this->nomeParametroModulo . ' NA TABELA infra_parametro PARA CONTROLAR A VERSÃO DO MÓDULO');
... ...
sei/web/modulos/peticionamento/rn/CriterioIntercorrentePeticionamentoRN.php
... ... @@ -153,6 +153,16 @@ class CriterioIntercorrentePeticionamentoRN extends InfraRN
153 153 */
154 154 public function cadastrarPadrao(CriterioIntercorrentePeticionamentoDTO $objCriterioIntercorrentePeticionamentoDTO)
155 155 {
  156 + $objCriterioIntercorrentePadraoConsultaDTO = new CriterioIntercorrentePeticionamentoDTO();
  157 + $objCriterioIntercorrentePadraoConsultaDTO->setStrSinCriterioPadrao('S');
  158 + $objCriterioIntercorrentePadraoConsultaDTO->retTodos();
  159 + $objCriterioIntercorrentePeticionamentoRN = new CriterioIntercorrentePeticionamentoRN();
  160 + $objCriterioIntercorrentePadraoDTO = $objCriterioIntercorrentePeticionamentoRN->consultar($objCriterioIntercorrentePadraoConsultaDTO);
  161 +
  162 + if($objCriterioIntercorrentePadraoDTO){
  163 + $this->excluir(array($objCriterioIntercorrentePadraoDTO));
  164 + }
  165 +
156 166 $objCriterioIntercorrentePeticionamentoDTO->setStrSinCriterioPadrao('S');
157 167 return $this->cadastrarControlado($objCriterioIntercorrentePeticionamentoDTO);
158 168 }
... ... @@ -237,7 +247,10 @@ class CriterioIntercorrentePeticionamentoRN extends InfraRN
237 247 try {
238 248  
239 249 SessaoSEI::getInstance()->validarAuditarPermissao('criterio_intercorrente_peticionamento_excluir', __METHOD__, $arrCriterioIntercorrentePeticionamentoDTO);
240   -
  250 + $objCriterioIntercorrentePeticionamentoBD = new CriterioIntercorrentePeticionamentoBD($this->getObjInfraIBanco());
  251 + for($i = 0; $i < count($arrCriterioIntercorrentePeticionamentoDTO); $i ++) {
  252 + $objCriterioIntercorrentePeticionamentoBD->excluir($arrCriterioIntercorrentePeticionamentoDTO[$i]);
  253 + }
241 254 } catch (Exception $e) {
242 255 throw new InfraException ('Erro excluindo.', $e);
243 256 }
... ... @@ -257,10 +270,17 @@ class CriterioIntercorrentePeticionamentoRN extends InfraRN
257 270 {
258 271 $objCriterioIntercorrentePeticionamentoValidarDTO = new CriterioIntercorrentePeticionamentoDTO();
259 272 $objCriterioIntercorrentePeticionamentoValidarDTO->setNumIdTipoProcedimento($objCriterioIntercorrentePeticionamentoDTO->getNumIdTipoProcedimento());
  273 + $objCriterioIntercorrentePeticionamentoValidarDTO->setStrSinCriterioPadrao($objCriterioIntercorrentePeticionamentoDTO->getStrSinCriterioPadrao());
  274 +
  275 + if($objCriterioIntercorrentePeticionamentoDTO->isSetNumIdCriterioIntercorrentePeticionamento()){
  276 + $objCriterioIntercorrentePeticionamentoValidarDTO->setNumIdCriterioIntercorrentePeticionamento($objCriterioIntercorrentePeticionamentoDTO->getNumIdCriterioIntercorrentePeticionamento(),InfraDTO::$OPER_DIFERENTE);
  277 + }
  278 +
260 279 $objCriterioIntercorrentePeticionamentoValidarDTO->retTodos();
261 280 $arrObjCriterioIntercorrentePeticionamentoValidarDTO = $this->consultar($objCriterioIntercorrentePeticionamentoValidarDTO);
262 281  
263   - if(count($arrObjCriterioIntercorrentePeticionamentoValidarDTO) > 0){
  282 + if((count($arrObjCriterioIntercorrentePeticionamentoValidarDTO) > 0 ) &&
  283 + $objCriterioIntercorrentePeticionamentoDTO->getStrSinCriterioPadrao() == $arrObjCriterioIntercorrentePeticionamentoValidarDTO->getStrSinCriterioPadrao()){
264 284 $objInfraException->adicionarValidacao('Tipo de Processo já possui Critério Intercorrente associado.');
265 285 }
266 286  
... ... @@ -291,6 +311,36 @@ class CriterioIntercorrentePeticionamentoRN extends InfraRN
291 311 $objInfraException->adicionarValidacao('Hipótese legal não informada.');
292 312 }
293 313 }
  314 +
  315 + $this->_validarTipoProcedimentoComAssunto($objCriterioIntercorrentePeticionamentoDTO, $objInfraException);
  316 + }
  317 +
  318 + /**
  319 + * Short description of method _validarTipoProcessoAssociado
  320 + *
  321 + * @access private
  322 + * @author Marcelo Bezerra <marcelo.cast@castgroup.com.br>
  323 + * @param $objTipoProcessoPeticionamentoDTO
  324 + * @param $objInfraException
  325 + * @return mixed
  326 + */
  327 + private function _validarTipoProcedimentoComAssunto(CriterioIntercorrentePeticionamentoDTO $objCriterioIntercorrentePeticionamentoDTO, InfraException $objInfraException){
  328 +
  329 + //VALIDA NOVA REGRA ADICIONADA
  330 + // somente aceita tipo de processo que na parametrização do SEI tenha
  331 + //indicação de pelo menos uma sugestao de assunto
  332 +
  333 + $relTipoProcedimentoDTO = new RelTipoProcedimentoAssuntoDTO();
  334 + $relTipoProcedimentoDTO->retTodos();
  335 + $relTipoProcedimentoDTO->setNumIdTipoProcedimento( $objCriterioIntercorrentePeticionamentoDTO->getNumIdTipoProcedimento() );
  336 +
  337 + $relTipoProcedimentoRN = new RelTipoProcedimentoAssuntoRN();
  338 + $arrLista = $relTipoProcedimentoRN->listarRN0192( $relTipoProcedimentoDTO );
  339 +
  340 + if( !is_array( $arrLista ) || count( $arrLista ) == 0 ){
  341 + $msg = "Por favor informe um tipo de processo que na parametrização do SEI tenha indicação de pelo menos uma sugestão de assunto.";
  342 + $objInfraException->adicionarValidacao ($msg);
  343 + }
294 344 }
295 345  
296 346 private function _retornaValorParametroHipoteseLegal(){
... ...
sei/web/modulos/peticionamento/rn/DocumentoPeticionamentoRN.php
... ... @@ -120,7 +120,8 @@ class DocumentoPeticionamentoRN extends InfraRN {
120 120 }
121 121  
122 122 if (InfraString::isBolVazia($objDocumento->dataHoraDeProducao)) {
123   - $objInfraException->lancarValidacao('Data do documento não informada.');
  123 + //$objInfraException->lancarValidacao('Data do documento não informada.');
  124 + throw new InfraException('Data do documento não informada.');
124 125 }
125 126  
126 127 $objProcedimentoDTO2 = new ProcedimentoDTO();
... ... @@ -1478,41 +1479,49 @@ class DocumentoPeticionamentoRN extends InfraRN {
1478 1479  
1479 1480 $objTarjaAssinaturaDTO = new TarjaAssinaturaDTO();
1480 1481 $objTarjaAssinaturaDTO->retNumIdTarjaAssinatura();
  1482 +
  1483 + if ($objUsuarioDTO->getStrStaTipo() == UsuarioRN::$TU_EXTERNO) {
  1484 + $objTarjaAssinaturaDTO->setStrStaTarjaAssinatura( AssinaturaPeticionamentoRN::$TT_ASSINATURA_SENHA_PETICIONAMENTO );
  1485 + } else {
  1486 + if ($objProtocoloDTO->getStrStaProtocolo()==ProtocoloRN::$TP_DOCUMENTO_GERADO) {
  1487 + if ($objAssinaturaDTO->getStrStaFormaAutenticacao() == AssinaturaRN::$TA_SENHA) {
  1488 + $objTarjaAssinaturaDTO->setStrStaTarjaAssinatura(TarjaAssinaturaRN::$TT_ASSINATURA_SENHA);
  1489 + // $objTarjaAssinaturaDTO->setStrStaTarjaAssinatura(TarjaAssinaturaRN::$TT_AUTENTICACAO_SENHA);
  1490 + } else {
  1491 + $objTarjaAssinaturaDTO->setStrStaTarjaAssinatura(TarjaAssinaturaRN::$TT_ASSINATURA_CERTIFICADO_DIGITAL);
  1492 + }
  1493 + }else{
  1494 +
  1495 + //CUSTOMIZACAO DA TARJA DE ASSINATURA PARA DOC ANEXO NATO-DIGITAL
  1496 + $arrDocs = $objAssinaturaDTO->getArrObjDocumentoDTO();
  1497 +
  1498 + if( is_array( $arrDocs ) && count( $arrDocs ) > 0 ) {
  1499 +
  1500 + $documentoDTOParaAssinar = $arrDocs[0];
  1501 +
  1502 + if( $documentoDTOParaAssinar->isSetStrDescricaoTipoConferencia()
  1503 + && $documentoDTOParaAssinar->getStrDescricaoTipoConferencia() == "do próprio documento nato-digital" ){
  1504 +
  1505 + //vai usar tarja customizada
  1506 + $objTarjaAssinaturaDTO->setStrStaTarjaAssinatura( AssinaturaPeticionamentoRN::$TT_ASSINATURA_SENHA_PETICIONAMENTO );
  1507 +
  1508 + } else {
  1509 +
  1510 + //vai usar a tarja normal
  1511 + $objTarjaAssinaturaDTO->setStrStaTarjaAssinatura(TarjaAssinaturaRN::$TT_AUTENTICACAO_SENHA);
  1512 +
  1513 + }
  1514 + }
  1515 +
  1516 + }
  1517 + }
1481 1518  
1482   - if ($objProtocoloDTO->getStrStaProtocolo()==ProtocoloRN::$TP_DOCUMENTO_GERADO) {
1483   - if ($objAssinaturaDTO->getStrStaFormaAutenticacao() == AssinaturaRN::$TA_SENHA) {
1484   - $objTarjaAssinaturaDTO->setStrStaTarjaAssinatura(TarjaAssinaturaRN::$TT_ASSINATURA_SENHA);
1485   - } else {
1486   - $objTarjaAssinaturaDTO->setStrStaTarjaAssinatura(TarjaAssinaturaRN::$TT_ASSINATURA_CERTIFICADO_DIGITAL);
1487   - }
1488   - }else{
1489   -
1490   - //CUSTOMIZACAO DA TARJA DE ASSINATURA PARA DOC ANEXO NATO-DIGITAL
1491   - $arrDocs = $objAssinaturaDTO->getArrObjDocumentoDTO();
1492   -
1493   - if( is_array( $arrDocs ) && count( $arrDocs ) > 0 ) {
1494   -
1495   - $documentoDTOParaAssinar = $arrDocs[0];
1496   -
1497   - if( $documentoDTOParaAssinar->isSetStrDescricaoTipoConferencia()
1498   - && $documentoDTOParaAssinar->getStrDescricaoTipoConferencia() == "do próprio documento nato-digital" ){
1499   -
1500   - //vai usar tarja customizada
1501   - $objTarjaAssinaturaDTO->setStrStaTarjaAssinatura( AssinaturaPeticionamentoRN::$TT_ASSINATURA_SENHA_PETICIONAMENTO );
1502   -
1503   - } else {
1504   -
1505   - //vai usar a tarja normal
1506   - $objTarjaAssinaturaDTO->setStrStaTarjaAssinatura(TarjaAssinaturaRN::$TT_AUTENTICACAO_SENHA);
1507   -
1508   - }
1509   - }
1510 1519  
1511   - }
1512 1520  
1513 1521 $objTarjaAssinaturaRN = new TarjaAssinaturaRN();
1514 1522 $objTarjaAssinaturaDTO = $objTarjaAssinaturaRN->consultar($objTarjaAssinaturaDTO);
1515   -
  1523 +//ini_set('xdebug.var_display_max_depth', 10); ini_set('xdebug.var_display_max_children', 256); ini_set('xdebug.var_display_max_data', 1024); echo '<pre>';
  1524 +//var_dump($objTarjaAssinaturaDTO); echo '</pre>'; exit;
1516 1525 $objAtividadeRN = new AtividadeRN();
1517 1526 $arrObjAssinaturaDTO = array();
1518 1527 $arrObjDocumentoDTOCredencialAssinatura = array();
... ...
sei/web/modulos/peticionamento/rn/EmailNotificacaoPetIntercorrenteRN.php
... ... @@ -33,11 +33,12 @@ class EmailNotificacaoPetIntercorrenteRN extends EmailNotificacaoPeticionamentoR
33 33 protected function notificaoPeticionamentoExternoConectado($arrParams ){
34 34  
35 35 $objInfraParametro = new InfraParametro( $this->getObjInfraIBanco() );
36   - $arrParametros = $arrParams[0]; //parametros adicionais fornecidos no formulario de peticionamento
37   - $objUnidadeDTO = $arrParams[1]; //UnidadeDTO da unidade geradora do processo
38   - $objProcedimentoDTO = $arrParams[2]; //ProcedimentoDTO para vincular o recibo ao processo correto
39   - $arrParticipantesParametro = $arrParams[3]; //array de ParticipanteDTO
40   - $reciboDTOBasico = $arrParams[4]; //Recibo
  36 + $arrParametros = $arrParams[0]; // parametros adicionais fornecidos no formulario de peticionamento
  37 + $objUnidadeDTO = $arrParams[1]; // UnidadeDTO da unidade geradora do processo
  38 + $objProcedimentoDTO = $arrParams[2]; // ProcedimentoDTO para vincular o recibo ao processo correto
  39 + $arrParticipantesParametro = $arrParams[3]; // array de ParticipanteDTO
  40 + $reciboDTOBasico = $arrParams[4]; // Recibo
  41 + $documentoDTORecibo = $arrParams[5]; // Documento Recibo
41 42  
42 43 //consultar email da unidade (orgao)
43 44 $orgaoRN = new OrgaoRN();
... ... @@ -105,6 +106,7 @@ class EmailNotificacaoPetIntercorrenteRN extends EmailNotificacaoPeticionamentoR
105 106 $documentoDTO->retTodos();
106 107 $documentoDTO->setDblIdProcedimento( $reciboDTOBasico->getNumIdProtocolo() );
107 108 $documentoDTO->setNumIdSerie( $idSerieParam );
  109 + $documentoDTO->setDblIdDocumento( $documentoDTORecibo->getDblIdDocumento() );
108 110  
109 111 $documentoDTO = $documentoRN->consultarRN0005( $documentoDTO );
110 112  
... ...
sei/web/modulos/peticionamento/rn/EmailNotificacaoPeticionamentoRN.php
... ... @@ -43,6 +43,7 @@ class EmailNotificacaoPeticionamentoRN extends InfraRN {
43 43 $orgaoRN = new OrgaoRN();
44 44 $objOrgaoDTO = new OrgaoDTO();
45 45 $objOrgaoDTO->retTodos();
  46 + $objOrgaoDTO->retStrSitioInternetContato();
46 47 $objOrgaoDTO->setNumIdOrgao( $objUnidadeDTO->getNumIdOrgao() );
47 48 $objOrgaoDTO->setStrSinAtivo('S');
48 49 $objOrgaoDTO = $orgaoRN->consultarRN1352( $objOrgaoDTO );
... ... @@ -162,7 +163,7 @@ class EmailNotificacaoPeticionamentoRN extends InfraRN {
162 163 $strConteudo = str_replace('@documento_recibo_eletronico_de_protocolo@',$documentoDTO->getStrProtocoloDocumentoFormatado(),$strConteudo);
163 164 $strConteudo = str_replace('@sigla_orgao@',$objOrgaoDTO->getStrSigla(),$strConteudo);
164 165 $strConteudo = str_replace('@descricao_orgao@',$objOrgaoDTO->getStrDescricao(),$strConteudo);
165   - $strConteudo = str_replace('@sitio_internet_orgao@',$objOrgaoDTO->getStrSitioInternet(),$strConteudo);
  166 + $strConteudo = str_replace('@sitio_internet_orgao@', $objOrgaoDTO->getStrSitioInternetContato() ,$strConteudo);
166 167  
167 168 InfraMail::enviarConfigurado(ConfiguracaoSEI::getInstance(), $strDe, $strPara, null, null, $strAssunto, $strConteudo);
168 169  
... ... @@ -214,7 +215,7 @@ class EmailNotificacaoPeticionamentoRN extends InfraRN {
214 215 $strConteudo = str_replace('@documento_recibo_eletronico_de_protocolo@',$documentoDTO->getStrProtocoloDocumentoFormatado(),$strConteudo);
215 216 $strConteudo = str_replace('@sigla_orgao@',$objOrgaoDTO->getStrSigla(),$strConteudo);
216 217 $strConteudo = str_replace('@descricao_orgao@',$objOrgaoDTO->getStrDescricao(),$strConteudo);
217   - $strConteudo = str_replace('@sitio_internet_orgao@',$objOrgaoDTO->getStrSitioInternet(),$strConteudo);
  218 + $strConteudo = str_replace('@sitio_internet_orgao@', $objOrgaoDTO->getStrSitioInternetContato() ,$strConteudo);
218 219  
219 220 foreach($arrEmailUnidade as $mail){
220 221 $strPara = $objEmailSistemaDTO->getStrPara();
... ...
sei/web/modulos/peticionamento/rn/GerirTipoContextoPeticionamentoRN.php
... ... @@ -110,6 +110,102 @@ class GerirTipoContextoPeticionamentoRN extends InfraRN {
110 110 throw new InfraException ('Erro cadastrando Tipo de Interessado.', $e );
111 111 }
112 112 }
  113 +
  114 + private function validarTiposReservados( $arrRelTipoContextoPeticionamentoDTO, InfraException $objInfraException){
  115 +
  116 + $strMensagem = "";
  117 +
  118 + if( is_array( $arrRelTipoContextoPeticionamentoDTO ) && count( $arrRelTipoContextoPeticionamentoDTO ) > 0 ){
  119 +
  120 + $arrIdTipo = array();
  121 +
  122 + foreach( $arrRelTipoContextoPeticionamentoDTO as $itemDTO ){
  123 +
  124 + $idTipo = $itemDTO->getNumIdTipoContextoContato();
  125 + array_push( $arrIdTipo , $idTipo);
  126 + }
  127 +
  128 + $objTipoContatoRN = new TipoContatoRN();
  129 + $objTipoContatoDTO = new TipoContatoDTO();
  130 + $objTipoContatoDTO->retTodos();
  131 +
  132 + $objTipoContatoDTO->adicionarCriterio(array('SinSistema', 'IdTipoContato'),
  133 + array( InfraDTO::$OPER_IGUAL , InfraDTO::$OPER_IN ),
  134 + array( 'S', $arrIdTipo ) ,
  135 + InfraDTO::$OPER_LOGICO_AND
  136 + );
  137 +
  138 + $arrTipoContatoReservado = $objTipoContatoRN->listarRN0337( $objTipoContatoDTO );
  139 +
  140 + //se tiver tipos do sistema, monta mensagem de erro
  141 + if( is_array( $arrTipoContatoReservado ) && count( $arrTipoContatoReservado ) > 0 ){
  142 +
  143 + foreach( $arrTipoContatoReservado as $itemTipoContatoDTO ){
  144 +
  145 + $strMensagem .= $itemTipoContatoDTO->getStrNome() . "\n" ;
  146 + }
  147 +
  148 + }
  149 +
  150 + }
  151 +
  152 + if( $strMensagem != ""){
  153 + $objInfraException->adicionarValidacao( " Nao permitido adicionar tipos de interessado reservados do sistema. Os seguintes tipos de interessado não são permitidos: \n ". $strMensagem );
  154 + }
  155 +
  156 + }
  157 +
  158 + protected function cadastrarMultiploControlado( $arrPrincipal ){
  159 +
  160 + $objInfraException = new InfraException();
  161 +
  162 + // excluindo registros anteriores
  163 + $objDTO = new RelTipoContextoPeticionamentoDTO();
  164 + $objDTO->retTodos();
  165 + $cadastro = $arrPrincipal['cadastro'];
  166 +
  167 + if( $cadastro == 'S'){
  168 + $objDTO->setStrSinCadastroInteressado('S');
  169 + $objDTO->setStrSinSelecaoInteressado('N');
  170 +
  171 + } else if( $cadastro == 'N'){
  172 + $objDTO->setStrSinCadastroInteressado('N');
  173 + $objDTO->setStrSinSelecaoInteressado('S');
  174 + }
  175 +
  176 + unset( $arrPrincipal['cadastro'] );
  177 +
  178 + $lista = $this->listar($objDTO);
  179 + $this->validarTiposReservados( $lista, $objInfraException );
  180 +
  181 + $this->excluir( $lista );
  182 +
  183 + //$arrPrincipal = PaginaSEI::getInstance()->getArrValuesSelect($_POST['hdnPrincipal']);
  184 +
  185 + if(!$arrPrincipal) {
  186 + $objInfraException->adicionarValidacao('Informe pelo menos um tipo de interessado.');
  187 + }
  188 +
  189 + $objInfraException->lancarValidacoes();
  190 +
  191 + foreach($arrPrincipal as $numPrincipal){
  192 +
  193 + $objDTO = new RelTipoContextoPeticionamentoDTO();
  194 + $objDTO->setNumIdTipoContextoContato($numPrincipal);
  195 +
  196 + if( $cadastro == 'S'){
  197 + $objDTO->setStrSinCadastroInteressado('S');
  198 + $objDTO->setStrSinSelecaoInteressado('N');
  199 +
  200 + } else if( $cadastro == 'N'){
  201 + $objDTO->setStrSinCadastroInteressado('N');
  202 + $objDTO->setStrSinSelecaoInteressado('S');
  203 + }
  204 +
  205 + $objDTO = $this->cadastrar($objDTO);
  206 + }
  207 +
  208 + }
113 209  
114 210 }
115 211 ?>
116 212 \ No newline at end of file
... ...
sei/web/modulos/peticionamento/rn/MdPetIntercorrenteProcessoRN.php
... ... @@ -22,6 +22,7 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN {
22 22 private $senha = null;
23 23 private $reciboDTO = null;
24 24 private $participantesDTO = null;
  25 + private $documentoRecibo = null;
25 26 private $arrDocumentos = array();
26 27  
27 28  
... ... @@ -131,7 +132,8 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN {
131 132 $objAtividadeDTO->retNumIdUnidade();
132 133 $objAtividadeDTO->setOrdDthConclusao(InfraDTO::$TIPO_ORDENACAO_DESC);
133 134 $arrObjAtividadeDTO = $objAtividadeRN->listarRN0036($objAtividadeDTO);
134   -
  135 +//ini_set('xdebug.var_display_max_depth', 10); ini_set('xdebug.var_display_max_children', 256); ini_set('xdebug.var_display_max_data', 1024); echo '<pre>';
  136 +//var_dump($arrObjAtividadeDTO); echo '</pre>'; exit;
135 137 $objUltimaAtvProcesso = count($arrObjAtividadeDTO) > 0 ? current($arrObjAtividadeDTO) : null;
136 138 if(!is_null($objUltimaAtvProcesso)) {
137 139 $idUnidadeReabrirProcesso = $objUltimaAtvProcesso->getNumIdUnidade();
... ... @@ -147,7 +149,8 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN {
147 149 //$arrObjDocumentoAPI = $params[2];
148 150  
149 151 $idUnidadeAbrirNovoProcesso = $this->retornaUltimaUnidadeProcessoAberto($objProcedimentoDTO->getDblIdProcedimento());
150   -
  152 +//ini_set('xdebug.var_display_max_depth', 10); ini_set('xdebug.var_display_max_children', 256); ini_set('xdebug.var_display_max_data', 1024); echo '<pre>';
  153 +//var_dump($idUnidadeAbrirNovoProcesso); echo '</pre>'; exit;
151 154 //Salva um processo do tipo padrão selecionado
152 155 $this->simularLogin($idUnidadeAbrirNovoProcesso);
153 156  
... ... @@ -180,6 +183,18 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN {
180 183 */
181 184 $saidaConsultarProcedimentoAPI = $objSEIRN->consultarProcedimento($objEntradaConsultaProcApi);
182 185  
  186 +
  187 + /*
  188 + $objProcedimentoHistoricoDTO = new ProcedimentoHistoricoDTO();
  189 + $objProcedimentoHistoricoDTO->setDblIdProcedimento($idProcedimento);
  190 + $objProcedimentoRN = new ProcedimentoRN();
  191 + $objProcedimentoDTOHistorico = $objProcedimentoRN->consultarHistoricoRN1025($objProcedimentoHistoricoDTO);
  192 + $arrObjAtividadeDTOHistorico = $objProcedimentoDTOHistorico->getArrObjAtividadeDTO();
  193 + */
  194 +
  195 +// ini_set('xdebug.var_display_max_depth', 10); ini_set('xdebug.var_display_max_children', 256); ini_set('xdebug.var_display_max_data', 1024); echo '<pre>';
  196 +// var_dump($arrObjAtividadeDTOHistorico);
  197 +// var_dump($saidaConsultarProcedimentoAPI); echo '</pre>'; exit;
183 198 /**
184 199 * @var $ultimoAndamento AndamentoAPI
185 200 */
... ... @@ -189,6 +204,7 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN {
189 204 */
190 205 $objUnidadeAPI = $ultimoAndamento->getUnidade();
191 206  
  207 +
192 208 return $objUnidadeAPI->getIdUnidade();
193 209 }
194 210  
... ... @@ -202,15 +218,18 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN {
202 218 $ret = $objSEIRN->consultarProcedimento($objEntradaConsultaProcApi);
203 219 $arrUnidadesAberto = $ret->getUnidadesProcedimentoAberto();
204 220 $unidadesAberto = count($arrUnidadesAberto);
  221 +// var_dump($unidadesAberto); echo '</pre>'; exit;
205 222  
206   - if ($unidadesAberto > 0) {
207   - return true;
  223 + if ($unidadesAberto < 0) {
  224 + return false;
208 225 }
209   -
210 226 $objAtividadeDTO = new AtividadeDTO();
211 227 $objAtividadeDTO->setDblIdProcedimentoProtocolo($objProcedimentoDTO->getDblIdProcedimento());
212 228 $idUnidadeReabrirProcesso = $this->retornaUltimaUnidadeProcessoConcluido($objAtividadeDTO);
213 229  
  230 +// ini_set('xdebug.var_display_max_depth', 10); ini_set('xdebug.var_display_max_children', 256); ini_set('xdebug.var_display_max_data', 1024); echo '<pre>';
  231 +// var_dump($idUnidadeReabrirProcesso); echo '</pre>'; exit;
  232 +
214 233 if (!$idUnidadeReabrirProcesso) {
215 234 return true;
216 235 }
... ... @@ -317,6 +336,7 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN {
317 336 private function retornarParticipante($objUsuarioDTO, $objUnidadeDTO, $objProcedimentoDTO)
318 337 {
319 338 $objParticipanteDTO = new ParticipanteDTO();
  339 + $objParticipanteDTO->retTodos(true);
320 340 $objParticipanteDTO->retStrSiglaContato();
321 341 $objParticipanteDTO->retStrNomeContato();
322 342 $objParticipanteDTO->retNumIdUnidade();
... ... @@ -338,7 +358,12 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN {
338 358 $objParticipanteDTO->setNumIdUnidade( $objUnidadeDTO->getNumIdUnidade() );
339 359 $objParticipanteDTO->setNumSequencia(0);
340 360  
341   - $ret = $objParticipanteRN->cadastrarRN0170( $objParticipanteDTO );
  361 + $participanteDTO = $objParticipanteRN->cadastrarRN0170( $objParticipanteDTO );
  362 +
  363 + $objParticipanteDTO = new ParticipanteDTO();
  364 + $objParticipanteDTO->retTodos(true);
  365 + $objParticipanteDTO->setNumIdParticipante( $participanteDTO->getNumIdParticipante() );
  366 + $ret = $objParticipanteRN->consultarRN1008($objParticipanteDTO);
342 367 //$idParticipante = $objParticipanteDTO->getNumIdParticipante();
343 368 } else {
344 369 $ret = $arrObjParticipanteDTO[0];
... ... @@ -364,7 +389,6 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN {
364 389 $dlbIdDocumento = $documento->getDblIdDocumento();
365 390 }
366 391 $documentoDTO = $this->abrirDocumentoParaAssinatura($dlbIdDocumento);
367   -
368 392 $objParticipanteDTO = $this->retornarParticipante($objUsuarioDTO, $objUnidadeDTO, $objProcedimentoDTO);
369 393  
370 394 $this->abrirAcessoParaAssinatura($orgaoDTO, $documentoDTO, $objParticipanteDTO);
... ... @@ -399,6 +423,10 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN {
399 423 return $arrObjReciboDocPet;
400 424 }
401 425  
  426 + /**
  427 + * @param $params
  428 + * @return DocumentoDTO
  429 + */
402 430 private function montarReciboIntercorrente($params)
403 431 {
404 432 $arrParams = array(
... ... @@ -411,7 +439,7 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN {
411 439 );
412 440  
413 441 $reciboPeticionamentoRN = new ReciboPeticionamentoIntercorrenteRN();
414   - $reciboPeticionamentoRN->montarRecibo($arrParams);
  442 + return $reciboPeticionamentoRN->montarRecibo($arrParams);
415 443 }
416 444  
417 445 protected function cadastrarReciboDocumentoAnexoConectado($params)
... ... @@ -439,6 +467,7 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN {
439 467 $arrParams[2] = $this->getProcedimentoDTO();
440 468 $arrParams[3] = array($this->getParticipanteDTO());
441 469 $arrParams[4] = $this->getReciboDTO();
  470 + $arrParams[5] = $this->getDocumentoRecibo();
442 471  
443 472 $emailNotificacaoPeticionamentoRN = new EmailNotificacaoPetIntercorrenteRN();
444 473 return $emailNotificacaoPeticionamentoRN->notificaoPeticionamentoExterno( $arrParams );
... ... @@ -473,6 +502,8 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN {
473 502 $arrDadosRecibo['idProcedimento'] = $params['id_procedimento'];
474 503  
475 504 if ($objCriterioIntercorrenteDTO->getStrSinCriterioPadrao() == 'S') {
  505 +
  506 +
476 507 $objSaidaGerarProcedimentoAPI = $this->gerarProcedimentoApi(array($objProcedimentoDTO, $objCriterioIntercorrenteDTO));
477 508 $arrDadosRecibo['idProcedimentoRel'] = $params['id_procedimento'];
478 509 $arrDadosRecibo['idProcedimento'] = $objSaidaGerarProcedimentoAPI->getIdProcedimento();
... ... @@ -482,6 +513,7 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN {
482 513 //Se possui critérios intercorrentes setta os documentos no processo existente
483 514 $this->setProcedimentoDTO($objSaidaGerarProcedimentoAPI->getIdProcedimento());
484 515 } else {
  516 +// var_dump('Padrão'); echo '</pre>'; exit;
485 517 $this->reabrirProcessoApi($objProcedimentoDTO);
486 518 $this->setProcedimentoDTO($params['id_procedimento']);
487 519 }
... ... @@ -502,15 +534,29 @@ class MdPetIntercorrenteProcessoRN extends ProcessoPeticionamentoRN {
502 534 if (count($objReciboDTO) > 0) {
503 535 $this->setReciboDTO($objReciboDTO);
504 536 $this->cadastrarReciboDocumentoAnexo(array($objReciboDTO, $arrObjReciboDocPet));
505   - $this->montarReciboIntercorrente($params);
  537 + $documentoReciboDTO = $this->montarReciboIntercorrente($params);
  538 + $this->setDocumentoRecibo($documentoReciboDTO);
506 539 $this->enviarEmail($params);
507   - return $objReciboDTO;
  540 + return array(
  541 + 'recibo' => $objReciboDTO,
  542 + 'documento' => $documentoReciboDTO
  543 + );
508 544 //Gerar Recibo e executar javascript para fechar janela filha e redirecionar janela pai para a tela de detalhes do recibo que foi gerado]
509 545 }
510 546  
511 547 return false;
512 548 }
513 549  
  550 + private function getDocumentoRecibo()
  551 + {
  552 + return $this->documentoRecibo;
  553 + }
  554 +
  555 + private function setDocumentoRecibo($documentoDTO)
  556 + {
  557 + $this->documentoRecibo = $documentoDTO;
  558 + }
  559 +
514 560 private function simularLogin($idUnidade)
515 561 {
516 562 SessaoSEI::getInstance()->simularLogin(null, null, SessaoSEIExterna::getInstance()->getNumIdUsuarioExterno(), $idUnidade);
... ...
sei/web/modulos/peticionamento/rn/MdPetParametroRN.php 0 → 100644
... ... @@ -0,0 +1,51 @@
  1 +<?
  2 +/**
  3 +* ANATEL
  4 +*
  5 +* 25/11/2016 - criado por marcelo.bezerra - CAST
  6 +*
  7 +*/
  8 +
  9 +require_once dirname(__FILE__).'/../../../SEI.php';
  10 +
  11 +class MdPetParametroRN extends InfraRN {
  12 +
  13 + private $infraParametro;
  14 +
  15 + public function __construct() {
  16 + parent::__construct ();
  17 + $this->infraParametro = new InfraParametro($this->getObjInfraIBanco());
  18 + }
  19 +
  20 + protected function inicializarObjInfraIBanco() {
  21 + return BancoSEI::getInstance ();
  22 + }
  23 +
  24 + protected function getValorConectado($valor, $bolErroNaoEncontrado)
  25 + {
  26 + return $this->infraParametro->getValor($valor, $bolErroNaoEncontrado);
  27 + }
  28 +
  29 + protected function consultarConectado(InfraParametroDTO $objInfraParametroDTO){
  30 + $arrObjInfraParametro = $this->infraParametro->listarValores(array($objInfraParametroDTO->getStrNome()), false);
  31 + list($nome, $valor) = each($arrObjInfraParametro);
  32 + $objInfraParametroDTO = new InfraParametroDTO();
  33 + $objInfraParametroDTO->setStrNome($nome);
  34 + $objInfraParametroDTO->setStrValor($valor);
  35 + return $objInfraParametroDTO;
  36 + }
  37 +
  38 + protected function listarValoresConectado($arrNomes = null, $bolErroNaoEncontrado = true) {
  39 + $arrKeyValueParametro = $this->infraParametro->listarValores($arrNomes, $bolErroNaoEncontrado);
  40 + $retorno = array();
  41 + foreach($arrKeyValueParametro as $key=>$value) {
  42 + $objInfraParametroDTO = new InfraParametroDTO();
  43 + $objInfraParametroDTO->setStrNome($key);
  44 + $objInfraParametroDTO->setStrValor($value);
  45 + $retorno[] = $objInfraParametroDTO;
  46 + }
  47 + return $retorno;
  48 + }
  49 +
  50 +}
  51 +?>
0 52 \ No newline at end of file
... ...
sei/web/modulos/peticionamento/rn/ProcessoPeticionamentoRN.php
... ... @@ -187,7 +187,10 @@ class ProcessoPeticionamentoRN extends InfraRN {
187 187 $objEntradaConsultarProcedimentoAPI->setIdProcedimento( $objSaidaGerarProcedimentoAPI->getIdProcedimento() );
188 188 $objSaidaConsultarProcedimentoAPI = $objSeiRN->consultarProcedimento( $objEntradaConsultarProcedimentoAPI );
189 189  
  190 + $nomeTipo = $objSaidaConsultarProcedimentoAPI->getTipoProcedimento()->getNome();
  191 +
190 192 $objProcedimentoDTO = new ProcedimentoDTO();
  193 + $objProcedimentoDTO->setStrNomeTipoProcedimento( $nomeTipo );
191 194 $objProcedimentoDTO->setDblIdProcedimento( $objSaidaGerarProcedimentoAPI->getIdProcedimento() );
192 195 $objProcedimentoDTO->setStrProtocoloProcedimentoFormatado( $objSaidaConsultarProcedimentoAPI->getProcedimentoFormatado() );
193 196 $objProcedimentoDTO->setNumIdTipoProcedimento( $objSaidaConsultarProcedimentoAPI->getTipoProcedimento()->getIdTipoProcedimento() );
... ...
sei/web/modulos/peticionamento/rn/ReciboPeticionamentoIntercorrenteRN.php
... ... @@ -90,7 +90,7 @@ class ReciboPeticionamentoIntercorrenteRN extends ReciboPeticionamentoRN {
90 90  
91 91 //TESTE COMENTADO $documentoBD = new DocumentoBD( $this->getObjInfraIBanco() );
92 92 $docRN = new DocumentoPeticionamentoRN();
93   -
  93 +
94 94 $documentoReciboDTO = new DocumentoDTO();
95 95 $documentoReciboDTO->setDblIdDocumento( $protocoloReciboDocumentoDTO->getDblIdProtocolo() );
96 96 $documentoReciboDTO->setDblIdProcedimento( $objProcedimentoDTO->getDblIdProcedimento() );
... ... @@ -116,8 +116,9 @@ class ReciboPeticionamentoIntercorrenteRN extends ReciboPeticionamentoRN {
116 116 $documentoReciboDTO->setStrProtocoloDocumentoTextoBase('');
117 117  
118 118 $documentoReciboDTO = $docRN->gerarRN0003Customizado( $documentoReciboDTO );
119   -
120   - return $reciboDTO;
  119 +// ini_set('xdebug.var_display_max_depth', 10); ini_set('xdebug.var_display_max_children', 256); ini_set('xdebug.var_display_max_data', 1024); echo '<pre>';
  120 +// var_dump($documentoReciboDTO); echo '</pre>'; exit;
  121 + return $documentoReciboDTO;
121 122  
122 123 }
123 124  
... ... @@ -130,7 +131,7 @@ class ReciboPeticionamentoIntercorrenteRN extends ReciboPeticionamentoRN {
130 131 $arrDocumentos = $arrParams[5]; //ReciboPeticionamentoDTO
131 132  
132 133 $objUsuarioDTO = new UsuarioDTO();
133   - $objUsuarioDTO->retTodos();
  134 + $objUsuarioDTO->retTodos(true);
134 135 $objUsuarioDTO->setNumIdUsuario( $reciboDTO->getNumIdUsuario() );
135 136  
136 137 $objUsuarioRN = new UsuarioRN();
... ...
sei/web/modulos/peticionamento/rn/ReciboPeticionamentoRN.php
... ... @@ -203,7 +203,7 @@ class ReciboPeticionamentoRN extends InfraRN {
203 203 $objDocumentoAPI->setNivelAcesso( ProtocoloRN::$NA_PUBLICO );
204 204 $objDocumentoAPI->setIdTipoConferencia( null );
205 205  
206   - $objDocumentoAPI->setConteudo(base64_encode( $htmlRecibo ) );
  206 + $objDocumentoAPI->setConteudo(base64_encode( utf8_encode($htmlRecibo) ) );
207 207  
208 208 $objSeiRN = new SeiRN();
209 209 $saidaDocExternoAPI = $objSeiRN->incluirDocumento( $objDocumentoAPI );
... ... @@ -303,10 +303,46 @@ class ReciboPeticionamentoRN extends InfraRN {
303 303 $html .= '<td></td>';
304 304 $html .= '</tr>';
305 305  
306   - $idPrincipalGerado = SessaoSEIExterna::getInstance()->getAtributo('idDocPrincipalGerado');
307   - $arrIdPrincipal = SessaoSEIExterna::getInstance()->getAtributo('arrIdAnexoPrincipal');
308   - $arrIdEssencial = SessaoSEIExterna::getInstance()->getAtributo('arrIdAnexoEssencial');
309   - $arrIdComplementar = SessaoSEIExterna::getInstance()->getAtributo('arrIdAnexoComplementar');
  306 + //consultando DOCs
  307 +
  308 + $reciboAnexoDTO = new ReciboDocumentoAnexoPeticionamentoDTO();
  309 + $reciboAnexoDTO->retTodos( true );
  310 + $reciboAnexoRN = new ReciboDocumentoAnexoPeticionamentoRN();
  311 + $reciboAnexoDTO->setNumIdReciboPeticionamento( $reciboDTO->getNumIdReciboPeticionamento() );
  312 +
  313 + $arrReciboAnexoDTO = $reciboAnexoRN->listar( $reciboAnexoDTO );
  314 +
  315 + $idPrincipalGerado = null;
  316 + $arrIdPrincipal = array();
  317 + $arrIdEssencial = array();
  318 + $arrIdComplementar = array();
  319 +
  320 + foreach( $arrReciboAnexoDTO as $itemReciboAnexoDTO ){
  321 +
  322 + if( $itemReciboAnexoDTO->getStrClassificacaoDocumento() == ReciboDocumentoAnexoPeticionamentoRN::$TP_PRINCIPAL ){
  323 +
  324 + $idPrincipalGerado = $itemReciboAnexoDTO->getNumIdDocumento();
  325 + //array_push( $arrIdPrincipal, $itemReciboAnexoDTO->getNumIdDocumento() );
  326 + }
  327 +
  328 + else if( $itemReciboAnexoDTO->getStrClassificacaoDocumento() == ReciboDocumentoAnexoPeticionamentoRN::$TP_ESSENCIAL ){
  329 +
  330 + array_push( $arrIdEssencial, $itemReciboAnexoDTO->getNumIdDocumento() );
  331 + }
  332 +
  333 + else if( $itemReciboAnexoDTO->getStrClassificacaoDocumento() == ReciboDocumentoAnexoPeticionamentoRN::$TP_COMPLEMENTAR ){
  334 +
  335 + array_push( $arrIdComplementar, $itemReciboAnexoDTO->getNumIdDocumento() );
  336 + }
  337 +
  338 + }
  339 +
  340 + //$idPrincipalGerado = SessaoSEIExterna::getInstance()->getAtributo('idDocPrincipalGerado');
  341 + //$arrIdPrincipal = SessaoSEIExterna::getInstance()->getAtributo('arrIdAnexoPrincipal');
  342 + //$arrIdEssencial = SessaoSEIExterna::getInstance()->getAtributo('arrIdAnexoEssencial');
  343 + //$arrIdComplementar = SessaoSEIExterna::getInstance()->getAtributo('arrIdAnexoComplementar');
  344 +
  345 +
310 346  
311 347 $anexoRN = new AnexoRN();
312 348 $documentoRN = new DocumentoRN();
... ... @@ -396,7 +432,7 @@ class ReciboPeticionamentoRN extends InfraRN {
396 432 $objAnexoDTO = new AnexoDTO();
397 433 $objAnexoDTO->retTodos(true);
398 434  
399   - $objAnexoDTO->adicionarCriterio(array('IdAnexo'),
  435 + $objAnexoDTO->adicionarCriterio(array('IdProtocolo'),
400 436 array(InfraDTO::$OPER_IN),
401 437 array($arrIdEssencial));
402 438  
... ... @@ -444,7 +480,7 @@ class ReciboPeticionamentoRN extends InfraRN {
444 480 $objAnexoDTO = new AnexoDTO();
445 481 $objAnexoDTO->retTodos(true);
446 482  
447   - $objAnexoDTO->adicionarCriterio(array('IdAnexo'),
  483 + $objAnexoDTO->adicionarCriterio(array('IdProtocolo'),
448 484 array(InfraDTO::$OPER_IN),
449 485 array($arrIdComplementar));
450 486  
... ...