CRM-16523 towards fixing test issues on this
[civicrm-core.git] / api / v3 / Activity.php
index 0d724b224f1d3eb220c8d177f86f116e564c219f..cd6f3bbee1283fa09f53d37c0df983a908ae851e 100644 (file)
@@ -40,7 +40,7 @@
  *
  * @throws API_Exception
  * @return array
- *   Array containing 'is_error' to denote success or failure and details of the created activity.
+ *   API result array
  */
 function civicrm_api3_activity_create($params) {
 
@@ -187,23 +187,38 @@ function _civicrm_api3_activity_create_spec(&$params) {
 
   $params['assignee_contact_id'] = array(
     'name' => 'assignee_id',
-    'title' => 'assigned to',
+    'title' => 'Activity Assignee',
+    'description' => 'Contact(s) assigned to this activity.',
     'type' => 1,
-    'FKClassName' => 'CRM_Activity_DAO_ActivityContact',
+    'FKClassName' => 'CRM_Contact_DAO_Contact',
+    'FKApiName' => 'Contact',
   );
   $params['target_contact_id'] = array(
     'name' => 'target_id',
     'title' => 'Activity Target',
+    'description' => 'Contact(s) participating in this activity.',
     'type' => 1,
-    'FKClassName' => 'CRM_Activity_DAO_ActivityContact',
+    'FKClassName' => 'CRM_Contact_DAO_Contact',
+    'FKApiName' => 'Contact',
   );
 
   $params['source_contact_id'] = array(
     'name' => 'source_contact_id',
     'title' => 'Activity Source Contact',
+    'description' => 'Person who created this activity. Defaults to current user.',
     'type' => 1,
-    'FKClassName' => 'CRM_Activity_DAO_ActivityContact',
+    'FKClassName' => 'CRM_Contact_DAO_Contact',
     'api.default' => 'user_contact_id',
+    'FKApiName' => 'Contact',
+  );
+
+  $params['case_id'] = array(
+    'name' => 'case_id',
+    'title' => 'Case ID',
+    'description' => 'For creating an activity as part of a case.',
+    'type' => 1,
+    'FKClassName' => 'CRM_Case_DAO_Case',
+    'FKApiName' => 'Case',
   );
 
 }
@@ -215,6 +230,7 @@ function _civicrm_api3_activity_create_spec(&$params) {
  *   Array per getfields documentation.
  *
  * @return array
+ *   API result array
  */
 function civicrm_api3_activity_get($params) {
   if (!empty($params['contact_id'])) {
@@ -226,7 +242,7 @@ function civicrm_api3_activity_get($params) {
     }
   }
   else {
-    $activities = _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params, FALSE);
+    $activities = _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params, FALSE, 'Activity');
   }
   $options = _civicrm_api3_get_options_from_params($params, FALSE, 'Activity', 'get');
   if ($options['is_count']) {
@@ -310,6 +326,7 @@ function _civicrm_api3_activity_get_formatResult($params, $activities) {
  * @throws API_Exception
  *
  * @return array
+ *   API result array
  */
 function civicrm_api3_activity_delete($params) {