Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.2.7
-
Fix Version/s: 4.3.0
-
Component/s: Core CiviCRM
-
Labels:None
Description
Currently if Phone Extension field is included in a profile, the phone_type_id is NOT specified which means it is not explicitly linked to a phone record. Also the runtime layout is sub-optimal (putting extension field on a separate line).
We can solve both problems by replacing Phone Extension profile field with 'Phone and Extension' pseudo-field which renders both the phone and phone extension fields side-by-side at runtime, and adds the correct phone_type_id to the phone extension field handle (e.g. id="phone_ext-Home-1")
1. Modify CRM_Core_BAO_UFField::getAvailableFields to remove phone_ext from available fields and replace with a new 'pseudo-field' - 'phone_and_ext' (option label = 'Phone and Extension').
2. Modify profile runtime form rendering to handle 'phone_and_ext' when present in uf_field.field_name
Render uf_field.label
Render phone and phone_ext fields side-by-side (phone_ext has no label)
Use uf_field.phone_type_id and location_type_id when constructing both fields
<input id="phone-Home-2" /> <input id="phone_ext-Home-2">
3. Modify profile form postProcess to retrieve phone_type_id from phone_ext field and use that to associate extension with the correct phone record.
4. Since admin's will likely not want to FORCE folks to enter an extension even when Phone is required, we should bypass required property on phone_ext field form validation. (This isn't perfect since we're not covering the rare case where the admin ALWAYS wants phone extension - but probably covers 80%+).
NOTE: phone_ext was not exposed to profiles in 4.2, so no upgrade is needed for this feature.
Attachments
Issue Links
- is duplicated by
-
CRM-11573 UFFields bound to phone_ext should clearly handle phone_type_id
- Done/Fixed