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

(-)a/catalogue/search.pl (+3 lines)
Lines 198-203 my ($template, $borrowernumber, $cookie) = get_template_and_user({ Link Here
198
198
199
my $lang = C4::Languages::getlanguage($cgi);
199
my $lang = C4::Languages::getlanguage($cgi);
200
200
201
my $userenv_branch = C4::Context->userenv->{'branch'} || '';
202
$template->param( userbranch => $userenv_branch );
203
201
if (C4::Context->preference("marcflavour") eq "UNIMARC" ) {
204
if (C4::Context->preference("marcflavour") eq "UNIMARC" ) {
202
    $template->param('UNIMARC' => 1);
205
    $template->param('UNIMARC' => 1);
203
}
206
}
(-)a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss (-1 / +6 lines)
Lines 1942-1948 li { Link Here
1942
1942
1943
        &.unavailable {
1943
        &.unavailable {
1944
            clear: left;
1944
            clear: left;
1945
            display: block;
1946
        }
1945
        }
1947
    }
1946
    }
1948
1947
Lines 1959-1964 li { Link Here
1959
            display: block;
1958
            display: block;
1960
        }
1959
        }
1961
    }
1960
    }
1961
    .all {
1962
        display: block;
1963
    }
1964
    .branch_specific {
1965
        display: none;
1966
    }
1962
}
1967
}
1963
1968
1964
#searchresults,
1969
#searchresults,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (-6 / +25 lines)
Lines 451-457 Link Here
451
451
452
                        <div id="searchresults">
452
                        <div id="searchresults">
453
                            [% INCLUDE 'page-numbers.inc' %]
453
                            [% INCLUDE 'page-numbers.inc' %]
454
454
                            <button href="#" id="toggleitems" class="btn btn-primary btn-xs" style="float: right;">Show local items only</button>
455
                            <form action="/cgi-bin/koha/catalogue/search.pl" method="get" name="bookbag_form" id="bookbag_form">
455
                            <form action="/cgi-bin/koha/catalogue/search.pl" method="get" name="bookbag_form" id="bookbag_form">
456
                                [% IF ( searchdesc ) %]
456
                                [% IF ( searchdesc ) %]
457
                                    [% FOREACH QUERY_INPUT IN QUERY_INPUTS %]
457
                                    [% FOREACH QUERY_INPUT IN QUERY_INPUTS %]
Lines 611-617 Link Here
611
                                                                <span class="blocker inaccurate-item-statuses" title="Item statuses may be inaccurate. Please view the record details for accurate item statuses">
611
                                                                <span class="blocker inaccurate-item-statuses" title="Item statuses may be inaccurate. Please view the record details for accurate item statuses">
612
                                                            [% END %]
612
                                                            [% END %]
613
613
614
                                                            [% tnx('{count} item', '{count} items', SEARCH_RESULT.items_count, {count = SEARCH_RESULT.items_count}) | html %][% IF ( SEARCH_RESULT.availablecount ) %], [% SEARCH_RESULT.availablecount | html %] <span>available:</span>[% ELSE %], <span>None available</span>[% END %]
614
                                                            <div class="all">[% tnx('{count} item', '{count} items', SEARCH_RESULT.items_count, {count = SEARCH_RESULT.items_count}) | html %][% IF ( SEARCH_RESULT.availablecount ) %], [% SEARCH_RESULT.availablecount | html %] <span>available:</span>[% ELSE %], <span>None available</span>[% END %]</div>
615
                                                            [% IF SEARCH_RESULT.branchtotalcount > 0 %]
616
                                                                <div class="branch_specific">[% tnx('{count} item', '{count} items', SEARCH_RESULT.branchtotalcount, {count = SEARCH_RESULT.branchtotalcount}) | html %][% IF ( SEARCH_RESULT.branchavailablecount ) %], [% SEARCH_RESULT.branchavailablecount | html %] <span>available:</span>[% ELSE %], <span>None available</span>[% END %]</div>
617
                                                            [% END %]
615
618
616
                                                            [% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %]
619
                                                            [% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %]
617
                                                                </span>
620
                                                                </span>
