Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/core#682 Add basic contact filters to Summary Contributions Report #13498

Merged
merged 1 commit into from
Jan 31, 2019

Conversation

francescbassas
Copy link
Contributor

@francescbassas francescbassas commented Jan 23, 2019

Overview

Contributions of deleted contacts are shown on Summary Contributions Report. Adding basic contact filters to the Summary Contributions Report will prevent these "deleted" contributions from being included. In addition it will enable new possibilities when applying contact filters to the report.

Before

before

After

after

Comments

As a summary report we are interested to include deceased contacts. For these reason we add a new param to the getBasicContactFilters() function.

@civibot
Copy link

civibot bot commented Jan 23, 2019

(Standard links)

@civibot civibot bot added the master label Jan 23, 2019
@colemanw
Copy link
Member

@francescbassas thanks for the PR. But I'm confused. Your description and your code don't seem to match. From your description you are adding filters, but your code isn't doing that, it's just changing the default value for is_deceased

@francescbassas
Copy link
Contributor Author

Thanks @colemanw for reviewing. Filters added on line 84 at CRM/Report/Form/Contribute/Summary.php using the funcion getBasicContactFilters.

@colemanw
Copy link
Member

Sorry I missed that.
@francescbassas what is the reason for passing NULL as the default value for deceased?

@francescbassas
Copy link
Contributor Author

francescbassas commented Jan 24, 2019

Its purpose is to avoid the default behavior of the function getBasicContactFilters (exclude deceased contacts). Setting to NULL report not filter for is_deceased field. In general, in a contribution report, you are interested in showing all contributions regardless of whether or not you are dealing with deceased contacts or not.

I found a related discussion in this dismissed PR #11244.

@colemanw
Copy link
Member

Ok that makes sense. A more forward-looking solution might be to have the function take an array of $defaults (which defaults to an empty array if not supplied).

Then the line could read

'is_deceased' => array(
    'title' => ts('Deceased'),
    'type' => CRM_Utils_Type::T_BOOLEAN,
    'default' => CRM_Utils_Array::value('deceased', $defaults, 0),
  ),

@francescbassas
Copy link
Contributor Author

And in this case be called something like 'filters' => $this->getBasicContactFilters(array('deceased' => NULL)?

@colemanw
Copy link
Member

Yes that's my idea.

@francescbassas
Copy link
Contributor Author

Ok @colemanw suggestions applied. There is a failing test that I find difficult to digest. You see what the problem is?

@colemanw
Copy link
Member

@civicrm-builder retest this please

@alifrumin
Copy link
Contributor

I tested this and it looks great to me. I think it is ready to be merged.

@seamuslee001
Copy link
Contributor

Merging as per @alifrumin Review and everything else looks fine to me me

@seamuslee001 seamuslee001 merged commit f8f3fe3 into civicrm:master Jan 31, 2019
@colemanw
Copy link
Member

Nice work everyone.

@francescbassas francescbassas deleted the patch-18 branch February 1, 2019 18:51
@francescbassas
Copy link
Contributor Author

Thanks all!

francescbassas added a commit to francescbassas/civicrm-core that referenced this pull request Feb 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants