From 41d98e86f4f71ca26043213486dc289df1853dab Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 7 Jul 2025 13:26:13 +0000 Subject: [PATCH] Bug 40319: Fix spacing in address display include This patch makes some spacing changes to the address display include in order to prevent address parts (e.g. city, state, zip, etc) from missing spaces in between. To test, apply the patch and locate or edit a patron record to include data in all main address fields. - Check out to the patron and check the display of the address in the sidebar. Confirm that the spacing is correct. - Test with all variations of the AddressFormat system preference. - Test with and without the use of road types (Administration -> Authorized values -> ROADTYPE) and street numbers. Sponsored-by: Athens County Public Libraries Signed-off-by: Martin Renvoize --- .../includes/member-display-address-style.inc | 50 ++++++++++++++----- 1 file changed, 37 insertions(+), 13 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style.inc index 7f29640ceb7..3e0bb172e01 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style.inc @@ -29,10 +29,18 @@ [%~ END ~%] [%~ IF ( patron.city || patron.zipcode || patron.state || patron.country ) ~%]
  • - [%~ 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 ~%] + [%~ patron.city |html ~%] + [%~ IF ( patron.state ) %] + [%~ IF ( patron.city ) ~%] + , + [% END ~%] + [% patron.state |html ~%] + [%~ END ~%] + [%~ IF ( patron.zipcode ) %][%~ " " _ patron.zipcode |html ~%][% END %] + [%~ IF ( patron.country ) %] + [% line_break | $raw %] + [% patron.country |html ~%] + [%~ END ~%]
  • [%~ END ~%] [%~ END ~%] @@ -44,11 +52,15 @@ [%~ IF patron.streettype ~%] [%~ SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', patron.streettype) ~%] [%~ END ~%] -
  • [%~ patron.address | html ~%][%~ IF roadtype_desc %][% roadtype_desc | html ~%][%~ END ~%][%~ IF patron.streetnumber %] +
  • + [%~ patron.address | html ~%] + [%~ IF roadtype_desc %] + [% roadtype_desc | html ~%] + [%~ END ~%] + [%~ IF patron.streetnumber %] [% patron.streetnumber | html ~%] - [%~ END ~%]
  • + [%~ END ~%] + [%~ END ~%] [%~ IF ( patron.address2 ) ~%]
  • [%~ patron.address2 | html ~%]
  • @@ -56,7 +68,11 @@ [%~ END ~%] [%~ IF ( patron.city || patron.zipcode || patron.state || patron.country ) ~%]
  • - [%~ IF ( patron.zipcode ) ~%][%~ patron.zipcode | html %][% END ~%][%~ patron.city | html ~%][%~ IF ( patron.state ) ~%] + [%~ 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 ~%] @@ -71,9 +87,13 @@ [%~ IF patron.streettype ~%] [%~ SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', patron.streettype) ~%] [%~ END ~%] -
  • [%~ IF patron.streetnumber ~%][%~ patron.streetnumber | html %][% END ~%] - [%~ IF roadtype_desc ~%][%~ roadtype_desc | html %][% END ~%] +
  • + [%~ IF patron.streetnumber ~%] + [%~ patron.streetnumber | html %] + [% END ~%] + [%~ IF roadtype_desc ~%] + [%~ roadtype_desc | html %] + [% END ~%] [%~ patron.address | html ~%]
  • [%~ END ~%] @@ -83,7 +103,11 @@ [%~ END ~%] [%~ IF ( patron.city || patron.zipcode || patron.state || patron.country ) ~%]
  • - [%~ IF ( patron.zipcode ) ~%][%~ patron.zipcode | html %][% END ~%][%~ patron.city | html ~%][%~ IF ( patron.state ) ~%] + [%~ 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 ~%] -- 2.50.0