CRM-21830: Add 'state_province_name' token and set appropriate value to it so that...
authorvarshith89 <vinu@compucorp.co.uk>
Wed, 7 Mar 2018 03:04:59 +0000 (03:04 +0000)
committervarshith89 <vinu@compucorp.co.uk>
Wed, 7 Mar 2018 03:04:59 +0000 (03:04 +0000)
CRM/Utils/Address.php

index 8a65d4255d9c1cd16b88ee546964975868fb6439..c5f8985aab4fc07e653d9db1b16c63d2a1ce9601 100644 (file)
@@ -331,6 +331,7 @@ class CRM_Utils_Address {
       "city" => "billing_city-{$billingLocationTypeID}",
       "postal_code" => "billing_postal_code-{$billingLocationTypeID}",
       "state_province" => "state_province-{$billingLocationTypeID}",
+      "state_province_name" => "state_province-{$billingLocationTypeID}",
       "country" => "country-{$billingLocationTypeID}",
     );
 
@@ -348,10 +349,13 @@ class CRM_Utils_Address {
           $value = $params[$alternateName];
         }
       }
-      if (is_numeric($value) && ($name == 'state_province' || $name == 'country')) {
+      if (is_numeric($value) && ($name == 'state_province' || $name == 'state_province_name' || $name == 'country')) {
         if ($name == 'state_province') {
           $addressFields[$name] = CRM_Core_PseudoConstant::stateProvinceAbbreviation($value);
         }
+        if ($name == 'state_province_name') {
+          $addressFields[$name] = CRM_Core_PseudoConstant::stateProvince($value);
+        }
         if ($name == 'country') {
           $addressFields[$name] = CRM_Core_PseudoConstant::countryIsoCode($value);
         }