Koha/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style.inc
Joonas Kylmälä aba3611dc0 Bug 21794: (QA follow-up) Separate city and country with a comma
If only the city and country address information was provided they ended
up being glued together like this: CityCountry. (AddressFormat=US style)

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-09-09 10:59:38 +02:00

77 lines
4 KiB
PHP

[%~ USE Koha ~%]
[%~ USE raw ~%]
[%~ BLOCK 'display-address-style' ~%]
[%~ SET line_break = "<br/>" ~%]
[%~ IF no_line_break %][% SET line_break = " " %][% END ~%]
[%~ IF Koha.Preference( 'AddressFormat' ) ~%]
[%~ PROCESS "member-display-address-style-${ Koha.Preference( 'AddressFormat' ) }" ~%]
[%~ ELSE ~%]
[%~ PROCESS 'member-display-address-style-us' ~%]
[%~ END ~%]
[%~ END ~%]
[%~ BLOCK 'member-display-address-style-us' ~%]
[%~ IF ( patron.address or patron.address2 ) ~%]
[%~ IF ( patron.address ) ~%]
[%~ SET roadtype_desc = '' ~%]
[%~ IF patron.streettype ~%]
[%~ SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', patron.streettype) ~%]
[%~ END ~%]
<li class="patronaddress1">[%~ if (patron.streetnumber) | html ~%][%~ patron.streetnumber |html ~%][%~ end | html %] [% patron.address | html %] [% IF roadtype_desc ~%][%~ roadtype_desc |html %] [% END ~%][%~ end | html ~%]</li>
[%~ END ~%]
[%~ IF ( patron.address2 ) ~%]
<li class="patronaddress2">[%~ patron.address2 |html ~%]</li>
[%~ END ~%]
[%~ END ~%]
[%~ IF ( patron.city || patron.zipcode || patron.state || patron.country ) ~%]
<li class="patroncity">
[%~ patron.city |html ~%][%~ IF ( patron.state ) %][%~ IF ( patron.city ) ~%], [% END ~%][% patron.state |html ~%][%~ END ~%]
[%~ IF ( patron.zipcode ) %][%~ " " _ patron.zipcode |html ~%][% END %][%~ IF ( patron.country ) %][%~ IF ( patron.zipcode || patron.state || patron.city ) ~%], [% END ~%][% patron.country |html ~%][%~ END ~%]
</li>
[%~ END ~%]
[%~ END ~%]
[%~ BLOCK 'member-display-address-style-de' ~%]
[%~ IF ( patron.address or patron.address2 ) ~%]
[%~ IF ( patron.address ) ~%]
[%~ SET roadtype_desc = '' ~%]
[%~ IF patron.streettype ~%]
[%~ SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', patron.streettype) ~%]
[%~ END ~%]
<li class="patronaddress1">[%~ patron.address | html ~%][%~IF roadtype_desc %] [% roadtype_desc | html ~%][%~ END ~%][%~ IF patron.streetnumber %] [% patron.streetnumber | html ~%][%~ END ~%]</li>
[%~ END ~%]
[%~ IF ( patron.address2 ) ~%]
<li class="patronaddress2">[%~ patron.address2 | html ~%]</li>
[%~ END ~%]
[%~ END ~%]
[%~ IF ( patron.city || patron.zipcode || patron.state || patron.country ) ~%]
<li class="patroncity">
[%~ IF ( patron.zipcode ) ~%][%~ patron.zipcode | html %] [% END ~%][%~ patron.city | html ~%][%~ IF ( patron.state ) ~%][% line_break | $raw %][%~ patron.state | html ~%][%~ END ~%]
[%~ IF ( patron.country ) ~%][% line_break | $raw %][%~ patron.country | html ~%][%~ END ~%]
</li>
[%~ END ~%]
[%~ END ~%]
[%~ BLOCK 'member-display-address-style-fr' ~%]
[%~ IF ( patron.address or patron.address2 ) ~%]
[%~ IF ( patron.address ) ~%]
[%~ SET roadtype_desc = '' ~%]
[%~ IF patron.streettype ~%]
[%~ SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', patron.streettype) ~%]
[%~ END ~%]
<li class="patronaddress1">[%~ IF patron.streetnumber ~%][%~ patron.streetnumber | html %] [% END ~%]
[%~IF roadtype_desc ~%][%~ roadtype_desc | html %] [% END ~%]
[%~ patron.address | html ~%]
</li>
[%~ END ~%]
[%~ IF ( patron.address2 ) ~%]
<li class="patronaddress2">[%~ patron.address2 | html ~%]</li>
[%~ END ~%]
[%~ END ~%]
[%~ IF ( patron.city || patron.zipcode || patron.state || patron.country ) ~%]
<li class="patroncity">
[%~ IF ( patron.zipcode ) ~%][%~ patron.zipcode | html %] [% END ~%][%~ patron.city | html ~%][%~ IF ( patron.state ) ~%][% line_break | $raw %][%~ patron.state | html ~%][%~ END ~%]
[%~ IF ( patron.country ) ~%][% line_break | $raw %][%~ patron.country | html ~%][%~ END ~%]
</li>
[%~ END ~%]
[%~ END ~%]