Lines 1490-1528
Link Here
|
1490 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> |
1490 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> |
1491 |
</div> |
1491 |
</div> |
1492 |
<div class="modal-body"> |
1492 |
<div class="modal-body"> |
1493 |
<div id="move_hold_item_selection"> |
|
|
1494 |
<h3>1. Review holds to move</h3> |
1495 |
<table class="table table-striped"> |
1496 |
<thead> |
1497 |
<tr> |
1498 |
<th>Hold ID</th> |
1499 |
<th>Original hold</th> |
1500 |
<th>Problem</th> |
1501 |
</tr> |
1502 |
</thead> |
1503 |
<tbody> </tbody> |
1504 |
</table> |
1505 |
</div> |
1506 |
<hr /> |
1507 |
<div id="move_hold_item_search" class="alert alert-danger" style="display:none;"></div> |
1493 |
<div id="move_hold_item_search" class="alert alert-danger" style="display:none;"></div> |
1508 |
<form id="itemSearchForm"> |
1494 |
<form id="itemSearchForm"> |
1509 |
<div id="move_hold_item_searchform"> |
1495 |
<div id="move_hold_item_searchform"> |
1510 |
<h3>2. Enter the item barcode of new hold target: </h3> |
1496 |
<h3>Enter the item barcode of new hold target: </h3> |
1511 |
<fieldset class="action"> |
1497 |
<fieldset class="action d-flex"> |
1512 |
<input type="text" class="form-control" name="external_id" id="external_id" required /> |
1498 |
<input type="text" class="form-control" name="external_id" id="external_id" required /> |
1513 |
<button type="submit" class="btn btn-default mt-3">Search</button> |
1499 |
<button type="submit" class="btn btn-default">Search</button> |
1514 |
</fieldset> |
1500 |
</fieldset> |
1515 |
</div> |
1501 |
</div> |
1516 |
</form> |
1502 |
</form> |
1517 |
<form id="move_hold_item_form" method="post" action="request.pl"> |
1503 |
<form id="move_hold_item_form" method="post" action="request.pl"> |
|
|
1504 |
[% INCLUDE 'csrf-token.inc' %] |
1505 |
<input type="hidden" name="op" value="cud-move_hold_item" /> |
1506 |
<input type="hidden" name="original_biblionumber" value="[% biblio.biblionumber | html %]" /> |
1518 |
<div id="itemResultMessage" class="mt-3"> </div> |
1507 |
<div id="itemResultMessage" class="mt-3"> </div> |
1519 |
<div id="move_hold_item_confirm" style="display:none;"> |
1508 |
<div id="move_hold_item_selection"> |
1520 |
<h3>3. Confirm moving of holds:</h3> |
1509 |
<h3>Review holds to move</h3> |
1521 |
[% INCLUDE 'csrf-token.inc' %] |
1510 |
<table class="table table-striped"> |
1522 |
<input type="hidden" name="op" value="cud-move_hold_item" /> |
1511 |
<thead> |
1523 |
<button type="submit" class="btn btn-primary mt-3">Move selected holds</button> |
1512 |
<tr> |
1524 |
<input type="hidden" name="original_biblionumber" value="[% biblio.biblionumber %]" /> |
1513 |
<th></th> |
|
|
1514 |
<th>Hold ID</th> |
1515 |
<th>Original hold</th> |
1516 |
<th>Problem</th> |
1517 |
</tr> |
1518 |
</thead> |
1519 |
<tbody> </tbody> |
1520 |
</table> |
1525 |
</div> |
1521 |
</div> |
|
|
1522 |
<button id="move_hold_item_confirm" type="submit" class="btn btn-primary" disabled="disabled">Move selected holds</button> |
1526 |
</form> |
1523 |
</form> |
1527 |
</div> |
1524 |
</div> |
1528 |
<div class="modal-footer"> |
1525 |
<div class="modal-footer"> |
Lines 1570-1576
Link Here
|
1570 |
[% INCLUDE 'csrf-token.inc' %] |
1567 |
[% INCLUDE 'csrf-token.inc' %] |
1571 |
<input type="hidden" name="op" value="cud-move_hold_biblio" /> |
1568 |
<input type="hidden" name="op" value="cud-move_hold_biblio" /> |
1572 |
<button type="submit" class="btn btn-primary mt-3">Move selected holds</button> |
1569 |
<button type="submit" class="btn btn-primary mt-3">Move selected holds</button> |
1573 |
<input type="hidden" name="original_biblionumber" value="[% biblio.biblionumber %]" /> |
1570 |
<input type="hidden" name="original_biblionumber" value="[% biblio.biblionumber | html %]" /> |
1574 |
</div> |
1571 |
</div> |
1575 |
</form> |
1572 |
</form> |
1576 |
</div> |
1573 |
</div> |
Lines 1898-1903
Link Here
|
1898 |
$(document).ready(function() { |
1895 |
$(document).ready(function() { |
1899 |
$("#itemSearchForm").on("submit", function (event) { |
1896 |
$("#itemSearchForm").on("submit", function (event) { |
1900 |
event.preventDefault(); |
1897 |
event.preventDefault(); |
|
|
1898 |
$('#move_hold_item_confirm').prop('disabled' , true ); |
1901 |
|
1899 |
|
1902 |
let externalID = $("#external_id").val(); |
1900 |
let externalID = $("#external_id").val(); |
1903 |
let apiUrl = `/api/v1/items?external_id=${encodeURIComponent(externalID)}`; |
1901 |
let apiUrl = `/api/v1/items?external_id=${encodeURIComponent(externalID)}`; |
Lines 1967-1975
Link Here
|
1967 |
$(document).on("change", 'input[name="new_itemnumber"]', function() { |
1965 |
$(document).on("change", 'input[name="new_itemnumber"]', function() { |
1968 |
$('input[name="new_itemnumber"]').not(this).prop("checked", false); |
1966 |
$('input[name="new_itemnumber"]').not(this).prop("checked", false); |
1969 |
if ( $('input[name="new_itemnumber"]:checked').length ){ |
1967 |
if ( $('input[name="new_itemnumber"]:checked').length ){ |
1970 |
$('#move_hold_item_confirm').show(); |
1968 |
$('#move_hold_item_confirm').prop( 'disabled' , false ); |
1971 |
} else { |
1969 |
} else { |
1972 |
$('#move_hold_item_confirm').hide(); |
1970 |
$('#move_hold_item_confirm').prop( 'disabled' , true ); |
1973 |
} |
1971 |
} |
1974 |
}); |
1972 |
}); |
1975 |
|
1973 |
|
Lines 2111-2116
Link Here
|
2111 |
|
2109 |
|
2112 |
$('.move_hold_item').click(function(e) { |
2110 |
$('.move_hold_item').click(function(e) { |
2113 |
e.preventDefault(); |
2111 |
e.preventDefault(); |
|
|
2112 |
$('#move_hold_item_confirm').prop('disabled' , true ); |
2114 |
if($('.holds_table .select_hold:checked').length) { |
2113 |
if($('.holds_table .select_hold:checked').length) { |
2115 |
$('#itemResultMessage').empty(); |
2114 |
$('#itemResultMessage').empty(); |
2116 |
$('#move_hold_item_selection table tbody').empty(); |
2115 |
$('#move_hold_item_selection table tbody').empty(); |
Lines 2122-2130
Link Here
|
2122 |
let item_level_hold = $(this).data('item_level_hold'); |
2121 |
let item_level_hold = $(this).data('item_level_hold'); |
2123 |
let error_message = $(this).data('item_level_hold') ? "" : _("Cannot move a waiting or record level hold"); |
2122 |
let error_message = $(this).data('item_level_hold') ? "" : _("Cannot move a waiting or record level hold"); |
2124 |
let found_status = $(this).data('found'); |
2123 |
let found_status = $(this).data('found'); |
2125 |
$('#move_hold_item_selection table').append(`<tr><td>${reserve_id}</td><td>Biblionumber: <a target="_blank" href="/cgi-bin/koha/reserve/request.pl?biblionumber=${reserve_biblionumber}">${reserve_biblionumber}</a> Itemnumber: <a target="_blank" href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=${reserve_biblionumber}#item${reserve_itemnumber}">${reserve_itemnumber}</a></td><td>${error_message}</td></tr>`) |
|
|
2126 |
if ( item_level_hold ) { |
2124 |
if ( item_level_hold ) { |
2127 |
$('#move_hold_item_form').append(`<input type="hidden" name="hold_id" value="${reserve_id}">`); |
2125 |
$('#move_hold_item_selection table').append(`<tr><td><input type="checkbox" name="move_hold_id" value="${reserve_id}" checked/></td><td>${reserve_id}</td><td>Biblionumber: <a target="_blank" href="/cgi-bin/koha/reserve/request.pl?biblionumber=${reserve_biblionumber}">${reserve_biblionumber}</a> Itemnumber: <a target="_blank" href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=${reserve_biblionumber}#item${reserve_itemnumber}">${reserve_itemnumber}</a></td><td>${error_message}</td></tr>`) |
|
|
2126 |
} else { |
2127 |
$('#move_hold_item_selection table').append(`<tr><td><input type="checkbox" name="move_hold_id" value="${reserve_id}" checked/></td><td>${reserve_id}</td><td>Biblionumber: <a target="_blank" href="/cgi-bin/koha/reserve/request.pl?biblionumber=${reserve_biblionumber}">${reserve_biblionumber}</a> Itemnumber: <a target="_blank" href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=${reserve_biblionumber}#item${reserve_itemnumber}">${reserve_itemnumber}</a></td><td>${error_message}</td></tr>`) |
2128 |
} |
2128 |
} |
2129 |
}); |
2129 |
}); |
2130 |
} |
2130 |
} |