From 5b11b0a3f4d42fa99ee037f711c542191398d6bd Mon Sep 17 00:00:00 2001 From: Michael J Rubinsky Date: Tue, 26 Nov 2013 13:04:07 -0500 Subject: [PATCH] Use global. --- hermes/lib/Ajax/Application/Handler.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hermes/lib/Ajax/Application/Handler.php b/hermes/lib/Ajax/Application/Handler.php index 39a555dd356..97af0f7d6de 100644 --- a/hermes/lib/Ajax/Application/Handler.php +++ b/hermes/lib/Ajax/Application/Handler.php @@ -410,25 +410,24 @@ public function startTimer() */ public function stopTimer() { - global $prefs; + global $prefs, $notification; try { $timer = Hermes::getTimer($this->vars->t); } catch (Horde_Exception_NotFound $e) { - $GLOBALS['notification']->push(_("Invalid timer requested"), 'horde.error'); + $notification->push(_("Invalid timer requested"), 'horde.error'); return false; } $results = $timer; $tname = $timer['name']; $elapsed = ((!$timer['paused']) ? time() - $timer['time'] : 0 ) + $timer['elapsed']; - $results['h'] = round((float)$elapsed / 3600, 2); if ($prefs->getValue('add_description')) { $results['n'] = sprintf(_("Using the \"%s\" stop watch from %s %s to %s %s"), $tname, strftime($prefs->getValue('date_format_mini'), $this->vars->t), strftime($prefs->getValue('time_format'), $this->vars->t), strftime($prefs->getValue('date_format_mini'), time()), strftime($prefs->getValue('time_format'), time())); } else { $results['n'] = ''; } - $GLOBALS['notification']->push(sprintf(_("The stop watch \"%s\" has been stopped."), $tname), 'horde.success'); + $notification->push(sprintf(_("The stop watch \"%s\" has been stopped."), $tname), 'horde.success'); Hermes::clearTimer($this->vars->t); if ($this->vars->restart == 'true') {