CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Allow multiple "registrations"?
Pages: 1 [2]

Author Topic: Allow multiple "registrations"?  (Read 4861 times)

kmarkley

  • I post frequently
  • ***
  • Posts: 178
  • Karma: 14
  • CiviCRM version: 4.4.3
  • CMS version: Drupal 7.24
  • MySQL version: 5.1.56
  • PHP version: 5.3.27
Re: Allow multiple "registrations"?
December 29, 2010, 09:09:12 pm
Spoke too soon.  The patch works except that the session status keeps getting doubled and doubled, etc.  I'll have to look into it tomorrow.  Hints welcome.

jcm55

  • I post occasionally
  • **
  • Posts: 96
  • Karma: 14
Re: Allow multiple "registrations"?
March 03, 2011, 04:34:15 pm
Not sure if this was ever resolved, but I fixed this a little higher up in the code.  I also opened CRM-7692 to hopefully incorporate this change in future releases.

Code: [Select]
--- civicrm/CRM/Event/Form/Registration/Register.php.orig 2011-03-03 16:00:55.000000000 -0800
+++ civicrm/CRM/Event/Form/Registration/Register.php 2011-03-03 15:50:30.000000000 -0800
@@ -1193,6 +1193,10 @@
             //as we are allowing w/ same email address,
             //lets check w/ other contact params.
             if ( $self->_values['event']['allow_same_participant_emails'] ) {
+                if ( ! $isAdditional ) {
+                    $contactID = array();
+                }
+                else {
                 $params = $fields;
                 $level  = ( $isAdditional ) ? 'Fuzzy' : 'Strict';
 
@@ -1203,6 +1207,7 @@
                 $dedupeParams['check_permission'] = false;
                 $ids       = CRM_Dedupe_Finder::dupesByParams( $dedupeParams, 'Individual', $level );
                 $contactID = CRM_Utils_Array::value( 0, $ids );
+                }
             } else if ( isset( $fields["email-{$self->_bltID}"] ) ) {
                 $emailString = trim( $fields["email-{$self->_bltID}"] );
                 if ( ! empty( $emailString ) ) {

kmarkley

  • I post frequently
  • ***
  • Posts: 178
  • Karma: 14
  • CiviCRM version: 4.4.3
  • CMS version: Drupal 7.24
  • MySQL version: 5.1.56
  • PHP version: 5.3.27
Re: Allow multiple "registrations"?
March 11, 2011, 10:30:12 am
Hi.  Thanks for the patch.

I was able to allow multiple registrations but got bogged down on the status messages.  To me the ideal solution would be that people are warned if they are already registered, but allowed to continue anyway.  That is, have something like "Looks like you're already registered, proceed only if you want additional registration under your name" appear on the registration page (for logged-in users) and the confirmation page (for anyone).

Every once in a while, someone experiences a browser or connection issue when buying a ticket and accidentally buys a duplicate because they didn't think the first one went through.  This would help in that case as well.

I've been bogged down and haven't had a chance to test your patch yet, but hope to in the next week or so.

Thanks again.

jcm55

  • I post occasionally
  • **
  • Posts: 96
  • Karma: 14
Re: Allow multiple "registrations"?
March 14, 2011, 10:47:37 am
I discovered that the patch above creates duplicate contact records.  Here's a better (and simpler) patch.  It does not create duplicate contacts, and allows multiple registrations if "Allow multiple registrations from the same email address?" is checked in the event config:

Code: [Select]
--- civicrm/CRM/Event/Form/Registration/Register.php.orig 2011-03-03 16:00:55.000000000 -0800
+++ civicrm/CRM/Event/Form/Registration/Register.php 2011-03-04 21:32:11.000000000 -0800
@@ -1233,7 +1233,7 @@
             $statusTypes = CRM_Event_PseudoConstant::participantStatus( null, "is_counted = 1" );
             while ( $participant->fetch( ) ) {
                 if ( array_key_exists ( $participant->status_id, $statusTypes ) ) {
-                    if ( !$isAdditional ) {
+                    if ( !$isAdditional && !$self->_values['event']['allow_same_participant_emails']) {
                         $registerUrl = CRM_Utils_System::url( 'civicrm/event/register',
                                                       "reset=1&id={$self->_values['event']['id']}&cid=0" );
                         $status = ts("Oops. It looks like you are already registered for this event. If you want to change your registration, or you feel that you've gotten this message in error, please contact the site administrator.")

minbori

  • I post occasionally
  • **
  • Posts: 53
  • Karma: 2
  • CiviCRM version: 4.0.8
  • CMS version: Joomla 2.5.24
  • MySQL version: 5.5.37
  • PHP version: 5.3.29
Re: Allow multiple "registrations"?
September 21, 2011, 10:19:43 am
Just wanted to thank you for this helpful patch which saved me a bunch of time to support a similar requirement!  ;D 

For anybody else who wants to use this, for the sake of clarity for the end users, I also amended the language of the "It looks like you're already registered" message in the civicrm/CRM/Event/Page/EventInfo.php file to make it clear to the users that they could proceed to create an additional registration by clicking the "Register Now" button at the bottom of the page.

wjm

  • I post occasionally
  • **
  • Posts: 88
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Joomla (Latest)
Re: Allow multiple "registrations"?
February 01, 2012, 08:22:16 am
I'm running 3.4.8 and still seeing this problem. 

I then applied jcm55's one line code change below.  Problem fixed.

wjm

  • I post occasionally
  • **
  • Posts: 88
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Joomla (Latest)
Re: Allow multiple "registrations"?
February 01, 2012, 08:25:58 am
JCM55,

You said in an earlier post that you posted a bug (http://issues.civicrm.org/jira/browse/CRM-7692) for this issue.  The code, though, that you attached does not match the one line change.  It seems to match the original 5 line addition that was posted prior to that.

Is there a problem with your last solution?

jcm55

  • I post occasionally
  • **
  • Posts: 96
  • Karma: 14
Re: Allow multiple "registrations"?
February 15, 2012, 07:07:38 am
I didn't realize I'd never updated CRM-7692 with the updated patch.  I've done that now.  I've had it applied on our system nearly a year, and it works great for us.

wjm

  • I post occasionally
  • **
  • Posts: 88
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Joomla (Latest)
Re: Allow multiple "registrations"?
February 15, 2012, 07:15:03 am
Super... thanks.

I've been using CIVICRM for a while.  Because of some problems I've been having recently with it, I've become more engaged with it and plan to contribute bug reports (and hopefully suggested fixes) as I go forward.

jcm55

  • I post occasionally
  • **
  • Posts: 96
  • Karma: 14
Re: Allow multiple "registrations"?
March 09, 2012, 07:16:30 pm
I've submitted a more complete patch attached to CRM-7692 which addresses some of the outstanding issues.  Aside from allowing primary participants to register multiple times with the same e-mail, it also addresses the warning message on the event info page, and adds language to the event config page to make more clear the effects of the different "allow multiple" and "allow same email" checkbox combinations do.

Hoepfully will be in 4.2.

Pages: 1 [2]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Allow multiple "registrations"?

This forum was archived on 2017-11-26.