From: Michael J. Rubinsky Date: Sat, 12 Sep 2009 16:20:54 +0000 (-0400) Subject: Need to move this comparison after the loop. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=b44d18ffb966739902f4fb1eed34454ff2d944b5;p=horde.git Need to move this comparison after the loop. If we are editing an event that was already accepted, we might hit max_reservations before we get to the event we are editing. --- diff --git a/kronolith/lib/Resource/Single.php b/kronolith/lib/Resource/Single.php index f686b4ad6..55f230403 100644 --- a/kronolith/lib/Resource/Single.php +++ b/kronolith/lib/Resource/Single.php @@ -46,17 +46,13 @@ class Kronolith_Resource_Single extends Kronolith_Resource_Base if (!($e->start->compareDateTime($event->end) >= 1 || $e->end->compareDateTime($event->start) <= -1)) { - /* Conflict, but check to see if we are allowed mulitiple */ - if (++$conflicts >= $this->get('max_reservations')) { - return false; - } - + $conflicts++; } } } } - return true; + return ($conflicts < $this->get('max_reservations')); } /**