Waiting Lists

Published
2009-03-13 14:21
Written by
I'm putting this together to help the next version of civicrm. We needed a waiting list for events once they are full. Our needs will perhaps differ from a generic version but you have to start somewhere. We started by detecting the state of the event with eventFull(). If it's full and the user is not already a participant OR in the waitinglist table, we give them a simple link which will add them to the waitinglist table. We use a first in first out system so when a participant is deleted, removed (status) or otherwise changed, we trigger a checking script that checks the maxParticipants and total to see if there is now a space. If there is we take the top one from the waiting list and add it to the participant list as a specific status (we used 'added by waiting list'). Our system isn't quite finished yet but we're thinking of auto removing people from the civicrm_participant table when they've not confirmed for a while. At the point mentioned above, we email the user with a link to the page to confirm or cancel their registration to the event. Speaking of the confirmation of their place, we added a multipage form (wizard) that had: page 1: 2 buttons - cancel or confirm place. page 2: The register form slightly tweaked. page 3: The confirm form, postProcess() altered to set the new status to registered. page 4: Pretty much unaltered thankyou page. StateMachine has this: $this->_pages = array( 'CRM_Event_Form_WaitingList_Prompt' => null, 'CRM_Event_Form_Registration_Register' => null, 'CRM_Event_Form_Registration_Confirm' => null, 'CRM_Event_Form_Registration_ThankYou' => null, ); At the moment, the waitinglist table includes only a few fields:
  • id - this is the id that will be used in the link in the email
  • contact_id - self explanatory
  • event_id - self explanatory
  • signup_date - so we can pick from the top of the list.
So for now things are quite simple. I almost forgot to mention, I make sure that the multiple registrations option is forced off for the event registration when we get to the confirmation pages. I can post code if needed but right now the concept is a start.
Filed under

Comments

Chris - thanks for pushing this forward. We had a team meeting early this morning (6am PDT - yawn) to kickoff work on integrating this into 2.3. Piotr will be posting specifications for folks to review soon.

I have pretty much completed a system that works to my client's spec so I'll gladly share the code.

Many thanks for moving this along.

A few questions/comments:

1a. I like the idea of a future version havung a configurable period (eg number of days/weeks) that the registration would be held open, after which it would be passed to next on the waiting list.

1b. How do you ensure that the users on waiting list invited to register are the only ones enabled to use that page? Are you using tokens? What if they pass the email along?

2. What's the rationale for turning off multiple registrations option? Is it a unique client need, or is there something in the idea of waiting lists that I'm missing?

Thanks again!

Hi there,
thanks for taking an interest. Right now the core dev team are working on an implementation of this for v2.3 In the meantime my solution works for my current client and is not without its flaws.

To answer you queries:
1a. This is being implemented for the official version

1b. There is a link in the email with a url for the return page. At this point the user can either cancel their waiting list place or continue to sign up. That means they are already a participant of the event and the sign-up pages will just confirm them as being fully registered (paid if applicable). So in essence the waiting list place is non-transferable.

2. When you have a single place open up on an event you don't want that person to use their waiting list space to register 10 more people. It's a numbers thing.

To keep up to speed with the official version, see here: http://wiki.civicrm.org/confluence/display/CRM/CiviEvent+2.3