From 479696ede3fb77238590f004c55cb6877246ca43 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sat, 15 Feb 2014 16:24:05 -0800 Subject: [PATCH] CRM-13929 Refactor participant form --- CRM/Event/Form/Participant.php | 10 +++------- templates/CRM/Event/Form/Participant.tpl | 5 ++++- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index 6b5e6ad854..7e4e20122a 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -722,7 +722,7 @@ SELECT civicrm_custom_group.name as name, $urlPath = 'civicrm/contact/view/participant'; $urlParams = "reset=1&cid={$this->_contactId}&context=participant"; if ($this->_context == 'standalone') { - CRM_Contact_Form_NewContact::buildQuickForm($this); + $this->addEntityRef('contact_id', ts('Contact'), array('create' => TRUE), TRUE); $urlParams = 'reset=1&context=standalone'; $urlPath = 'civicrm/participant/add'; } @@ -982,10 +982,6 @@ loadCampaign( {$this->_eID}, {$eventCampaigns} ); } $errorMsg = array(); - //check if contact is selected in standalone mode - if (isset($values['contact_select_id'][1]) && !$values['contact_select_id'][1]) { - $errorMsg['contact[1]'] = ts('Please select a contact or create new contact'); - } if (!empty($values['payment_processor_id'])) { // make sure that credit card number and cvv are valid @@ -1055,8 +1051,8 @@ loadCampaign( {$this->_eID}, {$eventCampaigns} ); $participantStatus = CRM_Event_PseudoConstant::participantStatus(); // set the contact, when contact is selected - if (!empty($params['contact_select_id'])) { - $this->_contactId = $params['contact_select_id'][1]; + if (!empty($params['contact_id'])) { + $this->_contactId = $params['contact_id']; } if ($this->_priceSetId && $isQuickConfig = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config')) { $this->_quickConfig = $isQuickConfig; diff --git a/templates/CRM/Event/Form/Participant.tpl b/templates/CRM/Event/Form/Participant.tpl index 463c4bebe1..a78d125d97 100644 --- a/templates/CRM/Event/Form/Participant.tpl +++ b/templates/CRM/Event/Form/Participant.tpl @@ -218,7 +218,10 @@ {if !$participantMode and !$email and $outBound_option != 2 } {assign var='profileCreateCallback' value=1} {/if} - {include file="CRM/Contact/Form/NewContact.tpl"} + + {$form.contact_id.label} + {$form.contact_id.html} + {/if} {if $action EQ 2} {if $additionalParticipants} {* Display others registered by this participant *} -- 2.25.1