Revision: 1293
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1293&view=rev
Author:   cimorrison
Date:     2010-02-08 13:08:01 +0000 (Mon, 08 Feb 2010)

Log Message:
-----------
Fixed bug when using periods which meant that if you made a booking for N 
periods and there were fewer than N periods left in the day, the booking didn't 
flow on to the next day properly unless the start period was the first period 
of the day.

Modified Paths:
--------------
    mrbs/trunk/web/functions.inc

Modified: mrbs/trunk/web/functions.inc
===================================================================
--- mrbs/trunk/web/functions.inc        2010-02-08 12:37:20 UTC (rev 1292)
+++ mrbs/trunk/web/functions.inc        2010-02-08 13:08:01 UTC (rev 1293)
@@ -236,9 +236,13 @@
   
   // First get the duration in minutes
   $max_periods = count($periods);
-  if ($dur_units == "periods" && ($start_period + $units) > $max_periods)
+  if ($dur_units == "periods")
   {
-    $units = (24*60*floor($units/$max_periods)) + ($units%$max_periods);
+    $end_period = $start_period + $units;
+    if ($end_period > $max_periods)
+    {
+      $units = (24*60*floor($end_period/$max_periods)) + 
($end_period%$max_periods) - $start_period;
+    }
   }
   if ($dur_units == "days")
   {


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to