Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-191

Import - Support Multiple Locations, Phone Numbers, etc. and Implement Additional Duplicate Record Handling Options


    • Type: New Feature
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: None
    • Fix Version/s: 1.1
    • Component/s: None
    • Labels:


      Allow users to import flat record data that contains fields for multiple locations (e.g. Home Address, Work Address, Home Phone, Cell Phone, etc.)

      1. Add is_default (tinyint) to crm_location_type table.
      1.1 Schema modification
      1.2 Fixed Data modification - set 'Work' as default (by default)
      1.3 CRM/Admin/LocationType - add support for this property in form, and page

      2. Extend/implement Contact API(s) to support insert/update of multiple locations, phones, emails....
      NOTE: We should continue to support the 'simple' Contact insert use case (1 address, 1 phone, 1 email) in some way (perhaps making the current crm_create_contact() a wrapper around a more granular set of APIs - and possibly renaming it to create_simple_contact).

      3. Import File Mapping - User Interface
      Option 1

      • Present the current initial list of items (properties) in the mapping drop-down (e.g. First Name, Last Name, Street Address, Phone....)
      • When a property is selected that is a child of Location, 'show' (i.e. unhide) an additional <select> field with the location_type list, next to the properties drop-down.

      EXAMPLE: If user selects 'Street Address', unhide location_type drop-down with default location_type selected (might be 'Work'). User can accept this or change to Home or any other value from crm_location_type.

      • If Phone property is selected - also 'show' a phone_type <select> BEFORE the location_type select. Default for this is null option label > '-phone type'.

      EXAMPLE: User selects 'Phone' from mapping <select>. They then can select 'Mobile' for phone_type and 'Work' for location.

      Option 2
      Similar to 1, but ask user up front (intervening wizard step) whether they need to map multiple locations (multiple addresses, phones, etc.) in this import. If they answer yes, we can ask them to pick the location_types they need and also pick one that we will mark as is_primary.

      Option 3
      Present a screen for mapping which is layed out like our current Add Contact screen. For each property in this screen (First Name, Last Name...) - provide a <select> with the column headers from the import file. If no column headers - <select> values would be the data values from the first row of import data.

      NOTE: David Geilhufe is mocking up an example of this approach so we can take a look and see if it seems more intuitive.

      4. Issues
      4.1 How should we set crm_location.is_primary?

      • In UI Option 1, we would need to 'assume' that the first referenced location_type was primary
      • In UI Options 2 and 3, this would be explicitly set

      4.2 How should we determine which phone, email, im is preferred for a location

      • In UI Option 1 and 2, could add ANOTHER conditional field to control this in the map row
      • In UI Option 3, explicitly set




            • Assignee:
              brian Brian McFee
              dgg David Greenberg
            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: