$options = array(
'group' => 'group_contact',
'tag' => 'entity_tag',
- 'country' => 'address',
- 'state_province' => 'address',
- 'gender' => 'contact',
- 'world_region' => 'contact',
- 'individual_prefix' => 'contact',
- 'individual_suffix' => 'contact',
- 'preferred_communication_method' => 'contact',
- 'preferred_language' => 'contact',
'on_hold' => 'yesno',
'is_bulkmail' => 'yesno',
- 'activity_type' => 'activity',
- 'activity_status' => 'activity',
- 'financial_type' => 'contribution',
- 'contribution_page_id' => 'contribution',
- 'contribution_status' => 'contribution',
'payment_instrument' => 'contribution',
'membership_status' => 'membership',
'membership_type' => 'membership',
+ 'member_is_test' => 'yesno',
+ 'member_is_pay_later' => 'yesno',
+ 'is_override' => 'yesno',
);
- $entities = array('contact', 'activity', 'participant', 'pledge', 'member', 'contribution');
+ $entities = array('contact', 'address', '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));
+ $fields = civicrm_api3($entity, 'getfields');
foreach ($fields['values'] as $field => $info) {
if (!empty($info['options']) || !empty($info['pseudoconstant']) || !empty($info['option_group_id']) || !empty($info['enumValues'])) {
$options[$field] = $entity;
break;
case 'gender':
+ case 'gender_id':
if (!self::checkGender($value)) {
self::addToErrorMsg(ts('Gender'), $errorMessage);
}
break;
case 'individual_prefix':
+ case 'prefix_id':
if (!self::in_value($value, CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'prefix_id'))) {
self::addToErrorMsg(ts('Individual Prefix'), $errorMessage);
}
break;
case 'individual_suffix':
+ case 'suffix_id':
if (!self::in_value($value, CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'suffix_id'))) {
self::addToErrorMsg(ts('Individual Suffix'), $errorMessage);
}
* @throws CiviCRM_API3_Exception
* @return array
*/
-function civicrm_api3($entity, $action, $params) {
+function civicrm_api3($entity, $action, $params = array()) {
$params['version'] = 3;
$result = civicrm_api($entity, $action, $params);
if(is_array($result) && !empty($result['is_error'])){