Commit a8ae079fda29a12d36b0972fcf65766b811f7fa2
1 parent
8dc60056
Exists in
master
and in
1 other branch
[Fix] Corrigindo listagem de unidades para o Perfil do usuário.
Showing
1 changed file
with
11 additions
and
6 deletions
Show diff stats
rn/MdWsSeiUsuarioRN.php
... | ... | @@ -162,23 +162,28 @@ class MdWsSeiUsuarioRN extends InfraRN { |
162 | 162 | $this->setaVariaveisAutenticacao(get_object_vars($ret)); |
163 | 163 | $ret->id_unidade_atual = SessaoSEI::getInstance()->getNumIdUnidadeAtual(); |
164 | 164 | $token = $this->tokenEncode($usuarioDTO->getStrSigla(), $usuarioDTO->getStrSenha()); |
165 | - $unidadeRN = new MdWsSeiUnidadeRN(); | |
166 | - $unidadeDTOConsulta = new UnidadeDTO(); | |
167 | - $unidadeDTOConsulta->setNumMaxRegistrosRetorno(99999);//pedido da MBA | |
168 | - $arrUnidades = $unidadeRN->pesquisarUnidade($unidadeDTOConsulta); | |
165 | + | |
166 | + $arrUnidades = array(); | |
167 | + foreach(SessaoSEI::getInstance()->getArrUnidades() as $unidade){ | |
168 | + $arrUnidades[] = array( | |
169 | + 'id' => $unidade[0], | |
170 | + 'sigla' => $unidade[1], | |
171 | + 'descricao' => $unidade[2] | |
172 | + ); | |
173 | + } | |
174 | + | |
169 | 175 | $arrPerfis = array(); |
170 | 176 | $retPerfis = $this->listarPerfisUsuario($ret->id_sistema, $ret->id_usuario); |
171 | 177 | if($retPerfis && $retPerfis['data']){ |
172 | 178 | $arrPerfis = $retPerfis['data']; |
173 | 179 | } |
174 | 180 | |
175 | - | |
176 | 181 | return MdWsSeiRest::formataRetornoSucessoREST( |
177 | 182 | null, |
178 | 183 | array( |
179 | 184 | 'loginData'=> $ret, |
180 | 185 | 'perfis' => $arrPerfis, |
181 | - 'unidades' => $arrUnidades['data'], | |
186 | + 'unidades' => $arrUnidades, | |
182 | 187 | 'token' => $token |
183 | 188 | ) |
184 | 189 | ); | ... | ... |