From 95cb6dea4bef28c2abce4d077e1111cd70dbade0 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 16 Jun 2015 18:13:04 +0200 Subject: [PATCH] Transfer changes from show/history.phtml to service/history.phtml Was not recognised by git as host/history.phtml is the counterpart for show/history.phtml in the tree. refs #9009 --- .../views/scripts/service/history.phtml | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/modules/monitoring/application/views/scripts/service/history.phtml b/modules/monitoring/application/views/scripts/service/history.phtml index dd6a0b3d9..ac443c370 100644 --- a/modules/monitoring/application/views/scripts/service/history.phtml +++ b/modules/monitoring/application/views/scripts/service/history.phtml @@ -43,79 +43,68 @@ function contactsLink($match, $view) { escape($event->output); switch ($event->type) { case 'notify': $icon = 'notification'; $title = $this->translate('Notification'); $stateClass = Service::getStateText($event->state); - $msg = preg_replace_callback( + $msg = $msg ? preg_replace_callback( '/^\[([^\]]+)\]/', function($match) use ($self) { return contactsLink($match, $self); }, - $this->escape($event->output) - ); + $msg + ) : $this->translate('This notification was not sent out to any contact.'); break; case 'comment': $icon = 'comment'; $title = $this->translate('Comment'); - $msg = $this->escape($event->output); break; case 'comment_deleted': $icon = 'remove'; $title = $this->translate('Comment deleted'); - $msg = $this->escape($event->output); break; case 'ack': $icon = 'acknowledgement'; $title = $this->translate('Acknowledge'); - $msg = $this->escape($event->output); break; case 'ack_deleted': $icon = 'remove'; $title = $this->translate('Ack removed'); - $msg = $this->escape($event->output); break; case 'dt_comment': $icon = 'in_downtime'; $title = $this->translate('In Downtime'); - $msg = $this->escape($event->output); break; case 'dt_comment_deleted': $icon = 'remove'; $title = $this->translate('Downtime removed'); - $msg = $this->escape($event->output); break; case 'flapping': $icon = 'flapping'; $title = $this->translate('Flapping'); - $msg = $this->escape($event->output); break; case 'flapping_deleted': $icon = 'remove'; $title = $this->translate('Flapping stopped'); - $msg = $this->escape($event->output); break; case 'hard_state': - $msg = '[ ' . $event->attempt . '/' . $event->max_attempts . ' ] ' . $this->escape($event->output); $stateClass = Service::getStateText($event->state); $icon = 'attention-alt'; $title = Service::getStateText($event->state); break; case 'soft_state': $icon = 'spinner'; - $msg = '[ ' . $event->attempt . '/' . $event->max_attempts . ' ] ' . $this->escape($event->output); $stateClass = Service::getStateText($event->state); $title = Service::getStateText($event->state); break; case 'dt_start': $icon = 'downtime_start'; $title = $this->translate('Downtime Start'); - $msg = $this->escape($event->output); break; case 'dt_end': $icon = 'downtime_end'; $title = $this->translate('Downtime End'); - $msg = $this->escape($event->output); break; } ?>