2011-09-23 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_api.php: added the code for the return the more criticity event in the API call "get_events". git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4995 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
b07cfa82a8
commit
09881f2a70
|
@ -1,3 +1,8 @@
|
|||
2011-09-23 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions_api.php: added the code for the return the more
|
||||
criticity event in the API call "get_events".
|
||||
|
||||
2011-09-23 Sancho Lerena <slerena@artica.es>
|
||||
|
||||
* pandoradb_data.sql: Update version and DB Build.
|
||||
|
|
|
@ -942,7 +942,16 @@ function otherParameter2Filter($other, $array = false) {
|
|||
|
||||
if (isset($other['data'][10]) && ($other['data'][10] != null)) {
|
||||
if ($array) {
|
||||
$filter['total'] = true;
|
||||
$filter['total'] = false;
|
||||
$filter['more_criticity'] = false;
|
||||
|
||||
if ($other['data'][10] == 'total') {
|
||||
$filter['total'] = true;
|
||||
}
|
||||
|
||||
if ($other['data'][10] == 'more_criticity') {
|
||||
$filter['more_criticity'] = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
|
@ -951,6 +960,7 @@ function otherParameter2Filter($other, $array = false) {
|
|||
else {
|
||||
if ($array) {
|
||||
$filter['total'] = false;
|
||||
$filter['more_criticity'] = false;
|
||||
}
|
||||
else {
|
||||
|
||||
|
@ -1634,6 +1644,11 @@ function get_events__with_user($trash1, $trash2, $other, $returnType, $user_in_d
|
|||
FROM tevento
|
||||
WHERE 1=1 ".$sql_post;
|
||||
}
|
||||
else if ($filter['more_criticity']) {
|
||||
$sql = "SELECT criticity
|
||||
FROM tevento
|
||||
WHERE 1=1 ".$sql_post." ORDER BY criticity DESC LIMIT 1";
|
||||
}
|
||||
else {
|
||||
$sql = "SELECT *,
|
||||
(SELECT t1.nombre FROM tagente AS t1 WHERE t1.id_agente = tevento.id_agente) AS agent_name,
|
||||
|
@ -1722,11 +1737,11 @@ function get_events__with_user($trash1, $trash2, $other, $returnType, $user_in_d
|
|||
else if ($other['type'] == 'array') {
|
||||
$separator = $other['data'][0];
|
||||
}
|
||||
|
||||
//html_debug_print($filter, true);
|
||||
$result = db_get_all_rows_sql ($sql);
|
||||
//html_debug_print($sql);
|
||||
|
||||
if (($result !== false) && (!$filter['total'])) {
|
||||
if (($result !== false) && (!$filter['total']) && (!$filter['more_criticity'])) {
|
||||
//Add the description and image
|
||||
foreach ($result as $key => $row) {
|
||||
//FOR THE TEST THE API IN THE ANDROID
|
||||
|
|
Loading…
Reference in New Issue