Commit ad4451c4669a3f6c89bb404b2042247f1c96562b

Authored by Nei Jobson da Costa Carneiro
2 parents c7540122 2bfd1412

Merge branch 'Correcao_111_Pet' into 'master'

Correcao 111 pet

Correções: Abertura do Editor pelo Usuário Externo no SEI 3.0.6 e ordem ascendente na combo de UF na tela de Peticionamento Processo Novo.

See merge request !9
sei/web/modulos/peticionamento/md_pet_usu_ext_cadastro.php
... ... @@ -110,30 +110,53 @@ PaginaSEIExterna::getInstance()->abrirAreaDados('auto');
110 110 <br/>
111 111  
112 112 <select id="selUFAberturaProcesso" name="selUFAberturaProcesso">
113   -
114   - <option value=""></option>
115   -
116   - <? foreach( $arrUnidadeUFDTO as $itemUnidadeDTO ){ ?>
117   - <option value="<?= $itemUnidadeDTO->getNumIdUnidade() ?>">
118   - <? // seiv2 $itemUnidadeDTO->getStrSiglaUf() ?>
119   - <?php
120   - //alteracoes seiv3
121   - $contatoAssociadoDTO = new ContatoDTO();
122   - $contatoAssociadoRN = new ContatoRN();
123   - $contatoAssociadoDTO->retStrSiglaUf();
124   - $contatoAssociadoDTO->retNumIdContato();
125   - $contatoAssociadoDTO->setNumIdContato( $itemUnidadeDTO->getNumIdContato() );
126   -
127   - $contatoAssociadoDTO = $contatoAssociadoRN->consultarRN0324( $contatoAssociadoDTO );
128   - echo $contatoAssociadoDTO->getStrSiglaUf();
129   - ?>
130   - </option>
131   - <? } ?>
132   -
  113 + <option value=""></option>
  114 + <?
  115 + function array_msort($array, $cols) {
  116 + $colarr = array();
  117 + foreach ($cols as $col => $order) {
  118 + $colarr[$col] = array();
  119 + foreach ($array as $k => $row) { $colarr[$col]['_'.$k] = strtolower($row[$col]); }
  120 + }
  121 + $eval = 'array_multisort(';
  122 + foreach ($cols as $col => $order) {
  123 + $eval .= '$colarr[\''.$col.'\'],'.$order.',';
  124 + }
  125 + $eval = substr($eval,0,-1).');';
  126 + eval($eval);
  127 + $ret = array();
  128 + foreach ($colarr as $col => $arr) {
  129 + foreach ($arr as $k => $v) {
  130 + $k = substr($k,1);
  131 + if (!isset($ret[$k])) $ret[$k] = $array[$k];
  132 + $ret[$k][$col] = $array[$k][$col];
  133 + }
  134 + }
  135 + return $ret;
  136 + }
  137 + $arrUnidadeUF = array();
  138 + foreach( $arrUnidadeUFDTO as $itemUnidadeDTO ){
  139 + $contatoAssociadoDTO = new ContatoDTO();
  140 + $contatoAssociadoRN = new ContatoRN();
  141 + $contatoAssociadoDTO->retStrSiglaUf();
  142 + $contatoAssociadoDTO->retNumIdContato();
  143 + $contatoAssociadoDTO->setNumIdContato( $itemUnidadeDTO->getNumIdContato() );
  144 +
  145 + $contatoAssociadoDTO = $contatoAssociadoRN->consultarRN0324( $contatoAssociadoDTO );
  146 +
  147 + $arrUnidadeUF[] = array ('IdUnidade' => $itemUnidadeDTO->getNumIdUnidade()
  148 + , 'IdContato' => $itemUnidadeDTO->getNumIdContato()
  149 + , 'SiglaUf' => $contatoAssociadoDTO->getStrSiglaUf()
  150 + );
  151 + }
  152 + $arrUnidadeUF = array_msort($arrUnidadeUF, array('name'=>SORT_DESC, 'SiglaUf'=>SORT_ASC));
  153 + foreach( $arrUnidadeUF as $itemUnidade ){
  154 + echo '<option value="' . $itemUnidade['IdUnidade'] . '">' . $itemUnidade['SiglaUf'] . '</option>';
  155 + }
  156 + ?>
133 157 </select> <br/><br/>
134   -
135   - <? } ?>
136   -
  158 + <? } ?>
  159 +
137 160 <? if( $objTipoProcDTO->getStrSinIIProprioUsuarioExterno() == 'S') { ?>
138 161  
139 162 <!-- CASO 1 -->
... ...
sei/web/modulos/peticionamento/rn/MdPetEditorUsuarioExternoRN.php
... ... @@ -86,8 +86,6 @@ class MdPetEditorUsuarioExternoRN extends InfraRN
86 86 $scayt="";
87 87 LogSEI::getInstance()->gravar("'Erro acessando servidor SCAYT para validar versão do plugin:\n".InfraException::inspecionar($e));
88 88 }
89   - } elseif ($objOrgaoDTO != null && $objOrgaoDTO->getStrStaCorretorOrtografico()==OrgaoRN::$TCO_GRATUITO){
90   - $scayt = 'scayt3';
91 89 }
92 90 if ($scayt!="") {
93 91 $includePlugins[] = $scayt;
... ... @@ -385,8 +383,6 @@ class MdPetEditorUsuarioExternoRN extends InfraRN
385 383 $scayt="";
386 384 LogSEI::getInstance()->gravar("'Erro acessando servidor SCAYT para validar versão do plugin:\n".InfraException::inspecionar($e));
387 385 }
388   - } elseif ($objOrgaoDTO->getStrStaCorretorOrtografico()==OrgaoRN::$TCO_GRATUITO){
389   - $scayt = 'scayt3';
390 386 }
391 387 if ($scayt!="") {
392 388 $includePlugins[] = $scayt;
... ...