Changeset:
        fb96328cb346
        
https://sourceforge.net/p/mrbs/hg-code/ci/fb96328cb3469dd32d3bc97a6ebf2d8db8729404
Author:
        Campbell Morrison <[email protected]>
Date:
        Thu Mar 30 20:44:30 2017 +0100
Log message:

Renamed variables

diffstat:

 web/functions_table.inc |  40 ++++++++++++++++++++--------------------
 1 files changed, 20 insertions(+), 20 deletions(-)

diffs (111 lines):

diff -r c398a4904bc9 -r fb96328cb346 web/functions_table.inc
--- a/web/functions_table.inc   Thu Mar 30 20:08:22 2017 +0100
+++ b/web/functions_table.inc   Thu Mar 30 20:44:30 2017 +0100
@@ -6,15 +6,15 @@
 $column_hidden_width  = 0;  // (%) width of the column for hidden days (set to 
0 for no column at all; 1 for a narrow column);
                             //     when $times_along_top is TRUE, hidden days 
(rows) are not shown at all
 
-function map_add_booking ($entry, &$column, $am7, $pm7)
+function map_add_booking ($entry, &$column, $start_first_slot, 
$start_last_slot)
 {
   // Enters the contents of the booking found in $entry into $column, which is
   // a column of the map of the bookings being prepared ready for display.
   //
-  // $column    the column of the map that is being prepared (see below)
-  // $entry     a booking from the database
-  // $am7       the start of the first slot of the booking day (Unix timestamp)
-  // $pm7       the start of the last slot of the booking day (Unix timestamp)
+  // $column            the column of the map that is being prepared (see 
below)
+  // $entry             a booking from the database
+  // $start_first_slot  the start of the first slot of the booking day (Unix 
timestamp)
+  // $start_last_slot   the start of the last slot of the booking day (Unix 
timestamp)
   
   // $entry is expected to have the following keys, when present:
   //       room_id
@@ -101,11 +101,11 @@
     $entry['status'] &= ~STATUS_PRIVATE;  // Clear the private bit
   }
 
-  $is_multiday_start = ($entry['start_time'] < $am7);
-  $is_multiday_end = ($entry['end_time'] > ($pm7 + $resolution));
+  $is_multiday_start = ($entry['start_time'] < $start_first_slot);
+  $is_multiday_end = ($entry['end_time'] > ($start_last_slot + $resolution));
               
-  $start_t = max(round_t_down($entry['start_time'], $resolution, $am7), $am7);
-  $end_t = min(round_t_up($entry['end_time'], $resolution, $am7) - 
$resolution, $pm7);
+  $start_t = max(round_t_down($entry['start_time'], $resolution, 
$start_first_slot), $start_first_slot);
+  $end_t = min(round_t_up($entry['end_time'], $resolution, $start_first_slot) 
- $resolution, $start_last_slot);
   
   // calculate the times used for indexing - we index by nominal seconds since 
the start
   // of the calendar day which has the start of the booking day
@@ -202,7 +202,7 @@
       $r = $start_s;
       // If you've got to the first slot of the day then that must be the
       // first slot of the first booking
-      while ($r > $am7)
+      while ($r > $start_first_slot)
       {
         // Otherwise, step back one slot.
         $r -= $resolution;
@@ -749,17 +749,17 @@
     $eveningends_minutes = count($periods) - 1;
   }
 
-  $am7 = get_start_first_slot($month, $day, $year);
-  $pm7 = get_start_last_slot($month, $day, $year);
+  $start_first_slot = get_start_first_slot($month, $day, $year);
+  $start_last_slot = get_start_last_slot($month, $day, $year);
   
   // Work out whether there's a possibility that a time slot is invalid,
   // in other words whether the booking day includes a transition into DST.
   // If we know that there's a transition into DST then some of the slots are
   // going to be invalid.   Knowing whether or not there are possibly invalid 
slots
   // saves us bothering to do the detailed calculations of which slots are 
invalid.
-  $is_possibly_invalid = !$enable_periods && is_possibly_invalid($am7, $pm7);
+  $is_possibly_invalid = !$enable_periods && 
is_possibly_invalid($start_first_slot, $start_last_slot);
   
-  $entries = get_entries_by_area($area_id, $am7, $pm7 + $resolution);
+  $entries = get_entries_by_area($area_id, $start_first_slot, $start_last_slot 
+ $resolution);
   
   // We want to build an array containing all the data we want to show
   // and then spit it out. 
@@ -767,7 +767,7 @@
 
   foreach ($entries as $entry)
   {
-    map_add_booking($entry, $today[$entry['room_id']][$day], $am7, $pm7);
+    map_add_booking($entry, $today[$entry['room_id']][$day], 
$start_first_slot, $start_last_slot);
   }
 
   $n_time_slots = get_n_time_slots();
@@ -1006,14 +1006,14 @@
   // affected by daylight saving...
   for ($j = 0; $j<=($num_of_days-1); $j++)
   {
-    $am7[$j] = get_start_first_slot($month, $day_start_week+$j, $year);
-    $pm7[$j] = get_start_last_slot($month, $day_start_week+$j, $year);
+    $start_first_slot[$j] = get_start_first_slot($month, $day_start_week+$j, 
$year);
+    $start_last_slot[$j] = get_start_last_slot($month, $day_start_week+$j, 
$year);
     // Work out whether there's a possibility that a time slot is invalid,
     // in other words whether the booking day includes a transition into DST.
     // If we know that there's a transition into DST then some of the slots are
     // going to be invalid.   Knowing whether or not there are possibly 
invalid slots
     // saves us bothering to do the detailed calculations of which slots are 
invalid.
-    $is_possibly_invalid[$j] = !$enable_periods && 
is_possibly_invalid($am7[$j], $pm7[$j]);
+    $is_possibly_invalid[$j] = !$enable_periods && 
is_possibly_invalid($start_first_slot[$j], $start_last_slot[$j]);
   }
   unset($j);  // Just so that we pick up any accidental attempt to use it later
 
@@ -1022,10 +1022,10 @@
 
   for ($j = 0; $j<=($num_of_days-1) ; $j++)
   {
-    $entries = get_entries_by_room($room_id, $am7[$j], $pm7[$j] + $resolution);
+    $entries = get_entries_by_room($room_id, $start_first_slot[$j], 
$start_last_slot[$j] + $resolution);
     foreach ($entries as $entry)
     {
-      map_add_booking($entry, $week_map[$room_id][$j], $am7[$j], $pm7[$j]);
+      map_add_booking($entry, $week_map[$room_id][$j], $start_first_slot[$j], 
$start_last_slot[$j]);
     }
   }
   unset($j);  // Just so that we pick up any accidental attempt to use it later

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to