From f5a47ead1c961bc62f9d4b383481ebb22a053f7e Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Fri, 3 Feb 2017 17:35:15 +0530 Subject: [PATCH] CRM-19745: Image URL field doesn't show up on CiviEvent Additional Participants Profile --- CRM/Event/BAO/Event.php | 4 +++- CRM/Event/Form/Registration/AdditionalParticipant.php | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CRM/Event/BAO/Event.php b/CRM/Event/BAO/Event.php index 8fa666d632..41cf64598f 100644 --- a/CRM/Event/BAO/Event.php +++ b/CRM/Event/BAO/Event.php @@ -1664,7 +1664,9 @@ WHERE id = $cfID $htmlType = $dao->html_type; if ($htmlType == 'File') { - $values[$index] = $params[$index]; + $path = CRM_Utils_Array::value('name', $params[$name]); + $fileType = CRM_Utils_Array::value('type', $params[$name]); + $values[$index] = CRM_Utils_File::getFileURL($path, $fileType); } else { if ($dao->data_type == 'Int' || diff --git a/CRM/Event/Form/Registration/AdditionalParticipant.php b/CRM/Event/Form/Registration/AdditionalParticipant.php index 728cfb0043..f23867627d 100644 --- a/CRM/Event/Form/Registration/AdditionalParticipant.php +++ b/CRM/Event/Form/Registration/AdditionalParticipant.php @@ -186,7 +186,7 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R 'post', ) as $keys) { if (isset($this->_values['additional_custom_' . $keys . '_id'])) { - $this->buildCustom($this->_values['additional_custom_' . $keys . '_id'], 'additionalCustom' . ucfirst($keys), TRUE); + $this->buildCustom($this->_values['additional_custom_' . $keys . '_id'], 'additionalCustom' . ucfirst($keys)); $$keys = CRM_Core_BAO_UFGroup::getFields($this->_values['additional_custom_' . $keys . '_id']); } foreach (array( @@ -356,7 +356,7 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R if ($allowToProceed) { $buttons = array_merge($buttons, array( array( - 'type' => 'next', + 'type' => 'upload', 'name' => ts('Continue'), 'spacing' => '                  ', 'isDefault' => TRUE, @@ -613,6 +613,9 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R $params['contact_id'] = CRM_Event_Form_Registration_Register::getRegistrationContactID($params, $this, TRUE); } + if (!empty($params['image_URL'])) { + CRM_Contact_BAO_Contact::processImageParams($params); + } //carry campaign to partcipants. if (array_key_exists('participant_campaign_id', $params)) { $params['campaign_id'] = $params['participant_campaign_id']; -- 2.25.1