From a0f767ccc77f9a576f004f7bfd8164e36431f9af Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Mon, 18 Nov 2019 15:28:34 +0100 Subject: [PATCH] fixed module cron minute selectors --- pandora_console/include/functions_html.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index ab3aad9c7a..6a5d261e7d 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -1178,8 +1178,13 @@ function html_print_extended_select_for_cron($hour='*', $minute='*', $mday='*', } // Minutes - for ($i = 0; $i < 60; $i += 5) { + for ($i = 0; $i < 60; $i++) { $minutes[$i] = $i; + + // If minute is not a multiple of 5, then add style to option in order to hide it from minute select but still is a valid value that input can adopt. We want this in case a value that is not a multiple of 5 is entered in module's data configuration. + if (($i % 5) != 0) { + $minutes_hidden_options[$i] = 'display: none;'; + } } // Month days @@ -1216,13 +1221,13 @@ function html_print_extended_select_for_cron($hour='*', $minute='*', $mday='*', if ($to) { $table->data[0][0] = html_print_select($hours, 'hour_to', $hour, '', __('Any'), '*', true, false, false, '', $disabled); - $table->data[0][1] = html_print_select($minutes, 'minute_to', $minute, '', __('Any'), '*', true, false, false, '', $disabled); + $table->data[0][1] = html_print_select($minutes, 'minute_to', $minute, '', __('Any'), '*', true, false, false, '', $disabled, false, $minutes_hidden_options); $table->data[0][2] = html_print_select($mdays, 'mday_to', $mday, '', __('Any'), '*', true, false, false, '', $disabled); $table->data[0][3] = html_print_select($months, 'month_to', $month, '', __('Any'), '*', true, false, false, '', $disabled); $table->data[0][4] = html_print_select($wdays, 'wday_to', $wday, '', __('Any'), '*', true, false, false, '', $disabled); } else { $table->data[0][0] = html_print_select($hours, 'hour_from', $hour, '', __('Any'), '*', true, false, false, '', $disabled); - $table->data[0][1] = html_print_select($minutes, 'minute_from', $minute, '', __('Any'), '*', true, false, false, '', $disabled); + $table->data[0][1] = html_print_select($minutes, 'minute_from', $minute, '', __('Any'), '*', true, false, false, '', $disabled, false, $minutes_hidden_options); $table->data[0][2] = html_print_select($mdays, 'mday_from', $mday, '', __('Any'), '*', true, false, false, '', $disabled); $table->data[0][3] = html_print_select($months, 'month_from', $month, '', __('Any'), '*', true, false, false, '', $disabled); $table->data[0][4] = html_print_select($wdays, 'wday_from', $wday, '', __('Any'), '*', true, false, false, '', $disabled);