From: yashodha Date: Mon, 30 Sep 2019 11:23:58 +0000 (+0530) Subject: (dev/core#1065) Member in Edit mode needs to be shown consistently X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=ac0ef1dc0e997cfbd9817f2b3fd0c95f492b7bd2;p=civicrm-core.git (dev/core#1065) Member in Edit mode needs to be shown consistently --- diff --git a/CRM/Member/Form/Membership.php b/CRM/Member/Form/Membership.php index bdc9c86110..51df038519 100644 --- a/CRM/Member/Form/Membership.php +++ b/CRM/Member/Form/Membership.php @@ -337,6 +337,11 @@ class CRM_Member_Form_Membership extends CRM_Member_Form { } } } + 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"); @@ -493,11 +498,9 @@ class CRM_Member_Form_Membership extends CRM_Member_Form { 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 -'); diff --git a/templates/CRM/Member/Form/Membership.tpl b/templates/CRM/Member/Form/Membership.tpl index c8d2cd5439..d16dbfa406 100644 --- a/templates/CRM/Member/Form/Membership.tpl +++ b/templates/CRM/Member/Form/Membership.tpl @@ -83,14 +83,10 @@ {else} - {if $context neq 'standalone'} - - - - {else} - - - {/if} + + + +
{ts}Member{/ts}{$displayName}
{$form.contact_id.label}{$form.contact_id.html}
{$form.contact_id.label}{$form.contact_id.html}
{$form.membership_type_id.label} {$form.membership_type_id.html}