mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Added search by secondary group name
This commit is contained in:
parent
810db1eec4
commit
4023327091
@ -179,6 +179,8 @@ if ($searchAgents) {
|
||||
$userGroups = users_get_groups($config['id_user'], 'AR', false);
|
||||
$id_userGroups = array_keys($userGroups);
|
||||
|
||||
$has_secondary = enterprise_hook('agents_is_using_secondary_groups');
|
||||
|
||||
$sql = "SELECT DISTINCT taddress_agent.id_agent FROM taddress
|
||||
INNER JOIN taddress_agent ON
|
||||
taddress.id_a = taddress_agent.id_a
|
||||
@ -207,6 +209,11 @@ if ($searchAgents) {
|
||||
t1.alias COLLATE utf8_general_ci LIKE '%%".$stringSearchSQL."%%'";
|
||||
}
|
||||
|
||||
if ($has_secondary === true) {
|
||||
$search_sql .= " OR (tasg.id_group IS NOT NULL AND
|
||||
tasg.id_group IN (SELECT id_grupo FROM tgrupo WHERE nombre COLLATE utf8_general_ci LIKE '%%".$stringSearchSQL."%%'))";
|
||||
}
|
||||
|
||||
$sql = "
|
||||
FROM tagente t1 LEFT JOIN tagent_secondary_group tasg
|
||||
ON t1.id_agente = tasg.id_agent
|
||||
|
Loading…
x
Reference in New Issue
Block a user