Menu

#1422 How to retrict past date bookings

open
nobody
None
1
2018-01-25
2018-01-25
No

Hi

Currenly the application is allowing users to book for the pas dates , Is there any way to put validation on this . User should only able to book for present and future dates not for the past dates

Discussion

  • Campbell Morrison

    For existing areas, login to MRBS as an admin, go to the Rooms page, select the area you want to change and click the Edit icon. Then set Advance Booking Minimum to 0. Setting it for Booking Creation prevents new bookings being made. Setting it for Booking Deletion prevents existing bookings from being edited or deleted. You can also set Advance Booking Minimum to a non-zero value. Setting the Creation to 1 week, for example, means that bookings must be made at least one week in advance.

    To set the defaults for new areas see areadefaults.inc.php (but copy the settings to config.inc.php before changing them).

     
  • Ramana Reddy

    Ramana Reddy - 2018-01-25

    Thanks Morris.

    Its woeking fine now.

    However the error message shown looks not meaningful. How can I change the text shown in attached image.

    Current Message: You cannot create a booking which starts in less than 0 seconds
    Expected: You cannot create a booking for the past days (something like this)

     
  • Campbell Morrison

    The message is a generic message which caters for all possible settings. For example, if you had Min Create Ahead set to two weeks it would say "You cannot create a booking which starts in less than 2 weeks". If you want to tailor the message for your special case then you could set in your config file:

    $vocab_override['en']['min_create_time_before'] = "You are not allowed to create bookings in the past";
    

    But if you do that you will still get that message if you change the setting from 0 to, say, 2 weeks.

     
MongoDB Logo MongoDB