From 8befb42b50ebfd9b59adaaabd72aa122ded7adf9 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Tue, 24 Aug 2021 00:34:13 +0200 Subject: [PATCH] Bug 21794: Fix display of addresses on details tab in staff when city is empty MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit If the city field was not filled out on the main or alternate address, the content of state, country and zipcode wouldn't display on the Details tab in the patron account in staff. To test: - Enter main contact and alternate address without city - Verify that the address information isn't shown on the details tab after saving - Apply patch - Verify that the information is displayed now - Toggle AddressFormat and check display is correct for all settings - Switch back to US address format - Try several combinations of empty fields for city, zipcode, country and state. The punctuation and whitespace should always appear correctly. Examples: - Enter just country - Enter zipcode and country - ... Signed-off-by: Hayley Pelham Signed-off-by: Joonas Kylmälä Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall (cherry picked from commit 423a600ad1401ced777dc53e3fc9ceb78d073a91) Signed-off-by: Fridolin Somers --- .../prog/en/includes/member-display-address-style.inc | 10 +++++----- .../en/includes/member-display-alt-address-style.inc | 10 +++++----- 2 files changed, 10 insertions(+), 10 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 5011d33d92..a79532b5cd 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 @@ -23,10 +23,10 @@
  • [%~ patron.address2 |html ~%]
  • [%~ END ~%] [%~ END ~%] - [%~ IF ( patron.city ) ~%] + [%~ IF ( patron.city || patron.zipcode || patron.state || patron.country ) ~%]
  • - [%~ patron.city |html ~%][%~ IF ( patron.state ) %], [% patron.state |html ~%][%~ END ~%] - [%~ " " _ patron.zipcode |html ~%][%~ IF ( patron.country ) %], [% 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 ) %][%~ IF ( patron.zipcode || patron.state ) ~%], [% END ~%][% patron.country |html ~%][%~ END ~%]
  • [%~ END ~%] [%~ END ~%] @@ -44,7 +44,7 @@
  • [%~ patron.address2 | html ~%]
  • [%~ END ~%] [%~ END ~%] - [%~ IF ( patron.city ) ~%] + [%~ IF ( patron.city || patron.zipcode || patron.state || patron.country ) ~%]
  • [%~ 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 ~%] @@ -68,7 +68,7 @@
  • [%~ patron.address2 | html ~%]
  • [%~ END ~%] [%~ END ~%] - [%~ IF ( patron.city ) ~%] + [%~ IF ( patron.city || patron.zipcode || patron.state || patron.country ) ~%]
  • [%~ 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 ~%] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-alt-address-style.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-alt-address-style.inc index 3eeada0378..57b7d05222 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-alt-address-style.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-alt-address-style.inc @@ -20,10 +20,10 @@
  • [% patron.B_address2 | html %]
  • [% END %] [% END %] - [% IF ( patron.B_city ) %] + [% IF ( patron.B_city || patron.B_state || patron.B_country || patron.B_zipcode ) %]
  • - [% patron.B_city | html %][% IF ( patron.B_state ) %], [% patron.B_state | html %][% END %] - [% patron.B_zipcode | html %][% IF ( patron.B_country ) %], [% patron.B_country | html %][% END %] + [% patron.B_city | html %][% IF ( patron.B_state ) %][% IF ( patron.B_city ) %], [% END %][%~ patron.B_state | html ~%][%~ END ~%] + [% IF ( patron.B_zipcode ) %][%~ " " _ patron.B_zipcode |html ~%][% END %][% IF ( patron.B_country ) %][% IF ( patron.B_zipcode || patron.B_state ) %], [% END %][% patron.B_country | html %][% END %]
  • [% END %] [% END %] @@ -41,7 +41,7 @@
  • [% patron.B_address2 | html %]
  • [% END %] [% END %] - [% IF ( patron.B_city ) %] + [% IF ( patron.B_city || patron.B_state || patron.B_country || patron.B_zipcode ) %]
  • [%IF ( patron.B_zipcode ) %][% patron.B_zipcode | html %] [% END %][% patron.B_city | html %][% IF ( patron.B_state ) %]
    [% patron.B_state | html %][% END %] [% IF ( patron.B_country ) %]
    [% patron.B_country | html %][% END %] @@ -65,7 +65,7 @@
  • [% patron.B_address2 | html %]
  • [% END %] [% END %] - [% IF ( patron.B_city ) %] + [% IF ( patron.B_city || patron.B_state || patron.B_country || patron.B_zipcode ) %]
  • [%IF ( patron.B_zipcode ) %][% patron.B_zipcode | html %] [% END %] [% patron.B_city | html %] -- 2.39.5