Bugzilla – Attachment 173005 Details for
Bug 15728
Hide component parts from search result
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15728: Add component records facet to OPAC
Bug-15728-Add-component-records-facet-to-OPAC.patch (text/plain), 3.76 KB, created by
Lari Taskula
on 2024-10-19 13:35:24 UTC
(
hide
)
Description:
Bug 15728: Add component records facet to OPAC
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2024-10-19 13:35:24 UTC
Size:
3.76 KB
patch
obsolete
>From 2282fc748b29461b829573323e00c6cbe977ccb0 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@hypernova.fi> >Date: Fri, 18 Oct 2024 21:01:03 +0000 >Subject: [PATCH] Bug 15728: Add component records facet to OPAC > >Test plan provided in "Support component records limit" commits. >--- > .../bootstrap/en/includes/opac-facets.inc | 20 +++++++++++++++++++ > opac/opac-search.pl | 13 ++++++++++-- > 2 files changed, 31 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc >index b133c530f8..2fb9f9326d 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc >@@ -39,6 +39,26 @@ > [% IF ( related ) %] <li>(related searches: [% FOREACH relate IN related %][% relate.related_search | html %][% END %])</li>[% END %] > </li> > >+ [% IF Koha.Preference("ShowComponentRecordsFacet") == 'opac' || Koha.Preference("ShowComponentRecordsFacet") == 'both' %] >+ <li id="component_record_facet"><h3 id="facet-compontent-records">Component records</h3> >+ <ul> >+ <li> >+ [% IF ( limit_exclude_component_records ) || ( limit_component_records ) %] >+ <strong>[% IF ( limit_exclude_component_records ) %]Excluding[% ELSE %]Showing only[% END %] component records</strong> >+ </li> >+ <li> >+ <a href="/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% IF ( limit_exclude_component_records ) %][% limit_cgi_not_limit_exclude_component_records %][% END %][% IF ( limit_component_records ) %][% limit_cgi_not_limit_component_records %][% END %][% IF ( sort_by ) %]&sort_by=[% sort_by | uri %][% END %]">Show all records</a> >+ [% ELSE %] >+ <a href="/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %][% IF ( sort_by ) %]&sort_by=[% sort_by |uri %][% END %]&limit=exclude_component_records">Exclude component records</a> >+ </li> >+ <li> >+ <a href="/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %][% IF ( sort_by ) %]&sort_by=[% sort_by |uri %][% END %]&limit=component_records">Limit to component records</a> >+ [% END # /IF limit_exclude_component_records %] >+ </li> >+ </ul> >+ </li> <!-- /#component_record_facet --> >+ [% END # /IF ShowComponentRecordsFacet %] >+ > [% FOREACH facets_loo IN facets_loop %] > [% IF facets_loo.facets.size > 0 %] > <li id="[% facets_loo.type_id | html %]"> >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index a5d80ed585..a489848196 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -440,13 +440,22 @@ if (@searchCategories > 0) { > @limits = map { uri_unescape($_) } @limits; > > >-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 > if ($params->{'limit-yr'}) { >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15728
:
173001
|
173002
|
173003
|
173004
|
173005
|
173007
|
173008