CRM-17115 fix change observed in QA on participant listing
authoreileenmcnaugton <eileen@fuzion.co.nz>
Wed, 9 Sep 2015 11:24:17 +0000 (23:24 +1200)
committereileenmcnaugton <eileen@fuzion.co.nz>
Thu, 10 Sep 2015 02:55:59 +0000 (14:55 +1200)
CRM/Report/Form/Event/ParticipantListing.php

index 5e96c997209d0565a0010159ccc81b43dee74635..b1ef746849d842b241701595b78e128f6ea2dc1f 100644 (file)
@@ -71,12 +71,23 @@ class CRM_Report_Form_Event_ParticipantListing extends CRM_Report_Form_Event {
     $this->_columns = array(
       'civicrm_contact' => array(
         'dao' => 'CRM_Contact_DAO_Contact',
-        '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)',
-          ),
-        )),
+        'fields' => array_merge(array(
+          // CRM-17115 - to avoid changing report output at this stage re-instate
+          // old field name for sort name
+          'sort_name_linked' => array(
+            'title' => ts('Participant Name'),
+            'required' => TRUE,
+            'no_repeat' => TRUE,
+            'dbAlias' => 'contact_civireport.sort_name',
+          )),
+          $this->getBasicContactFields(),
+          array(
+            'age_at_event' => array(
+              'title' => ts('Age at Event'),
+              'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, event_civireport.start_date)',
+            ),
+          )
+        ),
         'grouping' => 'contact-fields',
         'order_bys' => array(
           'sort_name' => array(
@@ -376,6 +387,10 @@ class CRM_Report_Form_Event_ParticipantListing extends CRM_Report_Form_Event {
       ),
     );
 
+    // CRM-17115 avoid duplication of sort_name - would be better to standardise name
+    // & behaviour across reports but trying for no change at this point.
+    $this->_columns['civicrm_contact']['fields']['sort_name']['no_display'] = TRUE;
+
     // If we have active campaigns add those elements to both the fields and filters
     if ($campaignEnabled && !empty($this->activeCampaigns)) {
       $this->_columns['civicrm_participant']['fields']['campaign_id'] = array(