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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc (-1 / +28 lines)
Lines 316-321 Link Here
316
            }
316
            }
317
        });
317
        });
318
318
319
        let group_by_status_values = {
320
            holdings: false,
321
            otherholdings: false,
322
        };
323
        $(".GroupByStatus").on("click",function(e){
324
            e.preventDefault();
325
            let tab_id = $(this).data("tab");
326
            let was_grouped = group_by_status_values[tab_id];
327
            group_by_status_values[tab_id] = !was_grouped;
328
329
            build_items_table(tab_id, true, { destroy: true }, build_items_table_drawncallback );
330
331
            if ( was_grouped ) {
332
                $(this).html('<i class="fa fa-object-group"></i> Group by status</button>');
333
            } else {
334
                $(this).html('<i class="fa fa-object-ungroup"></i> Ungroup by status</button>');
335
            }
336
        });
337
319
        function build_items_table (tab_id, add_filters, dt_options, drawcallback) {
338
        function build_items_table (tab_id, add_filters, dt_options, drawcallback) {
320
339
321
            let table_dt;
340
            let table_dt;
Lines 367-372 Link Here
367
                return $("#" + tab_id + "_status select").val();
386
                return $("#" + tab_id + "_status select").val();
368
            };
387
            };
369
388
389
        let offset = 2;
390
        [% UNLESS Koha.Preference('LocalCoverImages') %]offset--;[% END %]
391
        let filters_options = {
392
                [offset]   : () => all_item_types,
393
                [offset+1] : () => all_libraries,
394
                [offset+2] : () => all_libraries,
395
                [offset+7] : () => all_statuses,
396
            };
397
370
            let group_by_status = function(){
398
            let group_by_status = function(){
371
                if ( group_by_status_values[tab_id] ) {
399
                if ( group_by_status_values[tab_id] ) {
372
                    return 'group_by_status=1';
400
                    return 'group_by_status=1';
373
- 

Return to bug 38122