projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #3223 from lcdservices/CRM-14672
[civicrm-core.git]
/
api
/
v3
/
ActivityType.php
diff --git
a/api/v3/ActivityType.php
b/api/v3/ActivityType.php
index 6e0fb748d43edaed36ee18d0ec55275bcdbd89e1..e70ce15d0d982c72e3afad00f07808925991c623 100644
(file)
--- a/
api/v3/ActivityType.php
+++ b/
api/v3/ActivityType.php
@@
-1,11
+1,9
@@
<?php
<?php
-// $Id$
-
/*
+--------------------------------------------------------------------+
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.
3
|
+ | CiviCRM version 4.
5
|
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-201
3
|
+ | Copyright CiviCRM LLC (c) 2004-201
4
|
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
@@
-36,28
+34,24
@@
* @package CiviCRM_APIv3
* @subpackage API_Activity
*
* @package CiviCRM_APIv3
* @subpackage API_Activity
*
- * @copyright CiviCRM LLC (c) 2004-201
3
+ * @copyright CiviCRM LLC (c) 2004-201
4
* $Id: ActivityType.php 30171 2010-10-14 09:11:27Z mover $
*
*/
* $Id: ActivityType.php 30171 2010-10-14 09:11:27Z mover $
*
*/
-/**
- * Include common API util functions
- */
-require_once 'CRM/Core/OptionGroup.php';
-
/**
* Function to retrieve activity types
*
/**
* Function to retrieve activity types
*
+ * @param $params
+ *
* @return array $activityTypes activity types keyed by id
* @access public
*
* @example ActivityTypeGet.php
* @return array $activityTypes activity types keyed by id
* @access public
*
* @example ActivityTypeGet.php
- * @deprecated - use
constant_get
+ * @deprecated - use
getoptions
*/
function civicrm_api3_activity_type_get($params) {
*/
function civicrm_api3_activity_type_get($params) {
-
$activityTypes = CRM_Core_OptionGroup::values('activity_type');
return civicrm_api3_create_success($activityTypes, $params, 'activity_type', 'get');
}
$activityTypes = CRM_Core_OptionGroup::values('activity_type');
return civicrm_api3_create_success($activityTypes, $params, 'activity_type', 'get');
}
@@
-72,14
+66,10
@@
function civicrm_api3_activity_type_get($params) {
*
* @access public
*
*
* @access public
*
- *{@schema Activity/ActivityType.xml}
- *
- * {@example ActivityTypeCreate.php 0}
* @deprecated - we will introduce OptionValue Create - plse consider helping with this if not done
*/
function civicrm_api3_activity_type_create($params) {
* @deprecated - we will introduce OptionValue Create - plse consider helping with this if not done
*/
function civicrm_api3_activity_type_create($params) {
-
$action = 1;
$groupParams = array('name' => 'activity_type');
$action = 1;
$groupParams = array('name' => 'activity_type');
@@
-87,7
+77,6
@@
function civicrm_api3_activity_type_create($params) {
$action = 2;
}
$action = 2;
}
- require_once 'CRM/Core/OptionValue.php';
$activityObject = CRM_Core_OptionValue::addOptionValue($params, $groupParams, $action, $optionValueID);
$activityType = array();
_civicrm_api3_object_to_array($activityObject, $activityType[$activityObject->id]);
$activityObject = CRM_Core_OptionValue::addOptionValue($params, $groupParams, $action, $optionValueID);
$activityType = array();
_civicrm_api3_object_to_array($activityObject, $activityType[$activityObject->id]);
@@
-96,7
+85,7
@@
function civicrm_api3_activity_type_create($params) {
/**
* Adjust Metadata for Create action
/**
* Adjust Metadata for Create action
- *
+ *
* The metadata is used for setting defaults, documentation & validation
* @param array $params array or parameters determined by getfields
*/
* The metadata is used for setting defaults, documentation & validation
* @param array $params array or parameters determined by getfields
*/
@@
-108,22
+97,15
@@
function _civicrm_api3_activity_type_create_spec(&$params) {
/**
* Function to delete activity type
*
/**
* Function to delete activity type
*
- * @param a
ctivityTypeId int activity type id
to delete
- *
- * @return
boolen
+ * @param a
rray $params array including id of activity_type
to delete
+
+ * @return
array API result array
*
* @access public
*
* @deprecated - we will introduce OptionValue Delete- plse consider helping with this if not done
*
* @access public
*
* @deprecated - we will introduce OptionValue Delete- plse consider helping with this if not done
- * {@example ActivityTypeDelete.php 0}
*/
function civicrm_api3_activity_type_delete($params) {
*/
function civicrm_api3_activity_type_delete($params) {
-
- civicrm_api3_verify_mandatory($params, NULL, array('activity_type_id'));
-
- $activityTypeId = $params['activity_type_id'];
- require_once 'CRM/Core/BAO/OptionValue.php';
-
- return CRM_Core_BAO_OptionValue::del($activityTypeId);
+ return civicrm_api3_create_success(CRM_Core_BAO_OptionValue::del($params['id']), $params);
}
}