From dcf53f1cc3adbb8baa0f4f83d65eb4ced6aaabd1 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 30 Mar 2021 16:21:06 +0000 Subject: [PATCH] Bug 10902: Highlight patrons from logged-in library in patron searches This patch alters a few different patron search interfaces so that patrons from the currently-logged-in library are highlighted in a way that differentiates them from other patrons. To test, apply the patch and rebuild the staff interface CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client). - In Administration -> System preferences, make sure the PatronAutoComplete preference is enabled. - In the "Check out" tab in the header, type a partial patron name which will return multiple results and wait for the autocomplete menu to appear.. - Patrons in the autocomplete results should show the branchcode, and patrons from the currently-logged-in library should be highlighted in green. - Submit your partial name in the "check out" tab. - In the search results the branch name of patrons from the currently-logged-in library should be similarly highlighted. - Go to patrons browse for patrons. These results should be highlighted as in the previous steps. Signed-off-by: David Nind Signed-off-by: Sally --- circ/ysearch.pl | 1 + .../intranet-tmpl/prog/css/src/staff-global.scss | 23 ++++++++++++++++++++ .../en/includes/circ-patron-search-results.inc | 8 ++++++- .../intranet-tmpl/prog/en/includes/js_includes.inc | 25 +++++++++++++++++++++- .../prog/en/modules/members/member.tt | 10 ++++++++- 5 files changed, 64 insertions(+), 3 deletions(-) diff --git a/circ/ysearch.pl b/circ/ysearch.pl index a52568640e..63389fd936 100755 --- a/circ/ysearch.pl +++ b/circ/ysearch.pl @@ -90,6 +90,7 @@ while ( my $b = $borrowers_rs->next ) { city => $b->city // '', zipcode => $b->zipcode // '', country => $b->country // '', + branchcode => $b->branchcode // '', }; } 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 ed2a495237..5179147aca 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -4383,6 +4383,29 @@ div .suggestion_note { } } +.ac-library { + background-color: #EEE; + border-radius: 4px; + color: #000; + display: inline-block; + font-size: 80%; + padding: 1px 4px; +} + +.ac-currentlibrary { + .ac-library { + background-color: #E6FCB7; + font-weight: bold; + + } +} + +.currentlibrary { + background-color: #E6FCB7; + display: inline-block; + padding: 2px 4px; +} + @media (min-width: 200px) { } diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-patron-search-results.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-patron-search-results.inc index 0c31cbf291..3523abccb5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-patron-search-results.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-patron-search-results.inc @@ -28,7 +28,13 @@ [% borrower.cardnumber | html %] [% INCLUDE 'patron-age.inc' patron = borrower %] [% Categories.GetName( borrower.categorycode ) | html %] - [% Branches.GetName( borrower.branchcode ) | html %] + + [% IF ( Branches.GetLoggedInBranchcode == borrower.branchcode ) %] + [% Branches.GetName( borrower.branchcode ) | html %] + [% ELSE %] + [% Branches.GetName( borrower.branchcode ) | html %] + [% END %] + [% borrower.address | html %] [% borrower.phone | html %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc index b832eec518..c96ba49118 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc @@ -1,6 +1,7 @@ [% USE raw %] [% USE Asset %] [% USE AudioAlerts %] +[% USE Branches %] [% USE To %] [% USE Koha %] [%# Prevent XFS attacks -%] @@ -69,6 +70,8 @@ [% IF ( PatronAutoComplete ) %]