Revision: 1581
http://mrbs.svn.sourceforge.net/mrbs/?rev=1581&view=rev
Author: cimorrison
Date: 2010-11-03 12:48:41 +0000 (Wed, 03 Nov 2010)
Log Message:
-----------
Fixed bug in calculation of periods duration when the booking crosses a day or
more and the end period is before the start period
Modified Paths:
--------------
mrbs/branches/from_to_bookings/web/functions.inc
Modified: mrbs/branches/from_to_bookings/web/functions.inc
===================================================================
--- mrbs/branches/from_to_bookings/web/functions.inc 2010-11-03 12:31:07 UTC
(rev 1580)
+++ mrbs/branches/from_to_bookings/web/functions.inc 2010-11-03 12:48:41 UTC
(rev 1581)
@@ -229,6 +229,12 @@
$mins_in_day = 24*60;
$days = $dur / $mins_in_day;
$remainder = $dur % $mins_in_day;
+ // strip out any gap between the end of the last period on one day
+ // and the beginning of the first on the next
+ if ($remainder > $max_periods)
+ {
+ $remainder += $max_periods - $mins_in_day;
+ }
// We'll express the duration as an integer, in days if possible, otherwise
periods
if (($remainder == 0) || (($start_period == 0) && ($remainder ==
$max_periods)))
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Achieve Improved Network Security with IP and DNS Reputation.
Defend against bad network traffic, including botnets, malware,
phishing sites, and compromised hosts - saving your company time,
money, and embarrassment. Learn More!
http://p.sf.net/sfu/hpdev2dev-nov
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits