Changeset:
616210bd53b6
https://sourceforge.net/p/mrbs/hg-code/ci/616210bd53b665112b634846d6ab2df5dbfcdef9
Author:
Campbell Morrison <[email protected]>
Date:
Tue Jan 17 10:46:36 2017 +0000
Log message:
Fixed problem when the default duration takes a booking beyond the start day
and multiday bookings are not allowed.
diffstat:
web/edit_entry.php | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diffs (23 lines):
diff -r 17722e310c1a -r 616210bd53b6 web/edit_entry.php
--- a/web/edit_entry.php Tue Jan 17 10:41:52 2017 +0000
+++ b/web/edit_entry.php Tue Jan 17 10:46:36 2017 +0000
@@ -958,8 +958,17 @@
}
$end_time = $start_time + $duration;
- // The end time can't be past the end of the booking day
- $end_time = fit_to_booking_day($end_time, $back=true);
+ // Make sure the end_time falls within a booking day. So if there are no
+ // restrictions, bring it back to the nearest booking day. If the user
is not
+ // allowed multi-day bookings then make sure it is on the first booking
day.
+ if ($is_admin || !$auth['only_admin_can_book_multiday'])
+ {
+ $end_time = fit_to_booking_day($end_time, $back=true);
+ }
+ else
+ {
+ $end_time = min($end_time, get_end_last_slot($month, $day, $year));
+ }
}
$rep_id = 0;
------------------------------------------------------------------------------
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