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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc (-35 lines)
Lines 1-33 Link Here
1
<!-- strings.inc -->
1
<!-- strings.inc -->
2
<script>
2
<script>
3
    var CIRCULATION_RETURNED = _("Checked in");
4
    var CIRCULATION_NOT_RETURNED = _("Unable to check in");
5
    var NOT_RENEWABLE_OVERDUE = _("Not allowed: overdue");
6
    var NOT_RENEWABLE_RESTRICTION = _("Not allowed: patron restricted");
7
    var CIRCULATION_RENEWED_DUE = _("Renewed, due:");
8
    var CIRCULATION_RENEW_FAILED = _("Renew failed:");
9
    var RETURN_CLAIMED = _("Return claimed");
10
    var RETURN_CLAIMED_FAILURE = _("Unable to claim as returned");
11
    var RETURN_CLAIMED_MAKE = _("Claim returned");
12
    var RETURN_CLAIMED_NOTES = _("Notes about return claim");
13
    var NOT_CHECKED_OUT = _("not checked out");
14
    var TOO_MANY_RENEWALS = _("too many renewals");
15
    var ON_RESERVE = _("on hold");
16
    var REASON_UNKNOWN = _("reason unknown");
17
    var TODAYS_CHECKOUTS = _("Today's checkouts");
18
    var PREVIOUS_CHECKOUTS = _("Previous checkouts");
19
    var BY = _("by _AUTHOR_");
3
    var BY = _("by _AUTHOR_");
20
    var ON_HOLD = _("On hold");
21
    var PLACE_HOLD = _("Place hold");
4
    var PLACE_HOLD = _("Place hold");
22
    var NOT_RENEWABLE = _("Not renewable");
23
    var NOT_RENEWABLE_TOO_SOON = _("No renewal before %s");
24
    var NOT_RENEWABLE_AUTO_TOO_SOON = _("Scheduled for automatic renewal");
25
    var NOT_RENEWABLE_AUTO_TOO_LATE = _("Can no longer be auto-renewed - number of checkout days exceeded");
26
    var NOT_RENEWABLE_AUTO_TOO_MUCH_OWEING = _("Automatic renewal failed, patron has unpaid fines");
27
    var NOT_RENEWABLE_AUTO_ACCOUNT_EXPIRED = _("Automatic renewal failed, account expired");
28
    var NOT_RENEWABLE_AUTO_RENEW = _("Scheduled for automatic renewal");
29
    var NOT_RENEWABLE_DENIED = _("Renewal denied by syspref");
30
    var RENEWALS_REMAINING = _("%s of %s renewals remaining");
31
    var HOLD_IS_SUSPENDED = _("Hold is <strong>suspended</strong>");
5
    var HOLD_IS_SUSPENDED = _("Hold is <strong>suspended</strong>");
32
    var UNTIL = _("until %s");
6
    var UNTIL = _("until %s");
33
    var NEXT_AVAILABLE_ITYPE = _("Next available %s item");
7
    var NEXT_AVAILABLE_ITYPE = _("Next available %s item");
Lines 35-45 Link Here
35
    var ITEM_IS_WAITING_HERE = _("Item is <strong>waiting here</strong>");
9
    var ITEM_IS_WAITING_HERE = _("Item is <strong>waiting here</strong>");
36
    var AT = _("at %s");
10
    var AT = _("at %s");
37
    var ITEM_IS_IN_TRANSIT = _("Item is <strong>in transit</strong> from %s since %s");
11
    var ITEM_IS_IN_TRANSIT = _("Item is <strong>in transit</strong> from %s since %s");
38
    var FROM = _("from");
39
    var NOT_TRANSFERRED_YET = _("Item hasn't been transferred yet from %s");
12
    var NOT_TRANSFERRED_YET = _("Item hasn't been transferred yet from %s");
40
    var NO = _("No");
13
    var NO = _("No");
41
    var YES = _("Yes");
14
    var YES = _("Yes");
42
    var INHOUSE_USE = _("On-site checkout");
43
    var CANCEL = _("Cancel");
