$this->assign('registered_by_display_name', CRM_Contact_BAO_Contact::displayName($registered_by_contact_id));
}
}
+ elseif ($this->_contactID) {
+ $defaults[$this->_id]['contact_id'] = $this->_contactID;
+ }
//setting default register date
if ($this->_action == CRM_Core_Action::ADD) {
return;
}
- if ($this->_single && $this->_context == 'standalone') {
- $this->addEntityRef('contact_id', ts('Contact'), [
- 'create' => TRUE,
- 'api' => ['extra' => ['email']],
- ], TRUE);
+ if ($this->_single) {
+ $contactField = $this->addEntityRef('contact_id', ts('Participant'), ['create' => TRUE, 'api' => ['extra' => ['email']]], TRUE);
+ if ($this->_context != 'standalone') {
+ $contactField->freeze();
+ }
}
$eventFieldParams = [
{else} {* If action is other than Delete *}
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
<table class="form-layout-compressed">
- {if $single and $context neq 'standalone'}
- <tr class="crm-participant-form-block-displayName">
- <td class="label font-size12pt"><label>{ts}Participant{/ts}</label></td>
- <td class="font-size12pt view-value">{$displayName} </td>
- </tr>
- {else}
- <tr class="crm-participant-form-contact-id">
- <td class="label">{$form.contact_id.label}</td>
- <td>{$form.contact_id.html}</td>
- </tr>
- {/if}
+ <tr class="crm-participant-form-contact-id">
+ <td class="label">{$form.contact_id.label}</td>
+ <td>{$form.contact_id.html}</td>
+ </tr>
{if $action EQ 2}
{if $additionalParticipants} {* Display others registered by this participant *}
<tr class="crm-participant-form-block-additionalParticipants">