Lines 69-77
foreach my $bibnum (@holdable_bibs) {
Link Here
|
69 |
|
69 |
|
70 |
if ( $op eq 'cud-placerequest' && $patron ) { |
70 |
if ( $op eq 'cud-placerequest' && $patron ) { |
71 |
my %failed_holds; |
71 |
my %failed_holds; |
72 |
if ($hold_group_param) { |
72 |
my @successful_hold_ids; |
73 |
$hold_group = Koha::HoldGroup->new->store; |
|
|
74 |
} |
75 |
|
73 |
|
76 |
foreach my $biblionumber ( keys %bibinfos ) { |
74 |
foreach my $biblionumber ( keys %bibinfos ) { |
77 |
|
75 |
|
Lines 95-101
if ( $op eq 'cud-placerequest' && $patron ) {
Link Here
|
95 |
if ( $can_item_be_reserved eq 'OK' |
93 |
if ( $can_item_be_reserved eq 'OK' |
96 |
|| ( $can_item_be_reserved ne 'itemAlreadyOnHold' && $can_override ) ) |
94 |
|| ( $can_item_be_reserved ne 'itemAlreadyOnHold' && $can_override ) ) |
97 |
{ |
95 |
{ |
98 |
AddReserve( |
96 |
my $reserve_id = AddReserve( |
99 |
{ |
97 |
{ |
100 |
branchcode => $item_pickup_location, |
98 |
branchcode => $item_pickup_location, |
101 |
borrowernumber => $patron->borrowernumber, |
99 |
borrowernumber => $patron->borrowernumber, |
Lines 113-118
if ( $op eq 'cud-placerequest' && $patron ) {
Link Here
|
113 |
} |
111 |
} |
114 |
); |
112 |
); |
115 |
|
113 |
|
|
|
114 |
push @successful_hold_ids, $reserve_id; |
116 |
$hold_priority++; |
115 |
$hold_priority++; |
117 |
|
116 |
|
118 |
} else { |
117 |
} else { |
Lines 124-130
if ( $op eq 'cud-placerequest' && $patron ) {
Link Here
|
124 |
} elsif ( @biblionumbers > 1 || $multi_holds ) { |
123 |
} elsif ( @biblionumbers > 1 || $multi_holds ) { |
125 |
my $bibinfo = $bibinfos{$biblionumber}; |
124 |
my $bibinfo = $bibinfos{$biblionumber}; |
126 |
if ( $can_override || CanBookBeReserved( $patron->borrowernumber, $biblionumber )->{status} eq 'OK' ) { |
125 |
if ( $can_override || CanBookBeReserved( $patron->borrowernumber, $biblionumber )->{status} eq 'OK' ) { |
127 |
AddReserve( |
126 |
my $reserve_id = AddReserve( |
128 |
{ |
127 |
{ |
129 |
branchcode => $bibinfo->{pickup}, |
128 |
branchcode => $bibinfo->{pickup}, |
130 |
borrowernumber => $patron->borrowernumber, |
129 |
borrowernumber => $patron->borrowernumber, |
Lines 141-153
if ( $op eq 'cud-placerequest' && $patron ) {
Link Here
|
141 |
hold_group_id => $hold_group ? $hold_group->id : undef, |
140 |
hold_group_id => $hold_group ? $hold_group->id : undef, |
142 |
} |
141 |
} |
143 |
); |
142 |
); |
|
|
143 |
push @successful_hold_ids, $reserve_id; |
144 |
} |
144 |
} |
145 |
} else { |
145 |
} else { |
146 |
|
146 |
|
147 |
# place a request on 1st available |
147 |
# place a request on 1st available |
148 |
for ( my $i = 0 ; $i < $holds_to_place_count ; $i++ ) { |
148 |
for ( my $i = 0 ; $i < $holds_to_place_count ; $i++ ) { |
149 |
if ( $can_override || CanBookBeReserved( $patron->borrowernumber, $biblionumber )->{status} eq 'OK' ) { |
149 |
if ( $can_override || CanBookBeReserved( $patron->borrowernumber, $biblionumber )->{status} eq 'OK' ) { |
150 |
AddReserve( |
150 |
my $reserve_id = AddReserve( |
151 |
{ |
151 |
{ |
152 |
branchcode => $branch, |
152 |
branchcode => $branch, |
153 |
borrowernumber => $patron->borrowernumber, |
153 |
borrowernumber => $patron->borrowernumber, |
Lines 165-175
if ( $op eq 'cud-placerequest' && $patron ) {
Link Here
|
165 |
hold_group_id => $hold_group ? $hold_group->id : undef, |
165 |
hold_group_id => $hold_group ? $hold_group->id : undef, |
166 |
} |
166 |
} |
167 |
); |
167 |
); |
|
|
168 |
push @successful_hold_ids, $reserve_id; |
168 |
} |
169 |
} |
169 |
} |
170 |
} |
170 |
} |
171 |
} |
171 |
} |
172 |
} |
172 |
|
173 |
|
|
|
174 |
$patron->create_hold_group( \@successful_hold_ids ) if $hold_group_param; |
175 |
|
173 |
my $redirect_url = URI->new("request.pl"); |
176 |
my $redirect_url = URI->new("request.pl"); |
174 |
my @failed_hold_msgs = (); |
177 |
my @failed_hold_msgs = (); |
175 |
|
178 |
|
176 |
- |
|
|