Fix some things from a pretty mangled merge
authorMichael J. Rubinsky <mrubinsk@horde.org>
Tue, 29 Sep 2009 20:51:47 +0000 (16:51 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Tue, 29 Sep 2009 20:54:02 +0000 (16:54 -0400)
kronolith/attendees.php
kronolith/lib/Resource.php
kronolith/lib/Resource/Base.php
kronolith/lib/Resource/Group.php

index 9f67594..0171b2e 100644 (file)
@@ -317,8 +317,10 @@ if (count($resources)) {
         }
     }
 }
-$date = sprintf("%02d%02d%02d000000", Horde_Util::getFormData('year'), Horde_Util::getFormData('month'), Horde_Util::getFormData('mday'));
-$date = new Horde_Date($date);
+
+$date = new Horde_Date(Horde_Util::getFormData('date', date('Ymd') . '000000'));
+$end =  new Horde_Date(Horde_Util::getFormData('enddate', date('Ymd') . '000000'));
+
 $vfb_html = $attendee_view->render($date);
 
 // Add the ContactAutoCompleter
index fdfccf8..2c28dba 100644 (file)
@@ -53,56 +53,4 @@ class Kronolith_Resource
         return false;
     }
 
-   /**
-    * Adds a new resource to storage
-    *
-    * @param Kronolith_Resource $resource
-    *
-    * @return unknown_type
-    */
-    static public function addResource($resource)
-    {
-        // Create a new calendar id.
-        $calendar = 'resource_' . hash('md5', microtime());
-        $resource->set('calendar', $calendar);
-        $driver = Kronolith::getDriver('Resource');
-
-        return $driver->save($resource);
-    }
-
-    /**
-     * Return a list of resources that the current user has access to at the
-     * specified permission level. Right now, all users have PERMS_READ, but
-     * only system admins have PERMS_EDIT | PERMS_DELETE
-     *
-     * @return array of Kronolith_Resource objects
-     */
-    static public function listResources($perms = PERMS_READ, $params = array())
-    {
-        if (($perms & (PERMS_EDIT | PERMS_DELETE)) && !Horde_Auth::isAdmin()) {
-            return array();
-        }
-
-        // Query kronolith_resource table for all(?) available resources?
-        // maybe by 'type' or 'name'? type would be arbitrary?
-        $driver = Kronolith::getDriver('Resource');
-        return $driver->listResources($params);
-    }
-
-    /**
-     * Determine if the provided calendar id represents a resource's calendar.
-     *
-     * @param string $calendar  The calendar identifier to check.
-     *
-     * @return boolean
-     */
-    static public function isResourceCalendar($calendar)
-    {
-        if (strncmp($calendar, 'resource_', 9) === 0) {
-            return true;
-        }
-
-        return false;
-    }
-
 }
\ No newline at end of file
index c565a1b..d6fa357 100644 (file)
@@ -17,6 +17,7 @@ abstract class Kronolith_Resource_Base
      *   response_type - a RESPONSETYPE_* constant
      *   category    - The category of this resource...an arbitrary label used
      *                 to group multiple resources for the resource_group implementation
+     *
      * @var array
      */
     protected $_params = array();
@@ -154,32 +155,6 @@ abstract class Kronolith_Resource_Base
     }
 
     /**
-     * Check availability and return an appropriate Kronolith response code.
-     *
-     * @param Kronolith_Event $event  The event to check on
-     *
-     * @return integer Kronolith::RESPONSE* constant
-     */
-    public function getResponse($event)
-    {
-        switch($this->getResponseType()) {
-        case Kronolith_Resource::RESPONSETYPE_ALWAYS_ACCEPT:
-            return Kronolith::RESPONSE_ACCEPTED;
-        case Kronolith_Resource::RESPONSETYPE_AUTO:
-            if ($this->isFree($event)) {
-                return Kronolith::RESPONSE_ACCEPTED;
-            } else {
-                return Kronolith::RESPONSE_DECLINED;
-            }
-        case Kronolith_Resource::RESPONSETYPE_ALWAYS_DECLINE:
-            return Kronolith::RESPONSE_DECLINED;
-        case Kronolith_Resource::RESPONSETYPE_NONE:
-        case Kronolith_Resource::RESPONSETYPE_MANUAL:
-            return Kronolith::RESPONSE_NONE;
-        }
-    }
-
-    /**
      * Determine if event is free for specified time
      *
      * @param $startTime
index 00d32fc..0860976 100644 (file)
@@ -12,7 +12,6 @@
  */
 class Kronolith_Resource_Group extends Kronolith_Resource_Base
 {
-
     /**
      *
      * @var Kronolith_Driver_Resource