@@ -, +, @@
1 - Allow multiple holds per record in circ rules
2 - In staff client, go to place a hold on a record
3 - Select a patron
4 - Increase the number of holds
5 - Then select a specific item to hold
6 - Patron now has multiple holds on a single item
7 - Apply patch
8 - Repeat, notice that count is disabled when item checked
9 - Confirm count is enabled when 'Hold next available item' is checked
http://localhost:8081/cgi-bin/koha/reserve/placerequest.pl?biblionumber=1&checkitem=1&holds_to_place_count=2&borrowernumber=5
---
koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt | 5 ++++-
reserve/placerequest.pl | 9 ++++++---
2 files changed, 10 insertions(+), 4 deletions(-)
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
@@ -252,7 +252,7 @@
[% IF remaining_holds_for_record > 1 %]
-
+
[% ELSE %]
@@ -686,6 +686,7 @@
var MSG_NO_ITEMS_AVAILABLE = _("A hold cannot be requested on any of these items.");
columns_settings_borrowers_table = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %]
+
$(document).ready(function() {
function ToggleHoldsToPlace() {
if ( $("#requestany").prop('checked') ) {
@@ -827,8 +828,10 @@
});
if(onechecked == 1){
$("#requestany").prop("checked", false);
+ $("#holds_to_place_count").prop('disabled', true);
} else {
$("#requestany").prop("checked",true);
+ $("#holds_to_place_count").prop('disabled', false);
}
});
var prev_rank_request;
--- a/reserve/placerequest.pl
+++ a/reserve/placerequest.pl
@@ -93,9 +93,12 @@ if ( $type eq 'str8' && $borrower ) {
if ( $item->biblionumber ne $biblionumber ) {
$biblionumber = $item->biblionumber;
}
- }
-
- if ($multi_hold) {
+ if ( CanItemBeReserved($borrower->{'borrowernumber'}, $item->itemnumber, $branch)->{status} eq 'OK' ) {
+ AddReserve( $branch, $borrower->{'borrowernumber'},
+ $biblionumber, \@realbi, $rank[0], $startdate, $expirationdate, $notes, $title,
+ $checkitem, $found, $itemtype );
+ }
+ } elsif ($multi_hold) {
my $bibinfo = $bibinfos{$biblionumber};
if ( CanBookBeReserved($borrower->{'borrowernumber'}, $biblionumber)->{status} eq 'OK' ) {
AddReserve($branch,$borrower->{'borrowernumber'},$biblionumber,[$biblionumber],
--