Bugzilla – Attachment 104661 Details for
Bug 25070
Include files to display address and contact must be refactored
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25070: Centralize member-display-address-style
Bug-25070-Centralize-member-display-address-style.patch (text/plain), 14.38 KB, created by
David Nind
on 2020-05-11 09:25:43 UTC
(
hide
)
Description:
Bug 25070: Centralize member-display-address-style
Filename:
MIME Type:
Creator:
David Nind
Created:
2020-05-11 09:25:43 UTC
Size:
14.38 KB
patch
obsolete
>From 71d985d0615705c1cd29ccf74c5e22261e98ed2a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 6 Apr 2020 14:20:34 +0200 >Subject: [PATCH] Bug 25070: Centralize member-display-address-style > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../intranet-tmpl/prog/en/includes/circ-menu.inc | 7 +- > .../includes/member-display-address-style-de.inc | 16 ----- > .../includes/member-display-address-style-fr.inc | 19 ------ > .../includes/member-display-address-style-us.inc | 16 ----- > .../en/includes/member-display-address-style.inc | 74 ++++++++++++++++++++++ > .../intranet-tmpl/prog/en/modules/circ/returns.tt | 7 +- > .../prog/en/modules/members/moremember-brief.tt | 7 +- > .../prog/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 ) %] > <div class="patroninfo"><h5>[% INCLUDE 'patron-title.inc' %]</h5> > >@@ -29,11 +30,7 @@ > > <ul class="patronbriefinfo"> > [% 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 ) %]<li class="patronphone"> > [% 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 %] >- <li class="patronaddress1">[% patron.address | html %][%IF roadtype_desc %] [% roadtype_desc | html %][% END %][% IF patron.streetnumber %] [% patron.streetnumber | html %][% END %]</li> >- [% END %] >- [% IF ( patron.address2 ) %] >- <li class="patronaddress2">[% patron.address2 | html %]</li> >- [% END %] >-[% END %] >-[% IF ( patron.city ) %]<li class="patroncity"> >- [%IF ( patron.zipcode ) %][% patron.zipcode | html %] [% END %][% patron.city | html %][% IF ( patron.state ) %]</br>[% patron.state | html %][% END %] >- [% IF ( patron.country ) %]<br />[% patron.country | html %][% END %]</li> >-[% 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 %] >- <li class="patronaddress1">[% IF patron.streetnumber %][% patron.streetnumber | html %] [% END %] >- [%IF roadtype_desc %][% roadtype_desc | html %] [% END %] >- [% patron.address | html %] >- </li> >- [% END %] >- [% IF ( patron.address2 ) %] >- <li class="patronaddress2">[% patron.address2 | html %]</li> >- [% END %] >-[% END %] >-[% IF ( patron.city ) %] >- <li class="patroncity">[%IF ( patron.zipcode ) %][% patron.zipcode | html %] [% END %][% patron.city | html %][% IF ( patron.state ) %]</br>[% patron.state | html %][% END %] >- [% IF ( patron.country ) %]<br />[% patron.country | html %][% END %]</li> >-[% 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 %] >- <li class="patronaddress1">[% if (patron.streetnumber) | html %][% patron.streetnumber |html %][% end | html %] [% patron.address | html %] [% IF roadtype_desc %][% roadtype_desc |html %] [% END %][% end | html %]</li> >- [% END %] >- [% IF ( patron.address2 ) %] >- <li class="patronaddress2">[% patron.address2 |html %]</li> >- [% END %] >-[% END %] >-[% IF ( patron.city ) %]<li class="patroncity"> >- [% patron.city |html %][% IF ( patron.state ) %], [% patron.state |html %][% END %] >- [% patron.zipcode |html %][% IF ( patron.country ) %], [% patron.country |html %][% END %]</li> >-[% 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 %] >+ <li class="patronaddress1">[% if (patron.streetnumber) | html %][% patron.streetnumber |html %][% end | html %] [% patron.address | html %] [% IF roadtype_desc %][% roadtype_desc |html %] [% END %][% end | html %]</li> >+ [% END %] >+ [% IF ( patron.address2 ) %] >+ <li class="patronaddress2">[% patron.address2 |html %]</li> >+ [% END %] >+ [% END %] >+ [% IF ( patron.city ) %] >+ <li class="patroncity"> >+ [% patron.city |html %][% IF ( patron.state ) %], [% patron.state |html %][% END %] >+ [% patron.zipcode |html %][% IF ( patron.country ) %], [% patron.country |html %][% END %] >+ </li> >+ [% 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 %] >+ <li class="patronaddress1">[% patron.address | html %][%IF roadtype_desc %] [% roadtype_desc | html %][% END %][% IF patron.streetnumber %] [% patron.streetnumber | html %][% END %]</li> >+ [% END %] >+ [% IF ( patron.address2 ) %] >+ <li class="patronaddress2">[% patron.address2 | html %]</li> >+ [% END %] >+ [% END %] >+ [% IF ( patron.city ) %] >+ <li class="patroncity"> >+ [% IF ( patron.zipcode ) %][% patron.zipcode | html %] [% END %][% patron.city | html %][% IF ( patron.state ) %]</br>[% patron.state | html %][% END %] >+ [% IF ( patron.country ) %]<br />[% patron.country | html %][% END %] >+ </li> >+ [% 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 %] >+ <li class="patronaddress1">[% IF patron.streetnumber %][% patron.streetnumber | html %] [% END %] >+ [%IF roadtype_desc %][% roadtype_desc | html %] [% END %] >+ [% patron.address | html %] >+ </li> >+ [% END %] >+ [% IF ( patron.address2 ) %] >+ <li class="patronaddress2">[% patron.address2 | html %]</li> >+ [% END %] >+ [% END %] >+ [% IF ( patron.city ) %] >+ <li class="patroncity"> >+ [% IF ( patron.zipcode ) %][% patron.zipcode | html %] [% END %][% patron.city | html %][% IF ( patron.state ) %]</br>[% patron.state | html %][% END %] >+ [% IF ( patron.country ) %]<br />[% patron.country | html %][% END %] >+ </li> >+ [% 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 bcde1e90cb..b51a590698 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' %] > <title>Koha › Check duplicate patron</title> >@@ -21,11 +22,7 @@ > [% IF ( patron.othernames ) %]“[% patron.othernames | html %]”[% END %] > <div class = "address"> > <ul> >- [% 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' %] > </ul> > </div> > <div class="rows"> >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 @@ > <h3><a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% patron.cardnumber | uri %]">Account summary: [% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</a></h3> > > <ul> >- [% 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' %] > <li>[% IF ( patron.phone ) %][% patron.phone | html %][% ELSE %](no phone number on file)[% END %]</li> > <li>[% IF ( patron.email ) %][% patron.email | html %][% ELSE %](no primary email on file)[% END %]</li> > [% 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 fe2e7afdbc..014c0f4b8a 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 %] >@@ -184,11 +185,7 @@ > > <div class="address"> > <ul> >- [% 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' %] > </ul> > </div> > >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 25070
:
102439
|
102440
|
102441
|
102442
|
102443
|
102477
|
102478
|
102479
|
102480
|
102481
|
102487
|
102488
|
102489
|
102490
|
102491
|
104562
|
104563
|
104564
|
104565
|
104566
|
104581
|
104582
|
104583
|
104584
|
104585
|
104659
|
104660
|
104661
|
104662
|
104663
|
105745
|
105746
|
105747
|
105748
|
105749
|
105750