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

(-)a/admin/columns_settings.yml (-60 lines)
Lines 1313-1333 modules: Link Here
1313
    moremember:
1313
    moremember:
1314
      issues-table:
1314
      issues-table:
1315
        columns:
1315
        columns:
1316
            -
1317
              columnname: sort_order
1318
              cannot_be_toggled: 1
1319
              cannot_be_modified: 1
1320
              is_hidden: 1
1321
            -
1322
              columnname: todays_or_previous_checkouts
1323
              cannot_be_toggled: 1
1324
              cannot_be_modified: 1
1325
              is_hidden: 1
1326
            -
1327
              columnname: due_date_unformatted
1328
              cannot_be_toggled: 1
1329
              cannot_be_modified: 1
1330
              is_hidden: 1
1331
            -
1316
            -
1332
              columnname: due_date
1317
              columnname: due_date
1333
            -
1318
            -
Lines 1342-1352 modules: Link Here
1342
              columnname: location
1327
              columnname: location
1343
            -
1328
            -
1344
              columnname: homebranch
1329
              columnname: homebranch
1345
            -
1346
              columnname: checkout_on_unformatted
1347
              cannot_be_toggled: 1
1348
              cannot_be_modified: 1
1349
              is_hidden: 1
1350
            -
1330
            -
1351
              columnname: checkout_on
1331
              columnname: checkout_on
1352
            -
1332
            -
Lines 1431-1441 modules: Link Here
1431
1411
1432
      relatives-issues-table:
1412
      relatives-issues-table:
1433
        columns:
1413
        columns:
1434
            -
1435
              columnname: due_date_unformatted
1436
              cannot_be_toggled: 1
1437
              cannot_be_modified: 1
1438
              is_hidden: 1
1439
            -
1414
            -
1440
              columnname: due_date
1415
              columnname: due_date
1441
            -
1416
            -
Lines 1448-1458 modules: Link Here
1448
              columnname: collection
1423
              columnname: collection
1449
            -
1424
            -
1450
              columnname: location
1425
              columnname: location
1451
            -
1452
              columnname: checkout_on_unformatted
1453
              cannot_be_toggled: 1
1454
              cannot_be_modified: 1
1455
              is_hidden: 1
1456
            -
1426
            -
1457
              columnname: checkout_on
1427
              columnname: checkout_on
1458
            -
1428
            -
Lines 1687-1707 modules: Link Here
1687
    circulation:
1657
    circulation:
1688
      issues-table:
1658
      issues-table:
1689
        columns:
1659
        columns:
1690
            -
1691
              columnname: sort_order
1692
              cannot_be_toggled: 1
1693
              cannot_be_modified: 1
1694
              is_hidden: 1
1695
            -
1696
              columnname: todays_or_previous_checkouts
1697
              cannot_be_toggled: 1
1698
              cannot_be_modified: 1
1699
              is_hidden: 1
1700
            -
1701
              columnname: due_date_unformatted
1702
              cannot_be_toggled: 1
1703
              cannot_be_modified: 1
1704
              is_hidden: 1
1705
            -
1660
            -
1706
              columnname: due_date
1661
              columnname: due_date
1707
            -
1662
            -
Lines 1716-1726 modules: Link Here
1716
              columnname: location
1671
              columnname: location
1717
            -
1672
            -
1718
              columnname: homebranch
1673
              columnname: homebranch
1719
            -
1720
              columnname: checkout_on_unformatted
1721
              cannot_be_toggled: 1
1722
              cannot_be_modified: 1
1723
              is_hidden: 1
1724
            -
1674
            -
1725
              columnname: checkout_on
1675
              columnname: checkout_on
1726
            -
1676
            -
Lines 1750-1760 modules: Link Here
1750
1700
1751
      relatives-issues-table:
1701
      relatives-issues-table:
1752
        columns:
1702
        columns:
1753
            -
1754
              columnname: due_date_unformatted
1755
              cannot_be_toggled: 1
1756
              cannot_be_modified: 1
1757
              is_hidden: 1
1758
            -
1703
            -
1759
              columnname: due_date
1704
              columnname: due_date
1760
            -
1705
            -
Lines 1767-1777 modules: Link Here
1767
              columnname: collection
1712
              columnname: collection
1768
            -
1713
            -
1769
              columnname: location
1714
              columnname: location
1770
            -
1771
              columnname: checkout_on_unformatted
1772
              cannot_be_toggled: 1
1773
              cannot_be_modified: 1
1774
              is_hidden: 1
1775
            -
1715
            -
1776
              columnname: checkout_on
1716
              columnname: checkout_on
1777
            -
1717
            -
(-)a/installer/data/mysql/atomicupdate/bug-15219.pl (+15 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "15219",
5
    description => "Add syspref ServerSideCheckoutsTables",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
10
        $dbh->do(q{
11
            INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type)
12
            VALUES ('ServerSideCheckoutsTables','0',NULL,'If enabled, use the "server-side processing" feature for checkouts tables. Can improve performance when there is a big number of checkouts to display.','YesNo')
13
        });
14
    },
15
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 / +2 lines)
Lines 738-743 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
738
('SerialsDefaultEmailAddress', '', NULL, 'Default email address used as reply-to for notices sent by the serials module.', 'Free'),
738
('SerialsDefaultEmailAddress', '', NULL, 'Default email address used as reply-to for notices sent by the serials module.', 'Free'),
739
('SerialsDefaultReplyTo', '', NULL, 'Default email address that serials notices are sent from.', 'Free'),
739
('SerialsDefaultReplyTo', '', NULL, 'Default email address that serials notices are sent from.', 'Free'),
740
('SerialsSearchResultsLimit', '', NULL, 'Serials search results limit', 'integer'),
740
('SerialsSearchResultsLimit', '', NULL, 'Serials search results limit', 'integer'),
741
('ServerSideCheckoutsTables','0',NULL,'If enabled, use the "server-side processing" feature for checkouts tables. Can improve performance when there is a big number of checkouts per patron.','YesNo'),
741
('SessionRestrictionByIP','1','Check for change in remote IP address for session security. Disable only when remote IP address changes frequently.','','YesNo'),
742
('SessionRestrictionByIP','1','Check for change in remote IP address for session security. Disable only when remote IP address changes frequently.','','YesNo'),
742
('SessionStorage','mysql','mysql|Pg|tmp','Use database or a temporary file for storing session data','Choice'),
743
('SessionStorage','mysql','mysql|Pg|tmp','Use database or a temporary file for storing session data','Choice'),
743
('ShelfBrowserUsesCcode','1','0','Use the item collection code when finding items for the shelf browser.','YesNo'),
744
('ShelfBrowserUsesCcode','1','0','Use the item collection code when finding items for the shelf browser.','YesNo'),
Lines 889-892 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
889
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
890
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
890
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'),
891
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'),
891
('z3950Status','','','This syspref allows to define custom YAML based rules for marking items unavailable in z3950 results.','Textarea')
892
('z3950Status','','','This syspref allows to define custom YAML based rules for marking items unavailable in z3950 results.','Textarea')
892
;
893
;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc (-7 / +2 lines)
Lines 1-15 Link Here
1
<tfoot>
1
<tfoot>
2
    <tr>
