diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index cc5d026f35..6753d1d499 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -1927,7 +1927,7 @@ $table_other->data[$row][] = html_print_label_input_block( ).html_print_div( [ 'class' => '', - 'content' => __('Interval').html_print_select($units, 'interval_unit', 1, '', '', '', true, false, false, '', false, 'width: 100%'), + 'content' => __('Interval').html_print_select($units, 'interval_unit', '', '', '', '', true, false, false, '', false, 'width: 100%'), ], true ).html_print_button( @@ -1975,7 +1975,7 @@ $table_other->data[$row][] = html_print_label_input_block( ).html_print_button( __('Delete'), 'interval_del_btn', - empty($config['interval_values']), + false, '', [ 'mode' => 'link', @@ -2009,7 +2009,7 @@ $table_other->data[$row][] = html_print_label_input_block( ).html_print_div( [ 'class' => '', - 'content' => __('Interval').html_print_select($units, 'interval_unit', 1, '', '', '', true, false, false, '', false, 'width: 100%'), + 'content' => __('Interval').html_print_select($units, 'module_interval_unit', 1, '', '', '', true, false, false, '', false, 'width: 100%'), ], true ).html_print_button( @@ -2316,9 +2316,15 @@ $(document).ready (function () { // CUSTOM INTERVAL VALUES //------------------------------------------------------------------ $("#button-interval_del_btn").click( function() { - var interval_selected = $('#intervals option:selected').val(); - $('#hidden-interval_to_delete').val(interval_selected); - $('#submit-update_button').trigger('click'); + confirmDialog({ + title: "", + message: "", + onAccept: function() { + var interval_selected = $('#intervals option:selected').val(); + $('#hidden-interval_to_delete').val(interval_selected); + $('#button-update_button').trigger('click'); + } + }); }); $("#button-interval_add_btn").click( function() { diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 1b871d3c93..c522cdee92 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -1489,6 +1489,15 @@ function config_update_config() $interval_values_array = explode(',', $interval_values); if (in_array($new_interval, $interval_values_array) === false) { $interval_values_array[] = $new_interval; + // Get current periods. + $current_period = get_periods(false, false, true); + if (!isset($current_period[-1])) { + $new_current_period = array_keys($current_period); + $new_current_period = implode(',', $new_current_period); + // Add new periods to current. + array_push($interval_values_array, $new_current_period); + } + $interval_values = implode(',', $interval_values_array); } } diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index f56639cece..dcf367a54c 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -2227,7 +2227,7 @@ function html_print_extended_select_for_time( $nothing_value, false, false, - false, + true, $class, $readonly, 'font-size: xx-small;'.$select_style