$allFields = array_keys($apiFields['values']);
}
$paramFields = array_keys($params);
- $undefined = array_diff($paramFields, $allFields, array_keys($_COOKIE), array('action', 'entity', 'debug', 'version', 'check_permissions', 'IDS_request_uri', 'IDS_user_agent', 'return', 'sequential', 'rowCount', 'option_offset', 'option_limit', 'custom', 'option_sort', 'options'));
+ $undefined = array_diff($paramFields, $allFields, array_keys($_COOKIE), array('action', 'entity', 'debug', 'version', 'check_permissions', 'IDS_request_uri', 'IDS_user_agent', 'return', 'sequential', 'rowCount', 'option_offset', 'option_limit', 'custom', 'option_sort', 'options', 'prettyprint'));
if ($undefined) {
$result['undefined_fields'] = array_merge($undefined);
}
}
if(!empty($params['options']['metadata'])) {
// we've made metadata an array but only supporting 'fields' atm
- if(in_array('fields', $params['options']['metadata'])) {
+ if(in_array('fields', (array) $params['options']['metadata'])) {
$fields = civicrm_api3($entity, 'getfields', array('action' => substr($action, 0, 3) == 'get' ? 'get' : 'create'));
$result['metadata']['fields'] = $fields['values'];
}
}
}
}
- // http://issues.civicrm.org/jira/browse/CRM-9150 - stick with 'simple' operators for now
- // support for other syntaxes is discussed in ticket but being put off for now
- $acceptedSQLOperators = array('=', '<=', '>=', '>', '<', 'LIKE', "<>", "!=", "NOT LIKE", 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN');
if (!$fields) {
$fields = array();
}
FALSE,
FALSE
);
- // find out if we have any requests to resolve options
- $getoptions = CRM_Utils_Array::value('get_options', CRM_Utils_Array::value('options',$params));
- if(!is_array($getoptions)){
- $getoptions = array($getoptions);
- }
+
+ $ret = array();
foreach ($customfields as $key => $value) {
// Regular fields have a 'name' property
$value['name'] = 'custom_' . $key;
+ $value['title'] = $value['label'];
$value['type'] = _getStandardTypeFromCustomDataType($value['data_type']);
- $customfields['custom_' . $key] = $value;
- if (in_array('custom_' . $key, $getoptions)) {
- $customfields['custom_' . $key]['options'] = CRM_Core_BAO_CustomOption::valuesByID($key);
- }
- unset($customfields[$key]);
+ $ret['custom_' . $key] = $value;
}
- return $customfields;
+ return $ret;
}
/**
* Translate the custom field data_type attribute into a std 'type'