diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 931a4f0131..f36ad5886e 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,14 @@ +2012-03-16 Sergio Martin + + * include/functions_html.php + include/javascript/pandora.js: Fixed problem with two + or more time controls at the same time adding uniq id + to selects + + * godmode/agentes/module_manager_editor_common.php + godmode/reporting/reporting_builder.item_editor.php: Clean + code + 2012-03-16 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 6d3048efc2..1575fdab61 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -233,9 +233,6 @@ $table_advanced->data[1][4] = html_print_input_text ('module_ff_interval', $ff_i $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][3] = __('Post process').' ' . ui_print_help_icon ('postprocess', true); diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index e5804b5d26..f6affac07e 100644 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -327,26 +327,6 @@ switch ($action) { break; } -$intervals = array (); -$intervals[300] = human_time_description_raw (300); -$intervals[600] = human_time_description_raw (600); -$intervals[86400] = human_time_description_raw (86400); -$intervals[432000] = human_time_description_raw (432000); -$intervals[604800] = human_time_description_raw (604800); -$intervals[1296000] = human_time_description_raw (1296000); -$intervals[2592000] = human_time_description_raw (2592000); - -// Intervals for projection graph -$intervals_1 = array (); -$intervals_1[432000] = human_time_description_raw (432000); -$intervals_1[604800] = human_time_description_raw (604800); -$intervals_1[1296000] = human_time_description_raw (1296000); -$intervals_1[2592000] = human_time_description_raw (2592000); -$intervals_1[5184000] = human_time_description_raw (5184000); -$intervals_1[7776000] = human_time_description_raw (7776000); -$intervals_1[10368000] = human_time_description_raw (10368000); -$intervals_1[12960000] = human_time_description_raw (12960000); - $urlForm = 'index.php?sec=greporting&sec2=godmode/reporting/reporting_builder&tab=item_editor&action=' . $actionParameter . '&id_report=' . $idReport; echo '
'; diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 2b36812501..606ec55947 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -434,26 +434,29 @@ function html_print_extended_select_for_time ($name, $selected = '', $script = ' 2592000 => __('months'), 31104000 => __('years')); + $uniq_name = uniqid($name); + ob_start(); - echo '
'; - html_print_select ($fields, $name . '_select', $selected,"" . $script, + echo '
'; + html_print_select ($fields, $uniq_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 ' '.html_print_image('images/pencil.png',true,array('class' => $uniq_name . '_toggler', 'alt' => __('Custom'), 'title' => __('Custom'))).''; echo '
'; - echo '
'; - html_print_input_text ($name . '_text', $selected, '', $size); - html_print_input_hidden ($name, $selected); - html_print_select ($units, $name . '_units', 1, "" . $script, + echo '
'; + html_print_input_text ($uniq_name . '_text', $selected, '', $size); + + html_print_input_hidden ($name, $selected, false, $uniq_name); + html_print_select ($units, $uniq_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 ' '.html_print_image('images/default_list.png',true,array('class' => $uniq_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 1c4b168721..28b1733e78 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -656,7 +656,7 @@ function period_select_events(name) { value = 300; } - $('#hidden-'+name).val(value); + $('.'.name).val(value); $('#text-'+name+'_text').val(value); adjustTextUnits(); }); @@ -685,7 +685,7 @@ function period_select_events(name) { // Function to calculate the custom time in seconds into hidden input function calculateSeconds() { var calculated = $('#text-'+name+'_text').val()*$('#'+name+'_units').val(); - $('#hidden-'+name).val(calculated); + $('.'+name).val(calculated); } }