From 6724671bae9ff8a7bb9d5d892f2ca8b18167b738 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Thu, 15 Mar 2012 17:30:13 +0000 Subject: [PATCH] 2012-03-15 Sergio Martin * include/javascript/pandora.js godmode/agentes/module_manager_editor_common.php: Added advanced select for time to modules create/update form, improve layout of this form and add default value of 5 minutes to select git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5776 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 8 +++++ .../agentes/module_manager_editor_common.php | 29 ++++++++++++------- pandora_console/include/javascript/pandora.js | 4 +++ 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index d8e9ddc2d0..6589387ae0 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,11 @@ +2012-03-15 Sergio Martin + + * include/javascript/pandora.js + godmode/agentes/module_manager_editor_common.php: Added + advanced select for time to modules create/update form, + improve layout of this form and add default value of + 5 minutes to select + 2012-03-15 Sergio Martin * include/functions_html.php diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index ec0fde1c67..6d3048efc2 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -213,34 +213,41 @@ $table_advanced->class = 'databox_color'; $table_advanced->data = array (); $table_advanced->style = array (); $table_advanced->style[0] = 'font-weight: bold; vertical-align: top'; -$table_advanced->style[2] = 'font-weight: bold; vertical-align: top'; +$table_advanced->style[3] = 'font-weight: bold; vertical-align: top'; $table_advanced->colspan = array (); $table_advanced->data[0][0] = __('Description'); -$table_advanced->colspan[0][1] = 3; +$table_advanced->colspan[0][1] = 4; $table_advanced->data[0][1] = html_print_textarea ('description', 2, 65, $description, $disabledTextBecauseInPolicy, true); $table_advanced->data[1][0] = __('Custom ID'); +$table_advanced->colspan[1][1] = 2; $table_advanced->data[1][1] = html_print_input_text ('custom_id', $custom_id, '', 20, 65, true); -$table_advanced->data[1][2] = __('FF interval'); -$table_advanced->data[1][3] = html_print_input_text ('module_ff_interval', $ff_interval, +$table_advanced->data[1][3] = __('FF interval'); +$table_advanced->data[1][4] = html_print_input_text ('module_ff_interval', $ff_interval, '', 5, 10, true, $disabledBecauseInPolicy).ui_print_help_tip (__('Module execution flip flop time interval (in secs).'), true); -$table_advanced->data[2][0] = __('Interval'); -$table_advanced->data[2][1] = html_print_input_text ('module_interval', $interval, - '', 5, 10, true, $disabledBecauseInPolicy).ui_print_help_tip (__('Module execution time interval (in secs).'), true); +$table_advanced->data[2][0] = __('Interval').ui_print_help_tip (__('Module execution time interval.'), true); + +$table_advanced->colspan[2][1] = 2; +//~ $table_advanced->data[2][1] = html_print_input_text ('module_interval', $interval, + //~ '', 5, 10, true, $disabledBecauseInPolicy).ui_print_help_tip (__('Module execution time interval (in secs).'), true); + //~ +$table_advanced->data[2][1] = html_print_extended_select_for_time ('module_interval' , $interval, '', '', '0', false, true); -$table_advanced->data[2][2] = __('Post process').' ' . ui_print_help_icon ('postprocess', true); -$table_advanced->data[2][3] = html_print_input_text ('post_process', +$table_advanced->data[2][3] = __('Post process').' ' . ui_print_help_icon ('postprocess', true); +$table_advanced->data[2][4] = html_print_input_text ('post_process', $post_process, '', 15, 25, true, $disabledBecauseInPolicy); $table_advanced->data[3][0] = __('Min. Value'); +$table_advanced->colspan[3][1] = 2; + $table_advanced->data[3][1] = html_print_input_text ('min', $min, '', 5, 15, true, $disabledBecauseInPolicy); -$table_advanced->data[3][2] = __('Max. Value'); -$table_advanced->data[3][3] = html_print_input_text ('max', $max, '', 5, 15, true, $disabledBecauseInPolicy); +$table_advanced->data[3][3] = __('Max. Value'); +$table_advanced->data[3][4] = html_print_input_text ('max', $max, '', 5, 15, true, $disabledBecauseInPolicy); $table_advanced->data[4][0] = __('Export target'); // Default text message for export target select and disabled option diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index 33a46df486..071f0cd9f6 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -610,6 +610,10 @@ function agent_autocomplete (id_agent_name, id_server_name, id_agent_id ) { * @param name string with the name of the select for time */ function period_select_events(name) { + // If the text input is empty, we put on it 5 minutes by defaults + if($('#text-'+name+'_text').val() == '') { + $('#text-'+name+'_text').val(300); + } function adjustTextUnits() { var restPrev; var unitsSelected = false;