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

Extending Address records with custom fields

    Details

    • Type: New Feature
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.1.NYSS
    • Labels:
      None

      Description

      Summary
      =======
      Administrators can define one or more groups of custom fields which extend Address records. For this implementation, addresses are extended 'globally' (i.e. not restricted by contact type or location type). However, we may need to add filtering at a later stage, so keep this in mind during implementation.

      Implementation Details
      ==================
      1. Custom Data Group

      • Add 'Addresses' to the 'Used For' ('extends[0]') select field.
      • When extends = Addresses, Display Style is suppressed. Custom fields will always be injected 'inline' in address blocks (input form and display blocks).

      2. Custom Data Fields

      • Searchable property is available for Address custom fields

      3. Contact Add / Edit
      Address custom data group fields are injected within each address block (in the Addresses pane). Make sure the new 'Accordions' style is used (rather than the old fieldset style) for the injected custom group - as documented here: http://wiki.civicrm.org/confluence/display/CRMDOC/Accordions. The accordion wrapper div is set with class= .crm-accordion-closed or class= .crm-accordion-open depending on the 'Collapse on initial display' setting for the custom data group.

      4. Contact Summary
      Address custom data fields are injected in their own accordion (new style) div, below the corresponding table for the associated address (i.e. below 'Home Address' or 'Work Address'). The accordion wrapper div is set with class= .crm-accordion-closed or class= .crm-accordion-open depending on the 'Collapse on initial display' setting for the custom data group. The custom data group table has a row for each custom field.

      Example - custom field group with 2 fields and Collapse on initial display = TRUE:

      <table>
      <tbody><tr>
      <td class="label">Work Address</td>
      <td>
      <div class="location vcard"><span class="adr"><span class="street-address">100 Main Street</span><br>
      <span class="extended-address">Suite 33</span><br>
      <span class="locality">San Francisco</span>, <span class="region">CA</span> <span class="postal-code">94101</span><br>
      <span class="country-name">United States</span></span></div></td>
      </tr>
      </table>

      <!-- Custom fields here -->
      <div class="crm-accordion-wrapper crm-{$custom_group_title}-accordion crm-accordion-closed">
      <div class="crm-accordion-header">
      <div class="icon crm-accordion-pointer"></div>
      Custom Group Title
      </div>
      <div class="crm-accordion-body">
      <table>
      <tr><td class="label">District</td><td>20931</td></tr>
      <tr><td class="label">Registered Here?</td><td>No</td></tr></tbody>
      </table>
      </div>
      </div>

      5. Advanced Search
      5.1 Search Criteria (form)
      If any fields in an Address custom data group are searchable, inject a new-style accordion div for that custom data group in the 'Address Fields' pane of Advanced Search form (after the core address search fields)

      5.2 Search Query
      Non-blank custom field values need to be added to the query and show up the QILL.

      6. Profiles
      Address -> custom fields should be available to be added to 'Contact' type profiles.

        Attachments

          Activity

            People

            • Assignee:
              dgg David Greenberg
              Reporter:
              dgg David Greenberg
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 3 days, 6 hours Original Estimate - 3 days, 6 hours
                3d 6h
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 week, 7 hours
                1w 7h