From 497518132f978db39a7d5d3ebc228d6c12704b05 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Thu, 22 Sep 2011 19:02:46 +0000 Subject: [PATCH] 2011-09-22 Miguel de Dios * include/functions_api.php: fixed the lost check for the timestamps in the "get_events" call. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4986 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/include/functions_api.php | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 2cf366986d..2fe4ba5e72 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2011-09-22 Miguel de Dios + + * include/functions_api.php: fixed the lost check for the timestamps in the + "get_events" call. + 2011-09-22 Juan Manuel Ramon * operation/agentes/estado_monitores.php: Erased traces and db_clean_cache(). diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 600755af58..b4a9d3d1e1 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -1540,6 +1540,14 @@ function get_events__with_user($trash1, $trash2, $other, $returnType, $user_in_d $pagination = $filter['limit']; if (isset($filter['offset'])) $offset = $filter['offset']; + if ($filter['utimestamp']) { + if (isset($filter['utimestamp']['>'])) { + $utimestamp_upper = $filter['utimestamp']['>']; + } + if (isset($filter['utimestamp']['<'])) { + $utimestamp_bottom = $filter['utimestamp']['<']; + } + } //TODO MOVE THIS CODE AND THE CODE IN pandora_console/operation/events/events_list.php @@ -1633,8 +1641,8 @@ function get_events__with_user($trash1, $trash2, $other, $returnType, $user_in_d (SELECT t2.icon FROM tgrupo AS t2 WHERE t2.id_grupo = tevento.id_grupo) AS group_icon FROM tevento" . //FOR THE TEST THE API IN THE ANDROID -// "WHERE 1=1 ".$sql_post." ORDER BY id_evento ASC LIMIT ".$offset.",".$pagination; - "WHERE 1=1 ".$sql_post." ORDER BY utimestamp DESC LIMIT ".$offset.",".$pagination; +// " WHERE 1=1 ".$sql_post." ORDER BY id_evento ASC LIMIT ".$offset.",".$pagination; + " WHERE 1=1 ".$sql_post." ORDER BY utimestamp DESC LIMIT ".$offset.",".$pagination; } break; case "postgresql": @@ -1716,6 +1724,7 @@ function get_events__with_user($trash1, $trash2, $other, $returnType, $user_in_d } $result = db_get_all_rows_sql ($sql); + //html_debug_print($sql); if (($result !== false) && (!$filter['total'])) { //Add the description and image