From d1c2dc1b368e3104df884f059ab629b8f65d15a5 Mon Sep 17 00:00:00 2001 From: Bruno Noronha Date: Mon, 15 Sep 2014 17:28:29 -0300 Subject: [PATCH] modulo mapaController --- src/Cacic/WSBundle/Controller/MapaController.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Cacic/WSBundle/Controller/MapaController.php b/src/Cacic/WSBundle/Controller/MapaController.php index ff2ce4a..c103b50 100644 --- a/src/Cacic/WSBundle/Controller/MapaController.php +++ b/src/Cacic/WSBundle/Controller/MapaController.php @@ -41,6 +41,7 @@ class MapaController extends Controller { $netmask = $request->get('netmask'); } + $modPatrimonio = "false"; $so = $this->getDoctrine()->getRepository('CacicCommonBundle:So')->findOneBy( array('teSo'=>$request->get( 'te_so' ))); $rede = $this->getDoctrine()->getRepository('CacicCommonBundle:Rede')->getDadosRedePreColeta( $ip_computador, $netmask ); $computador = $this->getDoctrine()->getRepository('CacicCommonBundle:Computador')->getComputadorPreCole( $request, $request->get( 'te_so' ),$te_node_address, $rede, $so, $ip_computador ); @@ -64,12 +65,13 @@ class MapaController extends Controller { )->setParameter('id', $computador); $result = $query->getResult(); - } - if (empty($result)) - $modPatrimonio = "true"; - else - $modPatrimonio = "false"; + /** + * Caso não exista nenhuma coleta, envia "true" para o agente. + */ + if (empty($result)) + $modPatrimonio = "true"; + } /** * Mensagem a ser exibida na tela de Pop-Up do patrimônio -- libgit2 0.21.2