|
Lines 1297-1303
Link Here
|
| 1297 |
<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> |
1297 |
<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> |
| 1298 |
<ul class="dropdown-menu" role="menu" aria-labelledby="item_record_choice" style=""> |
1298 |
<ul class="dropdown-menu" role="menu" aria-labelledby="item_record_choice" style=""> |
| 1299 |
<li><a class="dropdown-item move_hold_item" href="#">Item level holds to a different item</a></li> |
1299 |
<li><a class="dropdown-item move_hold_item" href="#">Item level holds to a different item</a></li> |
| 1300 |
<li><a class="dropdown-item move_hold_record" href="#">Record level holds to a different record</a></li> |
1300 |
<li><a class="dropdown-item move_hold_biblio" href="#">Record level holds to a different record</a></li> |
| 1301 |
</ul> |
1301 |
</ul> |
| 1302 |
</div> |
1302 |
</div> |
| 1303 |
[% END %] |
1303 |
[% END %] |
|
Lines 1536-1574
Link Here
|
| 1536 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> |
1536 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> |
| 1537 |
</div> |
1537 |
</div> |
| 1538 |
<div class="modal-body"> |
1538 |
<div class="modal-body"> |
| 1539 |
<div id="move_hold_item_selection"> |
1539 |
<div id="move_hold_bibio_search" class="alert alert-danger" style="display:none;"></div> |
| 1540 |
<h3>1. Review holds to move</h3> |
|
|
| 1541 |
<table class="table table-striped"> |
| 1542 |
<thead> |
| 1543 |
<tr> |
| 1544 |
<th>Hold ID</th> |
| 1545 |
<th>Original hold</th> |
| 1546 |
<th>Problem</th> |
| 1547 |
</tr> |
| 1548 |
</thead> |
| 1549 |
<tbody> </tbody> |
| 1550 |
</table> |
| 1551 |
</div> |
| 1552 |
<hr /> |
| 1553 |
<div id="move_hold_biblio_search" class="alert alert-danger" style="display:none;"></div> |
| 1554 |
<form id="biblioSearchForm"> |
1540 |
<form id="biblioSearchForm"> |
| 1555 |
<div id="move_hold_item_searchform"> |
1541 |
<div id="move_hold_biblio_searchform"> |
| 1556 |
<h3>2. Enter the bibloinumber of the new hold target: </h3> |
1542 |
<h3>Enter the biblionumber of new hold target: </h3> |
| 1557 |
<fieldset class="action"> |
1543 |
<fieldset class="action d-flex"> |
| 1558 |
<input type="text" class="form-control" name="biblio_id" id="biblio_id" required /> |
1544 |
<input type="text" class="form-control" name="biblio_id" id="biblio_id" required /> |
| 1559 |
<button type="submit" class="btn btn-default mt-3">Search</button> |
1545 |
<button type="submit" class="btn btn-default">Search</button> |
| 1560 |
</fieldset> |
1546 |
</fieldset> |
| 1561 |
</div> |
1547 |
</div> |
| 1562 |
</form> |
1548 |
</form> |
| 1563 |
<form id="move_hold_biblio_form" method="post" action="request.pl"> |
1549 |
<form id="move_hold_biblio_form" method="post" action="request.pl"> |
|
|
1550 |
[% INCLUDE 'csrf-token.inc' %] |
| 1551 |
<input type="hidden" name="op" value="cud-move_hold_biblio" /> |
| 1552 |
<input type="hidden" name="original_biblionumber" value="[% biblio.biblionumber | html %]" /> |
| 1564 |
<div id="biblioResultMessage" class="mt-3"> </div> |
1553 |
<div id="biblioResultMessage" class="mt-3"> </div> |
| 1565 |
<div id="move_hold_biblio_confirm" style="display:none;"> |
1554 |
<div id="move_hold_biblio_selection"> |
| 1566 |
<h3>3. Confirm moving of holds:</h3> |
1555 |
<h3>Review holds to move</h3> |
| 1567 |
[% INCLUDE 'csrf-token.inc' %] |
1556 |
<table class="table table-striped"> |
| 1568 |
<input type="hidden" name="op" value="cud-move_hold_biblio" /> |
1557 |
<thead> |
| 1569 |
<button type="submit" class="btn btn-primary mt-3">Move selected holds</button> |
1558 |
<tr> |
| 1570 |
<input type="hidden" name="original_biblionumber" value="[% biblio.biblionumber | html %]" /> |
1559 |
<th></th> |
|
|
1560 |
<th>Hold ID</th> |
| 1561 |
<th>Original hold</th> |
| 1562 |
<th>Problem</th> |
| 1563 |
</tr> |
| 1564 |
</thead> |
| 1565 |
<tbody> </tbody> |
| 1566 |
</table> |
| 1571 |
</div> |
1567 |
</div> |
|
|
1568 |
<button id="move_hold_biblio_confirm" type="submit" class="btn btn-primary" disabled="disabled">Move selected holds</button> |
| 1572 |
</form> |
1569 |
</form> |
| 1573 |
</div> |
1570 |
</div> |
| 1574 |
<div class="modal-footer"> |
1571 |
<div class="modal-footer"> |
|
Lines 1931-1936
Link Here
|
| 1931 |
|
1928 |
|
| 1932 |
$("#biblioSearchForm").on("submit", function (event) { |
1929 |
$("#biblioSearchForm").on("submit", function (event) { |
| 1933 |
event.preventDefault(); |
1930 |
event.preventDefault(); |
|
|
1931 |
$('#move_hold_biblio_confirm').prop('disabled' , true ); |
| 1934 |
|
1932 |
|
| 1935 |
let biblioID = $("#biblio_id").val(); |
1933 |
let biblioID = $("#biblio_id").val(); |
| 1936 |
let apiUrl = `/api/v1/items?q={"biblio_id":"${encodeURIComponent(biblioID)}"}`; |
1934 |
let apiUrl = `/api/v1/items?q={"biblio_id":"${encodeURIComponent(biblioID)}"}`; |
|
Lines 1974-1982
Link Here
|
| 1974 |
$(document).on("change", 'input[name="new_biblionumber"]', function() { |
1972 |
$(document).on("change", 'input[name="new_biblionumber"]', function() { |
| 1975 |
$('input[name="new_biblionumber"]').not(this).prop("checked", false); |
1973 |
$('input[name="new_biblionumber"]').not(this).prop("checked", false); |
| 1976 |
if ( $('input[name="new_biblionumber"]:checked').length ){ |
1974 |
if ( $('input[name="new_biblionumber"]:checked').length ){ |
| 1977 |
$('#move_hold_biblio_confirm').show(); |
1975 |
$('#move_hold_biblio_confirm').prop('disabled' , false ); |
| 1978 |
} else { |
1976 |
} else { |
| 1979 |
$('#move_hold_biblio_confirm').hide(); |
1977 |
$('#move_hold_biblio_confirm').prop('disabled' , true ); |
| 1980 |
} |
1978 |
} |
| 1981 |
}); |
1979 |
}); |
| 1982 |
|
1980 |
|
|
Lines 2122-2140
Link Here
|
| 2122 |
let error_message = $(this).data('item_level_hold') ? "" : _("Cannot move a waiting or record level hold"); |
2120 |
let error_message = $(this).data('item_level_hold') ? "" : _("Cannot move a waiting or record level hold"); |
| 2123 |
let found_status = $(this).data('found'); |
2121 |
let found_status = $(this).data('found'); |
| 2124 |
if ( item_level_hold ) { |
2122 |
if ( item_level_hold ) { |
| 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>`) |
2123 |
$('#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 { |
2124 |
} 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>`) |
2125 |
$('#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>`) |
| 2128 |
} |
2126 |
} |
| 2129 |
}); |
2127 |
}); |
| 2130 |
} |
2128 |
} |
| 2131 |
}); |
2129 |
}); |
| 2132 |
|
2130 |
|
| 2133 |
$('.move_hold_record').click(function(e) { |
2131 |
$('.move_hold_biblio').click(function(e) { |
| 2134 |
e.preventDefault(); |
2132 |
e.preventDefault(); |
|
|
2133 |
$('#move_hold_biblio_confirm').prop('disabled' , true ); |
| 2135 |
if($('.holds_table .select_hold:checked').length) { |
2134 |
if($('.holds_table .select_hold:checked').length) { |
| 2136 |
$('#biblioResultMessage').empty(); |
2135 |
$('#biblioResultMessage').empty(); |
| 2137 |
$('#move_hold_item_selection table tbody').empty(); |
2136 |
$('#move_hold_biblio_selection table tbody').empty(); |
| 2138 |
$('#moveHoldBiblioModal').modal('show'); |
2137 |
$('#moveHoldBiblioModal').modal('show'); |
| 2139 |
$('.select_hold:checked').each( function() { |
2138 |
$('.select_hold:checked').each( function() { |
| 2140 |
let reserve_id = $(this).data('id'); |
2139 |
let reserve_id = $(this).data('id'); |
|
Lines 2143-2151
Link Here
|
| 2143 |
let item_level_hold = $(this).data('item_level_hold'); |
2142 |
let item_level_hold = $(this).data('item_level_hold'); |
| 2144 |
let error_message = $(this).data('item_level_hold') ? _("Cannot move a waiting or item level hold") : ""; |
2143 |
let error_message = $(this).data('item_level_hold') ? _("Cannot move a waiting or item level hold") : ""; |
| 2145 |
let found_status = $(this).data('found'); |
2144 |
let found_status = $(this).data('found'); |
| 2146 |
$('#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>`) |
|
|
| 2147 |
if ( !item_level_hold ) { |
2145 |
if ( !item_level_hold ) { |
| 2148 |
$('#move_hold_biblio_form').append(`<input type="hidden" name="hold_id" value="${reserve_id}">`); |
2146 |
$('#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>`) |
|
|
2147 |
} else { |
| 2148 |
$('#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>`) |
| 2149 |
|
| 2149 |
} |
2150 |
} |
| 2150 |
}); |
2151 |
}); |
| 2151 |
} |
2152 |
} |
| 2152 |
- |
|
|