mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Added secondary groups in global search
Former-commit-id: a569f78754d1f683b1585c235f1f568425c83fad
This commit is contained in:
parent
29e1fc828c
commit
153ba4279e
@ -182,7 +182,8 @@ if ($searchAgents) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sql = "
|
$sql = "
|
||||||
FROM tagente t1
|
FROM tagente t1 LEFT JOIN tagent_secondary_group tasg
|
||||||
|
ON t1.id_agente = tasg.id_agent
|
||||||
INNER JOIN tgrupo t2
|
INNER JOIN tgrupo t2
|
||||||
ON t2.id_grupo = t1.id_grupo
|
ON t2.id_grupo = t1.id_grupo
|
||||||
WHERE (
|
WHERE (
|
||||||
@ -191,9 +192,11 @@ if ($searchAgents) {
|
|||||||
FROM tusuario
|
FROM tusuario
|
||||||
WHERE id_user = '".$config['id_user']."'
|
WHERE id_user = '".$config['id_user']."'
|
||||||
)
|
)
|
||||||
OR t1.id_grupo IN (
|
OR (
|
||||||
".implode(',', $id_userGroups)."
|
t1.id_grupo IN (".implode(',', $id_userGroups).')
|
||||||
) OR 0 IN (
|
OR tasg.id_group IN ('.implode(',', $id_userGroups).")
|
||||||
|
)
|
||||||
|
OR 0 IN (
|
||||||
SELECT id_grupo
|
SELECT id_grupo
|
||||||
FROM tusuario_perfil
|
FROM tusuario_perfil
|
||||||
WHERE id_usuario = '".$config['id_user']."'
|
WHERE id_usuario = '".$config['id_user']."'
|
||||||
@ -208,7 +211,7 @@ if ($searchAgents) {
|
|||||||
)
|
)
|
||||||
';
|
';
|
||||||
|
|
||||||
$select = 'SELECT t1.id_agente, t1.ultimo_contacto, t1.nombre, t1.id_os, t1.intervalo, t1.id_grupo, t1.disabled, t1.alias, t1.quiet';
|
$select = 'SELECT DISTINCT(t1.id_agente), t1.ultimo_contacto, t1.nombre, t1.id_os, t1.intervalo, t1.id_grupo, t1.disabled, t1.alias, t1.quiet';
|
||||||
if ($only_count) {
|
if ($only_count) {
|
||||||
$limit = ' ORDER BY '.$order['field'].' '.$order['order'].' LIMIT '.$config['block_size'].' OFFSET 0';
|
$limit = ' ORDER BY '.$order['field'].' '.$order['order'].' LIMIT '.$config['block_size'].' OFFSET 0';
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user