-
-
Notifications
You must be signed in to change notification settings - Fork 825
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-21677 - Report improvements #11550
Conversation
test this please |
@@ -41,7 +41,7 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form { | |||
protected $_customGroupExtends = array('Contribution', 'Contact', 'Individual'); | |||
protected $_customGroupGroupBy = TRUE; | |||
|
|||
public $_drilldownReport = array('contribute/detail' => 'Link to Detail Report'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be in a separate PR as it is a behaviour change & we need to check if it will get buy in (I tend to agree with it). The other changes in this are just technical so better to put on 2 tracks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yashodha this line is the only thing that I think is blocking merge here - because I think it;s a separate change -
although I think it would be better if we changed joinAddressFromClause to joinAddressFromContactClause - and the same on the other functions. (that would make it more in line with extendedReport and differentiate between joinAddressFromLocation from joinAddressFromContact.
@yashodha this looks like a nice clean up! Yay + double yay. I think we should probably sync the approach here with that in the extended report extension since we are cleaning up. I had been porting a few of the approaches I use in that extension to core over time but it takes a little co-ordination because if the signature changes in core I have to change it in extended report ( I try to just remove the function & rely on core where I can) In extended report I use the following:
The differences are the parameters that are passed in & the function name. Because I have similar functions for a lot of joins I use the pattern Join...From - since there might also be a join to email from LocationBlock. Passing in $prefix permits 2 joins to email table (from contact a & from contact b). The $extra array is a relatively recent one & I haven't used it much but I think for a standard pattern it's better to have it - it might be used to indicate 'is_primary_only' = FALSE in the above for a report that wants all addresses returned. |
CRM/Report/Form/Contact/Summary.php
Outdated
{$this->_aliases['civicrm_phone']}.is_primary = 1 "; | ||
} | ||
$this->addPhoneFromClause(); | ||
$this->addEmailFromClause() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing a ;
here @yashodha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seamuslee001 : fixed
test errors are on the contact/detail report |
@eileenmcnaughton : the functions now have parameters in the same format. |
Thanks @yashodha - are you OK changing the names too? I think it is clearer saying what table it's coming from |
@eileenmcnaughton yes, sure! |
test this please |
1 similar comment
test this please |
@eileenmcnaughton : made the changes |
test this please |
1 similar comment
test this please |
* @param array $extra Additional options. | ||
* Not currently used in core but may be used in override extensions. | ||
*/ | ||
public function joinCountryFromClause($prefix = '', $extra = array()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change this to joinCountryFromAddressClause
public function addPhoneFromClause() { | ||
// include address field if address column is to be included | ||
if ($this->isTableSelected('civicrm_phone')) { | ||
public function joinPhoneFromClause($prefix = '', $extra = array()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change to joinPhoneFromContactClause
* @param array $extra Additional options. | ||
* Not currently used in core but may be used in override extensions. | ||
*/ | ||
public function joinEmailFromClause($prefix = '', $extra = array()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change to joinEmailFromContactClause
@yashodha there are a few minor things here + it needs squashing. I'm going to squash & put up in an alternate PR with the tweaks. You can then check my reviewers cut is still good & merge |
Closing this in favour of #11814 which is a reviewer's cut of this |
Overview
Clean up reports that have unnecessary joins to phone, email and address.
Before
unnecessary joins to phone, email and address tables
After
join only when needed.