2011-05-19 Vanessa Gil <vanessa.gil@artica.es>

* operation/agentes/alerts_status.php 
	include/functions_agents.php: Fixed filter Status in Alert Detail and pagination.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4368 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
vgilc 2011-05-19 08:51:49 +00:00
parent 84ff993022
commit 385b33b605
3 changed files with 12 additions and 7 deletions

View File

@ -1,3 +1,8 @@
2011-05-19 Vanessa Gil <vanessa.gil@artica.es>
* operation/agentes/alerts_status.php
include/functions_agents.php: Fixed filter Status in Alert Detail and pagination.
2011-05-18 Miguel de Dios <miguel.dedios@artica.es> 2011-05-18 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_agents.php: changed the source code to fixed the * include/functions_agents.php: changed the source code to fixed the

View File

@ -150,8 +150,7 @@ function agents_get_alerts_simple ($id_agent = false, $filter = '', $options = f
if (is_array ($options)) { if (is_array ($options)) {
$filter .= db_format_array_where_clause_sql ($options); $filter .= db_format_array_where_clause_sql ($options);
} }
if (($id_agent !== false) && ($idGroup !== false)) {
if (($id_agent === false) && ($idGroup !== false)) {
if ($idGroup != 0) { //All group if ($idGroup != 0) { //All group
$subQuery = 'SELECT id_agente_modulo $subQuery = 'SELECT id_agente_modulo
FROM tagente_modulo FROM tagente_modulo
@ -206,6 +205,7 @@ function agents_get_alerts_simple ($id_agent = false, $filter = '', $options = f
ON talert_template_modules.id_alert_template = t4.id ON talert_template_modules.id_alert_template = t4.id
WHERE id_agent_module in (%s) %s %s %s", WHERE id_agent_module in (%s) %s %s %s",
$selectText, $subQuery, $where, $filter, $orderbyText); $selectText, $subQuery, $where, $filter, $orderbyText);
break;
case "oracle": case "oracle":
$sql = sprintf ("SELECT %s $sql = sprintf ("SELECT %s
FROM talert_template_modules FROM talert_template_modules
@ -218,7 +218,7 @@ function agents_get_alerts_simple ($id_agent = false, $filter = '', $options = f
WHERE id_agent_module in (%s) %s %s %s", WHERE id_agent_module in (%s) %s %s %s",
$selectText, $subQuery, $where, $filter, $orderbyText); $selectText, $subQuery, $where, $filter, $orderbyText);
} }
$alerts = db_get_all_rows_sql ($sql); $alerts = db_get_all_rows_sql ($sql);
if ($alerts === false) if ($alerts === false)
@ -265,7 +265,7 @@ function agents_get_alerts_compound ($id_agent = false, $filter = '', $options =
$filter .= db_format_array_where_clause_sql ($options); $filter .= db_format_array_where_clause_sql ($options);
} }
if (($id_agent === false) && ($idGroup !== false)) { if (($id_agent !== false) && ($idGroup !== false)) {
if ($idGroup != 0) { //All group if ($idGroup != 0) { //All group
$subQuery = 'SELECT id_agente FROM tagente WHERE id_grupo = ' . $idGroup; $subQuery = 'SELECT id_agente FROM tagente WHERE id_grupo = ' . $idGroup;
} }
@ -291,9 +291,9 @@ function agents_get_alerts_compound ($id_agent = false, $filter = '', $options =
$sql = sprintf ("SELECT %s FROM talert_compound $sql = sprintf ("SELECT %s FROM talert_compound
WHERE id_agent IN (%s) %s %s", WHERE id_agent IN (%s) %s %s",
$selectText, $subQuery, $where, $filter); $selectText, $subQuery, $where, $filter);
$alerts = db_get_all_rows_sql ($sql); $alerts = db_get_all_rows_sql ($sql);
if ($alerts === false) if ($alerts === false)
return array (); return array ();

View File

@ -215,7 +215,7 @@ if($filter_standby == 'standby_on') {
$alerts['alerts_simple'] = agents_get_alerts_simple ($agents, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup); $alerts['alerts_simple'] = agents_get_alerts_simple ($agents, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup);
$countAlertsSimple = agents_get_alerts_simple ($agents, $filter, false, $whereAlertSimple, false, false, $idGroup, true); $countAlertsSimple = agents_get_alerts_simple ($agents, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true);
$alerts['alerts_combined'] = agents_get_alerts_compound($agents, $filter, $options_combined, $idGroup, false, $whereAlertCombined); $alerts['alerts_combined'] = agents_get_alerts_compound($agents, $filter, $options_combined, $idGroup, false, $whereAlertCombined);
$countAlertsCombined = agents_get_alerts_compound($agents, $filter, false, $idGroup, true, $whereAlertCombined); $countAlertsCombined = agents_get_alerts_compound($agents, $filter, false, $idGroup, true, $whereAlertCombined);