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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Displaying event_id in Event Participant Report
Pages: [1]

Author Topic: Displaying event_id in Event Participant Report  (Read 1310 times)

haydo

  • I’m new here
  • *
  • Posts: 26
  • Karma: 0
Displaying event_id in Event Participant Report
February 23, 2010, 06:21:28 pm
Hi all,

Trying to do something which I thought would be fairly simple.  Displaying the event_id in Event Participant Report, as well as keeping the display of the event name too.

I noticed it gets the event_id in the query but then populates it with the event name (aka title) in PseudoContent.php.  At the moment I can get one or the other but need both?  Anybody got any quick ideas for me to solve this problem?

Many thanks

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Displaying event_id in Event Participant Report
February 23, 2010, 06:30:05 pm
with debug on, add: &smartyDebug=1
to the url
that will open a window with the smarty variables available to the template. then you can insert the variable where you want it in the tpl file
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

haydo

  • I’m new here
  • *
  • Posts: 26
  • Karma: 0
Re: Displaying event_id in Event Participant Report
February 23, 2010, 06:51:17 pm
Thanks for the quick reply lcdweb :)

I don't have a problem finding where to put it, i have a problem of getting the id and event name both displaying as the event id is overridden to display the event name.  I can change it to display the id, but therefore can't show the title.  If that doesn't make sense I can display the code which does this.

Thanks again.

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Displaying event_id in Event Participant Report
February 23, 2010, 07:19:39 pm
if the variable is being overridden in the template, you could use the smarty assign function to assign the id to a different variable name before it's overridden (http://www.smarty.net/manual/en/language.custom.functions.php#language.function.assign)

but i'd be surprised if the event id was not available in one of the arrays passed to the tpl. did you look at the smarty debug window?
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Deepak Srivastava

  • Ask me questions
  • ****
  • Posts: 677
  • Karma: 65
Re: Displaying event_id in Event Participant Report
February 23, 2010, 09:48:56 pm
Another way would be changing the _columns array so that query makes it available in an another column. This 'll also make it part of "display columns".

Code: [Select]
--- CRM/Report/Form/Event/ParticipantListing.php (revision 26358)
+++ CRM/Report/Form/Event/ParticipantListing.php (working copy)
@@ -88,6 +88,10 @@
                          'fields'  =>
                          array( 'participant_id'            => array( 'title' => 'Participant ID' ),
 
+                                'e_id'                      => array( 'title' => 'Event ID',
+                                                                      'name'  => 'event_id',
+                                                                      'default' => true,
+                                                                      'type'    =>  CRM_Utils_Type::T_INT ),
                                 'event_id'                  => array( 'default' => true,
                                                                       'type'    =>  CRM_Utils_Type::T_STRING ),
                                 'status_id'                 => array( 'title'   => ts('Status'),

Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Displaying event_id in Event Participant Report
February 23, 2010, 10:18:44 pm
haydo --
i read your original post too fast. i didn't notice you were working on a report -- my response was relevant to event pages, but not to reports. sorry about that. Deepak has the direction you'll need to go in.
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

haydo

  • I’m new here
  • *
  • Posts: 26
  • Karma: 0
Re: Displaying event_id in Event Participant Report
February 24, 2010, 11:04:31 am
Thank you to you both Deepak and lcdweb.

That was exactly what i was doing but missing the 'name' field in the array.  Silly oversight by me!  Cheers guys :)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Displaying event_id in Event Participant Report

This forum was archived on 2017-11-26.