From: yashodha Date: Mon, 18 Jul 2022 09:13:13 +0000 (+0530) Subject: (dev/core#3732) Show billing address on Edit contribution screen as well X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=813eebf4b82864d67ebdf4415240c65bbccfac33;p=civicrm-core.git (dev/core#3732) Show billing address on Edit contribution screen as well --- diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index 60cc091581..7be876efb9 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -465,6 +465,14 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP $defaults['campaign_id'] = $this->_pledgeValues['campaign_id']; } + $billing_address = ''; + if (!empty($defaults['address_id'])) { + $addressDetails = CRM_Core_BAO_Address::getValues(['id' => $defaults['address_id']], FALSE, 'id'); + $addressDetails = array_values($addressDetails); + $billing_address = $addressDetails[0]['display']; + } + $this->assign('billing_address', $billing_address); + $this->_defaults = $defaults; return $defaults; } diff --git a/templates/CRM/Contribute/Form/Contribution.tpl b/templates/CRM/Contribute/Form/Contribution.tpl index af2ec9f53f..87157abdfb 100644 --- a/templates/CRM/Contribute/Form/Contribution.tpl +++ b/templates/CRM/Contribute/Form/Contribution.tpl @@ -413,6 +413,14 @@ {/foreach} {/if} + {if $billing_address} +
+ {ts}Billing Address{/ts} +
+ {$billing_address|nl2br} +
+
+ {/if}
{include file="CRM/common/formButtons.tpl" location="bottom"}