From f9ec8c77f586c9508bfb923714bd214b7738ce49 Mon Sep 17 00:00:00 2001 From: yashodha Date: Mon, 1 Oct 2018 16:49:33 +0530 Subject: [PATCH] CRM-21677 - report clean up --- CRM/Report/Form/Member/ContributionDetail.php | 14 -------------- CRM/Report/Form/Member/Lapse.php | 17 +---------------- CRM/Report/Form/Membership/Summary.php | 17 +---------------- 3 files changed, 2 insertions(+), 46 deletions(-) diff --git a/CRM/Report/Form/Member/ContributionDetail.php b/CRM/Report/Form/Member/ContributionDetail.php index db166f8165..0933df557e 100644 --- a/CRM/Report/Form/Member/ContributionDetail.php +++ b/CRM/Report/Form/Member/ContributionDetail.php @@ -737,20 +737,6 @@ class CRM_Report_Form_Member_ContributionDetail extends CRM_Report_Form { $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_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; - } - // convert donor sort name to link if (array_key_exists('civicrm_contact_sort_name', $row) && !empty($rows[$rowNum]['civicrm_contact_sort_name']) && diff --git a/CRM/Report/Form/Member/Lapse.php b/CRM/Report/Form/Member/Lapse.php index 0b7dd45cf0..5da18a763c 100644 --- a/CRM/Report/Form/Member/Lapse.php +++ b/CRM/Report/Form/Member/Lapse.php @@ -377,22 +377,6 @@ class CRM_Report_Form_Member_Lapse extends CRM_Report_Form { $entryFound = TRUE; } - // handle state province - 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 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; - } - // convert display name to links if (array_key_exists('civicrm_contact_sort_name', $row) && array_key_exists('civicrm_contact_id', $row) @@ -413,6 +397,7 @@ class CRM_Report_Form_Member_Lapse extends CRM_Report_Form { $entryFound = TRUE; } + $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/Membership/Summary.php b/CRM/Report/Form/Membership/Summary.php index daf03f9ff6..48cfffd253 100644 --- a/CRM/Report/Form/Membership/Summary.php +++ b/CRM/Report/Form/Membership/Summary.php @@ -388,22 +388,6 @@ LEFT JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']} $entryFound = TRUE; } - // handle state province - 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::stateProvinceAbbreviation($value, FALSE); - } - $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; - } - // convert display name to links if (array_key_exists('civicrm_contact_sort_name', $row) && array_key_exists('civicrm_contact_id', $row) @@ -418,6 +402,7 @@ LEFT JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']} $entryFound = TRUE; } + $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) { -- 2.25.1