}
}
- // update the UF user_unique_id if that has changed
- CRM_Core_BAO_UFMatch::updateUFName($contact->id);
-
if (!empty($params['custom']) &&
is_array($params['custom'])
) {
[
'name' => 'organization_name',
'title' => ts('Current Employer'),
+ 'type' => CRM_Utils_Type::T_STRING,
],
]);
+ // This probably would be added anyway by appendPseudoConstantsToFields.
$locationType = [
'location_type' => [
'name' => 'location_type',
'where' => 'civicrm_location_type.name',
'title' => ts('Location Type'),
+ 'type' => CRM_Utils_Type::T_STRING,
],
];
'name' => 'im_provider',
'where' => 'civicrm_im.provider_id',
'title' => ts('IM Provider'),
+ 'type' => CRM_Utils_Type::T_STRING,
],
];
+ $phoneFields = CRM_Core_DAO_Phone::export();
+ // This adds phone_type to the exportable fields and make it available for export.
+ // with testing the same can be done to the other entities.
+ CRM_Core_DAO::appendPseudoConstantsToFields($phoneFields);
$locationFields = array_merge($locationType,
CRM_Core_DAO_Address::export(),
- CRM_Core_DAO_Phone::export(),
+ $phoneFields,
CRM_Core_DAO_Email::export(),
$IMProvider,
CRM_Core_DAO_IM::export(TRUE),
);
}
}
- $fields['current_employer_id']['title'] = ts('Current Employer ID');
//fix for CRM-791
if ($export) {
$fields = array_merge($fields, [
return $email;
}
- /**
- * Function to get primary OpenID of the contact.
- *
- * @param int $contactID
- * Contact id.
- *
- * @return string
- * >openid OpenID if present else null
- */
- public static function getPrimaryOpenId($contactID) {
- // fetch the primary OpenID
- $query = "
-SELECT civicrm_openid.openid as openid
-FROM civicrm_contact
-LEFT JOIN civicrm_openid ON ( civicrm_contact.id = civicrm_openid.contact_id )
-WHERE civicrm_contact.id = %1
-AND civicrm_openid.is_primary = 1";
- $p = [1 => [$contactID, 'Integer']];
- $dao = CRM_Core_DAO::executeQuery($query, $p);
-
- $openId = NULL;
- if ($dao->fetch()) {
- $openId = $dao->openid;
- }
- return $openId;
- }
-
/**
* Fetch the object and store the values in the values array.
*
if ($dao->fetch()) {
$dao->is_primary = 1;
$dao->save();
+ if ($type === 'Email') {
+ CRM_Core_BAO_UFMatch::updateUFName($dao->contact_id);
+ }
}
}
}