Hermes: Yet more H4 fixes
authorBen Klang <ben@alkaloid.net>
Wed, 2 Jun 2010 20:47:30 +0000 (16:47 -0400)
committerBen Klang <ben@alkaloid.net>
Wed, 2 Jun 2010 20:47:30 +0000 (16:47 -0400)
hermes/admin.php
hermes/lib/Admin.php
hermes/lib/Hermes.php

index 6b324ee..77fb8d4 100644 (file)
@@ -12,7 +12,7 @@ require_once dirname(__FILE__) . '/lib/Application.php';
 $hermes = Horde_Registry::appInit('hermes');
 require_once HERMES_BASE . '/lib/Admin.php';
 
-if (!Horde_Auth::isAdmin()) {
+if (!$registry->isAdmin()) {
     exit('forbidden.');
 }
 
index b51c985..d77923a 100644 (file)
@@ -44,7 +44,7 @@ class EditJobTypeStep1Form extends Horde_Form {
         parent::Horde_Form($vars, 'editjobtypestep1form');
 
         $values = array();
-        $jobtypes = $hermes->listJobTypes();
+        $jobtypes = $hermes->driver->listJobTypes();
         if (!is_a($jobtypes, 'PEAR_Error')) {
             foreach ($jobtypes as $id => $jobtype) {
                 $values[$id] = $jobtype['name'];
@@ -79,7 +79,7 @@ class EditJobTypeStep2Form extends Horde_Form {
         parent::Horde_Form($vars, 'editjobtypestep2form');
 
         $jobtype = $vars->get('jobtype');
-        $info = $hermes->getJobTypeByID($jobtype);
+        $info = $hermes->driver->getJobTypeByID($jobtype);
         if (!$info || is_a($info, 'PEAR_Error')) {
             $stype = 'invalid';
             $type_params = array(_("This is not a valid job type."));
@@ -117,7 +117,7 @@ class DeleteJobTypeForm extends Horde_Form {
         parent::Horde_Form($vars, 'deletejobtypeform');
 
         $jobtype = $vars->get('jobtype');
-        $info = $hermes->getJobTypeByID($jobtype);
+        $info = $hermes->driver->getJobTypeByID($jobtype);
 
         $yesnotype = 'enum';
         $type_params = array(array(0 => _("No"), 1 => _("Yes")));
@@ -139,8 +139,6 @@ class EditClientStep1Form extends Horde_Form {
 
     function EditClientStep1Form(&$vars)
     {
-        global $hermes;
-
         parent::Horde_Form($vars, 'editclientstep1form');
 
         $clients = Hermes::listClients();
@@ -172,7 +170,7 @@ class EditClientStep2Form extends Horde_Form {
         parent::Horde_Form($vars, 'editclientstep2form');
 
         $client = $vars->get('client');
-        $info = $hermes->getClientSettings($client);
+        $info = $hermes->driver->getClientSettings($client);
         if (!$info || is_a($info, 'PEAR_Error')) {
             $stype = 'invalid';
             $type_params = array(_("This is not a valid client."));
index e188566..70367ee 100644 (file)
@@ -60,11 +60,11 @@ class Hermes {
         $menu->add(Horde::applicationUrl('entry.php'), _("_New Time"), 'hermes.png', null, null, null, Horde_Util::getFormData('id') ? '__noselection' : null);
         $menu->add(Horde::applicationUrl('search.php'), _("_Search"), Horde_Themes::img('search.png'));
 
-        if ($conf['time']['deliverables'] && Horde_Auth::isAdmin('hermes:deliverables')) {
+        if ($conf['time']['deliverables'] && $registry->isAdmin('hermes:deliverables')) {
             $menu->add(Horde::applicationUrl('deliverables.php'), _("_Deliverables"), 'hermes.png');
         }
 
-        if ($conf['invoices']['driver'] && Horde_Auth::isAdmin('hermes:invoicing')) {
+        if ($conf['invoices']['driver'] && $registry->isAdmin('hermes:invoicing')) {
             $menu->add(Horde::applicationUrl('invoicing.php'), _("_Invoicing"), 'invoices.png');
         }
 
@@ -93,7 +93,7 @@ class Hermes {
             return true;
         }
 
-        $hours = $hermes->getHours(array('id' => $id));
+        $hours = $hermes->driver->getHours(array('id' => $id));
         if (!is_array($hours) || count($hours) != 1) {
             return false;
         }
@@ -111,7 +111,7 @@ class Hermes {
      * Rewrite an hours array into a format useable by Horde_Data::
      *
      * @param array $hours          This is an array of the results from
-     *                              $hermes->getHours().
+     *                              $hermes->driver->getHours().
      * @return array an array suitable for Horde_Data::
      */
     function makeExportHours($hours)