From: Eileen McNaughton Date: Sun, 15 Mar 2015 22:11:58 +0000 (+1300) Subject: CRM-16112 add type for api _spec functions X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d142432b976440cc3ac9c52ce1e09a8e05c06017;p=civicrm-core.git CRM-16112 add type for api _spec functions (towards always specifying type) --- diff --git a/api/v3/ActivityType.php b/api/v3/ActivityType.php index 30c8a85a46..723f1b7ffd 100644 --- a/api/v3/ActivityType.php +++ b/api/v3/ActivityType.php @@ -93,10 +93,16 @@ function civicrm_api3_activity_type_create($params) { * Array of parameters determined by getfields. */ function _civicrm_api3_activity_type_create_spec(&$params) { - $params['label']['api.required'] = 1; - $params['label']['title'] = 'Label'; - $params['weight']['api.required'] = 1; - $params['weight']['title'] = 'Weight'; + $params['label'] = array( + 'api.required' => 1, + 'title' => 'Label', + 'type' => CRM_Utils_Type::T_STRING, + ); + $params['weight'] = array( + 'api.required' => 1, + 'title' => 'Weight', + 'type' => CRM_Utils_Type::T_STRING, + ); } /** diff --git a/api/v3/Address.php b/api/v3/Address.php index 1e16bfd62e..0856e9130c 100644 --- a/api/v3/Address.php +++ b/api/v3/Address.php @@ -94,6 +94,7 @@ function _civicrm_api3_address_create_spec(&$params) { $params['street_parsing'] = array( 'title' => 'Street Address Parsing', 'description' => 'Optional param to indicate you want the street_address field parsed into individual params', + 'type' => CRM_Utils_Type::T_BOOLEAN, ); $params['world_region'] = array( 'title' => ts('World Region'), diff --git a/api/v3/Case.php b/api/v3/Case.php index a7fe9c4d52..465020c929 100644 --- a/api/v3/Case.php +++ b/api/v3/Case.php @@ -134,8 +134,11 @@ function civicrm_api3_case_create($params) { * Parameters determined by getfields. */ function _civicrm_api3_case_get_spec(&$params) { - $params['contact_id']['api.aliases'] = array('client_id'); - $params['contact_id']['title'] = 'Case Client'; + $params['contact_id'] = array( + 'api.aliases' => array('client_id'), + 'title' => 'Case Client', + 'type' => CRM_Utils_Type::T_INT, + ); } /** @@ -145,9 +148,12 @@ function _civicrm_api3_case_get_spec(&$params) { * Array of parameters determined by getfields. */ function _civicrm_api3_case_create_spec(&$params) { - $params['contact_id']['api.aliases'] = array('client_id'); - $params['contact_id']['title'] = 'Case Client'; - $params['contact_id']['api.required'] = 1; + $params['contact_id'] = array( + 'api.aliases' => array('client_id'), + 'title' => 'Case Client', + 'api.required' => 1, + 'type' => CRM_Utils_Type::T_INT, + ); $params['status_id']['api.default'] = 1; $params['status_id']['api.aliases'] = array('case_status'); $params['creator_id']['api.default'] = 'user_contact_id'; @@ -157,6 +163,7 @@ function _civicrm_api3_case_create_spec(&$params) { $params['medium_id'] = array( 'name' => 'medium_id', 'title' => 'Activity Medium', + 'type' => CRM_Utils_Type::T_INT, ); } diff --git a/api/v3/Constant.php b/api/v3/Constant.php index a11ac1195a..0d3a7a0247 100644 --- a/api/v3/Constant.php +++ b/api/v3/Constant.php @@ -190,6 +190,7 @@ function _civicrm_api3_constant_get_spec(&$params) { 'name' => 'name', 'api.required' => 1, 'options' => array_combine($options, $options), + 'type' => CRM_Utils_Type::T_STRING, ), ); } diff --git a/api/v3/Contact.php b/api/v3/Contact.php index c9dc42d61a..3e2fa02f0d 100644 --- a/api/v3/Contact.php +++ b/api/v3/Contact.php @@ -127,6 +127,7 @@ function _civicrm_api3_contact_create_spec(&$params) { $params['dupe_check'] = array( 'title' => 'Check for Duplicates', 'description' => 'Throw error if contact create matches dedupe rule', + 'type' => CRM_Utils_Type::T_BOOLEAN, ); $params['prefix_id']['api.aliases'] = array('individual_prefix', 'individual_prefix_id'); $params['suffix_id']['api.aliases'] = array('individual_suffix', 'individual_suffix_id'); @@ -172,37 +173,127 @@ function _civicrm_api3_contact_get_spec(&$params) { // We declare all these pseudoFields as there are other undocumented fields accessible // via the api - but if check permissions is set we only allow declared fields - $params['address_id']['title'] = 'Primary Address ID'; - $params['street_address']['title'] = 'Primary Address Street Address'; - $params['supplemental_address_1']['title'] = 'Primary Address Supplemental Address 1'; - $params['supplemental_address_2']['title'] = 'Primary Address Supplemental Address 2'; - $params['current_employer']['title'] = 'Current Employer'; - $params['city']['title'] = 'Primary Address City'; - $params['postal_code_suffix']['title'] = 'Primary Address Post Code Suffix'; - $params['postal_code']['title'] = 'Primary Address Post Code'; - $params['geo_code_1']['title'] = 'Primary Address Latitude'; - $params['geo_code_2']['title'] = 'Primary Address Longitude'; - $params['state_province_id']['title'] = 'Primary Address State Province ID'; - $params['state_province_name']['title'] = 'Primary Address State Province Name'; - $params['state_province']['title'] = 'Primary Address State Province'; - $params['country_id']['title'] = 'Primary Address Country ID'; - $params['country']['title'] = 'Primary Address country'; - $params['worldregion_id']['title'] = 'Primary Address World Region ID'; - $params['worldregion']['title'] = 'Primary Address World Region'; - $params['phone_id']['title'] = 'Primary Phone ID'; - $params['phone']['title'] = 'Primary Phone'; - $params['phone_type_id']['title'] = 'Primary Phone Type ID'; - $params['provider_id']['title'] = 'Primary Phone Provider ID'; - $params['email_id']['title'] = 'Primary Email ID'; - $params['email']['title'] = 'Primary Email'; - $params['gender_id']['title'] = 'Gender ID'; - $params['gender']['title'] = 'Gender'; - $params['on_hold']['title'] = 'Primary Email On Hold'; - $params['im']['title'] = 'Primary Instant Messenger'; - $params['im_id']['title'] = 'Primary Instant Messenger ID'; - $params['group_id']['title'] = 'Group Memberships (filter)'; - $params['group']['title'] = 'Group Memberships (filter, array)'; - $params['tag']['title'] = 'Assigned tags (filter, array)'; + $params['address_id'] = array( + 'title' => 'Primary Address ID', + 'type' => CRM_Utils_Type::T_INT, + ); + $params['street_address'] = array( + 'title' => 'Primary Address Street Address', + 'type' => CRM_Utils_Type::T_STRING, + ); + $params['supplemental_address_1'] = array( + 'title' => 'Primary Address Supplemental Address 1', + 'type' => CRM_Utils_Type::T_STRING, + ); + $params['supplemental_address_2'] = array( + 'title' => 'Primary Address Supplemental Address 2', + 'type' => CRM_Utils_Type::T_STRING, + ); + $params['current_employer'] = array( + 'title' => 'Current Employer', + 'type' => CRM_Utils_Type::T_STRING, + ); + $params['city'] = array( + 'title' => 'Primary Address City', + 'type' => CRM_Utils_Type::T_STRING, + ); + $params['postal_code_suffix'] = array( + 'title' => 'Primary Address Post Code Suffix', + 'type' => CRM_Utils_Type::T_STRING, + ); + $params['postal_code'] = array( + 'title' => 'Primary Address Post Code', + 'type' => CRM_Utils_Type::T_STRING, + ); + $params['geo_code_1'] = array( + 'title' => 'Primary Address Latitude', + 'type' => CRM_Utils_Type::T_STRING, + ); + $params['geo_code_2'] = array( + 'title' => 'Primary Address Longitude', + 'type' => CRM_Utils_Type::T_STRING, + ); + $params['state_province_id'] = array( + 'title' => 'Primary Address State Province ID', + 'type' => CRM_Utils_Type::T_INT, + ); + $params['state_province_name'] = array( + 'title' => 'Primary Address State Province Name', + 'type' => CRM_Utils_Type::T_STRING, + ); + $params['state_province'] = array( + 'title' => 'Primary Address State Province', + 'type' => CRM_Utils_Type::T_STRING, + ); + $params['country_id'] = array( + 'title' => 'Primary Address Country ID', + 'type' => CRM_Utils_Type::T_INT, + ); + $params['country'] = array( + 'title' => 'Primary Address country', + 'type' => CRM_Utils_Type::T_STRING, + ); + $params['worldregion_id'] = array( + 'title' => 'Primary Address World Region ID', + 'type' => CRM_Utils_Type::T_INT, + ); + $params['worldregion'] = array( + 'title' => 'Primary Address World Region', + 'type' => CRM_Utils_Type::T_STRING, + ); + $params['phone_id'] = array( + 'title' => 'Primary Phone ID', + 'type' => CRM_Utils_Type::T_INT, + ); + $params['phone'] = array( + 'title' => 'Primary Phone', + 'type' => CRM_Utils_Type::T_STRING, + ); + $params['phone_type_id'] = array( + 'title' => 'Primary Phone Type ID', + 'type' => CRM_Utils_Type::T_INT, + ); + $params['provider_id'] = array( + 'title' => 'Primary Phone Provider ID', + 'type' => CRM_Utils_Type::T_INT, + ); + $params['email_id'] = array( + 'title' => 'Primary Email ID', + 'type' => CRM_Utils_Type::T_INT, + ); + $params['email'] = array( + 'title' => 'Primary Email', + 'type' => CRM_Utils_Type::T_STRING, + ); + $params['gender_id'] = array( + 'title' => 'Gender ID', + 'type' => CRM_Utils_Type::T_INT, + ); + $params['gender'] = array( + 'title' => 'Gender', + 'type' => CRM_Utils_Type::T_STRING, + ); + $params['on_hold'] = array( + 'title' => 'Primary Email On Hold', + 'type' => CRM_Utils_Type::T_BOOLEAN, + ); + $params['im'] = array( + 'title' => 'Primary Instant Messenger', + 'type' => CRM_Utils_Type::T_STRING, + ); + $params['im_id'] = array( + 'title' => 'Primary Instant Messenger ID', + 'type' => CRM_Utils_Type::T_INT, + ); + $params['group_id'] = array( + 'title' => 'Group Memberships (filter)', + ); + $params['group'] = array( + 'title' => 'Group Memberships (filter, array)', + ); + $params['tag'] = array( + 'title' => 'Assigned tags (filter, array)', + ); $params['birth_date_low'] = array('name' => 'birth_date_low', 'type' => CRM_Utils_Type::T_DATE, 'title' => ts('Birth Date is equal to or greater than')); $params['birth_date_high'] = array('name' => 'birth_date_high', 'type' => CRM_Utils_Type::T_DATE, 'title' => ts('Birth Date is equal to or less than')); $params['deceased_date_low'] = array('name' => 'deceased_date_low', 'type' => CRM_Utils_Type::T_DATE, 'title' => ts('Deceased Date is equal to or greater than')); @@ -885,12 +976,22 @@ function civicrm_api3_contact_merge($params) { * @param array $params */ 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'; + $params['latitude'] = array( + 'title' => 'Latitude', + 'api.required' => 1, + 'type' => CRM_Utils_Type::T_STRING, + ); + $params['longitude'] = array( + 'title' => 'Longitude', + 'api.required' => 1, + 'type' => CRM_Utils_Type::T_STRING, + ); + + $params['unit'] = array( + 'title' => 'Unit of Measurement', + 'api.default' => 'meter', + 'type' => CRM_Utils_Type::T_STRING, + ); } /** diff --git a/api/v3/Contribution.php b/api/v3/Contribution.php index 9d340142fc..058f5bcc83 100644 --- a/api/v3/Contribution.php +++ b/api/v3/Contribution.php @@ -85,6 +85,7 @@ function _civicrm_api3_contribution_create_spec(&$params) { // field is called payment processor - not payment processor id but can only be one id so // it seems likely someone will fix it up one day to be more consistent - lets alias it from the start 'api.aliases' => array('payment_processor_id'), + 'type' => CRM_Utils_Type::T_INT, ); $params['financial_type_id']['api.aliases'] = array('contribution_type_id', 'contribution_type'); $params['financial_type_id']['api.required'] = 1; @@ -245,8 +246,11 @@ function _civicrm_api3_format_soft_credit(&$contribution) { * Array of parameters determined by getfields. */ function _civicrm_api3_contribution_get_spec(&$params) { - $params['contribution_test']['api.default'] = 0; - $params['contribution_test']['title'] = 'Get Test Contributions?'; + $params['contribution_test'] = array( + 'api.default' => 0, + 'type' => CRM_Utils_Type::T_BOOLEAN, + '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'); @@ -363,22 +367,28 @@ function _civicrm_api3_contribution_sendconfirmation_spec(&$params) { $params['id'] = array( 'api.required' => 1, 'title' => 'Contribution ID', + 'type' => CRM_Utils_Type::T_INT, ); $params['receipt_from_email'] = array( 'api.required' => 1, 'title' => 'From Email address (string) required until someone provides a patch :-)', + 'type' => CRM_Utils_Type::T_STRING, ); $params['receipt_from_name'] = array( 'title' => 'From Name (string)', + 'type' => CRM_Utils_Type::T_STRING, ); $params['cc_receipt'] = array( 'title' => 'CC Email address (string)', + 'type' => CRM_Utils_Type::T_STRING, ); $params['bcc_receipt'] = array( 'title' => 'BCC Email address (string)', + 'type' => CRM_Utils_Type::T_STRING, ); $params['receipt_text'] = array( 'title' => 'Message (string)', + 'type' => CRM_Utils_Type::T_STRING, ); } diff --git a/api/v3/Job.php b/api/v3/Job.php index 08d98d731d..9b56339c50 100644 --- a/api/v3/Job.php +++ b/api/v3/Job.php @@ -139,13 +139,26 @@ function civicrm_api3_job_geocode($params) { * @param array $params */ function _civicrm_api3_job_geocode_spec(&$params) { - $params['start'] = array('title' => 'Start Date'); - $params['end'] = array('title' => 'End Date'); - $params['geocoding'] = array('title' => 'Geocode address?'); - $params['parse'] = array('title' => 'Parse street address?'); + $params['start'] = array( + 'title' => 'Start Date', + 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, + ); + $params['end'] = array( + 'title' => 'End Date', + 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, + ); + $params['geocoding'] = array( + 'title' => 'Geocode address?', + 'type' => CRM_Utils_Type::T_BOOLEAN, + ); + $params['parse'] = array( + 'title' => 'Parse street address?', + 'type' => CRM_Utils_Type::T_BOOLEAN, + ); $params['throttle'] = array( 'title' => 'Throttle?', - 'description' => 'if enabled, geo-codes at a slow rate', + 'description' => 'If enabled, geo-codes at a slow rate', + 'type' => CRM_Utils_Type::T_BOOLEAN, ); } diff --git a/api/v3/MailingAB.php b/api/v3/MailingAB.php index 4328ec7db7..9eb7750f9a 100755 --- a/api/v3/MailingAB.php +++ b/api/v3/MailingAB.php @@ -177,13 +177,20 @@ function civicrm_api3_mailing_a_b_submit($params) { * Array of parameters determined by getfields. */ function _civicrm_api3_mailing_a_b_graph_stats_spec(&$params) { - $params['criteria']['title'] = 'Criteria'; - $params['criteria']['default'] = 'Open'; + $params['criteria'] = array( + 'title' => 'Criteria', + 'default' => 'Open', + 'type' => CRM_Utils_Type::T_STRING, + ); + // mailing_ab_winner_criteria $params['target_date']['title'] = 'Target Date'; $params['target_date']['type'] = CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME; - $params['split_count']['title'] = 'Split Count'; - $params['split_count']['api.default'] = 6; + $params['split_count'] = array( + 'title' => 'Split Count', + 'api.default' => 6, + 'type' => CRM_Utils_Type::T_INT, + ); $params['split_count_select']['title'] = 'Split Count Select'; $params['split_count_select']['api.required'] = 1; $params['target_url']['title'] = 'Target URL'; diff --git a/api/v3/MailingContact.php b/api/v3/MailingContact.php index 4f1c563a46..9f7d28b884 100644 --- a/api/v3/MailingContact.php +++ b/api/v3/MailingContact.php @@ -75,8 +75,12 @@ function _civicrm_api3_mailing_contact_getresults($params, $count) { * Array of parameters determined by getfields. */ function _civicrm_api3_mailing_contact_get_spec(&$params) { - $params['contact_id']['api.required'] = 1; - $params['contact_id']['title'] = 'Contact ID'; + $params['contact_id'] = array( + 'api.required' => 1, + 'title' => 'Contact ID', + 'type' => CRM_Utils_Type::T_INT, + ); + $params['type'] = array( 'api.default' => 'Delivered', 'title' => 'Type', // doesn't really explain the field - but not sure I understand it to explain it better diff --git a/api/v3/MailingEventConfirm.php b/api/v3/MailingEventConfirm.php index 66d354f923..87e2c3692a 100644 --- a/api/v3/MailingEventConfirm.php +++ b/api/v3/MailingEventConfirm.php @@ -65,10 +65,19 @@ function civicrm_api3_mailing_event_confirm_create($params) { * Array of parameters determined by getfields. */ function _civicrm_api3_mailing_event_confirm_create_spec(&$params) { - $params['contact_id']['api.required'] = 1; - $params['contact_id']['title'] = 'Contact ID'; - $params['subscribe_id']['api.required'] = 1; - $params['subscribe_id']['title'] = 'Subscribe Event ID'; - $params['hash']['api.required'] = 1; - $params['hash']['title'] = 'Hash'; + $params['contact_id'] = array( + 'api.required' => 1, + 'title' => 'Contact ID', + 'type' => CRM_Utils_Type::T_INT, + ); + $params['subscribe_id'] = array( + 'api.required' => 1, + 'title' => 'Subscribe Event ID', + 'type' => CRM_Utils_Type::T_INT, + ); + $params['hash'] = array( + 'api.required' => 1, + 'title' => 'Hash', + 'type' => CRM_Utils_Type::T_STRING, + ); } diff --git a/api/v3/MailingEventQueue.php b/api/v3/MailingEventQueue.php index ad63ec1c0a..3229702ae2 100644 --- a/api/v3/MailingEventQueue.php +++ b/api/v3/MailingEventQueue.php @@ -85,6 +85,10 @@ function civicrm_api3_mailing_event_queue_delete($params) { * Array of parameters determined by getfields. */ function _civicrm_api3_mailing_event_queue_create_spec(&$params) { - $params['job_id']['api.required'] = 1; + $params['job_id'] = array( + 'api.required' => 1, + 'type' => CRM_Utils_Type::T_INT, + 'title' => 'Job ID', + ); $params['contact_id']['api.required'] = 1; } diff --git a/api/v3/MailingEventResubscribe.php b/api/v3/MailingEventResubscribe.php index 52963e6553..5d766400ec 100644 --- a/api/v3/MailingEventResubscribe.php +++ b/api/v3/MailingEventResubscribe.php @@ -68,10 +68,19 @@ function civicrm_api3_mailing_event_resubscribe_create($params) { * Array of parameters determined by getfields. */ function _civicrm_api3_mailing_event_resubscribe_create_spec(&$params) { - $params['event_queue_id']['api.required'] = 1; - $params['event_queue_id']['title'] = 'Event Queue ID'; - $params['job_id']['api.required'] = 1; - $params['job_id']['title'] = 'Job ID'; - $params['hash']['api.required'] = 1; - $params['hash']['title'] = 'Hash'; + $params['event_queue_id'] = array( + 'api.required' => 1, + 'title' => 'Event Queue ID', + 'type' => CRM_Utils_Type::T_INT, + ); + $params['job_id'] = array( + 'api.required' => 1, + 'title' => 'Job ID', + 'type' => CRM_Utils_Type::T_INT, + ); + $params['hash'] = array( + 'api.required' => 1, + 'title' => 'Hash', + 'type' => CRM_Utils_Type::T_STRING, + ); } diff --git a/api/v3/MailingEventSubscribe.php b/api/v3/MailingEventSubscribe.php index ac82084461..93e71dc888 100644 --- a/api/v3/MailingEventSubscribe.php +++ b/api/v3/MailingEventSubscribe.php @@ -80,8 +80,14 @@ function civicrm_api3_mailing_event_subscribe_create($params) { * Array of parameters determined by getfields. */ function _civicrm_api3_mailing_event_subscribe_create_spec(&$params) { - $params['email']['api.required'] = 1; - $params['email']['title'] = 'Unsubscribe Email'; - $params['group_id']['api.required'] = 1; - $params['group_id']['title'] = 'Unsubscribe From Group'; + $params['email'] = array( + 'api.required' => 1, + 'title' => 'Unsubscribe Email', + 'type' => CRM_Utils_Type::T_STRING, + ); + $params['group_id'] = array( + 'api.required' => 1, + 'title' => 'Unsubscribe From Group', + 'type' => CRM_Utils_Type::T_INT, + ); } diff --git a/api/v3/MailingEventUnsubscribe.php b/api/v3/MailingEventUnsubscribe.php index 322f9263b5..7ab4066b46 100644 --- a/api/v3/MailingEventUnsubscribe.php +++ b/api/v3/MailingEventUnsubscribe.php @@ -75,10 +75,19 @@ function civicrm_api3_mailing_event_unsubscribe_create($params) { * Array of parameters determined by getfields. */ function _civicrm_api3_mailing_event_unsubscribe_create_spec(&$params) { - $params['job_id']['api.required'] = 1; - $params['job_id']['title'] = 'Mailing Job ID'; - $params['hash']['api.required'] = 1; - $params['hash']['title'] = 'Mailing Hash'; - $params['event_queue_id']['api.required'] = 1; - $params['event_queue_id']['title'] = 'Mailing Queue ID'; + $params['job_id'] = array( + 'api.required' => 1, + 'title' => 'Mailing Job ID', + 'type' => CRM_Utils_Type::T_INT, + ); + $params['hash'] = array( + 'api.required' => 1, + 'title' => 'Mailing Hash', + 'type' => CRM_Utils_Type::T_STRING, + ); + $params['event_queue_id'] = array( + 'api.required' => 1, + 'title' => 'Mailing Queue ID', + 'type' => CRM_Utils_Type::T_INT, + ); } diff --git a/api/v3/Membership.php b/api/v3/Membership.php index d5c1100863..e60e8e0a4e 100644 --- a/api/v3/Membership.php +++ b/api/v3/Membership.php @@ -152,6 +152,7 @@ function _civicrm_api3_membership_create_spec(&$params) { $params['skipStatusCal'] = array( 'title' => 'Skip status calculation', 'description' => 'By default this is 0 if id is not set and 1 if it is set.', + 'type' => CRM_Utils_Type::T_BOOLEAN, ); $params['num_terms'] = array( 'title' => 'Number of terms', diff --git a/api/v3/MessageTemplate.php b/api/v3/MessageTemplate.php index a58219306e..4e2c510fa6 100644 --- a/api/v3/MessageTemplate.php +++ b/api/v3/MessageTemplate.php @@ -136,52 +136,66 @@ function _civicrm_api3_message_template_send_spec(&$params) { $params['id']['description'] = 'ID of the template'; $params['id']['title'] = 'Message Template ID'; $params['id']['api.aliases'] = array('messageTemplateID', 'message_template_id'); + $params['id']['type'] = CRM_Utils_Type::T_INT; $params['option_group_name']['description'] = 'option group name of the template (required if no id supplied)'; $params['option_group_name']['title'] = 'Option Group Name'; $params['option_group_name']['api.aliases'] = array('groupName'); + $params['option_group_name']['type'] = CRM_Utils_Type::T_STRING; $params['option_value_name']['description'] = 'option value name of the template (required if no id supplied)'; $params['option_value_name']['title'] = 'Option Value Name'; $params['option_value_name']['api.aliases'] = array('valueName'); + $params['option_value_name']['type'] = CRM_Utils_Type::T_STRING; $params['contact_id']['description'] = 'contact id if contact tokens are to be replaced'; $params['contact_id']['title'] = 'Contact ID'; $params['contact_id']['api.aliases'] = array('contactId'); + $params['contact_id']['type'] = CRM_Utils_Type::T_INT; $params['template_params']['description'] = 'additional template params (other than the ones already set in the template singleton)'; $params['template_params']['title'] = 'Template Params'; $params['template_params']['api.aliases'] = array('tplParams'); + // FIXME: Type?? $params['from']['description'] = 'the From: header'; $params['from']['title'] = 'From'; + $params['from']['type'] = CRM_Utils_Type::T_STRING; $params['to_name']['description'] = 'the recipient’s name'; $params['to_name']['title'] = 'Recipient Name'; $params['to_name']['api.aliases'] = array('toName'); + $params['to_name']['type'] = CRM_Utils_Type::T_STRING; $params['to_email']['description'] = 'the recipient’s email - mail is sent only if set'; $params['to_email']['title'] = 'Recipient Email'; $params['to_email']['api.aliases'] = array('toEmail'); + $params['to_email']['type'] = CRM_Utils_Type::T_STRING; $params['cc']['description'] = 'the Cc: header'; $params['cc']['title'] = 'CC'; + $params['cc']['type'] = CRM_Utils_Type::T_STRING; $params['bcc']['description'] = 'the Bcc: header'; $params['bcc']['title'] = 'BCC'; + $params['bcc']['type'] = CRM_Utils_Type::T_STRING; $params['reply_to']['description'] = 'the Reply-To: header'; $params['reply_to']['title'] = 'Reply To'; $params['reply_to']['api.aliases'] = array('replyTo'); + $params['reply_to']['type'] = CRM_Utils_Type::T_STRING; $params['attachments']['description'] = 'email attachments'; $params['attachments']['title'] = 'Attachments'; + // FIXME: Type?? $params['is_test']['description'] = 'whether this is a test email (and hence should include the test banner)'; $params['is_test']['title'] = 'Is Test'; $params['is_test']['api.aliases'] = array('isTest'); + $params['is_test']['type'] = CRM_Utils_Type::T_BOOLEAN; $params['pdf_filename']['description'] = 'filename of optional PDF version to add as attachment (do not include path)'; $params['pdf_filename']['title'] = 'PDF Filename'; $params['pdf_filename']['api.aliases'] = array('PDFFilename'); + $params['pdf_filename']['type'] = CRM_Utils_Type::T_STRING; } diff --git a/api/v3/Participant.php b/api/v3/Participant.php index 8465807221..86df15a02d 100644 --- a/api/v3/Participant.php +++ b/api/v3/Participant.php @@ -180,8 +180,11 @@ function civicrm_api3_participant_get($params) { * Array of parameters determined by getfields. */ function _civicrm_api3_participant_get_spec(&$params) { - $params['participant_test']['api.default'] = 0; - $params['participant_test']['title'] = 'Get Test Participants'; + $params['participant_test'] = array( + 'api.default' => 0, + 'title' => 'Get Test Participants', + 'type' => CRM_Utils_Type::T_BOOLEAN, + ); } /** diff --git a/api/v3/UFField.php b/api/v3/UFField.php index 3cd2e9aa90..8e63b0024f 100644 --- a/api/v3/UFField.php +++ b/api/v3/UFField.php @@ -112,8 +112,12 @@ function _civicrm_api3_uf_field_create_spec(&$params) { 'type' => CRM_Utils_Type::T_BOOLEAN, 'api.default' => TRUE, ); - $params['created_id']['api.default'] = 'user_contact_id'; - $params['created_id']['title'] = 'Created By'; + $params['created_id'] = array( + 'api.default' => 'user_contact_id', + 'title' => 'Created By', + 'type' => CRM_Utils_Type::T_INT, + ); + $params['is_active']['api.default'] = TRUE; }