From 8b8fa58287eb5790ef68f0673e3b9f73cdd0ad3d Mon Sep 17 00:00:00 2001 From: magnolia61 Date: Mon, 11 Aug 2014 12:54:46 +0200 Subject: [PATCH] Include Event ID in participant export Currently the Event ID is not available for the participant export. Since the Event ID it is one of the required matching fields for participant import it seems reasonable to also include it in the export. --- CRM/Event/BAO/Participant.php | 12 +++++++++++- CRM/Export/BAO/Export.php | 3 ++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CRM/Event/BAO/Participant.php b/CRM/Event/BAO/Participant.php index bc959413a0..b7d8dba814 100644 --- a/CRM/Event/BAO/Participant.php +++ b/CRM/Event/BAO/Participant.php @@ -760,9 +760,19 @@ GROUP BY participant.event_id 'name' => 'participant_role', )); + //CRM-13595 add event id to participant export + $eventid = array( + 'event_id' => array('title' => 'Event ID', + 'name' => 'event_id', + )); + $eventtitle = array( + 'event_title' => array('title' => 'Event Title', + 'name' => 'event_title', + )); + $discountFields = CRM_Core_DAO_Discount::export(); - $fields = array_merge($participantFields, $participantStatus, $participantRole, $noteField, $discountFields); + $fields = array_merge($participantFields, $participantStatus, $participantRole, $eventid, $eventtitle, $noteField, $discountFields); // add custom data $fields = array_merge($fields, CRM_Core_BAO_CustomField::getFieldsForImport('Participant')); diff --git a/CRM/Export/BAO/Export.php b/CRM/Export/BAO/Export.php index d2d56fa09c..2be77db09c 100644 --- a/CRM/Export/BAO/Export.php +++ b/CRM/Export/BAO/Export.php @@ -222,8 +222,9 @@ class CRM_Export_BAO_Export { } else { //hack to fix component fields + //revert mix of event_id and title if ($fieldName == 'event_id') { - $returnProperties['event_title'] = 1; + $returnProperties['event_id'] = 1; } else if ( $exportMode == CRM_Export_Form_Select::EVENT_EXPORT && -- 2.25.1