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

(-)a/C4/Koha.pm (-17 / +37 lines)
Lines 711-725 sub getFacets { Link Here
711
            ];
711
            ];
712
712
713
            my $library_facet;
713
            my $library_facet;
714
714
            unless ( C4::Context->preference("singleBranchMode") ) {
715
            $library_facet = {
715
                $library_facet = {
716
                link_value  => 'branch',
716
                    link_value  => 'branch',
717
                label_value => 'Libraries',
717
                    label_value => 'Libraries',
718
                tags        => [ '995', ],
718
                    tags        => [ '995', ],
719
                subfield    => 'b',
719
                    subfield    => 'b',
720
                expanded    => '1',
720
                    expanded    => '1',
721
            };
721
                };
722
            push @$facets, $library_facet unless C4::Context->preference("singleBranchMode");
722
            } else {
723
                $library_facet = {
724
                    link_value  => 'location',
725
                    label_value => 'Location',
726
                    tags        => [ '995' ],
727
                    subfield    => 'c',
728
                    expanded    => '1',
729
                };
730
            }
731
            push( @$facets, $library_facet );
723
    }
732
    }
724
    else {
733
    else {
725
        $facets = [
734
        $facets = [
Lines 761-775 sub getFacets { Link Here
761
                subfield    => 'a',
770
                subfield    => 'a',
762
            },
771
            },
763
            ];
772
            ];
773
            
764
            my $library_facet;
774
            my $library_facet;
765
            $library_facet = {
775
            unless ( C4::Context->preference("singleBranchMode") ) {
766
                link_value  => 'branch',
776
                $library_facet = {
767
                label_value => 'Libraries',
777
                    link_value  => 'branch',
768
                tags        => [ '952', ],
778
                    label_value => 'Libraries',
769
                subfield    => 'b',
779
                    tags        => [ '952', ],
770
                expanded    => '1',
780
                    subfield    => 'b',
771
            };
781
                    expanded    => '1',
772
            push @$facets, $library_facet unless C4::Context->preference("singleBranchMode");
782
                };
783
            } else {
784
                $library_facet = {
785
                    link_value => 'location',
786
                    label_value => 'Location',
787
                    tags => [ '952' ],
788
                    subfield => 'c',
789
                    expanded => '1',
790
                };
791
            }
792
            push( @$facets, $library_facet );
773
    }
793
    }
774
    return $facets;
794
    return $facets;
775
}
795
}
(-)a/C4/Search.pm (-1 / +6 lines)
Lines 303-309 sub getRecords { Link Here
303
    my (
303
    my (
304
        $koha_query,       $simple_query, $sort_by_ref,    $servers_ref,
304
        $koha_query,       $simple_query, $sort_by_ref,    $servers_ref,
305
        $results_per_page, $offset,       $expanded_facet, $branches,
305
        $results_per_page, $offset,       $expanded_facet, $branches,
306
        $query_type,       $scan
306
        $query_type,       $scan,         $opac
307
    ) = @_;
307
    ) = @_;
308
308
309
    my @servers = @$servers_ref;
309
    my @servers = @$servers_ref;
Lines 564-569 sub getRecords { Link Here
564
								}
564
								}
565
                            }
565
                            }
566
566
567
                            # also, if it's a location code, use the name instead of the code
568
                            if ( $link_value =~ /location/ ) {
569
                                $facet_label_value = GetKohaAuthorisedValueLib('LOC', $one_facet, $opac) || '*';
570
                            }
571
567
                            # but we're down with the whole label being in the link's title.
572
                            # but we're down with the whole label being in the link's title.
568
                            push @this_facets_array, {
573
                            push @this_facets_array, {
569
                                facet_count       => $facets_counter->{$link_value}->{$one_facet},
574
                                facet_count       => $facets_counter->{$link_value}->{$one_facet},
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc (+1 lines)
Lines 16-21 Link Here
16
[% IF ( facets_loo.type_label_Places ) %]Places[% END %]
16
[% IF ( facets_loo.type_label_Places ) %]Places[% END %]
17
[% IF ( facets_loo.type_label_Series ) %]Series[% END %]
17
[% IF ( facets_loo.type_label_Series ) %]Series[% END %]
18
[% IF ( facets_loo.type_label_Libraries ) %]Libraries[% END %]
18
[% IF ( facets_loo.type_label_Libraries ) %]Libraries[% END %]
19
[% IF ( facets_loo.type_label_Location ) %]Locations[% END %]
19
<ul>
20
<ul>
20
        [% 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 ) %]
21
        [% 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 ) %]
21
        <li class="showmore"><a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %][% IF ( offset ) %]&amp;offset=[% offset %][% END %]&amp;expand=[% facets_loo.expand %]#[% facets_loo.type_id %]">Show More</a></li>
22
        <li class="showmore"><a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %][% IF ( offset ) %]&amp;offset=[% offset %][% END %]&amp;expand=[% facets_loo.expand %]#[% facets_loo.type_id %]">Show More</a></li>
(-)a/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc (+1 lines)
Lines 17-22 Link Here
17
[% UNLESS ( singleBranchMode ) %]
17
[% UNLESS ( singleBranchMode ) %]
18
[% IF ( facets_loo.type_label_Libraries ) %]Libraries[% END %]
18
[% IF ( facets_loo.type_label_Libraries ) %]Libraries[% END %]
19
[% END %]
19
[% END %]
20
[% IF ( facets_loo.type_label_Location ) %]Locations[% END %]
20
<ul>
21
<ul>
21
        [% FOREACH facet IN facets_loo.facets %]<li><a href="/cgi-bin/koha/opac-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 |html %]">[% facet.facet_label_value %]</a> [% IF ( displayFacetCount ) %]([% facet.facet_count %])[% END %]</li>[% END %][% IF ( facets_loo.expandable ) %]
22
        [% FOREACH facet IN facets_loo.facets %]<li><a href="/cgi-bin/koha/opac-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 |html %]">[% facet.facet_label_value %]</a> [% IF ( displayFacetCount ) %]([% facet.facet_count %])[% END %]</li>[% END %][% IF ( facets_loo.expandable ) %]
22
        <li class="showmore"><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %][% IF ( offset ) %]&amp;offset=[% offset %][% END %]&amp;expand=[% facets_loo.expand %]#[% facets_loo.type_id %]">Show More</a></li>
23
        <li class="showmore"><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %][% IF ( offset ) %]&amp;offset=[% offset %][% END %]&amp;expand=[% facets_loo.expand %]#[% facets_loo.type_id %]">Show More</a></li>
(-)a/opac/opac-search.pl (-2 / +1 lines)
Lines 452-458 elsif (C4::Context->preference('NoZebra')) { Link Here
452
    $pasarParams .= '&amp;simple_query=' . $simple_query;
452
    $pasarParams .= '&amp;simple_query=' . $simple_query;
453
    $pasarParams .= '&amp;query_type=' . $query_type if ($query_type);
453
    $pasarParams .= '&amp;query_type=' . $query_type if ($query_type);
454
    eval {
454
    eval {
455
        ($error, $results_hashref, $facets) = getRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$query_type,$scan);
455
        ($error, $results_hashref, $facets) = getRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$query_type,$scan,1);
456
    };
456
    };
457
}
457
}
458
# This sorts the facets into alphabetical order
458
# This sorts the facets into alphabetical order
459
- 

Return to bug 7401