2
    <tr>
3
        <td colspan="15" style="text-align: right; font-weight:bold;">Totals:</td>
3
        <td colspan="11" style="text-align: right; font-weight:bold;">Totals:</td>
4
        <td id="totaldue" style="text-align: right;"></td>
4
        <td id="totaldue" style="text-align: right;"></td>
5
        <td id="totalfine" style="text-align: right;"></td>
5
        <td id="totalfine" style="text-align: right;"></td>
6
        <td id="totalprice" style="text-align: right;"></td>
6
        <td id="totalprice" style="text-align: right;"></td>
7
        [% IF Koha.Preference('ExportCircHistory') %]
7
        <td colspan="4">
8
            [% SET td_colspan = 4 %]
9
        [% ELSE %]
10
            [% SET td_colspan = 3 %]
11
        [% END %]
12
        <td colspan="[% td_colspan | html %]">
13
            <div class="date-select">
8
            <div class="date-select">
14
                <p><label for="newduedate">Renewal due date:</label> <input type="text" size="20" id="newduedate" name="newduedate" value="" class="flatpickr" data-flatpickr-enable-time="true" /></p>
9
                <p><label for="newduedate">Renewal due date:</label> <input type="text" size="20" id="newduedate" name="newduedate" value="" class="flatpickr" data-flatpickr-enable-time="true" /></p>
15
                <p id="newonholdduedate"
10
                <p id="newonholdduedate"
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc (-7 / +3 lines)
Lines 20-28 Link Here
20
        <table id="issues-table" style="width: 100% !Important; display: none;">
20
        <table id="issues-table" style="width: 100% !Important; display: none;">
21
            <thead>
21
            <thead>
22
                <tr>
22
                <tr>
23
                    <th scope="col">&nbsp;</th>
24
                    <th scope="col">&nbsp;</th>
25
                    <th scope="col">Due date</th>
26
                    <th scope="col">Due date</th>
23
                    <th scope="col">Due date</th>
27
                    <th scope="col">Title</th>
24
                    <th scope="col">Title</th>
28
                    <th scope="col">Record-level item type</th>
25
                    <th scope="col">Record-level item type</th>
Lines 30-36 Link Here
30
                    <th scope="col">Collection</th>
27
                    <th scope="col">Collection</th>
31
                    <th scope="col">Location</th>
28
                    <th scope="col">Location</th>
32
                    <th scope="col">Home library</th>
29
                    <th scope="col">Home library</th>
33
                    <th scope="col">&nbsp;</th>
34
                    <th scope="col">Checked out on</th>
30
                    <th scope="col">Checked out on</th>
35
                    <th scope="col">Checked out from</th>
31
                    <th scope="col">Checked out from</th>
36
                    <th scope="col">Call number</th>
32
                    <th scope="col">Call number</th>
Lines 39-52 Link Here
39
                    <th scope="col">Fine</th>
35
                    <th scope="col">Fine</th>
40
                    <th scope="col">Price</th>
36
                    <th scope="col">Price</th>
41
                    <th scope="col"
37
                    <th scope="col"
42
                        >Renew <p class="column-tool"><a href="#" id="CheckAllRenewals">select all</a> | <a href="#" id="UncheckAllRenewals">none</a></p></th
38
                        >Renew <p class="column-tool"><a href="#" id="CheckAllRenewals">select all visible rows</a> | <a href="#" id="UncheckAllRenewals">none</a></p></th
43
                    >
39
                    >
44
                    <th scope="col"
40
                    <th scope="col"
45
                        >Check in <p class="column-tool"><a href="#" id="CheckAllCheckins">select all</a> | <a href="#" id="UncheckAllCheckins">none</a></p></th
41
                        >Check in <p class="column-tool"><a href="#" id="CheckAllCheckins">select all visible rows</a> | <a href="#" id="UncheckAllCheckins">none</a></p></th
46
                    >
42
                    >
47
                    <th scope="col">Return claims</th>
43
                    <th scope="col">Return claims</th>
48
                    <th scope="col"
44
                    <th scope="col"
49
                        >Export <p class="column-tool"><a href="#" id="CheckAllExports">select all</a> | <a href="#" id="UncheckAllExports">none</a></p></th
45
                        >Export <p class="column-tool"><a href="#" id="CheckAllExports">select all visible rows</a> | <a href="#" id="UncheckAllExports">none</a></p></th
50
                    >
46
                    >
51
                </tr>
47
                </tr>
52
            </thead>
48
            </thead>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/relatives-issues-table.inc (-2 lines)
Lines 3-16 Link Here
3
    <table id="relatives-issues-table" style="width: 100% !Important;">
3
    <table id="relatives-issues-table" style="width: 100% !Important;">
4
        <thead>
4
        <thead>
5
            <tr>
5
            <tr>
6
                <th scope="col">Due date (unformatted, hidden)</th>
7
                <th scope="col">Due date</th>
6
                <th scope="col">Due date</th>
8
                <th scope="col">Title</th>
7
                <th scope="col">Title</th>
9
                <th scope="col">Record-level item type</th>
8
                <th scope="col">Record-level item type</th>
10
                <th scope="col">Item type</th>
9
                <th scope="col">Item type</th>
11
                <th scope="col">Collection</th>
10
                <th scope="col">Collection</th>
12
                <th scope="col">Location</th>
