Ticket #39 (new feature request)

Opened 4 years ago

Last modified 4 years ago

Time Limit To booking times [1506542]

Reported by: Anonymous Owned by:
Priority: major Milestone:
Version: 1.3 Keywords:
Cc:

Description

Hi
I'd like to see an option that allows a maximum
event booking time.

We use Rapla to book public access Internet PC's and
allow a maximum booking time of 1 hour.

If the maximum booking period were implemented we
could then allow customers to use a global account to
advance book a PC for themselves.

I have the source code but am pretty new to java
programming; if someone could point me in the right
direction I can probably get it done.

Please e-mail me at gary@…

Thanks in advance.

Best Regards
Gary Plummer

Change History

Changed 4 years ago by kohlhaas

Hello Gary,

sorry for the late reply. You can override checkReservation
in org.rapla.facade.internal.Facade Impl

Just iterate over all appointments of the reservation.
Calc the difference between start and end time and if it is
greater than 1 hour (e.g. start.getTime() - end.getTime() >
Date Tools.MILLISECONDS_PER_HOUR)
you can throw a Rapla Exception.

throw new Rapla Exception("You can't book reservations longer
then 1 hour");

Hope that helps

Greetings

Christopher

Note: See TracTickets for help on using tickets.