diff --git a/modules/monitoring/application/controllers/DowntimesController.php b/modules/monitoring/application/controllers/DowntimesController.php
index 51c9b79ed..5d8fcb60b 100644
--- a/modules/monitoring/application/controllers/DowntimesController.php
+++ b/modules/monitoring/application/controllers/DowntimesController.php
@@ -101,6 +101,6 @@ class DowntimesController extends Controller
));
$delDowntimeForm->setRedirectUrl(Url::fromPath('monitoring/list/downtimes'));
$delDowntimeForm->setDowntimes($this->downtimes->fetchAll())->handleRequest();
- $this->view->delDowntimeForm = $delDowntimeForm;
+ $this->view->delAllDowntimeForm = $delDowntimeForm;
}
}
diff --git a/modules/monitoring/application/forms/Command/Object/DeleteDowntimeCommandForm.php b/modules/monitoring/application/forms/Command/Object/DeleteDowntimeCommandForm.php
index 27fbae67a..fd1417224 100644
--- a/modules/monitoring/application/forms/Command/Object/DeleteDowntimeCommandForm.php
+++ b/modules/monitoring/application/forms/Command/Object/DeleteDowntimeCommandForm.php
@@ -68,7 +68,7 @@ class DeleteDowntimeCommandForm extends CommandForm
'ignore' => true,
'escape' => false,
'type' => 'submit',
- 'class' => 'link-like spinner',
+ 'class' => 'action-link link',
'label' => $this->getView()->icon('trash'),
'title' => $this->translate('Delete this downtime'),
'decorators' => array('ViewHelper')
diff --git a/modules/monitoring/application/views/scripts/downtime/remove.phtml b/modules/monitoring/application/views/scripts/downtime/remove.phtml
index 57fe36655..34a7dbdc8 100644
--- a/modules/monitoring/application/views/scripts/downtime/remove.phtml
+++ b/modules/monitoring/application/views/scripts/downtime/remove.phtml
@@ -4,7 +4,9 @@
= $this->tabs; ?>
- = $this->render('partials/downtime/downtime-header.phtml'); ?>
+
= $delDowntimeForm; ?>
diff --git a/modules/monitoring/application/views/scripts/downtime/show.phtml b/modules/monitoring/application/views/scripts/downtime/show.phtml
index 4a3583363..b59001a2f 100644
--- a/modules/monitoring/application/views/scripts/downtime/show.phtml
+++ b/modules/monitoring/application/views/scripts/downtime/show.phtml
@@ -3,119 +3,171 @@
= $this->tabs; ?>
- = $this->render('partials/downtime/downtime-header.phtml'); ?>
+
+ = $this->render('partials/downtime/downtime-header.phtml'); ?>
+
-
"
data-icinga-multiselect-data="downtime_id">
-
- service_description)) {
- $isService = true;
- $stateName = Service::getStateText($downtime->service_state);
+ $this->isService = true;
+ $this->stateName = Service::getStateText($downtime->service_state);
} else {
- $isService = false;
- $stateName = Host::getStateText($downtime->host_state);
+ $this->isService = false;
+ $this->stateName = Host::getStateText($downtime->host_state);
}
+ $this->downtime = $downtime;
+ $this->displayComment = true;
?>
-
-
- start <= time() && ! $downtime->is_in_effect): ?>
- = $this->translate('Ends'); ?>
-
- = $this->timeUntil($downtime->is_flexible ? $downtime->scheduled_end : $downtime->end, $this->compact) ?>
-
- = $downtime->is_in_effect ? $this->translate('Expires') : $this->translate('Starts'); ?>
-
- = $this->timeUntil($downtime->is_in_effect ? $downtime->end : $downtime->start, $this->compact) ?>
-
- |
-
-
- = $this->icon('service', $this->translate('Service')); ?> = $this->qlink(
- $this->escape($downtime->host_display_name) . ': ' . $this->escape($downtime->service_display_name),
- 'monitoring/downtime/show',
- array('downtime_id' => $downtime->id),
- array(
- 'title' => sprintf(
- $this->translate('Show detailed information for this downtime scheduled for service %s on host %s'),
- $downtime->service_display_name,
- $downtime->host_display_name
- ),
- 'class' => 'rowaction'
- )
- ); ?>
-
- = $this->icon('host', $this->translate('host')); ?> = $this->qlink(
- $this->escape($downtime->host_display_name),
- 'monitoring/downtime/show',
- array('downtime_id' => $downtime->id),
- array(
- 'title' => sprintf(
- $this->translate('Show detailed information for this downtime scheduled for host %s'),
- $downtime->host_display_name
- ),
- 'class' => 'rowaction'
- )
- ); ?>
-
-
- = $this->icon('comment', $this->translate('Comment')); ?> [= $this->escape($downtime->author_name) ?>] = $this->escape($downtime->comment) ?>
-
-
- is_flexible): ?>
- is_in_effect): ?>
- = sprintf(
- $isService
- ? $this->translate('This flexible service downtime was started on %s at %s and lasts for %s until %s at %s.')
- : $this->translate('This flexible host downtime was started on %s at %s and lasts for %s until %s at %s.'),
- $this->formatDate($downtime->start),
- $this->formatTime($downtime->start),
- $this->formatDuration($downtime->duration),
- $this->formatDate($downtime->end),
- $this->formatTime($downtime->end)
- ); ?>
-
- = sprintf(
- $isService
- ? $this->translate('This flexible service downtime has been scheduled to start between %s - %s and to last for %s.')
- : $this->translate('This flexible host downtime has been scheduled to start between %s - %s and to last for %s.'),
- $this->formatDateTime($downtime->scheduled_start),
- $this->formatDateTime($downtime->scheduled_end),
- $this->formatDuration($downtime->duration)
- ); ?>
-
-
- is_in_effect): ?>
- = sprintf(
- $isService
- ? $this->translate('This fixed service downtime was started on %s at %s and expires on %s at %s.')
- : $this->translate('This fixed host downtime was started on %s at %s and expires on %s at %s.'),
- $this->formatDate($downtime->start),
- $this->formatTime($downtime->start),
- $this->formatDate($downtime->end),
- $this->formatTime($downtime->end)
- ); ?>
-
- = sprintf(
- $isService
- ? $this->translate('This fixed service downtime has been scheduled to start on %s at %s and to end on %s at %s.')
- : $this->translate('This fixed host downtime has been scheduled to start on %s at %s and to end on %s at %s.'),
- $this->formatDate($downtime->start),
- $this->formatTime($downtime->start),
- $this->formatDate($downtime->end),
- $this->formatTime($downtime->end)
- ); ?>
-
-
-
- |
-
-
- populate(
- array(
- 'downtime_id' => $downtime->id,
- 'downtime_is_service' => isset($downtime->service_description)
- )
- );
- echo $delDowntimeForm;
- ?>
- |
-
-
-
+
+ = $this->render('partials/downtime/downtime-header.phtml'); ?>
+
+
hasResult()): ?>
diff --git a/modules/monitoring/application/views/scripts/partials/downtime/downtime-header.phtml b/modules/monitoring/application/views/scripts/partials/downtime/downtime-header.phtml
index 13bf8fe95..683375f13 100644
--- a/modules/monitoring/application/views/scripts/partials/downtime/downtime-header.phtml
+++ b/modules/monitoring/application/views/scripts/partials/downtime/downtime-header.phtml
@@ -1,64 +1,72 @@
-
-
-
- start <= time() && ! $downtime->is_in_effect): ?>
- = $this->translate('Ends'); ?>
-
- = $this->timeUntil($downtime->is_flexible ? $downtime->scheduled_end : $downtime->end, $this->compact) ?>
-
- = $downtime->is_in_effect ? $this->translate('Expires') : $this->translate('Starts'); ?>
-
- = $this->timeUntil($downtime->is_in_effect ? $downtime->end : $downtime->start, $this->compact) ?>
-
- |
-
-
- is_flexible): ?>
- is_in_effect): ?>
- = sprintf(
- $this->isService
- ? $this->translate('This flexible service downtime was started on %s at %s and lasts for %s until %s at %s.')
- : $this->translate('This flexible host downtime was started on %s at %s and lasts for %s until %s at %s.'),
- $this->formatDate($downtime->start),
- $this->formatTime($downtime->start),
- $this->formatDuration($downtime->duration),
- $this->formatDate($downtime->end),
- $this->formatTime($downtime->end)
- ); ?>
-
- = sprintf(
- $this->isService
- ? $this->translate('This flexible service downtime has been scheduled to start between %s - %s and to last for %s.')
- : $this->translate('This flexible host downtime has been scheduled to start between %s - %s and to last for %s.'),
- $this->formatDateTime($downtime->scheduled_start),
- $this->formatDateTime($downtime->scheduled_end),
- $this->formatDuration($downtime->duration)
- ); ?>
-
-
- is_in_effect): ?>
- = sprintf(
- $this->isService
- ? $this->translate('This fixed service downtime was started on %s at %s and expires on %s at %s.')
- : $this->translate('This fixed host downtime was started on %s at %s and expires on %s at %s.'),
- $this->formatDate($downtime->start),
- $this->formatTime($downtime->start),
- $this->formatDate($downtime->end),
- $this->formatTime($downtime->end)
- ); ?>
-
- = sprintf(
- $this->isService
- ? $this->translate('This fixed service downtime has been scheduled to start on %s at %s and to end on %s at %s.')
- : $this->translate('This fixed host downtime has been scheduled to start on %s at %s and to end on %s at %s.'),
- $this->formatDate($downtime->start),
- $this->formatTime($downtime->start),
- $this->formatDate($downtime->end),
- $this->formatTime($downtime->end)
- ); ?>
-
-
-
- |
-
-
+
+ start <= time() && ! $downtime->is_in_effect): ?>
+ = $this->translate('Ends'); ?>
+ = $this->timeUntil($downtime->is_flexible ? $downtime->scheduled_end : $downtime->end, $this->compact) ?>
+
+ = $downtime->is_in_effect ? $this->translate('Expires') : $this->translate('Starts'); ?>
+ = $this->timeUntil($downtime->is_in_effect ? $downtime->end : $downtime->start, $this->compact) ?>
+
+ |
+
+
+
+
+
+ |
diff --git a/modules/monitoring/application/views/scripts/partials/downtime/downtimes-header.phtml b/modules/monitoring/application/views/scripts/partials/downtime/downtimes-header.phtml
index e80ec72e3..a84b6fc0a 100644
--- a/modules/monitoring/application/views/scripts/partials/downtime/downtimes-header.phtml
+++ b/modules/monitoring/application/views/scripts/partials/downtime/downtimes-header.phtml
@@ -10,89 +10,17 @@ use Icinga\Module\Monitoring\Object\Service;
break;
}
if ($downtime->objecttype === 'service') {
- $isService = true;
- $stateText = Service::getStateText($downtime->service_state);
+ $this->isService = true;
+ $this->stateName = Service::getStateText($downtime->service_state);
} else {
- $isService = false;
- $stateText = Host::getStateText($downtime->host_state);
+ $this->isService = false;
+ $this->stateName = Host::getStateText($downtime->host_state);
}
+ $this->downtime = $downtime;
+ $this->displayComment = false;
?>
-
-
- start <= time() && ! $downtime->is_in_effect): ?>
- = $this->translate('Ends') ?>
-
- = $this->timeUntil(
- $downtime->is_flexible ? $downtime->scheduled_end : $downtime->end, $this->compact
- ) ?>
-
-
- = $downtime->is_in_effect ? $this->translate('Expires') : $this->translate('Starts') ?>
-
-
- = $this->timeUntil($downtime->is_in_effect ? $downtime->end : $downtime->start, $this->compact) ?>
-
- |
-
-
- = $this->icon('service', $this->translate('Service')) ?>
- = $this->link()->service(
- $downtime->service_description,
- $downtime->service_display_name,
- $downtime->host_name,
- $downtime->host_display_name
- ) ?>
-
- = $this->icon('host', $this->translate('Host')) ?>
- = $this->link()->host($downtime->host_name, $downtime->host_display_name) ?>
-
-
- is_flexible): ?>
- is_in_effect): ?>
- = sprintf(
- $isService
- ? $this->translate('This flexible service downtime was started on %s at %s and lasts for %s until %s at %s.')
- : $this->translate('This flexible host downtime was started on %s at %s and lasts for %s until %s at %s.'),
- $this->formatDate($downtime->start),
- $this->formatTime($downtime->start),
- $this->formatDuration($downtime->duration),
- $this->formatDate($downtime->end),
- $this->formatTime($downtime->end)
- ) ?>
-
- = sprintf(
- $isService
- ? $this->translate('This flexible service downtime has been scheduled to start between %s - %s and to last for %s.')
- : $this->translate('This flexible host downtime has been scheduled to start between %s - %s and to last for %s.'),
- $this->formatDateTime($downtime->scheduled_start),
- $this->formatDateTime($downtime->scheduled_end),
- $this->formatDuration($downtime->duration)
- ) ?>
-
-
- is_in_effect): ?>
- = sprintf(
- $isService
- ? $this->translate('This fixed service downtime was started on %s at %s and expires on %s at %s.')
- : $this->translate('This fixed host downtime was started on %s at %s and expires on %s at %s.'),
- $this->formatDate($downtime->start),
- $this->formatTime($downtime->start),
- $this->formatDate($downtime->end),
- $this->formatTime($downtime->end)
- ) ?>
-
- = sprintf(
- $isService
- ? $this->translate('This fixed service downtime has been scheduled to start on %s at %s and to end on %s at %s.')
- : $this->translate('This fixed host downtime has been scheduled to start on %s at %s and to end on %s at %s.'),
- $this->formatDate($downtime->scheduled_start),
- $this->formatTime($downtime->scheduled_start),
- $this->formatDate($downtime->scheduled_end),
- $this->formatTime($downtime->scheduled_end)
- ) ?>
-
-
- |
+
+ = $this->render('partials/downtime/downtime-header.phtml') ?>