From 5b5895a6443acadda40f7ac2380f93ee8a5ae366 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Fri, 22 Nov 2019 13:30:25 +0100 Subject: [PATCH] minor fix --- pandora_console/include/functions_agents.php | 23 ++++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index e85798cfde..e15a0a0f97 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -3542,17 +3542,22 @@ function agents_get_sap_agents($id_agent) $array_agents = []; foreach ($sap_modules as $module => $key) { + $new_ones = db_get_all_rows_sql( + 'SELECT ta.id_agente,ta.alias + FROM tagente ta + INNER JOIN tagente_modulo tam + ON tam.id_agente = ta.id_agente + WHERE tam.nombre + LIKE "%SAP%" + GROUP BY ta.id_agente' + ); + if ($new_ones === false) { + continue; + } + $array_agents = array_merge( $array_agents, - db_get_all_rows_sql( - 'SELECT ta.id_agente,ta.alias - FROM tagente ta - INNER JOIN tagente_modulo tam - ON tam.id_agente = ta.id_agente - WHERE tam.nombre - LIKE "%SAP%" - GROUP BY ta.id_agente' - ) + $new_ones ); }