#11692 the option to stop Scheduled Downtime is enabled for the Periodically execution type

This commit is contained in:
Jorge Rincon 2023-07-05 14:07:11 +02:00
parent 7dea46c634
commit 896ddd1a15
2 changed files with 12 additions and 2 deletions

View File

@ -835,7 +835,7 @@ if ($downtimes === false && $filter_performed === false) {
// If user have writting permissions.
if (in_array($downtime['id_group'], $groupsAD) === true) {
// Stop button.
if ($downtime['type_execution'] === 'once'
if (($downtime['type_execution'] === 'once' || $downtime['type_execution'] === 'periodically')
&& (int) $downtime['executed'] === 1
) {
if ((bool) check_acl_restricted_all($config['id_user'], $downtime['id_group'], 'AW') === true

View File

@ -566,7 +566,17 @@ function planned_downtimes_stop($downtime)
break;
case 'periodically':
return false;
$values = [
'executed' => 0,
'date_to' => time(),
];
$result = db_process_sql_update(
'tplanned_downtime',
$values,
['id' => $id_downtime]
);
break;
default:
// Nothing to do.