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

CRM-20545 - port extended reports metadata approach to adding columns #11276

Merged
merged 1 commit into from
Dec 1, 2017

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Nov 14, 2017

Overview

Port extended reports approach to metadata for fields alternative to #11244. Note that the ticket suggested is_deleted filtering should be added - this does it but it can be unset. Filtering by is_deleted probably DOES make sense, but not by is_deceased

Before

Contribution detail report not filtered by is deleted or is_deceased

After

Contribution detail report not filtered by is deceased but is filtered by deleted - but that can be altered in the report by the user. Extended reports metadata method exists

Technical Details

@colemanw this is what the extended reports approach looks like - obviously it seems quite long but the idea is that on the individual reports you don't define all the fields - although you can define special treatment of them - in this case overriding the default order by (display-name - although perhaps sort_name makes more sense), the default fields (to be the same as the existing report), to specify not to display id & to require it & to specify a filter.

The no_field_disambiguation I added - normally a common error in reports is ambiguity between 2 reports fields - ie. 'status_id' on case and on activity or something. This causes a tonne of issues so normally I append a string to disambiguate, but it would change the saved field names, so erring on the side of existing behaviour.

Note this code is the basis for the reports allowing details about 2 contacts in one report - because of the 'prefix' stuff

($this->getColumns('Contact', array(
      'order_bys_defaults' => array('sort_name ASC'),
      'fields_defaults' => array('sort_name'),
      'fields_excluded' => array('id'),
      'fields_required' => array('id'),
      'filters_defaults' => array('is_deleted' => FALSE),
      'no_field_disambiguation' => TRUE,
    )


@eileenmcnaughton eileenmcnaughton force-pushed the report-c branch 7 times, most recently from 415f0f4 to 4395f04 Compare November 14, 2017 08:35
@eileenmcnaughton
Copy link
Contributor Author

test this please

@colemanw
Copy link
Member

@eileenmcnaughton did you mean to say it is filtered by is_deleted? It looks from your code like it is set to exclude deleted contacts.

@eileenmcnaughton
Copy link
Contributor Author

@colemanw I have updated the description - I see it was incorrect about what the pr was doing. Also have rebased against master (not stale but good practice to do intermittantly IMHO)

@colemanw colemanw merged commit 278dac2 into civicrm:master Dec 1, 2017
@colemanw colemanw deleted the report-c branch December 1, 2017 15:40
sluc23 pushed a commit to ixiam/civicrm-core that referenced this pull request Jan 10, 2018
CRM-20545 - port extended reports metadata approach to adding columns
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.

3 participants