-
Notifications
You must be signed in to change notification settings - Fork 3
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
MAE-360: Add batch column and filter to constituent and contribution detail reports #220
base: master
Are you sure you want to change the base?
Conversation
* @param CRM_Report_Form_Contact_Detail|array $var | ||
* @param CRM_Report_Form_Contact_Detail $reportForm | ||
*/ | ||
public function handle($varType, &$var, &$reportForm) { |
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.
in this class and in CRM/ManualDirectDebit/Hook/Alter/ContributeDetailReport.php
can you change all the other methods to be private and just keep this as public
$batchTypeIds = CRM_Core_OptionGroup::values('batch_type', FALSE, FALSE, FALSE, $condition, 'value'); | ||
|
||
$params = [ | ||
'type_id' => ['IN' => $batchTypeIds], |
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.
civicrm API will retreuve only 25 records by default, so you need to pass this :
$params = [
'type_id' => ['IN' => $batchTypeIds],
'options' => ['limit' => 0],
..etc
]
to remove this restriction
$batchTypeIds = CRM_Core_OptionGroup::values('batch_type', FALSE, FALSE, FALSE, $condition, 'value'); | ||
|
||
$params = [ | ||
'type_id' => ['IN' => $batchTypeIds], |
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.
same here about 'options' => ['limit' => 0],
This refactor will help checking filters properly and to prevent handling any filter with missing or improper value
Overview
We need to show DD batch name in the following reports :
For Contact Detail Report we added
Instruction Batch
column and field.For Contribute Detail Report we added
Payment Batch
column.Please note that
civicrm_alterReportVar
hook will be fired 3 times:And we have a corresponding method handler:
Contact Detail Report Before
Filters tab
Contact Detail Report After
Filters tab
Contribute Detail Report Before
Contribute Detail Report After
Comments
I could only add payment batch column to contribute detail report using a hacky way and couldn't add a filter for that because of a bug in the core.
The
civicrm_alterReportVar
is not working for contribute detail report when the user select the new column or choose the new filter, and it will show an error messageDB Error: no such field
Here at Detail.php#L956 our changes to the
_form
attribute are lost and the error will be fired here Detail.php#L576I've tried to overcome this issue by doing (so hacky) :
$reportForm
object we access the request directly ContributeDetailReport.php#L69_columnHeaders
attribute in thesql
hook ContributeDetailReport.php#L102