[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,16 +371,28 @@ class Tree {
); );
} }
else{ else{
$query_agent_search = " SELECT DISTINCT(ta.id_grupo) $id_groups_agents = db_get_all_rows_sql(
FROM tagente ta " SELECT DISTINCT(ta.id_grupo)
LEFT JOIN tagent_secondary_group tasg FROM tagente ta
ON ta.id_agente = tasg.id_agent LEFT JOIN tagent_secondary_group tasg
, tagente_modulo tam ON ta.id_agente = tasg.id_agent
WHERE tam.id_agente = ta.id_agente , tagente_modulo tam
AND ta.disabled = 0 WHERE tam.id_agente = ta.id_agente
$agent_search_filter AND ta.disabled = 0
$module_search_filter"; $agent_search_filter
$id_groups_agents = db_get_all_rows_sql($query_agent_search); $module_search_filter"
);
$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){