From 5a5fb6eeeab3944b3d5390db6397c0a4c5443de4 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 7 Oct 2020 14:49:46 +0200 Subject: [PATCH 1/2] Allow define time start greater than time end in weekly planed downtimes --- pandora_console/godmode/agentes/planned_downtime.editor.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/agentes/planned_downtime.editor.php b/pandora_console/godmode/agentes/planned_downtime.editor.php index b3e7029dbd..aab9d9360d 100644 --- a/pandora_console/godmode/agentes/planned_downtime.editor.php +++ b/pandora_console/godmode/agentes/planned_downtime.editor.php @@ -354,8 +354,8 @@ if ($create_downtime || $update_downtime) { __('Not created. Error inserting data').'. '.__('The end date must be higher than the current time') ); } else if ($type_execution == 'periodically' - && (($type_periodicity == 'weekly' && $periodically_time_from >= $periodically_time_to) - || ($type_periodicity == 'monthly' && $periodically_day_from == $periodically_day_to && $periodically_time_from >= $periodically_time_to)) + && $type_periodicity == 'monthly' + && $periodically_day_from == $periodically_day_to ) { ui_print_error_message( __('Not created. Error inserting data').'. '.__('The end time must be higher than the start time') From 7fc32d32695a04991f7c17fad91459971f7a3b72 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 26 Nov 2020 12:57:30 +0100 Subject: [PATCH 2/2] minor fix --- pandora_console/include/functions_planned_downtimes.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_planned_downtimes.php b/pandora_console/include/functions_planned_downtimes.php index a9b701241b..7ce2b424ad 100644 --- a/pandora_console/include/functions_planned_downtimes.php +++ b/pandora_console/include/functions_planned_downtimes.php @@ -246,12 +246,10 @@ function planned_downtimes_get_malformed() $sql = "SELECT * FROM tplanned_downtime WHERE type_execution = 'periodically' - AND ((type_periodicity = 'monthly' + AND (type_periodicity = 'monthly' AND (periodically_day_from > periodically_day_to OR (periodically_day_from = periodically_day_to - AND periodically_time_from >= periodically_time_to))) - OR (type_periodicity = 'weekly' - AND periodically_time_from >= periodically_time_to))"; + AND periodically_time_from >= periodically_time_to)))"; $malformed_downtimes = db_get_all_rows_sql($sql); if ($malformed_downtimes === false) {