From 159be782f5cd3c05900bd55767de9fd4cfb82e64 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Fri, 3 Dec 2021 23:01:05 -1000 Subject: [PATCH] Bug 29621: Add link for Lists on opac-detail.pl When logged into the OPAC and viewing a results list of titles on opac-search.pl it is possible to see if a title is contained in a List. The link allows the user to click on it to get to the contents of the List. It would be helpful if the link for the List was also displayed on opac-detail.pl so the user could get to the results of the List from that page as well. This patch uses Koha::Virtualshelves->get_shelves_containing_record() in opac detail page like it is used in opac results page. Test plan : 1) Connect to OPAC as user U1 2) Create a public and a private list 3) Add a record B1 to both lists 4) Go to opac detail page of record B1 5) Without patch your see only link to public list, with patch you also see link to private list 6) Connect to OPAC as another user U2 7) Add record B1 to a private list 8) Go to opac detail page of record B1 9) With patch, check you see only link to your private list, not to list of user U1 --- opac/opac-detail.pl | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 3b47a19628..e74327e1ee 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -920,15 +920,12 @@ $template->param( # Lists if (C4::Context->preference("virtualshelves") ) { - my $shelves = Koha::Virtualshelves->search( - { - biblionumber => $biblionumber, - public => 1, - }, - { - join => 'virtualshelfcontents', - } - ); + my $shelves = Koha::Virtualshelves->get_shelves_containing_record( + { + biblionumber => $biblionumber, + borrowernumber => $borrowernumber + } + ); $template->param( shelves => $shelves ); } -- 2.34.0