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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc (-26 / +31 lines)
Lines 46-57 Link Here
46
[% END %]
46
[% END %]
47
[% BLOCK items_table %]
47
[% BLOCK items_table %]
48
    <div class="[% tab | html %]_table_table_controls">
48
    <div class="[% tab | html %]_table_table_controls">
49
        <span class="show_hide_filters">
50
            <a href="#" class="show_filters" data-tab="[% tab | html %]"><i class="fa fa-filter"></i> Show filters</a>
51
            <a href="#" class="hide_filters" data-tab="[% tab | html %]" style="display: none;"><i class="fa fa-filter"></i> Hide filters</a>
52
        </span>
49
        [% IF (StaffDetailItemSelection) %]
53
        [% IF (StaffDetailItemSelection) %]
50
51
            <span class="show_hide_filters">
52
                <a href="#" class="show_filters" data-tab="[% tab | html %]"><i class="fa fa-filter"></i> Show filters</a>
53
                <a href="#" class="hide_filters" data-tab="[% tab | html %]" style="display: none;"><i class="fa fa-filter"></i> Hide filters</a>
54
            </span>
55
            | <a href="#" class="SelectAll" data-tab="[% tab | html %]"><i class="fa fa-check"></i> Select all</a>
54
            | <a href="#" class="SelectAll" data-tab="[% tab | html %]"><i class="fa fa-check"></i> Select all</a>
56
            | <a href="#" class="ClearAll" data-tab="[% tab | html %]"><i class="fa fa-times"></i> Clear all</a>
55
            | <a href="#" class="ClearAll" data-tab="[% tab | html %]"><i class="fa fa-times"></i> Clear all</a>
57
            <span class="itemselection_actions">
56
            <span class="itemselection_actions">
Lines 142-171 Link Here
142
                itemSelectionBuildActionLinks(tab_id);
141
                itemSelectionBuildActionLinks(tab_id);
143
            });
142
            });
144
143
145
            $(".show_filters").on("click",function(e){
144
        });
146
                e.preventDefault();
145
    [% END %]
147
                let tab_id = $(this).data("tab");
148
                let tab = $("#"+tab_id);
149
                tab.find(".show_filters").hide();
150
                tab.find(".hide_filters").show();
151
                $("#"+tab_id+"_table thead tr:eq(1)").remove();
152
                build_items_table(tab_id, true, { destroy: true }, build_items_table_drawncallback );
153
                itemSelectionBuildActionLinks(tab_id);
154
            });
155
146
156
            $(".hide_filters").on("click",function(e){
147
157
                e.preventDefault();
148
    $(document).ready(function() {
158
                let tab_id = $(this).data("tab");
149
        $(".show_filters").on("click",function(e){
159
                let tab = $("#"+tab_id);
150
            e.preventDefault();
160
                tab.find(".hide_filters").hide();
151
            let tab_id = $(this).data("tab");
161
                tab.find(".show_filters").show();
152
            let tab = $("#"+tab_id);
162
                $("#"+tab_id+"_table thead tr:eq(1)").remove();
153
            tab.find(".show_filters").hide();
163
                build_items_table(tab_id, false, { destroy: true }, build_items_table_drawncallback );
154
            tab.find(".hide_filters").show();
155
            $("#"+tab_id+"_table thead tr:eq(1)").remove();
156
            build_items_table(tab_id, true, { destroy: true }, build_items_table_drawncallback );
157
            [% IF StaffDetailItemSelection %]
164
                itemSelectionBuildActionLinks(tab_id);
158
                itemSelectionBuildActionLinks(tab_id);
165
            });
159
            [% END %]
166
        });
160
        });
167
    [% END %]
168
161
162
        $(".hide_filters").on("click",function(e){
163
            e.preventDefault();
164
            let tab_id = $(this).data("tab");
165
            let tab = $("#"+tab_id);
166
            tab.find(".hide_filters").hide();
167
            tab.find(".show_filters").show();
168
            $("#"+tab_id+"_table thead tr:eq(1)").remove();
169
            build_items_table(tab_id, false, { destroy: true }, build_items_table_drawncallback );
170
            [% IF StaffDetailItemSelection %]
171
                itemSelectionBuildActionLinks(tab_id);
172
            [% END %]
173
        });
174
    });
169
175
170
    const all_libraries = [% To.json(Branches.all) | $raw %];
176
    const all_libraries = [% To.json(Branches.all) | $raw %];
171
    const libraries_filters = all_libraries.map(e => {
177
    const libraries_filters = all_libraries.map(e => {
172
- 

Return to bug 33568