/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
//default for source_contact_id = currently logged in user
$params['source_contact_id']['api.default'] = 'user_contact_id';
+ $params['status_id']['api.aliases'] = array('activity_status');
+
$params['assignee_contact_id'] = array(
'name' => 'assignee_id',
'title' => 'assigned to',
'api.default' => 'user_contact_id',
);
- $params['activity_status_id'] = array(
- 'name' => 'status_id',
- 'title' => 'Status Id',
- 'type' => 1,
- );
}
/**
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