From af6de2f19805e7183f17431e554d9ea9e68c7a1b Mon Sep 17 00:00:00 2001 From: Jitendra Purohit Date: Fri, 14 Jul 2017 13:12:23 +0530 Subject: [PATCH] Allow only public custom groups to display on participants receipts --- CRM/Event/Form/Participant.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index c524956793d2..d6ddf78eb634 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -1593,9 +1593,12 @@ public function postProcess() { //format submitted data foreach ($params['custom'] as $fieldID => $values) { foreach ($values as $fieldValue) { - $customFields[$fieldID]['id'] = $fieldID; - $formattedValue = CRM_Core_BAO_CustomField::displayValue($fieldValue['value'], $fieldID, $participants[0]->id); - $customGroup[$customFields[$fieldID]['groupTitle']][$customFields[$fieldID]['label']] = str_replace(' ', '', $formattedValue); + $isPublic = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $fieldValue['custom_group_id'], 'is_public'); + if ($isPublic) { + $customFields[$fieldID]['id'] = $fieldID; + $formattedValue = CRM_Core_BAO_CustomField::displayValue($fieldValue['value'], $fieldID, $participants[0]->id); + $customGroup[$customFields[$fieldID]['groupTitle']][$customFields[$fieldID]['label']] = str_replace(' ', '', $formattedValue); + } } }