From a19f3939e9dd90ac998d03514ab9f38ba436c652 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Wed, 18 Mar 2015 12:26:45 +0100 Subject: [PATCH] Fixed an SQL error when serving the agent status tooltip (cherry picked from commit 554fb7aa2c3c221e74fb096579c58e6b8a88568b) --- .../operation/agentes/ver_agente.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index ecb2bf24c9..23e33d8bba 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -469,17 +469,17 @@ if (is_ajax ()) { echo ''.__('Last contact').': '.human_time_comparation($agent['ultimo_contacto']).'
'; echo ''.__('Last remote contact').': '.human_time_comparation($agent['ultimo_contacto_remoto']).'
'; - # Fix : Only show agents with module with tags of user profile - $_user_tags = tags_get_user_tags($config['id_user'], 'RR'); + # Fix : Only show agents with module with tags of user profile + $_user_tags = tags_get_user_tags($config['id_user'], 'RR'); + + $_sql_post = ''; + if (is_array($_user_tags) && !empty($_user_tags)) { - $_sql_post = ''; - if ($_user_tags !== false) { - - $_tags = implode(',', array_keys($_user_tags)); - - $_sql_post .= ' AND tagente_modulo.id_agente_modulo IN (SELECT a.id_agente_modulo FROM tagente_modulo a, ttag_module b WHERE a.id_agente_modulo=b.id_agente_modulo AND b.id_tag IN (' . $_tags . ')) '; - - } + $_tags = implode(',', array_keys($_user_tags)); + + $_sql_post .= ' AND tagente_modulo.id_agente_modulo IN (SELECT a.id_agente_modulo FROM tagente_modulo a, ttag_module b WHERE a.id_agente_modulo=b.id_agente_modulo AND b.id_tag IN (' . $_tags . ')) '; + + } $sql = sprintf ('SELECT tagente_modulo.descripcion, tagente_modulo.nombre