From ac44bb1cbd38539e3c37015199c3adc2c226aa18 Mon Sep 17 00:00:00 2001 From: Web Access Date: Thu, 5 Feb 2015 15:27:40 +0530 Subject: [PATCH] Fix for CRM-15850 --- CRM/Core/BAO/Address.php | 4 ++++ templates/CRM/Contact/Form/ShareAddress.tpl | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CRM/Core/BAO/Address.php b/CRM/Core/BAO/Address.php index e5842af152..cd9cc5375c 100644 --- a/CRM/Core/BAO/Address.php +++ b/CRM/Core/BAO/Address.php @@ -498,6 +498,7 @@ class CRM_Core_BAO_Address extends CRM_Core_DAO_Address { $address->find(); + $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'); $count = 1; while ($address->fetch()) { // deprecate reference. @@ -518,6 +519,9 @@ class CRM_Core_BAO_Address extends CRM_Core_DAO_Address { CRM_Core_DAO::storeValues($address, $values); // add state and country information: CRM-369 + if (!empty($address->location_type_id)) { + $values['location_type'] = CRM_Utils_Array::value($address->location_type_id, $locationTypes); + } if (!empty($address->state_province_id)) { $address->state = CRM_Core_PseudoConstant::stateProvinceAbbreviation($address->state_province_id, FALSE); $address->state_name = CRM_Core_PseudoConstant::stateProvince($address->state_province_id, FALSE); diff --git a/templates/CRM/Contact/Form/ShareAddress.tpl b/templates/CRM/Contact/Form/ShareAddress.tpl index 9ffa5a6962..d4f924d880 100644 --- a/templates/CRM/Contact/Form/ShareAddress.tpl +++ b/templates/CRM/Contact/Form/ShareAddress.tpl @@ -36,7 +36,7 @@ {assign var="sa_name" value="selected_shared_address-`$blockId`"} {assign var="sa_id" value="`$sa_name`-`$sa.id`"} -
+ {if $sa.location_type}({$sa.location_type}){/if}
{/foreach} {/if} @@ -99,7 +99,7 @@ } var name = 'selected_shared_address-'+ blockNo, id = name + '-' + val.id; - addressHTML += '
'; + addressHTML += '('+val.location_type+')
'; }); if (!addressHTML) { -- 2.25.1