From 979307224f4efb98d204296c94353199b4295760 Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Fri, 18 Oct 2024 20:32:10 +0000 Subject: [PATCH] Bug 15728: Add component records facet to staff client Test plan provided in "Support component records limit" commits. --- catalogue/search.pl | 13 ++++++++++-- .../intranet-tmpl/prog/en/includes/facets.inc | 21 +++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/catalogue/search.pl b/catalogue/search.pl index ba97a75f1c..86defa9722 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -400,13 +400,22 @@ if ($operands[0] && !$operands[1]) { $basic_search=1; } -my $available; +my ( $available, $component_records, $exclude_component_records ); foreach my $limit(@limits) { if ($limit =~/available/) { $available = 1; } + elsif ( $limit =~ /^component_records$/ ) { + $component_records = 1; + } elsif ( $limit =~ /^exclude_component_records$/ ) { + $exclude_component_records = 1; + } } -$template->param(available => $available); +$template->param( + available => $available, + limit_component_records => $component_records, + limit_exclude_component_records => $exclude_component_records, +); # append year limits if they exist my $limit_yr; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc index 2e54fcb523..2782faa167 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc @@ -47,6 +47,27 @@ [% END %] + [% IF Koha.Preference("ShowComponentRecordsFacet") == 'staff' || Koha.Preference("ShowComponentRecordsFacet") == 'both' %] +
  • + Component records + +
  • + [% END # /IF ShowComponentRecordsFacet %] + [% FOREACH facets_loo IN facets_loop %] [% IF facets_loo.facets.size > 0 %]
  • -- 2.34.1