From 4bd532e8a52a3232c18d19da571c8fac0fae235b Mon Sep 17 00:00:00 2001 From: Jitendra Purohit Date: Fri, 23 Jun 2017 15:04:15 +0530 Subject: [PATCH] CRM-20633 : custom field set displayed twice on register event Participant --- CRM/Custom/Form/CustomDataByType.php | 3 ++- templates/CRM/Event/Form/Participant.tpl | 4 ++-- templates/CRM/common/customData.tpl | 6 +++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CRM/Custom/Form/CustomDataByType.php b/CRM/Custom/Form/CustomDataByType.php index 02a76f198f..811daa5573 100644 --- a/CRM/Custom/Form/CustomDataByType.php +++ b/CRM/Custom/Form/CustomDataByType.php @@ -47,6 +47,7 @@ class CRM_Custom_Form_CustomDataByType extends CRM_Core_Form { $this->_groupCount = CRM_Utils_Request::retrieve('cgcount', 'Positive'); $this->_entityId = CRM_Utils_Request::retrieve('entityID', 'Positive'); $this->_groupID = CRM_Utils_Request::retrieve('groupID', 'Positive'); + $this->_onlySubtype = CRM_Utils_Request::retrieve('onlySubtype', 'Boolean'); $this->assign('cdType', FALSE); $this->assign('cgCount', $this->_groupCount); @@ -57,7 +58,7 @@ class CRM_Custom_Form_CustomDataByType extends CRM_Core_Form { if (!is_array($this->_subType) && strstr($this->_subType, CRM_Core_DAO::VALUE_SEPARATOR)) { $this->_subType = str_replace(CRM_Core_DAO::VALUE_SEPARATOR, ',', trim($this->_subType, CRM_Core_DAO::VALUE_SEPARATOR)); } - CRM_Custom_Form_CustomData::setGroupTree($this, $this->_subType, $this->_groupID); + CRM_Custom_Form_CustomData::setGroupTree($this, $this->_subType, $this->_groupID, $this->_onlySubtype); $this->assign('suppressForm', TRUE); $this->controller->_generateQFKey = FALSE; diff --git a/templates/CRM/Event/Form/Participant.tpl b/templates/CRM/Event/Form/Participant.tpl index af389ac715..5816fffa38 100644 --- a/templates/CRM/Event/Form/Participant.tpl +++ b/templates/CRM/Event/Form/Participant.tpl @@ -357,8 +357,8 @@ $('#campaign_id', $form).select2('val', info.campaign_id); // Event and event-type custom data - CRM.buildCustomData('Participant', eventId, {/literal}{$eventNameCustomDataTypeID}{literal}); - CRM.buildCustomData('Participant', info.event_type_id, {/literal}{$eventTypeCustomDataTypeID}{literal}); + CRM.buildCustomData('Participant', eventId, {/literal}{$eventNameCustomDataTypeID}{literal}, null, null, null, true); + CRM.buildCustomData('Participant', info.event_type_id, {/literal}{$eventTypeCustomDataTypeID}{literal}, null, null, null, true); buildFeeBlock(); }); diff --git a/templates/CRM/common/customData.tpl b/templates/CRM/common/customData.tpl index 1f0854d3dc..278e7f8c33 100644 --- a/templates/CRM/common/customData.tpl +++ b/templates/CRM/common/customData.tpl @@ -26,7 +26,7 @@ {literal}