Use timeSince and timeUntil when displaying object downtimes

refs #6778
This commit is contained in:
Eric Lippmann 2015-05-18 14:33:49 +02:00
parent bd51bed9d7
commit e49f938f56

View File

@ -47,12 +47,21 @@ foreach ($object->downtimes as $downtime) {
) : $this->escape($downtime->comment);
if ((bool) $downtime->is_in_effect) {
$state = 'in downtime since ' . $this->timeSince($downtime->start);
$state = sprintf(
$this->translate('in downtime %s', 'Last format parameter represents the time in downtime'),
$this->timeSince($downtime->start)
);
} else {
if ((bool) $downtime->is_fixed) {
$state = 'scheduled ' . $this->timeUntil($downtime->start);
$state = sprintf(
$this->translate('scheduled %s', 'Last format parameter represents the time scheduled'),
$this->timeUntil($downtime->start)
);
} else {
$state = 'scheduled flexible ' . $this->timeUntil($downtime->start);
$state = sprintf(
$this->translate('scheduled flexible %s', 'Last format parameter represents the time scheduled'),
$this->timeUntil($downtime->start)
);
}
}