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 307-313
$(document).ready(function() {
Link Here
|
307 |
title += "</a></span>"; |
307 |
title += "</a></span>"; |
308 |
|
308 |
|
309 |
if ( oObj.author ) { |
309 |
if ( oObj.author ) { |
310 |
title += " " + BY.replace( "_AUTHOR_", " " + oObj.author.escapeHtml() ); |
310 |
title += " " + __("by _AUTHOR_").replace( "_AUTHOR_", " " + oObj.author.escapeHtml() ); |
311 |
} |
311 |
} |
312 |
|
312 |
|
313 |
if ( oObj.itemnotes ) { |
313 |
if ( oObj.itemnotes ) { |
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 681-687
$(document).ready(function() {
Link Here
|
681 |
title += "</a></span>"; |
681 |
title += "</a></span>"; |
682 |
|
682 |
|
683 |
if ( oObj.author ) { |
683 |
if ( oObj.author ) { |
684 |
title += " " + BY.replace( "_AUTHOR_", " " + oObj.author.escapeHtml() ); |
684 |
title += " " + __("by _AUTHOR_").replace( "_AUTHOR_", " " + oObj.author.escapeHtml() ); |
685 |
} |
685 |
} |
686 |
|
686 |
|
687 |
if ( oObj.itemnotes ) { |
687 |
if ( oObj.itemnotes ) { |
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 1064-1070
$(document).ready(function() {
Link Here
|
1064 |
|
1064 |
|
1065 |
// Hanld return claim deletion |
1065 |
// Hanld return claim deletion |
1066 |
$('body').on('click', '.return-claim-tools-delete', function() { |
1066 |
$('body').on('click', '.return-claim-tools-delete', function() { |
1067 |
let confirmed = confirm(CONFIRM_DELETE_RETURN_CLAIM); |
1067 |
let confirmed = confirm(__("Are you sure you want to delete this return claim?")); |
1068 |
if ( confirmed ) { |
1068 |
if ( confirmed ) { |
1069 |
let id = $(this).data('return-claim-id'); |
1069 |
let id = $(this).data('return-claim-id'); |
1070 |
|
1070 |
|