|
Lines 1505-1511
Link Here
|
| 1505 |
</div> |
1505 |
</div> |
| 1506 |
<hr /> |
1506 |
<hr /> |
| 1507 |
<div id="move_hold_item_search" class="alert alert-danger" style="display:none;"></div> |
1507 |
<div id="move_hold_item_search" class="alert alert-danger" style="display:none;"></div> |
| 1508 |
<form id="searchForm"> |
1508 |
<form id="itemSearchForm"> |
| 1509 |
<div id="move_hold_item_searchform"> |
1509 |
<div id="move_hold_item_searchform"> |
| 1510 |
<h3>2. Enter the item barcode of new hold target: </h3> |
1510 |
<h3>2. Enter the item barcode of new hold target: </h3> |
| 1511 |
<fieldset class="action"> |
1511 |
<fieldset class="action"> |
|
Lines 1515-1526
Link Here
|
| 1515 |
</div> |
1515 |
</div> |
| 1516 |
</form> |
1516 |
</form> |
| 1517 |
<form id="move_hold_item_form" method="post" action="request.pl"> |
1517 |
<form id="move_hold_item_form" method="post" action="request.pl"> |
| 1518 |
<div id="resultMessage" class="mt-3"> </div> |
1518 |
<div id="itemResultMessage" class="mt-3"> </div> |
| 1519 |
<div id="move_hold_item_confirm" style="display:none;"> |
1519 |
<div id="move_hold_item_confirm" style="display:none;"> |
| 1520 |
<h3>3. Confirm moving of holds:</h3> |
1520 |
<h3>3. Confirm moving of holds:</h3> |
| 1521 |
[% INCLUDE 'csrf-token.inc' %] |
1521 |
[% INCLUDE 'csrf-token.inc' %] |
| 1522 |
<input type="hidden" name="op" value="cud-move_hold_item" /> |
1522 |
<input type="hidden" name="op" value="cud-move_hold_item" /> |
| 1523 |
<button type="submit" class="btn btn-primary mt-3">Move selected holds</button> |
1523 |
<button type="submit" class="btn btn-primary mt-3">Move selected holds</button> |
|
|
1524 |
<input type="hidden" name="original_biblionumber" value="[% biblio.biblionumber %]" /> |
| 1525 |
</div> |
| 1526 |
</form> |
| 1527 |
</div> |
| 1528 |
<div class="modal-footer"> |
| 1529 |
<button type="button" class="btn btn-default" data-bs-dismiss="modal">Cancel</button> |
| 1530 |
</div> |
| 1531 |
</div> |
| 1532 |
</div> |
| 1533 |
</div> |
| 1534 |
<div id="moveHoldBiblioModal" class="modal modal-lg" tabindex="-1" role="dialog" aria-hidden="true"> |
| 1535 |
<div class="modal-dialog"> |
| 1536 |
<div class="modal-content"> |
| 1537 |
<div class="modal-header"> |
| 1538 |
<h1 class="modal-title">Move hold(s) to a different record</h1> |
| 1539 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> |
| 1540 |
</div> |
| 1541 |
<div class="modal-body"> |
| 1542 |
<div id="move_hold_item_selection"> |
| 1543 |
<h3>1. Review holds to move</h3> |
| 1544 |
<table class="table table-striped"> |
| 1545 |
<thead> |
| 1546 |
<tr> |
| 1547 |
<th>Hold ID</th> |
| 1548 |
<th>Original hold</th> |
| 1549 |
<th>Problem</th> |
| 1550 |
</tr> |
| 1551 |
</thead> |
| 1552 |
<tbody> </tbody> |
| 1553 |
</table> |
| 1554 |
</div> |
| 1555 |
<hr /> |
| 1556 |
<div id="move_hold_biblio_search" class="alert alert-danger" style="display:none;"></div> |
| 1557 |
<form id="biblioSearchForm"> |
| 1558 |
<div id="move_hold_item_searchform"> |
| 1559 |
<h3>2. Enter the bibloinumber of the new hold target: </h3> |
| 1560 |
<fieldset class="action"> |
| 1561 |
<input type="text" class="form-control" name="biblio_id" id="biblio_id" required /> |
| 1562 |
<button type="submit" class="btn btn-default mt-3">Search</button> |
| 1563 |
</fieldset> |
| 1564 |
</div> |
| 1565 |
</form> |
| 1566 |
<form id="move_hold_biblio_form" method="post" action="request.pl"> |
| 1567 |
<div id="biblioResultMessage" class="mt-3"> </div> |
| 1568 |
<div id="move_hold_biblio_confirm" style="display:none;"> |
| 1569 |
<h3>3. Confirm moving of holds:</h3> |
| 1570 |
[% INCLUDE 'csrf-token.inc' %] |
| 1571 |
<input type="hidden" name="op" value="cud-move_hold_biblio" /> |
| 1572 |
<button type="submit" class="btn btn-primary mt-3">Move selected holds</button> |
| 1573 |
<input type="hidden" name="original_biblionumber" value="[% biblio.biblionumber %]" /> |
| 1524 |
</div> |
1574 |
</div> |
| 1525 |
</form> |
1575 |
</form> |
| 1526 |
</div> |
1576 |
</div> |
|
Lines 1846-1852
Link Here
|
| 1846 |
} |
1896 |
} |
| 1847 |
|
1897 |
|
| 1848 |
$(document).ready(function() { |
1898 |
$(document).ready(function() { |
| 1849 |
$("#searchForm").on("submit", function (event) { |
1899 |
$("#itemSearchForm").on("submit", function (event) { |
| 1850 |
event.preventDefault(); |
1900 |
event.preventDefault(); |
| 1851 |
|
1901 |
|
| 1852 |
let externalID = $("#external_id").val(); |
1902 |
let externalID = $("#external_id").val(); |
|
Lines 1871-1879
Link Here
|
| 1871 |
<hr /> |
1921 |
<hr /> |
| 1872 |
`; |
1922 |
`; |
| 1873 |
}); |
1923 |
}); |
| 1874 |
$("#resultMessage").html(resultHtml); |
1924 |
$("#itemResultMessage").html(resultHtml); |
| 1875 |
} else { |
1925 |
} else { |
| 1876 |
$("#resultMessage").html(` |
1926 |
$("#itemResultMessage").html(` |
| 1877 |
<div class="alert alert-warning">No item found with barcode: ${externalID}.</div> |
1927 |
<div class="alert alert-warning">No item found with barcode: ${externalID}.</div> |
| 1878 |
`); |
1928 |
`); |
| 1879 |
} |
1929 |
} |
|
Lines 1881-1886
Link Here
|
| 1881 |
}); |
1931 |
}); |
| 1882 |
}); |
1932 |
}); |
| 1883 |
|
1933 |
|
|
|
1934 |
$("#biblioSearchForm").on("submit", function (event) { |
| 1935 |
event.preventDefault(); |
| 1936 |
|
| 1937 |
let biblioID = $("#biblio_id").val(); |
| 1938 |
let apiUrl = `/api/v1/items?q={"biblio_id":"${encodeURIComponent(biblioID)}"}`; |
| 1939 |
|
| 1940 |
$.ajax({ |
| 1941 |
url: apiUrl, |
| 1942 |
method: "GET", |
| 1943 |
dataType: "json", |
| 1944 |
success: function (data) { |
| 1945 |
if (data.length > 0) { |
| 1946 |
let resultHtml = ""; |
| 1947 |
$.each(data, function (index, item) { |
| 1948 |
resultHtml += ` |
| 1949 |
<div class="alert alert-success"> |
| 1950 |
<strong>Biblionumber:</strong> ${item.biblio_id} <br> |
| 1951 |
<input id="new_biblionumber_${item.biblio_id}" name="new_biblionumber" type="checkbox" value="${item.biblio_id}"> |
| 1952 |
<label for="new_biblionumber_${item.biblio_id}">Move all selected record level holds to this record</label> |
| 1953 |
</div> |
| 1954 |
<hr /> |
| 1955 |
`; |
| 1956 |
}); |
| 1957 |
$("#biblioResultMessage").html(resultHtml); |
| 1958 |
} else { |
| 1959 |
$("#biblioResultMessage").html(` |
| 1960 |
<div class="alert alert-warning">No item found with barcode: ${biblioID}.</div> |
| 1961 |
`); |
| 1962 |
} |
| 1963 |
}, |
| 1964 |
}); |
| 1965 |
}); |
| 1966 |
|
| 1884 |
$(document).on("change", 'input[name="new_itemnumber"]', function() { |
1967 |
$(document).on("change", 'input[name="new_itemnumber"]', function() { |
| 1885 |
$('input[name="new_itemnumber"]').not(this).prop("checked", false); |
1968 |
$('input[name="new_itemnumber"]').not(this).prop("checked", false); |
| 1886 |
if ( $('input[name="new_itemnumber"]:checked').length ){ |
1969 |
if ( $('input[name="new_itemnumber"]:checked').length ){ |
|
Lines 1890-1895
Link Here
|
| 1890 |
} |
1973 |
} |
| 1891 |
}); |
1974 |
}); |
| 1892 |
|
1975 |
|
|
|
1976 |
$(document).on("change", 'input[name="new_biblionumber"]', function() { |
| 1977 |
$('input[name="new_biblionumber"]').not(this).prop("checked", false); |
| 1978 |
if ( $('input[name="new_biblionumber"]:checked').length ){ |
| 1979 |
$('#move_hold_biblio_confirm').show(); |
| 1980 |
} else { |
| 1981 |
$('#move_hold_biblio_confirm').hide(); |
| 1982 |
} |
| 1983 |
}); |
| 1984 |
|
| 1893 |
$("#always_show_holds").change(function(){ |
1985 |
$("#always_show_holds").change(function(){ |
| 1894 |
if( $(this).prop('checked') ){ |
1986 |
if( $(this).prop('checked') ){ |
| 1895 |
document.cookie = 'always_show_holds=DO'; |
1987 |
document.cookie = 'always_show_holds=DO'; |
|
Lines 2020-2026
Link Here
|
| 2020 |
$('.move_hold_item').click(function(e) { |
2112 |
$('.move_hold_item').click(function(e) { |
| 2021 |
e.preventDefault(); |
2113 |
e.preventDefault(); |
| 2022 |
if($('.holds_table .select_hold:checked').length) { |
2114 |
if($('.holds_table .select_hold:checked').length) { |
| 2023 |
$('#moveHoldItemModal #resultMessage').empty(); |
2115 |
$('#itemResultMessage').empty(); |
| 2024 |
$('#move_hold_item_selection table tbody').empty(); |
2116 |
$('#move_hold_item_selection table tbody').empty(); |
| 2025 |
$('#moveHoldItemModal').modal('show'); |
2117 |
$('#moveHoldItemModal').modal('show'); |
| 2026 |
$('.select_hold:checked').each( function() { |
2118 |
$('.select_hold:checked').each( function() { |
|
Lines 2038-2043
Link Here
|
| 2038 |
} |
2130 |
} |
| 2039 |
}); |
2131 |
}); |
| 2040 |
|
2132 |
|
|
|
2133 |
$('.move_hold_record').click(function(e) { |
| 2134 |
e.preventDefault(); |
| 2135 |
if($('.holds_table .select_hold:checked').length) { |
| 2136 |
$('#biblioResultMessage').empty(); |
| 2137 |
$('#move_hold_item_selection table tbody').empty(); |
| 2138 |
$('#moveHoldBiblioModal').modal('show'); |
| 2139 |
$('.select_hold:checked').each( function() { |
| 2140 |
let reserve_id = $(this).data('id'); |
| 2141 |
let reserve_biblionumber = $(this).data('biblionumber'); |
| 2142 |
let reserve_itemnumber = $(this).data('itemnumber'); |
| 2143 |
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") : ""; |
| 2145 |
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 ) { |
| 2148 |
$('#move_hold_biblio_form').append(`<input type="hidden" name="hold_id" value="${reserve_id}">`); |
| 2149 |
} |
| 2150 |
}); |
| 2151 |
} |
| 2152 |
}); |
| 2153 |
|
| 2041 |
$('.cancel_selected_holds').click(function(e) { |
2154 |
$('.cancel_selected_holds').click(function(e) { |
| 2042 |
e.preventDefault(); |
2155 |
e.preventDefault(); |
| 2043 |
if($('.holds_table .select_hold:checked').length) { |
2156 |
if($('.holds_table .select_hold:checked').length) { |