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

(-)a/ill/ill-requests.pl (+1 lines)
Lines 427-432 if ( $backends_available ) { Link Here
427
427
428
$template->param(
428
$template->param(
429
    backends   => $backends,
429
    backends   => $backends,
430
    illreq_tabs => C4::Context->yaml_preference('ILLRequestsTabs'),
430
    types      => [ "Book", "Article", "Journal" ],
431
    types      => [ "Book", "Article", "Journal" ],
431
    query_type => $op,
432
    query_type => $op,
432
    branches   => Koha::Libraries->search,
433
    branches   => Koha::Libraries->search,
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-list-table.inc (-1 / +1 lines)
Lines 1-4 Link Here
1
<div>
1
<div id="ill-requests-results">
2
    [% IF prefilters.length > 0 %]
2
    [% IF prefilters.length > 0 %]
3
    <table id="ill-requests" data-prefilters="[% prefilters | html %]">
3
    <table id="ill-requests" data-prefilters="[% prefilters | html %]">
4
    [% ELSE %]
4
    [% ELSE %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt (-3 / +12 lines)
Lines 779-787 Link Here
779
                [% ELSIF query_type == 'illlist' %]
779
                [% ELSIF query_type == 'illlist' %]
780
                    <!-- illlist -->
780
                    <!-- illlist -->
781
                    <h1>View ILL requests</h1>
781
                    <h1>View ILL requests</h1>
782
                    <div id="results">
782
                    <div id="ill-requests-tabs" class="toptabs">
783
                        <h3>Details for all requests</h3>
783
                    <ul>
784
                        [% INCLUDE 'ill-list-table.inc' %]
784
                        <li>
785
                            <a id="#ill-requests-tab-all" href="#ill-requests-results">All</a>
786
                        </li>
787
                        [% FOREACH illreq_tab IN illreq_tabs %]
788
                        <li>
789
                            <a href="#ill-requests-results" data-statuses="[% illreq_tab.status.join('|') %]">[% illreq_tab.name %]</a>
790
                        </li>
791
                        [% END %]
792
                    </ul>
793
                    [% INCLUDE 'ill-list-table.inc' %]
785
794
786
                    </div> <!-- /#results -->
795
                    </div> <!-- /#results -->
787
                [% ELSIF query_type == 'availability' %]
796
                [% ELSIF query_type == 'availability' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/ill-requests.tt (-1 / +12 lines)
Lines 39-45 Link Here
39
            <main>
39
            <main>
40
                [% INCLUDE 'members-toolbar.inc' %]
40
                [% INCLUDE 'members-toolbar.inc' %]
41
                <h1>ILL requests history</h1>
41
                <h1>ILL requests history</h1>
42
                [% INCLUDE 'ill-list-table.inc' %]
42
                <div id="ill-requests-tabs" class="toptabs">
43
                    <ul>
44
                        <li>
45
                            <a id="#ill-requests-tab-all" href="#ill-requests-results">All</a>
46
                        </li>
47
                        [% FOREACH illreq_tab IN illreq_tabs %]
48
                        <li>
49
                            <a href="#ill-requests-results" data-statuses="[% illreq_tab.status.join('|') %]">[% illreq_tab.name %]</a>
50
                        </li>
51
                        [% END %]
52
                    </ul>
53
                    [% INCLUDE 'ill-list-table.inc' %]
43
            </main>
54
            </main>
44
        </div> <!-- .col-sm-10.col-sm-push-2 -->
55
        </div> <!-- .col-sm-10.col-sm-push-2 -->
45
56
(-)a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js (+50 lines)
Lines 317-322 $(document).ready(function() { Link Here
317
        }
317
        }
318
    };
318
    };
319
319
320
    var tabsInit = function( ui, illtable_el ) {
321
        localStorage.setItem(
322
            "illrequests_activetab",
323
            $( "#ill-requests-tabs" ).tabs( "option", "active" )
324
        );
325
326
        var ill_dt = illtable_el.DataTable();
327
        $.fn.dataTable.ext.search.pop();
328
        ill_dt.draw();
329
330
        if ( $( "#ill-requests-tabs" ).tabs( "option", "active" ) > 0 ) {
331
            // Initializing some other tab than "All"
332
            var ill_tab_statuses = $("#ill-requests-tabs>ul>li.ui-tabs-active>a").attr('data-statuses');
333
            ill_tab_statuses = ill_tab_statuses.split("|");
334
335
            // Only show rows having the status defined in ILLRequestsTabs system
336
            // preference in this tab
337
            $.fn.dataTable.ext.search.push(
338
                function(settings, data, dataIndex) {
339
                    return ill_tab_statuses.indexOf(ill_dt.row(dataIndex).data().status) >= 0;
340
                }
341
            );
342
            ill_dt.draw();
343
        }
344
    };
345
346
    $('#ill-requests-tabs').tabs({
347
        create: function(event,ui) {
348
            if ( $.fn.dataTable.isDataTable( 'table#ill-requests' ) ) {
349
                tabsInit(ui, $("table#ill-requests"));
350
            }
351
        },
352
        activate: function(event,ui) {
353
            if ( $.fn.dataTable.isDataTable( 'table#ill-requests' ) ) {
354
                tabsInit(ui, $("table#ill-requests"));
355
            }
356
        }
357
    });
358
359
    var activeTab = localStorage.getItem("illrequests_activetab");
360
    if( activeTab ){
361
        $("#ill-requests-tabs").tabs("option","active", activeTab );
362
    }
363
320
    // Display the modal containing request supplier metadata
364
    // Display the modal containing request supplier metadata
321
    $('#ill-request-display-log').on('click', function(e) {
365
    $('#ill-request-display-log').on('click', function(e) {
322
        e.preventDefault();
366
        e.preventDefault();
Lines 523-528 $(document).ready(function() { Link Here
523
567
524
            });
568
            });
525
569
570
            if( activeTab ){
571
                if ( $.fn.dataTable.isDataTable( 'table#ill-requests' ) ) {
572
                    tabsInit(null, $("table#ill-requests"));
573
                }
574
            }
575
526
        });
576
        });
527
    } //END if window.location.search.length == 0
577
    } //END if window.location.search.length == 0
528
578
(-)a/members/ill-requests.pl (-1 / +1 lines)
Lines 42-47 my $patron = Koha::Patrons->find( $borrowernumber ); Link Here
42
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
42
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
43
43
44
$template->param(
44
$template->param(
45
    illreq_tabs => C4::Context->yaml_preference('ILLRequestsTabs'),
45
    prefilters => "borrowernumber=$borrowernumber",
46
    prefilters => "borrowernumber=$borrowernumber",
46
    patron => $patron,
47
    patron => $patron,
47
    illview  => 1,
48
    illview  => 1,
48
- 

Return to bug 30200