Let's add address handler for Estonia to AF/DC.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tormi’s picture

Status: Active » Needs review
FileSize
3.32 KB

Here's the patch. Noticed that includes/addressfield_form_it.inc was missing from addressfield.info, added that too.

tormi’s picture

#1 has some parsing errors, sry about that;)

tormi’s picture

Status: Needs review » Needs work

Need to add addressfield-formatter--EE.tpl.php as well.

Damien Tournoud’s picture

Status: Needs work » Closed (won't fix)

The -reloaded branch has been merged. It comes with reasonable defaults for most countries in the world, including Estonia.

According to the UPU it doesn't seem that it is customary to use the province name in Estonia's addresses. The default for Poland is thus not to have a state field. The design is extensible so this can be added if necessary.

tormi’s picture

Thanks for the work done in - reloaded branch, I really appreciate it! However, I think it would be good idea to provide some additional address templating possibilities in addition to address.inc so one can store it's customized address format without hacking address.inc.

For example, if I'd like to complement Estonian postal address with counties list specified in UPU database, then where would be the safe place to store that code?

  // Address format for Estonia with counties.
  if ($address['country'] == 'EE') {
    unset($format['street_block']['premise']);
    $format['street_block']['thoroughfare'] = array(
      '#title' => t('Address'),
      '#size' => 30,
    ); 
    $format['locality_block']['administrative_area']['#options'] = array(
      ''   => t('--'),
      '37' =>	'Harjumaa',
      '39' =>	'Hiiumaa',
      '44' =>	'Ida-Virumaa',
      '49' =>	'Jõgevamaa',
      '51' =>	'Järvamaa',
      '57' =>	'Läänemaa',
      '59' =>	'Lääne-Virumaa',
      '65' =>	'Põlvamaa',
      '67' =>	'Pärnumaa',
      '70' =>	'Raplamaa',
      '74' =>	'Saaremaa',
      '78' =>	'Tartumaa',
      '82' =>	'Valgamaa',
      '84' =>	'Viljandimaa',
      '86' =>	'Võrumaa',
    );
    $format['locality_block']['administrative_area']['#title'] = t('County');
  }
UrmasZ’s picture

Status: Closed (won't fix) » Needs review

This default form is not ok.
Yes, for large places there is no need for counties, but for small places they are "must have". To add counties to address is common here. And field Address 2 is just confusing. There is no need for that. I really really dislike this default form.

This form should be something like that:
Name
Organization
Street, house - apartment nr.
City
Postal code, County
Country

And counties should be select list.

j0rd’s picture

Issue tags: +pluggable regions

This is a duplicate of
#1829900: [meta] Address Field 2.x needs pluggable administrative areas and an actual API

If you think so to, please close your ticket.

rszrama’s picture

Component: Code » Address formats
kaido.toomingas’s picture

Issue summary: View changes

https://drupal.org/project/addressfield_estonia -- Showcase how to add/change handler.

bojanz’s picture

Title: Address handler for Estonia » Address formats for Estonia, Latvia, Lithuania
Status: Needs review » Fixed
FileSize
32.49 KB
50.38 KB

I've just done research on Estonia, Latvia, Lithuania, and committed the following changes:

  • Show the optional administrative_area field.
  • Add administrative area labels (EE and LT: County, LV: Municipality)
  • Make the postal code required.
  • Remove the label from the "Address 2" field.

I've also committed the administrative areas for Estonia: http://cgit.drupalcode.org/addressfield/commit/?id=303e984
Opened an issue discussing these changes in Google's dataset: https://github.com/googlei18n/libaddressinput/issues/64

Attaching a before and after picture.

kaido.toomingas’s picture

Woow Huge Like

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.