CRM-13214, fixed notices and now it also exports correct values
authorkurund <kurund@civicrm.org>
Tue, 13 Aug 2013 10:23:13 +0000 (15:53 +0530)
committerkurund <kurund@civicrm.org>
Tue, 13 Aug 2013 10:23:13 +0000 (15:53 +0530)
----------------------------------------
* CRM-13214: Activity Export : Primary Fields - notices on renamed pseudoconstants (gender, suffix, prefix)
  http://issues.civicrm.org/jira/browse/CRM-13214

CRM/Export/BAO/Export.php

index b6e6f79cc8c4b1047362ba2397310cbe17c8f56c..ee049d01818936b0d3a3af80d7e7095949c666c5 100644 (file)
@@ -801,16 +801,8 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c
           elseif ($field == 'pledge_next_pay_amount') {
             $row[$field] = $dao->pledge_next_pay_amount + $dao->pledge_outstanding_amount;
           }
-          elseif ($field == 'prefix_id' || $field == 'suffix_id' || $field == 'gender_id') {
-            if ($field == 'prefix_id') {
-              $row[$field] = $dao->individual_prefix;
-            }
-            elseif ($field == 'suffix_id') {
-              $row[$field] = $dao->individual_suffix;
-            }
-            else {
-              $row[$field] = $dao->gender;
-            }
+          elseif (in_array(substr($field, 0, -3), array('gender', 'prefix', 'suffix'))) {
+            $row[$field] = CRM_Core_PseudoConstant::getLabel('CRM_Contact_DAO_Contact', $field, $dao->$field);
           }
           elseif (is_array($value) && $field == 'location') {
             // fix header for location type case