From 5414175fcc947e6f0f9b917ee0e3f125df591516 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 | 15 +++++++++++++ .../prog/en/includes/auth-finder-search.inc | 22 +++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/authorities/auth_finder.pl b/authorities/auth_finder.pl index 1603fbbc31f..9abf51419c7 100755 --- a/authorities/auth_finder.pl +++ b/authorities/auth_finder.pl @@ -67,6 +67,19 @@ 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', '|' ); + my @value_established = ( 'a' ); + foreach ( @value_established ) { + push @marclist, 'Kind-of-record'; + push @and_or, 'or'; + push @excluding, ''; + push @operator, 'contains'; + push @value, $_; + } + } my $builder = Koha::SearchEngine::QueryBuilder->new( { index => $Koha::SearchEngine::AUTHORITIES_INDEX } ); @@ -76,6 +89,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 ) = @@ -176,6 +190,7 @@ if ( $op eq "do_search" ) { operator_main => ( @operator > 1 && $operator[1] ) ? $operator[1] : '', operator_match => ( @operator > 2 && $operator[2] ) ? $operator[2] : '', operator_any => ( @operator > 3 && $operator[3] ) ? $operator[3] : '', + est_headings => $est_headings, ); } else { 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 fe94cf0f8b0..e30d6d982ea 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 @@ -117,6 +117,28 @@
+
  • + + +