Bugfix
Former-commit-id: 0ea7cf8437935c77098b1e408a723ac3de4d973c
This commit is contained in:
parent
68afc9289d
commit
2573e40538
|
@ -725,8 +725,6 @@ function planned_downtimes_created($values)
|
||||||
$check_group = (bool) db_get_value('id_grupo', 'tgrupo', 'id_grupo', $values['id_group']);
|
$check_group = (bool) db_get_value('id_grupo', 'tgrupo', 'id_grupo', $values['id_group']);
|
||||||
$check = (bool) db_get_value('name', 'tplanned_downtime', 'name', $values['name']);
|
$check = (bool) db_get_value('name', 'tplanned_downtime', 'name', $values['name']);
|
||||||
|
|
||||||
$datetime_from = strtotime($values['once_date_from'].' '.$values['once_time_from']);
|
|
||||||
$datetime_to = strtotime($values['once_date_to'].' '.$values['once_time_to']);
|
|
||||||
$now = time();
|
$now = time();
|
||||||
$result = false;
|
$result = false;
|
||||||
|
|
||||||
|
@ -735,16 +733,16 @@ function planned_downtimes_created($values)
|
||||||
'return' => false,
|
'return' => false,
|
||||||
'message' => __('Not created. Error inserting data. Start time must be higher than the current time'),
|
'message' => __('Not created. Error inserting data. Start time must be higher than the current time'),
|
||||||
];
|
];
|
||||||
|
} else if ($values['type_execution'] == 'once' && !$config['past_planned_downtimes'] && $values['date_to'] <= $now) {
|
||||||
|
return [
|
||||||
|
'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']) {
|
||||||
return [
|
return [
|
||||||
'return' => false,
|
'return' => false,
|
||||||
'message' => __('Not created. Error inserting data').'. '.__('The end date must be higher than the start date'),
|
'message' => __('Not created. Error inserting data').'. '.__('The end date must be higher than the start date'),
|
||||||
];
|
];
|
||||||
} else if ($values['type_execution'] == 'once' && $values['date_to'] <= $now) {
|
|
||||||
return [
|
|
||||||
'return' => false,
|
|
||||||
'message' => __('Not created. Error inserting data').'. '.__('The end date must be higher than the current time'),
|
|
||||||
];
|
|
||||||
} else if ($values['type_execution'] == 'periodically'
|
} else if ($values['type_execution'] == 'periodically'
|
||||||
&& (($values['type_periodicity'] == 'weekly' && $values['periodically_time_from'] >= $values['periodically_time_to'])
|
&& (($values['type_periodicity'] == 'weekly' && $values['periodically_time_from'] >= $values['periodically_time_to'])
|
||||||
|| ($values['type_periodicity'] == 'monthly' && $values['periodically_day_from'] == $values['periodically_day_to'] && $values['periodically_time_from'] >= $values['periodically_time_to']))
|
|| ($values['type_periodicity'] == 'monthly' && $values['periodically_day_from'] == $values['periodically_day_to'] && $values['periodically_time_from'] >= $values['periodically_time_to']))
|
||||||
|
|
Loading…
Reference in New Issue