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) »
  • Number of Additional Participants
Pages: [1]

Author Topic: Number of Additional Participants  (Read 653 times)

roswell2011

  • I’m new here
  • *
  • Posts: 28
  • Karma: 0
  • CiviCRM version: 4.0.4
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: php 5.3
Number of Additional Participants
September 29, 2011, 02:22:21 pm
I need to be able to configure the number of additional Participants allowed for a registration. I see that the register.php has the hard-coded value for additional option.

// Hardcode maximum number of additional participants here for now. May need to make this configurable per event.
                // Label is value + 1, since the code sees this is ADDITIONAL participants (in addition to "self")
                $additionalOptions = array( '' => ts('1'),1 => ts('2'),2 => ts('3'),3 => ts('4'),4 => ts('5' ),
                                            5  => ts('6'),6 => ts('7'),7 => ts('8'),8 => ts('9'),9 => ts('10') );

Do I need to implement a buildForm hook and override the value with a custom field value? Thoughts!!
« Last Edit: September 29, 2011, 02:28:13 pm by roswell2011 »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Number of Additional Participants
September 29, 2011, 03:00:28 pm

Yes, over-riding that via the buildForm hook is probably the easiest solution for now.

In the medium-long term, we might want to consider moving this to an option group and allow people to edit that option group. Would be a great project to get familiar with the code base

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

roswell2011

  • I’m new here
  • *
  • Posts: 28
  • Karma: 0
  • CiviCRM version: 4.0.4
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: php 5.3
Re: Number of Additional Participants
September 30, 2011, 08:01:47 am
For now I added a custom field to the events. Created a hook and for CRM_Event_Form_Registration_Register and did an override. Temporarily fixed but it would be great if it can be moved to the option group

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Number of Additional Participants
September 30, 2011, 09:29:05 am

Can you work on this and get a patch for it? Would really help :)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Number of Additional Participants

This forum was archived on 2017-11-26.