Skip to content

Commit

Permalink
(dev/core#1065) Member in Edit mode needs to be shown consistently
Browse files Browse the repository at this point in the history
  • Loading branch information
yashodha committed Sep 30, 2019
1 parent 592fc2b commit ac0ef1d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
13 changes: 8 additions & 5 deletions CRM/Member/Form/Membership.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,11 @@ public function setDefaultValues() {
}
}
}
else {
if ($this->_contactID) {
$defaults['contact_id'] = $this->_contactID;
}
}

//set Soft Credit Type to Gift by default
$scTypes = CRM_Core_OptionGroup::values("soft_credit_type");
Expand Down Expand Up @@ -493,11 +498,9 @@ public function buildQuickForm() {
return;
}

if ($this->_context == 'standalone') {
$this->addEntityRef('contact_id', ts('Contact'), [
'create' => TRUE,
'api' => ['extra' => ['email']],
], TRUE);
$contactField = $this->addEntityRef('contact_id', ts('Contact'), ['create' => TRUE, 'api' => ['extra' => ['email']]], TRUE);
if ($this->_context != 'standalone') {
$contactField->freeze();
}

$selOrgMemType[0][0] = $selMemTypeOrg[0] = ts('- select -');
Expand Down
12 changes: 4 additions & 8 deletions templates/CRM/Member/Form/Membership.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,10 @@
</div>
{else}
<table class="form-layout-compressed">
{if $context neq 'standalone'}
<tr>
<td class="font-size12pt label"><strong>{ts}Member{/ts}</strong></td><td class="font-size12pt"><strong>{$displayName}</strong></td>
</tr>
{else}
<td class="label">{$form.contact_id.label}</td>
<td>{$form.contact_id.html}</td>
{/if}
<tr class="crm-membership-form-contact-id">
<td class="label">{$form.contact_id.label}</td>
<td>{$form.contact_id.html}</td>
</tr>
<tr class="crm-membership-form-block-membership_type_id">
<td class="label">{$form.membership_type_id.label}</td>
<td><span id='mem_type_id'>{$form.membership_type_id.html}</span>
Expand Down

0 comments on commit ac0ef1d

Please sign in to comment.