From c2bcc0288d698d1b84d360a498a223d9a2425f45 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 6 Apr 2020 14:20:34 +0200 Subject: [PATCH] Bug 25070: Centralize member-display-address-style Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart (cherry picked from commit c32d71978c47cc810d5de8c20df89866b2ce417b) Signed-off-by: Lucas Gass --- .../prog/en/includes/circ-menu.inc | 7 +- .../member-display-address-style-de.inc | 16 ---- .../member-display-address-style-fr.inc | 19 ----- .../member-display-address-style-us.inc | 16 ---- .../includes/member-display-address-style.inc | 74 +++++++++++++++++++ .../prog/en/modules/circ/returns.tt | 7 +- .../en/modules/members/moremember-brief.tt | 7 +- .../en/modules/members/moremember-print.tt | 7 +- .../prog/en/modules/members/moremember.tt | 7 +- 9 files changed, 84 insertions(+), 76 deletions(-) delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style-de.inc delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style-fr.inc delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style-us.inc create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style.inc diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc index d665e81104..5e020f15f3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc @@ -1,5 +1,6 @@ [% USE Koha %] [% USE KohaDates %] +[% PROCESS 'member-display-address-style.inc' %] [% IF ( patron.borrowernumber ) %]
[% INCLUDE 'patron-title.inc' %]
@@ -29,11 +30,7 @@
    [% IF !(Koha.Preference('HidePersonalPatronDetailOnCirculation')) %] - [% IF Koha.Preference( 'AddressFormat' ) %] - [% INCLUDE "member-display-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %] - [% ELSE %] - [% INCLUDE 'member-display-address-style-us.inc' %] - [% END %] + [% PROCESS 'display-address-style' %] [% IF ( patron.phone || patron.mobile || patron.phonepro ) %]
  • [% IF ( patron.phone ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style-de.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style-de.inc deleted file mode 100644 index 78e0388e40..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style-de.inc +++ /dev/null @@ -1,16 +0,0 @@ -[% IF ( patron.address or patron.address2 ) %] - [% IF ( patron.address ) %] - [% SET roadtype_desc = '' %] - [% 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.streetnumber | html %][% END %]
  • - [% END %] - [% IF ( patron.address2 ) %] -
  • [% patron.address2 | html %]
  • - [% END %] -[% END %] -[% IF ( patron.city ) %]
  • - [%IF ( patron.zipcode ) %][% patron.zipcode | html %] [% END %][% patron.city | html %][% IF ( patron.state ) %]
    [% patron.state | html %][% END %] - [% IF ( patron.country ) %]
    [% patron.country | html %][% END %]
  • -[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style-fr.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style-fr.inc deleted file mode 100644 index cd8cb48922..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style-fr.inc +++ /dev/null @@ -1,19 +0,0 @@ -[% IF ( patron.address or patron.address2 ) %] - [% IF ( patron.address ) %] - [% SET roadtype_desc = '' %] - [% 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 %] - [% patron.address | html %] -
  • - [% END %] - [% IF ( patron.address2 ) %] -
  • [% patron.address2 | html %]
  • - [% END %] -[% END %] -[% IF ( patron.city ) %] -
  • [%IF ( patron.zipcode ) %][% patron.zipcode | html %] [% END %][% patron.city | html %][% IF ( patron.state ) %]
    [% patron.state | html %][% END %] - [% IF ( patron.country ) %]
    [% patron.country | html %][% END %]
  • -[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style-us.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style-us.inc deleted file mode 100644 index 7b00bddca8..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style-us.inc +++ /dev/null @@ -1,16 +0,0 @@ -[% IF ( patron.address or patron.address2 ) %] - [% IF ( patron.address ) %] - [% SET roadtype_desc = '' %] - [% IF patron.streettype %] - [% SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', patron.streettype) %] - [% END %] -
  • [% if (patron.streetnumber) | html %][% patron.streetnumber |html %][% end | html %] [% patron.address | html %] [% IF roadtype_desc %][% roadtype_desc |html %] [% END %][% end | html %]
  • - [% END %] - [% IF ( patron.address2 ) %] -
  • [% patron.address2 |html %]
  • - [% END %] -[% END %] -[% IF ( patron.city ) %]
  • - [% patron.city |html %][% IF ( patron.state ) %], [% patron.state |html %][% END %] - [% patron.zipcode |html %][% IF ( patron.country ) %], [% patron.country |html %][% END %]
  • -[% END %] 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 new file mode 100644 index 0000000000..64edea9bc3 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style.inc @@ -0,0 +1,74 @@ +[% USE Koha %] +[% BLOCK 'display-address-style' %] + [% 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 %] +
  • [% if (patron.streetnumber) | html %][% patron.streetnumber |html %][% end | html %] [% patron.address | html %] [% IF roadtype_desc %][% roadtype_desc |html %] [% END %][% end | html %]
  • + [% END %] + [% IF ( patron.address2 ) %] +
  • [% patron.address2 |html %]
  • + [% END %] + [% END %] + [% IF ( patron.city ) %] +
  • + [% patron.city |html %][% IF ( patron.state ) %], [% patron.state |html %][% END %] + [% patron.zipcode |html %][% IF ( patron.country ) %], [% patron.country |html %][% END %] +
  • + [% 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 %] +
  • [% patron.address | html %][%IF roadtype_desc %] [% roadtype_desc | html %][% END %][% IF patron.streetnumber %] [% patron.streetnumber | html %][% END %]
  • + [% END %] + [% IF ( patron.address2 ) %] +
  • [% patron.address2 | html %]
  • + [% END %] + [% END %] + [% IF ( patron.city ) %] +
  • + [% IF ( patron.zipcode ) %][% patron.zipcode | html %] [% END %][% patron.city | html %][% IF ( patron.state ) %]
    [% patron.state | html %][% END %] + [% IF ( patron.country ) %]
    [% patron.country | html %][% END %] +
  • + [% 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 %] +
  • [% IF patron.streetnumber %][% patron.streetnumber | html %] [% END %] + [%IF roadtype_desc %][% roadtype_desc | html %] [% END %] + [% patron.address | html %] +
  • + [% END %] + [% IF ( patron.address2 ) %] +
  • [% patron.address2 | html %]
  • + [% END %] + [% END %] + [% IF ( patron.city ) %] +
  • + [% IF ( patron.zipcode ) %][% patron.zipcode | html %] [% END %][% patron.city | html %][% IF ( patron.state ) %]
    [% patron.state | html %][% END %] + [% IF ( patron.country ) %]
    [% patron.country | html %][% END %] +
  • + [% END %] +[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt index 43515dac30..26c0fbbf83 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -6,6 +6,7 @@ [% USE ItemTypes %] [% USE AuthorisedValues %] [% USE ColumnsSettings %] +[% PROCESS 'member-display-address-style.inc' %] [% SET footerjs = 1 %] [% BLOCK display_bormessagepref %] [% IF ( bormessagepref ) %] @@ -23,11 +24,7 @@ [% END %] [% BLOCK display_holdpatron_address %] - [% IF Koha.Preference( 'AddressFormat' ) %] - [% INCLUDE "member-display-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %] - [% ELSE %] - [% INCLUDE 'member-display-address-style-us.inc' %] - [% END %] + [% PROCESS 'display-address-style' %] [% END %] [% INCLUDE 'doc-head-open.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt index c2745dfa7a..2b4391b59c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt @@ -1,6 +1,7 @@ [% USE raw %] [% USE Koha %] [% USE KohaDates %] +[% PROCESS 'member-display-address-style.inc' %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Check duplicate patron @@ -21,11 +22,7 @@ [% IF ( patron.othernames ) %]“[% patron.othernames | html %]”[% END %]
      - [% IF Koha.Preference( 'AddressFormat' ) %] - [% INCLUDE "member-display-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %] - [% ELSE %] - [% INCLUDE 'member-display-address-style-us.inc' %] - [% END %] + [% PROCESS 'display-address-style' %]
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt index 8bfc483c34..9e92f4e681 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt @@ -3,6 +3,7 @@ [% USE KohaDates %] [% USE Price %] [% USE ItemTypes %] +[% PROCESS 'member-display-address-style.inc' %] [% SET footerjs = 1 %] [% PROCESS 'accounts.inc' %] @@ -17,11 +18,7 @@

    Account summary: [% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])

      - [% IF Koha.Preference( 'AddressFormat' ) %] - [% INCLUDE "member-display-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %] - [% ELSE %] - [% INCLUDE 'member-display-address-style-us.inc' %] - [% END %] + [% PROCESS 'display-address-style' %]
    • [% IF ( patron.phone ) %][% patron.phone | html %][% ELSE %](no phone number on file)[% END %]
    • [% IF ( patron.email ) %][% patron.email | html %][% ELSE %](no primary email on file)[% END %]
    • [% IF ( patron.emailpro ) %] 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 8a9580026c..9ced9c3273 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -6,6 +6,7 @@ [% USE AuthorisedValues %] [% USE ColumnsSettings %] [% USE Price %] +[% PROCESS 'member-display-address-style.inc' %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] [% Asset.css("lib/jquery/plugins/rowGroup/stylesheets/rowGroup.dataTables.min.css") | $raw %] @@ -195,11 +196,7 @@
        - [% IF Koha.Preference( 'AddressFormat' ) %] - [% INCLUDE "member-display-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %] - [% ELSE %] - [% INCLUDE 'member-display-address-style-us.inc' %] - [% END %] + [% PROCESS 'display-address-style' %]
      -- 2.39.5