From b79b69328c922ef5ee0b1725da492f3fd074462f Mon Sep 17 00:00:00 2001 From: Ben Klang Date: Wed, 9 Jun 2010 18:24:44 -0400 Subject: [PATCH] Hermes: Misc H4 fixes --- hermes/lib/Hermes.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/hermes/lib/Hermes.php b/hermes/lib/Hermes.php index 841d36aa5..3279c254d 100644 --- a/hermes/lib/Hermes.php +++ b/hermes/lib/Hermes.php @@ -53,7 +53,9 @@ class Hermes { */ function getMenu($returnType = 'object') { - global $registry, $conf, $perms, $print_link; + global $registry, $conf, $print_link; + + $perms = $GLOBALS['injector']->getInstance('Horde_Perms'); $menu = new Horde_Menu(); $menu->add(Horde::applicationUrl('time.php'), _("My _Time"), 'hermes.png', null, null, null, basename($_SERVER['PHP_SELF']) == 'index.php' ? 'current' : null); @@ -87,9 +89,10 @@ class Hermes { function canEditTimeslice($id) { - global $hermes; + $hermes = $GLOBALS['registry']->getApiInstance('hermes', 'application'); + $perms = $GLOBALS['injector']->getInstance('Horde_Perms'); - if ($GLOBALS['perms']->hasPermission('hermes:review', $GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) { + if ($perms->hasPermission('hermes:review', $GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) { return true; } @@ -119,7 +122,6 @@ class Hermes { if (is_null($hours)) { return null; } - require_once 'Horde/Identity.php'; $clients = Hermes::listClients(); $namecache = array(); @@ -135,7 +137,7 @@ class Hermes { if (isset($namecache[$emp])) { $emp = $namecache[$emp]; } else { - $ident = &Identity::singleton('none', $emp); + $ident = $identity = $GLOBALS['injector']->getInstance('Horde_Prefs_Identity')->getIdentity($emp); $fullname = $ident->getValue('fullname'); if ($fullname) { $namecache[$emp] = $emp = $fullname; -- 2.11.0