function wf_crm_results_display_options in Webform CiviCRM Integration 7.5
Same name and namespace in other branches
- 7.3 contact_component.inc \wf_crm_results_display_options()
- 7.4 includes/contact_component.inc \wf_crm_results_display_options()
Returns a list of fields that can be shown in an "Existing Contact" field display In the future we could use api.getfields for this, but that also returns a lot of stuff we don't want
Return value
array
1 call to wf_crm_results_display_options()
- _webform_edit_civicrm_contact in includes/
contact_component.inc - Implements _webform_edit_component().
File
- includes/
contact_component.inc, line 1128
Code
function wf_crm_results_display_options($contact_type) {
$options = [
'display_name' => t("Display Name"),
'sort_name' => t("Sort Name"),
];
if ($contact_type == 'individual') {
$options += [
'first_name' => t("First Name"),
'middle_name' => t("Middle Name"),
'last_name' => t("Last Name"),
'current_employer' => t("Current Employer"),
'job_title' => t("Job Title"),
];
}
else {
$options[$contact_type . '_name'] = $contact_type == 'organization' ? t("Organization Name") : t("Household Name");
}
$options += [
'nick_name' => t("Nick Name"),
'id' => t("Contact ID"),
'external_identifier' => t("External ID"),
'source' => t("Source"),
'email' => t("Email"),
'city' => t("City"),
'county' => t("District/County"),
'state_province' => t("State/Province"),
'street_address' => t("Street Address"),
'country' => t("Country"),
'postal_code' => t("Postal Code"),
'phone' => t("Phone"),
];
return $options;
}