$do_redirect = true;
} else {
$msg = _("Your time was successfully entered.");
- $result = $hermes->driver->enterTime(Horde_Auth::getAuth(), $info);
+ $result = $hermes->driver->enterTime($GLOBALS['registry']->getAuth(), $info);
$do_redirect = false;
}
if (is_a($result, 'PEAR_Error')) {
case 'hours':
$emptype = Hermes::getEmployeesType('enum');
$clients = Hermes::listClients();
- $hours = $GLOBALS['hermes']->getHours($params);
+ $hours = $GLOBALS['hermes']->driver->getHours($params);
$yesno = array(1 => _("Yes"),
0 => _("No"));
{
switch ($name) {
case 'hours':
- $time_data = $GLOBALS['hermes']->getHours($params);
+ $time_data = $GLOBALS['hermes']->driver->getHours($params);
if (is_a($time_data, 'PEAR_Error')) {
return $time_data;
}
return array();
}
- $deliverables = $GLOBALS['hermes']->listDeliverables($criteria);
+ $deliverables = $GLOBALS['hermes']->driver->listDeliverables($criteria);
if (is_a($deliverables, 'PEAR_Error')) {
return PEAR::raiseError(sprintf(_("An error occurred retrieving deliverables: %s"), $deliverables->getMessage()));
}
*/
function listJobTypes($criteria = array())
{
- return $GLOBALS['hermes']->listJobTypes($criteria);
+ return $GLOBALS['hermes']->driver->listJobTypes($criteria);
}
function listClients()
$form->useToken(false);
if ($form->validate($vars)) {
$form->getInfo($vars, $info);
- $result = $GLOBALS['hermes']->enterTime(Horde_Auth::getAuth(), $info);
+ $result = $GLOBALS['hermes']->driver->enterTime($GLOBALS['registry']->getAuth(), $info);
if (is_a($result, 'PEAR_Error')) {
return $result;
} else {
/**
* Driver object for reading/writing time entries
*/
- static protected $driver = null;
+ static public $driver = null;
/**
* TODO
$sql .= ' ORDER BY timeslice_date DESC, clientjob_id';
- Horde::logMessage($sql, __FILE__, __LINE__, PEAR_LOG_DEBUG);
+ Horde::logMessage($sql, 'DEBUG');
$hours = $this->_db->getAll($sql, DB_FETCHMODE_ASSOC);
if (is_a($hours, 'PEAR_Error')) {
return $hours;
$this->addVariable(_("Select the export format"), 'format', 'enum',
true, false, null, array($formats));
- if ($perms->hasPermission('hermes:review', Horde_Auth::getAuth(),
+ if ($perms->hasPermission('hermes:review', $GLOBALS['registry']->getAuth(),
Horde_Perms::EDIT)) {
$yesno = array('yes' => _("Yes"),
'no' => _("No"));
{
parent::Horde_Form($vars, _("Search For Time"));
- if ($GLOBALS['perms']->hasPermission('hermes:review', Horde_Auth::getAuth(), Horde_Perms::SHOW)) {
+ if ($GLOBALS['perms']->hasPermission('hermes:review', $GLOBALS['registry']->getAuth(), Horde_Perms::SHOW)) {
$type = Hermes::getEmployeesType();
$this->addVariable(_("Employees"), 'employees', $type[0], false,
false, null, $type[1]);
$costobjects = array();
foreach ($clients as $client) {
- $criteria = array('user' => Horde_Auth::getAuth(),
+ $criteria = array('user' => $GLOBALS['registry']->getAuth(),
'active' => true,
'client_id' => $client);
$this->getInfo($vars, $info);
$criteria = array();
- if ($GLOBALS['perms']->hasPermission('hermes:review', Horde_Auth::getAuth(), Horde_Perms::SHOW)) {
+ if ($GLOBALS['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']) {
}
}
} else {
- $criteria['employee'] = Horde_Auth::getAuth();
+ $criteria['employee'] = $GLOBALS['registry']->getAuth();
}
if (!empty($info['clients'])) {
$criteria['client'] = $info['clients'];
/* Check to see if any other active applications are exporting cost
* objects to which we might want to bill our time. */
- $criteria = array('user' => Horde_Auth::getAuth(),
+ $criteria = array('user' => $GLOBALS['registry']->getAuth(),
'active' => true);
if (!empty($clientID)) {
$criteria['client_id'] = $clientID;
$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);
$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"), 'search.png', $registry->getImageDir('horde'));
+ $menu->add(Horde::applicationUrl('search.php'), _("_Search"), Horde_Themes::img('search.png'));
if ($conf['time']['deliverables'] && Horde_Auth::isAdmin('hermes:deliverables')) {
$menu->add(Horde::applicationUrl('deliverables.php'), _("_Deliverables"), 'hermes.png');
/* Print. */
if ($conf['menu']['print'] && isset($print_link)) {
- $menu->add($print_link, _("_Print"), 'print.png', $registry->getImageDir('horde'), '_blank', 'popup(this.href); return false;', '__noselection');
+ $menu->add($print_link, _("_Print"), Horde_Themes::img('print.png'), '_blank', 'popup(this.href); return false;', '__noselection');
}
/* Administration. */
- if (Horde_Auth::isAdmin()) {
+ if ($registry->isAdmin()) {
$menu->add(Horde::applicationUrl('admin.php'), _("_Admin"), 'hermes.png');
}
{
global $hermes;
- if ($GLOBALS['perms']->hasPermission('hermes:review', Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
+ if ($GLOBALS['perms']->hasPermission('hermes:review', $GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
return true;
}
$slice = $hours[0];
// We can edit our own time if it hasn't been submitted.
- if ($slice['employee'] == Horde_Auth::getAuth() && !$slice['submitted']) {
+ if ($slice['employee'] == $GLOBALS['registry']->getAuth() && !$slice['submitted']) {
return true;
}
*/
function getEmployeesType($enumtype = 'multienum')
{
- require_once 'Horde/Identity.php';
- $auth = Horde_Auth::singleton($GLOBALS['conf']['auth']['driver']);
+ $auth = $GLOBALS['injector']->getInstance('Horde_Auth');
if (!$auth->capabilities['list']) {
return array('text', array());
}
*/
var $_formVars = array();
- function getMetaData()
+ public function getMetaData()
{
if (is_null($this->_metaData)) {
list($app, $name) = explode('/', $this->_config['name']);
return $this->_metaData;
}
- function _getData($range = null)
+ protected function _getData($range = null)
{
if (is_null($range)) {
$range = array();
*
* @return mixed number of columns or PEAR_Error
*/
- function getColumnCount()
+ public function getColumnCount()
{
$res = $this->getMetaData();
if (is_a($res, 'PEAR_Error')) {
/**
* Render the table.
*/
- function render()
+ public function render($data = null)
{
global $notification;
+++ /dev/null
-<?php
-/**
- * Copyright 2001-2007 Robert E. Coyle <robertecoyle@hotmail.com>
- *
- * See the enclosed file LICENSE for license information (BSD). If you
- * did not receive this file, see http://www.horde.org/licenses/bsdl.php.
- *
- * Hermes base inclusion file.
- *
- * This file brings in all of the dependencies that every Hermes script
- * will need, and sets up objects that all scripts use.
- */
-
-// Check for a prior definition of HORDE_BASE (perhaps by an
-// auto_prepend_file definition for site customization).
-if (!defined('HORDE_BASE')) {
- define('HORDE_BASE', dirname(__FILE__) . '/../..');
-}
-
-// Load the Horde Framework core, and set up inclusion paths.
-require_once HORDE_BASE . '/lib/core.php';
-
-// Registry.
-$registry = Horde_Registry::singleton();
-try {
- $registry->pushApp('hermes', !defined('AUTH_HANDLER'));
-} catch (Horde_Exception $e) {
- if ($e->getCode() == 'permission_denied') {
- Horde::authenticationFailureRedirect();
- }
- Horde::fatal($e, __FILE__, __LINE__, false);
-}
-$conf = &$GLOBALS['conf'];
-define('HERMES_TEMPLATES', $registry->get('templates'));
-$print_link = null;
-
-// Notification system.
-$notification = &Horde_Notification::singleton();
-$notification->attach('status');
-
-// Find the base file path of Hermes.
-if (!defined('HERMES_BASE')) {
- define('HERMES_BASE', dirname(__FILE__) . '/..');
-}
-
-// Hermes base libraries.
-require_once HERMES_BASE . '/lib/Hermes.php';
-$GLOBALS['hermes'] = &Hermes::getDriver();
-
-// Horde libraries.
-require_once 'Horde/Form.php';
-require_once 'Horde/Form/Renderer.php';
-require_once 'Horde/Template.php';
-
-// Start compression.
-Horde::compressOutput();
echo $filedata;
if (!empty($info['mark_exported']) &&
$info['mark_exported'] == 'yes' &&
- $perms->hasPermission('hermes:review', Horde_Auth::getAuth(),
+ $perms->hasPermission('hermes:review', $GLOBALS['registry']->getAuth(),
Horde_Perms::EDIT)) {
$hermes->driver->markAs('exported', $hours);
}
?>
<title><?php echo htmlspecialchars($page_title) ?></title>
-<link href="<?php echo $GLOBALS['registry']->getImageDir()?>/favicon.ico" rel="SHORTCUT ICON" />
-<?php Horde::includeStylesheetFiles() ?>
+<link href="<?php echo Horde_Themes::img('favicon.ico', array('nohorde' => true)) ?>" rel="SHORTCUT ICON" />
+<?php Horde_Themes::includeStylesheetFiles() ?>
</head>
<body<?php if ($bc = Horde_Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Horde_Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
// We are displaying all time.
$tabs = Hermes::tabs();
-$criteria = array('employee' => Horde_Auth::getAuth(),
+$criteria = array('employee' => $GLOBALS['registry']->getAuth(),
'submitted' => false,
'link_page' => 'time.php');
$table = new Horde_Ui_Table('week', $vars,