Details
-
Type: Improvement
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.1
-
Fix Version/s: 3.1
-
Component/s: Core CiviCRM
-
Labels:None
Description
The autocomplete contact search widget is used to quickly find contacts by typing in a partial name or email address. Examples incude the search box on left side of new menu bar, the search box in the "New Contribution", "New Event Registration", etc. forms, and other screens. Currently this widget only displays contact sort name (e.g. "Smith, Joan"). For many use cases, the user needs to see additional contact data in order to select the correct contact from the drop-down list (and / or verify whether the contact they are looking for exists in the DB).
This issue adds the ability to include ANY of the following additional contact data elements in the drop-down list displayed by this widget:
- Email-primary (will be included by default)
- Phone-primary
- Street Address-primary
- City-primary
- State/Province-primary
- Country-primary
EXAMPLE: If site is configured to include Email + City, the drop down list will look like this:
Smith, Joan :: <j.smith@example.org> :: San Jose
Smith, Joan :: <joans@myco.com> :: Oakland
Implementation
============
1. Add a new column to civicrm_preferences
- contact_autocomplete_options varchar 255
This column will store the admin-selected 'fields' to include in the autocomplete drop-downs. We can store them as field names separated by our usual ctrl A character, e.g
email[]phone[]city
2. Add a new checkbox field to the Search Settings form
Field label: Autocomplete Contact Search Options
Checkbox items: [ x ] Contact Name [ ] Email Address [ ] Phone [ ] Street Address [ ] City [ ] State/Province [ ] Country
Notes:
- Contact Name is checked and read-only (we ALWAYS include contact sort name)
- For new installs / upgrades - Email Address is also checked by default
3. Modify autocomplete search widget / query to check preferences for additional tables / columns to include in results and configure results rows as shown in the EXAMPLE above