From 52909a7c5e56e1b3cbdd8e3b39423143a75305c6 Mon Sep 17 00:00:00 2001 From: eileenmcnaugton Date: Mon, 31 Aug 2015 16:36:22 +1200 Subject: [PATCH] CRM-17115 also add prefix, suffix etc to participant report --- CRM/Report/Form/Event/ParticipantListing.php | 43 ++------------------ 1 file changed, 3 insertions(+), 40 deletions(-) diff --git a/CRM/Report/Form/Event/ParticipantListing.php b/CRM/Report/Form/Event/ParticipantListing.php index 4822876e3a..74703000be 100644 --- a/CRM/Report/Form/Event/ParticipantListing.php +++ b/CRM/Report/Form/Event/ParticipantListing.php @@ -71,50 +71,12 @@ class CRM_Report_Form_Event_ParticipantListing extends CRM_Report_Form_Event { $this->_columns = array( 'civicrm_contact' => array( 'dao' => 'CRM_Contact_DAO_Contact', - 'fields' => array( - 'sort_name_linked' => array( - 'title' => ts('Participant Name'), - 'required' => TRUE, - 'no_repeat' => TRUE, - 'dbAlias' => 'contact_civireport.sort_name', - ), - 'first_name' => array( - 'title' => ts('First Name'), - ), - 'middle_name' => array( - 'title' => ts('Middle Name'), - ), - 'last_name' => array( - 'title' => ts('Last Name'), - ), - 'id' => array( - 'no_display' => TRUE, - 'required' => TRUE, - ), - 'employer_id' => array( - 'title' => ts('Organization'), - ), - 'gender_id' => array( - 'title' => ts('Gender'), - ), - 'birth_date' => array( - 'title' => ts('Birth Date'), - ), - 'age' => array( - 'title' => ts('Age'), - 'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, CURDATE())', - ), + 'fields' => array_merge($this->getBasicContactFields(), array( 'age_at_event' => array( 'title' => ts('Age at Event'), 'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, event_civireport.start_date)', ), - 'contact_type' => array( - 'title' => ts('Contact Type'), - ), - 'contact_sub_type' => array( - 'title' => ts('Contact Subtype'), - ), - ), + )), 'grouping' => 'contact-fields', 'order_bys' => array( 'sort_name' => array( @@ -824,6 +786,7 @@ ORDER BY cv.label // handle gender id $this->_initBasicRow($rows, $entryFound, $row, 'civicrm_contact_gender_id', $rowNum, $genders); + $entryFound = $this->alterDisplayContactFields($row, $rows, $rowNum, 'member/detail') ? TRUE : $entryFound; // display birthday in the configured custom format if (array_key_exists('civicrm_contact_birth_date', $row)) { -- 2.25.1