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) »
  • Adding Participants Custom Data to .../civicrm/event/participant?id=... list
Pages: [1]

Author Topic: Adding Participants Custom Data to .../civicrm/event/participant?id=... list  (Read 5311 times)

bokabu

  • I’m new here
  • *
  • Posts: 16
  • Karma: 1
    • California Creativity
Adding Participants Custom Data to .../civicrm/event/participant?id=... list
November 20, 2009, 10:22:46 pm
I would like to add a column to the .../civicrm/event/participant?reset=1&id=n participant listing that contains a piece Custom Data (used for Participants) collected during registration.  I enabled Smarty debug [changed to "var $debugging =  true;" in civicrm/packages/Smarty/Smarty.class.php] and added a {debug} to my custom templates/CRM/Event/Page/ParticipantListing/NameStatusAndDate.tpl to see what variables were available, and there's only $row. id, name, email, status, and date.  The id is for the contact, not the participant, so I cannot use {php} and go query the civicrm_value_<custom>_n table directly.  Nor do I see the participant id in the CRM_Event_Page_ParticipantListing_NameStatusAndDate $page presented in hook_civicrm_pageRun.  Anyone tried to do this CiviCRM-native, or is it time to describe these tables to my module.views.inc and build a Drupal Views2 from scratch?

As always, advaTHANKSnce for any assistance.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Adding Participants Custom Data to .../civicrm/event/participant?id=... list
November 20, 2009, 11:00:41 pm
Not sure what you mean by this:

Quote
module.views.inc and build a Drupal Views2 from scratch?

Do you mean to build a view using the existing CiviCRM views integration?

I did think that the participant ID had been added by 3.0 but perhaps not. You can call an API directly from your template:

We used it to add a current_employer field to the listing from our participant listing template


Code: [Select]
      {crmAPI entity="contact" action="get" var="contacts" contact_id=$row.id}

            <td>{foreach from=$contacts item=contact}{if $contact.current_employer} {$contact.current_employer}{/if}{/foreach}
       </td>

   

NB - I thought the various IDs had been added to the hooks by 3.0.0 - I must be wrong.
   
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

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: Adding Participants Custom Data to .../civicrm/event/participant?id=... list
November 21, 2009, 08:41:03 am
Quote from: Eileen on November 20, 2009, 11:00:41 pm
NB - I thought the various IDs had been added to the hooks by 3.0.0 - I must be wrong.

this did not make it into 3.0/3.1. its a pretty big change and restructuring of a fair amount of code (and we'd like to do it across all the big forms)

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

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: Adding Participants Custom Data to .../civicrm/event/participant?id=... list
November 21, 2009, 08:59:00 am

1. i fixed the code (in 3.1.alpha): http://fisheye2.atlassian.com/changelog/CiviCRM/?cs=25209 to expose the participantID. You can backport the patch

2. That set of files was designed to be extensible. So you can add your own participant listing using similar code to the participant listing files (check:

CRM/Event/Page/ParticipantListing/NameStatusAndDate.php

once u create a file, u need to register it in this url:

http://drupal.demo.civicrm.org/civicrm/admin/options/participant_listing?group=participant_listing&reset=1

3. if u just want to add a couple of fields, eileen's suggestion is the best method IMO :)

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

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Adding Participants Custom Data to .../civicrm/event/participant?id=... list
November 21, 2009, 10:15:50 am
Ah OK - That's why I was confused (well, one of the many reasons). Does exposing the payment processor ID to the relevant payment processor class fit in with that?
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

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: Adding Participants Custom Data to .../civicrm/event/participant?id=... list
November 21, 2009, 12:39:06 pm

you will need to extend the code / implement your own participant listing / extend the code via hooks to add the payment processor ID

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

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Adding Participants Custom Data to .../civicrm/event/participant?id=... list
November 21, 2009, 01:33:50 pm
No, it was more of a general / off-topic question. Ignore for now.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

GregoryHeller

  • I post occasionally
  • **
  • Posts: 73
  • Karma: 3
Re: Adding Participants Custom Data to .../civicrm/event/participant?id=... list
February 01, 2010, 05:11:35 pm
I'm confused about participant listings. What is the point of the "participant_listing" option group, which can also be found in 3.0.4 via the civievent > manage participant listing template menu item.

Do you need to create an option in this option group for your "new" participant listing format (for example, adding the company/current employer field)?

From the searching I've done on the forum, and from my clients' needs this seems like a pretty common option that folks are interested in.  Could it be included as a participant listing template in future releases if contributed?

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Adding Participants Custom Data to .../civicrm/event/participant?id=... list
February 01, 2010, 06:29:35 pm
Yes, you need to register a new custom participant listing.

Take a copy of one of these:

C:\xampp\htdocs\circus25\sites\all\modules\civicrm\CRM\Event\Page\ParticipantListing

(give it a new name)

You need to add

contact.organization_name to the query and assign it to the template

You also need to add it into the template

C:\xampp\htdocs\circus25\sites\all\modules\civicrm\templates\CRM\Event\Page\ParticipantListing

I don't have one with the current employer added. I thought I did but actually it's a custom field that I added
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

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: Adding Participants Custom Data to .../civicrm/event/participant?id=... list
February 01, 2010, 07:27:00 pm

You can then file an issue with a patch. also remember to:

1. add code to xml/templates/civicrm_data.tpl to add the participant listing class

2. write the sql upgrade snippet to add this option value to the relevant option group. Lots of examples here: CRM/Upgrade/Incremental/sql/

looking forward to the patch :)

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) »
  • Adding Participants Custom Data to .../civicrm/event/participant?id=... list

This forum was archived on 2017-11-26.