ts('Case ID'), 'no_display' => TRUE, 'required' => TRUE, 'name' => 'do_not_trade', ]; } if ($varType == 'sql') { CRM_ConstituentsOnly_BAO_ConstituentsOnly::updateReportSql($object); } if ($varType == 'rows') { $var = CRM_ConstituentsOnly_BAO_ConstituentsOnly::updateReportRows($var, $object); } } function constituentsonly_civicrm_selectWhereClause($entity, &$clauses) { if ($entity == 'Contact') { $url = CRM_Utils_Array::value('q', $_GET); if (strpos($url, 'civicrm/report') === FALSE) { return; } $clauses['do_not_trade'] = ' = 0'; } } /** * Implements hook_civicrm_searchColumns(). * * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_searchColumns */ function constituentsonly_civicrm_searchColumns($objectName, &$headers, &$rows, &$selector) { if (in_array($objectName, ['contact']) && !empty($rows)) { if (!empty($_POST['ignore_constituent_search'])) { return; } $rows = CRM_ConstituentsOnly_BAO_ConstituentsOnly::updateSearchRows($rows, $headers); } } /** * Implements hook_civicrm_buildForm(). * * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_buildForm */ function constituentsonly_civicrm_buildForm($formName, &$form) { if ('CRM_Contact_Form_Search_Advanced' == $formName && !($form->getVar('_action') == CRM_Core_Action::DELETE) ) { $form->addElement('checkbox', 'ignore_constituent_search', ts('Include non-constituents')); CRM_Core_Region::instance('page-body')->add(array( 'template' => 'CRM/common.tpl', )); } }