###############################################################################
# addresses mode for aqdb
#

namespace eval ::aqdb {
  variable fieldpairs		;# index/name pairs for fields in database
  variable pickfields		;# fields shown in picker
  variable ui
  
  # records automatically have notes field and tags
  
  set pickfields {ln fn or ds}
  
  set fieldpairs {
    {fn {First name}}
    {ln {Last name}}
    {or {Org.}}
    {ds {Selector}}
    {ti {Title}}
    {em {Email}}
    {ph {Phone}}
    {mo {Mobile}}
    {pg {Pager}}
    {wo {Work}}
    {hm {Home}}
    {ur {URL}}
    {fx {Fax}}
    {1d {Desc. 1}}
    {1a {Address 1}}
    {1c {City 1}}
    {1s {State 1}}
    {1z {ZIP 1}}
    {1C {Country 1}}
    {2d {Desc. 2}}
    {2a {Address 2}}
    {2c {City 2}}
    {2s {State 2}}
    {2z {ZIP 2}}
    {2C {Country 2}}
    {al {Aliases}}
    {bd {Birthdate}}
    {C1 {Custom 1}}
    {C2 {Custom 2}}
    {C3 {Custom 3}}
    {C4 {Custom 4}}
    {no {Note}}
    {sh {Show}}
  }
  
  set ui {
    {{}
      {fn {First name}}
      {ln {Last name}}
      {or {Organization}}
      {ds {Selector}}
      {ti {Title}}
    }
    {{Contacts}
      {em {Email}}
      {ph {Phone}}
      {mo {Mobile}}
      {pg {Pager}}
      {wo {Work}}
      {hm {Home}}
      {ur {URL}}
      {fx {Fax}}
      {al {Aliases}}
    }
    {{Main address}
      {1d {Description 1}}
      {1a {Address 1}}
      {1c {City 1}}
      {1s {State 1}}
      {1z {ZIP 1}}
      {1C {Country 1}}
    }
    {{Other address}
      {2d {Description 2}}
      {2a {Address 2}}
      {2c {City 2}}
      {2s {State 2}}
      {2z {ZIP 2}}
      {2C {Country 2}}
    }
    {{Other}
      {bd {Birthdate}}
      {C1 {Custom 1}}
      {C2 {Custom 2}}
      {C3 {Custom 3}}
      {C4 {Custom 4}}
      {no {Note}}
      {sh {Show}}
    }
  }
}
