From f49c18cf26e66b2cc653f51b993a37d3ea42c54f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 6 Apr 2020 14:25:48 +0200 Subject: [PATCH] Bug 25070: Centralize member-display-alt-address-style --- .../member-display-alt-address-style-de.inc | 16 ---- .../member-display-alt-address-style-fr.inc | 21 ----- .../member-display-alt-address-style-us.inc | 16 ---- .../member-display-alt-address-style.inc | 76 +++++++++++++++++++ .../prog/en/modules/members/moremember.tt | 7 +- 5 files changed, 78 insertions(+), 58 deletions(-) delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/member-display-alt-address-style-de.inc delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/member-display-alt-address-style-fr.inc delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/member-display-alt-address-style-us.inc create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/member-display-alt-address-style.inc diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-alt-address-style-de.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-alt-address-style-de.inc deleted file mode 100644 index f7fc9748c9..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-alt-address-style-de.inc +++ /dev/null @@ -1,16 +0,0 @@ -[% IF ( patron.B_address or patron.B_address2 ) %] - [% IF ( patron.B_address ) %] - [% SET roadtype_desc = '' %] - [% IF patron.B_streettype %] - [% SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', patron.B_streettype) %] - [% END %] -
  • [% patron.B_address | html %][%IF roadtype_desc %] [% roadtype_desc | html %][% END %][% IF patron.B_streetnumber %] [% patron.B_streetnumber | html %][% END %]
  • - [% END %] - [% IF ( patron.B_address2 ) %] -
  • [% patron.B_address2 | html %]
  • - [% END %] -[% END %] -[% IF ( patron.B_city ) %]
  • - [%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 %]
  • -[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-alt-address-style-fr.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-alt-address-style-fr.inc deleted file mode 100644 index 2080a48885..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-alt-address-style-fr.inc +++ /dev/null @@ -1,21 +0,0 @@ -[% IF ( patron.B_address or patron.B_address2 ) %] - [% IF ( patron.B_address ) %] - [% SET roadtype_desc = '' %] - [% IF patron.B_streettype %] - [% SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', patron.B_streettype) %] - [% END %] -
  • [% IF patron.B_streetnumber %][% patron.B_streetnumber | html %][% END %] - [%IF roadtype_desc %][% roadtype_desc | html %] [% END %] - [% patron.B_address | html %] -
  • - [% END %] - [% IF ( patron.B_address2 ) %] -
  • [% patron.B_address2 | html %]
  • - [% END %] -[% END %] -[% IF ( patron.B_city ) %] -
  • [%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 %]
  • -[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-alt-address-style-us.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-alt-address-style-us.inc deleted file mode 100644 index 9f8453f508..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-alt-address-style-us.inc +++ /dev/null @@ -1,16 +0,0 @@ -[% IF ( patron.B_address or patron.B_address2 ) %] - [% IF ( patron.B_address ) %] - [% SET roadtype_desc = '' %] - [% IF patron.B_streettype %] - [% SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', patron.B_streettype) %] - [% END %] -
  • [% if (patron.B_streetnumber) | html %][% patron.B_streetnumber | html %][% end | html %] [% patron.B_address | html %] [% IF roadtype_desc %][% roadtype_desc | html %] [% END %][% end | html %]
  • - [% END %] - [% IF ( patron.B_address2 ) %] -
  • [% patron.B_address2 | html %]
  • - [% END %] -[% END %] -[% IF ( patron.B_city ) %]
  • - [% 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 %]
  • -[% 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 new file mode 100644 index 0000000000..3eeada0378 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-alt-address-style.inc @@ -0,0 +1,76 @@ +[% USE Koha %] +[% BLOCK 'display-alt-address-style' %] + [% IF Koha.Preference( 'AddressFormat' ) %] + [% PROCESS "member-alt-display-address-style-${ Koha.Preference( 'AddressFormat' ) }" %] + [% ELSE %] + [% PROCESS 'member-alt-display-address-style-us' %] + [% END %] +[% END %] + +[% BLOCK 'member-alt-display-address-style-us' %] + [% IF ( patron.B_address or patron.B_address2 ) %] + [% IF ( patron.B_address ) %] + [% SET roadtype_desc = '' %] + [% IF patron.B_streettype %] + [% SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', patron.B_streettype) %] + [% END %] +
  • [% if (patron.B_streetnumber) | html %][% patron.B_streetnumber | html %][% end | html %] [% patron.B_address | html %] [% IF roadtype_desc %][% roadtype_desc | html %] [% END %][% end | html %]
  • + [% END %] + [% IF ( patron.B_address2 ) %] +
  • [% patron.B_address2 | html %]
  • + [% END %] + [% END %] + [% IF ( patron.B_city ) %] +
  • + [% 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 %] +
  • + [% END %] +[% END %] + +[% BLOCK 'member-alt-display-address-style-de' %] + [% IF ( patron.B_address or patron.B_address2 ) %] + [% IF ( patron.B_address ) %] + [% SET roadtype_desc = '' %] + [% IF patron.B_streettype %] + [% SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', patron.B_streettype) %] + [% END %] +
  • [% patron.B_address | html %][%IF roadtype_desc %] [% roadtype_desc | html %][% END %][% IF patron.B_streetnumber %] [% patron.B_streetnumber | html %][% END %]
  • + [% END %] + [% IF ( patron.B_address2 ) %] +
  • [% patron.B_address2 | html %]
  • + [% END %] + [% END %] + [% IF ( patron.B_city ) %] +
  • + [%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 %] +
  • + [% END %] +[% END %] + +[% BLOCK 'member-alt-display-address-style-fr' %] + [% IF ( patron.B_address or patron.B_address2 ) %] + [% IF ( patron.B_address ) %] + [% SET roadtype_desc = '' %] + [% IF patron.B_streettype %] + [% SET roadtype_desc = AuthorisedValues.GetByCode('ROADTYPE', patron.B_streettype) %] + [% END %] +
  • [% IF patron.B_streetnumber %][% patron.B_streetnumber | html %][% END %] + [%IF roadtype_desc %][% roadtype_desc | html %] [% END %] + [% patron.B_address | html %] +
  • + [% END %] + [% IF ( patron.B_address2 ) %] +
  • [% patron.B_address2 | html %]
  • + [% END %] + [% END %] + [% IF ( patron.B_city ) %] +
  • + [%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 %] +
  • + [% END %] +[% 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 cc920a517b..2423635a00 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -7,6 +7,7 @@ [% USE ColumnsSettings %] [% USE Price %] [% PROCESS 'member-display-address-style.inc' %] +[% PROCESS 'member-display-alt-address-style.inc' %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] [% Asset.css("lib/jquery/plugins/rowGroup/stylesheets/rowGroup.dataTables.min.css") | $raw %] @@ -577,11 +578,7 @@
    -- 2.20.1