CRM-13929 Refactor participant form
authorColeman Watts <coleman@civicrm.org>
Sun, 16 Feb 2014 00:24:05 +0000 (16:24 -0800)
committerColeman Watts <coleman@civicrm.org>
Sun, 16 Feb 2014 00:24:05 +0000 (16:24 -0800)
CRM/Event/Form/Participant.php
templates/CRM/Event/Form/Participant.tpl

index 6b5e6ad8545aa19b360976fe7682d019721a0608..7e4e20122aa2afaac695f26f138c91108116082f 100644 (file)
@@ -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;
index 463c4bebe1356be4be1402de84b1fae151ace360..a78d125d971806c71e5108e2eaa3f8936fd4b961 100644 (file)
             {if !$participantMode and !$email and $outBound_option != 2 }
               {assign var='profileCreateCallback' value=1}
             {/if}
-          {include file="CRM/Contact/Form/NewContact.tpl"}
+            <tr class="crm-participant-form-contact-id">
+              <td class="label">{$form.contact_id.label}</td>
+              <td>{$form.contact_id.html}</td>
+            </tr>
           {/if}
           {if $action EQ 2}
             {if $additionalParticipants} {* Display others registered by this participant *}