From b314e6a60c2d6665ce8811ec186fd1661429d764 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Mon, 22 Apr 2024 05:03:34 +0000 Subject: [PATCH] Bug 36616: [WIP] Add option to authority cataloguing plugin to show established headings only --- authorities/auth_finder.pl | 22 +++++++++++++++++++ .../prog/en/includes/auth-finder-search.inc | 12 ++++++++++ 2 files changed, 34 insertions(+) diff --git a/authorities/auth_finder.pl b/authorities/auth_finder.pl index 1603fbbc31f..458f3bbee10 100755 --- a/authorities/auth_finder.pl +++ b/authorities/auth_finder.pl @@ -67,6 +67,27 @@ if ( $op eq "do_search" ) { my $orderby = $query->param('orderby') || ''; my $startfrom = $query->param('startfrom') || 0; my $resultsperpage = $query->param('resultsperpage') || 20; + my $est_headings = $query->param('est_headings') || undef; + + if ( $est_headings ) { + my @value_established = ( 'a', 'f', '|' ); + foreach ( @value_established ) { + push @marclist, 'Kind-of-record'; + push @and_or, 'or'; + push @excluding, ''; + push @operator, 'contains'; + push @value, $_; + } + } + + use Data::Dumper; + warn Dumper(\@marclist); + warn Dumper(\@and_or); + warn Dumper(\@excluding); + warn Dumper(\@operator); + warn Dumper(\@value); + warn Dumper($authtypecode); + warn Dumper($orderby); my $builder = Koha::SearchEngine::QueryBuilder->new( { index => $Koha::SearchEngine::AUTHORITIES_INDEX } ); @@ -76,6 +97,7 @@ if ( $op eq "do_search" ) { \@marclist, \@and_or, \@excluding, \@operator, \@value, $authtypecode, $orderby ); + $template->param( search_query => $search_query ) if C4::Context->preference('DumpSearchQueryTemplate'); my $offset = $startfrom * $resultsperpage; my ( $results, $total ) = diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc index 5b5a8828e89..40a862a6ff9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc @@ -116,6 +116,18 @@
+
  • + + +