Bugzilla – Attachment 163898 Details for
Bug 35138
Enable configuration of facets with Elasticsearch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35138: Mark DisplayLibraryFacets as zebra only
Bug-35138-Mark-DisplayLibraryFacets-as-zebra-only.patch (text/plain), 3.59 KB, created by
Clemens Tubach
on 2024-03-26 10:51:07 UTC
(
hide
)
Description:
Bug 35138: Mark DisplayLibraryFacets as zebra only
Filename:
MIME Type:
Creator:
Clemens Tubach
Created:
2024-03-26 10:51:07 UTC
Size:
3.59 KB
patch
obsolete
>From 574d309d49b5166aa0c55702c220803d12816bd5 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 22 Mar 2024 09:53:47 +0100 >Subject: [PATCH] Bug 35138: Mark DisplayLibraryFacets as zebra only > >We can know add/remove homelibrary and holdinglibray from the config >page, this syspref is no longer needed for ES > >Sponsored-by: The Research University in the Helmholtz Association (KIT) >Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu> >--- > .../Elasticsearch/QueryBuilder.pm | 10 ---------- > .../data/mysql/atomicupdate/bug_35138.pl | 19 +++++++++++++++++-- > .../modules/admin/preferences/searching.pref | 1 + > 3 files changed, 18 insertions(+), 12 deletions(-) > >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index e91f02f91d..c8642a4259 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -232,16 +232,6 @@ sub build_query { > $res->{aggregations}->{$name} = { terms => { field => "${name}__facet" , size => $size } }; > }; > >- # FIXME We need a way to show/hide the facet individually >- #my $display_library_facets = C4::Context->preference('DisplayLibraryFacets'); >- #if ( $display_library_facets eq 'both' >- # or $display_library_facets eq 'home' ) { >- # $res->{aggregations}{homebranch} = { terms => { field => "homebranch__facet", size => $size } }; >- #} >- #if ( $display_library_facets eq 'both' >- # or $display_library_facets eq 'holding' ) { >- # $res->{aggregations}{holdingbranch} = { terms => { field => "holdingbranch__facet", size => $size } }; >- #} > return $res; > } > >diff --git a/installer/data/mysql/atomicupdate/bug_35138.pl b/installer/data/mysql/atomicupdate/bug_35138.pl >index 14b48246fa..224a9b0aca 100755 >--- a/installer/data/mysql/atomicupdate/bug_35138.pl >+++ b/installer/data/mysql/atomicupdate/bug_35138.pl >@@ -27,7 +27,22 @@ return { > } > > $sth->execute( 'Collections', 'ccode', 'collection-code'); >- $sth->execute( 'Holding libraries', 'holdingbranch', 'holdinglibrary'); >- $sth->execute( 'Home libraries', 'homebranch', 'homelibrary'); >+ >+ # Deal with DisplayLibraryFacets >+ my ($DisplayLibraryFacets) = $dbh->selectrow_array(q{ >+ SELECT value FROM systempreferences WHERE variable='DisplayLibraryFacets' >+ }); >+ my ($homebranch, $holdingbranch); >+ if ( $DisplayLibraryFacets eq 'both' ) { >+ $homebranch = 1; >+ $holdingbranch = 1; >+ } elsif ( $DisplayLibraryFacets eq 'holding' ) { >+ $holdingbranch = 1; >+ } elsif ( $DisplayLibraryFacets eq 'home' ) { >+ $homebranch = 1; >+ } >+ $sth->execute( 'Holding libraries', 'holdingbranch', 'holdinglibrary') if $holdingbranch; >+ $sth->execute( 'Home libraries', 'homebranch', 'homelibrary') if $homebranch; >+ > }, > }; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref >index 86b9f54ae1..d8888e7296 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref >@@ -278,6 +278,7 @@ Searching: > home: "home library" > holding: "holding library" > both: "both home and holding library" >+ - (Zebra only). > - > - Truncate facets length to > - pref: FacetLabelTruncationLength >-- >2.30.2
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 35138
:
163133
|
163680
|
163681
|
163682
|
163683
|
163684
|
163896
|
163897
|
163898
|
163899
|
163900
|
164811
|
164812
|
164813
|
164814
|
164815
|
164816
|
165811
|
165812
|
165813
|
165814
|
165815
|
165816
|
165817
|
165818
|
166402