Merge branch 'feature/untranslated-strings-7988'

resolves #7988
This commit is contained in:
Eric Lippmann 2014-12-30 11:16:34 +01:00
commit 84521a1a24
5 changed files with 88 additions and 93 deletions

View File

@ -193,11 +193,11 @@ class Monitoring_AlertsummaryController extends Controller
$out = new stdClass(); $out = new stdClass();
if ($yesterday === $today) { if ($yesterday === $today) {
$out->trend = 'unchanged'; $out->trend = $this->translate('unchanged');
} elseif ($yesterday > $today) { } elseif ($yesterday > $today) {
$out->trend = 'down'; $out->trend = $this->translate('down');
} else { } else {
$out->trend = 'up'; $out->trend = $this->translate('up');
} }
if ($yesterday <= 0) { if ($yesterday <= 0) {

View File

@ -605,7 +605,7 @@ class Monitoring_ListController extends Controller
$this->filterQuery($query); $this->filterQuery($query);
$this->setupSortControl(array( $this->setupSortControl(array(
'timestamp' => 'Occurence' 'timestamp' => $this->translate('Occurence')
)); ));
$this->view->history = $query->paginate(); $this->view->history = $query->paginate();
} }

View File

@ -5,85 +5,75 @@ use Icinga\Module\Monitoring\Object\Service;
?> ?>
<?php if (!$this->compact): ?> <?php if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs ?>
<div class="dontprint" style="margin: 1em;"> <div class="dontprint" style="margin: 1em;">
<?= $this->translate('Sort by') ?> <?= $this->sortControl->render($this) ?> <?= $this->translate('Sort by') ?> <?= $this->sortControl->render($this) ?>
</div> </div>
<?= $this->widget('limiter') ?> <?= $this->widget('limiter') ?>
<?= $this->paginationControl($notifications, null, null, array('preserve' => $this->preserve)) ?> <?= $this->paginationControl($notifications, null, null, array('preserve' => $this->preserve)) ?>
</div> </div>
<?php endif ?> <?php endif ?>
<?php if (! $this->inline): ?>
<div class="content"> <div class="content">
<?php endif; ?> <?php if (count($notifications) === 0): ?>
<?= $this->translate('No notifications matching the filter') ?>
<?php return; endif ?>
<?php <table data-base-target="_next" class="action">
<tbody>
if (empty($this->notifications)) { <?php foreach ($notifications as $notification):
echo 'No notifications yet</div>'; if (isset($notification->service)) {
return; $isService = true;
} $href = $this->href('monitoring/show/service', array(
?> 'host' => $notification->host,
'service' => $notification->service
<table data-base-target="_next" class="action"> ));
<tbody> $stateName = Service::getStateText($notification->notification_state);
<?php } else {
$isService = false;
if (count($notifications) === 0) { $href = $this->href('monitoring/show/host', array(
echo mt('monitoring', 'No notifications matching the filter'); 'host' => $notification->host
} ));
foreach ($notifications as $notification): $stateName = Host::getStateText($notification->notification_state);
}
if (isset($notification->service)) {
$isService = true;
$href = $this->href('monitoring/show/service', array(
'host' => $notification->host,
'service' => $notification->service
));
$stateName = Service::getStateText($notification->notification_state);
} else {
$isService = false;
$href = $this->href('monitoring/show/host', array(
'host' => $notification->host
));
$stateName = Host::getStateText($notification->notification_state);
}
?>
<tr class="state <?= $stateName ?>">
<td class="state">
<?= $this->dateTimeRenderer($notification->notification_start_time)->render(
$this->translate('on %s', 'datetime'),
$this->translate('at %s', 'time'),
$this->translate('%s ago', 'timespan')
);
?> ?>
</td> <tr class="state <?= $stateName ?>">
<td style="font-size: 0.8em"> <td class="state">
<?php if ($isService): ?> <?= $this->dateTimeRenderer($notification->notification_start_time)->render(
<a href="<?= $href ?>"><?= $notification->service ?></a> on <?= $notification->host ?> $this->translate('on %s', 'datetime'),
<?php else: ?> $this->translate('at %s', 'time'),
<a href="<?= $href ?>"><?= $notification->host ?></a> $this->translate('%s ago', 'timespan')
<?php endif; ?> ) ?>
<br /> </td>
<?= $this->escape(substr(strip_tags($notification->notification_output), 0, 10000)); ?> <td style="font-size: 0.8em">
<br /> <?php if ($isService): ?>
<?php if (!$this->contact): ?> <?= sprintf(
<small> $this->translate('%s on %s'),
Sent to <a href="<?= $this->href( $this->qlink($notification->service, $href), $notification->host
'monitoring/show/contact', ) ?>
array('contact' => $notification->notification_contact) <?php else: ?>
) ?>"><?= $this->escape($notification->notification_contact) ?></a> <?= $this->qlink($notification->host, $href) ?>
</small> <?php endif ?>
<?php endif ?> <br>
</td> <?= $this->escape(substr(strip_tags($notification->notification_output), 0, 10000)); ?>
</tr> <br>
<?php endforeach ?> <?php if (! $this->contact): ?>
</tbody> <small>
</table> <?= sprintf(
$this->translate('Sent to %s'),
<?php if (!$this->inline): ?> $this->qlink(
$notification->notification_contact,
'monitoring/show/contact',
array('contact' => $notification->notification_contact)
)
) ?>
</small>
<?php endif ?>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
</div> </div>
<?php endif; ?>

