Add ability to search by creditee name
This commit is contained in:
@ -171,6 +171,7 @@ function softcreditcustomfields_civicrm_buildForm($formName, &$form) {
|
||||
|| ('CRM_Contact_Form_Search_Advanced' == $formName && ('CiviContribute' == $form->_searchPane || $form->_flagSubmitted))
|
||||
) {
|
||||
CRM_Contribute_BAO_Query::addCustomFormFields($form, ['ContributionSoft']);
|
||||
$form->add('text', 'soft_credit_name', ts('Soft Creditee\'s name'));
|
||||
if ('CRM_Contact_Form_Search_Advanced' == $formName && 'CiviContribute' != $form->_searchPane) {
|
||||
return;
|
||||
}
|
||||
@ -323,3 +324,14 @@ function softcreditcustomfields_civicrm_postProcess($formName, &$form) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_civicrm_queryObjects().
|
||||
*
|
||||
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_queryObjects
|
||||
*/
|
||||
function softcreditcustomfields_civicrm_queryObjects(&$queryObjects, $type) {
|
||||
if ($type == 'Contact') {
|
||||
$queryObjects[] = new CRM_SoftCredit_SoftCreditQueryObject();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user