From 8cc38eed0a58cbf4e1dbd48e37fc987dc7b26ca8 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Thu, 22 Mar 2012 11:22:07 +0000 Subject: [PATCH] 2012-03-22 Sergio Martin * include/functions_html.php include/javascript/pandora.js operation/agentes/stat_win.php: Fixed period control in the popup graph menu (stat_win) merged from 4.0 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5811 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 ++++ pandora_console/include/functions_html.php | 1 + pandora_console/include/javascript/pandora.js | 40 +++++++++++++------ .../operation/agentes/stat_win.php | 1 + 4 files changed, 36 insertions(+), 13 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 6b934ffbc7..522ada4263 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2012-03-22 Sergio Martin + + * include/functions_html.php + include/javascript/pandora.js + operation/agentes/stat_win.php: Fixed period control + in the popup graph menu (stat_win) merged from 4.0 + 2012-03-21 Juan Manuel Ramon * godmode/agentes/module_manager_editor_common.php: Added global var diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index b07bdc3f5d..bae3485c4c 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -456,6 +456,7 @@ function html_print_extended_select_for_time ($name, $selected = '', $script = ' echo " diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index dc8e5168c4..0cf0b17555 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -602,14 +602,13 @@ function agent_autocomplete (id_agent_name, id_server_name, id_agent_id ) { } /** - * Manage events into html_extended_select_for_time + * Init values for html_extended_select_for_time * - * This function has all the events to manage the extended select - * for time + * This function initialize the values of the control * * @param name string with the name of the select for time */ -function period_select_events(name) { +function period_select_init(name) { // Manual mode is hidden by default $('#'+name+'_manual').hide(); @@ -623,7 +622,18 @@ function period_select_events(name) { $('#'+name+'_manual').toggle(); $('#'+name+'_units option:last').removeAttr('selected'); } - + +} + +/** + * Manage events into html_extended_select_for_time + * + * This function has all the events to manage the extended select + * for time + * + * @param name string with the name of the select for time + */ +function period_select_events(name) { $('.'+name+'_toggler').click(function() { $('#'+name+'_default').toggle(); $('#'+name+'_manual').toggle(); @@ -649,7 +659,7 @@ function period_select_events(name) { // the time in seconds is calculated into hidden input $('#'+name+'_units').change(function() { $('#'+name+'_select option:eq(0)').attr('selected', 'selected'); - calculateSeconds(); + calculateSeconds(name); }); // When write any character into custom input, it check to convert it to @@ -663,14 +673,18 @@ function period_select_events(name) { $('#text-'+name+'_text').val(cleanValue); $('#'+name+'_select option:eq(0)').attr('selected', 'selected'); - calculateSeconds(); + calculateSeconds(name); }); - - // Calculate the custom time in seconds into hidden input - function calculateSeconds() { - var calculated = $('#text-'+name+'_text').val()*$('#'+name+'_units').val(); - $('.'+name).val(calculated); - } +} + +/** + * + * Calculate the custom time in seconds into hidden input + * + */ +function calculateSeconds(name) { + var calculated = $('#text-'+name+'_text').val()*$('#'+name+'_units').val(); + $('.'+name).val(calculated); } /** diff --git a/pandora_console/operation/agentes/stat_win.php b/pandora_console/operation/agentes/stat_win.php index 1f3fffa591..98ffc2cc89 100644 --- a/pandora_console/operation/agentes/stat_win.php +++ b/pandora_console/operation/agentes/stat_win.php @@ -54,6 +54,7 @@ if ($refresh > 0) { +