From a8cc7e6530013a631585a6399f3a37d1ed56c932 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Tue, 29 Sep 2009 16:51:47 -0400 Subject: [PATCH] Fix some things from a pretty mangled merge --- kronolith/attendees.php | 6 +++-- kronolith/lib/Resource.php | 52 ---------------------------------------- kronolith/lib/Resource/Base.php | 27 +-------------------- kronolith/lib/Resource/Group.php | 1 - 4 files changed, 5 insertions(+), 81 deletions(-) diff --git a/kronolith/attendees.php b/kronolith/attendees.php index 9f67594d3..0171b2e1e 100644 --- a/kronolith/attendees.php +++ b/kronolith/attendees.php @@ -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 diff --git a/kronolith/lib/Resource.php b/kronolith/lib/Resource.php index fdfccf821..2c28dba44 100644 --- a/kronolith/lib/Resource.php +++ b/kronolith/lib/Resource.php @@ -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 diff --git a/kronolith/lib/Resource/Base.php b/kronolith/lib/Resource/Base.php index c565a1b10..d6fa35709 100644 --- a/kronolith/lib/Resource/Base.php +++ b/kronolith/lib/Resource/Base.php @@ -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 diff --git a/kronolith/lib/Resource/Group.php b/kronolith/lib/Resource/Group.php index 00d32fcf4..0860976f0 100644 --- a/kronolith/lib/Resource/Group.php +++ b/kronolith/lib/Resource/Group.php @@ -12,7 +12,6 @@ */ class Kronolith_Resource_Group extends Kronolith_Resource_Base { - /** * * @var Kronolith_Driver_Resource -- 2.11.0