15
    var CANCEL = _("Cancel");
44
    var RESUME = _("Resume");
16
    var RESUME = _("Resume");
45
    var SUSPEND = _("Suspend");
17
    var SUSPEND = _("Suspend");
Lines 50-61 Link Here
50
    var SUSPEND_HOLD_ERROR_NOT_FOUND = _("Unable to suspend hold, hold not found");
22
    var SUSPEND_HOLD_ERROR_NOT_FOUND = _("Unable to suspend hold, hold not found");
51
    var RESUME_HOLD_ERROR_NOT_FOUND = _("Unable to resume, hold not found");
23
    var RESUME_HOLD_ERROR_NOT_FOUND = _("Unable to resume, hold not found");
52
    var CURRENT = _(" (current) ");
24
    var CURRENT = _(" (current) ");
53
    var MSG_NO_ITEMTYPE = _("No itemtype");
54
    var MSG_CHECKOUTS_BY_ITEMTYPE = _("Number of checkouts by item type");
55
    var PATRON_NOTE = _("Patron note");
56
    var CONFIRM_DELETE_RETURN_CLAIM = _("Are you sure you want to delete this return claim?");
57
    var BROWSER_RETURN_TO_SEARCH = _("Results");
58
    var BROWSER_PREVIOUS = _("Previous");
59
    var BROWSER_NEXT = _("Next");
