Skip to content

Commit

Permalink
Merge pull request #10661 from jitendrapurohit/CRM-20507
Browse files Browse the repository at this point in the history
CRM-20507 - Allow only public custom groups to display on participant receipts
  • Loading branch information
eileenmcnaughton authored Aug 12, 2017
2 parents 2c2409c + af6de2f commit 5143b9a
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 @@ -1628,9 +1628,12 @@ public function submit($params) {
//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 5143b9a

Please sign in to comment.