View | Details | Raw Unified | Return to bug 11334
Collapse All | Expand All

(-)a/C4/Koha.pm (-16 / +58 lines)
Lines 716-730 sub getFacets { Link Here
716
            }
716
            }
717
            ];
717
            ];
718
718
719
            my $library_facet;
719
            unless ( C4::Context->preference("singleBranchMode")
720
            unless ( C4::Context->preference("singleBranchMode") || GetBranchesCount() == 1 ) {
720
                || GetBranchesCount() == 1 )
721
                $library_facet = {
721
            {
722
                    idx  => 'branch',
722
                my $DisplayLibraryFacets = C4::Context->preference('DisplayLibraryFacets');
723
                    label => 'Libraries',
723
                if (   $DisplayLibraryFacets eq 'both'
724
                    tags        => [ qw/ 995b / ],
724
                    || $DisplayLibraryFacets eq 'holding' )
725
                };
725
                {
726
                    push(
727
                        @$facets,
728
                        {
729
                            idx   => 'holdingbranch',
730
                            label => 'HoldingLibrary',
731
                            tags  => [qw / 995b /],
732
                        }
733
                    );
734
                }
735
736
                if (   $DisplayLibraryFacets eq 'both'
737
                    || $DisplayLibraryFacets eq 'home' )
738
                {
739
                push(
740
                    @$facets,
741
                    {
742
                        idx   => 'homebranch',
743
                        label => 'HomeLibrary',
744
                        tags  => [qw / 995a /],
745
                    }
746
                );
747
                }
726
            }
748
            }
727
            push( @$facets, $library_facet );
728
    }
749
    }
729
    else {
750
    else {
730
        $facets = [
751
        $facets = [
Lines 777-791 sub getFacets { Link Here
777
            },
798
            },
778
            ];
799
            ];
779
800
780
            my $library_facet;
801
            unless ( C4::Context->preference("singleBranchMode")
781
            unless ( C4::Context->preference("singleBranchMode") || GetBranchesCount() == 1 ) {
802
                || GetBranchesCount() == 1 )
782
                $library_facet = {
803
            {
783
                    idx  => 'branch',
804
                my $DisplayLibraryFacets = C4::Context->preference('DisplayLibraryFacets');
784
                    label => 'Libraries',
805
                if (   $DisplayLibraryFacets eq 'both'
785
                    tags        => [ qw / 952b / ],
806
                    || $DisplayLibraryFacets eq 'holding' )
786
                };
807
                {
808
                    push(
809
                        @$facets,
810
                        {
811
                            idx   => 'holdingbranch',
812
                            label => 'HoldingLibrary',
813
                            tags  => [qw / 952b /],
814
                        }
815
                    );
816
                }
817
818
                if (   $DisplayLibraryFacets eq 'both'
819
                    || $DisplayLibraryFacets eq 'home' )
820
                {
821
                push(
822
                    @$facets,
823
                    {
824
                        idx   => 'homebranch',
825
                        label => 'HomeLibrary',
826
                        tags  => [qw / 952a /],
827
                    }
828
                );
829
                }
787
            }
830
            }
788
            push( @$facets, $library_facet );
789
    }
831
    }
790
    return $facets;
832
    return $facets;
791
}
833
}
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 97-102 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
97
('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'),
97
('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'),
98
('displayFacetCount','0',NULL,NULL,'YesNo'),
98
('displayFacetCount','0',NULL,NULL,'YesNo'),
99
('DisplayIconsXSLT','1','','If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages.','YesNo'),
99
('DisplayIconsXSLT','1','','If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages.','YesNo'),
100
('DisplayLibraryFacets',  'holdingbranch',  'home|holding|both',  'Defines which library facets to display.',  'Choice'),
100
('DisplayMultiPlaceHold','1','','Display the ability to place multiple holds or not','YesNo'),
101
('DisplayMultiPlaceHold','1','','Display the ability to place multiple holds or not','YesNo'),
101
('DisplayOPACiconsXSLT','1','','If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages in the OPAC.','YesNo'),
102
('DisplayOPACiconsXSLT','1','','If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages in the OPAC.','YesNo'),
102
('dontmerge','1',NULL,'If ON, modifying an authority record will not update all associated bibliographic records immediately, ask your system administrator to enable the merge_authorities.pl cron job','YesNo'),
103
('dontmerge','1',NULL,'If ON, modifying an authority record will not update all associated bibliographic records immediately, ask your system administrator to enable the merge_authorities.pl cron job','YesNo'),
(-)a/installer/data/mysql/updatedatabase.pl (+18 lines)
Lines 7912-7917 if ( CheckVersion($DBversion) ) { Link Here
7912
    SetVersion($DBversion);
7912
    SetVersion($DBversion);
7913
}
7913
}
7914
7914
7915
$DBversion = '3.15.00.XXX';
7916
if ( CheckVersion($DBversion) ) {
7917
    $dbh->do(q{
7918
        INSERT INTO  systempreferences (
7919
            variable,
7920
            value,
7921
            options,
7922
            explanation,
7923
            type
7924
            )
7925
        VALUES (
7926
            'DisplayLibraryFacets',  'holdingbranch',  'home|holding|both',  'Defines which library facets to display.',  'Choice'
7927
        );
7928
    });
7929
    print "Upgrade to $DBversion done (Bug 11334 - Add facet for home library)\n";
7930
    SetVersion ($DBversion);
7931
}
7932
7915
=head1 FUNCTIONS
7933
=head1 FUNCTIONS
7916
7934
7917
=head2 TableExists($table)
7935
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc (-1 / +2 lines)
Lines 17-23 Link Here
17
[% IF ( facets_loo.type_label_Places ) %]<span id="facet-places">Places</span>[% END %]
17
[% IF ( facets_loo.type_label_Places ) %]<span id="facet-places">Places</span>[% END %]
18
[% IF ( facets_loo.type_label_Series ) %]<span id="facet-series">Series</span>[% END %]
18
[% IF ( facets_loo.type_label_Series ) %]<span id="facet-series">Series</span>[% END %]
19
[% IF ( facets_loo.type_label_ItemTypes ) %]<span id="facet-itemtypes">Item types</span>[% END %]
19
[% IF ( facets_loo.type_label_ItemTypes ) %]<span id="facet-itemtypes">Item types</span>[% END %]
20
[% IF ( facets_loo.type_label_Libraries ) %]Libraries[% END %]
20
[% IF ( facets_loo.type_label_HomeLibrary ) %]Home libraries[% END %]
21
[% IF ( facets_loo.type_label_HoldingLibrary ) %]Holding libraries[% END %]
21
[% IF ( facets_loo.type_label_Location ) %]Locations[% END %]
22
[% IF ( facets_loo.type_label_Location ) %]Locations[% END %]
22
<ul>
23
<ul>
23
        [% FOREACH facet IN facets_loo.facets %]<li><a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %]&amp;limit=[% facet.type_link_value %]:[% facet.facet_link_value %]" title="[% facet.facet_title_value %]">[% facet.facet_label_value %]</a> [% IF ( displayFacetCount ) %]([% facet.facet_count %])[% END %]</li>[% END %][% IF ( facets_loo.expandable ) %]
