Street format parsing Dutch format

Development Status
Stable
Active Installs
Maintainers
Pobierz

Last updated: 2013-10-09

Works with CiviCRM 4.2. It might not be supported anymore.

Extension can be downloaded from https://github.com/CiviCooP/org.civicoop.streetformatnl.

CiviCRM native extension to change the street_address parsing to Dutch format (street_name, street_number, all others)

It only makes sense to enable this extension if the CiviCRM setting 'street address parsing' is checked. This setting can be found at Administer/Localization/Address Settings (or in Dutch"Beheren/Lokalisatie/Adresformaten) AND if the local language is set to Dutch (nl_NL) Also, the assumption is that either Netherlands or Belgium is set as the default country. The parsing in Dutch format will happen only for those contacts that are located in either Netherlands or Belgium.

Please note that the extension does not convert existing street_addresses in your database! It assumes you either install this extension in a clean install or update your existing street_addresses in your database using MySQL. At least, if you have switched on street_parsing with an empty CiviCRM database, you will have street_names, street_numbers etc. in your database. You can just add those together in the right sequence to update your existing street_addresses.

What does it do?

  1. It changes the sequence of the street address fields in the inline edit and edit forms from street_number, street_name and all other street fields after that to the Dutch format of street_name, street_number and all other street fields after that.
    Technical Modified template CRM/Contact/Form/Edit/Address/street_address.tpl. Also, nl_NL is added as a possible language in CRM/Core/BAO/Address.php. And the hook hook_civicrm_buildForm is used to split and glue street_address before displaying
  2. It changed the way street_address is stored in the dabase to reflect the Dutch format of street_name, street_number and all other street fields after that.
    Technical Implementation of hook_civicrm_pre
  3. There is a scheduled job called 'Parse NL and BE addresses' that will select all Dutch or Belgian addresses in the database where the street_name field is empty, and parse those. This will enable you to parse your addresses after an import action. The scheduled job is set to inactive when installed, you will have to make it active and then run it from the scheduled job list. You could leave it to run daily, but that should not be necessary. Advise is to set it back to inactive once it has run.

Future wishes

Here are a couple of things I would like to do to make this better and more generic. If you are interested in funding some of this, please contact us (helpdesk@civicoop.org, erik.hommel@civicoop.org)

Any more suggestions, drop us a line!

  • Introduce a local file holding settings for this extension. This would include what languages to apply this for (with Dutch as default) and which countries to test for (with Netherlands and Belgium as default)
  • Change CRM/Core/BAO/Address.php to add possible languages based on the local settings file
  • For the even longer term: investigate how CiviCRM is going to cope with the various address formats based on internationally recognised standards and working with standard open source tools

Feel free to use and change! It has been created for 2 specific customer cases but should work in other situations.

Screenshot (click to enlarge)