Provide feedback on resource availability as soon as it's added to the attendees...
authorMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 17 Sep 2009 00:32:21 +0000 (20:32 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Tue, 29 Sep 2009 20:54:01 +0000 (16:54 -0400)
If response type is Kronolith_Resource::RESPONSETYPE_AUTO then use the start and end datetime
values that are now passed from the event form to determine if the resource is free.

Still need to figure out how to (efficiently) pass the datetime values to take into account
AM/PM. Probably break out the javascript from the onClick handler into it's function and
provide logic to check the am/pm fields? Is there an easier/prettier way?

kronolith/lib/Resource/Single.php

index 3814a08..0b1a258 100644 (file)
@@ -50,7 +50,6 @@ class Kronolith_Resource_Single extends Kronolith_Resource_Base
         } else {
             $uid = 0;
         }
-
         foreach ($busy as $events) {
             foreach ($events as $e) {
                 if (!($e->hasStatus(Kronolith::STATUS_CANCELLED) ||
@@ -61,7 +60,6 @@ class Kronolith_Resource_Single extends Kronolith_Resource_Base
                      // the previous event ends.
                      if (!($e->start->compareDateTime($end) >= 0) &&
                          !($e->end->compareDateTime($start) <= 0)) {
-
                         return false;
                      }
                 }