}
$contactID = CRM_Contact_BAO_Contact::createProfileContact($params, $fields, $this->_contactId, NULL, NULL, $ctype);
}
-
- $customFieldsRole = [];
- foreach ($this->getSubmittedValue('role_id') as $roleKey) {
- $customFieldsRole = CRM_Utils_Array::crmArrayMerge(CRM_Core_BAO_CustomField::getFields('Participant',
- FALSE, FALSE, $roleKey, $this->_roleCustomDataTypeID), $customFieldsRole);
- }
- $customFieldsEvent = CRM_Core_BAO_CustomField::getFields('Participant',
- FALSE,
- FALSE,
- CRM_Utils_Array::value('event_id', $params),
- $this->_eventNameCustomDataTypeID
- );
- $customFieldsEventType = CRM_Core_BAO_CustomField::getFields('Participant',
- FALSE,
- FALSE,
- $this->_eventTypeId,
- $this->_eventTypeCustomDataTypeID
- );
- $customFields = CRM_Utils_Array::crmArrayMerge($customFieldsRole,
- CRM_Core_BAO_CustomField::getFields('Participant', FALSE, FALSE, NULL, NULL, TRUE)
- );
- $customFields = CRM_Utils_Array::crmArrayMerge($customFieldsEvent, $customFields);
- $customFields = CRM_Utils_Array::crmArrayMerge($customFieldsEventType, $customFields);
-
$params['custom'] = CRM_Core_BAO_CustomField::postProcess($params, $this->_id, $this->getDefaultEntity());
//do cleanup line items if participant edit the Event Fee.
}
if (!empty($params['send_receipt'])) {
- $result = $this->sendReceipts($params, $customFields, $participants, $lineItem[0] ?? [], $additionalParticipantDetails ?? []);
+ $result = $this->sendReceipts($params, $participants, $lineItem[0] ?? [], $additionalParticipantDetails ?? []);
}
// set the participant id if it is not set
/**
* @param $params
- * @param array $customFields
* @param array $participants
* @param $lineItem
* @param $additionalParticipantDetails
* @return array
* @throws \CRM_Core_Exception
*/
- protected function sendReceipts($params, array $customFields, array $participants, $lineItem, $additionalParticipantDetails): array {
+ protected function sendReceipts($params, array $participants, $lineItem, $additionalParticipantDetails): array {
$sent = [];
$notSent = [];
$this->assign('module', 'Event Registration');
$customGroup = [];
//format submitted data
+ $customFieldsRole = [];
+ foreach ($this->getSubmittedValue('role_id') as $roleKey) {
+ $customFieldsRole = CRM_Utils_Array::crmArrayMerge(CRM_Core_BAO_CustomField::getFields('Participant',
+ FALSE, FALSE, $roleKey, $this->_roleCustomDataTypeID), $customFieldsRole);
+ }
+ $customFieldsEvent = CRM_Core_BAO_CustomField::getFields('Participant',
+ FALSE,
+ FALSE,
+ $this->getEventID(),
+ $this->_eventNameCustomDataTypeID
+ );
+ $customFieldsEventType = CRM_Core_BAO_CustomField::getFields('Participant',
+ FALSE,
+ FALSE,
+ $this->_eventTypeId,
+ $this->_eventTypeCustomDataTypeID
+ );
+ $customFields = CRM_Utils_Array::crmArrayMerge($customFieldsRole,
+ CRM_Core_BAO_CustomField::getFields('Participant', FALSE, FALSE, NULL, NULL, TRUE)
+ );
+ $customFields = CRM_Utils_Array::crmArrayMerge($customFieldsEvent, $customFields);
+ $customFields = CRM_Utils_Array::crmArrayMerge($customFieldsEventType, $customFields);
foreach ($params['custom'] as $fieldID => $values) {
foreach ($values as $fieldValue) {
$isPublic = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $fieldValue['custom_group_id'], 'is_public');