Revision: 1465
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1465&view=rev
Author:   cimorrison
Date:     2010-09-23 09:50:14 +0000 (Thu, 23 Sep 2010)

Log Message:
-----------
Fixed a problem whereby email notifications reported the originally requested 
duration, rather than the actual duration after adjusting the request to fit 
into slot boundaries.   This was potentially confusing as the duration in the 
email notification would differ from (a) the details in view_entry and (b) the 
details in the delete notification when the same booking was deleted.

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

Modified: mrbs/trunk/web/edit_entry_handler.php
===================================================================
--- mrbs/trunk/web/edit_entry_handler.php       2010-09-22 22:49:05 UTC (rev 
1464)
+++ mrbs/trunk/web/edit_entry_handler.php       2010-09-23 09:50:14 UTC (rev 
1465)
@@ -326,7 +326,13 @@
   {
     $endtime += $resolution;
   }
- 
+
+  // Now adjust the duration in line with the adjustments to start and end time
+  // so that the email notifications report the adjusted duration
+  // (We do this before we adjust for DST so that the user sees what they 
expect to see)
+  $duration = $endtime - $starttime;
+  $enable_periods ? toPeriodString($period, $duration, $dur_units, FALSE) : 
toTimeString($duration, $dur_units, FALSE);
+  
   // Adjust the endtime for DST
   $endtime += cross_dst( $starttime, $endtime );
 }

Modified: mrbs/trunk/web/functions.inc
===================================================================
--- mrbs/trunk/web/functions.inc        2010-09-22 22:49:05 UTC (rev 1464)
+++ mrbs/trunk/web/functions.inc        2010-09-23 09:50:14 UTC (rev 1465)
@@ -125,7 +125,8 @@
   header("Expires: ".rfc1123_date(time()+$seconds));
 }
 
-
+// Converts a duration of $dur seconds into a duration of
+// $dur $units
 function toTimeString(&$dur, &$units, $translate=TRUE)
 {
   if (abs($dur) >= 60)


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

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to