icingaweb2/modules/monitoring/application/views/scripts/hosts/show.phtml
Matthias Jentsch 29cc92a3f3 Display acknowledgement action for all unacknowledged objects
Instead of displaying the ack for all unhandled problem host, make acknowledgement possible for all monitored objects in multi views.

fixes #7931
2015-06-01 12:24:29 +02:00

235 lines
No EOL
7.8 KiB
PHTML

<div data-base-target='_next' class="controls">
<?php if (! $this->compact): ?>
<?= $tabs; ?>
<?php endif ?>
<?= $this->render('list/components/hostssummary.phtml') ?>
<?= $this->render('partials/host/objects-header.phtml'); ?>
</div>
<div class="content multi-commands">
<h3>
<?= $this->icon('reschedule') ?>
<?= $this->translate('Commands') ?>
</h3>
<p>
<?= sprintf($this->translatePlural(
'Issue commands to %s selected host:',
'Issue commands to all %s selected hosts:',
count($objects)
), '<b>' . count($objects) . '</b>') ?>
</p>
<?php if (($hostCount = count($objects)) === 0): ?>
<?= $this->translate('No hosts found matching the filter'); ?>
<?php else: ?>
<?= $checkNowForm; ?>
<br>
<?= $this->qlink(
$this->translate('Reschedule next checks'),
$rescheduleAllLink,
null,
array('icon' => 'reschedule')
); ?>
<br>
<?= $this->qlink(
$this->translate('Schedule downtimes'),
$downtimeAllLink,
null,
array('icon' => 'plug')
); ?>
<br>
<?= $this->qlink(
$this->translate('Submit passive check results'),
$processCheckResultAllLink,
null,
array('icon' => 'reply')
); ?>
<br>
<?= $this->qlink(
$this->translate('Add comments'),
$addCommentLink,
null,
array('icon' => 'comment')
); ?>
<?php if ($this->hasPermission('monitoring/command/send-custom-notification')): ?>
<br>
<?= $this->qlink(
sprintf($this->translate('Send a custom notification for all %u hosts'), $hostCount),
$sendCustomNotificationLink,
null,
array('icon' => 'comment')
); ?>
<?php endif; ?>
<?php
$unhandledCount = count($unhandledObjects);
$problemCount = count($problemObjects);
$unackCount = count($unacknowledgedObjects);
?>
<?php if ($problemCount || $unhandledCount || $unackCount): ?>
<h3>
<?= $this->icon('attention-alt') ?>
<?= $this->translatePlural(
'Problem',
'Problems',
$unhandledCount + $problemCount
) ?>
</h3>
<?php if ($problemCount): ?>
<p>
<?= sprintf(
$this->translatePlural(
'There is %s problem.',
'There are %s problems.',
$problemCount
),
'<b>' . $problemCount . '</b>'
); ?>
</p>
<?= $this->qlink(
sprintf(
$this->translatePlural(
'Schedule a downtime for %u problem host',
'Schedule a downtime for %u problem hosts',
$problemCount
),
$problemCount
),
$downtimeLink,
null,
array('icon' => 'plug')
); ?>
<?php endif; ?>
<?php
if ($unackCount > 0): ?>
<br>
<?= $this->qlink(
sprintf(
$this->translatePlural(
'Acknowledge %u unacknowledged problem hosts',
'Acknowledge %u unacknowledged problem hosts',
$unackCount
),
$unackCount
),
$acknowledgeLink,
null,
array('icon' => 'ok')
); ?>
<?php endif; ?>
<?php if ($unhandledCount): ?>
<p>
<?= sprintf(
$this->translatePlural(
'There is %s unhandled problem host, issue commands to the problematic host:',
'There are %s unhandled problem hosts, issue commands to the problematic hosts:',
$unhandledCount
),
'<span class="badge badge-critical">' . $unhandledCount . '</span>'
); ?>
</p>
<?= $this->qlink(
sprintf(
$this->translatePlural(
'Schedule a downtime for %u unhandled problem host',
'Schedule a downtime for %u unhandled problem hosts',
$unhandledCount
),
$unhandledCount
),
$downtimeUnhandledLink,
null,
array('icon' => 'plug')
); ?>
<?php endif; ?>
<?php endif;?>
<?php if (($acknowledgedCount = count($acknowledgedObjects)) > 0): ?>
<div>
<h3><?= $this->icon('ok', $this->translate('Acknowledgements')) ?> <?= $this->translate('Acknowledgements') ?></h3>
<?= sprintf(
$this->translatePlural(
'%s Acknowledged Host Problem',
'%s Acknowledged Host Problems',
$acknowledgedCount
),
'<b>' . $acknowledgedCount . '</b>'
); ?>
<?= $removeAckForm ?>
</div>
<?php endif ?>
<?php $scheduledDowntimeCount = count($objects->getScheduledDowntimes()) ?>
<?php if ($scheduledDowntimeCount): ?>
<h3><?= $this->icon('plug', $this->translate('Downtimes'))?> <?=$this->translate('Downtimes')?></h3>
<?= $this->qlink(
sprintf(
$this->translatePlural(
'%s scheduled downtime',
'%s scheduled downtimes',
$scheduledDowntimeCount
),
$scheduledDowntimeCount
),
$showDowntimesLink,
null,
array('data-base-target' => '_next')
);?>
<?= sprintf($this->translate('on all selected hosts.')) ?>
<?php if (($inDowntimeCount = count($objectsInDowntime)) > 0): ?>
<br>
<?= $this->qlink(
sprintf(
$this->translatePlural(
'%s host',
'%s hosts',
$inDowntimeCount
),
$inDowntimeCount
),
$inDowntimeLink,
null,
array('data-base-target' => '_next')
); ?>
<?= $this->translate('are currently in downtime.') ?>
<?php endif; ?>
<?php endif ?>
<?php if (($commentCount = count($objects->getComments())) > 0): ?>
<h3> <?= $this->icon('comment', $this->translate('Comments'))?> <?=$this->translate('Comments') ?></h3>
<?= $this->qlink(
sprintf(
$this->translatePlural(
'%s comment',
'%s comments',
$commentCount
),
$commentCount
),
$commentsLink,
null,
array('data-base-target' => '_next')
); ?>
<?= $this->translate('on all selected hosts.') ?>
<?php endif ?>
<?php endif ?>
</div>