diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 18b7740062..931a4f0131 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,12 @@ +2012-03-16 Sergio Martin + + * include/functions_html.php + include/javascript/pandora.js + images/pencil.png + images/default_list.png: Improved the usability + of the periods advanced control toggling between + manual and default mode + 2012-03-15 Sancho Lerena * images/console/background: Replaced old imagemaps diff --git a/pandora_console/images/default_list.png b/pandora_console/images/default_list.png new file mode 100644 index 0000000000..3a953aed17 Binary files /dev/null and b/pandora_console/images/default_list.png differ diff --git a/pandora_console/images/pencil.png b/pandora_console/images/pencil.png new file mode 100644 index 0000000000..d5ba3d5962 Binary files /dev/null and b/pandora_console/images/pencil.png differ diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 3a99537659..2b36812501 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -436,16 +436,25 @@ function html_print_extended_select_for_time ($name, $selected = '', $script = ' ob_start(); - html_print_select ($fields, $name . '_select', $selected,"" . $script, - $nothing, $nothing_value, false, false, false, '', false, 'font-size: xx-small;'.$select_style); - html_print_input_text ($name . '_text', $selected, '', $size); - html_print_input_hidden ($name, $selected); - html_print_select ($units, $name . '_units', 1, "" . $script, - $nothing, $nothing_value, false, false, false, '', false, 'font-size: xx-small;'.$select_style); + echo '
'; + html_print_select ($fields, $name . '_select', $selected,"" . $script, + $nothing, $nothing_value, false, false, false, '', false, 'font-size: xx-small;'.$select_style); + echo ' '.html_print_image('images/pencil.png',true,array('class' => $name . '_toggler', 'alt' => __('Manual'), 'title' => __('Manual'))).''; + echo '
'; + + echo '
'; + html_print_input_text ($name . '_text', $selected, '', $size); + html_print_input_hidden ($name, $selected); + html_print_select ($units, $name . '_units', 1, "" . $script, + $nothing, $nothing_value, false, false, false, '', false, 'font-size: xx-small;'.$select_style); + echo ' '.html_print_image('images/default_list.png',true,array('class' => $name . '_toggler', 'alt' => __('List'), 'title' => __('List'))).''; + echo '
'; echo " "; diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index 04d65a9c8a..1c4b168721 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -610,12 +610,21 @@ 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) { + // Manual mode is hidden by default + $('#'+name+'_manual').hide(); + // If the text input is empty, we put on it 5 minutes by default if($('#text-'+name+'_text').val() == '') { $('#text-'+name+'_text').val(300); $('#'+name+'_select option:eq(1)').attr('selected', true); } + $('.'+name+'_toggler').click(function() { + $('#'+name+'_default').toggle(); + $('#'+name+'_manual').toggle(); + $('#text-'+name+'_text').focus(); + }); + function adjustTextUnits() { var restPrev; var unitsSelected = false;