Skip to content

Commit

Permalink
Allow only public custom groups to display on participants receipts
Browse files Browse the repository at this point in the history
  • Loading branch information
Jitendra Purohit committed Jul 14, 2017
1 parent 03cefdd commit af6de2f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions CRM/Event/Form/Participant.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

Expand Down

0 comments on commit af6de2f

Please sign in to comment.