From e3665bb8c2f24029d8b64420935e2f7426b42b9e Mon Sep 17 00:00:00 2001 From: yashodha Date: Wed, 10 Oct 2018 11:49:35 +0530 Subject: [PATCH] CRM-21677 - report clean up --- CRM/Report/Form/Case/Demographics.php | 16 ++-------------- CRM/Report/Form/Case/Detail.php | 13 +------------ 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/CRM/Report/Form/Case/Demographics.php b/CRM/Report/Form/Case/Demographics.php index 8349f909ad..a1429cbab6 100644 --- a/CRM/Report/Form/Case/Demographics.php +++ b/CRM/Report/Form/Case/Demographics.php @@ -422,20 +422,6 @@ where (cg.extends='Contact' OR cg.extends='Individual' OR cg.extends_entity_colu $entryFound = TRUE; } - // handle country - if (array_key_exists('civicrm_address_country_id', $row)) { - if ($value = $row['civicrm_address_country_id']) { - $rows[$rowNum]['civicrm_address_country_id'] = CRM_Core_PseudoConstant::country($value, FALSE); - } - $entryFound = TRUE; - } - if (array_key_exists('civicrm_address_state_province_id', $row)) { - if ($value = $row['civicrm_address_state_province_id']) { - $rows[$rowNum]['civicrm_address_state_province_id'] = CRM_Core_PseudoConstant::stateProvince($value, FALSE); - } - $entryFound = TRUE; - } - // handle custom fields foreach ($row as $k => $r) { if (substr($k, 0, 13) == 'civicrm_value' || @@ -450,6 +436,8 @@ where (cg.extends='Contact' OR cg.extends='Individual' OR cg.extends_entity_colu } } + $entryFound = $this->alterDisplayAddressFields($row, $rows, $rowNum, NULL, NULL) ? TRUE : $entryFound; + // skip looking further in rows, if first row itself doesn't // have the column we need if (!$entryFound) { diff --git a/CRM/Report/Form/Case/Detail.php b/CRM/Report/Form/Case/Detail.php index 34572e2da5..4e40ef8d87 100644 --- a/CRM/Report/Form/Case/Detail.php +++ b/CRM/Report/Form/Case/Detail.php @@ -650,18 +650,6 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form { } $entryFound = TRUE; } - if (array_key_exists('civicrm_address_country_id', $row)) { - if ($value = $row['civicrm_address_country_id']) { - $rows[$rowNum]['civicrm_address_country_id'] = CRM_Core_PseudoConstant::country($value, FALSE); - } - $entryFound = TRUE; - } - if (array_key_exists('civicrm_address_state_province_id', $row)) { - if ($value = $row['civicrm_address_state_province_id']) { - $rows[$rowNum]['civicrm_address_state_province_id'] = CRM_Core_PseudoConstant::stateProvince($value, FALSE); - } - $entryFound = TRUE; - } if (array_key_exists('civicrm_activity_last_last_activity_activity_subject', $row) && empty($row['civicrm_activity_last_last_activity_activity_subject']) ) { @@ -715,6 +703,7 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form { $entryFound = TRUE; } + $entryFound = $this->alterDisplayAddressFields($row, $rows, $rowNum, NULL, NULL) ? TRUE : $entryFound; if (!$entryFound) { break; } -- 2.25.1