Our Yacht Club client has three workslips that members can reserve for up to 3 days. Using core taxonomy, content types, views, and the Events, Conditions, and Actions (ECA) module, we built a system to allow members to make reservations, and have the system prevent double-bookings.
This starts by having a vocabulary for the workslips, one taxonomy term for each one. Members book reservations that are a custom content type with date range and the term reference to the workslip. The ECA model acts on the presave event. It validates that the date range is in the future, and is shorter than 3 days. Then it passes the dates and slip into a view that takes these as contextual filters, and lists existing reservations in that date range. The model then looks at any results, and if it's not an existing reservation for this user, it sets a validation error on the dates, letting the member know that date is booked for that slip.
ECA can really do it all!
Add new comment