Remove max_reservations.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 17 Sep 2009 23:04:34 +0000 (19:04 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Tue, 29 Sep 2009 20:54:01 +0000 (16:54 -0400)
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
kronolith/lib/Resource/Single.php
kronolith/scripts/upgrades/2009-08-17_add_resources.sql

index 7a1b6db..d90c0c0 100644 (file)
@@ -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());
index 0b1a258..eec8c09 100644 (file)
@@ -66,7 +66,7 @@ class Kronolith_Resource_Single extends Kronolith_Resource_Base
             }
         }
 
-        return ($conflicts < $this->get('max_reservations'));
+        return true;
     }
 
     /**
index a66d24a..c9a7070 100644 (file)
@@ -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)
 );