2011-09-08 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_api.php: added in the output of get events the agent
	name and group name.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4953 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2011-09-15 10:12:32 +00:00
parent b5138aecdb
commit 159c96b971
2 changed files with 14 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2011-09-08 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_api.php: added in the output of get events the agent
name and group name.
2011-09-14 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/help/en/help_gis_tab.php

View File

@ -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);