From 2cf5d35f178455c26851f0001e46a28f053b8d26 Mon Sep 17 00:00:00 2001 From: darode Date: Wed, 17 Aug 2011 15:16:54 +0000 Subject: [PATCH] 2011-08-17 Dario Rodriguez * include/functions_networkmap.php: Fixed a bug with topology map git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4755 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/include/functions_networkmap.php | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index eed051e2b9..75221f7168 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2011-08-17 Dario Rodriguez + + * include/functions_networkmap.php: Fixed a bug with topology map + + 2011-08-17 Javier Lanz * operation/snmpconsole/snmp_view.php: Fixed an style icon small bug diff --git a/pandora_console/include/functions_networkmap.php b/pandora_console/include/functions_networkmap.php index cdbd9eb71a..b99258e603 100644 --- a/pandora_console/include/functions_networkmap.php +++ b/pandora_console/include/functions_networkmap.php @@ -72,11 +72,21 @@ function networkmap_generate_dot ($pandora_name, $group = 0, $simple = 0, $font_ // Parse agents $nodes = array (); $node_count = 1; + + // Add node + $node_ref = array(); + foreach ($agents as $agent) { + // Add node + $node_ref[$agent['id_agente']] = $node_count; + $node_count++; + } + + $node_count = 1; foreach ($agents as $agent) { // Save node parent information to define edges later if ($agent['id_parent'] != "0") { - $parents[$node_count] = $agent['id_parent']; + $parents[$node_count] = $node_ref[$agent['id_parent']]; } else { $orphans[$node_count] = 1; }