Revision: 3003
          https://sourceforge.net/p/mrbs/code/3003/
Author:   cimorrison
Date:     2015-02-25 09:34:16 +0000 (Wed, 25 Feb 2015)
Log Message:
-----------
Fixed bug that caused the end time selector on the edit_entry form to be wrong 
when using periods and trying to make a new booking for a slot that wasn't the 
first of the day.

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

Modified: mrbs/trunk/web/functions.inc
===================================================================
--- mrbs/trunk/web/functions.inc        2015-02-07 10:39:32 UTC (rev 3002)
+++ mrbs/trunk/web/functions.inc        2015-02-25 09:34:16 UTC (rev 3003)
@@ -530,8 +530,13 @@
 // Gets the UNIX timestamp for the start of the first slot on the given day
 function get_start_first_slot($month, $day, $year)
 {
-  global $morningstarts, $morningstarts_minutes;
+  global $morningstarts, $morningstarts_minutes, $enable_periods;
   
+  if ($enable_periods)
+  {
+    return mrbs_mktime(12, 0, 0, $month, $day, $year);
+  }
+  
   $t = mrbs_mktime($morningstarts, $morningstarts_minutes, 0,
                    $month, $day, $year);
   return $t;
@@ -541,8 +546,13 @@
 // Gets the UNIX timestamp for the start of the last slot on the given day
 function get_start_last_slot($month, $day, $year)
 {
-  global $morningstarts, $morningstarts_minutes, $eveningends, 
$eveningends_minutes;
+  global $morningstarts, $morningstarts_minutes, $eveningends, 
$eveningends_minutes, $enable_periods, $periods;
   
+  if ($enable_periods)
+  {
+    return mrbs_mktime(12, count($periods) -1, 0, $month, $day, $year);
+  }
+  
   // Work out if $evening_ends is really on the next day
   if (hm_before(array('hours' => $eveningends, 'minutes' => 
$eveningends_minutes),
                 array('hours' => $morningstarts, 'minutes' => 
$morningstarts_minutes)))
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to