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

(-)a/catalogue/search.pl (-5 / +16 lines)
Lines 400-412 if ($operands[0] && !$operands[1]) { Link Here
400
    $basic_search=1;
400
    $basic_search=1;
401
}
401
}
402
402
403
my $available;
403
my ( $available, $component_records, $exclude_component_records );
404
foreach my $limit(@limits) {
404
foreach my $limit(@limits) {
405
    if ($limit =~/available/) {
405
    if ($limit =~/available/) {
406
        $available = 1;
406
        $available = 1;
407
    }
407
    }
408
    elsif ( $limit =~ /^component_records$/ ) {
409
        $component_records = 1;
410
    } elsif ( $limit =~ /^exclude_component_records$/ ) {
411
        $exclude_component_records = 1;
412
    }
408
}
413
}
409
$template->param(available => $available);
414
$template->param(
415
    available                       => $available,
416
    limit_component_records         => $component_records,
417
    limit_exclude_component_records => $exclude_component_records,
418
);
410
419
411
# append year limits if they exist
420
# append year limits if they exist
412
my $limit_yr;
421
my $limit_yr;
Lines 648-656 for (my $i=0;$i<@servers;$i++) { Link Here
648
        if ($hits) {
657
        if ($hits) {
649
            $template->param(total => $hits);
658
            $template->param(total => $hits);
650
            if ($limit_cgi) {
659
            if ($limit_cgi) {
651
                my $limit_cgi_not_availablity = $limit_cgi;
660
                foreach my $limit_case ( 'available', 'component_records', 'exclude_component_records' ) {
652
                $limit_cgi_not_availablity =~ s/&limit=available//g;
661
                    my $limit_cgi_not_case = $limit_cgi;
653
                $template->param(limit_cgi_not_availablity => $limit_cgi_not_availablity);
662
                    $limit_cgi_not_case = s/&limit=$limit_case//g if defined $limit_cgi_not_case;
663
                    $template->param( "limit_cgi_not_$limit_case" => $limit_cgi_not_case );
664
                }
654
            }
665
            }
655
            $template->param(DisplayMultiPlaceHold => $DisplayMultiPlaceHold);
666
            $template->param(DisplayMultiPlaceHold => $DisplayMultiPlaceHold);
656
            if ($query_desc || $limit_desc) {
667
            if ($query_desc || $limit_desc) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc (-2 / +22 lines)
Lines 34-40 Link Here
34
                                <strong>Showing only records with available items</strong>
34
                                <strong>Showing only records with available items</strong>
35
                                </li>
35
                                </li>
36
                                <li>
36
                                <li>
37
                                    <a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi | $raw %][% limit_cgi_not_availablity | $raw %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by | uri %][% END %]">Show all records</a>
37
                                    <a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi | $raw %][% limit_cgi_not_available | $raw %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by | uri %][% END %]">Show all records</a>
38
                            [% ELSE %]
38
                            [% ELSE %]
39
                                <a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by | uri %][% END %]&amp;limit=available">Limit to records with available items</a>
39
                                <a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by | uri %][% END %]&amp;limit=available">Limit to records with available items</a>
40
                            [% END # /IF available %]
40
                            [% END # /IF available %]
Lines 47-52 Link Here
47
                    [% END %]
47
                    [% END %]
48
                </li> <!-- /#availability_facet -->
48
                </li> <!-- /#availability_facet -->
49
49
50
                [% IF Koha.Preference("ShowComponentRecordsFacet") == 'staff' || Koha.Preference("ShowComponentRecordsFacet") == 'both' %]
51
                <li id="component_record_facet">
52
                    Component records
53
                    <ul>
54
                        <li>
55
                            [% IF ( limit_exclude_component_records ) || ( limit_component_records ) %]
56
                                <strong>[% IF ( limit_exclude_component_records ) %]Excluding[% ELSE %]Showing only[% END %] component records</strong>
57
                                </li>
58
                                <li>
59
                                    <a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi | $raw %][% IF ( limit_exclude_component_records ) %][% limit_cgi_not_limit_exclude_component_records %][% END %][% IF ( limit_component_records ) %][% limit_cgi_not_limit_component_records %][% END %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by | uri %][% END %]">Show all records</a>
60
                            [% ELSE %]
61
                                <a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by | uri %][% END %]&amp;limit=exclude_component_records">Exclude component records</a>
62
                                </li>
63
                                <li>
64
                                <a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by | uri %][% END %]&amp;limit=component_records">Show component records</a>
65
                            [% END # /IF limit_exclude_component_records %]
66
                        </li>
67
                    </ul>
68
                </li> <!-- /#component_record_facet -->
69
                [% END # /IF ShowComponentRecordsFacet %]
70
50
                [% FOREACH facets_loo IN facets_loop %]
71
                [% FOREACH facets_loo IN facets_loop %]
51
                    [% IF facets_loo.facets.size > 0 %]
72
                    [% IF facets_loo.facets.size > 0 %]
52
                        <li id="[% facets_loo.type_id | html %]">
73
                        <li id="[% facets_loo.type_id | html %]">
53
- 

Return to bug 15728