From b2ed8e7370d814d15ba1d575831c05f349914112 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sat, 14 Mar 2015 22:49:37 -0400 Subject: [PATCH] Cleanup api field descriptions --- api/v3/Address.php | 5 ++++- api/v3/CustomField.php | 3 ++- api/v3/Domain.php | 5 ++++- api/v3/Job.php | 5 ++++- api/v3/Membership.php | 9 ++++++--- api/v3/PledgePayment.php | 6 +++++- api/v3/Setting.php | 35 ++++++++++++++++++++++++++++------- api/v3/System.php | 12 ++++++++++-- api/v3/UFField.php | 3 ++- 9 files changed, 65 insertions(+), 18 deletions(-) diff --git a/api/v3/Address.php b/api/v3/Address.php index a00dd415a9..1e16bfd62e 100644 --- a/api/v3/Address.php +++ b/api/v3/Address.php @@ -91,7 +91,10 @@ function civicrm_api3_address_create(&$params) { function _civicrm_api3_address_create_spec(&$params) { $params['location_type_id']['api.required'] = 1; $params['contact_id']['api.required'] = 1; - $params['street_parsing'] = array('title' => 'optional param to indicate you want the street_address field parsed into individual params'); + $params['street_parsing'] = array( + 'title' => 'Street Address Parsing', + 'description' => 'Optional param to indicate you want the street_address field parsed into individual params', + ); $params['world_region'] = array( 'title' => ts('World Region'), 'name' => 'world_region', diff --git a/api/v3/CustomField.php b/api/v3/CustomField.php index f18237e477..0f4ad15d12 100644 --- a/api/v3/CustomField.php +++ b/api/v3/CustomField.php @@ -81,7 +81,8 @@ function _civicrm_api3_custom_field_create_spec(&$params) { $params['custom_group_id']['api.required'] = 1; $params['is_active']['api.default'] = 1; $params['option_type'] = array( - 'title' => 'This (boolean) field tells the BAO to create an option group for the field if the field type is appropriate', + 'title' => 'Option Type', + 'description' => 'This (boolean) field tells the BAO to create an option group for the field if the field type is appropriate', 'api.default' => 1, 'type' => CRM_Utils_Type::T_BOOLEAN, ); diff --git a/api/v3/Domain.php b/api/v3/Domain.php index fcfa963815..6c38c10731 100644 --- a/api/v3/Domain.php +++ b/api/v3/Domain.php @@ -117,7 +117,10 @@ function civicrm_api3_domain_get($params) { * Array of parameters determined by getfields. */ function _civicrm_api3_domain_get_spec(&$params) { - $params['current_domain'] = array('title' => "get loaded domain"); + $params['current_domain'] = array( + 'title' => "Current Domain", + 'description' => "get loaded domain", + ); } /** diff --git a/api/v3/Job.php b/api/v3/Job.php index c22003c6b4..08d98d731d 100644 --- a/api/v3/Job.php +++ b/api/v3/Job.php @@ -143,7 +143,10 @@ function _civicrm_api3_job_geocode_spec(&$params) { $params['end'] = array('title' => 'End Date'); $params['geocoding'] = array('title' => 'Geocode address?'); $params['parse'] = array('title' => 'Parse street address?'); - $params['throttle'] = array('title' => 'Throttle? if enabled, geo-codes at a slow rate'); + $params['throttle'] = array( + 'title' => 'Throttle?', + 'description' => 'if enabled, geo-codes at a slow rate', + ); } /** diff --git a/api/v3/Membership.php b/api/v3/Membership.php index 63823a516c..d5c1100863 100644 --- a/api/v3/Membership.php +++ b/api/v3/Membership.php @@ -150,10 +150,12 @@ function _civicrm_api3_membership_create_spec(&$params) { $params['membership_type_id']['api.aliases'] = array('membership_type'); $params['status_id']['api.aliases'] = array('membership_status'); $params['skipStatusCal'] = array( - 'title' => 'Skip status calculation. By default this is 0 if id is not set and 1 if it is set.', + 'title' => 'Skip status calculation', + 'description' => 'By default this is 0 if id is not set and 1 if it is set.', ); $params['num_terms'] = array( - 'title' => 'Number of terms to add/renew. If this parameter is passed, dates will be calculated automatically. If no id is passed (new membership) and no dates are given, num_terms will be assumed to be 1.', + 'title' => 'Number of terms', + 'description' => 'Terms to add/renew. If this parameter is passed, dates will be calculated automatically. If no id is passed (new membership) and no dates are given, num_terms will be assumed to be 1.', 'type' => CRM_Utils_Type::T_INT, ); } @@ -169,7 +171,8 @@ function _civicrm_api3_membership_create_spec(&$params) { function _civicrm_api3_membership_get_spec(&$params) { $params['membership_type_id']['api.aliases'] = array('membership_type'); $params['active_only'] = array( - 'title' => 'Only retrieve active memberships', + 'title' => 'Active Only', + 'description' => 'Only retrieve active memberships', 'type' => CRM_Utils_Type::T_BOOLEAN, ); } diff --git a/api/v3/PledgePayment.php b/api/v3/PledgePayment.php index 3d4ff21c82..19939f3893 100644 --- a/api/v3/PledgePayment.php +++ b/api/v3/PledgePayment.php @@ -126,5 +126,9 @@ function civicrm_api3_pledge_payment_get($params) { * Modifiable list of fields allowed for the PledgePayment.get action. */ function civicrm_api3_pledge_payment_get_spec(&$params) { - $params['option.create_new'] = array('title' => "Create new field rather than update an unpaid payment"); + $params['option.create_new'] = array( + 'title' => "Create New", + 'description' => "Create new field rather than update an unpaid payment", + 'type' => CRM_Utils_Type::T_BOOLEAN, + ); } diff --git a/api/v3/Setting.php b/api/v3/Setting.php index 31b86e50eb..eb3bf6d4c4 100644 --- a/api/v3/Setting.php +++ b/api/v3/Setting.php @@ -80,9 +80,18 @@ function civicrm_api3_setting_getfields($params) { * @param array $params */ function _civicrm_api3_setting_getfields_spec(&$params) { - $params['filters'] = array('title' => 'Fields you wish to filter by e.g. array("group_name" => "CiviCRM Preferences")'); - $params['component_id'] = array('title' => 'id of relevant component'); - $params['profile'] = array('title' => 'profile is passed through to hooks & added to cachestring'); + $params['filters'] = array( + 'title' => 'Filters', + 'description' => 'Fields you wish to filter by e.g. array("group_name" => "CiviCRM Preferences")', + ); + $params['component_id'] = array( + 'title' => 'Component ID', + 'description' => 'ID of relevant component', + ); + $params['profile'] = array( + 'title' => 'Profile', + 'description' => 'Profile is passed through to hooks & added to cachestring', + ); } /** @@ -168,8 +177,14 @@ function civicrm_api3_setting_revert(&$params) { * @param array $params */ function _civicrm_api3_setting_revert_spec(&$params) { - $params['name'] = array('title' => 'Setting Name belongs to'); - $params['component_id'] = array('title' => 'id of relevant component'); + $params['name'] = array( + 'title' => 'Name', + 'description' => 'Setting Name belongs to', + ); + $params['component_id'] = array( + 'title' => 'Component ID', + 'description' => 'ID of relevant component', + ); $params['domain_id'] = array( 'api.default' => 'current_domain', 'description' => 'Defaults may differ by domain - if you do not pass in a domain id this will default to the current domain' @@ -211,8 +226,14 @@ function civicrm_api3_setting_fill(&$params) { * @param array $params */ function _civicrm_api3_setting_fill_spec(&$params) { - $params['name'] = array('title' => 'Setting Name belongs to'); - $params['component_id'] = array('title' => 'id of relevant component'); + $params['name'] = array( + 'title' => 'Name', + 'description' => 'Setting Name belongs to', + ); + $params['component_id'] = array( + 'title' => 'Component ID', + 'description' => 'ID of relevant component', + ); $params['domain_id'] = array( 'api.default' => 'current_domain', 'title' => 'Setting Domain', diff --git a/api/v3/System.php b/api/v3/System.php index 661e0caf34..0e5b5608c1 100644 --- a/api/v3/System.php +++ b/api/v3/System.php @@ -60,8 +60,16 @@ function civicrm_api3_system_flush($params) { * Array of parameters determined by getfields. */ function _civicrm_api3_system_flush_spec(&$params) { - $params['triggers'] = array('title' => 'rebuild triggers (boolean)'); - $params['session'] = array('title' => 'refresh sessions (boolean)'); + $params['triggers'] = array( + 'title' => 'Triggers', + 'description' => 'rebuild triggers (boolean)', + 'type' => CRM_Utils_Type::T_BOOLEAN, + ); + $params['session'] = array( + 'title' => 'Sessions', + 'description' => 'refresh sessions (boolean)', + 'type' => CRM_Utils_Type::T_BOOLEAN, + ); } /** diff --git a/api/v3/UFField.php b/api/v3/UFField.php index 5c1975a50a..3cd2e9aa90 100644 --- a/api/v3/UFField.php +++ b/api/v3/UFField.php @@ -107,7 +107,8 @@ function civicrm_api3_uf_field_create($params) { */ function _civicrm_api3_uf_field_create_spec(&$params) { $params['option.autoweight'] = array( - 'title' => "Automatically adjust weights in UFGroup to align with UFField", + 'title' => "Auto Weight", + 'description' => "Automatically adjust weights in UFGroup to align with UFField", 'type' => CRM_Utils_Type::T_BOOLEAN, 'api.default' => TRUE, ); -- 2.25.1