24
        [% FOREACH facet IN facets_loo.facets %]<li><a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %]&amp;limit=[% facet.type_link_value %]:[% facet.facet_link_value %]" title="[% facet.facet_title_value %]">[% facet.facet_label_value %]</a> [% IF ( displayFacetCount ) %]([% facet.facet_count %])[% END %]</li>[% END %][% IF ( facets_loo.expandable ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref (+8 lines)
Lines 172-177 Searching: Link Here
172
              class: integer
172
              class: integer
173
            - results per page in the OPAC.
173
            - results per page in the OPAC.
174
        -
174
        -
175
            - "Show facets for"
176
            - pref: DisplayLibraryFacets
177
              type: choice
178
              choices:
179
                  home: "home library"
180
                  holding: "holding library"
181
                  both: "both home and holding library"
182
        -
175
            - pref: OPACItemsResultsDisplay
183
            - pref: OPACItemsResultsDisplay
176
              type: boolean
184
              type: boolean
177
              choices:
185
              choices:
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc (-1 / +2 lines)
Lines 25-31 Link Here
25
                                            [% IF ( facets_loo.type_label_Series ) %]Series[% END %]
25
                                            [% IF ( facets_loo.type_label_Series ) %]Series[% END %]
26
                                            [% IF ( facets_loo.type_label_ItemTypes ) %]Item types[% END %]
26
                                            [% IF ( facets_loo.type_label_ItemTypes ) %]Item types[% END %]
27
                                            [% UNLESS ( singleBranchMode ) %]
27
                                            [% UNLESS ( singleBranchMode ) %]
28
                                                [% IF ( facets_loo.type_label_Libraries ) %]Libraries[% END %]
28
                                                [% IF ( facets_loo.type_label_HomeLibrary ) %]Home libraries[% END %]
29
                                                [% IF ( facets_loo.type_label_HoldingLibrary ) %]Holding libraries[% END %]
29
                                            [% END %]
30
                                            [% END %]
30
                                            [% IF ( facets_loo.type_label_Location ) %]Locations[% END %]</h5>
31
                                            [% IF ( facets_loo.type_label_Location ) %]Locations[% END %]</h5>
31
                        <ul>
32
                        <ul>
(-)a/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc (-2 / +2 lines)
Lines 17-23 Link Here
17
[% IF ( facets_loo.type_label_Series ) %]<span id="facet-series">Series</span>[% END %]
17
[% IF ( facets_loo.type_label_Series ) %]<span id="facet-series">Series</span>[% END %]
18
[% IF ( facets_loo.type_label_ItemTypes ) %]<span id="facet-itypes">Item types</span>[% END %]
18
[% IF ( facets_loo.type_label_ItemTypes ) %]<span id="facet-itypes">Item types</span>[% END %]
19
[% UNLESS ( singleBranchMode ) %]
19
[% UNLESS ( singleBranchMode ) %]
20
[% IF ( facets_loo.type_label_Libraries ) %]Libraries[% END %]
20
    [% IF ( facets_loo.type_label_HomeLibrary ) %]Home libraries[% END %]
21
    [% IF ( facets_loo.type_label_HoldingLibrary ) %]Holding libraries[% END %]
21
[% END %]
22
[% END %]
22
[% IF ( facets_loo.type_label_Location ) %]Locations[% END %]
23
[% IF ( facets_loo.type_label_Location ) %]Locations[% END %]
23
<ul>
24
<ul>
24
- 

Return to bug 11334