|
Lines 948-953
Link Here
|
| 948 |
[% END %][% END %][% END %] |
948 |
[% END %][% END %][% END %] |
| 949 |
}; |
949 |
}; |
| 950 |
var MSG_NO_ITEMS_AVAILABLE = _("A hold cannot be requested on any of these items."); |
950 |
var MSG_NO_ITEMS_AVAILABLE = _("A hold cannot be requested on any of these items."); |
|
|
951 |
var ERROR_MAP = { |
| 952 |
damaged: _("Item damaged"), |
| 953 |
ageRestricted: _("Age restricted"), |
| 954 |
tooManyHoldsForThisRecord: _("Exceeded max holds per record"), |
| 955 |
tooManyReservesToday: _("Daily hold limit reached for patron"), |
| 956 |
tooManyReserves: _("Too many holds"), |
| 957 |
notReservable: _("Not holdable"), |
| 958 |
cannotReserveFromOtherBranches: _("Patron is from different library"), |
| 959 |
itemAlreadyOnHold: _("Patron already has hold for this item"), |
| 960 |
cannotBeTransferred: _("Cannot be transferred to pickup library") |
| 961 |
} |
| 951 |
columns_settings_borrowers_table = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %] |
962 |
columns_settings_borrowers_table = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %] |
| 952 |
|
963 |
|
| 953 |
$(document).ready(function() { |
964 |
$(document).ready(function() { |
|
Lines 1005-1011
Link Here
|
| 1005 |
|
1016 |
|
| 1006 |
$("#club-request-form, #hold-request-form").on("submit", function() { |
1017 |
$("#club-request-form, #hold-request-form").on("submit", function() { |
| 1007 |
let $t = $(this); |
1018 |
let $t = $(this); |
| 1008 |
$('.clubalert').addClass('hide'); |
1019 |
$('.clubalert, .holdalert').addClass('hide'); |
| 1009 |
let biblionumbers = [biblionumber]; |
1020 |
let biblionumbers = [biblionumber]; |
| 1010 |
let biblionumbers_text; |
1021 |
let biblionumbers_text; |
| 1011 |
const data = { |
1022 |
const data = { |
|
Lines 1048-1054
Link Here
|
| 1048 |
document.location = url; |
1059 |
document.location = url; |
| 1049 |
}) |
1060 |
}) |
| 1050 |
.fail(function(err) { |
1061 |
.fail(function(err) { |
| 1051 |
$('.clubalert, .holdalert').removeClass('hide').html(err.responseJSON.error); |
1062 |
var message = err.responseJSON.error; |
|
|
1063 |
var match = err.responseJSON.error.match(/Reason: (\w+)\s*$/); |
| 1064 |
if(match && ERROR_MAP[match[1]]) { |
| 1065 |
message = '<div><strong>'+_("Cannot place hold")+'</strong></div><div>'+ERROR_MAP[match[1]]+'</div>' |
| 1066 |
} |
| 1067 |
$('.clubalert, .holdalert').removeClass('hide').html(message); |
| 1052 |
}); |
1068 |
}); |
| 1053 |
} |
1069 |
} |
| 1054 |
}); |
1070 |
}); |
| 1055 |
- |
|
|