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,23 +162,28 @@ class MdWsSeiUsuarioRN extends InfraRN { | ||
162 | $this->setaVariaveisAutenticacao(get_object_vars($ret)); | 162 | $this->setaVariaveisAutenticacao(get_object_vars($ret)); |
163 | $ret->id_unidade_atual = SessaoSEI::getInstance()->getNumIdUnidadeAtual(); | 163 | $ret->id_unidade_atual = SessaoSEI::getInstance()->getNumIdUnidadeAtual(); |
164 | $token = $this->tokenEncode($usuarioDTO->getStrSigla(), $usuarioDTO->getStrSenha()); | 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 | $arrPerfis = array(); | 175 | $arrPerfis = array(); |
170 | $retPerfis = $this->listarPerfisUsuario($ret->id_sistema, $ret->id_usuario); | 176 | $retPerfis = $this->listarPerfisUsuario($ret->id_sistema, $ret->id_usuario); |
171 | if($retPerfis && $retPerfis['data']){ | 177 | if($retPerfis && $retPerfis['data']){ |
172 | $arrPerfis = $retPerfis['data']; | 178 | $arrPerfis = $retPerfis['data']; |
173 | } | 179 | } |
174 | 180 | ||
175 | - | ||
176 | return MdWsSeiRest::formataRetornoSucessoREST( | 181 | return MdWsSeiRest::formataRetornoSucessoREST( |
177 | null, | 182 | null, |
178 | array( | 183 | array( |
179 | 'loginData'=> $ret, | 184 | 'loginData'=> $ret, |
180 | 'perfis' => $arrPerfis, | 185 | 'perfis' => $arrPerfis, |
181 | - 'unidades' => $arrUnidades['data'], | 186 | + 'unidades' => $arrUnidades, |
182 | 'token' => $token | 187 | 'token' => $token |
183 | ) | 188 | ) |
184 | ); | 189 | ); |