From f20f0e4fc3f3e6f04d3d1720d16ed0a857160ee4 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 19 Nov 2019 17:35:09 +0100 Subject: [PATCH] Bug 23591: Hide archived suggestions However we are adding a note on top of the table to tell how many suggestions are archived. It seems that there is no good reason to display the archived suggestions on this table. --- catalogue/detail.pl | 4 +++- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 72dfa4750d..c07efd6656 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -251,12 +251,14 @@ if ( C4::Context->preference('suggestion') ) { my $suggestions = Koha::Suggestions->search( { biblionumber => $biblionumber, + archived => 0, }, { order_by => { -desc => 'suggesteddate' } } ); - $template->param( suggestions => $suggestions ); + my $nb_archived_suggestions = Koha::Suggestions->search({ biblionumber => $biblionumber, archived => 1 })->count; + $template->param( suggestions => $suggestions, nb_archived_suggestions => $nb_archived_suggestions ); } if ( defined $dat->{'itemtype'} ) { 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 c6b5b43f8f..d4f426bb88 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -6,6 +6,7 @@ [% USE Branches %] [% USE Biblio %] [% USE ColumnsSettings %] +[% PROCESS 'i18n.inc' %] [% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %] [% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %] @@ -700,6 +701,9 @@ Note that permanent location is a code, and location may be an authval. [% IF suggestions.count %]
+ [% IF nb_archived_suggestions > 0 %] +

[% tnpx('pluralization', 'There is one archived suggestion.', 'There are {count} archived suggestions.', nb_archived_suggestions, { count = nb_archived_suggestions }) | $raw %] + [% END %] @@ -724,7 +728,6 @@ Note that permanent location is a code, and location may be an authval. [% IF ( suggestion.copyrightdate ) %]© [% suggestion.copyrightdate | html %] [% END %] [% IF ( suggestion.volumedesc ) %]; Volume:[% suggestion.volumedesc | html %] [% END %] [% IF ( suggestion.isbn ) %]; ISBN:[% suggestion.isbn | html %] [% END %][% IF ( suggestion.publishercode ) %]; Published by [% suggestion.publishercode | html %] [% END %][% IF ( suggestion.publicationyear ) %] in [% suggestion.publicationyear | html %] [% END %][% IF ( suggestion.place ) %] in [% suggestion.place | html %] [% END %][% IF ( suggestion.collectiontitle ) %]; [% suggestion.collectiontitle | html %] [% END %][% IF ( suggestion.itemtype ) %]; [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', suggestion.itemtype, 0 ) | html %] [% END %]
[% IF ( suggestion.note ) %]
[% suggestion.note | html %]
[% END %] - [% IF suggestion.archived %]
Archived[% END %]
[% INCLUDE 'patron-title.inc' patron => suggestion.suggester %] -- 2.20.1