From bd161b233d13db6e3c5c2e1c7cb830e837db6b95 Mon Sep 17 00:00:00 2001 From: santimunin Date: Thu, 24 May 2012 19:37:24 +0000 Subject: [PATCH] 2012-05-24 Santiago Munin * include/functions_api.php: Added "group id" and "tag" to the current get_events filters. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6346 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 4 ++++ pandora_console/include/functions_api.php | 26 +++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index d5aa048db2..7f776d1ec8 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,7 @@ +2012-05-24 Santiago Munin + + * include/functions_api.php: Added "group id" and "tag" to the current get_events filters. + 2012-05-24 Santiago Munin * pandoradb_data.sql: Fixed a double insert with the same ID value (it was making fail the installation). diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 4a80fd1b34..b9c3a77cfd 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -3897,6 +3897,24 @@ function otherParameter2Filter($other, $return_as_array = false) { } } + if (isset($other['data'][13]) && ($other['data'][13] != null)) { + if ($return_as_array) { + $filter['id_group'] = $other['data'][13]; + } + else { + $filterString .= ' AND id_grupo =' . $other['data'][13]; + } + } + + if (isset($other['data'][14]) && ($other['data'][14] != null)) { + + if ($return_as_array) { + $filter['tag'] = $other['data'][14]; + } + else { + $filterString .= " AND tags LIKE '%" . $other['data'][14]."%'"; + } + } if ($return_as_array) { return $filter; } @@ -4503,6 +4521,14 @@ function get_events__with_user($trash1, $trash2, $other, $returnType, $user_in_d $pagination = $filter['limit']; if (isset($filter['offset'])) $offset = $filter['offset']; + if (isset($filter['id_group'])) { + $id_group = $filter['id_group']; + //A little hack to make the query fetch all groups and not only "All" (with id=0) + if ($id_group == 0) + $id_group = -1; + } + if (isset($filter['tag'])) + $tag = $filter['tag']; if ($filter['utimestamp']) { if (isset($filter['utimestamp']['>'])) { $utimestamp_upper = $filter['utimestamp']['>'];