$params = (array
('name' => array(
+ 'title' => 'Constant Name',
'api.required' => 1,
'options' =>
'activityStatus',
*/
function _civicrm_api3_contact_proximity_spec(&$params) {
$params['latitude']['api.required'] = 1;
+ $params['latitude']['title'] = 'Latitude';
$params['longitude']['api.required'] = 1;
+ $params['longitude']['title'] = 'Longitude';
$params['unit']['api.default'] = 'meter';
+ $params['unit']['title'] = 'Unit of Measurement';
}
/**
*/
function _civicrm_api3_contribution_get_spec(&$params) {
$params['contribution_test']['api.default'] = 0;
+ $params['contribution_test']['title'] = 'Get Test Contributions?';
$params['financial_type_id']['api.aliases'] = array('contribution_type_id');
$params['contact_id'] = $params['contribution_contact_id'];
$params['contact_id']['api.aliases'] = array('contribution_contact_id');
* @param array $params array or parameters determined by getfields
*/
function _civicrm_api3_contribution_transact_spec(&$params) {
- // This function calls create, so should inherit create spec
- _civicrm_api3_contribution_create_spec($params);
+ $fields = civicrm_api3('contribution', 'getfields', array('action' => 'create'));
+ $params = array_merge($params, $fields['values']);
$params['receive_date']['api.default'] = 'now';
}
*/
function _civicrm_api3_custom_value_get_spec(&$params) {
$params['entity_id']['api.required'] = 1;
+ $params['entity_id']['title'] = 'Entity ID';
}
*/
function _civicrm_api3_generic_getrefcount_spec(&$params) {
$params['id']['api.required'] = 1;
+ $params['id']['title'] = 'Entity ID';
}
/**
*/
function _civicrm_api3_mailing_event_bounce_spec(&$params) {
$params['job_id']['api.required'] = 1;
+ $params['job_id']['title'] = 'Job ID';
$params['event_queue_id']['api.required'] = 1;
+ $params['event_queue_id']['title'] = 'Event Queue ID';
$params['hash']['api.required'] = 1;
+ $params['hash']['title'] = 'Hash';
$params['body']['api.required'] = 1;
+ $params['body']['title'] = 'Body';
}
/**
*/
function _civicrm_api3_mailing_event_reply_spec(&$params) {
$params['job_id']['api.required'] = 1;
+ $params['job_id']['title'] = 'Job ID';
$params['event_queue_id']['api.required'] = 1;
+ $params['event_queue_id']['title'] = 'Event Queue ID';
$params['hash']['api.required'] = 1;
+ $params['hash']['title'] = 'Hash';
$params['replyTo']['api.required'] = 0;
+ $params['replyTo']['title'] = 'Reply To';//doesn't really explain adequately
}
/**
*/
function _civicrm_api3_mailing_event_forward_spec(&$params) {
$params['job_id']['api.required'] = 1;
+ $params['job_id']['title'] = 'Job ID';
$params['event_queue_id']['api.required'] = 1;
+ $params['event_queue_id']['title'] = 'Event Queue ID';
$params['hash']['api.required'] = 1;
+ $params['hash']['title'] = 'Hash';
$params['email']['api.required'] = 1;
+ $params['email']['title'] = 'Forwarded to Email';
}
/**
*/
function _civicrm_api3_mailing_contact_get_spec(&$params) {
$params['contact_id']['api.required'] = 1;
+ $params['contact_id']['title'] = 'Contact ID';
$params['type'] = array(
'api.default' => 'Delivered',
+ 'title' => 'Type',// doesn't really explain the field - but not sure I understand it to explain it better
'type' => CRM_Utils_Type::T_STRING,
'options' => array(
'Delivered' => 'Delivered',
*/
function _civicrm_api3_participant_get_spec(&$params) {
$params['participant_test']['api.default'] = 0;
+ $params['participant_test']['title'] = 'Get Test Participants';
}
/**
*/
function _civicrm_api3_profile_get_spec(&$params) {
$params['profile_id']['api.required'] = TRUE;
+ $params['profile_id']['title'] = 'Profile ID';
$params['contact_id']['description'] = 'If no contact is specified an array of defaults will be returned';
+ $params['contact_id']['title'] = 'Contact ID';
}
/**
_civicrm_api3_buildprofile_submitfields(FALSE, FALSE, True);
}
$params['profile_id']['api.required'] = TRUE;
+ $params['profile_id']['title'] = 'Profile ID';
}
/**
if (in_array($entity, $entities)) {
$ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, $entity . 'Test.php');
}
- $fields = $this->callAPISuccess($entity, 'getfields', array('action' => 'create'));
- if (!empty($ids)) {
- $this->assertArrayHasKey('custom_' . $ids['custom_field_id'], $fields['values']);
- }
+ $actions = $this->callAPISuccess($entity, 'getactions', array());
+ foreach ($actions['values'] as $action) {
+ $fields = $this->callAPISuccess($entity, 'getfields', array('action' => $action));
+ if (!empty($ids) && in_array($action, array('create', 'get'))) {
+ $this->assertArrayHasKey('custom_' . $ids['custom_field_id'], $fields['values']);
+ }
- foreach ($fields['values'] as $fieldName => $fieldSpec) {
- $this->assertArrayHasKey('title', $fieldSpec, "no title for $entity - $fieldName");
- $this->assertNotEmpty($fieldSpec['title'], "empty title for $entity - $fieldName");
+ foreach ($fields['values'] as $fieldName => $fieldSpec) {
+ $this->assertArrayHasKey('title', $fieldSpec, "no title for $entity - $fieldName on action $action");
+ $this->assertNotEmpty($fieldSpec['title'], "empty title for $entity - $fieldName");
+ }
}
-
if (!empty($ids)) {
$this->customFieldDelete($ids['custom_field_id']);
$this->customGroupDelete($ids['custom_group_id']);