From 3fcfa44464b00e2c2abbea303da015a8ebd24b41 Mon Sep 17 00:00:00 2001
From: vgilc <vanessa.gil@artica.es>
Date: Tue, 10 Jan 2012 13:56:40 +0000
Subject: [PATCH] 2012-01-10  Vanessa Gil  <vanessa.gil@artica.es> 	*
 operation/agentes/group_view.php 	  include/functions_group.php: Improve
 display for 	group view.

git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5337 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
---
 pandora_console/ChangeLog                        | 5 +++++
 pandora_console/godmode/groups/group_list.php    | 2 +-
 pandora_console/include/functions_groups.php     | 6 +++---
 pandora_console/operation/agentes/group_view.php | 3 ++-
 4 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog
index 4f7d3973e6..d4fcf39f83 100644
--- a/pandora_console/ChangeLog
+++ b/pandora_console/ChangeLog
@@ -1,3 +1,8 @@
+2012-01-10  Vanessa Gil  <vanessa.gil@artica.es>
+	* operation/agentes/group_view.php
+	  include/functions_group.php: Improve display for 
+	group view.
+
 2012-01-10  Vanessa Gil  <vanessa.gil@artica.es>
 	* godmode/agentes/planned_downtime.php: fixed error in
 	planned downtime.
diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php
index 67366b229b..fe26db68c3 100644
--- a/pandora_console/godmode/groups/group_list.php
+++ b/pandora_console/godmode/groups/group_list.php
@@ -286,7 +286,7 @@ if(!empty($groups)) {
 				}
 			}
 		}
-		
+	
 		$tabulation = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $group['deep']);
 		
 		if ($group['id_grupo'] == 0) {
diff --git a/pandora_console/include/functions_groups.php b/pandora_console/include/functions_groups.php
index e801181021..5af0430026 100644
--- a/pandora_console/include/functions_groups.php
+++ b/pandora_console/include/functions_groups.php
@@ -623,9 +623,9 @@ function groups_get_group_row($id_group, $group_all, $group, &$printed_groups) {
 	
 	// Store printed group to not print it again
 	$printed_groups[$id_group] = 1;
-		
-	if ($id_group < 1) 
-		return; // Skip group 0
+	
+	if ($id_group < 0) 
+		return; 
 
 	// Get stats for this group
 	$data = reporting_get_group_stats($id_group);
diff --git a/pandora_console/operation/agentes/group_view.php b/pandora_console/operation/agentes/group_view.php
index d417779d0b..c1c8443d47 100644
--- a/pandora_console/operation/agentes/group_view.php
+++ b/pandora_console/operation/agentes/group_view.php
@@ -50,7 +50,8 @@ $groups_full = users_get_groups ($config['id_user'], "AR", true, true);
 $groups = array();
 foreach($groups_full as $group) {
 	$groups[$group['id_grupo']]['name'] = $group['nombre'];
-	if($group['parent'] != 0) {
+
+	if($group['id_grupo'] != 0) {
 		$groups[$group['parent']]['childs'][] = $group['id_grupo'];
 		$groups[$group['id_grupo']]['prefix'] = $groups[$group['parent']]['prefix'].'&nbsp;&nbsp;&nbsp;';
 	}