Skip to content

Commit

Permalink
Merge pull request #12885 from yashodha/report-fixes
Browse files Browse the repository at this point in the history
CRM-21677 - report clean up
  • Loading branch information
eileenmcnaughton authored Oct 3, 2018
2 parents f98177c + f9ec8c7 commit 473fb3b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 46 deletions.
14 changes: 0 additions & 14 deletions CRM/Report/Form/Member/ContributionDetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -737,20 +737,6 @@ public function alterDisplay(&$rows) {
$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']) &&
Expand Down
17 changes: 1 addition & 16 deletions CRM/Report/Form/Member/Lapse.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,22 +377,6 @@ public function alterDisplay(&$rows) {
$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)
Expand All @@ -413,6 +397,7 @@ public function alterDisplay(&$rows) {
$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) {
Expand Down
17 changes: 1 addition & 16 deletions CRM/Report/Form/Membership/Summary.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,22 +388,6 @@ public function alterDisplay(&$rows) {
$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)
Expand All @@ -418,6 +402,7 @@ public function alterDisplay(&$rows) {
$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) {
Expand Down

0 comments on commit 473fb3b

Please sign in to comment.