From d94014411dfd50a52676f9a1401f981ed7192b52 Mon Sep 17 00:00:00 2001 From: David Cook Date: Fri, 9 Dec 2022 03:28:12 +0000 Subject: [PATCH] Bug 32434: Show "Lists" line on lists results This patch adds a "Lists:" line on the lists results so that the output matches the search result output. This allows users to know which records belong to which lists. Test plan: 0. Apply patch and koha-plack --restart kohadev 1. Go to http://localhost:8080/cgi-bin/koha/opac-search.pl?idx=&q=test 2. Add all 3 results to a new list called "Test" 3. Note that "Lists:" appears in the search results 4. Click on "Test" in the "Lists:" line 5. Note that it takes you to the list "Test" and that "Lists:" still appears in the results --- .../bootstrap/en/modules/opac-shelves.tt | 15 +++++++++++++++ opac/opac-shelves.pl | 7 +++++++ 2 files changed, 22 insertions(+) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt index e35134ed28..8c90f1ba1d 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt @@ -481,6 +481,21 @@ [% itemsloo.XSLTBloc | $raw %] + + [% IF itemsloo.shelves.count %] +
+ Lists: + +
+ [% END %] + [% IF ( TagsShowEnabled && itemsloo.TagLoop.size ) %]
Tags: diff --git a/opac/opac-shelves.pl b/opac/opac-shelves.pl index 78ce49da0e..cb01c02806 100755 --- a/opac/opac-shelves.pl +++ b/opac/opac-shelves.pl @@ -386,6 +386,13 @@ if ( $op eq 'view' ) { $this_item->{biblio_object} = $biblio; $this_item->{biblionumber} = $biblionumber; + $this_item->{shelves} = + Koha::Virtualshelves->get_shelves_containing_record( + { + biblionumber => $biblionumber, + borrowernumber => $loggedinuser, + } + ); push @items_info, $this_item; } -- 2.25.1