diff --git a/modules/monitoring/application/views/scripts/show/components/downtime.phtml b/modules/monitoring/application/views/scripts/show/components/downtime.phtml index 2cd7147f1..c96d1b287 100644 --- a/modules/monitoring/application/views/scripts/show/components/downtime.phtml +++ b/modules/monitoring/application/views/scripts/show/components/downtime.phtml @@ -33,9 +33,6 @@ foreach ($object->downtimes as $downtime) { $this->escape($downtime->comment) ) : $this->escape($downtime->comment); - $form = clone $delDowntimeForm; - $form->populate(array('downtime_id' => $downtime->id)); - if ((bool) $downtime->is_in_effect) { $state = 'in downtime since ' . $this->timeSince($downtime->start); } else { @@ -54,7 +51,12 @@ foreach ($object->downtimes as $downtime) {
- = $form ?> = $state ?> + populate(array('downtime_id' => $downtime->id)); + echo $form; + } ?> + = $state ?> |
= str_replace(array('\r\n', '\n'), ' ', $text) ?> diff --git a/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php b/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php index 8cbea2d37..5de11e1e2 100644 --- a/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php +++ b/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php @@ -79,7 +79,7 @@ abstract class MonitoredObjectController extends Controller ->handleRequest(); $this->view->delCommentForm = $delCommentForm; } - if (count($this->object->downtimes > 0)) { + if (count($this->object->downtimes > 0) && $auth->hasPermission('monitoring/command/downtime/delete')) { $delDowntimeForm = new DeleteDowntimeCommandForm(); $delDowntimeForm ->setObjects($this->object) |