Details

    • Type: New Feature
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.3.5
    • Fix Version/s: 3.4.alpha
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      It has been a recurring complaint that counties haven't been fully supported by CiviCRM. This patch

      • adds a pseudo-constant function to return the counties for a state,
      • limits the county options on a form to those that are within the selected state,
      • withholds the county options if there is no state selected (operating on the assumption that county information is useless without knowing the state),
      • uses jQuery chain select to update the county options upon a new state selection,
      • shows the county options (preceded by the state abbreviations) of multiple states if multiple states are selected (a future project might be to allow for multiple county select in advanced search),
      • fixes a small bug that throws an error for contacts that have no county value, and
      • mimics the resolution to CRM-7597 by matching county names to the county that's in the appropriate state when you're importing.

      CRM-7601 is a separate issue, but it's obviously important to have county fields saved on profiles if you're going to have an effective county system. The patch assumes that the patches for CRM-7597 and CRM-7601 have been already applied.

      I'm also attaching a SQL file that populates all the counties of the United States except for the six that ship with CiviCRM already. I'm not sure what the best way of making these available would be, since I imagine at least a fair number of sites have populated their own county lists. I think a good method may be to include it for fresh installations and provide the SQL to load it for existing sites. I also have no idea how counties or sub-state/province unites work in other countries, so this list may have to grow. I'm happy to write a blog post on the topic if you'd like.

        Attachments

        1. counties.sql
          65 kB
          Andrew Hunt
        2. county.patch
          23 kB
          Andrew Hunt

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              andrewhunt Andrew Hunt
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: