return $extFields;
}
+ public function alterSearchBuilderOptions(&$apiEntities, &$fieldOptions) {
+ foreach (self::getSearchQueryObjects() as $obj) {
+ $obj->alterSearchBuilderOptions($apiEntities, $fieldOptions);
+ }
+ }
+
public function alterSearchQuery(&$query, $fnName) {
foreach (self::getSearchQueryObjects() as $obj) {
$obj->$fnName($query);
public function setAdvancedSearchPaneTemplatePath(&$paneTemplatePathArray, $type) {
return NULL;
}
-}
+
+ /**
+ * Describe options for available for use in the search-builder.
+ *
+ * @param array $apiEntities list of entities whose options should be automatically scanned using API metadata
+ * @param array $fieldOptions keys are field unique-names; values describe how to lookup the options
+ * @void
+ */
+ public function alterSearchBuilderOptions(&$apiEntities, &$fieldOptions) {
+ }
+}
\ No newline at end of file
'membership_type' => 'membership',
);
$entities = array('contact', 'activity', 'participant', 'pledge', 'member', 'contribution');
+ CRM_Contact_BAO_Query_Hook::singleton()->alterSearchBuilderOptions($entities, $options);
foreach ($entities as $entity) {
$fields = civicrm_api($entity, 'getfields', array('version' => 3));
foreach ($fields['values'] as $field => $info) {
- if (!empty($info['options']) || !empty($info['pseudoconstant']) || !empty($info['option_group_id'])) {
+ if (!empty($info['options']) || !empty($info['pseudoconstant']) || !empty($info['option_group_id']) || !empty($info['enumValues'])) {
$options[$field] = $entity;
if (substr($field, -3) == '_id') {
$options[substr($field, 0, -3)] = $entity;