fixed error autocomplete input module

Former-commit-id: c9fca2ba51b3b0872d39e658f18c5d3c5e917dbd
This commit is contained in:
Daniel Barbero Martin 2019-04-09 09:51:03 +02:00
parent 0d05d5c842
commit 3e4a7bfdbf
1 changed files with 2 additions and 26 deletions

View File

@ -2744,28 +2744,7 @@ function html_print_autocomplete_modules(
global $config;
if ($id_agents === false) {
$groups = [];
if ($ACL) {
$groups = users_get_groups($config['id_user'], 'AW', false);
$groups = array_keys($groups);
if (empty($groups)) {
$id_groups = 0;
} else {
$id_groups = implode(',', $groups);
}
$agents = db_get_all_rows_sql(
'SELECT id_agente
FROM tagente
WHERE id_grupo IN ('.$id_groups.')'
);
} else {
$agents = db_get_all_rows_sql(
'SELECT id_agente
FROM tagente'
);
}
$agents = agents_get_agents();
if ($agents === false) {
$agents = [];
@ -2777,10 +2756,7 @@ function html_print_autocomplete_modules(
}
} else {
if ($ACL) {
$groups = users_get_groups($config['id_user'], 'AW', false);
$groups = array_keys($groups);
$agents = db_get_all_rows_sql('SELECT id_agente FROM tagente WHERE id_grupo IN ('.implode(',', $groups).')');
$agents = agents_get_agents();
if ($agents === false) {
$agents = [];