- my $library_facet;
- unless ( C4::Context->preference("singleBranchMode") || GetBranchesCount() == 1 ) {
- $library_facet = {
- idx => 'branch',
- label => 'Libraries',
- tags => [ qw/ 995b / ],
- };
- } else {
- $library_facet = {
- idx => 'location',
- label => 'Location',
- tags => [ qw/ 995c / ],
- };
+ unless ( C4::Context->preference("singleBranchMode")
+ || GetBranchesCount() == 1 )
+ {
+ my $DisplayLibraryFacets = C4::Context->preference('DisplayLibraryFacets');
+ if ( $DisplayLibraryFacets eq 'both'
+ || $DisplayLibraryFacets eq 'holding' )
+ {
+ push(
+ @$facets,
+ {
+ idx => 'holdingbranch',
+ label => 'HoldingLibrary',
+ tags => [qw / 995b /],
+ }
+ );
+ }
+
+ if ( $DisplayLibraryFacets eq 'both'
+ || $DisplayLibraryFacets eq 'home' )
+ {
+ push(
+ @$facets,
+ {
+ idx => 'homebranch',
+ label => 'HomeLibrary',
+ tags => [qw / 995a /],
+ }
+ );
+ }