Merge branch 'ent-3653-finalizacion-de-paradas-planificadas-al-dia-siguiente-de-su-comienzo' into 'develop'

Allow define time start greater than time end in weekly planed downtimes

See merge request artica/pandorafms!3511
This commit is contained in:
Daniel Rodriguez 2020-11-26 17:30:09 +01:00
commit 69d9d04c20
2 changed files with 4 additions and 6 deletions

View File

@ -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')

View File

@ -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) {