Hermes: Yet more H4 changes
authorBen Klang <ben@alkaloid.net>
Wed, 2 Jun 2010 20:58:07 +0000 (16:58 -0400)
committerBen Klang <ben@alkaloid.net>
Wed, 2 Jun 2010 20:58:07 +0000 (16:58 -0400)
hermes/lib/Forms/Deliverable.php
hermes/lib/Forms/Export.php
hermes/lib/Forms/Search.php
hermes/lib/Forms/Time.php
hermes/search.php

index c2964ad..51acdb2 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 
-require_once 'Horde/Form.php';
-
 /**
  * DeliverableClientSelector - Form for selecting client on deliverables screen
  *
index 050fa96..544b482 100644 (file)
  */
 
 /**
- * Horde_Form
- */
-require_once 'Horde/Form.php';
-
-/**
  * ExportForm:: is the export form which appears with search results on
  * the search screen.
  *
@@ -28,7 +23,7 @@ class ExportForm extends Horde_Form {
 
     function ExportForm(&$vars)
     {
-        global $perms;
+        $perms = $GLOBALS['injector']->getInstance('Horde_Perms');;
 
         parent::Horde_Form($vars, _("Export Search Results"));
 
index 4556527..e8f9b24 100644 (file)
@@ -9,12 +9,6 @@
  *
  */
 
-/** Horde_Array */
-require_once 'Horde/Array.php';
-
-/** Horde_Form */
-require_once 'Horde/Form.php';
-
 /**
  * Hermes time search form.
  *
@@ -28,8 +22,9 @@ class SearchForm extends Horde_Form {
     function SearchForm(&$vars)
     {
         parent::Horde_Form($vars, _("Search For Time"));
+        $perms = $GLOBALS['injector']->getInstance('Horde_Perms');
 
-        if ($GLOBALS['perms']->hasPermission('hermes:review', $GLOBALS['registry']->getAuth(), Horde_Perms::SHOW)) {
+        if ($perms->hasPermission('hermes:review', $GLOBALS['registry']->getAuth(), Horde_Perms::SHOW)) {
             $type = Hermes::getEmployeesType();
             $this->addVariable(_("Employees"), 'employees', $type[0], false,
                                false, null, $type[1]);
@@ -164,9 +159,10 @@ class SearchForm extends Horde_Form {
             return null;
         }
         $this->getInfo($vars, $info);
+        $perms = $GLOBALS['injector']->getInstance('Horde_Perms');
 
         $criteria = array();
-        if ($GLOBALS['perms']->hasPermission('hermes:review', $GLOBALS['registry']->getAuth(), Horde_Perms::SHOW)) {
+        if ($perms->hasPermission('hermes:review', $GLOBALS['registry']->getAuth(), Horde_Perms::SHOW)) {
             if (!empty($info['employees'])) {
                 $auth = Horde_Auth::singleton($GLOBALS['conf']['auth']['driver']);
                 if (!$auth->capabilities['list']) {
index da957da..b12661f 100644 (file)
@@ -8,12 +8,6 @@
  * did not receive this file, see http://www.horde.org/licenses/bsdl.php.
  */
 
-/** Horde_Array */
-require_once 'Horde/Array.php';
-
-/** Horde_Form */
-require_once 'Horde/Form.php';
-
 /**
  * TimeForm abstract class.
  *
index 358e8a6..dc0bde0 100644 (file)
@@ -14,8 +14,6 @@ require_once HERMES_BASE . '/lib/Forms/Export.php';
 require_once HERMES_BASE . '/lib/Forms/Search.php';
 require_once HERMES_BASE . '/lib/Forms/Time.php';
 require_once HERMES_BASE . '/lib/Table.php';
-require_once 'Horde/Identity.php';
-require_once 'Horde/Data.php';
 
 $vars = Horde_Variables::getDefaultVariables();
 
@@ -100,14 +98,10 @@ if (isset($_SESSION['hermes_search_criteria'])) {
 }
 $form = new SearchForm($searchVars);
 
-if ($print_view) {
-    require_once $registry->get('templates', 'horde') . '/javascript/print.js';
-} else {
-    $print_link = Horde::url(Horde_Util::addParameter('search.php', array('print' => 'true')));
-    require HERMES_TEMPLATES . '/menu.inc';
-    $form->renderActive(new Horde_Form_Renderer(), $searchVars, 'search.php', 'post');
-    echo '<br />';
-}
+$print_link = Horde::url(Horde_Util::addParameter('search.php', array('print' => 'true')));
+require HERMES_TEMPLATES . '/menu.inc';
+$form->renderActive(new Horde_Form_Renderer(), $searchVars, 'search.php', 'post');
+echo '<br />';
 
 if (isset($_SESSION['hermes_search_criteria'])) {
     echo Hermes::tabs();