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

@ -16,27 +16,14 @@ use Icinga\Module\Monitoring\Object\Service;
</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 <?php return; endif ?>
if (empty($this->notifications)) {
echo 'No notifications yet</div>';
return;
}
?>
<table data-base-target="_next" class="action"> <table data-base-target="_next" class="action">
<tbody> <tbody>
<?php <?php foreach ($notifications as $notification):
if (count($notifications) === 0) {
echo mt('monitoring', 'No notifications matching the filter');
}
foreach ($notifications as $notification):
if (isset($notification->service)) { if (isset($notification->service)) {
$isService = true; $isService = true;
$href = $this->href('monitoring/show/service', array( $href = $this->href('monitoring/show/service', array(
@ -58,24 +45,30 @@ foreach ($notifications as $notification):
$this->translate('on %s', 'datetime'), $this->translate('on %s', 'datetime'),
$this->translate('at %s', 'time'), $this->translate('at %s', 'time'),
$this->translate('%s ago', 'timespan') $this->translate('%s ago', 'timespan')
); ) ?>
?>
</td> </td>
<td style="font-size: 0.8em"> <td style="font-size: 0.8em">
<?php if ($isService): ?> <?php if ($isService): ?>
<a href="<?= $href ?>"><?= $notification->service ?></a> on <?= $notification->host ?> <?= sprintf(
$this->translate('%s on %s'),
$this->qlink($notification->service, $href), $notification->host
) ?>
<?php else: ?> <?php else: ?>
<a href="<?= $href ?>"><?= $notification->host ?></a> <?= $this->qlink($notification->host, $href) ?>
<?php endif; ?> <?php endif ?>
<br /> <br>
<?= $this->escape(substr(strip_tags($notification->notification_output), 0, 10000)); ?> <?= $this->escape(substr(strip_tags($notification->notification_output), 0, 10000)); ?>
<br /> <br>
<?php if (! $this->contact): ?> <?php if (! $this->contact): ?>
<small> <small>
Sent to <a href="<?= $this->href( <?= sprintf(
$this->translate('Sent to %s'),
$this->qlink(
$notification->notification_contact,
'monitoring/show/contact', 'monitoring/show/contact',
array('contact' => $notification->notification_contact) array('contact' => $notification->notification_contact)
) ?>"><?= $this->escape($notification->notification_contact) ?></a> )
) ?>
</small> </small>
<?php endif ?> <?php endif ?>
</td> </td>
@ -83,7 +76,4 @@ foreach ($notifications as $notification):
<?php endforeach ?> <?php endforeach ?>
</tbody> </tbody>
</table> </table>
<?php if (!$this->inline): ?>
</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