-
Notifications
You must be signed in to change notification settings - Fork 275
/
acknowledgement.phtml
92 lines (89 loc) · 3.66 KB
/
acknowledgement.phtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php
/** @var \Icinga\Module\Monitoring\Object\MonitoredObject $object */
if (in_array((int) $object->state, array(0, 99))) {
// Ignore this markup if the object is in a non-problem state or pending
return;
}
if ($object->acknowledged): ?>
<?php
$acknowledgement = $object->acknowledgement;
/** @var \Icinga\Module\Monitoring\Object\Acknowledgement $acknowledgement */
?>
<tr>
<th><?= $this->translate('Acknowledged') ?></th>
<td data-base-target="_self">
<dl class="feed-list">
<dt class="feed-author clearfix">
<?= $this->escape($acknowledgement->getAuthor()) ?>
<span class="text-small"><?= $this->translate('acknowledged') ?></span>
<?= $this->timeAgo($acknowledgement->getEntryTime()) ?>
<?php
if ($acknowledgement->getSticky()) {
echo $this->icon('pin', sprintf(
$this->translate(
'Acknowledgement remains until the %1$s recovers even if the %1$s changes state'
),
$object->getType(true)
));
}
if (isset($removeAckForm)) {
$removeAckForm->setAttrib('class', $removeAckForm->getAttrib('class') . ' pull-right');
// Form is unset if the current user lacks the respective permission
echo $removeAckForm;
}
?>
</dt>
<dd class="comment-text">
<?= nl2br($this->createTicketLinks($acknowledgement->getComment()), false) ?>
</dd>
<?php if ($acknowledgement->expires()): ?>
<dd class="text-small">
<?= sprintf(
$this->translate('Expires %s'),
$this->timeUntil($acknowledgement->getExpirationTime())
) ?>
</dd>
<?php endif ?>
</dl>
</td>
</tr>
<?php else: ?>
<tr>
<th><?= $this->translate('Not acknowledged') ?></th>
<td>
<?php if ($this->hasPermission('monitoring/command/acknowledge-problem')) {
if ($object->getType() === $object::TYPE_HOST) {
$ackLink = $this->href(
'monitoring/host/acknowledge-problem',
array('host' => $object->getName()),
null,
array('class' => 'action-link')
);
} else {
$ackLink = $this->href(
'monitoring/service/acknowledge-problem',
array('host' => $object->getHost()->getName(), 'service' => $object->getName()),
null,
array('class' => 'action-link')
);
}
?>
<?= $this->qlink(
$this->translate('Acknowledge'),
$ackLink,
null,
array(
'class' => 'action-link',
'data-base-target' => '_self',
'icon' => 'ok',
'title' => $this->translate(
'Acknowledge this problem, suppress all future notifications for it and tag it as being handled'
)
)
); ?>
<?php } else {
echo '-';
} // endif ?>
</td>
</tr>
<?php endif ?>