-
-
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-20286, added card type field on contribution search form #9999
Conversation
pradpnayak
commented
Mar 15, 2017
•
edited by civicrm-builder
Loading
edited by civicrm-builder
- CRM-20286: Add card type field on search form
@eileenmcnaughton can you please review this? |
@pradpnayak I think this is good. I agree that your restructuring around the batch table is an improvement, and I was still able to do a search based on batch. I have done a PR with a suggestion about changing the way you add the field to the search form. Other than that, can you squash the commits into a single commit? Let me know if you are unsure how to |
$this->quickCleanup($this->_tablesToTruncate); | ||
$contactID1 = $this->individualCreate(array(), 1); | ||
$contactID2 = $this->individualCreate(array(), 2); | ||
$Contribution1 = civicrm_api3('Contribution', 'create', 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.
minor point, in the tests it's better to use $this->callAPISuccess - it has better handling when there is a bug
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.
Agree.
'form_value' => array('financial_trxn_card_type' => array(1, 2)), | ||
'expected_count' => 2, | ||
'expected_contribution' => array($Contribution1['id'], $Contribution3['id']), | ||
'expected_qill' => 'Card Type In Visa, MasterCard', |
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.
including checks on the qill is good
CRM/Contribute/BAO/Query.php
Outdated
$query->_tables['civicrm_financial_trxn'] = $query->_whereTables['civicrm_financial_trxn'] = 1; | ||
$query->_tables['civicrm_contribution'] = $query->_whereTables['civicrm_contribution'] = 1; | ||
list($op, $value) = CRM_Contact_BAO_Query::buildQillForFieldValue('CRM_Financial_DAO_FinancialTrxn', 'card_type', $value, $op); | ||
$query->_qill[$grouping][] = ts('%1 %2 %3', array(1 => ts('Card Type'), 2 => $op, 3 => $value)); |
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.
Minor change
- $query->_qill[$grouping][] = ts('%1 %2 %3', array(1 => ts('Card Type'), 2 => $op, 3 => $value));
+ $query->_qill[$grouping][] = ts('Card Type %1 %2', array(1 => $op, 2 => $value));
The patch is working as expected, tested on my local PR needs two minor changes, one suggested by @eileenmcnaughton on unit-test and other by me on |
---------------------------------------- * CRM-20286: Add card type field on search form https://issues.civicrm.org/jira/browse/CRM-20286 CRM-20286, code cleanup and defined $_wheretables and $_tables correctly for batch and is_payment fields ---------------------------------------- * CRM-20286: Add card type field on search form https://issues.civicrm.org/jira/browse/CRM-20286 CRM-20286, added where clause for card type ---------------------------------------- * CRM-20286: Add card type field on search form https://issues.civicrm.org/jira/browse/CRM-20286 CRM-20286, added unit test ---------------------------------------- * CRM-20286: Add card type field on search form https://issues.civicrm.org/jira/browse/CRM-20286 Use metadata based method to add field to form CRM-20286 Minor changes ---------------------------------------- * CRM-20286: Add card type field on search form https://issues.civicrm.org/jira/browse/CRM-20286
CRM-20286, added card type field on contribution search form