Skip to content

Commit

Permalink
Merge pull request #15744 from yashodha/participant_edit
Browse files Browse the repository at this point in the history
(dev/core#1065) Participant in Edit mode needs to be shown consistently
  • Loading branch information
eileenmcnaughton authored Nov 6, 2019
2 parents 2350cd4 + 2944baa commit 38e0390
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
13 changes: 8 additions & 5 deletions CRM/Event/Form/Participant.php
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,9 @@ public function setDefaultValues() {
$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) {
Expand Down Expand Up @@ -641,11 +644,11 @@ public function buildQuickForm() {
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 = [
Expand Down
15 changes: 4 additions & 11 deletions templates/CRM/Event/Form/Participant.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -227,17 +227,10 @@
{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}&nbsp;</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">
Expand Down

0 comments on commit 38e0390

Please sign in to comment.