From 439fc6fe1e44c8ddb31201402629de458cbbb718 Mon Sep 17 00:00:00 2001 From: Dave Greenberg Date: Fri, 30 Aug 2013 15:54:58 -0700 Subject: [PATCH] CRM-13279 adding birth date and gender as column options to participant listing report. ---------------------------------------- * CRM-13279: Include gender and date of birth in (participant) reports http://issues.civicrm.org/jira/browse/CRM-13279 --- CRM/Report/Form/Event/ParticipantListing.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/CRM/Report/Form/Event/ParticipantListing.php b/CRM/Report/Form/Event/ParticipantListing.php index de864d3ce1..859a3c44d2 100644 --- a/CRM/Report/Form/Event/ParticipantListing.php +++ b/CRM/Report/Form/Event/ParticipantListing.php @@ -73,6 +73,12 @@ class CRM_Report_Form_Event_ParticipantListing extends CRM_Report_Form_Event { 'no_display' => TRUE, 'required' => TRUE, ), + 'birth_date' => + array('title' => ts('Birth Date'), + ), + 'gender_id' => + array('title' => ts('Gender'), + ), 'employer_id' => array('title' => ts('Organization'), ), @@ -180,7 +186,7 @@ class CRM_Report_Form_Event_ParticipantListing extends CRM_Report_Form_Event { 'options' => CRM_Event_PseudoConstant::participantRole(), ), 'participant_register_date' => array( - 'title' => ' Registration Date', + 'title' => 'Registration Date', 'operatorType' => CRM_Report_Form::OP_DATE, ), 'fee_currency' => @@ -495,6 +501,7 @@ class CRM_Report_Form_Event_ParticipantListing extends CRM_Report_Form_Event { $contributionStatus = CRM_Contribute_PseudoConstant::contributionStatus(); $paymentInstruments = CRM_Contribute_PseudoConstant::paymentInstrument(); $honorTypes = CRM_Core_OptionGroup::values('honor_type', FALSE, FALSE, FALSE, NULL, 'label'); + $genders = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id', array('localize' => TRUE)); foreach ($rows as $rowNum => $row) { // make count columns point to detail report @@ -641,6 +648,13 @@ class CRM_Report_Form_Event_ParticipantListing extends CRM_Report_Form_Event { } $entryFound = TRUE; } + + if (array_key_exists('civicrm_contact_gender_id', $row)) { + if ($value = $row['civicrm_contact_gender_id']) { + $rows[$rowNum]['civicrm_contact_gender_id'] = $genders[$value]; + } + $entryFound = TRUE; + } // skip looking further in rows, if first row itself doesn't // have the column we need -- 2.25.1