From 2944baacc9408a0acfb0bd7f0129c0ee3441c9ad Mon Sep 17 00:00:00 2001 From: yashodha Date: Wed, 6 Nov 2019 14:37:55 +0530 Subject: [PATCH] (dev/core#1065) Participant in Edit mode needs to be shown consistently --- CRM/Event/Form/Participant.php | 13 ++++++++----- templates/CRM/Event/Form/Participant.tpl | 15 ++++----------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index 54e82d0d36..578dbb07f9 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -481,6 +481,9 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment $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) { @@ -641,11 +644,11 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment 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 = [ diff --git a/templates/CRM/Event/Form/Participant.tpl b/templates/CRM/Event/Form/Participant.tpl index e62dbf5ae7..47ac0e78f4 100644 --- a/templates/CRM/Event/Form/Participant.tpl +++ b/templates/CRM/Event/Form/Participant.tpl @@ -227,17 +227,10 @@ {else} {* If action is other than Delete *}
{include file="CRM/common/formButtons.tpl" location="top"}
- {if $single and $context neq 'standalone'} - - - - - {else} - - - - - {/if} + + + + {if $action EQ 2} {if $additionalParticipants} {* Display others registered by this participant *} -- 2.25.1
{$displayName} 
{$form.contact_id.label}{$form.contact_id.html}
{$form.contact_id.label}{$form.contact_id.html}