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

User Sharing (Drupal Profile replacement)


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


      The User Sharing feature will provide a fully admin configurable means of exposing any core and custom CiviCRM contact fields to 'users' (initially Drupal users). Our intention is to provide analogous functionality to the existing Drupal Profile module - so that contact data will not need to be stored in two places.

      In addition, this feature will allow site admins to determine which CiviCRM contact field(s) should be used to match user records to contact records. Default behavior is to match on primary email. However, the admin will be able to mark any other field(s) as the match criteria. For example, a site may include first name, last name and postal code as shared fields exposed to user account editing and user signup and may also mark these 3 fields as the combined key for matching. So, when a new user registers, we would look for an existing contact with matches on those three values. If found, we create a link from the new user record to the existing contact. Otherwise, we create a new contact record.

      Tasks are:
      1. Implement schema
      2. Implement shareableFields mechanism (xml element + function)
      3. User Sharing Admin Page and Forms
      4. Drupal implementation for user registration, user view/edit, user listings
      5. Integrate matching criteria with existing user-to-contact synchronization code
      6. Add sample user sharing config data to GenerateContactData script

      1. Two new tables have been defined in the schema

      • crm_uf_form
      • crm_uf_form_field

      2. Create xml-based mechanism to define the list of 'shareable fields' (similar to importable fields implementation).

      3. User Sharing - Admin Pages and Forms

        • Issue ** are we supporting > 1 form. If so, each form would be displayed as a local task in Drupal user account screens (as done by Profile)

      3.1 Browse User Sharing Forms (admin tab = 'User Sharing')
      Columns = Title, Type, Status, [actions]
      Actions = List/Edit Fields, Disable, Delete

      3.2 Add/Edit User Sharing Form

      • Form Title

      3.3 Browse User Sharing Fields (for the selected form)
      Columns = Field Name, View Only, Required, Registration, Visibility, Match, Status, [actions ]
      Actions = View, Edit, Disable, Delete

      3.4 Add/Edit User Sharing Field

      • Field Name (core or custom data field to be shared) - this will be a <select> field with
        options loaded by a shareableFields() function
      • View Only? (if true, data is displayed to user and user admin, but not editable in user forms)
      • Required? (is this field required or optional when presented on a user form)
      • For Registration Form? (if no, only presented in user/edit forms)
      • Visibility (options are 'none', 'user page', 'user page and user listings')
      • Match (if true, this field is included in the match key for user-to-contact synchronization)
      • Enabled? (if false, this user-sharing field is hidden for all user forms and pages)


      4. Drupal Implementations
      4.1 Expose form(s) as local tasks under My Account and Admin/User w/ their editable/viewable fields and values
      4.2 Expose shareable form title + field labels and values in User View screens
      4.3 Expose 'for registration' fields on new user reg form
      4.4 Create user listings page template and php code to populate this

      5. Update existing user-to-contact synchronization code to over-ride the existing default match key of primary email with a key composed of the uf_form_field enties marked 'Match=true'.

      NOTE: For the initial implementation, we will perform an exact (but case-insensitive) match. However, we may need to add some "fuzziness" rules at some point - similar to what Bob Schmidt spec'd for contact dedupe configuration.


      6. Add crm_ufform and field data to GenerateContactData. For our sample data, use First and Last Name, Postal Code, Country and the School Attended custom data field




            • Assignee:
              lobo Donald A. Lobo
              dgg David Greenberg
            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: