[icinga-checkins] icinga.org: icingaweb2/bugfix/correct-duration-formatting-6778: Use `dateTimeRenderer' helper in disable notifications view

git at icinga.org git at icinga.org
Thu Nov 27 15:34:42 CET 2014


Module: icingaweb2
Branch: bugfix/correct-duration-formatting-6778
Commit: d91b31c49b8c2fd36ac7b9d6723455fd06180c29
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=d91b31c49b8c2fd36ac7b9d6723455fd06180c29

Author: Alexander Klimov <alexander.klimov at netways.de>
Date:   Thu Nov 27 13:59:12 2014 +0100

Use `dateTimeRenderer' helper in disable notifications view

refs #6778

---

 .../scripts/process/disable-notifications.phtml      |   18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/modules/monitoring/application/views/scripts/process/disable-notifications.phtml b/modules/monitoring/application/views/scripts/process/disable-notifications.phtml
index 2fb3c6c..57ed43a 100644
--- a/modules/monitoring/application/views/scripts/process/disable-notifications.phtml
+++ b/modules/monitoring/application/views/scripts/process/disable-notifications.phtml
@@ -6,11 +6,19 @@
     <?php if ((bool) $programStatus->notifications_enabled === false): ?>
     <div>
         <?= $this->translate('Host and service notifications are already disabled.') ?>
-        <?php if ($this->programStatus->disable_notif_expire_time): ?>
-            <?= sprintf(
-                $this->translate('Notifications will be re-enabled in <strong>%s</strong>.'),
-                $this->timeUntil($this->programStatus->disable_notif_expire_time)); ?>
-        <?php endif; ?>
+        <?php if ($this->programStatus->disable_notif_expire_time) {
+            printf(
+                $this->translate('Notifications will be re-enabled %s.'),
+                $this->getView()->dateTimeRenderer(
+                    $this->programStatus->disable_notif_expire_time,
+                    true
+                )->render(
+                    $this->translate('on <strong>%s</strong>', 'datetime'),
+                    $this->translate('at <strong>%s</strong>', 'time'),
+                    $this->translate('in <strong>%s</strong>', 'timespan')
+                )
+            );
+        } ?>
     </div>
     <?php else: ?>
     <?= $form ?>



More information about the icinga-checkins mailing list