diff --git a/modules/monitoring/application/views/scripts/show/components/comments.phtml b/modules/monitoring/application/views/scripts/show/components/comments.phtml
index 104f8176b..b967cc67e 100644
--- a/modules/monitoring/application/views/scripts/show/components/comments.phtml
+++ b/modules/monitoring/application/views/scripts/show/components/comments.phtml
@@ -1,32 +1,27 @@
= $this->translate('Comments') ?> |
- getType() === $object::TYPE_HOST) {
- $addCommentLink = $this->href(
- 'monitoring/host/add-comment',
- array('host' => $object->getName())
- );
- } else {
- $addCommentLink = $this->href(
- 'monitoring/service/add-comment',
- array('host' => $object->getHost()->getName(), 'service' => $object->getName())
- );
- }
-
+ hasPermission('monitoring/command/comment/add')) {
+ /** @type \Icinga\Module\Monitoring\Object\MonitoredObject $object */
+ if ($object->getType() === $object::TYPE_HOST) {
+ $addCommentLink = $this->href(
+ 'monitoring/host/add-comment',
+ array('host' => $object->getName())
+ );
+ } else {
+ $addCommentLink = $this->href(
+ 'monitoring/service/add-comment',
+ array('host' => $object->getHost()->getName(), 'service' => $object->getName())
+ );
+ }
?>
-
- hasPermission('monitoring/command/comment/add')): ?>
= $this->icon('comment') ?>
= $this->translate('Add comment') ?>
-
- = '-' ?>
-
+
|
diff --git a/modules/monitoring/application/views/scripts/show/components/downtime.phtml b/modules/monitoring/application/views/scripts/show/components/downtime.phtml
index 37eeef14b..f95ea582c 100644
--- a/modules/monitoring/application/views/scripts/show/components/downtime.phtml
+++ b/modules/monitoring/application/views/scripts/show/components/downtime.phtml
@@ -1,32 +1,27 @@
= $this->translate('Downtimes') ?> |
- getType() === $object::TYPE_HOST) {
- $scheduleDowntimeLink = $this->href(
- 'monitoring/host/schedule-downtime',
- array('host' => $object->getName())
- );
- } else {
- $scheduleDowntimeLink = $this->href(
- 'monitoring/service/schedule-downtime',
- array('host' => $object->getHost()->getName(), 'service' => $object->getName())
- );
- }
-
+ hasPermission('monitoring/command/downtime/schedule')) {
+ /** @type \Icinga\Module\Monitoring\Object\MonitoredObject $object */
+ if ($object->getType() === $object::TYPE_HOST) {
+ $scheduleDowntimeLink = $this->href(
+ 'monitoring/host/schedule-downtime',
+ array('host' => $object->getName())
+ );
+ } else {
+ $scheduleDowntimeLink = $this->href(
+ 'monitoring/service/schedule-downtime',
+ array('host' => $object->getHost()->getName(), 'service' => $object->getName())
+ );
+ }
?>
-
- hasPermission('monitoring/command/downtime/schedule')): ?>
= $this->icon('plug') ?>
= $this->translate('Schedule downtime') ?>
-
- = '-' ?>
-
+
|