Added code to filter in quick search
This commit is contained in:
@ -135,14 +135,13 @@ function constituentsonly_civicrm_queryObjects(&$queryObjects, $type) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_civicrm_apiWrappers().
|
||||
* Implements hook_civicrm_contactListQuery().
|
||||
*
|
||||
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_apiWrappers
|
||||
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_contactListQuery
|
||||
*/
|
||||
function constituentsonly_civicrm_apiWrappers(&$wrappers, $apiRequest) {
|
||||
if ($apiRequest['entity'] == 'Contact' && $apiRequest['action'] == 'getquick') {
|
||||
$wrappers[] = new CRM_Utils_API_ConstituentsOnlyAPIWrapper();
|
||||
}
|
||||
function constituentsonly_civicrm_contactListQuery(&$query, $queryText, $context, $id) {
|
||||
$replace = 'WHERE (cc.do_not_trade IS NULL OR cc.do_not_trade = 0) AND ';
|
||||
$query = str_replace('WHERE ', $replace, $query);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user