|
Lines 808-816
Link Here
|
| 808 |
<input type = "hidden" name="biblionumbers" value="[% biblionumbers | html %]"/> |
808 |
<input type = "hidden" name="biblionumbers" value="[% biblionumbers | html %]"/> |
| 809 |
[% END %] |
809 |
[% END %] |
| 810 |
|
810 |
|
|
|
811 |
[% IF enqueued %] |
| 812 |
<div class="dialog message"> |
| 813 |
<p>The job has been enqueued! It will be processed as soon as possible.</p> |
| 814 |
<p><a href="/cgi-bin/koha/admin/background_jobs.pl?op=view&id=[% job_id | uri %]" title="View detail of the enqueued job">View detail of the enqueued job</a></p> |
| 815 |
</div> |
| 816 |
[% END %] |
| 817 |
|
| 811 |
<h2>Existing holds</h2> |
818 |
<h2>Existing holds</h2> |
| 812 |
<div id="toolbar" class="btn-toolbar"> |
819 |
<div id="toolbar" class="btn-toolbar"> |
| 813 |
<input type="submit" name="submit" value="Update hold(s)" /> |
820 |
<input type="submit" name="submit" value="Update hold(s)" /> <button class="cancel_selected_holds" data-bulk="true"></button> |
| 814 |
<fieldset id="cancellation-reason-fieldset" class="action"> |
821 |
<fieldset id="cancellation-reason-fieldset" class="action"> |
| 815 |
[% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %] |
822 |
[% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %] |
| 816 |
[% IF hold_cancellation %] |
823 |
[% IF hold_cancellation %] |
|
Lines 1015-1020
Link Here
|
| 1015 |
cannotBeTransferred: _("Cannot be transferred to pickup library"), |
1022 |
cannotBeTransferred: _("Cannot be transferred to pickup library"), |
| 1016 |
pickupNotInHoldGroup: _("Only pickup locations within the same hold group are allowed") |
1023 |
pickupNotInHoldGroup: _("Only pickup locations within the same hold group are allowed") |
| 1017 |
} |
1024 |
} |
|
|
1025 |
|
| 1026 |
var MSG_CANCEL_SELECTED = _("Cancel selected (%s)"); |
| 1018 |
columns_settings_borrowers_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %]; |
1027 |
columns_settings_borrowers_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %]; |
| 1019 |
$.fn.select2.defaults.set("width", "100%" ); |
1028 |
$.fn.select2.defaults.set("width", "100%" ); |
| 1020 |
$.fn.select2.defaults.set("dropdownAutoWidth", true ); |
1029 |
$.fn.select2.defaults.set("dropdownAutoWidth", true ); |
|
Lines 1339-1349
Link Here
|
| 1339 |
return false; |
1348 |
return false; |
| 1340 |
}); |
1349 |
}); |
| 1341 |
$("#cancelModalConfirmBtn").on("click",function(e) { |
1350 |
$("#cancelModalConfirmBtn").on("click",function(e) { |
| 1342 |
let borrowernumber = cancel_link.data('borrowernumber'); |
1351 |
let link; |
| 1343 |
let biblionumber = cancel_link.data('biblionumber'); |
1352 |
if(cancel_link.data('bulk')) { |
| 1344 |
let reserve_id = cancel_link.data('id'); |
1353 |
[% IF biblionumbers %] |
|
|
1354 |
link = `request.pl?biblionumbers=[% biblionumbers | url %]&action=cancelBulk&ids=${$('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')).join(',')}`; |
| 1355 |
[% ELSE %] |
| 1356 |
link = `request.pl?biblionumber=[% biblionumber | url %]&action=cancelBulk&ids=${$('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')).join(',')}`; |
| 1357 |
[% END %] |
| 1358 |
} else { |
| 1359 |
let borrowernumber = cancel_link.data('borrowernumber'); |
| 1360 |
let biblionumber = cancel_link.data('biblionumber'); |
| 1361 |
let reserve_id = cancel_link.data('id'); |
| 1362 |
link = `request.pl?action=cancel&borrowernumber=${ borrowernumber }&biblionumber=${ biblionumber }&reserve_id=${ reserve_id }`; |
| 1363 |
} |
| 1345 |
let reason = $("#modal-cancellation-reason").val(); |
1364 |
let reason = $("#modal-cancellation-reason").val(); |
| 1346 |
let link = `request.pl?action=cancel&borrowernumber=${ borrowernumber }&biblionumber=${ biblionumber }&reserve_id=${ reserve_id }`; |
|
|
| 1347 |
if ( reason ) { |
1365 |
if ( reason ) { |
| 1348 |
link += "&cancellation-reason=" + reason |
1366 |
link += "&cancellation-reason=" + reason |
| 1349 |
} |
1367 |
} |
|
Lines 1391-1396
Link Here
|
| 1391 |
stickTo: "#existing_holds", |
1409 |
stickTo: "#existing_holds", |
| 1392 |
stickyClass: "floating" |
1410 |
stickyClass: "floating" |
| 1393 |
}); |
1411 |
}); |
|
|
1412 |
|
| 1413 |
if(!localStorage.selectedHolds) { |
| 1414 |
localStorage.selectedHolds = []; |
| 1415 |
} |
| 1416 |
|
| 1417 |
$('.holds_table .select_hold').each(function() { |
| 1418 |
if(localStorage.selectedHolds.includes($(this).data('id'))) { |
| 1419 |
$(this).prop('checked', true); |
| 1420 |
} |
| 1421 |
}); |
| 1422 |
|
| 1423 |
$('.holds_table .select_hold_all').each(function() { |
| 1424 |
var table = $(this).parents('.holds_table'); |
| 1425 |
var count = $('.select_hold:not(:checked)', table).length; |
| 1426 |
$('.select_hold_all', table).prop('checked', !count); |
| 1427 |
}); |
| 1428 |
|
| 1429 |
$('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length)); |
| 1430 |
|
| 1431 |
$('.holds_table .select_hold_all').click(function() { |
| 1432 |
var table = $(this).parents('.holds_table'); |
| 1433 |
var count = $('.select_hold:checked', table).length; |
| 1434 |
$('.select_hold', table).prop('checked', !count); |
| 1435 |
$(this).prop('checked', !count); |
| 1436 |
$('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length)); |
| 1437 |
localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')); |
| 1438 |
}); |
| 1439 |
|
| 1440 |
$('.holds_table .select_hold').click(function() { |
| 1441 |
var table = $(this).parents('.holds_table'); |
| 1442 |
var count = $('.select_hold:not(:checked)', table).length; |
| 1443 |
$('.select_hold_all', table).prop('checked', !count); |
| 1444 |
$('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length)); |
| 1445 |
localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')); |
| 1446 |
}); |
| 1447 |
|
| 1448 |
$('.cancel_selected_holds').click(function(e) { |
| 1449 |
e.preventDefault(); |
| 1450 |
if($('.holds_table .select_hold:checked').length) { |
| 1451 |
cancel_link = $(this); |
| 1452 |
delete localStorage.selectedHolds; |
| 1453 |
$('#cancelModal').modal(); |
| 1454 |
} |
| 1455 |
return false; |
| 1456 |
}); |
| 1457 |
|
| 1394 |
}); |
1458 |
}); |
| 1395 |
</script> |
1459 |
</script> |
| 1396 |
[% END %] |
1460 |
[% END %] |