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 (-3 / +3 lines)
Lines 1-8 Link Here
1
<div>
1
<div>
2
    [% IF prefilters.length > 0 %]
2
    [% IF prefilters.length > 0 %]
3
    <table id="ill-requests" data-prefilters="[% prefilters | html %]">
3
    <table id="ill-requests[% illreq_custom_tab_id %]" data-prefilters="[% prefilters | html %]">
4
    [% ELSE %]
4
    [% ELSE %]
5
    <table id="ill-requests">
5
    <table id="ill-requests[% illreq_custom_tab_id %]">
6
    [% END %]
6
    [% END %]
7
        <thead>
7
        <thead>
8
            <tr id="illview-header">
8
            <tr id="illview-header">
Lines 36-42 Link Here
36
                <th scope="col" class="actions"></th>
36
                <th scope="col" class="actions"></th>
37
            </tr>
37
            </tr>
38
        </thead>
38
        </thead>
39
        <tbody id="illview-body">
39
        <tbody id="illview-body[% illreq_custom_tab_id %]">
40
        </tbody>
40
        </tbody>
41
    </table>
41
    </table>
42
</div>
42
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt (-2 / +27 lines)
Lines 1-6 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE Asset %]
2
[% USE Asset %]
3
[% USE Branches %]
3
[% USE Branches %]
4
[% USE JSON.Escape %]
4
[% USE Koha %]
5
[% USE Koha %]
5
[% USE KohaDates %]
6
[% USE KohaDates %]
6
[% SET footerjs = 1 %]
7
[% SET footerjs = 1 %]
Lines 779-787 Link Here
779
                [% ELSIF query_type == 'illlist' %]
780
                [% ELSIF query_type == 'illlist' %]
780
                    <!-- illlist -->
781
                    <!-- illlist -->
781
                    <h1>View ILL requests</h1>
782
                    <h1>View ILL requests</h1>
782
                    <div id="results">
783
                    <div id="results" class="toptabs">
783
                        <h3>Details for all requests</h3>
784
                    <ul>
785
                        <li>
786
                            <a href="#all">All</a>
787
                        </li>
788
                        [% illreq_tab_regex = '' %]
789
                        [% FOREACH illreq_tab IN illreq_tabs %]
790
                        <li>
791
                            <a href="#illreq_tab-[% loop.index %]">[% illreq_tab.name %]</a>
792
                        </li>
793
                        [% END %]
794
                    </ul>
795
                    <div id="all">
784
                        [% INCLUDE 'ill-list-table.inc' %]
796
                        [% INCLUDE 'ill-list-table.inc' %]
797
                    </div>
798
                    [% FOREACH illreq_tab IN illreq_tabs %]
799
                    [% SET illreq_custom_tab_id = "-illreq_tab-" _ loop.index %]
800
                    <div id="illreq_tab-[% loop.index %]">
801
                        [% INCLUDE 'ill-list-table.inc' %]
802
                    </div>
803
                    [% END %]
785
804
786
                    </div> <!-- /#results -->
805
                    </div> <!-- /#results -->
787
                [% ELSIF query_type == 'availability' %]
806
                [% ELSIF query_type == 'availability' %]
Lines 858-863 Link Here
858
            }
877
            }
859
        });
878
        });
860
    </script>
879
    </script>
880
    <script>
881
        var illreq_tabs = [% IF illreq_tabs %][% illreq_tabs.json %][% ELSE %][][% END %];
882
        $(document).ready(function() {
883
            $('#results').tabs();
884
        });
885
    </script>
861
    [% INCLUDE 'ill-list-table-strings.inc' %]
886
    [% INCLUDE 'ill-list-table-strings.inc' %]
862
    [% Asset.js("js/ill-list-table.js") | $raw %]
887
    [% Asset.js("js/ill-list-table.js") | $raw %]
863
    [% IF (query_type == 'availability' || query_type == 'generic_confirm') && Koha.Preference('ILLCheckAvailability') %]
888
    [% IF (query_type == 'availability' || query_type == 'generic_confirm') && Koha.Preference('ILLCheckAvailability') %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/ill-requests.tt (-1 / +28 lines)
Lines 1-6 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE Asset %]
2
[% USE Asset %]
3
[% USE Branches %]
3
[% USE Branches %]
4
[% USE JSON.Escape %]
4
[% USE Koha %]
5
[% USE Koha %]
5
[% USE KohaDates %]
6
[% USE KohaDates %]
6
[% SET footerjs = 1 %]
7
[% SET footerjs = 1 %]
Lines 39-45 Link Here
39
            <main>
40
            <main>
40
                [% INCLUDE 'members-toolbar.inc' %]
41
                [% INCLUDE 'members-toolbar.inc' %]
41
                <h1>ILL requests history</h1>
42
                <h1>ILL requests history</h1>
42
                [% INCLUDE 'ill-list-table.inc' %]
43
                <div id="results" class="toptabs">
44
                    <ul>
45
                        <li>
46
                            <a href="#all">All</a>
47
                        </li>
48
                        [% illreq_tab_regex = '' %]
49
                        [% FOREACH illreq_tab IN illreq_tabs %]
