Remove cruft/@since/CVS tags; autoloading
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 19 Jan 2009 06:59:52 +0000 (23:59 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 19 Jan 2009 06:59:52 +0000 (23:59 -0700)
62 files changed:
kronolith/add.php
kronolith/attend.php
kronolith/attendees.php
kronolith/contacts.php
kronolith/data.php
kronolith/day.php
kronolith/delete.php
kronolith/edit.php
kronolith/event.php
kronolith/fb.php
kronolith/ics.php
kronolith/imple.php
kronolith/index.php
kronolith/lib/Day.php
kronolith/lib/Driver.php
kronolith/lib/Driver/holidays.php
kronolith/lib/Driver/ical.php
kronolith/lib/Driver/kolab.php
kronolith/lib/Driver/sql.php
kronolith/lib/FBView.php [deleted file]
kronolith/lib/FBView/day.php [deleted file]
kronolith/lib/FBView/month.php [deleted file]
kronolith/lib/FBView/week.php [deleted file]
kronolith/lib/FBView/workweek.php [deleted file]
kronolith/lib/Forms/CreateCalendar.php
kronolith/lib/Forms/DeleteCalendar.php
kronolith/lib/Forms/EditCalendar.php
kronolith/lib/Forms/EditRemoteCalendar.php
kronolith/lib/Forms/SubscribeRemoteCalendar.php
kronolith/lib/Forms/UnsubscribeRemoteCalendar.php
kronolith/lib/FreeBusy.php
kronolith/lib/FreeBusy/FreeBusy.php [new file with mode: 0644]
kronolith/lib/FreeBusy/View/Day.php [new file with mode: 0644]
kronolith/lib/FreeBusy/View/Month.php [new file with mode: 0644]
kronolith/lib/FreeBusy/View/Week.php [new file with mode: 0644]
kronolith/lib/FreeBusy/View/Workweek.php [new file with mode: 0644]
kronolith/lib/Imple.php
kronolith/lib/Imple/ContactAutoCompleter.php
kronolith/lib/Imple/Embed.php
kronolith/lib/Kronolith.php
kronolith/lib/Maintenance/kronolith.php
kronolith/lib/Views/Day.php
kronolith/lib/Views/DeleteEvent.php
kronolith/lib/Views/EditEvent.php
kronolith/lib/Views/Event.php
kronolith/lib/Views/ExportEvent.php
kronolith/lib/Views/Month.php
kronolith/lib/Views/Week.php
kronolith/lib/Views/WorkWeek.php
kronolith/lib/Views/Year.php
kronolith/lib/api.php
kronolith/lib/base.php
kronolith/lib/prefs.php
kronolith/month.php
kronolith/new.php
kronolith/perms.php
kronolith/pref_api.php
kronolith/search.php
kronolith/view.php
kronolith/week.php
kronolith/workweek.php
kronolith/year.php

index 09b236d..50e2500 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * $Horde: kronolith/add.php,v 1.7 2009/01/06 18:00:59 jan Exp $
- *
  * Copyright 1999-2009 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file COPYING for license information (GPL). If you
index e3c5d5b..53e0499 100644 (file)
@@ -1,13 +1,12 @@
 <?php
 /**
- * $Horde: kronolith/attend.php,v 1.11 2009/01/06 18:00:59 jan Exp $
- *
  * Copyright 2005-2009 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file COPYING for license information (GPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  *
- * @author Jan Schneider <jan@horde.org>
+ * @author  Jan Schneider <jan@horde.org>
+ * @package Kronolith
  */
 
 @define('AUTH_HANDLER', true);
index c4341ae..841066d 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * $Horde: kronolith/attendees.php,v 1.47 2009/01/07 13:05:20 jan Exp $
- *
  * Copyright 2004-2007 Code Fusion  <http://www.codefusion.co.za/>
  * Copyright 2004-2007 Stuart Binge <s.binge@codefusion.co.za>
  *
@@ -11,11 +9,7 @@
 
 @define('KRONOLITH_BASE', dirname(__FILE__));
 require_once KRONOLITH_BASE . '/lib/base.php';
-require_once KRONOLITH_BASE . '/lib/FreeBusy.php';
-require_once KRONOLITH_BASE . '/lib/FBView.php';
-require_once KRONOLITH_BASE . '/lib/Imple.php';
 require_once 'Horde/Identity.php';
-require_once 'Horde/UI/Tabs.php';
 require_once 'Horde/Variables.php';
 
 // Get the current attendees array from the session cache.
@@ -35,7 +29,6 @@ $actionValue = Util::getFormData('actionValue');
 // Perform the specified action, if there is one.
 switch ($actionID) {
 case 'add':
-    require_once 'Mail/RFC822.php';
     $parser = new Mail_RFC822;
     // Add new attendees. Multiple attendees can be seperated on a single line
     // by whitespace and/or commas.
@@ -259,7 +252,7 @@ $date = new Horde_Date($date);
 $vfb_html = $attendee_view->render($date);
 
 // Add the ContactAutoCompleter
-Imple::factory('ContactAutoCompleter', array('triggerId' => 'newAttendees'));
+Kronolith_Imple::factory('ContactAutoCompleter', array('triggerId' => 'newAttendees'));
 
 $title = _("Edit attendees");
 require KRONOLITH_TEMPLATES . '/common-header.inc';
index 19fab94..49dd140 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * $Horde: kronolith/contacts.php,v 1.26 2009/01/06 18:00:59 jan Exp $
- *
  * Copyright 2002-2009 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file COPYING for license information (GPL). If you
index 53e63e1..2cdb82d 100644 (file)
@@ -1,13 +1,12 @@
 <?php
 /**
- * $Horde: kronolith/data.php,v 1.97 2009/01/06 18:00:59 jan Exp $
- *
  * Copyright 2001-2009 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file COPYING for license information (GPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  *
- * @author Jan Schneider <jan@horde.org>
+ * @author  Jan Schneider <jan@horde.org>
+ * @package Kronolith
  */
 
 function _cleanup()
@@ -19,7 +18,6 @@ function _cleanup()
 
 @define('KRONOLITH_BASE', dirname(__FILE__));
 require_once KRONOLITH_BASE . '/lib/base.php';
-require_once 'Horde/Data.php';
 
 if (!$conf['menu']['import_export']) {
     require KRONOLITH_BASE . '/index.php';
@@ -160,7 +158,6 @@ case 'export':
 
     case EXPORT_ICALENDAR:
         require_once 'Horde/Identity.php';
-        require_once 'Horde/iCalendar.php';
         $iCal = new Horde_iCalendar();
 
         $calNames = array();
index a2696db..9b52da0 100644 (file)
@@ -1,13 +1,12 @@
 <?php
 /**
- * $Horde: kronolith/day.php,v 1.79 2009/01/06 18:00:59 jan Exp $
- *
  * Copyright 1999-2009 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file COPYING for license information (GPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  *
- * @author Chuck Hagenbuch <chuck@horde.org>
+ * @author  Chuck Hagenbuch <chuck@horde.org>
+ * @package Kronolith
  */
 
 require_once dirname(__FILE__) . '/lib/base.php';
index 49a7df2..c64007d 100644 (file)
@@ -1,13 +1,12 @@
 <?php
 /**
- * $Horde: kronolith/delete.php,v 1.15 2009/01/06 18:00:59 jan Exp $
- *
  * Copyright 1999-2009 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file COPYING for license information (GPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  *
- * @author Chuck Hagenbuch <chuck@horde.org>
+ * @author  Chuck Hagenbuch <chuck@horde.org>
+ * @package Kronolith
  */
 
 @define('KRONOLITH_BASE', dirname(__FILE__));
index 304b35f..c4a793c 100644 (file)
@@ -1,13 +1,12 @@
 <?php
 /**
- * $Horde: kronolith/edit.php,v 1.13 2009/01/06 18:00:59 jan Exp $
- *
  * Copyright 1999-2009 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file COPYING for license information (GPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  *
- * @author Chuck Hagenbuch <chuck@horde.org>
+ * @author  Chuck Hagenbuch <chuck@horde.org>
+ * @package Kronolith
  */
 
 function _save(&$event)
index 0076994..87601ea 100644 (file)
@@ -1,13 +1,12 @@
 <?php
 /**
- * $Horde: kronolith/event.php,v 1.12 2009/01/06 18:00:59 jan Exp $
- *
  * Copyright 1999-2009 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file COPYING for license information (GPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  *
- * @author Chuck Hagenbuch <chuck@horde.org>
+ * @author  Chuck Hagenbuch <chuck@horde.org>
+ * @package Kronolith
  */
 
 @define('KRONOLITH_BASE', dirname(__FILE__));
index f84a18a..55a48db 100644 (file)
@@ -1,21 +1,18 @@
 <?php
 /**
- * $Horde: kronolith/fb.php,v 1.43 2009/01/06 18:00:59 jan Exp $
- *
  * Copyright 1999-2009 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file COPYING for license information (GPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  *
- * @author Chuck Hagenbuch <chuck@horde.org>
+ * @author  Chuck Hagenbuch <chuck@horde.org>
+ * @package Kronolith
  */
 
 @define('AUTH_HANDLER', true);
 @define('KRONOLITH_BASE', dirname(__FILE__));
 $session_control = 'none';
 require_once KRONOLITH_BASE . '/lib/base.php';
-require_once KRONOLITH_BASE . '/lib/FreeBusy.php';
-require_once 'Horde/Cache.php';
 
 // We want to always generate UTF-8 iCalendar data.
 NLS::setCharset('UTF-8');
index 2da105b..180f4c3 100644 (file)
@@ -1,21 +1,18 @@
 <?php
 /**
- * $Horde: kronolith/ics.php,v 1.23 2009/01/06 18:00:59 jan Exp $
- *
  * Copyright 1999-2009 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file COPYING for license information (GPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  *
- * @author Chuck Hagenbuch <chuck@horde.org>
+ * @author  Chuck Hagenbuch <chuck@horde.org>
+ * @package Kronolith
  */
 
 @define('AUTH_HANDLER', true);
 @define('KRONOLITH_BASE', dirname(__FILE__));
 $session_control = 'none';
 require_once KRONOLITH_BASE . '/lib/base.php';
-require_once 'Horde/Cache.php';
-require_once 'Horde/iCalendar.php';
 
 // We want to always generate UTF-8 iCalendar data.
 NLS::setCharset('UTF-8');
index 96c9634..46b468d 100644 (file)
@@ -12,7 +12,6 @@
 
 @define('KRONOLITH_BASE', dirname(__FILE__));
 require_once KRONOLITH_BASE . '/lib/base.php';
-require_once KRONOLITH_BASE . '/lib/Imple.php';
 
 $path = Util::getFormData('imple');
 if (!$path) {
@@ -24,7 +23,7 @@ if ($path[0] == '/') {
 $path = explode('/', $path);
 $impleName = array_shift($path);
 
-$imple = Imple::factory($impleName);
+$imple = Kronolith_Imple::factory($impleName);
 if (!$imple) {
     exit;
 }
@@ -50,7 +49,6 @@ if (!empty($_SERVER['Content-Type'])) {
 switch ($ct) {
 case 'json':
     header('Content-Type: application/json');
-    require_once 'Horde/Serialize.php';
     echo Horde_Serialize::serialize($result, SERIALIZE_JSON, NLS::getCharset());
     break;
 
index e2771a1..f01badf 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * $Horde: kronolith/index.php,v 1.35 2009/01/06 18:00:59 jan Exp $
- *
  * Copyright 1999-2009 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file COPYING for license information (GPL). If you
index 3f1aa03..10c46c8 100644 (file)
@@ -2,10 +2,7 @@
 /**
  * The Kronolith_Day:: class provides an API for dealing with days.
  *
- * $Horde: kronolith/lib/Day.php,v 1.32 2008/10/13 23:00:16 jan Exp $
- *
  * @author  Chuck Hagenbuch <chuck@horde.org>
- * @since   Kronolith 0.1
  * @package Kronolith
  */
 class Kronolith_Day extends Horde_Date {
index 03e7ff5..de218bc 100644 (file)
@@ -3,11 +3,8 @@
  * Kronolith_Driver defines an API for implementing storage backends for
  * Kronolith.
  *
- * $Horde: kronolith/lib/Driver.php,v 1.303 2008/10/24 21:10:06 jan Exp $
- *
  * @author  Chuck Hagenbuch <chuck@horde.org>
  * @author  Jan Schneider <jan@horde.org>
- * @since   Kronolith 0.1
  * @package Kronolith
  */
 class Kronolith_Driver {
@@ -54,8 +51,6 @@ class Kronolith_Driver {
     /**
      * Returns a configuration for this driver.
      *
-     * @since Kronolith 3.0
-     *
      * @param string $param  A parameter name.
      *
      * @return mixed  The parameter value or null if not set.
@@ -275,7 +270,6 @@ class Kronolith_Driver {
  *
  * @author  Chuck Hagenbuch <chuck@horde.org>
  * @author  Jan Schneider <jan@horde.org>
- * @since   Kronolith 0.1
  * @package Kronolith
  */
 class Kronolith_Event {
@@ -422,8 +416,6 @@ class Kronolith_Event {
     /**
      * Whether this is an all-day event.
      *
-     * @since Kronolith 3.0
-     *
      * @var boolean
      */
     var $allday = false;
@@ -561,7 +553,6 @@ class Kronolith_Event {
             if ($alarm) {
                 $alarm['start'] = new Horde_Date($alarm['start']);
                 $alarm['end'] = new Horde_Date($alarm['end']);
-                require_once 'Horde/Alarm.php';
                 $horde_alarm = Horde_Alarm::factory();
                 $horde_alarm->set($alarm);
             }
@@ -1301,7 +1292,6 @@ class Kronolith_Event {
         }
 
         if ($this->start && $this->end) {
-            require_once 'Date/Calc.php';
             $dur_day_match = Date_Calc::dateDiff($this->start->mday,
                                                  $this->start->month,
                                                  $this->start->year,
@@ -2152,7 +2142,6 @@ class Kronolith_Event {
         }
 
         if (!$this->_varRenderer) {
-            require_once 'Horde/UI/VarRenderer.php';
             $this->_varRenderer = Horde_UI_VarRenderer::factory('html');
         }
 
index c5a7b99..554e5fb 100644 (file)
@@ -3,12 +3,9 @@
  * The Kronolith_Driver_holidays implements support for the PEAR package
  * Date_Holidays.
  *
- * $Horde: kronolith/lib/Driver/holidays.php,v 1.13 2008/11/15 15:43:24 jan Exp $
- *
  * @see     http://pear.php.net/packages/Date_Holidays
  * @author  Stephan Hohmann <webmaster@dasourcerer.net>
  * @package Kronolith
- * @since   Kronolith 2.2
  */
 
 class Kronolith_Driver_holidays extends Kronolith_Driver {
index 98935e8..fb31ad1 100644 (file)
@@ -3,10 +3,7 @@
  * The Kronolith_Driver_ical:: class implements the Kronolith_Driver
  * API for iCalendar data.
  *
- * $Horde: kronolith/lib/Driver/ical.php,v 1.11 2008/04/30 21:32:13 chuck Exp $
- *
  * @author  Chuck Hagenbuch <chuck@horde.org>
- * @since   Kronolith 2.0
  * @package Kronolith
  */
 class Kronolith_Driver_ical extends Kronolith_Driver {
index 7d52d84..dc8163d 100644 (file)
@@ -5,9 +5,8 @@ require_once 'Horde/Identity.php';
 
 /**
  * Horde Kronolith driver for the Kolab IMAP Server.
- * Copyright 2004-2009 The Horde Project (http://www.horde.org/)
  *
- * $Horde: kronolith/lib/Driver/kolab.php,v 1.77 2009/01/06 18:01:01 jan Exp $
+ * Copyright 2004-2009 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file COPYING for license information (LGPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
@@ -15,7 +14,6 @@ require_once 'Horde/Identity.php';
  * @author  Thomas Jarosch <thomas.jarosch@intra2net.com>
  * @author  Gunnar Wrobel <wrobel@pardus.de>
  * @author  Stuart Binge <omicron@mighty.co.za>
- * @since   Kronolith 2.0
  * @package Kronolith
  */
 class Kronolith_Driver_kolab extends Kronolith_Driver {
index b41a8a5..076269b 100644 (file)
@@ -3,11 +3,8 @@
  * The Kronolith_Driver_sql:: class implements the Kronolith_Driver
  * API for a SQL backend.
  *
- * $Horde: kronolith/lib/Driver/sql.php,v 1.214 2008/10/22 21:14:07 jan Exp $
- *
  * @author  Luc Saillard <luc.saillard@fr.alcove.com>
  * @author  Chuck Hagenbuch <chuck@horde.org>
- * @since   Kronolith 0.3
  * @package Kronolith
  */
 class Kronolith_Driver_sql extends Kronolith_Driver {
diff --git a/kronolith/lib/FBView.php b/kronolith/lib/FBView.php
deleted file mode 100644 (file)
index ca4fe58..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-<?php
-
-require_once 'Horde/Template.php';
-
-/**
- * This class represent a view of multiple free busy information sets.
- *
- * Copyright 2003-2009 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information.
- *
- * $Horde: kronolith/lib/FBView.php,v 1.33 2009/01/07 13:05:21 jan Exp $
- *
- * @author  Mike Cochrane <mike@graftonhall.co.nz>
- * @author  Jan Schneider <jan@horde.org>
- * @package Kronolith
- */
-class Kronolith_FreeBusy_View {
-
-    var $_requiredMembers = array();
-    var $_optionalMembers = array();
-    var $_timeBlocks = array();
-
-    var $_startHour;
-    var $_endHour;
-
-    var $_start;
-    var $_end;
-
-    function addRequiredMember($vFreebusy)
-    {
-        $this->_requiredMembers[] = Util::cloneObject($vFreebusy);
-    }
-
-    function addOptionalMember($vFreebusy)
-    {
-        $this->_optionalMembers[] = Util::cloneObject($vFreebusy);
-    }
-
-    function render($day = null)
-    {
-        global $prefs;
-
-        $this->_startHour = floor($prefs->getValue('day_hour_start') / 2);
-        $this->_endHour = floor(($prefs->getValue('day_hour_end') + 1) / 2);
-
-        $this->_render($day);
-
-        require_once 'Horde/iCalendar.php';
-        $vCal = new Horde_iCalendar();
-        $required = &Horde_iCalendar::newComponent('vfreebusy', $vCal);
-        foreach ($this->_requiredMembers as $member) {
-            $required->merge($member, false);
-        }
-        $required->simplify();
-
-        $optional = &Horde_iCalendar::newComponent('vfreebusy', $vCal);
-        foreach ($this->_optionalMembers as $member) {
-            $optional->merge($member, false);
-        }
-        $optional->simplify();
-
-        $optimal = &Horde_iCalendar::newComponent('vfreebusy', $vCal);
-        $optimal->merge($required, false);
-        $optimal->merge($optional);
-
-        $base_url = Horde::selfUrl();
-        $base_url = Util::removeParameter($base_url, 'date');
-        $base_url = Util::removeParameter($base_url, 'fbview');
-        $base_url = Util::addParameter($base_url, 'fbview', $this->view);
-
-        $template = &new Horde_Template();
-        $template->set('title', $this->_title());
-
-        $html = $template->fetch(KRONOLITH_TEMPLATES . '/fbview/header.html') .
-            '<div class="fbgrid">';
-
-        $hours_html = $this->_hours();
-
-        // Set C locale to avoid localized decimal separators during CSS width
-        // calculation.
-        $lc = setlocale(LC_NUMERIC, 0);
-        setlocale(LC_NUMERIC, 'C');
-
-        // Required to attend.
-        if (count($this->_requiredMembers) > 0) {
-            $template = new Horde_Template();
-            $rows = '';
-            foreach ($this->_requiredMembers as $member) {
-                $member->simplify();
-                $blocks = $this->_getBlocks($member, $member->getBusyPeriods(), 'busyblock.html', _("Busy"));
-                $template = new Horde_Template();
-                $template->set('blocks', $blocks);
-                $template->set('name', $member->getName());
-                $rows .= $template->fetch(KRONOLITH_TEMPLATES . '/fbview/row.html');
-            }
-
-            $template = new Horde_Template();
-            $template->set('title', _("Required Attendees"));
-            $template->set('rows', $rows);
-            $template->set('span', count($this->_timeBlocks));
-            $template->set('hours', $hours_html);
-            $template->set('legend', '');
-            $html .= $template->fetch(KRONOLITH_TEMPLATES . '/fbview/section.html');
-        }
-
-        // Optional to attend.
-        if (count($this->_optionalMembers) > 0) {
-            $template = new Horde_Template();
-            $rows = '';
-            foreach ($this->_optionalMembers as $member) {
-                $member->simplify();
-                $blocks = $this->_getBlocks($member, $member->getBusyPeriods(), 'busyblock.html', _("Busy"));
-                $template = new Horde_Template();
-                $template->set('blocks', $blocks);
-                $template->set('name', $member->getName());
-                $rows .= $template->fetch(KRONOLITH_TEMPLATES . '/fbview/row.html');
-            }
-
-            $template = new Horde_Template();
-            $template->set('title', _("Optional Attendees"));
-            $template->set('rows', $rows);
-            $template->set('span', count($this->_timeBlocks));
-            $template->set('hours', $hours_html);
-            $template->set('legend', '');
-            $html .= $template->fetch(KRONOLITH_TEMPLATES . '/fbview/section.html');
-        }
-
-        // Possible meeting times.
-        $optimal->setAttribute('ORGANIZER', _("All Attendees"));
-        $blocks = $this->_getBlocks($optimal,
-                                    $optimal->getFreePeriods($this->_start->timestamp(), $this->_end->timestamp()),
-                                    'meetingblock.html', _("All Attendees"));
-
-        $template = new Horde_Template();
-        $template->set('name', _("All Attendees"));
-        $template->set('blocks', $blocks);
-        $rows = $template->fetch(KRONOLITH_TEMPLATES . '/fbview/row.html');
-
-        // Possible meeting times.
-        $required->setAttribute('ORGANIZER', _("Required Attendees"));
-        $blocks = $this->_getBlocks($required,
-                                    $required->getFreePeriods($this->_start->timestamp(), $this->_end->timestamp()),
-                                    'meetingblock.html', _("Required Attendees"));
-
-        $template = new Horde_Template();
-        $template->set('name', _("Required Attendees"));
-        $template->set('blocks', $blocks);
-        $rows .= $template->fetch(KRONOLITH_TEMPLATES . '/fbview/row.html');
-
-        // Reset locale.
-        setlocale(LC_NUMERIC, $lc);
-
-        $template = new Horde_Template();
-        $template->set('rows', $rows);
-        $template->set('title', _("Overview"));
-        $template->set('span', count($this->_timeBlocks));
-        $template->set('hours', $hours_html);
-        if ($prefs->getValue('show_fb_legend')) {
-            $template->setOption('gettext', true);
-            $template->set('legend', $template->fetch(KRONOLITH_TEMPLATES . '/fbview/legend.html'));
-        } else {
-            $template->set('legend', '');
-        }
-
-        return $html . $template->fetch(KRONOLITH_TEMPLATES . '/fbview/section.html') . '</div>';
-    }
-
-    /**
-     * Attempts to return a concrete Kronolith_FreeBusy_View instance based on
-     * $view.
-     *
-     * @param string $view  The type of concrete Kronolith_FreeBusy_View
-     *                      subclass to return.
-     *
-     * @return mixed  The newly created concrete Kronolith_FreeBusy_View
-     *                instance, or false on an error.
-     */
-    function factory($view)
-    {
-        $driver = basename($view);
-        require_once dirname(__FILE__) . '/FBView/' . $driver . '.php';
-        $class = 'Kronolith_FreeBusy_View_' . $driver;
-        if (class_exists($class)) {
-            return new $class($user, $params);
-        }
-
-        return false;
-    }
-
-    /**
-     * Attempts to return a reference to a concrete Kronolith_FreeBusy_View
-     * instance based on $view.  It will only create a new instance if no
-     * Kronolith_FreeBusy_View instance with the same parameters currently
-     * exists.
-     *
-     * This method must be invoked as:
-     * $var = &Kronolith_FreeBusy_View::singleton()
-     *
-     * @param string $view  The type of concrete Kronolith_FreeBusy_View
-     *                      subclass to return.
-     *
-     * @return mixed  The created concrete Kronolith_FreeBusy_View instance, or
-     *                false on an error.
-     */
-    function &singleton($view)
-    {
-        static $instances = array();
-
-        if (!isset($instances[$view])) {
-            $instances[$view] = Kronolith_FreeBusy_View::factory($view);
-        }
-
-        return $instances[$view];
-    }
-
-    function _getBlocks($member, $periods, $blockfile, $label)
-    {
-        $template = new Horde_Template();
-        $template->set('label', $label);
-
-        reset($periods);
-        list($periodStart, $periodEnd) = each($periods);
-
-        $blocks = '';
-        foreach ($this->_timeBlocks as $span) {
-            /* Horde_iCalendar_vfreebusy only supports timestamps at the
-             * moment. */
-            $start = $span[0]->timestamp();
-            $end = $span[1]->timestamp();
-            if ($member->getStart() > $start ||
-                $member->getEnd() < $end) {
-                $blocks .= $template->fetch(KRONOLITH_TEMPLATES . '/fbview/unknownblock.html');
-                continue;
-            }
-
-            while ($start > $periodEnd &&
-                   list($periodStart, $periodEnd) = each($periods));
-
-            if (($periodStart <= $start && $periodEnd >= $start) ||
-                ($periodStart <= $end && $periodEnd >= $end) ||
-                ($periodStart <= $start && $periodEnd >= $end) ||
-                ($periodStart >= $start && $periodEnd <= $end)) {
-
-                $l_start = ($periodStart < $start) ? $start : $periodStart;
-                $l_end = ($periodEnd > $end) ? $end : $periodEnd;
-                $plen = ($end - $start) / 100.0;
-
-                $left = ($l_start - $start) / $plen;
-                $width = ($l_end - $l_start) / $plen;
-
-                $template->set('left', $left . '%');
-                $template->set('width', $width . '%');
-
-                $blocks .= $template->fetch(KRONOLITH_TEMPLATES . '/fbview/' . $blockfile);
-            } else {
-                $blocks .= $template->fetch(KRONOLITH_TEMPLATES . '/fbview/emptyblock.html');
-            }
-        }
-
-        return $blocks;
-    }
-
-}
diff --git a/kronolith/lib/FBView/day.php b/kronolith/lib/FBView/day.php
deleted file mode 100644 (file)
index ea08e5f..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<?php
-/**
- * This class represent a single day of free busy information sets.
- *
- * Copyright 2003-2009 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information.
- *
- * $Horde: kronolith/lib/FBView/day.php,v 1.30 2009/01/07 12:39:13 jan Exp $
- *
- * @author  Mike Cochrane <mike@graftonhall.co.nz>
- * @author  Jan Schneider <jan@horde.org>
- * @package Kronolith
- */
-class Kronolith_FreeBusy_View_day extends Kronolith_FreeBusy_View {
-
-    var $view = 'day';
-
-    function _title()
-    {
-        global $registry, $prefs;
-
-        $prev = new Horde_Date($this->_start);
-        $prev->mday--;
-        $prev->correct();
-        $next = new Horde_Date($this->_start);
-        $next->mday++;
-        $next->correct();
-        return Horde::link('#', _("Previous Day"), '', '', 'return switchDate(' . $prev->dateString() . ');')
-            . Horde::img('nav/left.png', '<', null, $registry->getImageDir('horde'))
-            . '</a>'
-            . $this->_start->strftime($prefs->getValue('date_format'))
-            . Horde::link('#', _("Next Day"), '', '', 'return switchDate(' . $next->dateString() . ');')
-            . Horde::img('nav/right.png', '>', null, $registry->getImageDir('horde'))
-            . '</a>';
-    }
-
-    function _hours()
-    {
-        global $prefs;
-
-        $hours_html = '';
-        $width = round(100 / ($this->_endHour - $this->_startHour + 1));
-        $start = new Horde_Date($this->_start);
-        $end = new Horde_Date($this->_start);
-        $end->min = 59;
-        for ($i = $this->_startHour; $i < $this->_endHour; $i++) {
-            $start->hour = $end->hour = $i;
-            $this->_timeBlocks[] = array(clone $start, clone $end);
-            $hours_html .= '<th width="' . $width . '%">' . $start->strftime($prefs->getValue('twentyFour') ? '%H:00' : '%I:00') . '</th>';
-        }
-
-        return $hours_html;
-    }
-
-    function _render($day = null)
-    {
-        $this->_start = new Horde_Date($day);
-        $this->_start->hour = $this->_startHour;
-        $this->_end = new Horde_Date($this->_start);
-        $this->_end->hour = $this->_endHour;
-    }
-
-}
diff --git a/kronolith/lib/FBView/month.php b/kronolith/lib/FBView/month.php
deleted file mode 100644 (file)
index cecda70..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-<?php
-/**
- * This class represent a month of free busy information sets.
- *
- * Copyright 2004-2009 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information.
- *
- * $Horde: kronolith/lib/FBView/month.php,v 1.8 2009/01/06 18:01:01 jan Exp $
- *
- * @author  Gunnar Wrobel <wrobel@pardus.de>
- * @author  Jan Schneider <jan@horde.org>
- * @package Kronolith
- */
-class Kronolith_FreeBusy_View_month extends Kronolith_FreeBusy_View {
-
-    var $view = 'month';
-    var $_days = 30;
-
-    function _title()
-    {
-        global $registry, $prefs;
-
-        $end = new Horde_Date($this->_start);
-        $end->mday += $this->_days - 1;
-        $end->correct();
-        $prev = new Horde_Date($this->_start);
-        $prev->month--;
-        $prev->correct();
-        $next = new Horde_Date($this->_start);
-        $next->month++;
-        $next->correct();
-        return Horde::link('#', _("Previous Month"), '', '', 'return switchDate(' . $prev->dateString() . ');')
-            . Horde::img('nav/left.png', '<', null, $registry->getImageDir('horde'))
-            . '</a>'
-            . $this->_start->strftime('%B %Y')
-            . Horde::link('#', _("Next Month"), '', '', 'return switchDate(' . $next->dateString() . ');')
-            . Horde::img('nav/right.png', '>', null, $registry->getImageDir('horde'))
-            . '</a>';
-    }
-
-    function _hours()
-    {
-        global $prefs;
-
-        $hours_html = '';
-        $dayWidth = round(100 / $this->_days);
-        $date_format = $prefs->getValue('date_format');
-
-        $week = Date_Calc::weekOfYear(1, $this->_start->month, $this->_start->year);
-        $span = (7 - $week) % 7 + 1;
-        $span_left = $this->_days;
-        $t = new Horde_Date($this->_start);
-        while ($span_left > 0) {
-            $span_left -= $span;
-            $week_label = Horde::link('#', '', '', '', 'return switchDateView(\'week\',' . $t->dateString() . ');') . ("Week") . ' ' . $week . '</a>';
-            $hours_html .= sprintf('<th colspan="%d" width="%s%%">%s</th>',
-                                   $span, $dayWidth, $week_label);
-            $week++;
-            $t->mday += 7;
-            $t->correct();
-            $span = min($span_left, 7);
-        }
-        $hours_html .= '</tr><tr><td width="100" class="label">&nbsp;</td>';
-
-        for ($i = 0; $i < $this->_days; $i++) {
-            $t = new Horde_Date(array('month' => $this->_start->month,
-                                      'mday' => $this->_start->mday + $i,
-                                      'year' => $this->_start->year));
-            $day_label = Horde::link('#', '', '', '', 'return switchDateView(\'day\',' . $t->dateString() . ');') . sprintf("%s.", $i + 1) . '</a>';
-            $hours_html .= sprintf('<th width="%s%%">%s</th>',
-                                   $dayWidth, $day_label);
-        }
-
-        for ($i = 0; $i < $this->_days; $i++) {
-            $start = new Horde_Date(array('hour' => $this->_startHour,
-                                          'month' => $this->_start->month,
-                                          'mday' => $this->_start->mday + $i,
-                                          'year' => $this->_start->year));
-            $end = new Horde_Date(array('hour' => $this->_endHour,
-                                        'month' => $this->_start->month,
-                                        'mday' => $this->_start->mday + $i,
-                                        'year' => $this->_start->year));
-            $this->_timeBlocks[] = array($start, $end);
-        }
-
-        return $hours_html;
-    }
-
-    function _render($day = null)
-    {
-        $this->_start = new Horde_Date($day);
-        $this->_start->mday = 1;
-        $this->_days = Horde_Date::daysInMonth($day->month, $day->year);
-        $this->_end = new Horde_Date($this->_start);
-        $this->_end->hour = 23;
-        $this->_end->min = $this->_end->sec = 59;
-        $this->_end->mday = $this->_days;
-    }
-
-}
diff --git a/kronolith/lib/FBView/week.php b/kronolith/lib/FBView/week.php
deleted file mode 100644 (file)
index 7347244..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-<?php
-/**
- * This class represent a week of free busy information sets.
- *
- * Copyright 2003-2009 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information.
- *
- * $Horde: kronolith/lib/FBView/week.php,v 1.30 2009/01/06 18:01:01 jan Exp $
- *
- * @author  Mike Cochrane <mike@graftonhall.co.nz>
- * @author  Jan Schneider <jan@horde.org>
- * @package Kronolith
- */
-class Kronolith_FreeBusy_View_week extends Kronolith_FreeBusy_View {
-
-    var $view = 'week';
-    var $_days = 7;
-
-    function _title()
-    {
-        global $registry, $prefs;
-
-        $prev = new Horde_Date($this->_start);
-        $prev->mday -= 7;
-        $prev->correct();
-        $next = new Horde_Date($this->_start);
-        $next->mday += 7;
-        $next->correct();
-        $end = new Horde_Date($this->_start);
-        $end->mday += $this->_days - 1;
-        $end->correct();
-        return Horde::link('#', _("Previous Week"), '', '', 'return switchDate(' . $prev->dateString() . ');')
-            . Horde::img('nav/left.png', '<', null, $registry->getImageDir('horde'))
-            . '</a>'
-            . $this->_start->strftime($prefs->getValue('date_format')) . ' - '
-            . $end->strftime($prefs->getValue('date_format'))
-            . Horde::link('#', _("Next Week"), '', '', 'return switchDate(' . $next->dateString() . ');') .
-            Horde::img('nav/right.png', '>', null, $registry->getImageDir('horde')) .
-            '</a>';
-    }
-
-    function _hours()
-    {
-        global $prefs;
-
-        $hours_html = '';
-        $dayWidth = round(100 / $this->_days);
-        $span = floor(($this->_endHour - $this->_startHour) / 3);
-        if (($this->_endHour - $this->_startHour) % 3) {
-            $span++;
-        }
-        $date_format = $prefs->getValue('date_format');
-        for ($i = 0; $i < $this->_days; $i++) {
-            $t = new Horde_Date(array('month' => $this->_start->month,
-                                      'mday' => $this->_start->mday + $i,
-                                      'year' => $this->_start->year));
-            $t->correct();
-            $day_label = Horde::link('#', '', '', '', 'return switchDateView(\'day\',' . $t->dateString() . ');') . $t->strftime($date_format) . '</a>';
-            $hours_html .= sprintf('<th colspan="%d" width="%s%%">%s</th>',
-                                   $span, $dayWidth, $day_label);
-        }
-        $hours_html .= '</tr><tr><td width="100" class="label">&nbsp;</td>';
-
-        $width = round(100 / ($span * $this->_days));
-        for ($i = 0; $i < $this->_days; $i++) {
-            for ($h = $this->_startHour; $h < $this->_endHour; $h += 3) {
-                $start = new Horde_Date(array('hour' => $h,
-                                              'month' => $this->_start->month,
-                                              'mday' => $this->_start->mday + $i,
-                                              'year' => $this->_start->year));
-                $end = new Horde_Date($start);
-                $end->hour += 2;
-                $end->min = 59;
-                $this->_timeBlocks[] = array($start, $end);
-
-                $hour = $start->strftime($prefs->getValue('twentyFour') ? '%H:00' : '%I:00');
-                $hours_html .= sprintf('<th width="%d%%">%s</th>', $width, $hour);
-            }
-        }
-
-        return $hours_html;
-    }
-
-    function _render($day = null)
-    {
-        $this->_start = new Horde_Date(Date_Calc::beginOfWeek($day->mday, $day->month, $day->year, '%Y%m%d000000'));
-        $this->_end = new Horde_Date($this->_start);
-        $this->_end->hour = 23;
-        $this->_end->min = $this->_end->sec = 59;
-        $this->_end->mday += $this->_days - 1;
-        $this->_end->correct();
-    }
-
-}
diff --git a/kronolith/lib/FBView/workweek.php b/kronolith/lib/FBView/workweek.php
deleted file mode 100644 (file)
index 5f392b5..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-
-require_once dirname(__FILE__) . '/week.php';
-
-/**
- * This class represent a work week of free busy information sets.
- *
- * Copyright 2003-2009 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information.
- *
- * $Horde: kronolith/lib/FBView/workweek.php,v 1.18 2009/01/06 18:01:01 jan Exp $
- *
- * @author  Mike Cochrane <mike@graftonhall.co.nz>
- * @author  Jan Schneider <jan@horde.org>
- * @package Kronolith
- */
-class Kronolith_FreeBusy_View_workweek extends Kronolith_FreeBusy_View_week {
-
-    var $view = 'workweek';
-    var $_days = 5;
-
-}
index 09866fa..e00f705 100644 (file)
@@ -2,8 +2,6 @@
 /**
  * Horde_Form for creating calendars.
  *
- * $Horde: kronolith/lib/Forms/CreateCalendar.php,v 1.2 2007/12/19 17:41:15 chuck Exp $
- *
  * See the enclosed file COPYING for license information (GPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  *
@@ -24,7 +22,6 @@ require_once 'Horde/Form/Renderer.php';
  * creating a calendar.
  *
  * @author  Chuck Hagenbuch <chuck@horde.org>
- * @since   Kronolith 2.2
  * @package Kronolith
  */
 class Kronolith_CreateCalendarForm extends Horde_Form {
index 6239d5c..2235fb0 100644 (file)
@@ -2,8 +2,6 @@
 /**
  * Horde_Form for deleting calendars.
  *
- * $Horde: kronolith/lib/Forms/DeleteCalendar.php,v 1.3 2007/12/20 05:55:31 chuck Exp $
- *
  * See the enclosed file COPYING for license information (GPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  *
@@ -24,7 +22,6 @@ require_once 'Horde/Form/Renderer.php';
  * deleting a calendar.
  *
  * @author  Chuck Hagenbuch <chuck@horde.org>
- * @since   Kronolith 2.2
  * @package Kronolith
  */
 class Kronolith_DeleteCalendarForm extends Horde_Form {
index 8b07eeb..94aefa2 100644 (file)
@@ -2,8 +2,6 @@
 /**
  * Horde_Form for editing calendars.
  *
- * $Horde: kronolith/lib/Forms/EditCalendar.php,v 1.2 2008/11/12 09:16:12 wrobel Exp $
- *
  * See the enclosed file COPYING for license information (GPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  *
@@ -24,7 +22,6 @@ require_once 'Horde/Form/Renderer.php';
  * editing a calendar.
  *
  * @author  Chuck Hagenbuch <chuck@horde.org>
- * @since   Kronolith 2.2
  * @package Kronolith
  */
 class Kronolith_EditCalendarForm extends Horde_Form {
index b43aab9..c4f5621 100644 (file)
@@ -2,8 +2,6 @@
 /**
  * Horde_Form for editing remote calendars.
  *
- * $Horde: kronolith/lib/Forms/EditRemoteCalendar.php,v 1.1 2007/12/19 19:32:33 chuck Exp $
- *
  * See the enclosed file COPYING for license information (GPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  *
@@ -24,7 +22,6 @@ require_once 'Horde/Form/Renderer.php';
  * editing a remote calendar.
  *
  * @author  Chuck Hagenbuch <chuck@horde.org>
- * @since   Kronolith 2.2
  * @package Kronolith
  */
 class Kronolith_EditRemoteCalendarForm extends Horde_Form {
index e304a0a..f49af9d 100644 (file)
@@ -2,8 +2,6 @@
 /**
  * Horde_Form for subscribing to remote calendars.
  *
- * $Horde: kronolith/lib/Forms/SubscribeRemoteCalendar.php,v 1.1 2007/12/19 19:32:33 chuck Exp $
- *
  * See the enclosed file COPYING for license information (GPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  *
@@ -24,7 +22,6 @@ require_once 'Horde/Form/Renderer.php';
  * for subscribing to remote calendars
  *
  * @author  Chuck Hagenbuch <chuck@horde.org>
- * @since   Kronolith 2.2
  * @package Kronolith
  */
 class Kronolith_SubscribeRemoteCalendarForm extends Horde_Form {
index eb1d4e9..6eb34e4 100644 (file)
@@ -2,8 +2,6 @@
 /**
  * Horde_Form for unsubscribing from remote calendars.
  *
- * $Horde: kronolith/lib/Forms/UnsubscribeRemoteCalendar.php,v 1.1 2007/12/19 19:32:34 chuck Exp $
- *
  * See the enclosed file COPYING for license information (GPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  *
@@ -24,7 +22,6 @@ require_once 'Horde/Form/Renderer.php';
  * deleting a calendar.
  *
  * @author  Chuck Hagenbuch <chuck@horde.org>
- * @since   Kronolith 2.2
  * @package Kronolith
  */
 class Kronolith_UnsubscribeRemoteCalendarForm extends Horde_Form {
index 03d79f8..a78f497 100644 (file)
@@ -2,10 +2,7 @@
 /**
  * Free/Busy functionality.
  *
- * $Horde: kronolith/lib/FreeBusy.php,v 1.19 2009/01/07 13:03:55 jan Exp $
- *
  * @author  Chuck Hagenbuch <chuck@horde.org>
- * @since   Kronolith 2.2
  * @package Kronolith
  */
 class Kronolith_FreeBusy {
@@ -29,7 +26,6 @@ class Kronolith_FreeBusy {
         global $kronolith_shares;
 
         require_once 'Horde/Identity.php';
-        require_once 'Horde/iCalendar.php';
         require_once KRONOLITH_BASE . '/lib/version.php';
 
         if (!is_array($calendar)) {
@@ -131,9 +127,6 @@ class Kronolith_FreeBusy {
      */
     function get($email)
     {
-        require_once 'Horde/iCalendar.php';
-        require_once 'Mail/RFC822.php';
-
         /* Properly handle RFC822-compliant email addresses. */
         static $rfc822;
         if (is_null($rfc822)) {
@@ -168,7 +161,6 @@ class Kronolith_FreeBusy {
                 $options = array_merge($options, $GLOBALS['conf']['http']['proxy']);
             }
 
-            require_once 'HTTP/Request.php';
             $http = new HTTP_Request($url, $options);
             if (is_a($response = @$http->sendRequest(), 'PEAR_Error')) {
                 return PEAR::raiseError(sprintf(_("The free/busy url for %s cannot be retrieved."), $email));
diff --git a/kronolith/lib/FreeBusy/FreeBusy.php b/kronolith/lib/FreeBusy/FreeBusy.php
new file mode 100644 (file)
index 0000000..b9181cc
--- /dev/null
@@ -0,0 +1,258 @@
+<?php
+/**
+ * This class represent a view of multiple free busy information sets.
+ *
+ * Copyright 2003-2009 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information.
+ *
+ * @author  Mike Cochrane <mike@graftonhall.co.nz>
+ * @author  Jan Schneider <jan@horde.org>
+ * @package Kronolith
+ */
+class Kronolith_FreeBusy_View {
+
+    var $_requiredMembers = array();
+    var $_optionalMembers = array();
+    var $_timeBlocks = array();
+
+    var $_startHour;
+    var $_endHour;
+
+    var $_start;
+    var $_end;
+
+    function addRequiredMember($vFreebusy)
+    {
+        $this->_requiredMembers[] = Util::cloneObject($vFreebusy);
+    }
+
+    function addOptionalMember($vFreebusy)
+    {
+        $this->_optionalMembers[] = Util::cloneObject($vFreebusy);
+    }
+
+    function render($day = null)
+    {
+        global $prefs;
+
+        $this->_startHour = floor($prefs->getValue('day_hour_start') / 2);
+        $this->_endHour = floor(($prefs->getValue('day_hour_end') + 1) / 2);
+
+        $this->_render($day);
+
+        $vCal = new Horde_iCalendar();
+        $required = &Horde_iCalendar::newComponent('vfreebusy', $vCal);
+        foreach ($this->_requiredMembers as $member) {
+            $required->merge($member, false);
+        }
+        $required->simplify();
+
+        $optional = &Horde_iCalendar::newComponent('vfreebusy', $vCal);
+        foreach ($this->_optionalMembers as $member) {
+            $optional->merge($member, false);
+        }
+        $optional->simplify();
+
+        $optimal = &Horde_iCalendar::newComponent('vfreebusy', $vCal);
+        $optimal->merge($required, false);
+        $optimal->merge($optional);
+
+        $base_url = Horde::selfUrl();
+        $base_url = Util::removeParameter($base_url, 'date');
+        $base_url = Util::removeParameter($base_url, 'fbview');
+        $base_url = Util::addParameter($base_url, 'fbview', $this->view);
+
+        $template = new Horde_Template();
+        $template->set('title', $this->_title());
+
+        $html = $template->fetch(KRONOLITH_TEMPLATES . '/fbview/header.html') .
+            '<div class="fbgrid">';
+
+        $hours_html = $this->_hours();
+
+        // Set C locale to avoid localized decimal separators during CSS width
+        // calculation.
+        $lc = setlocale(LC_NUMERIC, 0);
+        setlocale(LC_NUMERIC, 'C');
+
+        // Required to attend.
+        if (count($this->_requiredMembers) > 0) {
+            $template = new Horde_Template();
+            $rows = '';
+            foreach ($this->_requiredMembers as $member) {
+                $member->simplify();
+                $blocks = $this->_getBlocks($member, $member->getBusyPeriods(), 'busyblock.html', _("Busy"));
+                $template = new Horde_Template();
+                $template->set('blocks', $blocks);
+                $template->set('name', $member->getName());
+                $rows .= $template->fetch(KRONOLITH_TEMPLATES . '/fbview/row.html');
+            }
+
+            $template = new Horde_Template();
+            $template->set('title', _("Required Attendees"));
+            $template->set('rows', $rows);
+            $template->set('span', count($this->_timeBlocks));
+            $template->set('hours', $hours_html);
+            $template->set('legend', '');
+            $html .= $template->fetch(KRONOLITH_TEMPLATES . '/fbview/section.html');
+        }
+
+        // Optional to attend.
+        if (count($this->_optionalMembers) > 0) {
+            $template = new Horde_Template();
+            $rows = '';
+            foreach ($this->_optionalMembers as $member) {
+                $member->simplify();
+                $blocks = $this->_getBlocks($member, $member->getBusyPeriods(), 'busyblock.html', _("Busy"));
+                $template = new Horde_Template();
+                $template->set('blocks', $blocks);
+                $template->set('name', $member->getName());
+                $rows .= $template->fetch(KRONOLITH_TEMPLATES . '/fbview/row.html');
+            }
+
+            $template = new Horde_Template();
+            $template->set('title', _("Optional Attendees"));
+            $template->set('rows', $rows);
+            $template->set('span', count($this->_timeBlocks));
+            $template->set('hours', $hours_html);
+            $template->set('legend', '');
+            $html .= $template->fetch(KRONOLITH_TEMPLATES . '/fbview/section.html');
+        }
+
+        // Possible meeting times.
+        $optimal->setAttribute('ORGANIZER', _("All Attendees"));
+        $blocks = $this->_getBlocks($optimal,
+                                    $optimal->getFreePeriods($this->_start->timestamp(), $this->_end->timestamp()),
+                                    'meetingblock.html', _("All Attendees"));
+
+        $template = new Horde_Template();
+        $template->set('name', _("All Attendees"));
+        $template->set('blocks', $blocks);
+        $rows = $template->fetch(KRONOLITH_TEMPLATES . '/fbview/row.html');
+
+        // Possible meeting times.
+        $required->setAttribute('ORGANIZER', _("Required Attendees"));
+        $blocks = $this->_getBlocks($required,
+                                    $required->getFreePeriods($this->_start->timestamp(), $this->_end->timestamp()),
+                                    'meetingblock.html', _("Required Attendees"));
+
+        $template = new Horde_Template();
+        $template->set('name', _("Required Attendees"));
+        $template->set('blocks', $blocks);
+        $rows .= $template->fetch(KRONOLITH_TEMPLATES . '/fbview/row.html');
+
+        // Reset locale.
+        setlocale(LC_NUMERIC, $lc);
+
+        $template = new Horde_Template();
+        $template->set('rows', $rows);
+        $template->set('title', _("Overview"));
+        $template->set('span', count($this->_timeBlocks));
+        $template->set('hours', $hours_html);
+        if ($prefs->getValue('show_fb_legend')) {
+            $template->setOption('gettext', true);
+            $template->set('legend', $template->fetch(KRONOLITH_TEMPLATES . '/fbview/legend.html'));
+        } else {
+            $template->set('legend', '');
+        }
+
+        return $html . $template->fetch(KRONOLITH_TEMPLATES . '/fbview/section.html') . '</div>';
+    }
+
+    /**
+     * Attempts to return a concrete Kronolith_FreeBusy_View instance based on
+     * $view.
+     *
+     * @param string $view  The type of concrete Kronolith_FreeBusy_View
+     *                      subclass to return.
+     *
+     * @return mixed  The newly created concrete Kronolith_FreeBusy_View
+     *                instance, or false on an error.
+     */
+    function factory($view)
+    {
+        $driver = basename($view);
+        require_once dirname(__FILE__) . '/FBView/' . $driver . '.php';
+        $class = 'Kronolith_FreeBusy_View_' . $driver;
+        if (class_exists($class)) {
+            return new $class($user, $params);
+        }
+
+        return false;
+    }
+
+    /**
+     * Attempts to return a reference to a concrete Kronolith_FreeBusy_View
+     * instance based on $view.  It will only create a new instance if no
+     * Kronolith_FreeBusy_View instance with the same parameters currently
+     * exists.
+     *
+     * This method must be invoked as:
+     * $var = &Kronolith_FreeBusy_View::singleton()
+     *
+     * @param string $view  The type of concrete Kronolith_FreeBusy_View
+     *                      subclass to return.
+     *
+     * @return mixed  The created concrete Kronolith_FreeBusy_View instance, or
+     *                false on an error.
+     */
+    function &singleton($view)
+    {
+        static $instances = array();
+
+        if (!isset($instances[$view])) {
+            $instances[$view] = Kronolith_FreeBusy_View::factory($view);
+        }
+
+        return $instances[$view];
+    }
+
+    function _getBlocks($member, $periods, $blockfile, $label)
+    {
+        $template = new Horde_Template();
+        $template->set('label', $label);
+
+        reset($periods);
+        list($periodStart, $periodEnd) = each($periods);
+
+        $blocks = '';
+        foreach ($this->_timeBlocks as $span) {
+            /* Horde_iCalendar_vfreebusy only supports timestamps at the
+             * moment. */
+            $start = $span[0]->timestamp();
+            $end = $span[1]->timestamp();
+            if ($member->getStart() > $start ||
+                $member->getEnd() < $end) {
+                $blocks .= $template->fetch(KRONOLITH_TEMPLATES . '/fbview/unknownblock.html');
+                continue;
+            }
+
+            while ($start > $periodEnd &&
+                   list($periodStart, $periodEnd) = each($periods));
+
+            if (($periodStart <= $start && $periodEnd >= $start) ||
+                ($periodStart <= $end && $periodEnd >= $end) ||
+                ($periodStart <= $start && $periodEnd >= $end) ||
+                ($periodStart >= $start && $periodEnd <= $end)) {
+
+                $l_start = ($periodStart < $start) ? $start : $periodStart;
+                $l_end = ($periodEnd > $end) ? $end : $periodEnd;
+                $plen = ($end - $start) / 100.0;
+
+                $left = ($l_start - $start) / $plen;
+                $width = ($l_end - $l_start) / $plen;
+
+                $template->set('left', $left . '%');
+                $template->set('width', $width . '%');
+
+                $blocks .= $template->fetch(KRONOLITH_TEMPLATES . '/fbview/' . $blockfile);
+            } else {
+                $blocks .= $template->fetch(KRONOLITH_TEMPLATES . '/fbview/emptyblock.html');
+            }
+        }
+
+        return $blocks;
+    }
+
+}
diff --git a/kronolith/lib/FreeBusy/View/Day.php b/kronolith/lib/FreeBusy/View/Day.php
new file mode 100644 (file)
index 0000000..030d71c
--- /dev/null
@@ -0,0 +1,62 @@
+<?php
+/**
+ * This class represent a single day of free busy information sets.
+ *
+ * Copyright 2003-2009 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information.
+ *
+ * @author  Mike Cochrane <mike@graftonhall.co.nz>
+ * @author  Jan Schneider <jan@horde.org>
+ * @package Kronolith
+ */
+class Kronolith_FreeBusy_View_Day extends Kronolith_FreeBusy_View {
+
+    var $view = 'day';
+
+    function _title()
+    {
+        global $registry, $prefs;
+
+        $prev = new Horde_Date($this->_start);
+        $prev->mday--;
+        $prev->correct();
+        $next = new Horde_Date($this->_start);
+        $next->mday++;
+        $next->correct();
+        return Horde::link('#', _("Previous Day"), '', '', 'return switchDate(' . $prev->dateString() . ');')
+            . Horde::img('nav/left.png', '<', null, $registry->getImageDir('horde'))
+            . '</a>'
+            . $this->_start->strftime($prefs->getValue('date_format'))
+            . Horde::link('#', _("Next Day"), '', '', 'return switchDate(' . $next->dateString() . ');')
+            . Horde::img('nav/right.png', '>', null, $registry->getImageDir('horde'))
+            . '</a>';
+    }
+
+    function _hours()
+    {
+        global $prefs;
+
+        $hours_html = '';
+        $width = round(100 / ($this->_endHour - $this->_startHour + 1));
+        $start = new Horde_Date($this->_start);
+        $end = new Horde_Date($this->_start);
+        $end->min = 59;
+        for ($i = $this->_startHour; $i < $this->_endHour; $i++) {
+            $start->hour = $end->hour = $i;
+            $this->_timeBlocks[] = array(clone $start, clone $end);
+            $hours_html .= '<th width="' . $width . '%">' . $start->strftime($prefs->getValue('twentyFour') ? '%H:00' : '%I:00') . '</th>';
+        }
+
+        return $hours_html;
+    }
+
+    function _render($day = null)
+    {
+        $this->_start = new Horde_Date($day);
+        $this->_start->hour = $this->_startHour;
+        $this->_end = new Horde_Date($this->_start);
+        $this->_end->hour = $this->_endHour;
+    }
+
+}
diff --git a/kronolith/lib/FreeBusy/View/Month.php b/kronolith/lib/FreeBusy/View/Month.php
new file mode 100644 (file)
index 0000000..08be008
--- /dev/null
@@ -0,0 +1,99 @@
+<?php
+/**
+ * This class represent a month of free busy information sets.
+ *
+ * Copyright 2004-2009 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information.
+ *
+ * @author  Gunnar Wrobel <wrobel@pardus.de>
+ * @author  Jan Schneider <jan@horde.org>
+ * @package Kronolith
+ */
+class Kronolith_FreeBusy_View_Month extends Kronolith_FreeBusy_View {
+
+    var $view = 'month';
+    var $_days = 30;
+
+    function _title()
+    {
+        global $registry, $prefs;
+
+        $end = new Horde_Date($this->_start);
+        $end->mday += $this->_days - 1;
+        $end->correct();
+        $prev = new Horde_Date($this->_start);
+        $prev->month--;
+        $prev->correct();
+        $next = new Horde_Date($this->_start);
+        $next->month++;
+        $next->correct();
+        return Horde::link('#', _("Previous Month"), '', '', 'return switchDate(' . $prev->dateString() . ');')
+            . Horde::img('nav/left.png', '<', null, $registry->getImageDir('horde'))
+            . '</a>'
+            . $this->_start->strftime('%B %Y')
+            . Horde::link('#', _("Next Month"), '', '', 'return switchDate(' . $next->dateString() . ');')
+            . Horde::img('nav/right.png', '>', null, $registry->getImageDir('horde'))
+            . '</a>';
+    }
+
+    function _hours()
+    {
+        global $prefs;
+
+        $hours_html = '';
+        $dayWidth = round(100 / $this->_days);
+        $date_format = $prefs->getValue('date_format');
+
+        $week = Date_Calc::weekOfYear(1, $this->_start->month, $this->_start->year);
+        $span = (7 - $week) % 7 + 1;
+        $span_left = $this->_days;
+        $t = new Horde_Date($this->_start);
+        while ($span_left > 0) {
+            $span_left -= $span;
+            $week_label = Horde::link('#', '', '', '', 'return switchDateView(\'week\',' . $t->dateString() . ');') . ("Week") . ' ' . $week . '</a>';
+            $hours_html .= sprintf('<th colspan="%d" width="%s%%">%s</th>',
+                                   $span, $dayWidth, $week_label);
+            $week++;
+            $t->mday += 7;
+            $t->correct();
+            $span = min($span_left, 7);
+        }
+        $hours_html .= '</tr><tr><td width="100" class="label">&nbsp;</td>';
+
+        for ($i = 0; $i < $this->_days; $i++) {
+            $t = new Horde_Date(array('month' => $this->_start->month,
+                                      'mday' => $this->_start->mday + $i,
+                                      'year' => $this->_start->year));
+            $day_label = Horde::link('#', '', '', '', 'return switchDateView(\'day\',' . $t->dateString() . ');') . sprintf("%s.", $i + 1) . '</a>';
+            $hours_html .= sprintf('<th width="%s%%">%s</th>',
+                                   $dayWidth, $day_label);
+        }
+
+        for ($i = 0; $i < $this->_days; $i++) {
+            $start = new Horde_Date(array('hour' => $this->_startHour,
+                                          'month' => $this->_start->month,
+                                          'mday' => $this->_start->mday + $i,
+                                          'year' => $this->_start->year));
+            $end = new Horde_Date(array('hour' => $this->_endHour,
+                                        'month' => $this->_start->month,
+                                        'mday' => $this->_start->mday + $i,
+                                        'year' => $this->_start->year));
+            $this->_timeBlocks[] = array($start, $end);
+        }
+
+        return $hours_html;
+    }
+
+    function _render($day = null)
+    {
+        $this->_start = new Horde_Date($day);
+        $this->_start->mday = 1;
+        $this->_days = Horde_Date::daysInMonth($day->month, $day->year);
+        $this->_end = new Horde_Date($this->_start);
+        $this->_end->hour = 23;
+        $this->_end->min = $this->_end->sec = 59;
+        $this->_end->mday = $this->_days;
+    }
+
+}
diff --git a/kronolith/lib/FreeBusy/View/Week.php b/kronolith/lib/FreeBusy/View/Week.php
new file mode 100644 (file)
index 0000000..8310b88
--- /dev/null
@@ -0,0 +1,93 @@
+<?php
+/**
+ * This class represent a week of free busy information sets.
+ *
+ * Copyright 2003-2009 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information.
+ *
+ * @author  Mike Cochrane <mike@graftonhall.co.nz>
+ * @author  Jan Schneider <jan@horde.org>
+ * @package Kronolith
+ */
+class Kronolith_FreeBusy_View_Week extends Kronolith_FreeBusy_View {
+
+    var $view = 'week';
+    var $_days = 7;
+
+    function _title()
+    {
+        global $registry, $prefs;
+
+        $prev = new Horde_Date($this->_start);
+        $prev->mday -= 7;
+        $prev->correct();
+        $next = new Horde_Date($this->_start);
+        $next->mday += 7;
+        $next->correct();
+        $end = new Horde_Date($this->_start);
+        $end->mday += $this->_days - 1;
+        $end->correct();
+        return Horde::link('#', _("Previous Week"), '', '', 'return switchDate(' . $prev->dateString() . ');')
+            . Horde::img('nav/left.png', '<', null, $registry->getImageDir('horde'))
+            . '</a>'
+            . $this->_start->strftime($prefs->getValue('date_format')) . ' - '
+            . $end->strftime($prefs->getValue('date_format'))
+            . Horde::link('#', _("Next Week"), '', '', 'return switchDate(' . $next->dateString() . ');') .
+            Horde::img('nav/right.png', '>', null, $registry->getImageDir('horde')) .
+            '</a>';
+    }
+
+    function _hours()
+    {
+        global $prefs;
+
+        $hours_html = '';
+        $dayWidth = round(100 / $this->_days);
+        $span = floor(($this->_endHour - $this->_startHour) / 3);
+        if (($this->_endHour - $this->_startHour) % 3) {
+            $span++;
+        }
+        $date_format = $prefs->getValue('date_format');
+        for ($i = 0; $i < $this->_days; $i++) {
+            $t = new Horde_Date(array('month' => $this->_start->month,
+                                      'mday' => $this->_start->mday + $i,
+                                      'year' => $this->_start->year));
+            $t->correct();
+            $day_label = Horde::link('#', '', '', '', 'return switchDateView(\'day\',' . $t->dateString() . ');') . $t->strftime($date_format) . '</a>';
+            $hours_html .= sprintf('<th colspan="%d" width="%s%%">%s</th>',
+                                   $span, $dayWidth, $day_label);
+        }
+        $hours_html .= '</tr><tr><td width="100" class="label">&nbsp;</td>';
+
+        $width = round(100 / ($span * $this->_days));
+        for ($i = 0; $i < $this->_days; $i++) {
+            for ($h = $this->_startHour; $h < $this->_endHour; $h += 3) {
+                $start = new Horde_Date(array('hour' => $h,
+                                              'month' => $this->_start->month,
+                                              'mday' => $this->_start->mday + $i,
+                                              'year' => $this->_start->year));
+                $end = new Horde_Date($start);
+                $end->hour += 2;
+                $end->min = 59;
+                $this->_timeBlocks[] = array($start, $end);
+
+                $hour = $start->strftime($prefs->getValue('twentyFour') ? '%H:00' : '%I:00');
+                $hours_html .= sprintf('<th width="%d%%">%s</th>', $width, $hour);
+            }
+        }
+
+        return $hours_html;
+    }
+
+    function _render($day = null)
+    {
+        $this->_start = new Horde_Date(Date_Calc::beginOfWeek($day->mday, $day->month, $day->year, '%Y%m%d000000'));
+        $this->_end = new Horde_Date($this->_start);
+        $this->_end->hour = 23;
+        $this->_end->min = $this->_end->sec = 59;
+        $this->_end->mday += $this->_days - 1;
+        $this->_end->correct();
+    }
+
+}
diff --git a/kronolith/lib/FreeBusy/View/Workweek.php b/kronolith/lib/FreeBusy/View/Workweek.php
new file mode 100644 (file)
index 0000000..fb32a4b
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+/**
+ * This class represent a work week of free busy information sets.
+ *
+ * Copyright 2003-2009 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information.
+ *
+ * @author  Mike Cochrane <mike@graftonhall.co.nz>
+ * @author  Jan Schneider <jan@horde.org>
+ * @package Kronolith
+ */
+class Kronolith_FreeBusy_View_Workweek extends Kronolith_FreeBusy_View_Week {
+
+    var $view = 'workweek';
+    var $_days = 5;
+
+}
index 87ee328..5e975ac 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * $Horde: kronolith/lib/Imple.php,v 1.4 2009/01/06 18:01:00 jan Exp $
- *
  * Copyright 2005-2009 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file COPYING for license information (GPL). If you
@@ -10,7 +8,7 @@
  * @author  Michael Slusarz <slusarz@horde.org>
  * @package Kronolith
  */
-class Imple {
+class Kronolith_Imple {
 
     /**
      * Parameters needed by the subclasses.
index a69cd91..cf2819f 100644 (file)
@@ -8,7 +8,7 @@
  * @author  Michael Slusarz <slusarz@horde.org>
  * @package Kronolith
  */
-class Imple_ContactAutoCompleter extends Imple
+class Kronolith_Imple_ContactAutoCompleter extends Kronolith_Imple
 {
     /**
      * Constructor.
index fed2001..ebc4ec0 100644 (file)
@@ -4,15 +4,13 @@
  * websites. Meant to be called via a single script tag, therefore this will
  * always return nothing but valid javascript.
  *
- * $Horde: kronolith/lib/Imple/Embed.php,v 1.10 2009/01/06 18:01:01 jan Exp $
- *
  * Copyright 2008-2009 The Horde Project (http://www.horde.org/)
  *
  * @author Michael J. Rubinsky <mrubinsk@horde.org>
  *
  * @package Ansel
  */
-class Imple_Embed extends Imple {
+class Kronolith_Imple_Embed extends Kronolith_Imple {
 
     /**
      * Override the parent method since it uses Horde::addScriptFile()
index 96064ed..d46b279 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * $Horde: kronolith/lib/Kronolith.php,v 1.440 2008/11/10 05:07:19 chuck Exp $
- *
  * @package Kronolith
  */
 
@@ -38,7 +36,6 @@ define('PERMS_DELEGATE', 1024);
  * The Kronolith:: class provides functionality common to all of Kronolith.
  *
  * @author  Chuck Hagenbuch <chuck@horde.org>
- * @since   Kronolith 0.1
  * @package Kronolith
  */
 class Kronolith {
@@ -46,8 +43,6 @@ class Kronolith {
     /**
      * Output everything up to but not including the <body> tag.
      *
-     * @since Kronolith 3.0
-     *
      * @param string $title   The title of the page.
      * @param array $scripts  Any additional scripts that need to be loaded.
      *                        Each entry contains the three elements necessary
@@ -109,8 +104,6 @@ class Kronolith {
      * Outputs the javascript code which defines all javascript variables
      * that are dependent on the local user's account.
      *
-     * @since Kronolith 3.0
-     *
      * @private
      *
      * @return string
@@ -119,8 +112,6 @@ class Kronolith {
     {
         global $browser, $conf, $prefs, $registry;
 
-        require_once 'Horde/Serialize.php';
-
         $kronolith_webroot = $registry->get('webroot');
         $horde_webroot = $registry->get('webroot', 'horde');
 
@@ -160,8 +151,6 @@ class Kronolith {
     /**
      * Add inline javascript to the output buffer.
      *
-     * @since Kronolith 2.2
-     *
      * @param mixed $script    The script text to add (can be stored in an
      *                         array also).
      * @param string $onload   Load the script after the page has loaded?
@@ -205,8 +194,6 @@ class Kronolith {
     /**
      * Print inline javascript to the output buffer.
      *
-     * @since Kronolith 2.2
-     *
      * @return string  The javascript text to output.
      */
     function outputInlineScript()
@@ -226,8 +213,6 @@ class Kronolith {
      * Print inline javascript to output buffer after wrapping with necessary
      * javascript tags.
      *
-     * @since Kronolith 3.0
-     *
      * @param array $script  The script to output.
      *
      * @return string  The script with the necessary HTML javascript tags
@@ -241,8 +226,6 @@ class Kronolith {
     /**
      * Outputs the necessary script tags, honoring local configuration choices
      * as to script caching.
-     *
-     * @since Kronolith 3.0
      */
     function includeScriptFiles()
     {
@@ -285,7 +268,6 @@ class Kronolith {
             break;
 
         case 'horde_cache':
-            require_once 'Horde/Cache.php';
             $cache = &Horde_Cache::singleton($conf['cache']['driver'], Horde::getDriverConfig('cache', $conf['cache']['driver']));
             $exists = $cache->exists($sig, empty($conf['server']['cachejsparams']['lifetime']) ? 0 : $conf['server']['cachejsparams']['lifetime']);
             $js_url = Kronolith::getCacheURL('js', $sig);
@@ -327,8 +309,6 @@ class Kronolith {
      * Outputs the necessary style tags, honoring local configuration choices
      * as to stylesheet caching.
      *
-     * @since Kronolith 3.0
-     *
      * @param boolean $print  Include print CSS?
      */
     function includeStylesheetFiles($print = false)
@@ -392,7 +372,6 @@ class Kronolith {
                 break;
 
             case 'horde_cache':
-                require_once 'Horde/Cache.php';
                 $cache = &Horde_Cache::singleton($GLOBALS['conf']['cache']['driver'], Horde::getDriverConfig('cache', $GLOBALS['conf']['cache']['driver']));
                 $exists = $cache->exists($sig, empty($GLOBALS['conf']['server']['cachecssparams']['lifetime']) ? 0 : $GLOBALS['conf']['server']['cachecssparams']['lifetime']);
                 $css_url = Kronolith::getCacheURL('css', $sig);
@@ -431,8 +410,6 @@ class Kronolith {
     /**
      * Creates a URL for cached Kronolith data.
      *
-     * @since Kronolith 3.0
-     *
      * @param string $type  The cache type.
      * @param string $cid   The cache id.
      *
@@ -452,8 +429,6 @@ class Kronolith {
     /**
      * Do garbage collection in the statically served file directory.
      *
-     * @since Kronolith 3.0
-     *
      * @access private
      *
      * @param string $type  Either 'css' or 'js'.
@@ -843,7 +818,6 @@ class Kronolith {
                 $options = array_merge($options, $GLOBALS['conf']['http']['proxy']);
             }
 
-            require_once 'HTTP/Request.php';
             $http = new HTTP_Request($url, $options);
             /* Check for HTTP authentication credentials */
             $cals = unserialize($GLOBALS['prefs']->getValue('remote_cals'));
@@ -895,7 +869,6 @@ class Kronolith {
             return $data;
         }
 
-        require_once 'Horde/iCalendar.php';
         $iCal = new Horde_iCalendar();
         if (!$iCal->parsevCalendar($data)) {
             return array();
@@ -962,7 +935,6 @@ class Kronolith {
             return $data;
         }
 
-        require_once 'Horde/iCalendar.php';
         $iCal = new Horde_iCalendar();
         if (!$iCal->parsevCalendar($data)) {
             return array();
@@ -1919,8 +1891,6 @@ class Kronolith {
             }
 
             /* Build the iCalendar data */
-            require_once 'Horde/Data.php';
-            require_once 'Horde/iCalendar.php';
             $iCal = new Horde_iCalendar();
             $iCal->setAttribute('METHOD', $method);
             $iCal->setAttribute('X-WR-CALNAME', String::convertCharset($share->get('name'), NLS::getCharset(), 'utf-8'));
@@ -2162,8 +2132,6 @@ class Kronolith {
     /**
      * Returns the specified permission for the current user.
      *
-     * @since Kronolith 2.1
-     *
      * @param string $permission  A permission, currently only 'max_events'.
      *
      * @return mixed  The value of the specified permission.
@@ -2196,7 +2164,6 @@ class Kronolith {
         $date = Kronolith::currentDate();
         $date_stamp = $date->dateString();
 
-        require_once 'Horde/UI/Tabs.php';
         require_once 'Horde/Variables.php';
         $tabs = new Horde_UI_Tabs('view', Variables::getDefaultVariables());
         $tabs->preserve('date', $date_stamp);
@@ -2228,7 +2195,6 @@ class Kronolith {
             return;
         }
 
-        require_once 'Horde/UI/Tabs.php';
         require_once 'Horde/Variables.php';
         $tabs = new Horde_UI_Tabs('event', Variables::getDefaultVariables());
 
@@ -2415,7 +2381,6 @@ class Kronolith {
      */
     function foregroundColor($calendar)
     {
-        require_once 'Horde/Image.php';
         return Horde_Image::brightness(Kronolith::backgroundColor($calendar)) < 128 ? '#f6f6f6' : '#000';
     }
 
index 005c1f7..81890e2 100644 (file)
@@ -4,8 +4,6 @@ require_once 'Horde/Maintenance.php';
 require_once $GLOBALS['registry']->get('fileroot', 'kronolith') . '/lib/base.php';
 
 /**
- * $Horde: kronolith/lib/Maintenance/kronolith.php,v 1.2 2009/01/06 18:01:01 jan Exp $
- *
  * The Maintenance_Kronolith class defines the maintenance operations run upon
  * login to Kronolith
  *
@@ -14,7 +12,6 @@ require_once $GLOBALS['registry']->get('fileroot', 'kronolith') . '/lib/base.php
  * See the enclosed file COPYING for license information (GPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  *
- * @since   Kronolith 2.2.1
  * @package Horde_Maintenance
  */
 class Maintenance_Kronolith extends Maintenance {
index 60afd6d..8c0c9a5 100644 (file)
@@ -5,11 +5,8 @@ require_once KRONOLITH_BASE . '/lib/Day.php';
 /**
  * The Kronolith_View_Day:: class provides an API for viewing days.
  *
- * $Horde: kronolith/lib/Views/Day.php,v 1.39 2008/10/21 21:58:29 jan Exp $
- *
  * @author  Chuck Hagenbuch <chuck@horde.org>
  * @author  Jan Schneider <jan@horde.org>
- * @since   Kronolith 0.1
  * @package Kronolith
  */
 class Kronolith_View_Day extends Kronolith_Day {
index 4e0c800..18d1e69 100644 (file)
@@ -3,10 +3,7 @@
  * The Kronolith_View_DeleteEvent:: class provides an API for viewing
  * event delete forms.
  *
- * $Horde: kronolith/lib/Views/DeleteEvent.php,v 1.4 2008/10/13 23:00:18 jan Exp $
- *
  * @author  Chuck Hagenbuch <chuck@horde.org>
- * @since   Kronolith 2.2
  * @package Kronolith
  */
 class Kronolith_View_DeleteEvent {
index f1ca8b5..649fa83 100644 (file)
@@ -3,10 +3,7 @@
  * The Kronolith_View_EditEvent:: class provides an API for viewing
  * event edit forms.
  *
- * $Horde: kronolith/lib/Views/EditEvent.php,v 1.11 2008/10/13 23:00:18 jan Exp $
- *
  * @author  Chuck Hagenbuch <chuck@horde.org>
- * @since   Kronolith 2.2
  * @package Kronolith
  */
 class Kronolith_View_EditEvent {
index af87dc1..2587ed9 100644 (file)
@@ -2,10 +2,7 @@
 /**
  * The Kronolith_View_Event:: class provides an API for viewing events.
  *
- * $Horde: kronolith/lib/Views/Event.php,v 1.12 2008/11/10 05:13:43 chuck Exp $
- *
  * @author  Chuck Hagenbuch <chuck@horde.org>
- * @since   Kronolith 2.2
  * @package Kronolith
  */
 class Kronolith_View_Event {
index e82e8bb..c29e03d 100644 (file)
@@ -3,10 +3,7 @@
  * The Kronolith_View_ExportEvent:: class provides an API for exporting
  * events.
  *
- * $Horde: kronolith/lib/Views/ExportEvent.php,v 1.2 2008/03/14 13:55:05 jan Exp $
- *
  * @author  Jan Schneider <chuck@horde.org>
- * @since   Kronolith 2.2
  * @package Kronolith
  */
 class Kronolith_View_ExportEvent {
index 45ab666..47502e1 100644 (file)
@@ -6,11 +6,8 @@ require_once KRONOLITH_BASE . '/lib/Day.php';
  * The Kronolith_View_Month:: class provides an API for viewing
  * months.
  *
- * $Horde: kronolith/lib/Views/Month.php,v 1.20 2008/10/13 23:00:18 jan Exp $
- *
  * @author  Chuck Hagenbuch <chuck@horde.org>
  * @author  Jan Schneider <jan@horde.org>
- * @since   Kronolith 2.2
  * @package Kronolith
  */
 class Kronolith_View_Month {
index c8963fa..46856af 100644 (file)
@@ -5,11 +5,8 @@ require_once dirname(__FILE__) . '/Day.php';
 /**
  * The Kronolith_View_Week:: class provides an API for viewing weeks.
  *
- * $Horde: kronolith/lib/Views/Week.php,v 1.34 2008/11/03 22:50:06 jan Exp $
- *
  * @author  Chuck Hagenbuch <chuck@horde.org>
  * @author  Jan Schneider <jan@horde.org>
- * @since   Kronolith 0.1
  * @package Kronolith
  */
 class Kronolith_View_Week {
index a3b5272..572dad9 100644 (file)
@@ -6,10 +6,7 @@ require_once dirname(__FILE__) . '/Week.php';
  * The Kronolith_View_WorkWeek:: class provides a shortcut for a week
  * view that is only Monday through Friday.
  *
- * $Horde: kronolith/lib/Views/WorkWeek.php,v 1.3 2006/11/07 21:47:42 chuck Exp $
- *
  * @author  Chuck Hagenbuch <chuck@horde.org>
- * @since   Kronolith 2.2
  * @package Kronolith
  */
 class Kronolith_View_WorkWeek extends Kronolith_View_Week {
index 75cb440..3482f1d 100644 (file)
@@ -5,11 +5,8 @@ require_once KRONOLITH_BASE . '/lib/Day.php';
 /**
  * The Kronolith_View_Year:: class provides an API for viewing years.
  *
- * $Horde: kronolith/lib/Views/Year.php,v 1.17 2008/10/21 04:23:07 chuck Exp $
- *
  * @author  Chuck Hagenbuch <chuck@horde.org>
  * @author  Jan Schneider <jan@horde.org>
- * @since   Kronolith 2.2
  * @package Kronolith
  */
 class Kronolith_View_Year {
index 9ccd7ac..2d82478 100644 (file)
@@ -517,7 +517,6 @@ function _kronolith_put($path, $content, $content_type)
     switch ($content_type) {
     case 'text/calendar':
     case 'text/x-vcalendar':
-        require_once 'Horde/iCalendar.php';
         $iCal = new Horde_iCalendar();
         if (!is_a($content, 'Horde_iCalendar_vevent')) {
             if (!$iCal->parsevCalendar($content)) {
@@ -789,7 +788,6 @@ function _kronolith_import($content, $contentType, $calendar = null)
     switch ($contentType) {
     case 'text/calendar':
     case 'text/x-vcalendar':
-        require_once 'Horde/iCalendar.php';
         $iCal = new Horde_iCalendar();
         if (!is_a($content, 'Horde_iCalendar_vevent')) {
             if (!$iCal->parsevCalendar($content)) {
@@ -886,7 +884,6 @@ function _kronolith_export($uid, $contentType)
     case 'text/calendar':
         $share = &$kronolith_shares->getShare($event->getCalendar());
 
-        require_once 'Horde/iCalendar.php';
         $iCal = new Horde_iCalendar($version);
         $iCal->setAttribute('X-WR-CALNAME', String::convertCharset($share->get('name'), NLS::getCharset(), 'utf-8'));
 
@@ -939,7 +936,6 @@ function _kronolith_exportCalendar($calendar, $contentType)
     case 'text/calendar':
         $share = &$kronolith_shares->getShare($calendar);
 
-        require_once 'Horde/iCalendar.php';
         $iCal = new Horde_iCalendar($version);
         $iCal->setAttribute('X-WR-CALNAME', String::convertCharset($share->get('name'), NLS::getCharset(), 'utf-8'));
 
@@ -1060,7 +1056,6 @@ function _kronolith_replace($uid, $content, $contentType)
         case 'text/calendar':
         case 'text/x-vcalendar':
             if (!is_a($content, 'Horde_iCalendar_vevent')) {
-                require_once 'Horde/iCalendar.php';
                 $iCal = new Horde_iCalendar();
                 if (!$iCal->parsevCalendar($content)) {
                     return PEAR::raiseError(_("There was an error importing the iCalendar data."));
@@ -1111,7 +1106,6 @@ function _kronolith_getFreeBusy($startstamp = null, $endstamp = null,
                                 $calendar = null)
 {
     require_once dirname(__FILE__) . '/base.php';
-    require_once KRONOLITH_BASE . '/lib/FreeBusy.php';
 
     if (is_null($calendar)) {
         $calendar = Kronolith::getDefaultCalendar();
index fa6ea0e..264861a 100644 (file)
  * @package Kronolith
  */
 
+$kronolith_dir = dirname(__FILE__);
+
 // Check for a prior definition of HORDE_BASE.
 if (!defined('HORDE_BASE')) {
     /* Temporary fix - if horde does not live directly under the imp
      * directory, the HORDE_BASE constant should be defined in
      * imp/lib/base.local.php. */
-    $krono_dir = dirname(__FILE__);
-    if (file_exists($krono_dir . '/base.local.php')) {
-        include $krono_dir . '/base.local.php';
+    if (file_exists($kronolith_dir . '/base.local.php')) {
+        include $kronolith_dir . '/base.local.php';
     } else {
-        define('HORDE_BASE', dirname(__FILE__) . '/../..');
+        define('HORDE_BASE', $kronolith_dir . '/../..');
     }
 }
 /* Load the Horde Framework core, and set up inclusion paths. */
 require_once HORDE_BASE . '/lib/core.php';
+Horde_Autoloader::addClassPath($kronolith_dir);
+Horde_Autoloader::addClassPattern('/^Kronolith_/', $kronolith_dir);
 
 /* Registry. */
 $session_control = Util::nonInputVar('session_control');
@@ -50,14 +53,11 @@ define('KRONOLITH_TEMPLATES', $registry->get('templates'));
 
 /* Find the base file path of Kronolith. */
 if (!defined('KRONOLITH_BASE')) {
-    define('KRONOLITH_BASE', dirname(__FILE__) . '/..');
+    define('KRONOLITH_BASE', $kronolith_dir . '/..');
 }
 
 /* Horde framework libraries. */
-require_once 'Horde/Date.php';
-require_once 'Horde/Date/Recurrence.php';
 require_once 'Horde/Help.php';
-require_once 'Horde/History.php';
 
 /* Notification system. */
 $notification = &Notification::singleton();
@@ -72,9 +72,6 @@ require_once 'Horde/Prefs/CategoryManager.php';
 $GLOBALS['cManager'] = new Prefs_CategoryManager();
 $GLOBALS['cManager_fgColors'] = $GLOBALS['cManager']->fgColors();
 
-/* PEAR Date_Calc. */
-require_once 'Date/Calc.php';
-
 /* Start compression, if requested. */
 Horde::compressOutput();
 
@@ -82,10 +79,9 @@ Horde::compressOutput();
 NLS::setTimeZone();
 
 /* Create a calendar backend object. */
-$GLOBALS['kronolith_driver'] = &Kronolith_Driver::factory();
+$GLOBALS['kronolith_driver'] = Kronolith_Driver::factory();
 
 /* Create a share instance. */
-require_once 'Horde/Share.php';
 $GLOBALS['kronolith_shares'] = &Horde_Share::singleton($registry->getApp());
 
 Kronolith::initialize();
@@ -99,26 +95,22 @@ require_once 'Horde/Maintenance.php';
 if (Kronolith::loginTasksFlag() &&
     !strstr($_SERVER['PHP_SELF'], 'maintenance.php') &&
     !headers_sent() && !defined('AUTH_HANDLER') &&
-    $GLOBALS['prefs']->getValue('do_maintenance'))   {
-
+    $GLOBALS['prefs']->getValue('do_maintenance')) {
     Kronolith::loginTasksFlag(2);
-    $maint = &Maintenance::factory('kronolith', array('last_maintenance' => $GLOBALS['prefs']->getValue('last_kronolith_maintenance')));
+    $maint = Maintenance::factory('kronolith', array('last_maintenance' => $GLOBALS['prefs']->getValue('last_kronolith_maintenance')));
     if (!$maint) {
         $GLOBALS['notification']->push(_("Could not execute maintenance operations."), 'horde.warning');
     } else {
        $maint->runMaintenance();
     }
     Kronolith::loginTasksFlag(0);
-
 } elseif (Util::getFormData(MAINTENANCE_DONE_PARAM) &&
           Kronolith::loginTasksFlag()) {
-
-        $maint = &Maintenance::factory('kronolith', array('last_maintenance' => $GLOBALS['prefs']->getValue('last_kronolith_maintenance')));
-        if (!$maint) {
-            $GLOBALS['notification']->push(_("Could not execute maintenance operations."), 'horde.warning');
-        } else {
-           $maint->runMaintenance();
-        }
-        Kronolith::loginTasksFlag(0);
-
+    $maint = Maintenance::factory('kronolith', array('last_maintenance' => $GLOBALS['prefs']->getValue('last_kronolith_maintenance')));
+    if (!$maint) {
+        $GLOBALS['notification']->push(_("Could not execute maintenance operations."), 'horde.warning');
+    } else {
+        $maint->runMaintenance();
+    }
+    Kronolith::loginTasksFlag(0);
 }
index 95da5e5..3bde1aa 100644 (file)
@@ -21,7 +21,6 @@ function handle_remote_cal_management($updated)
 
     $key = Auth::getCredential('password');
     if ($key) {
-        require_once 'Horde/Secret.php';
         $calUser = base64_encode(Secret::write($key, $calUser));
         $calPasswd = base64_encode(Secret::write($key, $calPasswd));
     }
@@ -156,7 +155,6 @@ function prefs_callback()
     if ($GLOBALS['prefs']->isDirty('event_alarms')) {
         $alarms = $GLOBALS['registry']->callByPackage('kronolith', 'listAlarms', array($_SERVER['REQUEST_TIME']));
         if (!is_a($alarms, 'PEAR_Error') && !empty($alarms)) {
-            require_once 'Horde/Alarm.php';
             $horde_alarm = Horde_Alarm::factory();
             foreach ($alarms as $alarm) {
                 $alarm['start'] = new Horde_Date($alarm['start']);
index aecbfec..7c629cb 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * $Horde: kronolith/month.php,v 1.200 2009/01/06 18:00:59 jan Exp $
- *
  * Copyright 1999-2009 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file COPYING for license information (GPL). If you
index e602107..b73fce6 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * $Horde: kronolith/new.php,v 1.11 2009/01/06 18:00:59 jan Exp $
- *
  * Copyright 1999-2009 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file COPYING for license information (GPL). If you
index e82611f..364d70f 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * $Horde: kronolith/perms.php,v 1.10 2009/01/06 18:00:59 jan Exp $
- *
  * Copyright 2002-2009 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file COPYING for license information (GPL). If you
index 2db1e0c..a7a9254 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * $Horde: kronolith/pref_api.php,v 1.5 2009/01/06 18:00:59 jan Exp $
- *
  * Copyright 2006-2009 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file COPYING for license information (LGPL). If you
index dc974b7..26e9076 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * $Horde: kronolith/search.php,v 1.28 2009/01/06 18:00:59 jan Exp $
- *
  * Copyright 2004-2009 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file COPYING for license information (GPL). If you
index df97f7f..34684d4 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * $Horde: kronolith/view.php,v 1.15 2009/01/06 18:00:59 jan Exp $
- *
  * Copyright 2005-2009 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file COPYING for license information (GPL). If you
index ced78d9..bd707ce 100644 (file)
@@ -1,13 +1,12 @@
 <?php
 /**
- * $Horde: kronolith/week.php,v 1.60 2009/01/06 18:00:59 jan Exp $
- *
  * Copyright 1999-2009 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file COPYING for license information (GPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  *
- * @author Chuck Hagenbuch <chuck@horde.org>
+ * @author  Chuck Hagenbuch <chuck@horde.org>
+ * @package Kronolith
  */
 
 require_once dirname(__FILE__) . '/lib/base.php';
index 81711c6..ef76f07 100644 (file)
@@ -1,13 +1,12 @@
 <?php
 /**
- * $Horde: kronolith/workweek.php,v 1.50 2009/01/06 18:00:59 jan Exp $
- *
  * Copyright 1999-2009 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file COPYING for license information (GPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  *
- * @author Chuck Hagenbuch <chuck@horde.org>
+ * @author  Chuck Hagenbuch <chuck@horde.org>
+ * @package Kronolith
  */
 
 require_once dirname(__FILE__) . '/lib/base.php';
index c6bee94..3330c70 100644 (file)
@@ -1,13 +1,12 @@
 <?php
 /**
- * $Horde: kronolith/year.php,v 1.29 2009/01/06 18:00:59 jan Exp $
- *
  * Copyright 1999-2009 The Horde Project (http://www.horde.org/)
  *
  * See the enclosed file COPYING for license information (GPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  *
- * @author Chuck Hagenbuch <chuck@horde.org>
+ * @author  Chuck Hagenbuch <chuck@horde.org>
+ * @package Kronolith
  */
 
 require_once dirname(__FILE__) . '/lib/base.php';