Merge branch 'bugfix/downtimes-with-non-problem-state-time-caption-9266'
fixes #9266
This commit is contained in:
commit
b54a643c97
|
@ -35,9 +35,15 @@ if (! $this->compact): ?>
|
||||||
?>
|
?>
|
||||||
<tr class="state <?= $stateName; ?><?= $downtime->is_in_effect ? ' handled' : ''; ?>">
|
<tr class="state <?= $stateName; ?><?= $downtime->is_in_effect ? ' handled' : ''; ?>">
|
||||||
<td class="state">
|
<td class="state">
|
||||||
|
<?php if ($downtime->start <= time() && ! $downtime->is_in_effect): ?>
|
||||||
|
<strong><?= $this->translate('Ends'); ?></strong>
|
||||||
|
<br>
|
||||||
|
<?= $this->timeUntil($downtime->is_flexible ? $downtime->scheduled_end : $downtime->end, $this->compact) ?>
|
||||||
|
<?php else: ?>
|
||||||
<strong><?= $downtime->is_in_effect ? $this->translate('Expires') : $this->translate('Starts'); ?></strong>
|
<strong><?= $downtime->is_in_effect ? $this->translate('Expires') : $this->translate('Starts'); ?></strong>
|
||||||
<br>
|
<br>
|
||||||
<?= $this->timeUntil($downtime->is_in_effect ? $downtime->end : $downtime->start, $this->compact) ?>
|
<?= $this->timeUntil($downtime->is_in_effect ? $downtime->end : $downtime->start, $this->compact) ?>
|
||||||
|
<?php endif; ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?php if ($isService): ?>
|
<?php if ($isService): ?>
|
||||||
|
|
|
@ -1,9 +1,15 @@
|
||||||
<table class="action">
|
<table class="action">
|
||||||
<tr class="state <?= $stateName; ?><?= $downtime->is_in_effect ? ' handled' : ''; ?>">
|
<tr class="state <?= $stateName; ?><?= $downtime->is_in_effect ? ' handled' : ''; ?>">
|
||||||
<td class="state">
|
<td class="state">
|
||||||
|
<?php if ($downtime->start <= time() && ! $downtime->is_in_effect): ?>
|
||||||
|
<strong><?= $this->translate('Ends'); ?></strong>
|
||||||
|
<br>
|
||||||
|
<?= $this->timeUntil($downtime->is_flexible ? $downtime->scheduled_end : $downtime->end, $this->compact) ?>
|
||||||
|
<?php else: ?>
|
||||||
<strong><?= $downtime->is_in_effect ? $this->translate('Expires') : $this->translate('Starts'); ?></strong>
|
<strong><?= $downtime->is_in_effect ? $this->translate('Expires') : $this->translate('Starts'); ?></strong>
|
||||||
<br>
|
<br>
|
||||||
<?= $this->timeUntil($downtime->is_in_effect ? $downtime->end : $downtime->start, $this->compact) ?>
|
<?= $this->timeUntil($downtime->is_in_effect ? $downtime->end : $downtime->start, $this->compact) ?>
|
||||||
|
<?php endif; ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<small>
|
<small>
|
||||||
|
|
|
@ -6,9 +6,15 @@
|
||||||
} ?>
|
} ?>
|
||||||
<tr class="state <?= $downtime->stateText ?>">
|
<tr class="state <?= $downtime->stateText ?>">
|
||||||
<td class="state">
|
<td class="state">
|
||||||
|
<?php if ($downtime->start <= time() && ! $downtime->is_in_effect): ?>
|
||||||
|
<strong><?= $this->translate('Ends'); ?></strong>
|
||||||
|
<br>
|
||||||
|
<?= $this->timeUntil($downtime->is_flexible ? $downtime->scheduled_end : $downtime->end, $this->compact) ?>
|
||||||
|
<?php else: ?>
|
||||||
<strong><?= $downtime->is_in_effect ? $this->translate('Expires') : $this->translate('Starts'); ?></strong>
|
<strong><?= $downtime->is_in_effect ? $this->translate('Expires') : $this->translate('Starts'); ?></strong>
|
||||||
<br>
|
<br>
|
||||||
<?= $this->timeUntil($downtime->is_in_effect ? $downtime->end : $downtime->start, $this->compact) ?>
|
<?= $this->timeUntil($downtime->is_in_effect ? $downtime->end : $downtime->start, $this->compact) ?>
|
||||||
|
<?php endif; ?>
|
||||||
</td>
|
</td>
|
||||||
<td class="name oneline">
|
<td class="name oneline">
|
||||||
<?php if ($downtime->isService): ?>
|
<?php if ($downtime->isService): ?>
|
||||||
|
|
|
@ -53,7 +53,12 @@ if (empty($object->comments) && ! $addLink) {
|
||||||
$this->timeUntil($downtime->end)
|
$this->timeUntil($downtime->end)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
if ((bool) $downtime->is_fixed) {
|
if ($downtime->start <= time()) {
|
||||||
|
$state = sprintf(
|
||||||
|
$this->translate('ends %s', 'Last format parameter represents the end time'),
|
||||||
|
$this->timeUntil($downtime->is_flexible ? $downtime->scheduled_end : $downtime->end)
|
||||||
|
);
|
||||||
|
} elseif ((bool) $downtime->is_fixed) {
|
||||||
$state = sprintf(
|
$state = sprintf(
|
||||||
$this->translate('scheduled %s', 'Last format parameter represents the time scheduled'),
|
$this->translate('scheduled %s', 'Last format parameter represents the time scheduled'),
|
||||||
$this->timeUntil($downtime->start)
|
$this->timeUntil($downtime->start)
|
||||||
|
|
|
@ -279,6 +279,7 @@ abstract class MonitoredObject implements Filterable
|
||||||
'author_name' => 'downtime_author_name',
|
'author_name' => 'downtime_author_name',
|
||||||
'start' => 'downtime_start',
|
'start' => 'downtime_start',
|
||||||
'scheduled_start' => 'downtime_scheduled_start',
|
'scheduled_start' => 'downtime_scheduled_start',
|
||||||
|
'scheduled_end' => 'downtime_scheduled_end',
|
||||||
'end' => 'downtime_end',
|
'end' => 'downtime_end',
|
||||||
'duration' => 'downtime_duration',
|
'duration' => 'downtime_duration',
|
||||||
'is_flexible' => 'downtime_is_flexible',
|
'is_flexible' => 'downtime_is_flexible',
|
||||||
|
|
Loading…
Reference in New Issue