downtime/views: Fix the wrong time for flexible downtime

refs #9266
This commit is contained in:
Alexander Fuhr 2015-08-10 12:15:26 +02:00
parent 18dae78d80
commit 073d695c94
4 changed files with 4 additions and 4 deletions

View File

@ -38,7 +38,7 @@ if (! $this->compact): ?>
<?php if ($downtime->start <= time() && ! $downtime->is_in_effect): ?>
<strong><?= $this->translate('Ends'); ?></strong>
<br>
<?= $this->timeUntil($downtime->end, $this->compact) ?>
<?= $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>
<br>

View File

@ -4,7 +4,7 @@
<?php if ($downtime->start <= time() && ! $downtime->is_in_effect): ?>
<strong><?= $this->translate('Ends'); ?></strong>
<br>
<?= $this->timeUntil($downtime->end, $this->compact) ?>
<?= $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>
<br>

View File

@ -9,7 +9,7 @@
<?php if ($downtime->start <= time() && ! $downtime->is_in_effect): ?>
<strong><?= $this->translate('Ends'); ?></strong>
<br>
<?= $this->timeUntil($downtime->end, $this->compact) ?>
<?= $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>
<br>

View File

@ -56,7 +56,7 @@ if (empty($object->comments) && ! $addLink) {
if ($downtime->start <= time() && ! (bool) $downtime->is_in_effect) {
$state = sprintf(
$this->translate('ends %s', 'Last format parameter represents the end time'),
$this->timeUntil($downtime->end)
$this->timeUntil($downtime->is_flexible ? $downtime->scheduled_end : $downtime->end)
);
} elseif ((bool) $downtime->is_fixed) {
$state = sprintf(