Revision: 1103
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1103&view=rev
Author:   cimorrison
Date:     2009-04-29 22:13:43 +0000 (Wed, 29 Apr 2009)

Log Message:
-----------
Fixed a bug in the display of multiple bookings whereby in some circumstances 
the name and description of the booking were not correct.

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

Modified: mrbs/trunk/web/functions.inc
===================================================================
--- mrbs/trunk/web/functions.inc        2009-04-29 10:19:16 UTC (rev 1102)
+++ mrbs/trunk/web/functions.inc        2009-04-29 22:13:43 UTC (rev 1103)
@@ -825,13 +825,23 @@
         break;
       } // end while
       
-      // and decrement the slot count for the first booking
+      // Now we've found the time ($s) of the first slot of the first booking
+      // we need to find its index ($i)
+      foreach ($column[date($format,$s)] as $i => $booking)
+      {
+        if ($booking["id"] == $first_booking_id)
+        {
+          break;
+        }
+      }
+
+      // Finally decrement the slot count for the first booking
       // no need to worry about count going < 1: the multiple booking display
       // does not use the slot count.
-      $column[date($format,$s)][0]["slots"]--;
+      $column[date($format,$s)][$i]["slots"]--;
       // and put the name and description in the multiply booked slot
-      $column[$time_start_t][0]["data"] = $column[date($format,$s)][0]["data"];
-      $column[$time_start_t][0]["long_descr"] = 
$column[date($format,$s)][0]["long_descr"];
+      $column[$time_start_t][0]["data"] = 
$column[date($format,$s)][$i]["data"];
+      $column[$time_start_t][0]["long_descr"] = 
$column[date($format,$s)][$i]["long_descr"];
 
     }
   }


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

------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to