Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(dev/core#1065) Participant in Edit mode needs to be shown consistently #15744

Merged
merged 1 commit into from
Nov 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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