2012-05-24 Santiago Munin <burning1@gmail.com>

* 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
This commit is contained in:
santimunin 2012-05-24 19:37:24 +00:00
parent cc941f12c8
commit bd161b233d
2 changed files with 30 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2012-05-24 Santiago Munin <burning1@gmail.com>
* include/functions_api.php: Added "group id" and "tag" to the current get_events filters.
2012-05-24 Santiago Munin <burning1@gmail.com>
* pandoradb_data.sql: Fixed a double insert with the same ID value (it was making fail the installation).

View File

@ -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']['>'];