Merge branch 'ent-3855-Problemas_grupos_secundarios_en_input_auto_completado_de_modulos' into 'develop'

fixed error autocomplete input module

See merge request artica/pandorafms!2345

Former-commit-id: 76a7c4aa1d611a21b307d0d6367a1f15dc40b323
This commit is contained in:
Daniel Rodriguez 2019-04-09 13:14:38 +02:00
commit 5494a6129f
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 = [];