Skip to content

Commit

Permalink
Re-order owner_membership_id field options so that primary members on…
Browse files Browse the repository at this point in the history
…ly and non-primary-members-only filters are at the top
  • Loading branch information
seamuslee001 committed Jun 19, 2019
1 parent a6d4b20 commit 8db9dd0
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 9 deletions.
13 changes: 10 additions & 3 deletions CRM/Report/Form/Member/ContributionDetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -613,14 +613,21 @@ public function statistics(&$rows) {
}

public function getOperationPair($type = "string", $fieldName = NULL) {
$result = parent::getOperationPair($type, $fieldName);

//re-name IS NULL/IS NOT NULL for clarity
if ($fieldName == 'owner_membership_id') {
$result = [];
$result['nll'] = ts('Primary members only');
$result['nnll'] = ts('Non-primary members only');
$options = parent::getOperationPair($type, $fieldName);
foreach ($options as $key => $label) {
if (!array_key_exists($key, $result)) {
$result[$key] = $label;
}
}
}
else {
$result = parent::getOperationPair($type, $fieldName);
}

return $result;
}

Expand Down
13 changes: 10 additions & 3 deletions CRM/Report/Form/Member/Detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,14 +285,21 @@ public function from() {
}

public function getOperationPair($type = "string", $fieldName = NULL) {
$result = parent::getOperationPair($type, $fieldName);

//re-name IS NULL/IS NOT NULL for clarity
if ($fieldName == 'owner_membership_id') {
$result = [];
$result['nll'] = ts('Primary members only');
$result['nnll'] = ts('Non-primary members only');
$options = parent::getOperationPair($type, $fieldName);
foreach ($options as $key => $label) {
if (!array_key_exists($key, $result)) {
$result[$key] = $label;
}
}
}
else {
$result = parent::getOperationPair($type, $fieldName);
}

return $result;
}

Expand Down
13 changes: 10 additions & 3 deletions CRM/Report/Form/Member/Summary.php
Original file line number Diff line number Diff line change
Expand Up @@ -437,14 +437,21 @@ public function postProcess() {
}

public function getOperationPair($type = "string", $fieldName = NULL) {
$result = parent::getOperationPair($type, $fieldName);

//re-name IS NULL/IS NOT NULL for clarity
if ($fieldName == 'owner_membership_id') {
$result = [];
$result['nll'] = ts('Primary members only');
$result['nnll'] = ts('Non-primary members only');
$options = parent::getOperationPair($type, $fieldName);
foreach ($options as $key => $label) {
if (!array_key_exists($key, $result)) {
$result[$key] = $label;
}
}
}
else {
$result = parent::getOperationPair($type, $fieldName);
}

return $result;
}

Expand Down

0 comments on commit 8db9dd0

Please sign in to comment.