diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 8b1ea71400..516b0a9f99 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2012-09-05 Vanessa Gil + + * general/header.php + include/functions_ui.php: Enable/disable autorefresh. + 2012-09-04 Juan Manuel Ramon * include/functions_graph.php diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index a284713136..2ec0121988 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -130,20 +130,23 @@ config_check(); false, 'code' => false); - if ($config["refr"]) {//autorefresh interval - $ignored_params['refr'] = 0; - if (($config['enable_refr']) || (($_GET['sec2'] == 'operation/agentes/tactical') || ($_GET['sec2'] == 'operation/agentes/estado_agente') || + + if ($config['enable_refr']) { + $ignored_params['refr'] = 0; + echo '' . html_print_image("images/page_refresh.png", true, array("class" => 'bot', "alt" => 'lightning')) . ' '. __('Autorefresh'); + echo ' ('.date ("i:s", $config["refr"]).')'; + echo ''; + } else { + + if (($config['refr']) && (($_GET['sec2'] == 'operation/agentes/tactical') || ($_GET['sec2'] == 'operation/agentes/estado_agente') || ($_GET['sec2'] == 'operation/agentes/group_view') || ($_GET['sec2'] == 'operation/events/events') || - ($_GET['sec2'] == 'enterprise/dashboard/main_dashboard'))) { //enable autorefresh to all pages or default pages - + ($_GET['sec2'] == 'enterprise/dashboard/main_dashboard'))) { + echo '' . html_print_image("images/page_refresh.png", true, array("class" => 'bot', "alt" => 'lightning')) . ' '. __('Autorefresh'); echo ' ('.date ("i:s", $config["refr"]).')'; echo ''; - - } - else { - - $ignored_params['refr'] = ''; + } else { + $ignored_params['refr'] = ''; echo '' . html_print_image("images/page_refresh.png", true, array("class" => 'bot', "alt" => 'lightning')) . ' '. __('Autorefresh').''; $values = array ( '5' => __('5 seconds'), @@ -160,28 +163,9 @@ config_check(); html_print_select ($values, 'ref', '', '', __('Select'), '0', false, false, false); unset ($values); echo ''; - } } - else { - $ignored_params['refr'] = ''; - echo '' . html_print_image("images/page_refresh.png", true, array("class" => 'bot', "alt" => 'lightning')) . ' '. __('Autorefresh').''; - $values = array ( - '5' => __('5 seconds'), - '10' => __('10 seconds'), - '15' => __('15 seconds'), - '30' => __('30 seconds'), - (string)SECONDS_1MINUTE => __('1 minute'), - (string)SECONDS_2MINUTES => __('2 minutes'), - (string)SECONDS_5MINUTES => __('5 minutes'), - (string)SECONDS_15MINUTES => __('15 minutes'), - (string)SECONDS_30MINUTES => __('30 minutes'), - (string)SECONDS_1HOUR => __('1 hour')); - echo ''; - } + ?> diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index a48069d63a..48b025bf87 100644 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -1108,9 +1108,14 @@ function ui_process_page_head ($string, $bitfield) { // If user is logged or displayed view is the public view of visual console if ($config["refr"] > 0 && (isset($config['id_user']) || $vc_public_view == 1)) { - $query = ui_get_url_refresh (false); - - $output .= ''; + if ($config['enable_refr'] || $GET['sec2'] == "operation/agentes/estado_agente" || $GET['sec2'] == "operation/agentes/tactical"|| + $_GET['sec2'] == "operation/agentes/group_view" || $_GET['sec2'] == 'operation/events/events' || + $_GET['sec2'] == "enterprise/dashboard/main_dashboard") { + + $query = ui_get_url_refresh (false); + $output .= ''; + + } } $output .= "\n\t"; $output .= 'Pandora FMS - '.__('the Flexible Monitoring System').'