Lines 621-631 Link Here
621
                                                        [% BLOCK search_result_items %]
624
                                                        [% BLOCK search_result_items %]
622
                                                            [% IF status_count == "onloancount" %]
625
                                                            [% IF status_count == "onloancount" %]
623
                                                                [% IF SEARCH_RESULT.${status_count} > 0 %]
626
                                                                [% IF SEARCH_RESULT.${status_count} > 0 %]
624
                                                                    <div class="results_checkedout">[% SEARCH_RESULT.${status_count} | html %] checked out:</div>
627
                                                                    <div class="results_checkedout all">[% SEARCH_RESULT.${status_count} | html %] checked out:</div>
628
                                                                    <div class="results_checkedout branch_specific">[% SEARCH_RESULT.branchonloancount | html %] checked out:</div>
625
                                                                [% END %]
629
                                                                [% END %]
626
                                                            [% ELSIF status_count == "othercount" %]
630
                                                            [% ELSIF status_count == "othercount" %]
627
                                                                [% IF SEARCH_RESULT.${status_count} > 0 %]
631
                                                                [% IF SEARCH_RESULT.${status_count} > 0 %]
628
                                                                    <div class="results_unavailable">[% SEARCH_RESULT.${status_count} | html %] unavailable:</div>
632
                                                                    <div class="results_unavailablei all">[% SEARCH_RESULT.${status_count} | html %] unavailable:</div>
633
                                                                    <div class="results_unavailablei branch_specific">[% SEARCH_RESULT.branchothercount | html %] unavailable:</div>
629
                                                                [% END %]
634
                                                                [% END %]
630
                                                            [% END %]
635
                                                            [% END %]
631
                                                            [% IF SEARCH_RESULT.${items_loop}.size > 0 %]
636
                                                            [% IF SEARCH_RESULT.${items_loop}.size > 0 %]
Lines 704-712 Link Here
704
                                                                [% END %]
709
                                                                [% END %]
705
                                                            </ul>
710
                                                            </ul>
706
                                                        [% ELSE %]
711
                                                        [% ELSE %]
707
                                                            <span class="unavailable">No items</span>
712
                                                            <span class="unavailable all">No items</span>
708
                                                        [% END %]
713
                                                        [% END %]
709
                                                    [% END # /IF ( SEARCH_RESULT.items_count ) %]
714
                                                    [% END # /IF ( SEARCH_RESULT.items_count ) %]
715
                                                    [% IF SEARCH_RESULT.branchtotalcount == 0 %]
716
                                                            <span class="unavailable branch_specific">No items</span>
717
                                                    [% END %]
710
                                                </div> <!-- /.availability -->
718
                                                </div> <!-- /.availability -->
711
                                            </td>
719
                                            </td>
712
                                        </tr>
720
                                        </tr>
Lines 816-821 Link Here
816
        var biblionumber = "[% biblionumber | html %]";
824
        var biblionumber = "[% biblionumber | html %]";
817
        var holdfor_cardnumber = "[% holdfor_patron.cardnumber | html %]";
825
        var holdfor_cardnumber = "[% holdfor_patron.cardnumber | html %]";
818
        var holdforclub = "[% holdforclub | html %]";
826
        var holdforclub = "[% holdforclub | html %]";
827
        var userbranch = "[% userbranch | html %]";
828
829
        $('#toggleitems').click( function() {
830
            $('#toggleitems').text() === 'Show local items only' ? $('#toggleitems').text("Show items in all libraries") : $('#toggleitems').text("Show local items only");
831
            $('.branch_specific').toggle();
832
            $('.all').toggle();
833
            $('ul[class*="_loop_items"] li').each( function() {
834
                if ( !$(this).hasClass(userbranch) ) {
835
                    $(this).toggle();
836
                }
837
            });
838
        });
819
        [% IF SEARCH_RESULTS %]
839
        [% IF SEARCH_RESULTS %]
820
            var SEARCH_RESULTS = 1;
840
            var SEARCH_RESULTS = 1;
821
        [% ELSE %]
841
        [% ELSE %]
822
- 

Return to bug 37883