X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FCase.php;h=7a6bf6c61d097a3a75f068663e32e08d0dab6685;hb=da7a33feb6f28d09a8b2de93cb702b43ed484851;hp=c6f3f6e85f5e98da402205dca3060b04cb7a5796;hpb=ca11b9da84832d48f19debc3a8e7b2cc802a3c53;p=civicrm-core.git diff --git a/api/v3/Case.php b/api/v3/Case.php index c6f3f6e85f..7a6bf6c61d 100644 --- a/api/v3/Case.php +++ b/api/v3/Case.php @@ -147,7 +147,8 @@ function _civicrm_api3_case_create_spec(&$params) { $params['contact_id']['title'] = 'Case Client'; $params['contact_id']['api.required'] = 1; $params['status_id']['api.default'] = 1; - $params['created_id']['api.default'] = 'user_contact_id'; + $params['creator_id']['api.default'] = 'user_contact_id'; + $params['creator_id']['type'] = CRM_Utils_Type::T_INT; $params['start_date']['api.default'] = 'now'; $params['medium_id'] = array( 'name' => 'medium_id', @@ -188,12 +189,12 @@ function _civicrm_api3_case_delete_spec(&$params) { * * {@getfields case_get} * + * @throws API_Exception * @return array (get mode, case_id provided): Array with case details, case roles, case activity ids, (search mode, case_id not provided): Array of cases found@access public * @todo Erik Hommel 16 dec 2010 check if all DB fields are returned */ function civicrm_api3_case_get($params) { $options = _civicrm_api3_get_options_from_params($params); - //search by client if (!empty($params['contact_id'])) { $ids = array(); @@ -339,13 +340,14 @@ function civicrm_api3_case_update($params) { /** * Delete a specified case. * - * @param array( - //REQUIRED: + * @param array ( + * //REQUIRED: * 'id' => int * * //OPTIONAL * 'move_to_trash' => bool (defaults to false) * + * @throws API_Exception * @return boolean: true if success, else false * {@getfields case_delete} * @access public @@ -391,10 +393,6 @@ function _civicrm_api3_case_read($caseId, $options) { // Legacy support for client_id - TODO: in apiv4 remove 'client_id' $case['client_id'] = $case['contact_id'] = $dao->retrieveContactIdsByCaseId($caseId); - //handle multi-value case type - $sep = CRM_Core_DAO::VALUE_SEPARATOR; - $case['case_type_id'] = trim(str_replace($sep, ',', $case['case_type_id']), ','); - if (!empty($return['contacts'])) { //get case contacts $contacts = CRM_Case_BAO_Case::getcontactNames($caseId); @@ -419,14 +417,11 @@ function _civicrm_api3_case_read($caseId, $options) { */ function _civicrm_api3_case_format_params(&$params) { // figure out case type id from case type and vice-versa - $caseTypes = CRM_Case_PseudoConstant::caseType('label', FALSE); + $caseTypes = CRM_Case_PseudoConstant::caseType('title', FALSE); if (empty($params['case_type_id'])) { $params['case_type_id'] = array_search($params['case_type'], $caseTypes); } elseif (empty($params['case_type'])) { $params['case_type'] = $caseTypes[$params['case_type_id']]; } - // format input with value separators - $sep = CRM_Core_DAO::VALUE_SEPARATOR; - $params['case_type_id'] = $sep . implode($sep, (array) $params['case_type_id']) . $sep; }