From 8afc6a40f3d4f0fb5184976570357af6e5e7d989 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 16 Apr 2013 16:51:09 +0000 Subject: [PATCH] 2013-04-16 Miguel de Dios * operation/agentes/alerts_status.php: fixed the PHP warnings and improved the show when have not alerts. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7997 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++ .../operation/agentes/alerts_status.php | 33 +++++++++++-------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 3148f245e3..4608fd9bdd 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2013-04-16 Miguel de Dios + + * operation/agentes/alerts_status.php: fixed the PHP warnings and + improved the show when have not alerts. + 2013-04-16 Miguel de Dios * godmode/groups/group_list.php: fixed notice PHP. diff --git a/pandora_console/operation/agentes/alerts_status.php b/pandora_console/operation/agentes/alerts_status.php index 68a79ee627..1bc76b444c 100644 --- a/pandora_console/operation/agentes/alerts_status.php +++ b/pandora_console/operation/agentes/alerts_status.php @@ -54,7 +54,11 @@ $flag_alert = (bool) get_parameter ('force_execution', 0); $alert_validate = (bool) get_parameter ('alert_validate', 0); $tab = get_parameter_get ("tab", null); -$url = 'index.php?sec='.$sec.'&sec2='.$sec2.'&refr='.$config["refr"].'&filter='.$filter.'&filter_standby='.$filter_standby.'&ag_group='.$id_group; +$refr = (int)get_parameter('refr', 0); + +$url = 'index.php?sec=' . $sec . '&sec2=' . $sec2 . '&refr=' . $refr . + '&filter=' . $filter . '&filter_standby=' . $filter_standby . + '&ag_group=' . $id_group; if ($flag_alert == 1 && check_acl($config['id_user'], $id_group, "AW")) { forceExecution($id_group); @@ -104,7 +108,8 @@ else { if ($alert_validate) { if (check_acl ($config["id_user"], $id_group, "AW") == 0) { - echo '

'.__('Insufficient permissions to validate alerts').'

'; + echo '

' . + __('Insufficient permissions to validate alerts') . '

'; } else { validateAlert(); @@ -376,26 +381,26 @@ foreach ($alerts['alerts_simple'] as $alert) { array_push ($table->data, ui_format_alert_row ($alert, $print_agent, $url, 'font-size: 7pt;')); } -echo '
'; - if (!empty ($table->data)) { + echo ''; + ui_pagination ($countAlertsSimple, $url, $offset_simple, 0, false, 'offset_simple'); html_print_table ($table); + + if (check_acl ($config["id_user"], $id_group, "AW") || check_acl ($config["id_user"], $id_group, "AM")) { + if (count($alerts['alerts_simple']) > 0) { + echo '
'; + html_print_submit_button (__('Validate'), 'alert_validate', false, 'class="sub ok"', false); + echo '
'; + } + } + + echo '
'; } else { echo '
'.__('No alerts found').'
'; } -if (check_acl ($config["id_user"], $id_group, "AW") || check_acl ($config["id_user"], $id_group, "AM")) { - if (count($alerts['alerts_simple']) > 0) { - echo '
'; - html_print_submit_button (__('Validate'), 'alert_validate', false, 'class="sub ok"', false); - echo '
'; - } -} - -echo ''; - ui_require_css_file('cluetip'); ui_require_jquery_file('cluetip'); ?>