11
                <th scope="col">Location</th>
13
                <th scope="col">Checked out on (hidden, unformatted)</th>
14
                <th scope="col">Checked out on</th>
12
                <th scope="col">Checked out on</th>
15
                <th scope="col">Checked out from</th>
13
                <th scope="col">Checked out from</th>
16
                <th scope="col">Call number</th>
14
                <th scope="col">Call number</th>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+6 lines)
Lines 57-62 Circulation: Link Here
57
                  asc: earliest to latest
57
                  asc: earliest to latest
58
                  desc: latest to earliest
58
                  desc: latest to earliest
59
            - checkout time.
59
            - checkout time.
60
        -
61
            - pref: ServerSideCheckoutsTables
62
              choices:
63
                  1: Enable
64
                  0: Do not enable
65
            - server-side processing on checkouts tables. It can improve performance when there is a big number of checkouts to display.
60
        -
66
        -
61
            - pref: SpecifyDueDate
67
            - pref: SpecifyDueDate
62
              choices:
68
              choices:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (+1 lines)
Lines 1107-1112 Link Here
1107
            relatives_borrowernumbers.push("[% b | html %]");
1107
            relatives_borrowernumbers.push("[% b | html %]");
1108
        [% END %]
1108
        [% END %]
1109
        var SuspendHoldsIntranet = [% ( Koha.Preference('SuspendHoldsIntranet') ) ? 1 : 0 | html %];
1109
        var SuspendHoldsIntranet = [% ( Koha.Preference('SuspendHoldsIntranet') ) ? 1 : 0 | html %];
1110
        var ServerSideCheckoutsTables = [% Koha.Preference('ServerSideCheckoutsTables') ? 'true' : 'false' | $raw %];
1110
    </script>
1111
    </script>
1111
    [% Asset.js("js/pages/circulation.js") | $raw %]
1112
    [% Asset.js("js/pages/circulation.js") | $raw %]
1112
    [% IF Koha.Preference('ClaimReturnedLostValue') || Koha.Preference('BundleLostValue') %]
