From 2b2f8417a7b24419054ac2a33585ca31b743ca1a Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Mon, 7 Oct 2019 12:40:59 +0200 Subject: [PATCH] Added control for same-day and different hours planned downtimes --- pandora_console/include/functions_planned_downtimes.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_planned_downtimes.php b/pandora_console/include/functions_planned_downtimes.php index 7f1a587b65..1147ad97a8 100644 --- a/pandora_console/include/functions_planned_downtimes.php +++ b/pandora_console/include/functions_planned_downtimes.php @@ -748,7 +748,9 @@ function planned_downtimes_created($values) 'return' => false, 'message' => __('Not created. Error inserting data').'. '.__('The end date must be higher than the current time'), ]; - } else if ($values['type_execution'] == 'once' && $values['date_from'] >= $values['date_to']) { + } else if ($values['type_execution'] == 'once' && ($values['date_from'] > $values['date_to']) + || (($values['date_from'] == $values['date_to']) && ($values['periodically_time_from'] >= $values['periodically_time_to'])) + ) { return [ 'return' => false, 'message' => __('Not created. Error inserting data').'. '.__('The end date must be higher than the start date'),