View File

@ -26,11 +26,11 @@ $cp = $this->checkPerformance()->create($this->checkperformance);
</tr> </tr>
<tr> <tr>
<th><?= $this->translate('Last Status Update'); ?></th> <th><?= $this->translate('Last Status Update'); ?></th>
<td><?= $this->timeSince($this->programStatus->status_update_time) ?> ago</td> <td><?= sprintf($this->translate('%s ago'), $this->timeSince($this->programStatus->status_update_time)); ?></td>
</tr> </tr>
<tr> <tr>
<th><?= $this->translate('Last External Command Check'); ?></th> <th><?= $this->translate('Last External Command Check'); ?></th>
<td><?= $this->timeSince($this->programStatus->last_command_check) ?> ago</td> <td><?= sprintf($this->translate('%s ago'), $this->timeSince($this->programStatus->last_command_check)); ?></td>
</tr> </tr>
<tr> <tr>
<th><?= $this->translate('Last Log File Rotation'); ?></th> <th><?= $this->translate('Last Log File Rotation'); ?></th>

View File

@ -127,22 +127,27 @@ $section->add($this->translate('Hostgroups'), array(
'url' => 'monitoring/list/hostgroups', 'url' => 'monitoring/list/hostgroups',
'priority' => 60 'priority' => 60
)); ));
$section->add($this->translate('Contactgroups'), array(
'url' => 'monitoring/list/contactgroups',
'priority' => 61
));
$section->add($this->translate('Downtimes'), array(
'url' => 'monitoring/list/downtimes',
'priority' => 71
));
$section->add($this->translate('Comments'), array(
'url' => 'monitoring/list/comments?comment_type=(comment|ack)',
'priority' => 70
));
$section->add($this->translate('Contacts'), array( $section->add($this->translate('Contacts'), array(
'url' => 'monitoring/list/contacts', 'url' => 'monitoring/list/contacts',
'priority' => 70 'priority' => 70
)); ));
$section->add($this->translate('Contactgroups'), array(
'url' => 'monitoring/list/contactgroups',
'priority' => 70
));
$section->add($this->translate('Comments'), array(
'url' => 'monitoring/list/comments?comment_type=(comment|ack)',
'priority' => 80
));
$section->add($this->translate('Downtimes'), array(
'url' => 'monitoring/list/downtimes',
'priority' => 80
));
$section->add($this->translate('Notifications'), array(
'url' => 'monitoring/list/notifications',
'priority' => 80
));
/* /*
* History Section * History Section