diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 7533f94976..b2ea05a979 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2011-11-30 Juan Manuel Ramon + + * include/ajax/agent.php + operation/agentes/exportdata.php: Fixed agent autocomplete + functionality. + 2011-11-30 Juan Manuel Ramon * include/functions_reporting.php: Fixed html render of combined diff --git a/pandora_console/include/ajax/agent.php b/pandora_console/include/ajax/agent.php index 0647b36ecc..acb8189c2e 100644 --- a/pandora_console/include/ajax/agent.php +++ b/pandora_console/include/ajax/agent.php @@ -33,7 +33,7 @@ if ($search_agents && ($config['metaconsole'] == 0)) { $id_agent = (int) get_parameter ('id_agent'); $string = (string) get_parameter ('q'); /* q is what autocomplete plugin gives */ - $id_group = (int) get_parameter('id_group'); + $id_group = get_parameter('id_group', -1); $addedItems = html_entity_decode((string) get_parameter('add')); $addedItems = json_decode($addedItems); @@ -53,8 +53,9 @@ if ($search_agents && ($config['metaconsole'] == 0)) { $filter[] = '(UPPER(nombre) LIKE UPPER(\'%'.$string.'%\') OR UPPER(direccion) LIKE UPPER(\'%'.$string.'%\') OR UPPER(comentarios) LIKE UPPER(\'%'.$string.'%\'))'; break; } - - $filter['id_grupo'] = $id_group; + + if ($id_group != -1) + $filter['id_grupo'] = $id_group; $agents = agents_get_agents ($filter, array ('id_agente','nombre', 'direccion')); if ($agents === false) diff --git a/pandora_console/operation/agentes/exportdata.php b/pandora_console/operation/agentes/exportdata.php index a1f0cf47f7..901c7ac550 100644 --- a/pandora_console/operation/agentes/exportdata.php +++ b/pandora_console/operation/agentes/exportdata.php @@ -24,7 +24,7 @@ if (is_ajax ()) { $id_agent = (int) get_parameter ('id_agent'); $string = (string) get_parameter ('q'); /* q is what autocomplete plugin gives */ - $id_group = (int) get_parameter('id_group'); + $id_group = (int) get_parameter('id_group', -1); $addedItems = html_entity_decode((string) get_parameter('add')); $addedItems = json_decode($addedItems); $all = (string)get_parameter('all', 'all'); @@ -47,7 +47,9 @@ if (is_ajax ()) { $filter[] = '(UPPER(nombre) LIKE UPPER(\'%'.$string.'%\') OR UPPER(direccion) LIKE UPPER(\'%'.$string.'%\') OR UPPER(comentarios) LIKE UPPER(\'%'.$string.'%\'))'; break; } - $filter['id_grupo'] = $id_group; + + if ($id_group != -1) + $filter['id_grupo'] = $id_group; switch ($all) { case 'enabled':