From c356ba9260a3e2f908c45eee75081567ee36a79a Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 6 Dec 2021 11:15:58 +0000 Subject: [PATCH] Bug 29621: (follow-up) Make all views consistent This follow-up makes various views more consistent: OPAC search results, OPAC details, staff search results, and staff details. The patch also adds an indication to the user which lists are private. To test, apply the patch and rebuild the OPAC and staff CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client). Repeat the previous test plan in the OPAC and staff client. Signed-off-by: Pierre Fagot --- catalogue/detail.pl | 9 +++------ catalogue/search.pl | 8 ++++++++ .../intranet-tmpl/prog/css/src/staff-global.scss | 5 +++++ .../prog/en/modules/catalogue/detail.tt | 1 + .../prog/en/modules/catalogue/results.tt | 11 +++++++++++ koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss | 5 +++++ .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 12 +++++++----- .../opac-tmpl/bootstrap/en/modules/opac-results.tt | 1 + 8 files changed, 41 insertions(+), 11 deletions(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 1146aa78d8..09eeb02f15 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -516,13 +516,10 @@ $template->param( # Lists if (C4::Context->preference("virtualshelves") ) { - my $shelves = Koha::Virtualshelves->search( + my $shelves = Koha::Virtualshelves->get_shelves_containing_record( { - biblionumber => $biblionumber, - public => 1, - }, - { - join => 'virtualshelfcontents', + biblionumber => $biblionumber, + borrowernumber => $borrowernumber } ); $template->param( 'shelves' => $shelves ); diff --git a/catalogue/search.pl b/catalogue/search.pl index 5da9c063f3..44dce636b5 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -596,6 +596,14 @@ for (my $i=0;$i<@servers;$i++) { if ( grep {$_ eq $line->{'biblionumber'}} @cart_list) { $line->{'incart'} = 1; } + + $line->{'shelves'} = Koha::Virtualshelves->get_shelves_containing_record( + { + biblionumber => $line->{'biblionumber'}, + borrowernumber => $borrowernumber + } + ); + } my( $page_numbers, $hits_to_paginate, $pages, $current_page_number, $previous_page_offset, $next_page_offset, $last_page_offset ) = Koha::SearchEngine::Search->pagination_bar( 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 fa3421dee1..ee491f2b82 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -639,6 +639,11 @@ ol { font-weight: bold; } +.privateshelf { + font-style: italic; + color: #666; +} + .problem { color: #990000; font-weight: bold; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 3b56260668..c674e6fd10 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -122,6 +122,7 @@ Lists that include this title: [% FOREACH s IN shelves %] [% s.shelfname | html %] + [% UNLESS ( s.public ) %] Private [% END %] [% IF ( loop.last ) %][% ELSE %]|[% END %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt index 59def93d62..131407ed95 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -498,6 +498,17 @@ [% SEARCH_RESULT.result_number | html %]. [% SEARCH_RESULT.XSLTResultsRecord | $raw %] + [% IF Koha.Preference('virtualshelves') AND SEARCH_RESULT.shelves.count %] +
+ Lists: + [% FOREACH shelf IN SEARCH_RESULT.shelves %] + [% shelf.shelfname | html %] + [% UNLESS ( shelf.public ) %]Private[% END %] + [%~ UNLESS loop.last %], [% ELSE %].[% END ~%] + [% END %] +
+ [% END %] +

[% IF ( SEARCH_RESULT.norequests ) %] No holds allowed diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss index 9dbfbae0cd..e904e32f27 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss +++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss @@ -59,6 +59,11 @@ } } +.privateshelf { + font-style: italic; + color: #666; +} + a { &:link, &:visited { diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index c226da6dd0..939813f23f 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -193,11 +193,13 @@ [% IF shelves.count %] - List(s) this item appears in: - [% FOREACH s IN shelves %] - [% s.shelfname | html %] - [% IF ( loop.last ) %][% ELSE %]|[% END %] - [% END %] + + Lists that include this title: + [% FOREACH s IN shelves %] + [% s.shelfname | html %] + [% UNLESS ( s.public ) %] Private [% END %] + [% IF ( loop.last ) %][% ELSE %]|[% END %] + [% END %] [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt index 28b4bdef6c..eefaeb7606 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt @@ -493,6 +493,7 @@ [% FOREACH shelf IN SEARCH_RESULT.shelves %]

  • [% shelf.shelfname | html %] + [% UNLESS ( shelf.public ) %] Private [% END %] [%~ UNLESS loop.last %], [% ELSE %].[% END ~%]
  • [% END %] -- 2.17.1