Revision: 2587
          https://sourceforge.net/p/mrbs/code/2587/
Author:   cimorrison
Date:     2012-12-12 13:50:19 +0000 (Wed, 12 Dec 2012)
Log Message:
-----------
Made mrbsMakeBookings() return an array of start times booked.  No functional 
change to MRBS.

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

Modified: mrbs/trunk/web/mrbs_sql.inc
===================================================================
--- mrbs/trunk/web/mrbs_sql.inc 2012-12-12 13:18:02 UTC (rev 2586)
+++ mrbs/trunk/web/mrbs_sql.inc 2012-12-12 13:50:19 UTC (rev 2587)
@@ -801,17 +801,18 @@
  * 
  * Returns:
  *   an array
- *   ['id']      - 0 if an error occurred or if no bookings could be
- *                 made, otherwise an id
- *   ['series']  - boolean: TRUE if the id refers to the repeat table
- *                          FALSE if the id refers to the entry table
+ *   ['id']          - 0 if an error occurred or if no bookings could be
+ *                     made, otherwise an id
+ *   ['series']      - boolean: TRUE if the id refers to the repeat table
+ *                              FALSE if the id refers to the entry table
+ *   ['start_times'] - an array of start times that have been created
  *
  */
 function mrbsCreateRepeatingEntrys($data)
 {
   global $max_rep_entrys;
   
-  $result = array('id' => 0, 'series' => FALSE);
+  $result = array('id' => 0, 'series' => FALSE, 'start_times' => array());
 
   if (!isset($data['skip_list']))
   {
@@ -853,6 +854,7 @@
     $id = mrbsCreateSingleEntry($data);
     $result['id'] = $id;
     $result['series'] = FALSE;
+    $result['start_times'][] = $data['start_time'];
     return $result;
   }
   
@@ -901,6 +903,7 @@
         $data['end_time'] = $reps[$i] + $diff;
 
         $ent_id = mrbsCreateSingleEntry($data);
+        $result['start_times'][] = $data['start_time'];
       }
     }
   }
@@ -1623,12 +1626,14 @@
       $details = mrbsCreateRepeatingEntrys($booking);
       $new_id = $details['id'];
       $is_repeat_table = $details['series'];
+      $result['start_times'] = $details['start_times'];
     }
     else
     {
       // Create the entry:
       $new_id = mrbsCreateSingleEntry($booking);
       $is_repeat_table = FALSE;
+      $result['start_times'] = array($booking['start_time']);
     }
     $new_details[] = array('id' => $new_id, 'room_id' => $booking['room_id']);
     $booking['id'] = $new_id;  // Add in the id now we know it
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to