Use more readable coding style in service multi-view

refs #8565
This commit is contained in:
Matthias Jentsch 2015-03-06 12:45:29 +01:00
parent 71534369ef
commit 9fc80ec34f
1 changed files with 109 additions and 109 deletions

View File

@ -22,36 +22,48 @@ use Icinga\Web\Url;
<?php if (($serviceCount = count($objects)) === 0): ?>
<?= $this->translate('No services matching the filter'); ?>
<?php else: ?>
<?= sprintf(t('Issue commands on all %d selected services'), count($objects)) ?>
<?= sprintf(t('Issue commands on all %d selected services:'), count($objects)) ?>
<p>
<div>
<?= $checkNowForm; ?>
</div>
<div><?= $this->qlink(
<div>
<?= $this->qlink(
$this->translate('Reschedule the next check'),
$rescheduleAllLink,
null,
array('icon' => 'reschedule')
); ?></div>
<div><?= $this->qlink(
); ?>
</div>
<div>
<?= $this->qlink(
$this->translate('Schedule a downtime'),
$downtimeAllLink,
null,
array('icon' => 'plug')
); ?></div>
<div><?= $this->qlink(
); ?>
</div>
<div>
<?= $this->qlink(
$this->translate('Submit a passive check result'),
$processCheckResultAllLink,
null,
array('icon' => 'reply')
); ?></div>
<div><?= $this->qlink(
); ?>
</div>
<div>
<?= $this->qlink(
$this->translate('Add a comment'),
$addCommentLink,
null,
array('icon' => 'comment')
); ?></div>
); ?>
</div>
</p>
<?php if (($unhandledCount = count($unhandledObjects)) > 0): ?>
@ -100,18 +112,16 @@ use Icinga\Web\Url;
); ?></div>
</p>
</div>
<?php endif ?>
<?php if (($acknowledgedCount = count($acknowledgedObjects)) > 0): ?>
<h3> <?= $this->icon('ok', $this->translate('Acknowledgements')) ?> <?= $this->translate('Acknowledgements') ?> </h3>
<?php if (($acknowledgedCount = count($acknowledgedObjects)) > 0): ?>
<h3><?= $this->icon('ok', $this->translate('Acknowledgements')) ?> <?= $this->translate('Acknowledgements') ?></h3>
<p>
<?= sprintf(
$this->translatePlural(
'%u Acknowledged Service Problem',
'%u Acknowledged Service Problems',
'%u Acknowledged Service Problem.',
'%u Acknowledged Service Problems.',
$acknowledgedCount
),
$acknowledgedCount
@ -120,23 +130,19 @@ use Icinga\Web\Url;
<?php endif ?>
<?php if (($inDowntimeCount = count($objectsInDowntime)) > 0): ?>
<?php if (($inDowntimeCount = count($objectsInDowntime)) > 0 /*&& $auth->hasPermission('monitoring/command/comment/delete')*/): ?>
<h3> <?= $this->icon('plug', $this->translate('Downtimes')) ?> <?= $this->translate('Downtimes') ?> </h3>
<p> <?= sprintf($this->translatePlural(
'%u service currently in downtime',
'%u services currently in downtime',
'%u service currently in downtime.',
'%u services currently in downtime.',
$inDowntimeCount
), $inDowntimeCount) ?>
<div>
<?= $this->qlink(
$this->translate('List all'),
$inDowntimeLink,
null,
array('icon' => 'plug')
null
);?>
</div>
</p>
<?php endif ?>
@ -146,12 +152,18 @@ use Icinga\Web\Url;
<h3> <?= $this->icon('comment') ?> <?= t('Comments') ?> </h3>
<p><?= sprintf(
$this->translatePlural(
'There are no comments.',
'There are %d comments',
'There is %d comment.',
'There are %d comments.',
$commentCount
), $commentCount);
?>
<?= $this->qlink(
$this->translate('List all'),
$commentsLink,
null
); ?>
<p>
<table>
<?php foreach ($objects as $service): ?>
<?php $service->fetchComments(); ?>
@ -180,20 +192,9 @@ use Icinga\Web\Url;
<?php endforeach ?>
<?php endforeach ?>
</table>
<!--
</p>
<div>
<?= $this->qlink(
$this->translate('List all'),
$commentsLink,
null,
array('icon' => 'comment')
); ?>
</div>
<!--
TODO: implement backend functionality.
<div><?= $this->qlink(
$this->translate('Remove all'),
$deleteCommentLink,
@ -201,8 +202,7 @@ use Icinga\Web\Url;
array('icon' => 'trash')
); ?></div>
</p>
-->
-->
<?php endif ?>