From 6266e6db7fc9124db6a84941b6bb12d3541a47b4 Mon Sep 17 00:00:00 2001 From: Ben Klang Date: Wed, 2 Jun 2010 16:58:07 -0400 Subject: [PATCH] Hermes: Yet more H4 changes --- hermes/lib/Forms/Deliverable.php | 2 -- hermes/lib/Forms/Export.php | 7 +------ hermes/lib/Forms/Search.php | 12 ++++-------- hermes/lib/Forms/Time.php | 6 ------ hermes/search.php | 14 ++++---------- 5 files changed, 9 insertions(+), 32 deletions(-) diff --git a/hermes/lib/Forms/Deliverable.php b/hermes/lib/Forms/Deliverable.php index c2964adb1..51acdb2b3 100644 --- a/hermes/lib/Forms/Deliverable.php +++ b/hermes/lib/Forms/Deliverable.php @@ -1,7 +1,5 @@ getInstance('Horde_Perms');; parent::Horde_Form($vars, _("Export Search Results")); diff --git a/hermes/lib/Forms/Search.php b/hermes/lib/Forms/Search.php index 455652775..e8f9b2439 100644 --- a/hermes/lib/Forms/Search.php +++ b/hermes/lib/Forms/Search.php @@ -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']) { diff --git a/hermes/lib/Forms/Time.php b/hermes/lib/Forms/Time.php index da957da06..b12661ffb 100644 --- a/hermes/lib/Forms/Time.php +++ b/hermes/lib/Forms/Time.php @@ -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. * diff --git a/hermes/search.php b/hermes/search.php index 358e8a66c..dc0bde0d9 100644 --- a/hermes/search.php +++ b/hermes/search.php @@ -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 '
'; -} +$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 '
'; if (isset($_SESSION['hermes_search_criteria'])) { echo Hermes::tabs(); -- 2.11.0