Details
-
Type: New Feature
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: None
-
Fix Version/s: 1.2
-
Component/s: None
-
Labels:None
Description
Allow the user to save/reload import field mappings.
1. Mappings are stored in 2 new DB tables (already created). Please enter the Added + version (2.0) tags to the xml schema.
--------------
civicrm_import_mapping:
name (varchar)
description (varchar)
domain id (int, fkey:civicrm_domain)
civicrm_import_mapping_field
civicrm_import_mapping id (int, fkey:civicrm_import_mapping)
column (int)
name (varchar)
location_type_id (nullable fkey:civicrm_location_type.id)
phone_type (nullable varchar)
relationship_type_id (nullable fkey: civicirm_relationship_type.id
2. User Interface - Map Fields (step 2) of Import
---------
2.1 Add link above mapping table: >> Load Saved Field Mapping
- only show link if one or more import_mapping records for the domain
- when clicked, unhide the following form elements:
++ <select> listing available mappings. Option labels are import_mapping.name. If easy, implement same trick as we did with custom activity_type select widget - and display the import_mapping.description for the selected option in a read-only element.
++ button -> "Load Mapping" - when button clicked, reload this page with mappings set from DB
NOTE: It may be useful to put up a warning if number of mapped columns is different from number of columns in current import (upload file). We could also check for expected mapping mismatches - i.e. run our usual smart-guessing on field mapping to the data and column headers - and if the saved mapping 'disagrees' with our auto-match values on more than 1 item - put up a warning.
"WARNING: The data columns in this import file appear to be different from the saved mapping. Please verify that you have selected the correct saved mapping before continuing."
2.2 If no saved mapping has been loaded, add a single checkbox below the mapping table:
[ x ] Save this field mapping
++ if checked, display two additional text fields, Name and Description (Name is required)
2.3 If a saved mapping is currently loaded:
- Add saved mapping name to existing heading above map table:
Import Data -> CiviCRM Contact Fields Using Saved Mapping: $mappingName
- add 2 checkboxes:
[ x ] Update this field mapping
[ x ] Save as a new field mapping
++ if 2nd box is checked, display two additional fields as above (Name and Description)
Attachments
Issue Links
- duplicates
-
CRM-230 File import -- storeable field mappings
- Done/Fixed