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

(-)a/installer/data/mysql/updatedatabase.pl (+10 lines)
Lines 8560-8565 if ( CheckVersion($DBversion) ) { Link Here
8560
    SetVersion($DBversion);
8560
    SetVersion($DBversion);
8561
}
8561
}
8562
8562
8563
$DBversion = "3.15.00.XXX";
8564
if ( CheckVersion($DBversion) ) {
8565
    $dbh->do(q{
8566
        DELETE FROM systempreferences WHERE variable = 'UseTableSortForCirc'
8567
    });
8568
8569
    print "Upgrade to $DBversion done (Bug 11703 - Convert checkouts table to ajax datatable)\n";
8570
    SetVersion($DBversion);
8571
}
8572
8563
=head1 FUNCTIONS
8573
=head1 FUNCTIONS
8564
8574
8565
=head2 TableExists($table)
8575
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc (-11 / +9 lines)
Lines 10-29 Link Here
10
    var REASON_UNKNOWN = _("reason unkown");
10
    var REASON_UNKNOWN = _("reason unkown");
11
    var TODAYS_CHECKOUTS = _("Today's checkouts");
11
    var TODAYS_CHECKOUTS = _("Today's checkouts");
12
    var PREVIOUS_CHECKOUTS = _("Previous checkouts");
12
    var PREVIOUS_CHECKOUTS = _("Previous checkouts");
13
    var BY = _("by");
13
    var BY = _("by _AUTHOR_");
14
    var ON_HOLD = _("On hold");
14
    var ON_HOLD = _("On hold");
15
    var NOT_RENEWABLE = _("Not renewable");
15
    var NOT_RENEWABLE = _("Not renewable");
16
    var OF = _("of");
16
    var NOT_RENEWABLE_TOO_SOON = _("Cannot renew, renewal is premature");
17
    var RENEWALS_REMAINING = _("renewals remaining");
17
    var RENEWALS_REMAINING = _("_RENEWALS_REMAINING_ of _RENEWALS_ALLOWED_ renewals remaining");
18
    var HOLD_IS = _("Hold is");
18
    var HOLD_IS_SUSPENDED = _("Hold is <strong>suspended</strong>");
19
    var SUSPENDED = _("suspended");
19
    var UNTIL = _("until _SUSPEND_UNTIL_");
20
    var UNTIL = _("until");
20
    var ITEM_IS_WAITING = _("Item is <strong>waiting</strong>"); //
21
    var ITEM_IS = _("Item is");
21
    var AT = _("at _WAITING_AT_BRANCH_");
22
    var WAITING = _("waiting");
22
    var ITEM_IS_IN_TRANSIT = _("Item is <strong>in transit</strong> from _FROM_BRANCH_");
23
    var AT = _("at");
24
    var IN_TRANSIT = _("in transit");
25
    var FROM = _("from");
23
    var FROM = _("from");
26
    var NOT_TRANSFERRED_YET = _("Item hasn't been transferred yet from");
24
    var NOT_TRANSFERRED_YET = _("Item hasn't been transferred yet from _FROM_BRANCH_");
27
    var NO = _("No");
25
    var NO = _("No");
28
    var YES = _("Yes");
26
    var YES = _("Yes");
