diff --git a/modules/monitoring/application/views/scripts/list/downtimes.phtml b/modules/monitoring/application/views/scripts/list/downtimes.phtml index f6023f421..6b761fa52 100644 --- a/modules/monitoring/application/views/scripts/list/downtimes.phtml +++ b/modules/monitoring/application/views/scripts/list/downtimes.phtml @@ -30,7 +30,6 @@ if (! $this->compact): ?> $this->stateName = Host::getStateText($downtime->host_state); } $this->downtime = $downtime; - $this->displayComment = true; ?> render('partials/downtime/downtime-header.phtml'); ?> 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 9c7f7af19..eadc9f5fb 100644 --- a/modules/monitoring/application/views/scripts/partials/downtime/downtime-header.phtml +++ b/modules/monitoring/application/views/scripts/partials/downtime/downtime-header.phtml @@ -8,7 +8,7 @@ - +
icon('service', $this->translate('Service')); ?> qlink( $downtime->host_display_name . ': ' . $downtime->service_display_name, @@ -38,11 +38,10 @@ ) ); ?> - - translate('by') ?> - escape($downtime->author_name) ?> - - + + translate('by') ?> + escape($downtime->author_name) ?> + is_flexible): ?> icon('magic', $this->translate('This downtime is flexible')); ?> @@ -52,22 +51,23 @@ - populate( - array( - 'downtime_id' => $downtime->id, - 'downtime_is_service' => isset($downtime->service_description) - ) - ); - echo $delDowntimeForm; - ?> + setAttrib('class', $deleteButton->getAttrib('class') . ' remove-comment'); + $deleteButton->populate( + array( + 'downtime_id' => $downtime->id, + 'downtime_is_service' => isset($downtime->service_description) + ) + ); + echo $deleteButton; + ?> + - - -

- escape($downtime->comment) ?> -

- +
+

+ escape($downtime->comment) ?> +

diff --git a/modules/monitoring/application/views/scripts/show/components/downtime.phtml b/modules/monitoring/application/views/scripts/show/components/downtime.phtml index 489547c6e..d909eeca5 100644 --- a/modules/monitoring/application/views/scripts/show/components/downtime.phtml +++ b/modules/monitoring/application/views/scripts/show/components/downtime.phtml @@ -40,14 +40,14 @@ if (empty($object->comments) && ! $addLink) { translate('Downtimes'); if (! empty($object->downtimes) && $addLink) { - echo '
' . $addLink; + echo '
' . $addLink; } ?> downtimes)): echo $addLink; else: ?> -
+
downtimes as $downtime): if ((bool) $downtime->is_in_effect) { $state = sprintf( @@ -72,30 +72,34 @@ if (empty($object->comments) && ! $addLink) { ); } } - // Form is unset if the current user lacks the respective permission - if (isset($delDowntimeForm)) { - $deleteButton = clone($delDowntimeForm); - $deleteButton->setAttrib('class', $deleteButton->getAttrib('class') . ' pull-right'); - $deleteButton->populate( - array( - 'downtime_id' => $downtime->id, - 'downtime_is_service' => $object->getType() === $object::TYPE_SERVICE - ) - ); - } else { - $deleteButton = ''; - } - ?> -
- escape($downtime->author_name) ?> - timeAgo($downtime->entry_time) ?> - -
-
- ', $this->createTicketLinks($downtime->comment)) ?> -
-
- + ?> +
+ escape($downtime->author_name) ?> + + translate('created') ?> + timeAgo($downtime->entry_time) ?> + + + + + setAttrib('class', $deleteButton->getAttrib('class') . ' remove-comment'); + $deleteButton->populate( + array( + 'downtime_id' => $downtime->id, + 'downtime_is_service' => $object->getType() === $object::TYPE_SERVICE + ) + ); + echo $deleteButton; + ?> + + + +
+
+

', $this->createTicketLinks($downtime->comment)) ?>