Lines 1240-1246
Link Here
|
1240 |
<a class="btn btn-default btn-xs dropdown-toggle move_selected_holds" id="item_record_choice" role="button" data-bs-toggle="dropdown" href="#" aria-expanded="false"></a> |
1240 |
<a class="btn btn-default btn-xs dropdown-toggle move_selected_holds" id="item_record_choice" role="button" data-bs-toggle="dropdown" href="#" aria-expanded="false"></a> |
1241 |
<ul class="dropdown-menu" role="menu" aria-labelledby="item_record_choice" style=""> |
1241 |
<ul class="dropdown-menu" role="menu" aria-labelledby="item_record_choice" style=""> |
1242 |
<li><a class="dropdown-item move_hold_item" href="#">Item level holds to a different item</a></li> |
1242 |
<li><a class="dropdown-item move_hold_item" href="#">Item level holds to a different item</a></li> |
1243 |
<li><a class="dropdown-item move_hold_record" href="#">Record level holds to a different record</a></li> |
1243 |
<li><a class="dropdown-item move_hold_biblio" href="#">Record level holds to a different record</a></li> |
1244 |
</ul> |
1244 |
</ul> |
1245 |
</div> |
1245 |
</div> |
1246 |
[% END %] |
1246 |
[% END %] |
Lines 1479-1517
Link Here
|
1479 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> |
1479 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> |
1480 |
</div> |
1480 |
</div> |
1481 |
<div class="modal-body"> |
1481 |
<div class="modal-body"> |
1482 |
<div id="move_hold_item_selection"> |
1482 |
<div id="move_hold_bibio_search" class="alert alert-danger" style="display:none;"></div> |
1483 |
<h3>1. Review holds to move</h3> |
|
|
1484 |
<table class="table table-striped"> |
1485 |
<thead> |
1486 |
<tr> |
1487 |
<th>Hold ID</th> |
1488 |
<th>Original hold</th> |
1489 |
<th>Problem</th> |
1490 |
</tr> |
1491 |
</thead> |
1492 |
<tbody> </tbody> |
1493 |
</table> |
1494 |
</div> |
1495 |
<hr /> |
1496 |
<div id="move_hold_biblio_search" class="alert alert-danger" style="display:none;"></div> |
1497 |
<form id="biblioSearchForm"> |
1483 |
<form id="biblioSearchForm"> |
1498 |
<div id="move_hold_item_searchform"> |
1484 |
<div id="move_hold_biblio_searchform"> |
1499 |
<h3>2. Enter the bibloinumber of the new hold target: </h3> |
1485 |
<h3>Enter the biblionumber of new hold target: </h3> |
1500 |
<fieldset class="action"> |
1486 |
<fieldset class="action d-flex"> |
1501 |
<input type="text" class="form-control" name="biblio_id" id="biblio_id" required /> |
1487 |
<input type="text" class="form-control" name="biblio_id" id="biblio_id" required /> |
1502 |
<button type="submit" class="btn btn-default mt-3">Search</button> |
1488 |
<button type="submit" class="btn btn-default">Search</button> |
1503 |
</fieldset> |
1489 |
</fieldset> |
1504 |
</div> |
1490 |
</div> |
1505 |
</form> |
1491 |
</form> |
1506 |
<form id="move_hold_biblio_form" method="post" action="request.pl"> |
1492 |
<form id="move_hold_biblio_form" method="post" action="request.pl"> |
|
|
1493 |
[% INCLUDE 'csrf-token.inc' %] |
1494 |
<input type="hidden" name="op" value="cud-move_hold_biblio" /> |
1495 |
<input type="hidden" name="original_biblionumber" value="[% biblio.biblionumber | html %]" /> |
1507 |
<div id="biblioResultMessage" class="mt-3"> </div> |
1496 |
<div id="biblioResultMessage" class="mt-3"> </div> |
1508 |
<div id="move_hold_biblio_confirm" style="display:none;"> |
1497 |
<div id="move_hold_biblio_selection"> |
1509 |
<h3>3. Confirm moving of holds:</h3> |
1498 |
<h3>Review holds to move</h3> |
1510 |
[% INCLUDE 'csrf-token.inc' %] |
1499 |
<table class="table table-striped"> |
1511 |
<input type="hidden" name="op" value="cud-move_hold_biblio" /> |
1500 |
<thead> |
1512 |
<button type="submit" class="btn btn-primary mt-3">Move selected holds</button> |
1501 |
<tr> |
1513 |
<input type="hidden" name="original_biblionumber" value="[% biblio.biblionumber | html %]" /> |
1502 |
<th></th> |
|
|
1503 |
<th>Hold ID</th> |
1504 |
<th>Original hold</th> |
1505 |
<th>Problem</th> |
1506 |
</tr> |
1507 |
</thead> |
1508 |
<tbody> </tbody> |
1509 |
</table> |
1514 |
</div> |
1510 |
</div> |
|
|
1511 |
<button id="move_hold_biblio_confirm" type="submit" class="btn btn-primary" disabled="disabled">Move selected holds</button> |
1515 |
</form> |
1512 |
</form> |
1516 |
</div> |
1513 |
</div> |
1517 |
<div class="modal-footer"> |
1514 |
<div class="modal-footer"> |
Lines 1872-1877
Link Here
|
1872 |
|
1869 |
|
1873 |
$("#biblioSearchForm").on("submit", function (event) { |
1870 |
$("#biblioSearchForm").on("submit", function (event) { |
1874 |
event.preventDefault(); |
1871 |
event.preventDefault(); |
|
|
1872 |
$('#move_hold_biblio_confirm').prop('disabled' , true ); |
1875 |
|
1873 |
|
1876 |
let biblioID = $("#biblio_id").val(); |
1874 |
let biblioID = $("#biblio_id").val(); |
1877 |
let apiUrl = `/api/v1/items?q={"biblio_id":"${encodeURIComponent(biblioID)}"}`; |
1875 |
let apiUrl = `/api/v1/items?q={"biblio_id":"${encodeURIComponent(biblioID)}"}`; |
Lines 1915-1923
Link Here
|
1915 |
$(document).on("change", 'input[name="new_biblionumber"]', function() { |
1913 |
$(document).on("change", 'input[name="new_biblionumber"]', function() { |
1916 |
$('input[name="new_biblionumber"]').not(this).prop("checked", false); |
1914 |
$('input[name="new_biblionumber"]').not(this).prop("checked", false); |
1917 |
if ( $('input[name="new_biblionumber"]:checked').length ){ |
1915 |
if ( $('input[name="new_biblionumber"]:checked').length ){ |
1918 |
$('#move_hold_biblio_confirm').show(); |
1916 |
$('#move_hold_biblio_confirm').prop('disabled' , false ); |
1919 |
} else { |
1917 |
} else { |
1920 |
$('#move_hold_biblio_confirm').hide(); |
1918 |
$('#move_hold_biblio_confirm').prop('disabled' , true ); |
1921 |
} |
1919 |
} |
1922 |
}); |
1920 |
}); |
1923 |
|
1921 |
|
Lines 2060-2078
Link Here
|
2060 |
let error_message = $(this).data('item_level_hold') ? "" : _("Cannot move a waiting or record level hold"); |
2058 |
let error_message = $(this).data('item_level_hold') ? "" : _("Cannot move a waiting or record level hold"); |
2061 |
let found_status = $(this).data('found'); |
2059 |
let found_status = $(this).data('found'); |
2062 |
if ( item_level_hold ) { |
2060 |
if ( item_level_hold ) { |
2063 |
$('#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>`) |
2061 |
$('#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>`) |
2064 |
} else { |
2062 |
} else { |
2065 |
$('#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>`) |
2063 |
$('#move_hold_item_selection table').append(`<tr><td><input type="checkbox" name="move_hold_id" value="${reserve_id}" disabled /></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>`) |
2066 |
} |
2064 |
} |
2067 |
}); |
2065 |
}); |
2068 |
} |
2066 |
} |
2069 |
}); |
2067 |
}); |
2070 |
|
2068 |
|
2071 |
$('.move_hold_record').click(function(e) { |
2069 |
$('.move_hold_biblio').click(function(e) { |
2072 |
e.preventDefault(); |
2070 |
e.preventDefault(); |
|
|
2071 |
$('#move_hold_biblio_confirm').prop('disabled' , true ); |
2073 |
if($('.holds_table .select_hold:checked').length) { |
2072 |
if($('.holds_table .select_hold:checked').length) { |
2074 |
$('#biblioResultMessage').empty(); |
2073 |
$('#biblioResultMessage').empty(); |
2075 |
$('#move_hold_item_selection table tbody').empty(); |
2074 |
$('#move_hold_biblio_selection table tbody').empty(); |
2076 |
$('#moveHoldBiblioModal').modal('show'); |
2075 |
$('#moveHoldBiblioModal').modal('show'); |
2077 |
$('.select_hold:checked').each( function() { |
2076 |
$('.select_hold:checked').each( function() { |
2078 |
let reserve_id = $(this).data('id'); |
2077 |
let reserve_id = $(this).data('id'); |
Lines 2081-2089
Link Here
|
2081 |
let item_level_hold = $(this).data('item_level_hold'); |
2080 |
let item_level_hold = $(this).data('item_level_hold'); |
2082 |
let error_message = $(this).data('item_level_hold') ? _("Cannot move a waiting or item level hold") : ""; |
2081 |
let error_message = $(this).data('item_level_hold') ? _("Cannot move a waiting or item level hold") : ""; |
2083 |
let found_status = $(this).data('found'); |
2082 |
let found_status = $(this).data('found'); |
2084 |
$('#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></td><td>${error_message}</td></tr>`) |
|
|
2085 |
if ( !item_level_hold ) { |
2083 |
if ( !item_level_hold ) { |
2086 |
$('#move_hold_biblio_form').append(`<input type="hidden" name="hold_id" value="${reserve_id}">`); |
2084 |
$('#move_hold_biblio_selection table').append(`<tr><td><input type="checkbox" name="move_hold_id" value="${reserve_id}" checked /><td>${reserve_id}</td><td>Biblionumber: <a target="_blank" href="/cgi-bin/koha/reserve/request.pl?biblionumber=${reserve_biblionumber}">${reserve_biblionumber}</a></td><td>${error_message}</td></tr>`) |
|
|
2085 |
} else { |
2086 |
$('#move_hold_biblio_selection table').append(`<tr><td><input type="checkbox" name="move_hold_id" value="${reserve_id}" disabled /><td>${reserve_id}</td><td>Biblionumber: <a target="_blank" href="/cgi-bin/koha/reserve/request.pl?biblionumber=${reserve_biblionumber}">${reserve_biblionumber}</a></td><td>${error_message}</td></tr>`) |
2087 |
|
2087 |
} |
2088 |
} |
2088 |
}); |
2089 |
}); |
2089 |
} |
2090 |
} |
2090 |
- |
|
|