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

(-)a/C4/Koha.pm (-16 / +58 lines)
Lines 715-729 sub getFacets { Link Here
715
            }
715
            }
716
            ];
716
            ];
717
717
718
            my $library_facet;
718
            unless ( C4::Context->preference("singleBranchMode")
719
            unless ( C4::Context->preference("singleBranchMode") || GetBranchesCount() == 1 ) {
719
                || GetBranchesCount() == 1 )
720
                $library_facet = {
720
            {
721
                    idx  => 'branch',
721
                my $DisplayLibraryFacets = C4::Context->preference('DisplayLibraryFacets');
722
                    label => 'Libraries',
722
                if (   $DisplayLibraryFacets eq 'both'
723
                    tags        => [ qw/ 995b / ],
723
                    || $DisplayLibraryFacets eq 'holding' )
724
                };
724
                {
725
                    push(
726
                        @$facets,
727
                        {
728
                            idx   => 'holdingbranch',
729
                            label => 'HoldingLibrary',
730
                            tags  => [qw / 995b /],
731
                        }
732
                    );
733
                }
734
735
                if (   $DisplayLibraryFacets eq 'both'
736
                    || $DisplayLibraryFacets eq 'home' )
737
                {
738
                push(
739
                    @$facets,
740
                    {
741
                        idx   => 'homebranch',
742
                        label => 'HomeLibrary',
743
                        tags  => [qw / 995a /],
744
                    }
745
                );
746
                }
725
            }
747
            }
726
            push( @$facets, $library_facet );
727
    }
748
    }
728
    else {
749
    else {
729
        $facets = [
750
        $facets = [
Lines 776-790 sub getFacets { Link Here
776
            },
797
            },
777
            ];
798
            ];
778
799
779
            my $library_facet;
800
            unless ( C4::Context->preference("singleBranchMode")
780
            unless ( C4::Context->preference("singleBranchMode") || GetBranchesCount() == 1 ) {
801
                || GetBranchesCount() == 1 )
781
                $library_facet = {
802
            {
782
                    idx  => 'branch',
803
                my $DisplayLibraryFacets = C4::Context->preference('DisplayLibraryFacets');
783
                    label => 'Libraries',
804
                if (   $DisplayLibraryFacets eq 'both'
784
                    tags        => [ qw / 952b / ],
805
                    || $DisplayLibraryFacets eq 'holding' )
785
                };
806
                {
807
                    push(
808
                        @$facets,
809
                        {
810
                            idx   => 'holdingbranch',
811
                            label => 'HoldingLibrary',
812
                            tags  => [qw / 952b /],
813
                        }
814
                    );
815
                }
816
817
                if (   $DisplayLibraryFacets eq 'both'
818
                    || $DisplayLibraryFacets eq 'home' )
819
                {
820
                push(
821
                    @$facets,
822
                    {
823
                        idx   => 'homebranch',
824
                        label => 'HomeLibrary',
825
                        tags  => [qw / 952a /],
826
                    }
827
                );
828
                }
786
            }
829
            }
787
            push( @$facets, $library_facet );
788
    }
830
    }
789
    return $facets;
831
    return $facets;
790
}
832
}
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 96-101 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
96
('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'),
96
('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'),
97
('displayFacetCount','0',NULL,NULL,'YesNo'),
97
('displayFacetCount','0',NULL,NULL,'YesNo'),
98
('DisplayIconsXSLT','1','','If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages.','YesNo'),
98
('DisplayIconsXSLT','1','','If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages.','YesNo'),
99
('DisplayLibraryFacets',  'holdingbranch',  'home|holding|both',  'Defines which library facets to display.',  'Choice'),
99
('DisplayMultiPlaceHold','1','','Display the ability to place multiple holds or not','YesNo'),
100
('DisplayMultiPlaceHold','1','','Display the ability to place multiple holds or not','YesNo'),
100
('DisplayOPACiconsXSLT','1','','If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages in the OPAC.','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'),
101
('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'),
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'),
(-)a/installer/data/mysql/updatedatabase.pl (+18 lines)
Lines 7771-7776 if ( CheckVersion($DBversion) ) { Link Here
7771
    SetVersion($DBversion);
7771
    SetVersion($DBversion);
7772
}
7772
}
7773
7773
7774
$DBversion = '3.15.00.XXX';
7775
if ( CheckVersion($DBversion) ) {
7776
    $dbh->do(q{
7777
        INSERT INTO  systempreferences (
7778
            variable,
7779
            value,
7780
            options,
7781
            explanation,
7782
            type
7783
            )
7784
        VALUES (
7785
            'DisplayLibraryFacets',  'holdingbranch',  'home|holding|both',  'Defines which library facets to display.',  'Choice'
7786
        );
7787
    });
7788
    print "Upgrade to $DBversion done (Bug 11334 - Add facet for home library)\n";
7789
    SetVersion ($DBversion);
7790
}
7791
7774
=head1 FUNCTIONS
7792
=head1 FUNCTIONS
7775
7793
7776
=head2 TableExists($table)
7794
=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 ) %]Series[% END %]
17
[% IF ( facets_loo.type_label_Series ) %]Series[% END %]
18
[% IF ( facets_loo.type_label_ItemTypes ) %]Item types[% END %]
18
[% IF ( facets_loo.type_label_ItemTypes ) %]Item types[% 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