29
//]]>
27
//]]>
(-)a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js (-19 / +43 lines)
Lines 127-138 $(document).ready(function() { Link Here
127
    var issuesTable;
127
    var issuesTable;
128
    var drawn = 0;
128
    var drawn = 0;
129
    issuesTable = $("#issues-table").dataTable({
129
    issuesTable = $("#issues-table").dataTable({
130
        "bAutoWidth": false,
130
        "sDom": "<'row-fluid'<'span6'><'span6'>r>t<'row-fluid'>t",
131
        "sDom": "<'row-fluid'<'span6'><'span6'>r>t<'row-fluid'>t",
131
        "aaSorting": [[ 0, "desc" ]],
132
        "aoColumns": [
132
        "aoColumns": [
133
            {
133
            {
134
                "mDataProp": function( oObj ) {
134
                "mDataProp": function( oObj ) {
135
                    if ( $.datepicker.formatDate('yy-mm-dd', new Date(oObj.issuedate) ) == ymd ) {
135
                    if ( oObj.issued_today ) {
136
                        return "<strong>" + TODAYS_CHECKOUTS + "</strong>";
136
                        return "<strong>" + TODAYS_CHECKOUTS + "</strong>";
137
                    } else {
137
                    } else {
138
                        return "<strong>" + PREVIOUS_CHECKOUTS + "</strong>";
138
                        return "<strong>" + PREVIOUS_CHECKOUTS + "</strong>";
Lines 157-163 $(document).ready(function() { Link Here
157
            },
157
            },
158
            {
158
            {
159
                "mDataProp": function ( oObj ) {
159
                "mDataProp": function ( oObj ) {
160
                    title = "<a href='/cgi-bin/koha/catalogue/detail.pl?biblionumber="
160
                    title = "<span class='strong'><a href='/cgi-bin/koha/catalogue/detail.pl?biblionumber="
161
                          + oObj.biblionumber
161
                          + oObj.biblionumber
162
                          + "'>"
162
                          + "'>"
163
                          + oObj.title;
163
                          + oObj.title;
Lines 166-175 $(document).ready(function() { Link Here
166
                              title += " " + value.subfield;
166
                              title += " " + value.subfield;
167
                    });
167
                    });
168
168
169
                    title += "</a>";
169
                    title += "</a></span>";
170
170
171
                    if ( oObj.author ) {
171
                    if ( oObj.author ) {
172
                        title += " " + BY + " " + oObj.author;
172
                        title += " " + BY.replace( "_AUTHOR_",  " " + oObj.author );
173
                    }
173
                    }
174
174
175
                    if ( oObj.itemnotes ) {
175
                    if ( oObj.itemnotes ) {
Lines 195-212 $(document).ready(function() { Link Here
195
                }
195
                }
196
            },
196
            },
197
            { "mDataProp": "itemtype" },
197
            { "mDataProp": "itemtype" },
198
            { "mDataProp": "issuedate" },
198
            { "mDataProp": "issuedate_formatted" },
199
            { "mDataProp": "branchname" },
199
            { "mDataProp": "branchname" },
200
            { "mDataProp": "itemcallnumber" },
200
            { "mDataProp": "itemcallnumber" },
201
            {
201
            {
202
                "bSortable": false,
203
                "mDataProp": function ( oObj ) {
202
                "mDataProp": function ( oObj ) {
203
                    if ( ! oObj.charge ) oObj.charge = 0;
204
                    return parseFloat(oObj.charge).toFixed(2);
204
                    return parseFloat(oObj.charge).toFixed(2);
205
                }
205
                }
206
            },
206
            },
207
            {
207
            {
208
                "bSortable": false,
208
                "mDataProp": function ( oObj ) {
209
                "mDataProp": "price" },
209
                    if ( ! oObj.price ) oObj.price = 0;
210
                    return parseFloat(oObj.price).toFixed(2);
211
                }
212
            },
210
            {
213
            {
211
                "bSortable": false,
214
                "bSortable": false,
212
                "mDataProp": function ( oObj ) {
215
                "mDataProp": function ( oObj ) {
Lines 233-238 $(document).ready(function() { Link Here
233
236
234
                        span_style = "display: none";
237
                        span_style = "display: none";
235
                        span_class = "renewals-allowed";
238
                        span_class = "renewals-allowed";
239
                    } else if ( oObj.can_renew_error == "too_soon" ) {
240
                        content += "<span class='renewals-disabled'>"
241
                                + NOT_RENEWABLE_TOO_SOON
242
                                + "</span>";
243
244
                        span_style = "display: none";
245
                        span_class = "renewals-allowed";
236
                    } else {
246
                    } else {
237
                        content += "<span class='renewals-disabled'>"
247
                        content += "<span class='renewals-disabled'>"
238
                                + oObj.can_renew_error
248
                                + oObj.can_renew_error
Lines 248-257 $(document).ready(function() { Link Here
248
258
249
                    if ( oObj.renewals_remaining ) {
259
                    if ( oObj.renewals_remaining ) {
250
                        content += "<span class='renewals'>("
260
                        content += "<span class='renewals'>("
251
                                + oObj.renewals_remaining
261
                                + RENEWALS_REMAINING.replace( "_RENEWALS_REMAINING_", oObj.renewals_remaining ).replace( "_RENEWALS_ALLOWED_", oObj.renewals_allowed )
252
                                + " " + OF + " "
262
                                + ")</span>";
253
                                + oObj.renewals_allowed + " "
254
                                + RENEWALS_REMAINING + ")</span>";
255
                    }
263
                    }
256
264
257
                    content += "</span>";
265
                    content += "</span>";
Lines 333-342 $(document).ready(function() { Link Here
333
    $("#relatives-issues-tab").click( function() {
341
    $("#relatives-issues-tab").click( function() {
334
        if ( ! relativesIssuesTable ) {
342
        if ( ! relativesIssuesTable ) {
335
            relativesIssuesTable = $("#relatives-issues-table").dataTable({
343
            relativesIssuesTable = $("#relatives-issues-table").dataTable({
344
                "bAutoWidth": false,
336
                "sDom": "<'row-fluid'<'span6'><'span6'>r>t<'row-fluid'>t",
345
                "sDom": "<'row-fluid'<'span6'><'span6'>r>t<'row-fluid'>t",
337
                "aaSorting": [],
346
                "aaSorting": [],
338
                "aoColumns": [
347
                "aoColumns": [
339
                    {
348
                    {
349
                        "mDataProp": "date_due",
350
                        "bVisible": false,
351
                    },
352
                    {
353
                        "iDataSort": 1, // Sort on hidden unformatted date due column
340
                        "mDataProp": function( oObj ) {
354
                        "mDataProp": function( oObj ) {
341
                            var today = new Date();
355
                            var today = new Date();
342
                            var due = new Date( oObj.date_due );
356
                            var due = new Date( oObj.date_due );
Lines 349-355 $(document).ready(function() { Link Here
349
                    },
363
                    },
350
                    {
364
                    {
351
                        "mDataProp": function ( oObj ) {
365
                        "mDataProp": function ( oObj ) {
352
                            title = "<a href='/cgi-bin/koha/catalogue/detail.pl?biblionumber="
366
                            title = "<span class='strong'><a href='/cgi-bin/koha/catalogue/detail.pl?biblionumber="
353
                                  + oObj.biblionumber
367
                                  + oObj.biblionumber
354
                                  + "'>"
368
                                  + "'>"
355
                                  + oObj.title;
369
                                  + oObj.title;
Lines 358-364 $(document).ready(function() { Link Here
358
                                      title += " " + value.subfield;
372
                                      title += " " + value.subfield;
359
                            });
373
                            });
360
374
361
                            title += "</a>";
375
                            title += "</a></span>";
362
376
363
                            if ( oObj.author ) {
377
                            if ( oObj.author ) {
364
                                title += " " + BY + " " + oObj.author;
378
                                title += " " + BY + " " + oObj.author;
Lines 387-397 $(document).ready(function() { Link Here
387
                        }
401
                        }
388
                    },
402
                    },
389
                    { "mDataProp": "itemtype" },
403
                    { "mDataProp": "itemtype" },
390
                    { "mDataProp": "issuedate" },
404
                    { "mDataProp": "issuedate_formatted" },
391
                    { "mDataProp": "branchname" },
405
                    { "mDataProp": "branchname" },
392
                    { "mDataProp": "itemcallnumber" },
406
                    { "mDataProp": "itemcallnumber" },
393
                    { "mDataProp": "charge" },
407
                    {
394
                    { "mDataProp": "price" },
408
                        "mDataProp": function ( oObj ) {
409
                            if ( ! oObj.charge ) oObj.charge = 0;
410
                            return parseFloat(oObj.charge).toFixed(2);
411
                        }
412
                    },
413
                    {
414
                        "mDataProp": function ( oObj ) {
415
                            if ( ! oObj.price ) oObj.price = 0;
416
                            return parseFloat(oObj.price).toFixed(2);
417
                        }
418
                    },
395
                    {
419
                    {
396
                        "mDataProp": function( oObj ) {
420
                        "mDataProp": function( oObj ) {
397
                            return "<a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=" + oObj.borrowernumber + "'>"
421
                            return "<a href='/cgi-bin/koha/members/moremember.pl?borrowernumber=" + oObj.borrowernumber + "'>"
Lines 401-407 $(document).ready(function() { Link Here
401
                ],
425
                ],
402
                "bPaginate": false,
426
                "bPaginate": false,
403
                "bProcessing": true,
427
                "bProcessing": true,
404
                "bServerSide": true,
428
                "bServerSide": false,
405
                "sAjaxSource": '/cgi-bin/koha/svc/checkouts.pl',
429
                "sAjaxSource": '/cgi-bin/koha/svc/checkouts.pl',
406
                "fnServerData": function ( sSource, aoData, fnCallback ) {
430
                "fnServerData": function ( sSource, aoData, fnCallback ) {
407
                    $.each(relatives_borrowernumbers, function( index, value ) {
431
                    $.each(relatives_borrowernumbers, function( index, value ) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/js/holds.js (-22 / +21 lines)
Lines 4-9 $(document).ready(function() { Link Here
4
    $("#holds-tab").click( function() {
4
    $("#holds-tab").click( function() {
5
        if ( ! holdsTable ) {
5
        if ( ! holdsTable ) {
6
            holdsTable = $("#holds-table").dataTable({
6
            holdsTable = $("#holds-table").dataTable({
7
                "bAutoWidth": false,
7
                "sDom": "<'row-fluid'<'span6'><'span6'>r>t<'row-fluid'>t",
8
                "sDom": "<'row-fluid'<'span6'><'span6'>r>t<'row-fluid'>t",
8
                "aoColumns": [
9
                "aoColumns": [
9
                    {
10
                    {
Lines 11-17 $(document).ready(function() { Link Here
11
                    },
12
                    },
12
                    {
13
                    {
13
                        "mDataProp": function ( oObj ) {
14
                        "mDataProp": function ( oObj ) {
14
                            title = "<a href='/cgi-bin/koha/catalogue/detail.pl?biblionumber="
15
                            title = "<a href='/cgi-bin/koha/reserve/request.pl?biblionumber="
15
                                  + oObj.biblionumber
16
                                  + oObj.biblionumber
16
                                  + "'>"
17
                                  + "'>"
17
                                  + oObj.title;
18
                                  + oObj.title;
Lines 23-29 $(document).ready(function() { Link Here
23
                            title += "</a>";
24
                            title += "</a>";
24
25
25
                            if ( oObj.author ) {
26
                            if ( oObj.author ) {
26
                                title += " " + BY + " " + oObj.author;
27
                                title += " " + BY.replace( "_AUTHOR_",  oObj.author );
27
                            }
28
                            }
28
29
29
                            if ( oObj.itemnotes ) {
30
                            if ( oObj.itemnotes ) {
Lines 34-50 $(document).ready(function() { Link Here
34
                                title += " - <span class='" + span_class + "'>" + oObj.itemnotes + "</span>"
35
                                title += " - <span class='" + span_class + "'>" + oObj.itemnotes + "</span>"
35
                            }
36
                            }
36
37
37
                            title += " "
38
                                  + "<a href='/cgi-bin/koha/catalogue/moredetail.pl?biblionumber="
39
                                  + oObj.biblionumber
40
                                  + "&itemnumber="
41
                                  + oObj.itemnumber
42
                                  + "#"
43
                                  + oObj.itemnumber
44
                                  + "'>"
45
                                  + oObj.barcode
46
                                  + "</a>";
47
48
                            return title;
38
                            return title;
49
                        }
39
                        }
50
                    },
40
                    },
Lines 58-66 $(document).ready(function() { Link Here
58
                            var data = "";
48
                            var data = "";
59
49
60
                            if ( oObj.suspend == 1 ) {
50
                            if ( oObj.suspend == 1 ) {
61
                                data += "<p>" + HOLD_IS + " <strong> " + SUSPENDED + " </strong>";
51
                                data += "<p>" + HOLD_IS_SUSPENDED;
62
                                if ( oObj.suspend_until ) {
52
                                if ( oObj.suspend_until ) {
63
                                    data += " " + UNTIL + " " + oObj.suspend_until_formatted;
53
                                    data += " " + UNTIL.replace( "_SUSPEND_UNTIL_", oObj.suspend_until_formatted );
64
                                }
54
                                }
65
                                data += "</p>";
55
                                data += "</p>";
66
                            }
56
                            }
Lines 68-86 $(document).ready(function() { Link Here
68
                            if ( oObj.barcode ) {
58
                            if ( oObj.barcode ) {
69
                                data += "<em>";
59
                                data += "<em>";
70
                                if ( oObj.found == "W" ) {
60
                                if ( oObj.found == "W" ) {
71
                                    data += ITEM_IS + " <strong> " + WAITING + " </strong>";
61
                                    data += ITEM_IS_WAITING;
72
62
73
                                    if ( ! oObj.waiting_here ) {
63
                                    if ( ! oObj.waiting_here ) {
74
                                        data += " " + AT + " " + oObj.waiting_at;
64
                                        data += " " + AT.replace("_WAITING_AT_BRANCH_", oObj.waiting_at );
75
                                    }
65
                                    }
76
                                } else if ( oObj.transferred ) {
66
                                } else if ( oObj.transferred ) {
77
                                    data += ITEM_IS + " <strong> " + IN_TRANSIT + " </strong> " + FROM + oObj.from_branch;
67
                                    data += ITEM_IS_IN_TRANSIT.replace( "_FROM_BRANCH_", oObj.from_branch );
78
                                } else if ( oObj.not_transferred ) {
68
                                } else if ( oObj.not_transferred ) {
79
                                    data += NOT_TRANSFERRED_YET + " " + oObj.not_transferred_by;
69
                                    data += NOT_TRANSFERRED_YET.replace( "_FROM_BRANCH_", oObj.not_transferred_by );
80
                                }                                 data += "</em>";
70
                                }
71
                                data += "</em>";
81
72
82
                                data += " <a href='/cgi-bin/koha/catalogue/detail.pl?biblionumber="
73
                                data += " <a href='/cgi-bin/koha/catalogue/detail.pl?biblionumber="
83
                                     + oObj.biblionumber + "'>" + oObj.barcode + "</a>";
74
                                  + oObj.biblionumber
75
                                  + "&itemnumber="
76
                                  + oObj.itemnumber
77
                                  + "#"
78
                                  + oObj.itemnumber
79
                                  + "'>"
80
                                  + oObj.barcode
81
                                  + "</a>";
84
                            }
82
                            }
85
83
86
                            return data;
84
                            return data;
Lines 97-102 $(document).ready(function() { Link Here
97
                        }
95
                        }
98
                    },
96
                    },
99
                    {
97
                    {
98
                        "bSortable": false,
100
                        "mDataProp": function( oObj ) {
99
                        "mDataProp": function( oObj ) {
101
                            return "<select name='rank-request'>"
100
                            return "<select name='rank-request'>"
102
                                 + "<option value='n'>" + NO + "</option>"
101
                                 + "<option value='n'>" + NO + "</option>"
Lines 110-116 $(document).ready(function() { Link Here
110
                ],
109
                ],
111
                "bPaginate": false,
110
                "bPaginate": false,
112
                "bProcessing": true,
111
                "bProcessing": true,
113
                "bServerSide": true,
112
                "bServerSide": false,
114
                "sAjaxSource": '/cgi-bin/koha/svc/holds.pl',
113
                "sAjaxSource": '/cgi-bin/koha/svc/holds.pl',
115
                "fnServerData": function ( sSource, aoData, fnCallback ) {
114
                "fnServerData": function ( sSource, aoData, fnCallback ) {
116
                    aoData.push( { "name": "borrowernumber", "value": borrowernumber } );
115
                    aoData.push( { "name": "borrowernumber", "value": borrowernumber } );
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt (+4 lines)
Lines 524-529 Link Here
524
524
525
            <p>The <a href="http://www.openjs.com/scripts/events/keyboard_shortcuts/">OpenJS keyboard shortcuts library</a>
525
            <p>The <a href="http://www.openjs.com/scripts/events/keyboard_shortcuts/">OpenJS keyboard shortcuts library</a>
526
               by Binny V A is licensed under the BSD license.</p>
526
               by Binny V A is licensed under the BSD license.</p>
527
528
            <h2>jquery.dataTables.grouping.js</h2>
529
            <p>The <a href="https://code.google.com/p/jquery-datatables-row-grouping/">jquery.dataTables.grouping.js</a>
530
               plugin by Jovan Popovic is licensed under the BSD and GPL v2 license.</p>
527
        </div>
531
        </div>
528
532
529
        <div id="translations">
533
        <div id="translations">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-2 / +3 lines)
Lines 15-23 Link Here
15
[% INCLUDE 'calendar.inc' %]
15
[% INCLUDE 'calendar.inc' %]
16
16
17
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
17
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
18
[% INCLUDE 'datatables.inc' %]
19
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
20
[% INCLUDE 'strings.inc' %]
18
[% INCLUDE 'strings.inc' %]
19
[% INCLUDE 'datatables.inc' %]
20
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
21
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min.js"></script>
21
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min.js"></script>
22
[% INCLUDE 'timepicker.inc' %]
22
[% INCLUDE 'timepicker.inc' %]
23
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.rowGrouping.js"></script>
23
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.rowGrouping.js"></script>
Lines 721-726 No patron matched <span class="ex">[% message %]</span> Link Here
721
        <table id="relatives-issues-table">
721
        <table id="relatives-issues-table">
722
            <thead>
722
            <thead>
723
                <tr>
723
                <tr>
724
                    <th scope="col">Due date (unformatted, hidden)</th>
724
                    <th scope="col">Due date</th>
725
                    <th scope="col">Due date</th>
725
                    <th scope="col">Title</th>
726
                    <th scope="col">Title</th>
726
                    <th scope="col">Item type</th>
727
                    <th scope="col">Item type</th>
(-)a/svc/checkin.pl (-2 lines)
Lines 27-34 use C4::Items qw(GetBarcodeFromItemnumber); Link Here
27
use C4::Context;
27
use C4::Context;
28
use C4::Auth qw(check_cookie_auth);
28
use C4::Auth qw(check_cookie_auth);
29
29
30
use Koha::DateUtils qw(output_pref_due);
31
32
my $input = new CGI;
30
my $input = new CGI;
33
31
34
my ( $auth_status, $sessionID ) =
32
my ( $auth_status, $sessionID ) =
(-)a/svc/checkouts.pl (-44 / +68 lines)
Lines 81-87 my $sql = ' Link Here
81
        borrowernumber,
81
        borrowernumber,
82
        surname,
82
        surname,
83
        firstname,
83
        firstname,
84
        cardnumber
84
        cardnumber,
85
86
        DATEDIFF( issuedate, CURRENT_DATE() ) AS not_issued_today
85
    FROM issues
87
    FROM issues
86
        LEFT JOIN items USING ( itemnumber )
88
        LEFT JOIN items USING ( itemnumber )
87
        LEFT JOIN biblio USING ( biblionumber )
89
        LEFT JOIN biblio USING ( biblionumber )
Lines 95-101 if ( @borrowernumber == 1 ) { Link Here
95
    $sql .= '= ?';
97
    $sql .= '= ?';
96
}
98
}
97
else {
99
else {
98
    $sql = ' IN (' . join( ',', ('?') x @borrowernumber ) . ') ';
100
    $sql .= ' IN (' . join( ',', ('?') x @borrowernumber ) . ') ';
99
}
101
}
100
push( @parameters, @borrowernumber );
102
push( @parameters, @borrowernumber );
101
103
Lines 103-113 $sql .= " ORDER BY $sorting_column $sorting_direction "; Link Here
103
105
104
my $dbh = C4::Context->dbh();
106
my $dbh = C4::Context->dbh();
105
my $sth = $dbh->prepare($sql);
107
my $sth = $dbh->prepare($sql);
106
$sth->execute( @parameters );
108
$sth->execute(@parameters);
107
109
108
my $item_level_itypes = C4::Context->preference('item-level_itypes');
110
my $item_level_itypes = C4::Context->preference('item-level_itypes');
109
111
110
my @checkouts;
112
my @checkouts_today;
113
my @checkouts_previous;
111
while ( my $c = $sth->fetchrow_hashref() ) {
114
while ( my $c = $sth->fetchrow_hashref() ) {
112
    my ($charge) = GetIssuingCharges( $c->{itemnumber}, $c->{borrowernumber} );
115
    my ($charge) = GetIssuingCharges( $c->{itemnumber}, $c->{borrowernumber} );
113
116
Lines 116-165 while ( my $c = $sth->fetchrow_hashref() ) { Link Here
116
119
117
    my ( $renewals_count, $renewals_allowed, $renewals_remaining ) =
120
    my ( $renewals_count, $renewals_allowed, $renewals_remaining ) =
118
      GetRenewCount( $c->{borrowernumber}, $c->{itemnumber} );
121
      GetRenewCount( $c->{borrowernumber}, $c->{itemnumber} );
119
    push(
122
120
        @checkouts,
123
    my $checkout = {
121
        {
124
        DT_RowId   => $c->{itemnumber} . '-' . $c->{borrowernumber},
122
            DT_RowId   => $c->{itemnumber} . '-' . $c->{borrowernumber},
125
        title      => $c->{title},
123
            title      => $c->{title},
126
        author     => $c->{author},
124
            author     => $c->{author},
127
        barcode    => $c->{barcode},
125
            barcode    => $c->{barcode},
128
        itemtype   => $item_level_itypes ? $c->{itype} : $c->{itemtype},
126
            itemtype   => $item_level_itypes ? $c->{itype} : $c->{itemtype},
129
        itemnotes  => $c->{itemnotes},
127
            itemnotes  => $c->{itemnotes},
130
        branchcode => $c->{branchcode},
128
            branchcode => $c->{branchcode},
131
        branchname => $c->{branchname},
129
            branchname => $c->{branchname},
132
        itemcallnumber => $c->{itemcallnumber}   || q{},
130
            itemcallnumber => $c->{itemcallnumber}   || q{},
133
        charge         => $charge,
131
            charge         => $charge,
134
        price          => $c->{replacementprice} || q{},
132
            price          => $c->{replacementprice} || q{},
135
        can_renew      => $can_renew,
133
            can_renew      => $can_renew,
136
        can_renew_error     => $can_renew_error,
134
            can_renew_error    => $can_renew_error,
137
        itemnumber          => $c->{itemnumber},
135
            itemnumber         => $c->{itemnumber},
138
        borrowernumber      => $c->{borrowernumber},
136
            borrowernumber     => $c->{borrowernumber},
139
        biblionumber        => $c->{biblionumber},
137
            biblionumber       => $c->{biblionumber},
140
        issuedate           => $c->{issuedate},
138
            issuedate          => $c->{issuedate},
141
        date_due            => $c->{date_due},
139
            date_due           => $c->{date_due},
142
        renewals_count      => $renewals_count,
140
            renewals_count     => $renewals_count,
143
        renewals_allowed    => $renewals_allowed,
141
            renewals_allowed   => $renewals_allowed,
144
        renewals_remaining  => $renewals_remaining,
142
            renewals_remaining => $renewals_remaining,
145
        issuedate_formatted => output_pref(
143
            issuedate_formatted =>
146
            {
144
              output_pref( dt_from_string( $c->{issuedate} ) ),
147
                dt          => dt_from_string( $c->{issuedate} ),
145
            date_due_formatted =>
148
                as_due_date => 1
146
              output_pref_due( dt_from_string( $c->{date_due} ) ),
149
            }
147
            subtitle => GetRecordValue(
150
        ),
148
                'subtitle',
151
        date_due_formatted => output_pref(
149
                GetMarcBiblio( $c->{biblionumber} ),
152
            {
150
                GetFrameworkCode( $c->{biblionumber} )
153
                dt          => dt_from_string( $c->{date_due} ),
151
            ),
154
                as_due_date => 1
152
            borrower => {
153
                surname    => $c->{surname},
154
                firstname  => $c->{firstname},
155
                cardnumber => $c->{cardnumber},
156
            }
155
            }
157
        }
156
        ),
158
    );
157
        subtitle => GetRecordValue(
158
            'subtitle',
159
            GetMarcBiblio( $c->{biblionumber} ),
160
            GetFrameworkCode( $c->{biblionumber} )
161
        ),
162
        borrower => {
163
            surname    => $c->{surname},
164
            firstname  => $c->{firstname},
165
            cardnumber => $c->{cardnumber},
166
        },
167
        issued_today => !$c->{not_issued_today},
168
    };
169
170
    if ( $c->{not_issued_today} ) {
171
        push( @checkouts_previous, $checkout );
172
    }
173
    else {
174
        push( @checkouts_today, $checkout );
175
    }
159
}
176
}
160
177
178
@checkouts_today = reverse(@checkouts_today)
179
  if ( C4::Context->preference('todaysIssuesDefaultSortOrder') eq 'desc' );
180
@checkouts_previous = reverse(@checkouts_previous)
181
  if ( C4::Context->preference('previousIssuesDefaultSortOrder') eq 'desc' );
182
183
my @checkouts = ( @checkouts_today, @checkouts_previous );
184
161
my $data;
185
my $data;
162
$data->{'iTotalRecords'}        = scalar @checkouts;                 #FIXME
186
$data->{'iTotalRecords'}        = scalar @checkouts;
163
$data->{'iTotalDisplayRecords'} = scalar @checkouts;
187
$data->{'iTotalDisplayRecords'} = scalar @checkouts;
164
$data->{'sEcho'}                = $input->param('sEcho') || undef;
188
$data->{'sEcho'}                = $input->param('sEcho') || undef;
165
$data->{'aaData'}               = \@checkouts;
189
$data->{'aaData'}               = \@checkouts;
(-)a/svc/holds.pl (-7 / +10 lines)
Lines 95-108 while ( my $h = $holds_rs->next() ) { Link Here
95
            'subtitle', GetMarcBiblio($biblionumber),
95
            'subtitle', GetMarcBiblio($biblionumber),
96
            GetFrameworkCode($biblionumber)
96
            GetFrameworkCode($biblionumber)
97
        ),
97
        ),
98
        reservedate_formatted => $h->reservedate()
98
        reservedate_formatted => $h->reservedate() ? output_pref(
99
        ? output_pref_due( dt_from_string( $h->reservedate() ) )
99
            { dt => dt_from_string( $h->reservedate() ), dateonly => 1 }
100
          )
100
        : q{},
101
        : q{},
101
        suspend_until_formatted => $h->suspend_until()
102
        suspend_until_formatted => $h->suspend_until() ? output_pref(
102
        ? output_pref_due( dt_from_string( $h->suspend_until() ) )
103
            { dt => dt_from_string( $h->suspend_until() ), dateonly => 1 }
104
          )
103
        : q{},
105
        : q{},
104
        expirationdate_formatted => $h->expirationdate()
106
        expirationdate_formatted => $h->expirationdate() ? output_pref(
105
        ? output_pref_due( dt_from_string( $h->expirationdate() ) )
107
            { dt => dt_from_string( $h->expirationdate() ), dateonly => 1 }
108
          )
106
        : q{},
109
        : q{},
107
    };
110
    };
108
111
Lines 120-126 while ( my $h = $holds_rs->next() ) { Link Here
120
        if ($transferred_when) {
123
        if ($transferred_when) {
121
            $hold->{color}       = 'transferred';
124
            $hold->{color}       = 'transferred';
122
            $hold->{transferred} = 1;
125
            $hold->{transferred} = 1;
123
            $hold->{date_sent}   = format_date($transferred_when);
126
            $hold->{date_sent} = output_pref( dt_from_string($transferred_when) );
124
            $hold->{from_branch} = GetBranchName($transferred_from);
127
            $hold->{from_branch} = GetBranchName($transferred_from);
125
        }
128
        }
126
        elsif ( $item->holdingbranch()->branchcode() ne
129
        elsif ( $item->holdingbranch()->branchcode() ne
(-)a/svc/renew.pl (-3 / +2 lines)
Lines 26-32 use C4::Circulation; Link Here
26
use C4::Context;
26
use C4::Context;
27
use C4::Auth qw(check_cookie_auth);
27
use C4::Auth qw(check_cookie_auth);
28
28
29
use Koha::DateUtils qw(output_pref_due dt_from_string);
29
use Koha::DateUtils qw(output_pref dt_from_string);
30
30
31
my $input = new CGI;
31
my $input = new CGI;
32
32
Lines 63-69 $data->{branchcode} = $branchcode; Link Here
63
63
64
if ( $data->{renew_okay} ) {
64
if ( $data->{renew_okay} ) {
65
    $date_due = AddRenewal( $borrowernumber, $itemnumber, $branchcode, $date_due );
65
    $date_due = AddRenewal( $borrowernumber, $itemnumber, $branchcode, $date_due );
66
    $data->{date_due} = output_pref_due( $date_due );
66
    $data->{date_due} = output_pref( { dt => $date_due, as_due_date => 1 } );
67
}
67
}
68
68
69
print to_json($data);
69
print to_json($data);
70
- 

Return to bug 11703