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
This commit is contained in:
Johannes Meyer 2015-06-16 18:13:04 +02:00
parent 670d6e93c7
commit 95cb6dea4b
1 changed files with 4 additions and 15 deletions

View File

@ -43,79 +43,68 @@ function contactsLink($match, $view) {
<?php foreach ($history as $event): ?> <?php foreach ($history as $event): ?>
<?php <?php
$stateClass = 'invalid'; $stateClass = 'invalid';
$msg = $this->escape($event->output);
switch ($event->type) { switch ($event->type) {
case 'notify': case 'notify':
$icon = 'notification'; $icon = 'notification';
$title = $this->translate('Notification'); $title = $this->translate('Notification');
$stateClass = Service::getStateText($event->state); $stateClass = Service::getStateText($event->state);
$msg = preg_replace_callback( $msg = $msg ? preg_replace_callback(
'/^\[([^\]]+)\]/', '/^\[([^\]]+)\]/',
function($match) use ($self) { return contactsLink($match, $self); }, 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; break;
case 'comment': case 'comment':
$icon = 'comment'; $icon = 'comment';
$title = $this->translate('Comment'); $title = $this->translate('Comment');
$msg = $this->escape($event->output);
break; break;
case 'comment_deleted': case 'comment_deleted':
$icon = 'remove'; $icon = 'remove';
$title = $this->translate('Comment deleted'); $title = $this->translate('Comment deleted');
$msg = $this->escape($event->output);
break; break;
case 'ack': case 'ack':
$icon = 'acknowledgement'; $icon = 'acknowledgement';
$title = $this->translate('Acknowledge'); $title = $this->translate('Acknowledge');
$msg = $this->escape($event->output);
break; break;
case 'ack_deleted': case 'ack_deleted':
$icon = 'remove'; $icon = 'remove';
$title = $this->translate('Ack removed'); $title = $this->translate('Ack removed');
$msg = $this->escape($event->output);
break; break;
case 'dt_comment': case 'dt_comment':
$icon = 'in_downtime'; $icon = 'in_downtime';
$title = $this->translate('In Downtime'); $title = $this->translate('In Downtime');
$msg = $this->escape($event->output);
break; break;
case 'dt_comment_deleted': case 'dt_comment_deleted':
$icon = 'remove'; $icon = 'remove';
$title = $this->translate('Downtime removed'); $title = $this->translate('Downtime removed');
$msg = $this->escape($event->output);
break; break;
case 'flapping': case 'flapping':
$icon = 'flapping'; $icon = 'flapping';
$title = $this->translate('Flapping'); $title = $this->translate('Flapping');
$msg = $this->escape($event->output);
break; break;
case 'flapping_deleted': case 'flapping_deleted':
$icon = 'remove'; $icon = 'remove';
$title = $this->translate('Flapping stopped'); $title = $this->translate('Flapping stopped');
$msg = $this->escape($event->output);
break; break;
case 'hard_state': case 'hard_state':
$msg = '[ ' . $event->attempt . '/' . $event->max_attempts . ' ] ' . $this->escape($event->output);
$stateClass = Service::getStateText($event->state); $stateClass = Service::getStateText($event->state);
$icon = 'attention-alt'; $icon = 'attention-alt';
$title = Service::getStateText($event->state); $title = Service::getStateText($event->state);
break; break;
case 'soft_state': case 'soft_state':
$icon = 'spinner'; $icon = 'spinner';
$msg = '[ ' . $event->attempt . '/' . $event->max_attempts . ' ] ' . $this->escape($event->output);
$stateClass = Service::getStateText($event->state); $stateClass = Service::getStateText($event->state);
$title = Service::getStateText($event->state); $title = Service::getStateText($event->state);
break; break;
case 'dt_start': case 'dt_start':
$icon = 'downtime_start'; $icon = 'downtime_start';
$title = $this->translate('Downtime Start'); $title = $this->translate('Downtime Start');
$msg = $this->escape($event->output);
break; break;
case 'dt_end': case 'dt_end':
$icon = 'downtime_end'; $icon = 'downtime_end';
$title = $this->translate('Downtime End'); $title = $this->translate('Downtime End');
$msg = $this->escape($event->output);
break; break;
} }
?> ?>