From c0b557c6c64733e9a2e08cead4a2eab3505b817b Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Mon, 26 Jul 2010 12:45:25 +0000 Subject: [PATCH] 2010-07-26 Sergio Martin * include/functions_db.php: Changed the priority of the status of agents and groups when get status from their descendents git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3064 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 ++++++ pandora_console/include/functions_db.php | 24 ++++++++++++------------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 36e9e4b4f6..2404a34d6f 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2010-07-26 Sergio Martin + + * include/functions_db.php: Changed the priority of the + status of agents and groups when get status from their + descendents + 2010-07-26 Miguel de Dios * include/functions_db.php: added into the function "get_group_icon" the return icon for "all" group. diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index a0998b820f..f89c9b70d4 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -2690,10 +2690,6 @@ function get_agent_status ($id_agent = 0) { if(is_int(array_search(4,$modules_status))){ return 4; } - // Checking if any module has unknown status (3) - elseif(is_int(array_search(3,$modules_status))){ - return 3; - } // Checking if any module has critical status (1) elseif(is_int(array_search(1,$modules_status))){ return 1; @@ -2702,6 +2698,10 @@ function get_agent_status ($id_agent = 0) { elseif(is_int(array_search(2,$modules_status))){ return 2; } + // Checking if any module has unknown status (3) + elseif(is_int(array_search(3,$modules_status))){ + return 3; + } else { return 0; } @@ -2728,14 +2728,6 @@ function get_group_status ($id_group = 0) { if(is_int(array_search(4,$agents_status))){ return 4; } - // Checking if any agent has unknown status (-1) - elseif(is_int(array_search(-1,$agents_status))){ - return -1; - } - // Checking if any agents module has unknown status (3) - elseif(is_int(array_search(3,$agents_status))){ - return 3; - } // Checking if any agent has critical status (1) elseif(is_int(array_search(1,$agents_status))){ return 1; @@ -2744,6 +2736,14 @@ function get_group_status ($id_group = 0) { elseif(is_int(array_search(2,$agents_status))){ return 2; } + // Checking if any agent has unknown status (-1) + elseif(is_int(array_search(-1,$agents_status))){ + return -1; + } + // Checking if any agents module has unknown status (3) + elseif(is_int(array_search(3,$agents_status))){ + return 3; + } else { return 0; }