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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (-15 / +22 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
                            <button href="#" id="toggleitems" class="btn btn-primary btn-xs" style="float: right;">Show local items only</button>
454
                            [% IF Koha.Preference('FilterSearchResultsByLoggedInBranch') %]
455
                                <button href="#" id="toggleitems" class="btn btn-primary btn-xs" style="float: right;">Show local items only</button>
456
                            [% END %]
455
                            <form action="/cgi-bin/koha/catalogue/search.pl" method="get" name="bookbag_form" id="bookbag_form">
457
                            <form action="/cgi-bin/koha/catalogue/search.pl" method="get" name="bookbag_form" id="bookbag_form">
456
                                [% IF ( searchdesc ) %]
458
                                [% IF ( searchdesc ) %]
457
                                    [% FOREACH QUERY_INPUT IN QUERY_INPUTS %]
459
                                    [% FOREACH QUERY_INPUT IN QUERY_INPUTS %]
Lines 612-618 Link Here
612
                                                            [% END %]
614
                                                            [% END %]
613
615
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>
616
                                                            <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 %]
617
                                                            [% IF ( SEARCH_RESULT.branchtotalcount > 0 ) && Koha.Preference('FilterSearchResultsByLoggedInBranch') %]
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>
618
                                                                <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 %]
619
                                                            [% END %]
618
620
Lines 625-636 Link Here
625
                                                            [% IF status_count == "onloancount" %]
627
                                                            [% IF status_count == "onloancount" %]
626
                                                                [% IF SEARCH_RESULT.${status_count} > 0 %]
628
                                                                [% IF SEARCH_RESULT.${status_count} > 0 %]
627
                                                                    <div class="results_checkedout all">[% SEARCH_RESULT.${status_count} | html %] checked out:</div>
629
                                                                    <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>
630
                                                                    [% IF Koha.Preference('FilterSearchResultsByLoggedInBranch') %]
631
                                                                        <div class="results_checkedout branch_specific">[% SEARCH_RESULT.branchonloancount | html %] checked out:</div>
632
                                                                    [% END %]
629
                                                                [% END %]
633
                                                                [% END %]
630
                                                            [% ELSIF status_count == "othercount" %]
634
                                                            [% ELSIF status_count == "othercount" %]
631
                                                                [% IF SEARCH_RESULT.${status_count} > 0 %]
635
                                                                [% IF SEARCH_RESULT.${status_count} > 0 %]
632
                                                                    <div class="results_unavailablei all">[% SEARCH_RESULT.${status_count} | html %] unavailable:</div>
636
                                                                    <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>
637
                                                                    [% IF Koha.Preference('FilterSearchResultsByLoggedInBranch') %]
638
                                                                        <div class="results_unavailablei branch_specific">[% SEARCH_RESULT.branchothercount | html %] unavailable:</div>
639
                                                                    [% END %]
634
                                                                [% END %]
640
                                                                [% END %]
635
                                                            [% END %]
641
                                                            [% END %]
636
                                                            [% IF SEARCH_RESULT.${items_loop}.size > 0 %]
642
                                                            [% IF SEARCH_RESULT.${items_loop}.size > 0 %]
Lines 712-718 Link Here
712
                                                            <span class="unavailable all">No items</span>
718
                                                            <span class="unavailable all">No items</span>
713
                                                        [% END %]
719
                                                        [% END %]
714
                                                    [% END # /IF ( SEARCH_RESULT.items_count ) %]
720
                                                    [% END # /IF ( SEARCH_RESULT.items_count ) %]
715
                                                    [% IF SEARCH_RESULT.branchtotalcount == 0 %]
721
                                                    [% IF SEARCH_RESULT.branchtotalcount == 0 && Koha.Preference('FilterSearchResultsByLoggedInBranch') %]
716
                                                            <span class="unavailable branch_specific">No items</span>
722
                                                            <span class="unavailable branch_specific">No items</span>
717
                                                    [% END %]
723
                                                    [% END %]
718
                                                </div> <!-- /.availability -->
724
                                                </div> <!-- /.availability -->
Lines 826-841 Link Here
826
        var holdforclub = "[% holdforclub | html %]";
832
        var holdforclub = "[% holdforclub | html %]";
827
        var userbranch = "[% userbranch | html %]";
833
        var userbranch = "[% userbranch | html %]";
828
834
829
        $('#toggleitems').click( function() {
835
        [% IF Koha.Preference('FilterSearchResultsByLoggedInBranch') %]
830
            $('#toggleitems').text() === 'Show local items only' ? $('#toggleitems').text("Show items in all libraries") : $('#toggleitems').text("Show local items only");
836
            $('#toggleitems').click( function() {
831
            $('.branch_specific').toggle();
837
                $('#toggleitems').text() === 'Show local items only' ? $('#toggleitems').text("Show items in all libraries") : $('#toggleitems').text("Show local items only");
832
            $('.all').toggle();
838
                $('.branch_specific').toggle();
833
            $('ul[class*="_loop_items"] li').each( function() {
839
                $('.all').toggle();
834
                if ( !$(this).hasClass(userbranch) ) {
840
                $('ul[class*="_loop_items"] li').each( function() {
835
                    $(this).toggle();
841
                    if ( !$(this).hasClass(userbranch) ) {
836
                }
842
                        $(this).toggle();
843
                    }
844
                });
837
            });
845
            });
838
        });
846
        [% END %]
839
        [% IF SEARCH_RESULTS %]
847
        [% IF SEARCH_RESULTS %]
840
            var SEARCH_RESULTS = 1;
848
            var SEARCH_RESULTS = 1;
841
        [% ELSE %]
849
        [% ELSE %]
842
- 

Return to bug 37883