60
</script>
25
</script>
61
<!-- / strings.inc -->
26
<!-- / strings.inc -->
(-)a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js (-38 / +37 lines)
Lines 1-4 Link Here
1
/* global PATRON_NOTE */
1
/* global __ */
2
2
3
$(document).ready(function() {
3
$(document).ready(function() {
4
    $.ajaxSetup ({ cache: false });
4
    $.ajaxSetup ({ cache: false });
Lines 115-128 $(document).ready(function() { Link Here
115
115
116
                content = "";
116
                content = "";
117
                if ( data.returned ) {
117
                if ( data.returned ) {
118
                    content = CIRCULATION_RETURNED;
118
                    content = __("Checked in");
119
                    $(id).parent().parent().addClass('ok');
119
                    $(id).parent().parent().addClass('ok');
120
                    $('#date_due_' + data.itemnumber).html(CIRCULATION_RETURNED);
120
                    $('#date_due_' + data.itemnumber).html(__("Checked in"));
121
                    if ( data.patronnote != null ) {
121
                    if ( data.patronnote != null ) {
122
                        $('.patron_note_' + data.itemnumber).html( PATRON_NOTE + ": " + data.patronnote);
122
                        $('.patron_note_' + data.itemnumber).html( __("Patron note") + ": " + data.patronnote);
123
                    }
123
                    }
124
                } else {
124
                } else {
125
                    content = CIRCULATION_NOT_RETURNED;
125
                    content = __("Unable to check in");
126
                    $(id).parent().parent().addClass('warn');
126
                    $(id).parent().parent().addClass('warn');
127
                }
127
                }
128
128
Lines 160-183 $(document).ready(function() { Link Here
160
160
161
                var content = "";
161
                var content = "";
162
                if ( data.renew_okay ) {
162
                if ( data.renew_okay ) {
163
                    content = CIRCULATION_RENEWED_DUE + " " + data.date_due;
163
                    content = __("Renewed, due:") + " " + data.date_due;
164
                    $('#date_due_' + data.itemnumber).replaceWith( data.date_due );
164
                    $('#date_due_' + data.itemnumber).replaceWith( data.date_due );
165
                } else {
165
                } else {
166
                    content = CIRCULATION_RENEW_FAILED + " ";
166
                    content = __("Renew failed:") + " ";
167
                    if ( data.error == "no_checkout" ) {
167
                    if ( data.error == "no_checkout" ) {
168
                        content += NOT_CHECKED_OUT;
168
                        content += __("not checked out");
169
                    } else if ( data.error == "too_many" ) {
169
                    } else if ( data.error == "too_many" ) {
170
                        content += TOO_MANY_RENEWALS;
170
                        content += __("too many renewals");
171
                    } else if ( data.error == "on_reserve" ) {
171
                    } else if ( data.error == "on_reserve" ) {
172
                        content += ON_RESERVE;
172
                        content += __("on hold");
173
                    } else if ( data.error == "restriction" ) {
173
                    } else if ( data.error == "restriction" ) {
174
                        content += NOT_RENEWABLE_RESTRICTION;
174
                        content += __("Not allowed: patron restricted");
175
                    } else if ( data.error == "overdue" ) {
175
                    } else if ( data.error == "overdue" ) {
176
                        content += NOT_RENEWABLE_OVERDUE;
176
                        content += __("Not allowed: overdue");
177
                    } else if ( data.error ) {
177
                    } else if ( data.error ) {
178
                        content += data.error;
178
                        content += data.error;
179
                    } else {
179
                    } else {
180
                        content += REASON_UNKNOWN;
180
                        content += __("reason unknown");
181
                    }
181
                    }
182
                }
182
                }
183
183
Lines 250-258 $(document).ready(function() { Link Here
250
                {
250
                {
251
                    "mDataProp": function( oObj ) {
251
                    "mDataProp": function( oObj ) {
252
                        if ( oObj.issued_today ) {
252
                        if ( oObj.issued_today ) {
253
                            return "<strong>" + TODAYS_CHECKOUTS + "</strong>";
253
                            return "<strong>" + __("Today's checkouts") + "</strong>";
254
                        } else {
254
                        } else {
255
                            return "<strong>" + PREVIOUS_CHECKOUTS + "</strong>";
255
                            return "<strong>" + __("Previous checkouts") + "</strong>";
256
                        }
256
                        }
257
                    }
257
                    }
258
                },
258
                },
Lines 328-334 $(document).ready(function() { Link Here
328
328
329
                        var onsite_checkout = '';
329
                        var onsite_checkout = '';
330
                        if ( oObj.onsite_checkout == 1 ) {
330
                        if ( oObj.onsite_checkout == 1 ) {
331
                            onsite_checkout += " <span class='onsite_checkout'>(" + INHOUSE_USE + ")</span>";
331
                            onsite_checkout += " <span class='onsite_checkout'>(" + __("On-site checkout") + ")</span>";
332
                        }
332
                        }
333
333
334
                        title += " "
334
                        title += " "
Lines 421-490 $(document).ready(function() { Link Here
421
                            // Do nothing
421
                            // Do nothing
422
                        } else if ( oObj.can_renew_error == "on_reserve" ) {
422
                        } else if ( oObj.can_renew_error == "on_reserve" ) {
423
                            msg += "<span>"
423
                            msg += "<span>"
424
                                    + "<a href='/cgi-bin/koha/reserve/request.pl?biblionumber=" + oObj.biblionumber + "'>" + ON_HOLD + "</a>"
424
                                    + "<a href='/cgi-bin/koha/reserve/request.pl?biblionumber=" + oObj.biblionumber + "'>" + __("On hold") + "</a>"
425
                                    + "</span>";
425
                                    + "</span>";
426
426
427
                            span_style = "display: none";
427
                            span_style = "display: none";
428
                            span_class = "renewals-allowed-on_reserve";
428
                            span_class = "renewals-allowed-on_reserve";
429
                        } else if ( oObj.can_renew_error == "too_many" ) {
429
                        } else if ( oObj.can_renew_error == "too_many" ) {
430
                            msg += "<span class='renewals-disabled'>"
430
                            msg += "<span class='renewals-disabled'>"
431
                                    + NOT_RENEWABLE
431
                                    + __("Not renewable")
432
                                    + "</span>";
432
                                    + "</span>";
433
433
434
                            span_style = "display: none";
434
                            span_style = "display: none";
435
                            span_class = "renewals-allowed";
435
                            span_class = "renewals-allowed";
436
                        } else if ( oObj.can_renew_error == "restriction" ) {
436
                        } else if ( oObj.can_renew_error == "restriction" ) {
437
                            msg += "<span class='renewals-disabled'>"
437
                            msg += "<span class='renewals-disabled'>"
438
                                    + NOT_RENEWABLE_RESTRICTION
438
                                    + __("Not allowed: patron restricted")
439
                                    + "</span>";
439
                                    + "</span>";
440
440
441
                            span_style = "display: none";
441
                            span_style = "display: none";
442
                            span_class = "renewals-allowed";
442
                            span_class = "renewals-allowed";
443
                        } else if ( oObj.can_renew_error == "overdue" ) {
443
                        } else if ( oObj.can_renew_error == "overdue" ) {
444
                            msg += "<span class='renewals-disabled'>"
444
                            msg += "<span class='renewals-disabled'>"
445
                                    + NOT_RENEWABLE_OVERDUE
445
                                    + __("Not allowed: overdue")
446
                                    + "</span>";
446
                                    + "</span>";
447
447
448
                            span_style = "display: none";
448
                            span_style = "display: none";
449
                            span_class = "renewals-allowed";
449
                            span_class = "renewals-allowed";
450
                        } else if ( oObj.can_renew_error == "too_soon" ) {
450
                        } else if ( oObj.can_renew_error == "too_soon" ) {
451
                            msg += "<span class='renewals-disabled'>"
451
                            msg += "<span class='renewals-disabled'>"
452
                                    + NOT_RENEWABLE_TOO_SOON.format( oObj.can_renew_date )
452
                                    + __("No renewal before %s").format( oObj.can_renew_date )
453
                                    + "</span>";
453
                                    + "</span>";
454
454
455
                            span_style = "display: none";
455
                            span_style = "display: none";
456
                            span_class = "renewals-allowed";
456
                            span_class = "renewals-allowed";
457
                        } else if ( oObj.can_renew_error == "auto_too_soon" ) {
457
                        } else if ( oObj.can_renew_error == "auto_too_soon" ) {
458
                            msg += "<span class='renewals-disabled'>"
458
                            msg += "<span class='renewals-disabled'>"
459
                                    + NOT_RENEWABLE_AUTO_TOO_SOON
459
                                    + __("Scheduled for automatic renewal")
460
                                    + "</span>";
460
                                    + "</span>";
461
461
462
                            span_style = "display: none";
462
                            span_style = "display: none";
463
                            span_class = "renewals-allowed";
463
                            span_class = "renewals-allowed";
464
                        } else if ( oObj.can_renew_error == "auto_too_late" ) {
464
                        } else if ( oObj.can_renew_error == "auto_too_late" ) {
465
                            msg += "<span class='renewals-disabled'>"
465
                            msg += "<span class='renewals-disabled'>"
466
                                    + NOT_RENEWABLE_AUTO_TOO_LATE
466
                                    + __("Can no longer be auto-renewed - number of checkout days exceeded")
467
                                    + "</span>";
467
                                    + "</span>";
468
468
469
                            span_style = "display: none";
469
                            span_style = "display: none";
470
                            span_class = "renewals-allowed";
470
                            span_class = "renewals-allowed";
471
                        } else if ( oObj.can_renew_error == "auto_too_much_oweing" ) {
471
                        } else if ( oObj.can_renew_error == "auto_too_much_oweing" ) {
472
                            msg += "<span class='renewals-disabled'>"
472
                            msg += "<span class='renewals-disabled'>"
473
                                    + NOT_RENEWABLE_AUTO_TOO_MUCH_OWEING
473
                                    + __("Automatic renewal failed, patron has unpaid fines")
474
                                    + "</span>";
474
                                    + "</span>";
475
475
476
                            span_style = "display: none";
476
                            span_style = "display: none";
477
                            span_class = "renewals-allowed";
477
                            span_class = "renewals-allowed";
478
                        } else if ( oObj.can_renew_error == "auto_account_expired" ) {
478
                        } else if ( oObj.can_renew_error == "auto_account_expired" ) {
479
                            msg += "<span class='renewals-disabled'>"
479
                            msg += "<span class='renewals-disabled'>"
480
                                    + NOT_RENEWABLE_AUTO_ACCOUNT_EXPIRED
480
                                    + __("Automatic renewal failed, account expired")
481
                                    + "</span>";
481
                                    + "</span>";
482
482
483
                            span_style = "display: none";
483
                            span_style = "display: none";
484
                            span_class = "renewals-allowed";
484
                            span_class = "renewals-allowed";
485
                        } else if ( oObj.can_renew_error == "auto_renew" ) {
485
                        } else if ( oObj.can_renew_error == "auto_renew" ) {
486
                            msg += "<span class='renewals-disabled'>"
486
                            msg += "<span class='renewals-disabled'>"
487
                                    + NOT_RENEWABLE_AUTO_RENEW
487
                                    + __("Scheduled for automatic renewal")
488
                                    + "</span>";
488
                                    + "</span>";
489
489
490
                            span_style = "display: none";
490
                            span_style = "display: none";
Lines 493-499 $(document).ready(function() { Link Here
493
                            // Don't display something if it's an onsite checkout
493
                            // Don't display something if it's an onsite checkout
494
                        } else if ( oObj.can_renew_error == "item_denied_renewal" ) {
494
                        } else if ( oObj.can_renew_error == "item_denied_renewal" ) {
495
                            content += "<span class='renewals-disabled'>"
495
                            content += "<span class='renewals-disabled'>"
496
                                    + NOT_RENEWABLE_DENIED
496
                                    + __("Renewal denied by syspref")
497
                                    + "</span>";
497
                                    + "</span>";
498
498
499
                            span_style = "display: none";
499
                            span_style = "display: none";
Lines 528-534 $(document).ready(function() { Link Here
528
                        content += msg;
528
                        content += msg;
529
                        if ( can_renew || can_force_renew ) {
529
                        if ( can_renew || can_force_renew ) {
530
                            content += "<span class='renewals'>("
530
                            content += "<span class='renewals'>("
531
                                    + RENEWALS_REMAINING.format( oObj.renewals_remaining, oObj.renewals_allowed )
531
                                    + __("%s of %s renewals remaining").format( oObj.renewals_remaining, oObj.renewals_allowed )
532
                                    + ")</span>";
532
                                    + ")</span>";
533
                        }
533
                        }
534
534
Lines 542-548 $(document).ready(function() { Link Here
542
                    "bVisible": AllowCirculate ? true : false,
542
                    "bVisible": AllowCirculate ? true : false,
543
                    "mDataProp": function ( oObj ) {
543
                    "mDataProp": function ( oObj ) {
544
                        if ( oObj.can_renew_error == "on_reserve" ) {
544
                        if ( oObj.can_renew_error == "on_reserve" ) {
545
                            return "<a href='/cgi-bin/koha/reserve/request.pl?biblionumber=" + oObj.biblionumber + "'>" + ON_HOLD + "</a>";
545
                            return "<a href='/cgi-bin/koha/reserve/request.pl?biblionumber=" + oObj.biblionumber + "'>" + __("On hold") + "</a>";
546
                        } else {
546
                        } else {
547
                            return "<input type='checkbox' class='checkin' id='checkin_" + oObj.itemnumber + "' name='checkin' value='" + oObj.itemnumber +"'></input>";
547
                            return "<input type='checkbox' class='checkin' id='checkin_" + oObj.itemnumber + "' name='checkin' value='" + oObj.itemnumber +"'></input>";
548
                        }
548
                        }
Lines 557-563 $(document).ready(function() { Link Here
557
                        if ( oObj.return_claim_id ) {
557
                        if ( oObj.return_claim_id ) {
558
                          content = '<span class="badge">' + oObj.return_claim_created_on_formatted + '</span>';
558
                          content = '<span class="badge">' + oObj.return_claim_created_on_formatted + '</span>';
559
                        } else {
559
                        } else {
560
                          content = '<a class="btn btn-default btn-xs claim-returned-btn" data-itemnumber="' + oObj.itemnumber + '"><i class="fa fa-exclamation-circle"></i>' + RETURN_CLAIMED_MAKE + '</a>';
560
                          content = '<a class="btn btn-default btn-xs claim-returned-btn" data-itemnumber="' + oObj.itemnumber + '"><i class="fa fa-exclamation-circle"></i>' + __("Claim returned") + '</a>';
561
                        }
561
                        }
562
                        return content;
562
                        return content;
563
                    }
563
                    }
Lines 601-609 $(document).ready(function() { Link Here
601
                "dataSrc": "issued_today",
601
                "dataSrc": "issued_today",
602
                "startRender": function ( rows, group ) {
602
                "startRender": function ( rows, group ) {
603
                    if ( group ) {
603
                    if ( group ) {
604
                        return TODAYS_CHECKOUTS;
604
                        return __("Today's checkouts");
605
                    } else {
605
                    } else {
606
                        return PREVIOUS_CHECKOUTS;
606
                        return __("Previous checkouts");
607
                    }
607
                    }
608
                }
608
                }
609
            },
609
            },
Lines 616-628 $(document).ready(function() { Link Here
616
                var ul = $('<ul>');
616
                var ul = $('<ul>');
617
                Object.keys(checkoutsByItype).sort().forEach(function (itype) {
617
                Object.keys(checkoutsByItype).sort().forEach(function (itype) {
618
                    var li = $('<li>')
618
                    var li = $('<li>')
619
                        .append($('<strong>').html(itype || MSG_NO_ITEMTYPE))
619
                        .append($('<strong>').html(itype || __("No itemtype")))
620
                        .append(': ' + checkoutsByItype[itype]);
620
                        .append(': ' + checkoutsByItype[itype]);
621
                    ul.append(li);
621
                    ul.append(li);
622
                })
622
                })
623
                $('<details>')
623
                $('<details>')
624
                    .addClass('checkouts-by-itemtype')
624
                    .addClass('checkouts-by-itemtype')
625
                    .append($('<summary>').html(MSG_CHECKOUTS_BY_ITEMTYPE))
625
                    .append($('<summary>').html( __("Number of checkouts by item type") ))
626
                    .append(ul)
626
                    .append(ul)
627
                    .insertBefore(oSettings.nTableWrapper)
627
                    .insertBefore(oSettings.nTableWrapper)
628
            },
628
            },
Lines 702-708 $(document).ready(function() { Link Here
702
702
703
                            var onsite_checkout = '';
703
                            var onsite_checkout = '';
704
                            if ( oObj.onsite_checkout == 1 ) {
704
                            if ( oObj.onsite_checkout == 1 ) {
705
                                onsite_checkout += " <span class='onsite_checkout'>(" + INHOUSE_USE + ")</span>";
705
                                onsite_checkout += " <span class='onsite_checkout'>(" + __("On-site checkout") + ")</span>";
706
                            }
706
                            }
707
707
708
                            title += " "
708
                            title += " "
Lines 866-872 $(document).ready(function() { Link Here
866
                content = '<span class="badge">' + created_on.toLocaleDateString() + '</span>';
866
                content = '<span class="badge">' + created_on.toLocaleDateString() + '</span>';
867
                $(id).parent().parent().addClass('ok');
867
                $(id).parent().parent().addClass('ok');
868
            } else {
868
            } else {
869
                content = RETURN_CLAIMED_FAILURE;
869
                content = __("Unable to claim as returned");
870
                $(id).parent().parent().addClass('warn');
870
                $(id).parent().parent().addClass('warn');
871
            }
871
            }
872
872
Lines 1048-1054 $(document).ready(function() { Link Here
1048
1048
1049
    // Hanld return claim deletion
1049
    // Hanld return claim deletion
1050
    $('body').on('click', '.return-claim-tools-delete', function() {
1050
    $('body').on('click', '.return-claim-tools-delete', function() {
1051
        let confirmed = confirm(CONFIRM_DELETE_RETURN_CLAIM);
1051
        let confirmed = confirm(__("Are you sure you want to delete this return claim?"));
1052
        if ( confirmed ) {
1052
        if ( confirmed ) {
1053
            let id = $(this).data('return-claim-id');
1053
            let id = $(this).data('return-claim-id');
1054
1054
1055
- 

Return to bug 25321