diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index a6902251fa..ad8085407d 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2011-09-08 Miguel de Dios + + * include/functions_api.php: added in the output of get events the agent + name and group name. + 2011-09-14 Juan Manuel Ramon * include/help/en/help_gis_tab.php diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index d41200d723..b56f62f238 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -1572,12 +1572,16 @@ function get_events__with_user($trash1, $trash2, $other, $returnType, $user_in_d if ($group_rep == 0) { switch ($config["dbtype"]) { case "mysql": - $sql = "SELECT * + $sql = "SELECT *, + (SELECT t1.nombre FROM tagente AS t1 WHERE t1.id_agente = tevento.id_agente) AS agent_name, + (SELECT t2.nombre FROM tgrupo AS t2 WHERE t2.id_grupo = tevento.id_grupo) AS group_name FROM tevento WHERE 1=1 ".$sql_post." ORDER BY utimestamp DESC LIMIT ".$offset.",".$pagination; break; case "postgresql": - $sql = "SELECT * + $sql = "SELECT *, + (SELECT t1.nombre FROM tagente AS t1 WHERE t1.id_agente = tevento.id_agente) AS agent_name, + (SELECT t2.nombre FROM tgrupo AS t2 WHERE t2.id_grupo = tevento.id_grupo) AS group_name FROM tevento WHERE 1=1 ".$sql_post." ORDER BY utimestamp DESC LIMIT ".$pagination." OFFSET ".$offset; break; @@ -1585,7 +1589,9 @@ function get_events__with_user($trash1, $trash2, $other, $returnType, $user_in_d $set = array(); $set['limit'] = $pagination; $set['offset'] = $offset; - $sql = "SELECT * + $sql = "SELECT *, + (SELECT t1.nombre FROM tagente AS t1 WHERE t1.id_agente = tevento.id_agente) AS agent_name, + (SELECT t2.nombre FROM tgrupo AS t2 WHERE t2.id_grupo = tevento.id_grupo) AS group_name FROM tevento WHERE 1=1 ".$sql_post." ORDER BY utimestamp DESC"; $sql = oracle_recode_query ($sql, $set);