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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (-4 / +46 lines)
Lines 554-560 Link Here
554
        [% ELSE # /IF scan %]
554
        [% ELSE # /IF scan %]
555
            <div id="searchresults">
555
            <div id="searchresults">
556
                [% INCLUDE 'page-numbers.inc' %]
556
                [% INCLUDE 'page-numbers.inc' %]
557
557
                [% IF Koha.Preference('FilterSearchResultsByLoggedInBranch') %]
558
                    <button href="#" id="toggleitems" class="btn btn-primary btn-xs" style="float: right;">Show local items only</button>
559
                [% END %]
558
                <form action="/cgi-bin/koha/catalogue/search.pl" method="get" name="bookbag_form" id="bookbag_form">
560
                <form action="/cgi-bin/koha/catalogue/search.pl" method="get" name="bookbag_form" id="bookbag_form">
559
                    [% IF ( searchdesc ) %]
561
                    [% IF ( searchdesc ) %]
560
                        [% FOREACH QUERY_INPUT IN QUERY_INPUTS %]
562
                        [% FOREACH QUERY_INPUT IN QUERY_INPUTS %]
Lines 747-752 Link Here
747
                                                <div class="results_available_count">
749
                                                <div class="results_available_count">
748
                                                    [% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %]
750
                                                    [% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %]
749
                                                        <span class="blocker inaccurate-item-statuses" title="Item statuses may be inaccurate. Please view the record details for accurate item statuses">
751
                                                        <span class="blocker inaccurate-item-statuses" title="Item statuses may be inaccurate. Please view the record details for accurate item statuses">
752
                                                            <div class="all">
753
                                                                [% tnx('{count} item', '{count} items', SEARCH_RESULT.items_count, {count = SEARCH_RESULT.items_count}) | html %][% IF ( SEARCH_RESULT.availablecount ) %]
754
                                                                    , [% SEARCH_RESULT.availablecount | html %] <span>available:</span>
755
                                                                [% ELSE %]
756
                                                                    , <span>None available</span>
757
                                                                [% END %]
758
                                                            </div>
759
                                                            [% IF SEARCH_RESULT.branchtotalcount > 0 && Koha.Preference('FilterSearchResultsByLoggedInBranch') %]
760
                                                                <div class="branch_specific">
761
                                                                    [% tnx('{count} item', '{count} items', SEARCH_RESULT.branchtotalcount, {count = SEARCH_RESULT.branchtotalcount}) | html %][% IF ( SEARCH_RESULT.branchavailablecount ) %]
762
                                                                        , [% SEARCH_RESULT.branchavailablecount | html %] <span>available:</span>
763
                                                                    [% ELSE %]
764
                                                                        , <span>None available</span>
765
                                                                    [% END %]
766
                                                                </div>
767
                                                            [% END %]
768
                                                        </span>
769
                                                    [% ELSE %]
770
                                                        <div class="all">
750
                                                            [% tnx('{count} item', '{count} items', SEARCH_RESULT.items_count, {count = SEARCH_RESULT.items_count}) | html %][% IF ( SEARCH_RESULT.availablecount ) %]
771
                                                            [% tnx('{count} item', '{count} items', SEARCH_RESULT.items_count, {count = SEARCH_RESULT.items_count}) | html %][% IF ( SEARCH_RESULT.availablecount ) %]
751
                                                                , [% SEARCH_RESULT.availablecount | html %] <span>available:</span>
772
                                                                , [% SEARCH_RESULT.availablecount | html %] <span>available:</span>
752
                                                            [% ELSE %]
773
                                                            [% ELSE %]
Lines 766-776 Link Here
766
                                                [% BLOCK search_result_items %]
787
                                                [% BLOCK search_result_items %]
767
                                                    [% IF status_count == "onloancount" %]
788
                                                    [% IF status_count == "onloancount" %]
768
                                                        [% IF SEARCH_RESULT.${status_count} > 0 %]
789
                                                        [% IF SEARCH_RESULT.${status_count} > 0 %]
769
                                                            <div class="results_checkedout">[% SEARCH_RESULT.${status_count} | html %] checked out:</div>
790
                                                            <div class="results_checkedout all">[% SEARCH_RESULT.${status_count} | html %] checked out:</div>
791
                                                            [% IF Koha.Preference('FilterSearchResultsByLoggedInBranch') %]
792
                                                                <div class="results_checkedout branch_specific">[% SEARCH_RESULT.branchonloancount | html %] checked out:</div>
793
                                                            [% END %]
770
                                                        [% END %]
794
                                                        [% END %]
771
                                                    [% ELSIF status_count == "othercount" %]
795
                                                    [% ELSIF status_count == "othercount" %]
772
                                                        [% IF SEARCH_RESULT.${status_count} > 0 %]
796
                                                        [% IF SEARCH_RESULT.${status_count} > 0 %]
773
                                                            <div class="results_unavailable">[% SEARCH_RESULT.${status_count} | html %] unavailable:</div>
797
                                                            <div class="results_unavailable all">[% SEARCH_RESULT.${status_count} | html %] unavailable:</div>
798
                                                            [% IF Koha.Preference('FilterSearchResultsByLoggedInBranch') %]
799
                                                                <div class="results_unavailable branch_specific">[% SEARCH_RESULT.branchothercount | html %] unavailable:</div>
800
                                                            [% END %]
774
                                                        [% END %]
801
                                                        [% END %]
775
                                                    [% END %]
802
                                                    [% END %]
776
                                                    [% IF SEARCH_RESULT.${items_loop}.size > 0 %]
803
                                                    [% IF SEARCH_RESULT.${items_loop}.size > 0 %]
Lines 851-856 Link Here
851
                                                    <span class="unavailable">No items</span>
878
                                                    <span class="unavailable">No items</span>
852
                                                [% END %]
879
                                                [% END %]
853
                                            [% END # /IF ( SEARCH_RESULT.items_count ) %]
880
                                            [% END # /IF ( SEARCH_RESULT.items_count ) %]
881
                                            [% IF SEARCH_RESULT.branchtotalcount == 0 && Koha.Preference('FilterSearchResultsByLoggedInBranch') %]
882
                                                <span class="unavailable branch_specific">No items</span>
883
                                            [% END %]
854
                                        </div>
884
                                        </div>
855
                                        <!-- /.availability -->
885
                                        <!-- /.availability -->
856
                                    </td>
886
                                    </td>
Lines 935-940 Link Here
935
        var biblionumber = "[% biblionumber | html %]";
965
        var biblionumber = "[% biblionumber | html %]";
936
        var holdfor_cardnumber = "[% holdfor_patron.cardnumber | html %]";
966
        var holdfor_cardnumber = "[% holdfor_patron.cardnumber | html %]";
937
        var holdforclub = "[% holdforclub | html %]";
967
        var holdforclub = "[% holdforclub | html %]";
968
        var userbranch = "[% userbranch | html %]";
969
        [% IF Koha.Preference('FilterSearchResultsByLoggedInBranch') %]
970
            $('#toggleitems').click( function() {
971
                $('#toggleitems').text() === 'Show local items only' ? $('#toggleitems').text("Show items in all libraries") : $('#toggleitems').text("Show local items only");
972
                $('.branch_specific').toggle();
973
                $('.all').toggle();
974
                $('ul[class*="_loop_items"] li').each( function() {
975
                    if ( !$(this).hasClass(userbranch) ) {
976
                        $(this).toggle();
977
                    }
978
                });
979
            });
980
        [% END %]
938
        [% IF SEARCH_RESULTS %]
981
        [% IF SEARCH_RESULTS %]
939
            var SEARCH_RESULTS = 1;
982
            var SEARCH_RESULTS = 1;
940
        [% ELSE %]
983
        [% ELSE %]
941
- 

Return to bug 37883