Skip to content

Commit

Permalink
Use more readable coding style in service multi-view
Browse files Browse the repository at this point in the history
refs #8565
  • Loading branch information
majentsch committed Mar 6, 2015
1 parent 7153436 commit 9fc80ec
Showing 1 changed file with 101 additions and 101 deletions.
202 changes: 101 additions & 101 deletions modules/monitoring/application/views/scripts/services/show.phtml
Expand Up @@ -20,124 +20,130 @@ use Icinga\Web\Url;
</h3>

<?php if (($serviceCount = count($objects)) === 0): ?>
<?= $this->translate('No services matching the filter'); ?>
<?= $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>
<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>
</p>

<?php if (($unhandledCount = count($unhandledObjects)) > 0): ?>
<div>
<h3>
<?= $this->icon('attention-alt') ?>
<?= $this->translatePlural(
'Unhandled Problem',
'Unhandled Problems',
$unhandledCount
) ?>
</h3>

<p><?= sprintf(t('There are %s unhandled problems. ' .
'Issue commands to the problematic services.'),
'<span class="badge badge-critical">' . $unhandledCount . '</span>') ?>
); ?>
</div>
</p>

<div>
<?= $this->qlink(
sprintf(
$this->translatePlural(
'Schedule a downtime for %u unhandled service problem',
'Schedule a downtime for %u unhandled service problems',
<?php if (($unhandledCount = count($unhandledObjects)) > 0): ?>
<div>
<h3>
<?= $this->icon('attention-alt') ?>
<?= $this->translatePlural(
'Unhandled Problem',
'Unhandled Problems',
$unhandledCount
) ?>
</h3>

<p><?= sprintf(t('There are %s unhandled problems. ' .
'Issue commands to the problematic services.'),
'<span class="badge badge-critical">' . $unhandledCount . '</span>') ?>

<div>
<?= $this->qlink(
sprintf(
$this->translatePlural(
'Schedule a downtime for %u unhandled service problem',
'Schedule a downtime for %u unhandled service problems',
$unhandledCount
),
$unhandledCount
),
$unhandledCount
),
$downtimeUnhandledLink,
null,
array('icon' => 'plug')
); ?>
</div>

<div><?= $this->qlink(
sprintf(
$this->translatePlural(
'Acknowledge %u unhandled service problem',
'Acknowledge %u unhandled service problems',
$downtimeUnhandledLink,
null,
array('icon' => 'plug')
); ?>
</div>

<div><?= $this->qlink(
sprintf(
$this->translatePlural(
'Acknowledge %u unhandled service problem',
'Acknowledge %u unhandled service problems',
$unhandledCount
),
$unhandledCount
),
$unhandledCount
),
$acknowledgeUnhandledLink,
null,
array('icon' => 'ok')
); ?></div>
</p>


</div>
$acknowledgeUnhandledLink,
null,
array('icon' => 'ok')
); ?></div>
</p>

</div>
<?php endif ?>
<?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',
<?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.',
$acknowledgedCount
),
$acknowledgedCount
),
$acknowledgedCount
); ?> <?= $removeAckForm ?>
</p>
); ?> <?= $removeAckForm ?>
</p>
<?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.',
$inDowntimeCount
), $inDowntimeCount) ?>

<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',
$inDowntimeCount
), $inDowntimeCount) ?>

<div>
<?= $this->qlink(
$this->translate('List all'),
$inDowntimeLink,
null,
array('icon' => 'plug')
);?>
</div>
</p>
<?= $this->qlink(
$this->translate('List all'),
$inDowntimeLink,
null
);?>
</p>
<?php endif ?>


Expand All @@ -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(); ?>
Expand Down Expand Up @@ -180,29 +192,17 @@ 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.
<!--
</p>
<div><?= $this->qlink(
$this->translate('Remove all'),
$deleteCommentLink,
null,
array('icon' => 'trash')
); ?></div>
</p>
-->

-->

<?php endif ?>

Expand Down

0 comments on commit 9fc80ec

Please sign in to comment.