Bug 10760

Summary: Use Street Number and Street type in Alternate Address section
Product: Koha Reporter: Victor Pang <victorp>
Component: PatronsAssignee: Marc Véron <veron>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: f.demians, gmcharlt, kyle.m.hall, kyle, marjorie.barry-vila, veron, ztajoli
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=3765
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=4041
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16730
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16779
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on:    
Bug Blocks: 17559    
Attachments: Bug 10760: Alternate Address: Make street number and street type editable
Bug 10760: Alternate Address: Display street number and street type
Bug 10760: (followup) Move street type after address
[SIGNED-OFF] Bug 10760: Alternate Address: Make street number and street type editable
[SIGNED-OFF] Bug 10760: Alternate Address: Display street number and street type
[SIGNED-OFF] Bug 10760: (followup) Move street type after address
Bug 10760: Alternate Address: Make street number and street type editable
Bug 10760: Alternate Address: Display street number and street type
Bug 10760: (followup) Move street type after address

Description Victor Pang 2013-08-19 12:05:25 UTC
The Street Number field seems to be missing from the Alternate Address section. Peeking into the borrowers table in the Koha database, there is a B_streetnumber field defined but it is not exposed in the Koha GUI interface.
Comment 1 Katrin Fischer 2015-01-06 21:11:10 UTC
Still valid.
Comment 2 Marc Véron 2016-06-14 08:33:50 UTC Comment hidden (obsolete)
Comment 3 Marc Véron 2016-06-14 09:07:21 UTC Comment hidden (obsolete)
Comment 4 Mark Tompsett 2016-06-18 00:56:48 UTC
Comment on attachment 52352 [details] [review]
Bug 10760: Alternate Address: Display street number and street type

Review of attachment 52352 [details] [review]:
-----------------------------------------------------------------

::: koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
@@ +413,5 @@
>   <div id="patron-alternate-address" style="padding-top: 1em;">
>      <h3>Alternate address</h3>
> +
> +    [% IF Koha.Preference( 'AddressFormat' ) %]
> +        [% INCLUDE "member-display-alt-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]

What if the file doesn't exist?
Comment 5 Marc Véron 2016-06-18 04:44:09 UTC
(In reply to M. Tompsett from comment #4)
> Comment on attachment 52352 [details] [review] [review]
> Bug 10760: Alternate Address: Display street number and street type
> 
> Review of attachment 52352 [details] [review] [review]:
> -----------------------------------------------------------------
> 
> ::: koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
> @@ +413,5 @@
> >   <div id="patron-alternate-address" style="padding-top: 1em;">
> >      <h3>Alternate address</h3>
> > +
> > +    [% IF Koha.Preference( 'AddressFormat' ) %]
> > +        [% INCLUDE "member-display-alt-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
> 
> What if the file doesn't exist?

It works the same as with Bug 4041 - Address Format as a I18N/L10N system preference and Bug 16730 - Use member-display-address-style*-includes in moremember-brief.tt 

Syspref 'AddressFormat' can have 2 values: us and de
----snip---
        - pref: addressformat
          default: us
          choices:
              us: US style ([Street number], [Address] - [City], [Zip/Postal Code], [Country])
              de: German style ([Adress] [Street number] - [Zip/Postal Code] [City] - [Country]
----snip---
For each choice, a file exists:
member-display-alt-address-style-us.inc
member-display-alt-address-style-de.inc

Fallback is us if syspref 'AdressFormat' is not defined

If more formats are needed, you have to
- add an additional syspref value
- add inc files to folder koha-tmpl/intranet-tmpl/prog/en/includes as appropriate
Comment 6 Katrin Fischer 2016-06-19 09:54:47 UTC
Thx for the explanation Marc - looks ok to me.
Comment 7 Owen Leonard 2016-06-20 13:31:04 UTC
The format for US addresses should be:

[Street number] [Address] [Road type]

Correct: 25 Euclid Drive
Incorrect: 25 Drive Euclid
Comment 8 Marc Véron 2016-06-20 14:19:16 UTC Comment hidden (obsolete)
Comment 9 Marc Véron 2016-06-20 14:33:44 UTC
(In reply to Owen Leonard from comment #7)
> The format for US addresses should be:
> 
> [Street number] [Address] [Road type]
> 
> Correct: 25 Euclid Drive
> Incorrect: 25 Drive Euclid

Same issue with main address (introduced by Bug 4041), see Bug 16779
Comment 10 Owen Leonard 2016-06-20 14:52:04 UTC Comment hidden (obsolete)
Comment 11 Owen Leonard 2016-06-20 14:52:12 UTC Comment hidden (obsolete)
Comment 12 Owen Leonard 2016-06-20 14:52:19 UTC Comment hidden (obsolete)
Comment 13 Owen Leonard 2016-06-21 12:43:22 UTC
*** Bug 13996 has been marked as a duplicate of this bug. ***
Comment 14 Kyle M Hall (khall) 2016-06-24 16:08:46 UTC
Created attachment 52829 [details] [review]
Bug 10760: Alternate Address: Make street number and street type editable

Table 'borrowers' contain columns B_streetnumber and B_streettype.
This patch makes them editable for alternate address.

To test:
- Apply patch
- Edit a patron's details
- Verify that in edit mode for Alternate address, the fields 'street type' and 'street number' appear
  and follow the settings in sysprefs AddressFormat, BorrowerMandatoryField, BorrowerUnwantedField
- Verify that the values are saved correctly.

Note: A second patch will follow to manage the display of street number and street type
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 15 Kyle M Hall (khall) 2016-06-24 16:09:01 UTC
Created attachment 52830 [details] [review]
Bug 10760: Alternate Address: Display street number and street type

This patch displays alternate streetnumber and street type on patron's
detail page.

To test:
- Apply patch
- Verify that the alternate address information displays follwing the
  setting in syspref AddressFormat and contains street type and
  street number (as appropriate)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 16 Kyle M Hall (khall) 2016-06-24 16:09:04 UTC
Created attachment 52831 [details] [review]
Bug 10760: (followup) Move street type after address

As of comment #7

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 17 Kyle M Hall (khall) 2016-07-08 13:46:06 UTC
Pushed to master for 16.11, thanks Marc!
Comment 18 Frédéric Demians 2016-08-01 13:32:52 UTC
Pushed in 16.05. Will be in 16.05.02.