Lines 105-110
Link Here
|
105 |
:disabled { |
105 |
:disabled { |
106 |
opacity: 0.5; |
106 |
opacity: 0.5; |
107 |
} |
107 |
} |
|
|
108 |
#toolbar { |
109 |
align-items: center; |
110 |
} |
108 |
</style> |
111 |
</style> |
109 |
[% END %] |
112 |
[% END %] |
110 |
</head> |
113 |
</head> |
Lines 171-176
Link Here
|
171 |
</div> |
174 |
</div> |
172 |
[% END %] |
175 |
[% END %] |
173 |
|
176 |
|
|
|
177 |
[% IF ( hold_move_successes ) %] |
178 |
<div class="alert alert-success"> |
179 |
<p>Moved the following holds:</p> |
180 |
<ul> |
181 |
[% FOREACH hold IN hold_move_successes %] |
182 |
<li> |
183 |
<label>Hold ID: </label> |
184 |
<span>[% hold.hold_id | html %]</span> |
185 |
<span> - Moved from [%- INCLUDE 'biblio-title.inc' biblio=hold.original_biblio link = 1 -%] to [%- INCLUDE 'biblio-title.inc' biblio=hold.target_biblio link = 1 -%]</span> |
186 |
</li> |
187 |
[% END %] |
188 |
</ul> |
189 |
</div> |
190 |
[% END %] |
191 |
[% IF ( hold_move_failures ) %] |
192 |
<div class="alert alert-warning"> |
193 |
<strong>One or more holds were not moved due to following errors:</strong> |
194 |
<ul> |
195 |
[% FOREACH fail IN hold_move_failures %] |
196 |
<li> |
197 |
<label>Hold ID: </label> |
198 |
<span>[% fail.hold_id | html %]</span> |
199 |
[% SWITCH fail.error %] |
200 |
[% CASE 'cannotReserveFromOtherBranches' %] |
201 |
<span>Target item cannot be reserved from other branches</span> |
202 |
[% CASE 'ageRestricted' %] |
203 |
<span>The target record and/or items are age restricted</span> |
204 |
[% CASE 'alreadypossession' %] |
205 |
<span>Target item is already checked out to patron</span> |
206 |
[% CASE 'noReservesAllowed' %] |
207 |
<span>No holds are allowed on the target item(s)</span> |
208 |
[% CASE 'tooManyReservesToday' %] |
209 |
<span>Target item has too many holds placed on it today</span> |
210 |
[% CASE 'tooManyReserves' %] |
211 |
<span>Target item has too many holds placed on it</span> |
212 |
[% CASE 'notReservable' %] |
213 |
<span>Target item is not reservable</span> |
214 |
[% CASE 'cannotReserveFromOtherBranches' %] |
215 |
<span>Target item cannot be placed on reserve for this branch</span> |
216 |
[% CASE 'branchNotInHoldGroup' %] |
217 |
<span>Tagret item is not in the local hold group</span> |
218 |
[% CASE 'notforloan' %] |
219 |
<span>Target item is not for loan</span> |
220 |
[% CASE 'damaged' %] |
221 |
<span>Target item is damaged</span> |
222 |
[% CASE %] |
223 |
<span>Error: [% fail.error | html %]</span> |
224 |
[% END %] |
225 |
</li> |
226 |
[% END %] |
227 |
</ul> |
228 |
</div> |
229 |
[% END %] |
230 |
|
174 |
[% IF ( failed_holds ) %] |
231 |
[% IF ( failed_holds ) %] |
175 |
<div class="alert alert-warning"> |
232 |
<div class="alert alert-warning"> |
176 |
<strong>One or more holds were not placed due to following errors:</strong> |
233 |
<strong>One or more holds were not placed due to following errors:</strong> |
Lines 1235-1240
Link Here
|
1235 |
</select> |
1292 |
</select> |
1236 |
[% END %] |
1293 |
[% END %] |
1237 |
</fieldset> |
1294 |
</fieldset> |
|
|
1295 |
[% IF ( CAN_user_reserveforothers_alter_hold_targets ) %] |
1296 |
<div class="btn-group"> |
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=""> |
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> |
1301 |
</ul> |
1302 |
</div> |
1303 |
[% END %] |
1238 |
</div> |
1304 |
</div> |
1239 |
<div class="page-section"> |
1305 |
<div class="page-section"> |
1240 |
[% FOREACH biblioloo IN biblioloop %] |
1306 |
[% FOREACH biblioloo IN biblioloop %] |
Lines 1416-1421
Link Here
|
1416 |
</div> |
1482 |
</div> |
1417 |
</div> |
1483 |
</div> |
1418 |
</div> |
1484 |
</div> |
|
|
1485 |
<div id="moveHoldItemModal" class="modal modal-lg" tabindex="-1" role="dialog" aria-hidden="true"> |
1486 |
<div class="modal-dialog"> |
1487 |
<div class="modal-content"> |
1488 |
<div class="modal-header"> |
1489 |
<h1 class="modal-title">Move hold(s) to a different item</h1> |
1490 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> |
1491 |
</div> |
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> |
1508 |
<form id="itemSearchForm"> |
1509 |
<div id="move_hold_item_searchform"> |
1510 |
<h3>2. Enter the item barcode of new hold target: </h3> |
1511 |
<fieldset class="action"> |
1512 |
<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> |
1514 |
</fieldset> |
1515 |
</div> |
1516 |
</form> |
1517 |
<form id="move_hold_item_form" method="post" action="request.pl"> |
1518 |
<div id="itemResultMessage" class="mt-3"> </div> |
1519 |
<div id="move_hold_item_confirm" style="display:none;"> |
1520 |
<h3>3. Confirm moving of holds:</h3> |
1521 |
[% INCLUDE 'csrf-token.inc' %] |
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> |
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 %]" /> |
1574 |
</div> |
1575 |
</form> |
1576 |
</div> |
1577 |
<div class="modal-footer"> |
1578 |
<button type="button" class="btn btn-default" data-bs-dismiss="modal">Cancel</button> |
1579 |
</div> |
1580 |
</div> |
1581 |
</div> |
1582 |
</div> |
1419 |
<div id="hold-actions"> |
1583 |
<div id="hold-actions"> |
1420 |
<form id="hold-actions-form"> [% INCLUDE 'csrf-token.inc' %] </form> |
1584 |
<form id="hold-actions-form"> [% INCLUDE 'csrf-token.inc' %] </form> |
1421 |
</div> |
1585 |
</div> |
Lines 1468-1473
Link Here
|
1468 |
|
1632 |
|
1469 |
var MSG_CANCEL_SELECTED = _("Cancel selected (%s)"); |
1633 |
var MSG_CANCEL_SELECTED = _("Cancel selected (%s)"); |
1470 |
var MSG_CANCEL_ALERT = _("This action will cancel <span class='badge bg-danger'>%s</span> hold(s)."); |
1634 |
var MSG_CANCEL_ALERT = _("This action will cancel <span class='badge bg-danger'>%s</span> hold(s)."); |
|
|
1635 |
var MSG_MOVE_SELECTED = _("Move selected (%s)"); |
1471 |
$.fn.select2.defaults.set("width", "100%" ); |
1636 |
$.fn.select2.defaults.set("width", "100%" ); |
1472 |
$.fn.select2.defaults.set("dropdownAutoWidth", true ); |
1637 |
$.fn.select2.defaults.set("dropdownAutoWidth", true ); |
1473 |
|
1638 |
|
Lines 1731-1736
Link Here
|
1731 |
} |
1896 |
} |
1732 |
|
1897 |
|
1733 |
$(document).ready(function() { |
1898 |
$(document).ready(function() { |
|
|
1899 |
$("#itemSearchForm").on("submit", function (event) { |
1900 |
event.preventDefault(); |
1901 |
|
1902 |
let externalID = $("#external_id").val(); |
1903 |
let apiUrl = `/api/v1/items?external_id=${encodeURIComponent(externalID)}`; |
1904 |
|
1905 |
$.ajax({ |
1906 |
url: apiUrl, |
1907 |
method: "GET", |
1908 |
dataType: "json", |
1909 |
success: function (data) { |
1910 |
if (data.length > 0) { |
1911 |
let resultHtml = ""; |
1912 |
$.each(data, function (index, item) { |
1913 |
resultHtml += ` |
1914 |
<div class="alert alert-success"> |
1915 |
<strong>Biblionumber:</strong> ${item.biblio_id} <br> |
1916 |
<strong>Item:</strong> ${item.external_id} <br> |
1917 |
<input id="new_itemnumber_${item.item_id}" name="new_itemnumber" type="checkbox" value="${item.item_id}"> |
1918 |
<label for="new_itemnumber_${item.item_id}">Move all selected item level holds to this item</label> |
1919 |
<input id="new_biblionumber_${item.item_id}" name="new_biblionumber" type="hidden" value="${item.biblio_id}"> |
1920 |
</div> |
1921 |
<hr /> |
1922 |
`; |
1923 |
}); |
1924 |
$("#itemResultMessage").html(resultHtml); |
1925 |
} else { |
1926 |
$("#itemResultMessage").html(` |
1927 |
<div class="alert alert-warning">No item found with barcode: ${externalID}.</div> |
1928 |
`); |
1929 |
} |
1930 |
}, |
1931 |
}); |
1932 |
}); |
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 |
|
1967 |
$(document).on("change", 'input[name="new_itemnumber"]', function() { |
1968 |
$('input[name="new_itemnumber"]').not(this).prop("checked", false); |
1969 |
if ( $('input[name="new_itemnumber"]:checked').length ){ |
1970 |
$('#move_hold_item_confirm').show(); |
1971 |
} else { |
1972 |
$('#move_hold_item_confirm').hide(); |
1973 |
} |
1974 |
}); |
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 |
}); |
1734 |
|
1984 |
|
1735 |
$("#always_show_holds").change(function(){ |
1985 |
$("#always_show_holds").change(function(){ |
1736 |
if( $(this).prop('checked') ){ |
1986 |
if( $(this).prop('checked') ){ |
Lines 1834-1839
Link Here
|
1834 |
}); |
2084 |
}); |
1835 |
|
2085 |
|
1836 |
$('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length)); |
2086 |
$('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length)); |
|
|
2087 |
$('.move_selected_holds').html(MSG_MOVE_SELECTED.format($('.holds_table .select_hold:checked').length)); |
1837 |
|
2088 |
|
1838 |
$('.holds_table .select_hold_all').click(function() { |
2089 |
$('.holds_table .select_hold_all').click(function() { |
1839 |
var table = $(this).parents('.holds_table'); |
2090 |
var table = $(this).parents('.holds_table'); |
Lines 1841-1846
Link Here
|
1841 |
$('.select_hold', table).prop('checked', !count); |
2092 |
$('.select_hold', table).prop('checked', !count); |
1842 |
$(this).prop('checked', !count); |
2093 |
$(this).prop('checked', !count); |
1843 |
$('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length)); |
2094 |
$('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length)); |
|
|
2095 |
$('.move_selected_holds').html(MSG_MOVE_SELECTED.format($('.holds_table .select_hold:checked').length)); |
1844 |
$('#cancel_hold_alert').html( MSG_CANCEL_ALERT.format($('.holds_table .select_hold:checked').length)); |
2096 |
$('#cancel_hold_alert').html( MSG_CANCEL_ALERT.format($('.holds_table .select_hold:checked').length)); |
1845 |
$('#cancel_hold_alert').show(); |
2097 |
$('#cancel_hold_alert').show(); |
1846 |
localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')); |
2098 |
localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')); |
Lines 1851-1861
Link Here
|
1851 |
var count = $('.select_hold:not(:checked)', table).length; |
2103 |
var count = $('.select_hold:not(:checked)', table).length; |
1852 |
$('.select_hold_all', table).prop('checked', !count); |
2104 |
$('.select_hold_all', table).prop('checked', !count); |
1853 |
$('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length)); |
2105 |
$('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length)); |
|
|
2106 |
$('.move_selected_holds').html(MSG_MOVE_SELECTED.format($('.holds_table .select_hold:checked').length)); |
1854 |
$('#cancel_hold_alert').html( MSG_CANCEL_ALERT.format($('.holds_table .select_hold:checked').length)); |
2107 |
$('#cancel_hold_alert').html( MSG_CANCEL_ALERT.format($('.holds_table .select_hold:checked').length)); |
1855 |
$('#cancel_hold_alert').show(); |
2108 |
$('#cancel_hold_alert').show(); |
1856 |
localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')); |
2109 |
localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')); |
1857 |
}); |
2110 |
}); |
1858 |
|
2111 |
|
|
|
2112 |
$('.move_hold_item').click(function(e) { |
2113 |
e.preventDefault(); |
2114 |
if($('.holds_table .select_hold:checked').length) { |
2115 |
$('#itemResultMessage').empty(); |
2116 |
$('#move_hold_item_selection table tbody').empty(); |
2117 |
$('#moveHoldItemModal').modal('show'); |
2118 |
$('.select_hold:checked').each( function() { |
2119 |
let reserve_id = $(this).data('id'); |
2120 |
let reserve_biblionumber = $(this).data('biblionumber'); |
2121 |
let reserve_itemnumber = $(this).data('itemnumber'); |
2122 |
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"); |
2124 |
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 ) { |
2127 |
$('#move_hold_item_form').append(`<input type="hidden" name="hold_id" value="${reserve_id}">`); |
2128 |
} |
2129 |
}); |
2130 |
} |
2131 |
}); |
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 |
|
1859 |
$('.cancel_selected_holds').click(function(e) { |
2154 |
$('.cancel_selected_holds').click(function(e) { |
1860 |
e.preventDefault(); |
2155 |
e.preventDefault(); |
1861 |
if($('.holds_table .select_hold:checked').length) { |
2156 |
if($('.holds_table .select_hold:checked').length) { |