Use case:
1) User goes to a SharePoint calendar2) User selects from a available days for the event
3) User is presented with all the available timeslots for the event
4) User clicks a button for the timeslot
5) Timeslot is booked and confirmation email is sent to user.
6) Done
Required SharePoint lists
- Calendar (for the available days for the event)
- Timeslots (Custom list)
- Title
- BookingDate (lookup to Calendar)
- TimeSlot (text field of timeslot like 9AM, 10AM, 11AM, etc)
- MaxCount (the maximum amount of participants for this timeslot)
- Bookings (Custom list)
- Title,
- Timeslot (choice)
- BookingDate (text)
- Person (peoplepicker)
You create one Timeslots row for each timeslot available. So if you had 2 days of events with 10AM, 11AM, 1PM and 3PM timeslots, you would need 8 rows (2 days x 4 timeslots)
How it works
- Add entries in the calendar for the days that will have timeslots. For instance add 2 days. Click one of these days to get the DispForm.aspx for the event.
- Copy the 2 code files below to your SiteAssets/js folder (create if needed)
- Customize the DispForm.aspx.
- Hide the form you see
- Add a Content Editor Web Part and link to the code below.
- The page will now show all the timeslots you configured for this day. There will be a "Book it" button beside each timeslot that hasn't reached its MaxCount maximum yet. Any timeslot that has reached the maximum will not have a button beside it.
Code
Data Access code the above file needs