2014-03-08 18:28:19 +01:00
|
|
|
<?php
|
2013-10-14 18:17:58 +02:00
|
|
|
|
2014-03-08 18:28:19 +01:00
|
|
|
$cf = $this->getHelper('CommandForm');
|
2013-10-14 18:17:58 +02:00
|
|
|
|
2014-03-08 18:28:19 +01:00
|
|
|
$data = array('host' => $object->host_name);
|
|
|
|
if ($object->service_description) {
|
|
|
|
$data['service'] = $object->service_description;
|
|
|
|
}
|
2013-10-14 18:17:58 +02:00
|
|
|
|
2014-03-08 18:28:19 +01:00
|
|
|
|
|
|
|
$list = array();
|
|
|
|
foreach ($object->downtimes as $downtime) {
|
|
|
|
$deleteData = $data;
|
|
|
|
$deleteData['downtimeid'] = $object->downtime_internal_downtime_id;
|
|
|
|
|
|
|
|
// TODO: This needs improvement
|
|
|
|
if ((int) $downtime->downtime_is_in_effect) {
|
|
|
|
$state = 'in downtime since ' . $this->timeSince($downtime->downtime_start);
|
|
|
|
} else {
|
|
|
|
if ($downtime->downtime_is_fixed) {
|
|
|
|
$state = 'scheduled ' . $this->timeUnless($downtime->downtime_start);
|
|
|
|
} else {
|
|
|
|
$state = 'scheduled flexible ' . $this->timeUnless($downtime->downtime_start);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$iconForm = $cf->iconSubmitForm(
|
|
|
|
'img/icons/remove_petrol.png',
|
|
|
|
'Remove Downtime',
|
|
|
|
'link-like',
|
|
|
|
'removedowntime',
|
|
|
|
$deleteData
|
|
|
|
);
|
|
|
|
|
|
|
|
$list[] = sprintf(
|
|
|
|
"<br />%s [%s] (%s): %s\n",
|
|
|
|
$iconForm,
|
|
|
|
$this->escape($downtime->downtime_author),
|
|
|
|
$state,
|
|
|
|
$this->escape($downtime->downtime_comment)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
<tr>
|
|
|
|
<th><?= $this->translate('Downtimes') ?></th>
|
|
|
|
<td>
|
|
|
|
<a href="<?= $this->href('monitoring/command/scheduleDowntime', $data) ?>"><?= $this->icon('in_downtime_petrol.png') ?> <?= $this->translate('Schedule downtime') ?></a>
|
|
|
|
<?= implode('', $list) ?>
|
|
|
|
</td>
|
|
|
|
</tr>
|