50
                        <li>
51
                            <a href="#illreq_tab-[% loop.index %]">[% illreq_tab.name %]</a>
52
                        </li>
53
                        [% END %]
54
                    </ul>
55
                    <div id="all">
56
                        [% INCLUDE 'ill-list-table.inc' %]
57
                    </div>
58
                    [% FOREACH illreq_tab IN illreq_tabs %]
59
                    [% SET illreq_custom_tab_id = "-illreq_tab-" _ loop.index %]
60
                    <div id="illreq_tab-[% loop.index %]">
61
                        [% INCLUDE 'ill-list-table.inc' %]
62
                    </div>
63
                    [% END %]
43
            </main>
64
            </main>
44
        </div> <!-- .col-sm-10.col-sm-push-2 -->
65
        </div> <!-- .col-sm-10.col-sm-push-2 -->
45
66
Lines 61-66 Link Here
61
            // Set column settings
82
            // Set column settings
62
            var columns_settings = [% TablesSettings.GetColumns( 'illrequests', 'ill-requests', 'ill-requests', 'json' ) %];
83
            var columns_settings = [% TablesSettings.GetColumns( 'illrequests', 'ill-requests', 'ill-requests', 'json' ) %];
63
        </script>
84
        </script>
85
        <script>
86
            var illreq_tabs = [% IF illreq_tabs %][% illreq_tabs.json %][% ELSE %][][% END %];
87
            $(document).ready(function() {
88
                $('#results').tabs();
89
            });
90
        </script>
64
        [% INCLUDE 'ill-list-table-strings.inc' %]
91
        [% INCLUDE 'ill-list-table-strings.inc' %]
65
        [% Asset.js("js/ill-list-table.js") | $raw %]
92
        [% Asset.js("js/ill-list-table.js") | $raw %]
66
    [% END %]
93
    [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js (-2 / +24 lines)
Lines 176-181 $(document).ready(function() { Link Here
176
    };
176
    };
177
    //END Expand
177
    //END Expand
178
178
179
    var spliceTabData = function(tab_data, tab_i) {
180
        for (var j=0; tab_i>=0 && j<tab_data.length; j++) {
181
            if (!illreq_tabs[tab_i].status.includes(tab_data[j].status)) {
182
                tab_data.splice(j, 1);
183
                j--;
184
            }
185
        }
186
        return tab_data;
187
    };
188
179
    // Strip the expand prefix if it exists, we do this for display
189
    // Strip the expand prefix if it exists, we do this for display
180
    var stripPrefix = function(value) {
190
    var stripPrefix = function(value) {
181
        expand.forEach(function(thisExpand) {
191
        expand.forEach(function(thisExpand) {
Lines 446-453 $(document).ready(function() { Link Here
446
                colData.push(colObj);
456
                colData.push(colObj);
447
            });
457
            });
448
458
459
460
            var tab_data_copy = $.extend(true, [], dataCopy);
461
            for (var i=-1; i<illreq_tabs.length; i++) { // i=-1 is tab "All"
462
                var illreq_tab_id;
463
                if (i===-1) {
464
                    illreq_tab_id = "ill-requests";
465
                } else {
466
                    illreq_tab_id = "ill-requests-illreq_tab-"+i;
467
                }
468
                var tab_data = spliceTabData($.extend(true, [], tab_data_copy), i);
469
449
            // Initialise the datatable
470
            // Initialise the datatable
450
            table = KohaTable("ill-requests", {
471
            table = KohaTable(illreq_tab_id, {
451
                'aoColumnDefs': [
472
                'aoColumnDefs': [
452
                    { // Last column shouldn't be sortable or searchable
473
                    { // Last column shouldn't be sortable or searchable
453
                        'aTargets': [ 'actions' ],
474
                        'aTargets': [ 'actions' ],
Lines 474-480 $(document).ready(function() { Link Here
474
                'processing': true, // Display a message when manipulating
495
                'processing': true, // Display a message when manipulating
475
                'sPaginationType': "full_numbers", // Pagination display
496
                'sPaginationType': "full_numbers", // Pagination display
476
                'deferRender': true, // Improve performance on big datasets
497
                'deferRender': true, // Improve performance on big datasets
477
                'data': dataCopy,
498
                'data': tab_data,
478
                "dom": '<"top pager"<"table_entries"ilp><"table_controls"B>>tr<"bottom pager"ip>',
499
                "dom": '<"top pager"<"table_entries"ilp><"table_controls"B>>tr<"bottom pager"ip>',
479
                'columns': colData,
500
                'columns': colData,
480
                'originalData': data, // Enable render functions to access
501
                'originalData': data, // Enable render functions to access
Lines 495-500 $(document).ready(function() { Link Here
495
516
496
                }
517
                }
497
            }, columns_settings);
518
            }, columns_settings);
519
            }
498
520
499
            // Custom date range filtering
521
            // Custom date range filtering
500
            $.fn.dataTable.ext.search.push(function(settings, data, dataIndex) {
522
            $.fn.dataTable.ext.search.push(function(settings, data, dataIndex) {
(-)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