From 12f0c69912b8d593939152a713760f315bee5a78 Mon Sep 17 00:00:00 2001 From: juanmanuelr Date: Wed, 30 Nov 2011 14:55:08 +0000 Subject: [PATCH] 2011-11-30 Juan Manuel Ramon * include/functions_agents.php: Fixed bad sql sintax in agents_get_agents funtion. Fixes: #3445995 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5215 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 +++++++ pandora_console/include/functions_agents.php | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index ea5af6b5ff..515219cd60 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2011-11-30 Juan Manuel Ramon + + * include/functions_agents.php: Fixed bad sql sintax in + agents_get_agents funtion. + + Fixes: #3445995 + 2011-11-30 Juan Manuel Ramon * operation/agentes/estado_generalagente.php diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 3ce63905c6..9c875d1732 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -388,8 +388,11 @@ function agents_get_agents ($filter = false, $fields = false, $access = 'AR', $o } } - if($extra) { - $where = sprintf('%s AND (%s OR %s)', $where, $where_nogroup, $sql_extra); + if($extra) { + if (empty($where_nogroup)) + $where = sprintf('%s AND (%s)', $where, $sql_extra); + else + $where = sprintf('%s AND (%s OR %s)', $where, $where_nogroup, $sql_extra); } else { $where = sprintf('%s AND %s', $where, $where_nogroup);