From adff9b1cbf0cdca503296a89282b088f3b71ba59 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Thu, 17 Sep 2009 19:04:34 -0400 Subject: [PATCH] Remove max_reservations. It's not intuitive and won't be needed in 99.9% of the use cases. For single resources that may be overbooked, the resource should be created with a RESPONSETYPE_ALWAYS_EXCEPT responseType instead. --- kronolith/lib/Driver/Resource.php | 1 - kronolith/lib/Resource/Single.php | 2 +- kronolith/scripts/upgrades/2009-08-17_add_resources.sql | 3 +-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/kronolith/lib/Driver/Resource.php b/kronolith/lib/Driver/Resource.php index 7a1b6db5a..d90c0c0b8 100644 --- a/kronolith/lib/Driver/Resource.php +++ b/kronolith/lib/Driver/Resource.php @@ -455,7 +455,6 @@ class Kronolith_Driver_Resource extends Kronolith_Driver_Sql public function getResource($id) { $query = 'SELECT resource_id, resource_name, resource_calendar, resource_category, resource_description, resource_response_type, resource_type, resource_members FROM kronolith_resources WHERE resource_id = ?'; - $results = $this->_db->getRow($query, array($id), DB_FETCHMODE_ASSOC); if ($results instanceof PEAR_Error) { throw new Horde_Exception($results->getMessage()); diff --git a/kronolith/lib/Resource/Single.php b/kronolith/lib/Resource/Single.php index 0b1a25853..eec8c097c 100644 --- a/kronolith/lib/Resource/Single.php +++ b/kronolith/lib/Resource/Single.php @@ -66,7 +66,7 @@ class Kronolith_Resource_Single extends Kronolith_Resource_Base } } - return ($conflicts < $this->get('max_reservations')); + return true; } /** diff --git a/kronolith/scripts/upgrades/2009-08-17_add_resources.sql b/kronolith/scripts/upgrades/2009-08-17_add_resources.sql index a66d24aad..c9a70705d 100644 --- a/kronolith/scripts/upgrades/2009-08-17_add_resources.sql +++ b/kronolith/scripts/upgrades/2009-08-17_add_resources.sql @@ -5,9 +5,8 @@ CREATE TABLE kronolith_resources ( resource_name VARCHAR(255), resource_calendar VARCHAR(255), resource_description TEXT, - resource_category VARCHAR(255), + resource_category VARCHAR(255) DEFAULT '', resource_response_type INT DEFAULT 0, - resource_max_reservations INT DEFAULT 1, PRIMARY KEY (resource_id) ); -- 2.11.0