|
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 1467-1472
Link Here
|
| 1467 |
|
1631 |
|
| 1468 |
var MSG_CANCEL_SELECTED = _("Cancel selected (%s)"); |
1632 |
var MSG_CANCEL_SELECTED = _("Cancel selected (%s)"); |
| 1469 |
var MSG_CANCEL_ALERT = _("This action will cancel <span class='badge bg-danger'>%s</span> hold(s)."); |
1633 |
var MSG_CANCEL_ALERT = _("This action will cancel <span class='badge bg-danger'>%s</span> hold(s)."); |
|
|
1634 |
var MSG_MOVE_SELECTED = _("Move selected (%s)"); |
| 1470 |
$.fn.select2.defaults.set("width", "100%" ); |
1635 |
$.fn.select2.defaults.set("width", "100%" ); |
| 1471 |
$.fn.select2.defaults.set("dropdownAutoWidth", true ); |
1636 |
$.fn.select2.defaults.set("dropdownAutoWidth", true ); |
| 1472 |
|
1637 |
|
|
Lines 1730-1735
Link Here
|
| 1730 |
} |
1895 |
} |
| 1731 |
|
1896 |
|
| 1732 |
$(document).ready(function() { |
1897 |
$(document).ready(function() { |
|
|
1898 |
$("#itemSearchForm").on("submit", function (event) { |
| 1899 |
event.preventDefault(); |
| 1900 |
|
| 1901 |
let externalID = $("#external_id").val(); |
| 1902 |
let apiUrl = `/api/v1/items?external_id=${encodeURIComponent(externalID)}`; |
| 1903 |
|
| 1904 |
$.ajax({ |
| 1905 |
url: apiUrl, |
| 1906 |
method: "GET", |
| 1907 |
dataType: "json", |
| 1908 |
success: function (data) { |
| 1909 |
if (data.length > 0) { |
| 1910 |
let resultHtml = ""; |
| 1911 |
$.each(data, function (index, item) { |
| 1912 |
resultHtml += ` |
| 1913 |
<div class="alert alert-success"> |
| 1914 |
<strong>Biblionumber:</strong> ${item.biblio_id} <br> |
| 1915 |
<strong>Item:</strong> ${item.external_id} <br> |
| 1916 |
<input id="new_itemnumber_${item.item_id}" name="new_itemnumber" type="checkbox" value="${item.item_id}"> |
| 1917 |
<label for="new_itemnumber_${item.item_id}">Move all selected item level holds to this item</label> |
| 1918 |
<input id="new_biblionumber_${item.item_id}" name="new_biblionumber" type="hidden" value="${item.biblio_id}"> |
| 1919 |
</div> |
| 1920 |
<hr /> |
| 1921 |
`; |
| 1922 |
}); |
| 1923 |
$("#itemResultMessage").html(resultHtml); |
| 1924 |
} else { |
| 1925 |
$("#itemResultMessage").html(` |
| 1926 |
<div class="alert alert-warning">No item found with barcode: ${externalID}.</div> |
| 1927 |
`); |
| 1928 |
} |
| 1929 |
}, |
| 1930 |
}); |
| 1931 |
}); |
| 1932 |
|
| 1933 |
$("#biblioSearchForm").on("submit", function (event) { |
| 1934 |
event.preventDefault(); |
| 1935 |
|
| 1936 |
let biblioID = $("#biblio_id").val(); |
| 1937 |
let apiUrl = `/api/v1/items?q={"biblio_id":"${encodeURIComponent(biblioID)}"}`; |
| 1938 |
|
| 1939 |
$.ajax({ |
| 1940 |
url: apiUrl, |
| 1941 |
method: "GET", |
| 1942 |
dataType: "json", |
| 1943 |
success: function (data) { |
| 1944 |
if (data.length > 0) { |
| 1945 |
let resultHtml = ""; |
| 1946 |
$.each(data, function (index, item) { |
| 1947 |
resultHtml += ` |
| 1948 |
<div class="alert alert-success"> |
| 1949 |
<strong>Biblionumber:</strong> ${item.biblio_id} <br> |
| 1950 |
<input id="new_biblionumber_${item.biblio_id}" name="new_biblionumber" type="checkbox" value="${item.biblio_id}"> |
| 1951 |
<label for="new_biblionumber_${item.biblio_id}">Move all selected record level holds to this record</label> |
| 1952 |
</div> |
| 1953 |
<hr /> |
| 1954 |
`; |
| 1955 |
}); |
| 1956 |
$("#biblioResultMessage").html(resultHtml); |
| 1957 |
} else { |
| 1958 |
$("#biblioResultMessage").html(` |
| 1959 |
<div class="alert alert-warning">No item found with barcode: ${biblioID}.</div> |
| 1960 |
`); |
| 1961 |
} |
| 1962 |
}, |
| 1963 |
}); |
| 1964 |
}); |
| 1965 |
|
| 1966 |
$(document).on("change", 'input[name="new_itemnumber"]', function() { |
| 1967 |
$('input[name="new_itemnumber"]').not(this).prop("checked", false); |
| 1968 |
if ( $('input[name="new_itemnumber"]:checked').length ){ |
| 1969 |
$('#move_hold_item_confirm').show(); |
| 1970 |
} else { |
| 1971 |
$('#move_hold_item_confirm').hide(); |
| 1972 |
} |
| 1973 |
}); |
| 1974 |
|
| 1975 |
$(document).on("change", 'input[name="new_biblionumber"]', function() { |
| 1976 |
$('input[name="new_biblionumber"]').not(this).prop("checked", false); |
| 1977 |
if ( $('input[name="new_biblionumber"]:checked').length ){ |
| 1978 |
$('#move_hold_biblio_confirm').show(); |
| 1979 |
} else { |
| 1980 |
$('#move_hold_biblio_confirm').hide(); |
| 1981 |
} |
| 1982 |
}); |
| 1733 |
|
1983 |
|
| 1734 |
$("#always_show_holds").change(function(){ |
1984 |
$("#always_show_holds").change(function(){ |
| 1735 |
if( $(this).prop('checked') ){ |
1985 |
if( $(this).prop('checked') ){ |
|
Lines 1833-1838
Link Here
|
| 1833 |
}); |
2083 |
}); |
| 1834 |
|
2084 |
|
| 1835 |
$('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length)); |
2085 |
$('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length)); |
|
|
2086 |
$('.move_selected_holds').html(MSG_MOVE_SELECTED.format($('.holds_table .select_hold:checked').length)); |
| 1836 |
|
2087 |
|
| 1837 |
$('.holds_table .select_hold_all').click(function() { |
2088 |
$('.holds_table .select_hold_all').click(function() { |
| 1838 |
var table = $(this).parents('.holds_table'); |
2089 |
var table = $(this).parents('.holds_table'); |
|
Lines 1840-1845
Link Here
|
| 1840 |
$('.select_hold', table).prop('checked', !count); |
2091 |
$('.select_hold', table).prop('checked', !count); |
| 1841 |
$(this).prop('checked', !count); |
2092 |
$(this).prop('checked', !count); |
| 1842 |
$('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length)); |
2093 |
$('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length)); |
|
|
2094 |
$('.move_selected_holds').html(MSG_MOVE_SELECTED.format($('.holds_table .select_hold:checked').length)); |
| 1843 |
$('#cancel_hold_alert').html( MSG_CANCEL_ALERT.format($('.holds_table .select_hold:checked').length)); |
2095 |
$('#cancel_hold_alert').html( MSG_CANCEL_ALERT.format($('.holds_table .select_hold:checked').length)); |
| 1844 |
$('#cancel_hold_alert').show(); |
2096 |
$('#cancel_hold_alert').show(); |
| 1845 |
localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')); |
2097 |
localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')); |
|
Lines 1850-1860
Link Here
|
| 1850 |
var count = $('.select_hold:not(:checked)', table).length; |
2102 |
var count = $('.select_hold:not(:checked)', table).length; |
| 1851 |
$('.select_hold_all', table).prop('checked', !count); |
2103 |
$('.select_hold_all', table).prop('checked', !count); |
| 1852 |
$('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length)); |
2104 |
$('.cancel_selected_holds').html(MSG_CANCEL_SELECTED.format($('.holds_table .select_hold:checked').length)); |
|
|
2105 |
$('.move_selected_holds').html(MSG_MOVE_SELECTED.format($('.holds_table .select_hold:checked').length)); |
| 1853 |
$('#cancel_hold_alert').html( MSG_CANCEL_ALERT.format($('.holds_table .select_hold:checked').length)); |
2106 |
$('#cancel_hold_alert').html( MSG_CANCEL_ALERT.format($('.holds_table .select_hold:checked').length)); |
| 1854 |
$('#cancel_hold_alert').show(); |
2107 |
$('#cancel_hold_alert').show(); |
| 1855 |
localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')); |
2108 |
localStorage.selectedHolds = $('.holds_table .select_hold:checked').toArray().map(el => $(el).data('id')); |
| 1856 |
}); |
2109 |
}); |
| 1857 |
|
2110 |
|
|
|
2111 |
$('.move_hold_item').click(function(e) { |
| 2112 |
e.preventDefault(); |
| 2113 |
if($('.holds_table .select_hold:checked').length) { |
| 2114 |
$('#itemResultMessage').empty(); |
| 2115 |
$('#move_hold_item_selection table tbody').empty(); |
| 2116 |
$('#moveHoldItemModal').modal('show'); |
| 2117 |
$('.select_hold:checked').each( function() { |
| 2118 |
let reserve_id = $(this).data('id'); |
| 2119 |
let reserve_biblionumber = $(this).data('biblionumber'); |
| 2120 |
let reserve_itemnumber = $(this).data('itemnumber'); |
| 2121 |
let item_level_hold = $(this).data('item_level_hold'); |
| 2122 |
let error_message = $(this).data('item_level_hold') ? "" : _("Cannot move a waiting or record level hold"); |
| 2123 |
let found_status = $(this).data('found'); |
| 2124 |
$('#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>`) |
| 2125 |
if ( item_level_hold ) { |
| 2126 |
$('#move_hold_item_form').append(`<input type="hidden" name="hold_id" value="${reserve_id}">`); |
| 2127 |
} |
| 2128 |
}); |
| 2129 |
} |
| 2130 |
}); |
| 2131 |
|
| 2132 |
$('.move_hold_record').click(function(e) { |
| 2133 |
e.preventDefault(); |
| 2134 |
if($('.holds_table .select_hold:checked').length) { |
| 2135 |
$('#biblioResultMessage').empty(); |
| 2136 |
$('#move_hold_item_selection table tbody').empty(); |
| 2137 |
$('#moveHoldBiblioModal').modal('show'); |
| 2138 |
$('.select_hold:checked').each( function() { |
| 2139 |
let reserve_id = $(this).data('id'); |
| 2140 |
let reserve_biblionumber = $(this).data('biblionumber'); |
| 2141 |
let reserve_itemnumber = $(this).data('itemnumber'); |
| 2142 |
let item_level_hold = $(this).data('item_level_hold'); |
| 2143 |
let error_message = $(this).data('item_level_hold') ? _("Cannot move a waiting or item level hold") : ""; |
| 2144 |
let found_status = $(this).data('found'); |
| 2145 |
$('#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>`) |
| 2146 |
if ( !item_level_hold ) { |
| 2147 |
$('#move_hold_biblio_form').append(`<input type="hidden" name="hold_id" value="${reserve_id}">`); |
| 2148 |
} |
| 2149 |
}); |
| 2150 |
} |
| 2151 |
}); |
| 2152 |
|
| 1858 |
$('.cancel_selected_holds').click(function(e) { |
2153 |
$('.cancel_selected_holds').click(function(e) { |
| 1859 |
e.preventDefault(); |
2154 |
e.preventDefault(); |
| 1860 |
if($('.holds_table .select_hold:checked').length) { |
2155 |
if($('.holds_table .select_hold:checked').length) { |