Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/core#3778 Add 'Registered by Contact ID' (created_id) to civireport #24749

Merged
merged 1 commit into from Oct 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions CRM/Report/Form/Event/ParticipantListing.php
Expand Up @@ -144,6 +144,13 @@ public function __construct() {
'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'),
),
Expand Down Expand Up @@ -638,6 +645,16 @@ public function alterDisplay(&$rows) {
}
}

// 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'];
Expand Down