views/donwtime(s|-header): Fix that the Downtimes show "Starts in" ...

... for objects with non-problem state

refs #9266
This commit is contained in:
Alexander Fuhr 2015-08-05 14:37:33 +02:00
parent 3d846ea270
commit aa7adee21f
3 changed files with 21 additions and 3 deletions

View File

@ -35,9 +35,15 @@ if (! $this->compact): ?>
?>
<tr class="state <?= $stateName; ?><?= $downtime->is_in_effect ? ' handled' : ''; ?>">
<td class="state">
<?php if ($downtime->start <= time() && ! $downtime->is_in_effect): ?>
<strong><?= $this->translate('Started'); ?></strong>
<br>
Ends <?= $this->timeUntil($downtime->end, $this->compact) ?>
<?php else: ?>
<strong><?= $downtime->is_in_effect ? $this->translate('Expires') : $this->translate('Starts'); ?></strong>
<br>
<?= $this->timeUntil($downtime->is_in_effect ? $downtime->end : $downtime->start, $this->compact) ?>
<?php endif; ?>
</td>
<td>
<?php if ($isService): ?>

View File

@ -1,9 +1,15 @@
<table class="action">
<tr class="state <?= $stateName; ?><?= $downtime->is_in_effect ? ' handled' : ''; ?>">
<td class="state">
<strong><?= $downtime->is_in_effect ? $this->translate('Expires') : $this->translate('Starts'); ?></strong>
<br>
<?= $this->timeUntil($downtime->is_in_effect ? $downtime->end : $downtime->start, $this->compact) ?>
<?php if ($downtime->start <= time() && ! $downtime->is_in_effect): ?>
<strong><?= $this->translate('Started'); ?></strong>
<br>
Ends <?= $this->timeUntil($downtime->end, $this->compact) ?>
<?php else: ?>
<strong><?= $downtime->is_in_effect ? $this->translate('Expires') : $this->translate('Starts'); ?></strong>
<br>
<?= $this->timeUntil($downtime->is_in_effect ? $downtime->end : $downtime->start, $this->compact) ?>
<?php endif; ?>
</td>
<td>
<small>

View File

@ -6,9 +6,15 @@
} ?>
<tr class="state <?= $downtime->stateText ?>">
<td class="state">
<?php if ($downtime->start <= time() && ! $downtime->is_in_effect): ?>
<strong><?= $this->translate('Started'); ?></strong>
<br>
Ends <?= $this->timeUntil($downtime->end, $this->compact) ?>
<?php else: ?>
<strong><?= $downtime->is_in_effect ? $this->translate('Expires') : $this->translate('Starts'); ?></strong>
<br>
<?= $this->timeUntil($downtime->is_in_effect ? $downtime->end : $downtime->start, $this->compact) ?>
<?php endif; ?>
</td>
<td class="name oneline">
<?php if ($downtime->isService): ?>