From 3a61c90d6bcc8542f22d506236ae6eff5abbd57e Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Fri, 14 Oct 2022 14:52:46 +0100 Subject: [PATCH] Add 'Registered by Contact ID' to civireport --- CRM/Report/Form/Event/ParticipantListing.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CRM/Report/Form/Event/ParticipantListing.php b/CRM/Report/Form/Event/ParticipantListing.php index 6dfe2a946c..612744a1b0 100644 --- a/CRM/Report/Form/Event/ParticipantListing.php +++ b/CRM/Report/Form/Event/ParticipantListing.php @@ -144,6 +144,13 @@ class CRM_Report_Form_Event_ParticipantListing extends CRM_Report_Form { 'title' => ts('Registered by Participant Name'), 'name' => 'registered_by_id', ), + 'created_id' => array( + 'title' => ts('Registered by Contact ID'), + ), + 'registered_by_contact_name' => array( + 'title' => ts('Registered by Contact Name'), + 'name' => 'created_id', + ), 'source' => array( 'title' => ts('Source'), ), @@ -638,6 +645,16 @@ ORDER BY cv.label } } + // Handle registered by contact name + if (array_key_exists('civicrm_participant_registered_by_contact_name', $row)) { + $registeredByContactId = $row['civicrm_participant_registered_by_contact_name']; + if ($registeredByContactId) { + $rows[$rowNum]['civicrm_participant_registered_by_contact_name'] = CRM_Contact_BAO_Contact::displayName($registeredByContactId); + $rows[$rowNum]['civicrm_participant_registered_by_contact_name_link'] = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $registeredByContactId, $this->_absoluteUrl); + $rows[$rowNum]['civicrm_participant_registered_by_contact_name_hover'] = ts('View Contact Summary for Contact that registered the participant.'); + } + } + // Handle value separator in Fee Level if (array_key_exists('civicrm_participant_participant_fee_level', $row)) { $feeLevel = $row['civicrm_participant_participant_fee_level']; -- 2.25.1