Fixed errors
This commit is contained in:
parent
eb0a093525
commit
9fa010c8ac
|
@ -621,6 +621,10 @@ class Tree {
|
|||
else
|
||||
$parent = $this->root;
|
||||
|
||||
function cmpSortNames($a, $b) {
|
||||
return strcmp($a["name"], $b["name"]);
|
||||
}
|
||||
|
||||
// Get all groups
|
||||
if (empty($parent)) {
|
||||
require_once($config['homedir']."/include/functions_groups.php");
|
||||
|
@ -801,13 +805,13 @@ class Tree {
|
|||
// Add the resulting item
|
||||
$mergedItems[] = $resultItem;
|
||||
}
|
||||
|
||||
usort($mergedItems, "cmpSortNames");
|
||||
|
||||
return $mergedItems;
|
||||
}
|
||||
|
||||
$items = __getMergedItems($item_list);
|
||||
|
||||
html_debug_print($items, true);
|
||||
}
|
||||
|
||||
if (empty($items))
|
||||
|
@ -821,10 +825,6 @@ class Tree {
|
|||
$this->tree = $this->getAgents($parent, $this->type);
|
||||
}
|
||||
else {
|
||||
function cmpSortAgentNames($a, $b) {
|
||||
return strcmp($a["name"], $b["name"]);
|
||||
}
|
||||
|
||||
$agents = array();
|
||||
foreach ($parent as $server_id => $group_id) {
|
||||
$server = metaconsole_get_servers($server_id);
|
||||
|
@ -839,7 +839,7 @@ class Tree {
|
|||
}
|
||||
}
|
||||
if (!empty($agents))
|
||||
usort($agents, "cmpSortAgentNames");
|
||||
usort($agents, "cmpSortNames");
|
||||
|
||||
$this->tree = $agents;
|
||||
}
|
||||
|
|
|
@ -2019,7 +2019,7 @@ function group_get_data ($id_user = false, $user_strict = false, $acltags, $retu
|
|||
}
|
||||
}
|
||||
|
||||
if ($mode == 'group' || $mode == 'tree') {
|
||||
if ($mode == 'group') {
|
||||
if (! defined ('METACONSOLE')) {
|
||||
if (($list[$i]['_agents_unknown_'] == 0) && ($list[$i]['_monitors_alerts_fired_'] == 0) && ($list[$i]['_total_agents_'] == 0) && ($list[$i]['_monitors_ok_'] == 0) && ($list[$i]['_monitors_critical_'] == 0) && ($list[$i]['_monitors_warning_'] == 0) && ($list[$i]['_monitors_unknown_'] == 0) && ($list[$i]['_monitors_not_init_'] == 0) && ($list[$i]['_agents_not_init_'] == 0)) {
|
||||
unset($list[$i]);
|
||||
|
@ -2123,7 +2123,7 @@ function group_get_data ($id_user = false, $user_strict = false, $acltags, $retu
|
|||
}
|
||||
}
|
||||
|
||||
if ($mode == 'group' || $mode == 'tree') {
|
||||
if ($mode == 'group') {
|
||||
if (! defined ('METACONSOLE')) {
|
||||
if (($list[$i]['_agents_unknown_'] == 0) && ($list[$i]['_monitors_alerts_fired_'] == 0) && ($list[$i]['_total_agents_'] == 0) && ($list[$i]['_monitors_ok_'] == 0) && ($list[$i]['_monitors_critical_'] == 0) && ($list[$i]['_monitors_warning_'] == 0) && ($list[$i]['_monitors_unknown_'] == 0) && ($list[$i]['_monitors_not_init_'] == 0) && ($list[$i]['_agents_not_init_'] == 0)) {
|
||||
unset($list[$i]);
|
||||
|
@ -2180,7 +2180,7 @@ function group_get_data ($id_user = false, $user_strict = false, $acltags, $retu
|
|||
}
|
||||
}
|
||||
|
||||
if ($mode == 'group' || $mode == 'tree') {
|
||||
if ($mode == 'group') {
|
||||
if (! defined ('METACONSOLE')) {
|
||||
if (($list[$i]['_agents_unknown_'] == 0) && ($list[$i]['_monitors_alerts_fired_'] == 0) && ($list[$i]['_total_agents_'] == 0) && ($list[$i]['_monitors_ok_'] == 0) && ($list[$i]['_monitors_critical_'] == 0) && ($list[$i]['_monitors_warning_'] == 0) && ($list[$i]['_monitors_unknown_'] == 0) && ($list[$i]['_monitors_not_init_'] == 0) && ($list[$i]['_agents_not_init_'] == 0)) {
|
||||
unset($list[$i]);
|
||||
|
|
Loading…
Reference in New Issue