Lines 71-104
if ( $patron ) {
Link Here
|
71 |
my $can_override = C4::Context->preference('AllowHoldPolicyOverride'); |
71 |
my $can_override = C4::Context->preference('AllowHoldPolicyOverride'); |
72 |
if ( defined $checkitem && $checkitem ne '' ) { |
72 |
if ( defined $checkitem && $checkitem ne '' ) { |
73 |
|
73 |
|
74 |
my $item_pickup_location = $input->param("item_pickup_$checkitem"); |
74 |
if ( my $item_pickup_location = $input->param("item_pickup_$checkitem") ) { |
75 |
|
75 |
|
76 |
my $item = Koha::Items->find($checkitem); |
76 |
my $item = Koha::Items->find($checkitem); |
77 |
|
77 |
|
78 |
if ( $item->biblionumber ne $biblionumber ) { |
78 |
if ( $item->biblionumber ne $biblionumber ) { |
79 |
$biblionumber = $item->biblionumber; |
79 |
$biblionumber = $item->biblionumber; |
80 |
} |
80 |
} |
81 |
|
81 |
|
82 |
my $can_item_be_reserved = CanItemBeReserved($patron, $item, $item_pickup_location)->{status}; |
82 |
my $can_item_be_reserved = CanItemBeReserved($patron, $item, $item_pickup_location)->{status}; |
83 |
|
83 |
|
84 |
if ( $can_item_be_reserved eq 'OK' || ( $can_item_be_reserved ne 'itemAlreadyOnHold' && $can_override ) ) { |
84 |
if ( $item_pickup_location || $can_item_be_reserved eq 'OK' || ( $can_item_be_reserved ne 'itemAlreadyOnHold' && $can_override ) ) { |
85 |
AddReserve( |
85 |
AddReserve( |
86 |
{ |
86 |
{ |
87 |
branchcode => $item_pickup_location, |
87 |
branchcode => $item_pickup_location, |
88 |
borrowernumber => $patron->borrowernumber, |
88 |
borrowernumber => $patron->borrowernumber, |
89 |
biblionumber => $biblionumber, |
89 |
biblionumber => $biblionumber, |
90 |
priority => $rank[0], |
90 |
priority => $rank[0], |
91 |
reservation_date => $startdate, |
91 |
reservation_date => $startdate, |
92 |
expiration_date => $expirationdate, |
92 |
expiration_date => $expirationdate, |
93 |
notes => $notes, |
93 |
notes => $notes, |
94 |
title => $title, |
94 |
title => $title, |
95 |
itemnumber => $checkitem, |
95 |
itemnumber => $checkitem, |
96 |
found => $found, |
96 |
found => $found, |
97 |
itemtype => $itemtype, |
97 |
itemtype => $itemtype, |
98 |
non_priority => $non_priority, |
98 |
non_priority => $non_priority, |
99 |
} |
99 |
} |
100 |
); |
100 |
); |
101 |
|
101 |
|
|
|
102 |
} |
102 |
} |
103 |
} |
103 |
|
104 |
|
104 |
} elsif (@biblionumbers > 1) { |
105 |
} elsif (@biblionumbers > 1) { |
105 |
- |
|
|