[Secondary groups] Added secondary groups in tree view
This commit is contained in:
parent
4c71450b6a
commit
310c2a6f15
|
@ -361,7 +361,10 @@ class Tree {
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$query_agent_search = " SELECT DISTINCT(ta.id_grupo)
|
$query_agent_search = " SELECT DISTINCT(ta.id_grupo)
|
||||||
FROM tagente ta, tagente_modulo tam
|
FROM tagente ta
|
||||||
|
LEFT JOIN tagent_secondary_group tasg
|
||||||
|
ON ta.id_agente = tasg.id_agent
|
||||||
|
, tagente_modulo tam
|
||||||
WHERE tam.id_agente = ta.id_agente
|
WHERE tam.id_agente = ta.id_agente
|
||||||
AND ta.disabled = 0
|
AND ta.disabled = 0
|
||||||
$agent_search_filter
|
$agent_search_filter
|
||||||
|
@ -407,13 +410,18 @@ class Tree {
|
||||||
else {
|
else {
|
||||||
$agent_table = "SELECT COUNT(DISTINCT(ta.id_agente))
|
$agent_table = "SELECT COUNT(DISTINCT(ta.id_agente))
|
||||||
FROM tagente ta
|
FROM tagente ta
|
||||||
|
LEFT JOIN tagent_secondary_group tasg
|
||||||
|
ON ta.id_agente=tasg.id_agent
|
||||||
INNER JOIN tagente_modulo tam
|
INNER JOIN tagente_modulo tam
|
||||||
ON tam.disabled = 0
|
ON tam.disabled = 0
|
||||||
AND ta.id_agente = tam.id_agente
|
AND ta.id_agente = tam.id_agente
|
||||||
$module_search_filter
|
$module_search_filter
|
||||||
$module_status_join
|
$module_status_join
|
||||||
WHERE ta.disabled = 0
|
WHERE ta.disabled = 0
|
||||||
AND ta.id_grupo = $item_for_count
|
AND (
|
||||||
|
ta.id_grupo = $item_for_count
|
||||||
|
OR tasg.id_group = $item_for_count
|
||||||
|
)
|
||||||
$group_filter
|
$group_filter
|
||||||
$agent_search_filter
|
$agent_search_filter
|
||||||
$agent_status_filter";
|
$agent_status_filter";
|
||||||
|
@ -443,7 +451,7 @@ class Tree {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (! is_metaconsole() || $this->strictACL) {
|
if (! is_metaconsole()) {
|
||||||
$columns = 'ta.id_agente AS id, ta.nombre AS name, ta.alias,
|
$columns = 'ta.id_agente AS id, ta.nombre AS name, ta.alias,
|
||||||
ta.fired_count, ta.normal_count, ta.warning_count,
|
ta.fired_count, ta.normal_count, ta.warning_count,
|
||||||
ta.critical_count, ta.unknown_count, ta.notinit_count,
|
ta.critical_count, ta.unknown_count, ta.notinit_count,
|
||||||
|
@ -456,13 +464,18 @@ class Tree {
|
||||||
|
|
||||||
$sql = "SELECT $columns
|
$sql = "SELECT $columns
|
||||||
FROM tagente ta
|
FROM tagente ta
|
||||||
|
LEFT JOIN tagent_secondary_group tasg
|
||||||
|
ON tasg.id_agent = ta.id_agente
|
||||||
LEFT JOIN tagente_modulo tam
|
LEFT JOIN tagente_modulo tam
|
||||||
ON tam.disabled = 0
|
ON tam.disabled = 0
|
||||||
AND ta.id_agente = tam.id_agente
|
AND ta.id_agente = tam.id_agente
|
||||||
$module_search_filter
|
$module_search_filter
|
||||||
$module_status_join
|
$module_status_join
|
||||||
WHERE ta.disabled = 0
|
WHERE ta.disabled = 0
|
||||||
AND ta.id_grupo = $rootID
|
AND (
|
||||||
|
ta.id_grupo = $rootID
|
||||||
|
OR tasg.id_group = $rootID
|
||||||
|
)
|
||||||
$group_filter
|
$group_filter
|
||||||
$agent_search_filter
|
$agent_search_filter
|
||||||
$agent_status_filter
|
$agent_status_filter
|
||||||
|
@ -514,12 +527,14 @@ class Tree {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT $columns
|
$sql = "SELECT DISTINCT $columns
|
||||||
FROM tagente_modulo tam
|
FROM tagente_modulo tam
|
||||||
$tag_join
|
$tag_join
|
||||||
$module_status_join
|
$module_status_join
|
||||||
INNER JOIN tagente ta
|
INNER JOIN tagente ta
|
||||||
ON ta.disabled = 0
|
ON ta.disabled = 0
|
||||||
|
LEFT JOIN tagent_secondary_group tasg
|
||||||
|
ON ta.id_agente = tasg.id_agent
|
||||||
AND tam.id_agente = ta.id_agente
|
AND tam.id_agente = ta.id_agente
|
||||||
AND ta.id_grupo = $rootID
|
AND ta.id_grupo = $rootID
|
||||||
$group_filter
|
$group_filter
|
||||||
|
@ -1120,11 +1135,11 @@ class Tree {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$sql = $this->getSqlExtended($item_for_count, $type, $rootType, $parent, $rootID,
|
$sql = $this->getSqlExtended($item_for_count, $type, $rootType, $parent, $rootID,
|
||||||
$agent_search_filter, $agent_status_filter, $agents_join,
|
$agent_search_filter, $agent_status_filter, $agents_join,
|
||||||
$module_search_filter, $module_status_filter, $modules_join,
|
$module_search_filter, $module_status_filter, $modules_join,
|
||||||
$module_status_join);
|
$module_status_join);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $sql;
|
return $sql;
|
||||||
|
|
Loading…
Reference in New Issue