From 6122e511eeb5603cbc67d032fb3cac95a761657c Mon Sep 17 00:00:00 2001 From: David Roberts Date: Fri, 22 May 2020 18:44:25 +0000 Subject: [PATCH] Bug 25463: Patron details page - display the alternative contact address as a block This patch changes the format of the alternative contact address to a block, instead of a list. To test: 1) Edit a patron's contact details so that the Main Address and Alternative Contact addresses are complete 2) Install the patch 3) Ensure that the AddressFormat system preference is set to US style 4) View the patron record (members/moremember.pl) and ensure that the address format in both the Contact information and Alternative address sections display identically. 5) Change the AddressFormat system preference to German style, and repeat 6) Change the AddressFormat system preference to French style, and repeat. Signed-off-by: David Nind --- .../member-display-altv-address-style-de.inc | 9 ++++ .../member-display-altv-address-style-fr.inc | 9 ++++ .../member-display-altv-address-style-us.inc | 11 ++++ .../prog/en/modules/members/moremember.tt | 62 ++++------------------ 4 files changed, 40 insertions(+), 51 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/member-display-altv-address-style-de.inc create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/member-display-altv-address-style-fr.inc create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/member-display-altv-address-style-us.inc diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-altv-address-style-de.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-altv-address-style-de.inc new file mode 100644 index 0000000000..cd278bc3fd --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-altv-address-style-de.inc @@ -0,0 +1,9 @@ +[% IF ( patron.altcontactaddress1 or patron.altcontactaddress2 ) %] +
  • [% patron.altcontactfirstname | html %] [% patron.altcontactsurname | html %][% end | html %]
  • +
  • [% if (patron.altcontactaddress1) | html %][% patron.altcontactaddress1 | html %][% end | html %]
  • +
  • [% if (patron.altcontactaddress2) | html %][% patron.altcontactaddress2 | html %][% end | html %]
  • +[% END %] +[% IF ( patron.altcontactzipcode ) %]
  • [% patron.altcontactzipcode | html %] [% IF ( patron.altcontactaddress3 ) %][% patron.altcontactaddress3 %][% END %]
  • +[% IF ( patron.altcontactstate ) %]
  • [% patron.altcontactstate | html %] [% END %]
  • +[% IF ( patron.altcontactcountry ) %]
  • [% patron.altcontactcountry | html %][% END %]
  • +[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-altv-address-style-fr.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-altv-address-style-fr.inc new file mode 100644 index 0000000000..cd278bc3fd --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-altv-address-style-fr.inc @@ -0,0 +1,9 @@ +[% IF ( patron.altcontactaddress1 or patron.altcontactaddress2 ) %] +
  • [% patron.altcontactfirstname | html %] [% patron.altcontactsurname | html %][% end | html %]
  • +
  • [% if (patron.altcontactaddress1) | html %][% patron.altcontactaddress1 | html %][% end | html %]
  • +
  • [% if (patron.altcontactaddress2) | html %][% patron.altcontactaddress2 | html %][% end | html %]
  • +[% END %] +[% IF ( patron.altcontactzipcode ) %]
  • [% patron.altcontactzipcode | html %] [% IF ( patron.altcontactaddress3 ) %][% patron.altcontactaddress3 %][% END %]
  • +[% IF ( patron.altcontactstate ) %]
  • [% patron.altcontactstate | html %] [% END %]
  • +[% IF ( patron.altcontactcountry ) %]
  • [% patron.altcontactcountry | html %][% END %]
  • +[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-altv-address-style-us.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-altv-address-style-us.inc new file mode 100644 index 0000000000..271a9bbdaa --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-altv-address-style-us.inc @@ -0,0 +1,11 @@ +[% IF ( patron.altcontactaddress1 or patron.altcontactaddress2 ) %] +
  • [% patron.altcontactfirstname | html %] [% patron.altcontactsurname | html %][% end | html %]
  • +
  • [% if (patron.altcontactaddress1) | html %][% patron.altcontactaddress1 | html %][% end | html %]
  • +
  • [% if (patron.altcontactaddress2) | html %][% patron.altcontactaddress2 | html %][% end | html %]
  • +[% END %] +
  • +[% IF ( patron.altcontactaddress3 ) %][% patron.altcontactaddress3 | html %], [% END %] +[% IF ( patron.altcontactstate ) %] [% patron.altcontactstate | html %],[% END %] +[% IF ( patron.altcontactzipcode ) %] [% patron.altcontactzipcode | html %],[% END %] +[% IF ( patron.altcontactcountry ) %] [% patron.altcontactcountry | html %][% END %] +
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index a03c1bd5e4..a13059883b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -634,65 +634,25 @@

    Alternative contact

    Edit +
    +
      + [% IF Koha.Preference( 'AddressFormat' ) %] + [% INCLUDE "member-display-altv-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %] + [% ELSE %] + [% INCLUDE 'member-display-altv-address-style-us.inc' %] + [% END %] +
    +
      - [% IF ( patron.altcontactsurname ) %] -
    1. - Surname: - [% patron.altcontactsurname | html %] -
    2. - [% END %] - [% IF ( patron.altcontactfirstname ) %] -
    3. - First name: - [% patron.altcontactfirstname | html %] -
    4. - [% END %] - [% IF ( patron.altcontactaddress1 ) %] -
    5. - Address: - [% patron.altcontactaddress1 | html %] -
    6. - [% END %] - [% IF ( patron.altcontactaddress2 ) %] -
    7. - Address 2: - [% patron.altcontactaddress2 | html %] -
    8. - [% END %] - [% IF ( patron.altcontactaddress3 ) %] -
    9. - City: - [% patron.altcontactaddress3 | html %] -
    10. - [% END %] - - [% IF ( patron.altcontactstate ) %] -
    11. - State: - [% patron.altcontactstate | html %] -
    12. - [% END %] - [% IF ( patron.altcontactzipcode ) %] -
    13. - ZIP/Postal code: - [% patron.altcontactzipcode | html %] -
    14. - [% END %] - [% IF ( patron.altcontactcountry ) %] -
    15. - Country: - [% patron.altcontactcountry | html %] -
    16. - [% END %] [% IF ( patron.altcontactphone ) %]
    17. Phone: - [% patron.altcontactphone | html %] + [% patron.altcontactphone |html %]
    18. [% END %]
    -
    [% # /div.rows %] + [% ELSE %]

    Alternative contact

    -- 2.11.0