[Secondary groups] Fixed agent filter on node tree view

This commit is contained in:
fermin831 2018-04-09 12:40:11 +02:00
parent 89181b6f42
commit 9972252a3f

View File

@ -371,7 +371,8 @@ class Tree {
); );
} }
else{ else{
$query_agent_search = " SELECT DISTINCT(ta.id_grupo) $id_groups_agents = db_get_all_rows_sql(
" SELECT DISTINCT(ta.id_grupo)
FROM tagente ta FROM tagente ta
LEFT JOIN tagent_secondary_group tasg LEFT JOIN tagent_secondary_group tasg
ON ta.id_agente = tasg.id_agent ON ta.id_agente = tasg.id_agent
@ -379,8 +380,19 @@ class Tree {
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
$module_search_filter"; $module_search_filter"
$id_groups_agents = db_get_all_rows_sql($query_agent_search); );
$id_secondary_groups_agents = db_get_all_rows_sql(
" SELECT DISTINCT(tasg.id_group)
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
AND ta.disabled = 0
$agent_search_filter
$module_search_filter"
);
} }
if($id_groups_agents != false){ if($id_groups_agents != false){