CRM-17115 also add prefix, suffix etc to participant report
authoreileenmcnaugton <eileen@fuzion.co.nz>
Mon, 31 Aug 2015 04:36:22 +0000 (16:36 +1200)
committereileenmcnaugton <eileen@fuzion.co.nz>
Mon, 31 Aug 2015 04:36:45 +0000 (16:36 +1200)
CRM/Report/Form/Event/ParticipantListing.php

index 4822876e3a48ff7de97a0f80579778a40c46a06a..74703000be394eefefb02534b7ef268c4534a6a8 100644 (file)
@@ -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)) {