From c88f0c7e37a62c08831c65846bc06fcfdabce3d4 Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Mon, 10 Aug 2015 10:58:21 +0200 Subject: [PATCH] downtime/views: Use ends instead of started ... refs #9266 --- .../application/views/scripts/list/downtimes.phtml | 4 ++-- .../views/scripts/partials/downtime/downtime-header.phtml | 4 ++-- .../views/scripts/partials/downtime/downtimes-header.phtml | 4 ++-- .../views/scripts/show/components/downtime.phtml | 7 ++++++- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/modules/monitoring/application/views/scripts/list/downtimes.phtml b/modules/monitoring/application/views/scripts/list/downtimes.phtml index 1ff615094..b588af952 100644 --- a/modules/monitoring/application/views/scripts/list/downtimes.phtml +++ b/modules/monitoring/application/views/scripts/list/downtimes.phtml @@ -36,9 +36,9 @@ if (! $this->compact): ?> start <= time() && ! $downtime->is_in_effect): ?> - translate('Started'); ?> + translate('Ends'); ?>
- translate('Ends %s'), $this->timeUntil($downtime->end, $this->compact)) ?> + timeUntil($downtime->end, $this->compact) ?> is_in_effect ? $this->translate('Expires') : $this->translate('Starts'); ?>
diff --git a/modules/monitoring/application/views/scripts/partials/downtime/downtime-header.phtml b/modules/monitoring/application/views/scripts/partials/downtime/downtime-header.phtml index ebb45ccb0..e722532b8 100644 --- a/modules/monitoring/application/views/scripts/partials/downtime/downtime-header.phtml +++ b/modules/monitoring/application/views/scripts/partials/downtime/downtime-header.phtml @@ -2,9 +2,9 @@ start <= time() && ! $downtime->is_in_effect): ?> - translate('Started'); ?> + translate('Ends'); ?>
- translate('Ends %s'), $this->timeUntil($downtime->end, $this->compact)) ?> + timeUntil($downtime->end, $this->compact) ?> is_in_effect ? $this->translate('Expires') : $this->translate('Starts'); ?>
diff --git a/modules/monitoring/application/views/scripts/partials/downtime/downtimes-header.phtml b/modules/monitoring/application/views/scripts/partials/downtime/downtimes-header.phtml index 4eb1b87eb..83766b8b6 100644 --- a/modules/monitoring/application/views/scripts/partials/downtime/downtimes-header.phtml +++ b/modules/monitoring/application/views/scripts/partials/downtime/downtimes-header.phtml @@ -7,9 +7,9 @@ start <= time() && ! $downtime->is_in_effect): ?> - translate('Started'); ?> + translate('Ends'); ?>
- translate('Ends %s'), $this->timeUntil($downtime->end, $this->compact)) ?> + timeUntil($downtime->end, $this->compact) ?> is_in_effect ? $this->translate('Expires') : $this->translate('Starts'); ?>
diff --git a/modules/monitoring/application/views/scripts/show/components/downtime.phtml b/modules/monitoring/application/views/scripts/show/components/downtime.phtml index fb3d86df8..2228c35cd 100644 --- a/modules/monitoring/application/views/scripts/show/components/downtime.phtml +++ b/modules/monitoring/application/views/scripts/show/components/downtime.phtml @@ -53,7 +53,12 @@ if (empty($object->comments) && ! $addLink) { $this->timeUntil($downtime->end) ); } else { - if ((bool) $downtime->is_fixed) { + 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) + ); + } elseif ((bool) $downtime->is_fixed) { $state = sprintf( $this->translate('scheduled %s', 'Last format parameter represents the time scheduled'), $this->timeUntil($downtime->start)