/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
'name' => 'assignee_id',
'title' => 'assigned to',
'type' => 1,
- 'FKClassName' => 'CRM_Activity_DAO_ActivityAssignment',
+ 'FKClassName' => 'CRM_Activity_DAO_ActivityContact',
);
$params['target_contact_id'] = array(
'name' => 'target_id',
'title' => 'Activity Target',
'type' => 1,
- 'FKClassName' => 'CRM_Activity_DAO_ActivityTarget',
+ 'FKClassName' => 'CRM_Activity_DAO_ActivityContact',
);
- $params['activity_status_id'] = array(
- 'name' => 'status_id',
- 'title' => 'Status Id',
- 'type' => 1,
+
+ $params['source_contact_id'] = array(
+ 'name' => 'source_contact_id',
+ 'title' => 'Activity Source Contact',
+ 'type' => 1,
+ 'FKClassName' => 'CRM_Activity_DAO_ActivityContact',
+ 'api.default' => 'user_contact_id',
);
+
}
/**
$returns[$returnkey] = $v;
}
}
-
+ $returns['source_contact_id'] = 1;
foreach ($returns as $n => $v) {
switch ($n) {
case 'assignee_contact_id':
return civicrm_api3_create_success($activities, $params, 'activity', 'get');
}
+
+
/**
* Delete a specified Activity.
*
return civicrm_api3_create_error('Invalid Activity Type ID');
}
- // check for activity status is passed in
- // note this should all be removed in favour of wrapper layer validation
- // needs testing
- if (isset($params['activity_status_id'])) {
- $activityStatus = CRM_Core_PseudoConstant::activityStatus();
-
- if (is_numeric($params['activity_status_id']) && !array_key_exists($params['activity_status_id'], $activityStatus)) {
- return civicrm_api3_create_error('Invalid Activity Status');
- }
- elseif (!is_numeric($params['activity_status_id'])) {
- $statusId = array_search($params['activity_status_id'], $activityStatus);
-
- if (!is_numeric($statusId)) {
- return civicrm_api3_create_error('Invalid Activity Status');
- }
- }
- }
-
-
-
// check for activity duration minutes
// this should be validated @ the wrapper layer not here
// needs testing