);
}
- if ($contact->contact_type == 'Individual' &&
- (isset($params['current_employer']) ||
- isset($params['employer_id'])
- )
- ) {
+ if ($contact->contact_type == 'Individual' && (isset($params['current_employer']) || isset($params['employer_id']))) {
+ $newEmployer = !empty($params['employer_id']) ? $params['employer_id'] : CRM_Utils_Array::value('current_employer', $params);
// create current employer
- if (isset($params['employer_id'])) {
- CRM_Contact_BAO_Contact_Utils::createCurrentEmployerRelationship($contact->id,
- $params['employer_id'], $employerId
- );
- }
- elseif ($params['current_employer']) {
- CRM_Contact_BAO_Contact_Utils::createCurrentEmployerRelationship($contact->id,
- $params['current_employer']
- );
+ if ($newEmployer) {
+ CRM_Contact_BAO_Contact_Utils::createCurrentEmployerRelationship($contact->id, $newEmployer, $employerId);
}
else {
//unset if employer id exits
$values['preferred_communication_method'] = $preffComm;
$values['preferred_communication_method_display'] = CRM_Utils_Array::value('preferred_communication_method_display', $temp);
- CRM_Contact_DAO_Contact::addDisplayEnums($values);
+ $preferredMailingFormat = CRM_Core_SelectValues::pmf();
+ $values['preferred_mail_format'] = $preferredMailingFormat[$contact->preferred_mail_format];
// get preferred languages
if (!empty($contact->preferred_language)) {