1113
    [% IF Koha.Preference('ClaimReturnedLostValue') || Koha.Preference('BundleLostValue') %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (+1 lines)
Lines 783-788 Link Here
783
            relatives_borrowernumbers.push("[% b | html %]");
783
            relatives_borrowernumbers.push("[% b | html %]");
784
        [% END %]
784
        [% END %]
785
        var SuspendHoldsIntranet = [% ( Koha.Preference('SuspendHoldsIntranet') ) ? 1 : 0 | html %];
785
        var SuspendHoldsIntranet = [% ( Koha.Preference('SuspendHoldsIntranet') ) ? 1 : 0 | html %];
786
        var ServerSideCheckoutsTables = [% Koha.Preference('ServerSideCheckoutsTables') ? 'true' : 'false' | $raw %];
786
    </script>
787
    </script>
787
    [% Asset.js("js/pages/circulation.js") | $raw %]
788
    [% Asset.js("js/pages/circulation.js") | $raw %]
788
    [% IF Koha.Preference('ClaimReturnedLostValue') || Koha.Preference('BundleLostValue') %]
789
    [% IF Koha.Preference('ClaimReturnedLostValue') || Koha.Preference('BundleLostValue') %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js (-85 / +122 lines)
Lines 1-4 Link Here
1
/* global __ */
1
/* global __, ServerSideCheckoutsTables: false */
2
2
3
function CheckRenewCheckinBoxes() {
3
function CheckRenewCheckinBoxes() {
4
    $("#RenewChecked").prop("disabled", !$(".renew:checked").length);
4
    $("#RenewChecked").prop("disabled", !$(".renew:checked").length);
Lines 61-97 function LoadIssuesTable() { Link Here
61
                processing: msg_loading,
61
                processing: msg_loading,
62
            },
62
            },
63
            autoWidth: false,
63
            autoWidth: false,
64
            dom: '<"table_controls"B>rt',
64
            order: [],
65
            columns: [
65
            columns: [
66
                {
67
                    data: function (oObj) {
68
                        return oObj.sort_order;
69
                    },
70
                },
71
                {
72
                    data: function (oObj) {
73
                        if (oObj.issued_today) {
74
                            return (
75
                                "<strong>" +
76
                                __("Today's checkouts") +
77
                                "</strong>"
78
                            );
79
                        } else {
80
                            return (
81
                                "<strong>" +
82
                                __("Previous checkouts") +
83
                                "</strong>"
84
                            );
85
                        }
86
                    },
87
                },
88
                {
66
                {
89
                    data: "date_due",
67
                    data: "date_due",
90
                    visible: false,
68
                    render: function (data, type, oObj) {
91
                },
92
                {
93
                    orderData: 2, // Sort on hidden unformatted date due column
94
                    data: function (oObj) {
95
                        let date_due_formatted = $datetime(oObj.date_due, {
69
                        let date_due_formatted = $datetime(oObj.date_due, {
96
                            as_due_date: true,
70
                            as_due_date: true,
97
                            no_tz_adjust: true,
71
                            no_tz_adjust: true,
Lines 142-148 function LoadIssuesTable() { Link Here
142
                    },
116
                    },
143
                },
117
                },
144
                {
118
                {
145
                    data: function (oObj) {
119
                    data: "title",
120
                    render: function (data, type, oObj) {
146
                        let title =
121
                        let title =
147
                            "<span id='title_" +
122
                            "<span id='title_" +
148
                            oObj.itemnumber +
123
                            oObj.itemnumber +
Lines 247-275 function LoadIssuesTable() { Link Here
247
                    type: "anti-the",
222
                    type: "anti-the",
248
                },
223
                },
249
                {
224
                {
250
                    data: function (oObj) {
225
                    data: "recordtype",
226
                    render: function (data, type, oObj) {
251
                        return oObj.recordtype_description.escapeHtml();
227
                        return oObj.recordtype_description.escapeHtml();
252
                    },
228
                    },
253
                },
229
                },
254
                {
230
                {
255
                    data: function (oObj) {
231
                    data: "itemtype",
232
                    render: function (data, type, oObj) {
256
                        return oObj.itemtype_description.escapeHtml();
233
                        return oObj.itemtype_description.escapeHtml();
257
                    },
234
                    },
258
                },
235
                },
259
                {
236
                {
260
                    data: function (oObj) {
237
                    data: "collection",
238
                    render: function (data, type, oObj) {
261
                        return oObj.collection
239
                        return oObj.collection
262
                            ? oObj.collection.escapeHtml()
240
                            ? oObj.collection.escapeHtml()
263
                            : "";
241
                            : "";
264
                    },
242
                    },
265
                },
243
                },
266
                {
244
                {
267
                    data: function (oObj) {
245
                    data: "location",
246
                    render: function (data, type, oObj) {
268
                        return oObj.location ? oObj.location.escapeHtml() : "";
247
                        return oObj.location ? oObj.location.escapeHtml() : "";
269
                    },
248
                    },
270
                },
249
                },
271
                {
250
                {
272
                    data: function (oObj) {
251
                    data: "homebranch",
252
                    render: function (data, type, oObj) {
273
                        return oObj.homebranch
253
                        return oObj.homebranch
274
                            ? oObj.homebranch.escapeHtml()
254
                            ? oObj.homebranch.escapeHtml()
275
                            : "";
255
                            : "";
Lines 277-315 function LoadIssuesTable() { Link Here
277
                },
257
                },
278
                {
258
                {
279
                    data: "issuedate",
259
                    data: "issuedate",
280
                    visible: false,
260
                    render: function (data, type, oObj) {
281
                },
282
                {
283
                    orderData: 10, // Sort on hidden unformatted issuedate column
284
                    data: function (oObj) {
285
                        return $datetime(oObj.issuedate, {
261
                        return $datetime(oObj.issuedate, {
286
                            no_tz_adjust: true,
262
                            no_tz_adjust: true,
287
                        });
263
                        });
288
                    },
264
                    },
289
                },
265
                },
290
                {
266
                {
291
                    data: function (oObj) {
267
                    data: "branchcode",
268
                    render: function (data, type, oObj) {
292
                        return oObj.branchname
269
                        return oObj.branchname
293
                            ? oObj.branchname.escapeHtml()
270
                            ? oObj.branchname.escapeHtml()
294
                            : "";
271
                            : "";
295
                    },
272
                    },
296
                },
273
                },
297
                {
274
                {
298
                    data: function (oObj) {
275
                    data: "itemcallnumber",
276
                    render: function (data, type, oObj) {
299
                        return oObj.itemcallnumber
277
                        return oObj.itemcallnumber
300
                            ? oObj.itemcallnumber.escapeHtml()
278
                            ? oObj.itemcallnumber.escapeHtml()
301
                            : "";
279
                            : "";
302
                    },
280
                    },
303
                },
281
                },
304
                {
282
                {
305
                    data: function (oObj) {
283
                    data: "copynumber",
284
                    render: function (data, type, oObj) {
306
                        return oObj.copynumber
285
                        return oObj.copynumber
307
                            ? oObj.copynumber.escapeHtml()
286
                            ? oObj.copynumber.escapeHtml()
308
                            : "";
287
                            : "";
309
                    },
288
                    },
310
                },
289
                },
311
                {
290
                {
312
                    data: function (oObj) {
291
                    data: "charge",
292
                    render: function (data, type, oObj) {
313
                        if (!oObj.charge) oObj.charge = 0;
293
                        if (!oObj.charge) oObj.charge = 0;
314
                        return (
294
                        return (
315
                            '<span style="text-align: right; display: block;">' +
295
                            '<span style="text-align: right; display: block;">' +
Lines 320-326 function LoadIssuesTable() { Link Here
320
                    className: "nowrap",
300
                    className: "nowrap",
321
                },
301
                },
322
                {
302
                {
323
                    data: function (oObj) {
303
                    data: "fine",
304
                    render: function (data, type, oObj) {
324
                        if (!oObj.fine) oObj.fine = 0;
305
                        if (!oObj.fine) oObj.fine = 0;
325
                        return (
306
                        return (
326
                            '<span style="text-align: right; display: block;">' +
307
                            '<span style="text-align: right; display: block;">' +
Lines 331-337 function LoadIssuesTable() { Link Here
331
                    className: "nowrap",
312
                    className: "nowrap",
332
                },
313
                },
333
                {
314
                {
334
                    data: function (oObj) {
315
                    data: "price",
316
                    render: function (data, type, oObj) {
335
                        if (!oObj.price) oObj.price = 0;
317
                        if (!oObj.price) oObj.price = 0;
336
                        return (
318
                        return (
337
                            '<span style="text-align: right; display: block;">' +
319
                            '<span style="text-align: right; display: block;">' +
Lines 343-349 function LoadIssuesTable() { Link Here
343
                },
325
                },
344
                {
326
                {
345
                    orderable: false,
327
                    orderable: false,
346
                    data: function (oObj) {
328
                    render: function (data, type, oObj) {
347
                        var content = "";
329
                        var content = "";
348
                        var msg = "";
330
                        var msg = "";
349
                        var span_style = "";
331
                        var span_style = "";
Lines 555-561 function LoadIssuesTable() { Link Here
555
                },
537
                },
556
                {
538
                {
557
                    orderable: false,
539
                    orderable: false,
558
                    data: function (oObj) {
540
                    render: function (data, type, oObj) {
559
                        if (oObj.can_renew_error == "recalled") {
541
                        if (oObj.can_renew_error == "recalled") {
560
                            return (
542
                            return (
561
                                "<a href='/cgi-bin/koha/recalls/request.pl?biblionumber=" +
543
                                "<a href='/cgi-bin/koha/recalls/request.pl?biblionumber=" +
Lines 589-595 function LoadIssuesTable() { Link Here
589
                },
571
                },
590
                {
572
                {
591
                    orderable: false,
573
                    orderable: false,
592
                    data: function (oObj) {
574
                    render: function (data, type, oObj) {
593
                        let content = "";
575
                        let content = "";
594
576
595
                        if (oObj.return_claim_id) {
577
                        if (oObj.return_claim_id) {
Lines 615-621 function LoadIssuesTable() { Link Here
615
                },
597
                },
616
                {
598
                {
617
                    orderable: false,
599
                    orderable: false,
618
                    data: function (oObj) {
600
                    render: function (data, type, oObj) {
619
                        var s =
601
                        var s =
620
                            "<input type='checkbox' name='itemnumbers' value='" +
602
                            "<input type='checkbox' name='itemnumbers' value='" +
621
                            oObj.itemnumber +
603
                            oObj.itemnumber +
Lines 644-656 function LoadIssuesTable() { Link Here
644
                $("#totalfine").html(total_fine.format_price());
626
                $("#totalfine").html(total_fine.format_price());
645
                $("#totalprice").html(total_price.format_price());
627
                $("#totalprice").html(total_price.format_price());
646
            },
628
            },
647
            paging: false,
629
            paging: ServerSideCheckoutsTables,
648
            processing: true,
630
            processing: true,
649
            serverSide: false,
631
            serverSide: ServerSideCheckoutsTables,
650
            ajax: {
632
            ajax: {
651
                url: "/cgi-bin/koha/svc/checkouts?borrowernumber=%s".format(
633
                url: "/cgi-bin/koha/svc/checkouts",
652
                    borrowernumber
634
                data(data) {
653
                ),
635
                    return Object.assign({}, data, {
636
                        borrowernumber,
637
                        date_due_sorton: "issues.date_due",
638
                        title_sorton: "biblio.title",
639
                        recordtype_sorton: "biblioitems.itemtype",
640
                        itemtype_sorton: "items.itype",
641
                        collection_sorton: "items.ccode",
642
                        location_sorton: "items.location",
643
                        homebranch_sorton: "items.homebranch",
644
                        issuedate_sorton: "issues.issuedate",
645
                        branchcode_sorton: "issues.branchcode",
646
                        itemcallnumber_sorton: "items.itemcallnumber",
647
                        copynumber_sorton: "items.copynumber",
648
                    });
649
                },
654
            },
650
            },
655
            bKohaAjaxSVC: true,
651
            bKohaAjaxSVC: true,
656
            rowGroup: {
652
            rowGroup: {
Lines 667-673 function LoadIssuesTable() { Link Here
667
                CheckRenewCheckinBoxes();
663
                CheckRenewCheckinBoxes();
668
664
669
                // Build a summary of checkouts grouped by itemtype
665
                // Build a summary of checkouts grouped by itemtype
670
                var checkoutsByItype = json.aaData.reduce(function (obj, row) {
666
                var checkoutsByItype = json.data.reduce(function (obj, row) {
671
                    obj[row.type_for_stat] = (obj[row.type_for_stat] || 0) + 1;
667
                    obj[row.type_for_stat] = (obj[row.type_for_stat] || 0) + 1;
672
                    return obj;
668
                    return obj;
673
                }, {});
669
                }, {});
Lines 696-701 function LoadIssuesTable() { Link Here
696
        table_settings_issues_table
692
        table_settings_issues_table
697
    );
693
    );
698
694
695
    var groupingSwitch = $('<input type="checkbox">')
696
        .attr("id", "issues-table-row-grouping-switch")
697
        .attr("checked", "checked")
698
        .css("vertical-align", "middle")
699
        .change(function () {
700
            if (this.checked) {
701
                issuesTable.api().rowGroup().enable();
702
                issuesTable.api().draw();
703
            } else {
704
                issuesTable.api().rowGroup().disable();
705
                issuesTable.api().draw();
706
            }
707
        });
708
    $("<div></div>")
709
        .css("float", "left")
710
        .css("padding", "0.3em 0.5em")
711
        .css("line-height", "1.9em")
712
        .append(groupingSwitch)
713
        .append("&nbsp;")
714
        .append(
715
            '<label for="issues-table-row-grouping-switch">' +
716
                __("Group today's checkouts") +
717
                "</label>"
718
        )
719
        .appendTo("#issues-table_wrapper .top.pager");
720
699
    if ($("#issues-table").length) {
721
    if ($("#issues-table").length) {
700
        $("#issues-table_processing").position({
722
        $("#issues-table_processing").position({
701
            of: $("#issues-table"),
723
            of: $("#issues-table"),
Lines 1091-1106 $(document).ready(function () { Link Here
1091
            relativesIssuesTable = $("#relatives-issues-table").kohaTable(
1113
            relativesIssuesTable = $("#relatives-issues-table").kohaTable(
1092
                {
1114
                {
1093
                    autoWidth: false,
1115
                    autoWidth: false,
1094
                    dom: '<"table_controls"B>rt',
1095
                    order: [],
1116
                    order: [],
1096
                    columns: [
1117
                    columns: [
1097
                        {
1118
                        {
1098
                            data: "date_due",
1119
                            data: "date_due",
1099
                            visible: false,
1120
                            render: function (data, type, oObj) {
1100
                        },
1101
                        {
1102
                            orderData: 0, // Sort on hidden unformatted date due column
1103
                            data: function (oObj) {
1104
                                var today = new Date();
1121
                                var today = new Date();
1105
                                var due = new Date(oObj.date_due);
1122
                                var due = new Date(oObj.date_due);
1106
                                let date_due_formatted = $datetime(
1123
                                let date_due_formatted = $datetime(
Lines 1119-1125 $(document).ready(function () { Link Here
1119
                            },
1136
                            },
1120
                        },
1137
                        },
1121
                        {
1138
                        {
1122
                            data: function (oObj) {
1139
                            data: "title",
1140
                            render: function (data, type, oObj) {
1123
                                let title =
1141
                                let title =
1124
                                    "<span class='strong'><a href='/cgi-bin/koha/catalogue/detail.pl?biblionumber=" +
1142
                                    "<span class='strong'><a href='/cgi-bin/koha/catalogue/detail.pl?biblionumber=" +
1125
                                    oObj.biblionumber +
1143
                                    oObj.biblionumber +
Lines 1218-1241 $(document).ready(function () { Link Here
1218
                            type: "anti-the",
1236
                            type: "anti-the",
1219
                        },
1237
                        },
1220
                        {
1238
                        {
1221
                            data: function (oObj) {
1239
                            data: "recordtype",
1240
                            render: function (data, type, oObj) {
1222
                                return oObj.recordtype_description.escapeHtml();
1241
                                return oObj.recordtype_description.escapeHtml();
1223
                            },
1242
                            },
1224
                        },
1243
                        },
1225
                        {
1244
                        {
1226
                            data: function (oObj) {
1245
                            data: "itemtype",
1246
                            render: function (data, type, oObj) {
1227
                                return oObj.itemtype_description.escapeHtml();
1247
                                return oObj.itemtype_description.escapeHtml();
1228
                            },
1248
                            },
1229
                        },
1249
                        },
1230
                        {
1250
                        {
1231
                            data: function (oObj) {
1251
                            data: "collection",
1252
                            render: function (data, type, oObj) {
1232
                                return oObj.collection
1253
                                return oObj.collection
1233
                                    ? oObj.collection.escapeHtml()
1254
                                    ? oObj.collection.escapeHtml()
1234
                                    : "";
1255
                                    : "";
1235
                            },
1256
                            },
1236
                        },
1257
                        },
1237
                        {
1258
                        {
1238
                            data: function (oObj) {
1259
                            data: "location",
1260
                            render: function (data, type, oObj) {
1239
                                return oObj.location
1261
                                return oObj.location
1240
                                    ? oObj.location.escapeHtml()
1262
                                    ? oObj.location.escapeHtml()
1241
                                    : "";
1263
                                    : "";
Lines 1243-1298 $(document).ready(function () { Link Here
1243
                        },
1265
                        },
1244
                        {
1266
                        {
1245
                            data: "issuedate",
1267
                            data: "issuedate",
1246
                            visible: false,
1268
                            render: function (data, type, oObj) {
1247
                        },
1248
                        {
1249
                            orderData: 7, // Sort on hidden unformatted issuedate column
1250
                            data: function (oObj) {
1251
                                return $datetime(oObj.issuedate, {
1269
                                return $datetime(oObj.issuedate, {
1252
                                    no_tz_adjust: true,
1270
                                    no_tz_adjust: true,
1253
                                });
1271
                                });
1254
                            },
1272
                            },
1255
                        },
1273
                        },
1256
                        {
1274
                        {
1257
                            data: function (oObj) {
1275
                            data: "branchcode",
1276
                            render: function (data, type, oObj) {
1258
                                return oObj.branchname
1277
                                return oObj.branchname
1259
                                    ? oObj.branchname.escapeHtml()
1278
                                    ? oObj.branchname.escapeHtml()
1260
                                    : "";
1279
                                    : "";
1261
                            },
1280
                            },
1262
                        },
1281
                        },
1263
                        {
1282
                        {
1264
                            data: function (oObj) {
1283
                            data: "itemcallnumber",
1284
                            render: function (data, type, oObj) {
1265
                                return oObj.itemcallnumber
1285
                                return oObj.itemcallnumber
1266
                                    ? oObj.itemcallnumber.escapeHtml()
1286
                                    ? oObj.itemcallnumber.escapeHtml()
1267
                                    : "";
1287
                                    : "";
1268
                            },
1288
                            },
1269
                        },
1289
                        },
1270
                        {
1290
                        {
1271
                            data: function (oObj) {
1291
                            data: "copynumber",
1292
                            render: function (data, type, oObj) {
1272
                                return oObj.copynumber
1293
                                return oObj.copynumber
1273
                                    ? oObj.copynumber.escapeHtml()
1294
                                    ? oObj.copynumber.escapeHtml()
1274
                                    : "";
1295
                                    : "";
1275
                            },
1296
                            },
1276
                        },
1297
                        },
1277
                        {
1298
                        {
1278
                            data: function (oObj) {
1299
                            data: "charge",
1300
                            render: function (data, type, oObj) {
1279
                                if (!oObj.charge) oObj.charge = 0;
1301
                                if (!oObj.charge) oObj.charge = 0;
1280
                                return parseFloat(oObj.charge).toFixed(2);
1302
                                return parseFloat(oObj.charge).toFixed(2);
1281
                            },
1303
                            },
1282
                        },
1304
                        },
1283
                        {
1305
                        {
1284
                            data: function (oObj) {
1306
                            data: "fine",
1307
                            render: function (data, type, oObj) {
1285
                                if (!oObj.fine) oObj.fine = 0;
1308
                                if (!oObj.fine) oObj.fine = 0;
1286
                                return parseFloat(oObj.fine).toFixed(2);
1309
                                return parseFloat(oObj.fine).toFixed(2);
1287
                            },
1310
                            },
1288
                        },
1311
                        },
1289
                        {
1312
                        {
1290
                            data: function (oObj) {
1313
                            data: "price",
1314
                            render: function (data, type, oObj) {
1291
                                if (!oObj.price) oObj.price = 0;
1315
                                if (!oObj.price) oObj.price = 0;
1292
                                return parseFloat(oObj.price).toFixed(2);
1316
                                return parseFloat(oObj.price).toFixed(2);
1293
                            },
1317
                            },
1294
                        },
1318
                        },
1295
                        {
1319
                        {
1320
                            orderable: false,
1296
                            data: function (oObj) {
1321
                            data: function (oObj) {
1297
                                return (
1322
                                return (
1298
                                    "<a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=" +
1323
                                    "<a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=" +
Lines 1314-1328 $(document).ready(function () { Link Here
1314
                            },
1339
                            },
1315
                        },
1340
                        },
1316
                    ],
1341
                    ],
1317
                    paging: false,
1342
                    paging: ServerSideCheckoutsTables,
1318
                    processing: true,
1343
                    processing: true,
1319
                    serverSide: false,
1344
                    serverSide: ServerSideCheckoutsTables,
1320
                    ajax: {
1345
                    ajax: {
1321
                        url: "/cgi-bin/koha/svc/checkouts?%s".format(
1346
                        url: "/cgi-bin/koha/svc/checkouts",
1322
                            relatives_borrowernumbers
1347
                        data(data) {
1323
                                .map(b => "borrowernumber=%s".format(b))
1348
                            return Object.assign({}, data, {
1324
                                .join("&")
1349
                                borrowernumber: relatives_borrowernumbers,
1325
                        ),
1350
                                date_due_sorton: "issues.date_due",
1351
                                title_sorton: "biblio.title",
1352
                                recordtype_sorton: "biblioitems.itemtype",
1353
                                itemtype_sorton: "items.itype",
1354
                                collection_sorton: "items.ccode",
1355
                                location_sorton: "items.location",
1356
                                homebranch_sorton: "items.homebranch",
1357
                                issuedate_sorton: "issues.issuedate",
1358
                                branchcode_sorton: "issues.branchcode",
1359
                                itemcallnumber_sorton: "items.itemcallnumber",
1360
                                copynumber_sorton: "items.copynumber",
1361
                            });
1362
                        },
1326
                    },
1363
                    },
1327
                    bKohaAjaxSVC: true,
1364
                    bKohaAjaxSVC: true,
1328
                },
1365
                },
(-)a/svc/checkouts (-51 / +88 lines)
Lines 48-73 unless ( haspermission( $userid, { circulate => 'circulate_remaining_permissions Link Here
48
    exit 0;
48
    exit 0;
49
}
49
}
50
50
51
my @sort_columns = qw/date_due title itype issuedate branchcode itemcallnumber/;
51
my $dbh = C4::Context->dbh();
52
52
53
my @borrowernumber   = $input->multi_param('borrowernumber');
53
my @borrowernumbers;
54
my $offset           = $input->param('iDisplayStart');
54
my $borrowernumber = $input->param('borrowernumber');
55
my $results_per_page = $input->param('iDisplayLength') || -1;
55
if ($borrowernumber) {
56
    push @borrowernumbers, $borrowernumber;
57
} else {
58
    @borrowernumbers = $input->multi_param('borrowernumber[]');
59
}
60
my $offset = $input->param('start');
61
my $count = $input->param('length');
56
62
57
my $sorting_column = $input->param('iSortCol_0') || q{};
63
my %vars = $input->Vars();
58
$sorting_column = ( $sorting_column && $sort_columns[$sorting_column] ) ? $sort_columns[$sorting_column] : 'issuedate';
64
my $i = 0;
65
my @orderbys;
66
while (exists $vars{"order[$i][column]"}) {
67
    my $iSortCol = $vars{"order[$i][column]"};
68
    my $sSortDir = $vars{"order[$i][dir]"};
69
    my $mDataProp = $vars{"columns[$iSortCol][data]"};
70
    my @sort_fields = $vars{$mDataProp.'_sorton'}
71
        ? split(' ', $vars{$mDataProp.'_sorton'})
72
        : ();
73
    if(@sort_fields > 0) {
74
        push @orderbys, "$_ $sSortDir" foreach (@sort_fields);
75
    } else {
76
        push @orderbys, "$mDataProp $sSortDir";
77
    }
78
    $i++;
79
}
80
@orderbys = grep { /^\w+\.\w+ (asc|desc)$/ } @orderbys;
81
my @sanitized_orderbys;
82
for my $orderby (@orderbys) {
83
    my ($identifier, $direction) = split / /, $orderby, 2;
84
    my ($table, $column) = split /\./, $identifier, 2;
85
    my $sanitized_identifier = $dbh->quote_identifier(undef, $table, $column);
86
    my $sanitized_direction = $direction eq 'asc' ? 'ASC' : 'DESC';
87
    push @sanitized_orderbys, "$sanitized_identifier $sanitized_direction";
88
}
89
my $orderby =  @sanitized_orderbys ? " ORDER BY " . join(',', @sanitized_orderbys) . " " : '';
59
90
60
my $sorting_direction = $input->param('sSortDir_0') || q{};
91
my $todaysIssuesDefaultSortOrder =
61
$sorting_direction = $sorting_direction eq 'asc' ? 'asc' : 'desc';
92
  C4::Context->preference('todaysIssuesDefaultSortOrder');
93
my $previousIssuesDefaultSortOrder =
94
  C4::Context->preference('previousIssuesDefaultSortOrder');
62
95
63
$results_per_page = undef if ( $results_per_page == -1 );
96
# Default sort when user hasn't clicked on a column header yet.
64
97
# When row grouping is enabled, DataTables ask to sort on issued_today column,
65
binmode STDOUT, ":encoding(UTF-8)";
98
# so we need to treat this case the same as the "no sorting" case
66
print $input->header( -type => 'application/json', -charset => 'UTF-8' );
99
if (!$orderby || $orderby =~ m/ORDER BY issued_today desc\s*$/) {
100
    $orderby = qq{
101
        ORDER BY
102
        issued_today DESC,
103
        CASE WHEN issued_today = 0 THEN date_due END $previousIssuesDefaultSortOrder,
104
        CASE WHEN issued_today != 0 THEN date_due END $todaysIssuesDefaultSortOrder
105
    };
106
}
67
107
68
my @parameters;
108
my @parameters;
69
my $sql = '
109
my $sql = '
70
    SELECT
110
    SELECT SQL_CALC_FOUND_ROWS
71
        issues.issue_id,
111
        issues.issue_id,
72
        issues.issuedate,
112
        issues.issuedate,
73
        issues.date_due,
113
        issues.date_due,
Lines 114-126 my $sql = ' Link Here
114
        items.enumchron,
154
        items.enumchron,
115
        items.materials,
155
        items.materials,
116
156
117
        DATEDIFF( issues.issuedate, CURRENT_DATE() ) AS not_issued_today,
157
        DATEDIFF( issues.issuedate, CURRENT_DATE() ) = 0 AS issued_today,
118
158
119
        return_claims.id AS return_claim_id,
159
        return_claims.id AS return_claim_id,
120
        return_claims.notes AS return_claim_notes,
160
        return_claims.notes AS return_claim_notes,
121
        return_claims.created_on AS return_claim_created_on,
161
        return_claims.created_on AS return_claim_created_on,
122
        return_claims.updated_on AS return_claim_updated_on
162
        return_claims.updated_on AS return_claim_updated_on
123
124
    FROM issues
163
    FROM issues
125
        LEFT JOIN items USING ( itemnumber )
164
        LEFT JOIN items USING ( itemnumber )
126
        LEFT JOIN biblio USING ( biblionumber )
165
        LEFT JOIN biblio USING ( biblionumber )
Lines 129-149 my $sql = ' Link Here
129
        LEFT JOIN branches ON ( issues.branchcode = branches.branchcode )
168
        LEFT JOIN branches ON ( issues.branchcode = branches.branchcode )
130
        LEFT JOIN branches branches2 ON ( items.homebranch = branches2.branchcode )
169
        LEFT JOIN branches branches2 ON ( items.homebranch = branches2.branchcode )
131
        LEFT JOIN return_claims USING ( issue_id )
170
        LEFT JOIN return_claims USING ( issue_id )
132
    WHERE issues.borrowernumber
171
    WHERE
133
';
172
';
134
173
135
if ( @borrowernumber == 1 ) {
174
my $borrowernumber_sql = 'issues.borrowernumber';
136
    $sql .= '= ?';
175
if ( @borrowernumbers == 1 ) {
176
    $borrowernumber_sql .= ' = ?';
137
} else {
177
} else {
138
    $sql .= ' IN (' . join( ',', ('?') x @borrowernumber ) . ') ';
178
    $borrowernumber_sql .= ' IN (' . join( ',', ('?') x @borrowernumbers ) . ') ';
139
}
179
}
140
push( @parameters, @borrowernumber );
180
$sql .= $borrowernumber_sql;
181
push( @parameters, @borrowernumbers );
141
182
142
$sql .= " ORDER BY $sorting_column $sorting_direction ";
183
$sql .= " $orderby";
184
185
if ($count && $count > 0) {
186
    $sql .= " LIMIT ?,?";
187
    push @parameters, $offset, $count;
188
}
143
189
144
my $dbh = C4::Context->dbh();
145
my $sth = $dbh->prepare($sql);
190
my $sth = $dbh->prepare($sql);
191
warn $sql;
146
$sth->execute(@parameters);
192
$sth->execute(@parameters);
193
my ($iTotalDisplayRecords) = $dbh->selectrow_array('SELECT FOUND_ROWS()');
147
194
148
my $item_level_itypes          = C4::Context->preference('item-level_itypes');
195
my $item_level_itypes          = C4::Context->preference('item-level_itypes');
149
my $claims_returned_lost_value = C4::Context->preference('ClaimReturnedLostValue');
196
my $claims_returned_lost_value = C4::Context->preference('ClaimReturnedLostValue');
Lines 152-159 my $confirm_parts_required = C4::Context->preference("CircConfirmItemParts") Link Here
152
my $itemtypes = { map { $_->{itemtype} => $_->{translated_description} }
199
my $itemtypes = { map { $_->{itemtype} => $_->{translated_description} }
153
        @{ Koha::ItemTypes->search_with_localization->unblessed } };
200
        @{ Koha::ItemTypes->search_with_localization->unblessed } };
154
201
155
my @checkouts_today;
202
my @checkouts;
156
my @checkouts_previous;
157
while ( my $c = $sth->fetchrow_hashref() ) {
203
while ( my $c = $sth->fetchrow_hashref() ) {
158
    my ($charge) = GetIssuingCharges( $c->{itemnumber}, $c->{borrowernumber} );
204
    my ($charge) = GetIssuingCharges( $c->{itemnumber}, $c->{borrowernumber} );
159
    my $fine = GetFine( $c->{itemnumber}, $c->{borrowernumber} );
205
    my $fine = GetFine( $c->{itemnumber}, $c->{borrowernumber} );
Lines 251-257 while ( my $c = $sth->fetchrow_hashref() ) { Link Here
251
        author                 => $c->{author},
297
        author                 => $c->{author},
252
        barcode                => $c->{barcode},
298
        barcode                => $c->{barcode},
253
        type_for_stat          => $type_for_stat || q{},
299
        type_for_stat          => $type_for_stat || q{},
300
        itemtype               => $c->{itype}    || q{},
254
        itemtype_description   => $itemtype      || q{},
301
        itemtype_description   => $itemtype      || q{},
302
        recordtype             => $c->{itemtype} || q{},
255
        recordtype_description => $recordtype    || q{},
303
        recordtype_description => $recordtype    || q{},
256
        collection             => $collection,
304
        collection             => $collection,
257
        location               => $location,
305
        location               => $location,
Lines 306-341 while ( my $c = $sth->fetchrow_hashref() ) { Link Here
306
            firstname  => $c->{firstname},
354
            firstname  => $c->{firstname},
307
            cardnumber => $c->{cardnumber},
355
            cardnumber => $c->{cardnumber},
308
        },
356
        },
309
        issued_today => !$c->{not_issued_today},
357
        issued_today => $c->{issued_today} ? JSON::true : JSON::false,
310
        recalled     => $recalled,
358
        recalled => $recalled,
311
    };
359
    };
312
360
313
    if ( $c->{not_issued_today} ) {
361
    push @checkouts, $checkout;
314
        push( @checkouts_previous, $checkout );
315
    } else {
316
        push( @checkouts_today, $checkout );
317
    }
318
}
362
}
319
363
320
@checkouts_today = sort { $a->{timestamp} cmp $b->{timestamp} } @checkouts_today;    # latest to earliest
364
binmode STDOUT, ":encoding(UTF-8)";
321
@checkouts_today = reverse(@checkouts_today)
365
print $input->header( -type => 'application/json', -charset => 'UTF-8' );
322
    if ( C4::Context->preference('todaysIssuesDefaultSortOrder') eq 'desc' );        # earliest to latest
323
366
324
@checkouts_previous =
367
my $draw = $input->param('draw');
325
    sort { $a->{date_due} cmp $b->{date_due} || $a->{timestamp} cmp $b->{timestamp} }
368
my ($iTotalRecords) = $dbh->selectrow_array(
326
    @checkouts_previous;                                                             # latest to earliest
369
    "SELECT COUNT(*) FROM issues WHERE $borrowernumber_sql", undef,
327
@checkouts_previous = reverse(@checkouts_previous)
370
    @borrowernumbers);
328
    if ( C4::Context->preference('previousIssuesDefaultSortOrder') eq 'desc' );      # earliest to latest
329
371
330
my @checkouts = ( @checkouts_today, @checkouts_previous );
372
my $response = {
373
    recordsTotal => $iTotalRecords,
374
    recordsFiltered => $iTotalDisplayRecords,
375
    draw => $draw,
376
    data => \@checkouts,
377
};
331
378
332
my $i = 1;
379
print to_json($response);
333
map { $_->{sort_order} = $i++ } @checkouts;
334
335
my $data;
336
$data->{'iTotalRecords'}        = scalar @checkouts;
337
$data->{'iTotalDisplayRecords'} = scalar @checkouts;
338
$data->{'sEcho'}                = $input->param('sEcho') || undef;
339
$data->{'aaData'}               = \@checkouts;
340
341
print to_json($data);
342
- 

Return to bug 15219