3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2014 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
31 * @package CiviCRM_APIv3
32 * @subpackage API_Activity
34 * @copyright CiviCRM LLC (c) 2004-2014
35 * $Id: ActivityType.php 30171 2010-10-14 09:11:27Z mover $
40 * @deprecated api notice
41 * @return string to indicate this entire api entity is deprecated
43 function _civicrm_api3_activity_type_deprecation() {
44 return 'The activity_type api is deprecated. Please use the option_value api instead.';
48 * retrieve activity types
50 * @param array $params
52 * @return array $activityTypes activity types keyed by id
55 * @example ActivityTypeGet.php
56 * @deprecated - use getoptions
58 function civicrm_api3_activity_type_get($params) {
60 $activityTypes = CRM_Core_OptionGroup
::values('activity_type');
61 return civicrm_api3_create_success($activityTypes, $params, 'activity_type', 'get');
65 * create activity type (
67 * @param array $params
68 * Associated array of fields.
69 * $params['option_value_id'] is required for updation of activity type
71 * @return array $activityType created / updated activity type
75 * @deprecated - use option_value create
77 function civicrm_api3_activity_type_create($params) {
80 $groupParams = array('name' => 'activity_type');
82 if ($optionValueID = CRM_Utils_Array
::value('option_value_id', $params)) {
86 $activityObject = CRM_Core_OptionValue
::addOptionValue($params, $groupParams, $action, $optionValueID);
87 $activityType = array();
88 _civicrm_api3_object_to_array($activityObject, $activityType[$activityObject->id
]);
89 return civicrm_api3_create_success($activityType, $params, 'activity_type', 'create');
93 * Adjust Metadata for Create action
95 * The metadata is used for setting defaults, documentation & validation
96 * @param array $params
97 * Array or parameters determined by getfields.
99 function _civicrm_api3_activity_type_create_spec(&$params) {
100 $params['label']['api.required'] = 1;
101 $params['label']['title'] = 'Label';
102 $params['weight']['api.required'] = 1;
103 $params['weight']['title'] = 'Weight';
107 * delete activity type
109 * @param array $params
110 * Array including id of activity_type to delete.
112 * @return array API result array
116 * @deprecated - we will introduce OptionValue Delete- plse consider helping with this if not done
118 function civicrm_api3_activity_type_delete($params) {
119 return civicrm_api3_create_success(CRM_Core_BAO_OptionValue
::del($params['id']), $params);