a5331b6526da5c8a33d9e5b2af2f1f195d968749
4 * Retrieve a report template
6 * FIXME This is a bare-minimum placeholder
8 * @param array $ params input parameters
10 * {@example OptionValueGet.php 0}
11 * @example OptionValueGet.php
13 * @return array details of found Option Values
14 * {@getfields OptionValue_get}
17 function civicrm_api3_report_template_get($params) {
18 require_once 'api/v3/OptionValue.php';
19 $params['option_group_id'] = CRM_Core_DAO
::getFieldValue(
20 'CRM_Core_DAO_OptionGroup', 'report_template', 'id', 'name'
22 return civicrm_api3_option_value_get($params);
26 * Add a OptionValue. OptionValues are used to classify CRM entities (including Contacts, Groups and Actions).
28 * Allowed @params array keys are:
30 * {@example OptionValueCreate.php}
32 * @return array of newly created option_value property values.
33 * {@getfields OptionValue_create}
36 function civicrm_api3_report_template_create($params) {
37 require_once 'api/v3/OptionValue.php';
38 $params['option_group_id'] = CRM_Core_DAO
::getFieldValue(
39 'CRM_Core_DAO_OptionGroup', 'report_template', 'id', 'name'
41 return civicrm_api3_option_value_create($params);
45 * Adjust Metadata for Create action
47 * The metadata is used for setting defaults, documentation & validation
48 * @param array $params array or parameters determined by getfields
50 function _civicrm_api3_report_template_create_spec(&$params) {
51 require_once 'api/v3/OptionValue.php';
52 _civicrm_api3_option_value_create_spec($params);
53 $params['weight']['api.default'] = 'next';
54 $params['value']['api.aliases'] = array('report_url');
55 $params['name']['api.aliases'] = array('class_name');
56 // $params['component']['api.required'] = TRUE;
60 * Deletes an existing ReportTemplate
62 * @param array $params
64 * {@example ReportTemplateDelete.php 0}
66 * @return array Api result
67 * {@getfields ReportTemplate_create}
70 function civicrm_api3_report_template_delete($params) {
71 require_once 'api/v3/OptionValue.php';
72 return civicrm_api3_option_value_delete($params);
76 function civicrm_api3_report_template_getfields($params) {
77 return civicrm_api3_create_success(array(
83 'option_group_id' => array(
84 'name' => 'option_group_id',
87 'FKClassName' => 'CRM_Core_DAO_OptionGroup',
92 'title' => 'Option Label',
100 'title' => 'Option Value',
108 'title' => 'Option Name',
112 'where' => 'civicrm_option_value.name',
116 'name' => 'grouping',
118 'title' => 'Option Grouping Name',
127 'is_default' => array(
128 'name' => 'is_default',
137 'description' => array(
138 'name' => 'description',
140 'title' => 'Description',
144 'is_optgroup' => array(
145 'name' => 'is_optgroup',
148 'is_reserved' => array(
149 'name' => 'is_reserved',
152 'is_active' => array(
153 'name' => 'is_active',
156 'component_id' => array(
157 'name' => 'component_id',
159 'FKClassName' => 'CRM_Core_DAO_Component',
161 'domain_id' => array(
162 'name' => 'domain_id',
164 'FKClassName' => 'CRM_Core_DAO_Domain',
166 'visibility_id' => array(
167 'name' => 'visibility_id',