From 872de3bc13f725e079f8c11ea86564626102667a Mon Sep 17 00:00:00 2001 From: darode Date: Mon, 16 Jul 2012 15:20:56 +0000 Subject: [PATCH] 2012-07-16 Dario Rodriguez * operation/tree.php: Fixed a bug which shows agents with not init modules when they must be hidde. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6779 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 ++++ pandora_console/operation/tree.php | 37 +++++++++++++++++++++++++++--- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 5198fbc170..8aeac8c836 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2012-07-16 Dario Rodriguez + + * operation/tree.php: Fixed a bug which shows agents with + not init modules when they must be hidde. + 2012-07-16 Juan Manuel Ramon * include/constants.php diff --git a/pandora_console/operation/tree.php b/pandora_console/operation/tree.php index 6c4149aa1d..1e37278032 100644 --- a/pandora_console/operation/tree.php +++ b/pandora_console/operation/tree.php @@ -256,7 +256,12 @@ if (is_ajax ()) //Extract all rows of data for each type switch ($type) { - case 'group': + case 'group': + + //Skip agents which only have not init modules + + $search_sql .= " AND id_agente NOT IN (SELECT tagente_estado.id_agente FROM + tagente_estado GROUP BY id_agente HAVING SUM(utimestamp) = 0)"; $sql = agents_get_agents(array ( 'order' => 'nombre COLLATE utf8_general_ci ASC', @@ -272,6 +277,13 @@ if (is_ajax ()) break; case 'os': + + //Skip agents which only have not init modules + + $search_sql .= " AND id_agente NOT IN (SELECT tagente_estado.id_agente FROM + tagente_estado GROUP BY id_agente HAVING SUM(utimestamp) = 0)"; + + $sql = agents_get_agents(array ( 'order' => 'nombre COLLATE utf8_general_ci ASC', 'id_os' => $id, @@ -283,9 +295,17 @@ if (is_ajax ()) 'AR', false, true); - + break; case 'module_group': + + //Skip agents which only have not init modules + + $search_sql .= " AND id_agente NOT IN (SELECT tagente_estado.id_agente FROM tagente_estado + WHERE id_agente_modulo IN + (SELECT id_agente_modulo FROM tagente_modulo + WHERE id_module_group = $id) + GROUP BY id_agente HAVING SUM(utimestamp) = 0)"; $sql = agents_get_agents(array ( 'order' => 'nombre COLLATE utf8_general_ci ASC', @@ -878,7 +898,12 @@ function printTree_($type) { switch ($type) { default: case 'os': - + + //Skip agent with all modules in not init status + + $sql_search .= " AND id_agente NOT IN (SELECT tagente_estado.id_agente FROM + tagente_estado GROUP BY id_agente HAVING SUM(utimestamp) = 0)"; + $sql = agents_get_agents(array ( 'order' => 'nombre COLLATE utf8_general_ci ASC', 'disabled' => 0, @@ -918,6 +943,11 @@ function printTree_($type) { case 'module_group': + //Skip agents which only have not init modules + + $sql_search .= " AND id_agente NOT IN (SELECT tagente_estado.id_agente FROM + tagente_estado GROUP BY id_agente HAVING SUM(utimestamp) = 0)"; + $sql = agents_get_agents(array ( 'order' => 'nombre COLLATE utf8_general_ci ASC', 'disabled' => 0, @@ -1032,6 +1062,7 @@ function printTree_($type) { $first = true; foreach ($list as $item) { + $iconImg = ''; switch ($type) { default: