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

* include/functions_api.php: added the call "get_events" the filters for the
	free text in event description and status of event.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5007 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2011-09-26 14:29:55 +00:00
parent 20252bf796
commit 354f1d9b2f
2 changed files with 36 additions and 9 deletions

View File

@ -1,3 +1,8 @@
2011-09-26 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_api.php: added the call "get_events" the filters for the
free text in event description and status of event.
2011-09-26 Sancho Lerena <slerena@artica.es>
* pandora_console/index.php: Developer mode disabled.

View File

@ -922,34 +922,52 @@ function otherParameter2Filter($other, $array = false) {
}
}
if ($other['data'][8] != null) {
if (($other['data'][8] != null) && ($other['data'][8] != -1)) {
if ($array) {
$filter['limit'] = $other['data'][8];
$filter['estado'] = $other['data'][8];
}
else {
$filterString .= ' LIMIT ' . $other['data'][8];
$filterString .= ' AND estado = ' . $other[8];
}
}
if ($other['data'][9] != null) {
if (($other['data'][9] != null) && ($other['data'][9] != "")) {
if ($array) {
$filter['offset'] = $other['data'][9];
$filter['evento'] = $other['data'][9];
}
else {
$filterString .= ' OFFSET ' . $other['data'][9];
$filterString .= ' AND evento like "%' . $other[9] . '%"';
}
}
if (isset($other['data'][10]) && ($other['data'][10] != null)) {
if ($other['data'][10] != null) {
if ($array) {
$filter['limit'] = $other['data'][10];
}
else {
$filterString .= ' LIMIT ' . $other['data'][10];
}
}
if ($other['data'][11] != null) {
if ($array) {
$filter['offset'] = $other['data'][11];
}
else {
$filterString .= ' OFFSET ' . $other['data'][11];
}
}
if (isset($other['data'][12]) && ($other['data'][12] != null)) {
if ($array) {
$filter['total'] = false;
$filter['more_criticity'] = false;
if ($other['data'][10] == 'total') {
if ($other['data'][12] == 'total') {
$filter['total'] = true;
}
if ($other['data'][10] == 'more_criticity') {
if ($other['data'][12] == 'more_criticity') {
$filter['more_criticity'] = true;
}
}
@ -1563,6 +1581,10 @@ function get_events__with_user($trash1, $trash2, $other, $returnType, $user_in_d
$id_alert_am = $filter['id_alert_am'];
if (isset($filter['id_usuario']))
$id_user_ack = $filter['id_usuario'];
if (isset($filter['estado']))
$status = $filter['estado'];
if (isset($filter['evento']))
$search = $filter['evento'];
if (isset($filter['limit']))
$pagination = $filter['limit'];
if (isset($filter['offset']))