Bugzilla – Attachment 102482 Details for
Bug 22087
Show city and state in patron search results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22087: Use include file to display patrons address in search result
Bug-22087-Use-include-file-to-display-patrons-addr.patch (text/plain), 11.29 KB, created by
Jonathan Druart
on 2020-04-07 08:53:02 UTC
(
hide
)
Description:
Bug 22087: Use include file to display patrons address in search result
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-04-07 08:53:02 UTC
Size:
11.29 KB
patch
obsolete
>From c74a81ae1489eb2bd52333aac77402735983fc7a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 6 Apr 2020 16:00:13 +0200 >Subject: [PATCH] Bug 22087: Use include file to display patrons address in > search result > >In order to display the city and country in the patron search result, we >need to use the member-display-address-style include file, to satisfy >AddressFormat. > >Test plan: >Modify some patrons and fill the different address info >Search for them and notice that the city, zipcode and country are now >displayed. >Modify the value of AddressFormat and confirm that the display is >modified according to its value >--- > .../prog/css/src/staff-global.scss | 14 ++ > .../includes/member-display-address-style.inc | 128 +++++++++--------- > .../modules/members/tables/members_results.tt | 10 +- > 3 files changed, 80 insertions(+), 72 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >index a9f1b247d7..05654c38ac 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >+++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >@@ -1999,6 +1999,20 @@ li { > } > } > >+#searchresults { >+ .address { >+ ul { >+ margin: 0; >+ padding-left: 0; >+ li { >+ clear: none; >+ float: left; >+ list-style: none; >+ } >+ } >+ } >+} >+ > #searchheader { > background-color: #E6F0F2; > border: 1px solid #B9D8D9; >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 64edea9bc3..eed70063c1 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 >@@ -1,74 +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 %] >+[%~ 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 ) %] >+[%~ 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 %] >+ [%~ patron.city |html ~%][%~ IF ( patron.state ) ~%], [%~ patron.state |html ~%][%~ END ~%] >+ [%~ patron.zipcode |html ~%][%~ IF ( patron.country ) ~%], [%~ patron.country |html ~%][%~ END ~%] > </li> >- [% END %] >-[% 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 %] >- <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 ) %] >+[%~ 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 %] >+ [%~ 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 %] >+ [%~ 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 %] >+[%~ 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 ) %] >+ [%~ 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 %] >+ [%~ 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 %] >+ [%~ END ~%] >+[%~ END ~%] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt >index 2c047fd8f5..1f22eeee4a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/tables/members_results.tt >@@ -3,6 +3,7 @@ > [% USE AuthorisedValues %] > [% USE KohaDates %] > [% USE Price %] >+[% PROCESS 'member-display-address-style.inc' %] > { > "sEcho": [% sEcho | html %], > "iTotalRecords": [% iTotalRecords | html %], >@@ -17,7 +18,7 @@ > "dt_cardnumber": > "[% data.cardnumber | html | $To %]", > "dt_name": >- "<a href=\"/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.borrowernumber | html %]\" class=\"patron_preview\" data-borrowernumber=\"[% data.borrowernumber | html %]\" style='white-space:nowrap'>[% INCLUDE 'patron-title.inc' borrowernumber = data.borrowernumber category_type = data.category_type firstname = data.firstname surname = data.surname othernames = data.othernames invert_name = 1 | $To %]</a><br />[% INCLUDE escape_address data = data %][% IF data.email %]<br/>Email: <a href='mailto:[% data.email | html | $To %]'>[% data.email | html | $To %]</a>[% END %]", >+ "<a href=\"/cgi-bin/koha/members/moremember.pl?borrowernumber=[% data.borrowernumber | html %]\" class=\"patron_preview\" data-borrowernumber=\"[% data.borrowernumber | html %]\" style='white-space:nowrap'>[% INCLUDE 'patron-title.inc' borrowernumber = data.borrowernumber category_type = data.category_type firstname = data.firstname surname = data.surname othernames = data.othernames invert_name = 1 | $To %]</a><br /><div class='address'><ul>[%~ PROCESS 'display-address-style' patron=data| $To ~%]</ul></div>[% IF data.email %]<br/>Email: <a href='mailto:[% data.email | html | $To %]'>[% data.email | html | $To %]</a>[% END %]", > "dt_dateofbirth": > "[% data.dateofbirth | $KohaDates %]", > "dt_category": >@@ -40,10 +41,3 @@ > [% END %] > ] > } >-[% BLOCK escape_address %] >-[%~ SET address = data.streetnumber _ ' ' %] >-[%~ IF data.streettype %][% SET address = address _ AuthorisedValues.GetByCode( 'ROADTYPE', data.streettype ) _ ' ' %][% END %] >-[%~ IF data.address %][% SET address = address _ data.address _ ' ' %][% END %] >-[%~ IF data.address2 %][% SET address = address _ data.address2 _ ' ' %][% END %] >-[%~ address | html | $To ~%] >-[% END %] >-- >2.20.1
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 22087
:
102043
|
102064
|
102448
|
102449
|
102450
|
102451
|
102466
|
102482
|
102483
|
102484
|
102485
|
102486
|
102492
|
102505
|
102506
|
102507
|
107420
|
107421
|
107422
|
107423
|
107424
|
107425
|
107427
|
107428
|
107543
|
107544
|
107545
|
107546
|
107547
|
107548
|
107549