Lines 76-91
sub add {
Link Here
|
76 |
my $biblio; |
76 |
my $biblio; |
77 |
my $item; |
77 |
my $item; |
78 |
|
78 |
|
79 |
my $biblio_id = $body->{biblio_id}; |
79 |
my $biblio_id = $body->{biblio_id}; |
80 |
my $item_group_id = $body->{item_group_id}; |
80 |
my $item_group_id = $body->{item_group_id}; |
81 |
my $pickup_library_id = $body->{pickup_library_id}; |
81 |
my $pickup_library_id = $body->{pickup_library_id}; |
82 |
my $item_id = $body->{item_id}; |
82 |
my $item_id = $body->{item_id}; |
83 |
my $patron_id = $body->{patron_id}; |
83 |
my $patron_id = $body->{patron_id}; |
84 |
my $item_type = $body->{item_type}; |
84 |
my $item_type = $body->{item_type}; |
85 |
my $expiration_date = $body->{expiration_date}; |
85 |
my $expiration_date = $body->{expiration_date}; |
86 |
my $notes = $body->{notes}; |
86 |
my $patron_expiration_date = $body->{patron_expiration_date}; |
87 |
my $hold_date = $body->{hold_date}; |
87 |
my $notes = $body->{notes}; |
88 |
my $non_priority = $body->{non_priority}; |
88 |
my $hold_date = $body->{hold_date}; |
|
|
89 |
my $non_priority = $body->{non_priority}; |
89 |
|
90 |
|
90 |
my $overrides = $c->stash('koha.overrides'); |
91 |
my $overrides = $c->stash('koha.overrides'); |
91 |
my $can_override = C4::Context->preference('AllowHoldPolicyOverride') // 0; |
92 |
my $can_override = C4::Context->preference('AllowHoldPolicyOverride') // 0; |
Lines 193-211
sub add {
Link Here
|
193 |
|
194 |
|
194 |
my $hold_id = C4::Reserves::AddReserve( |
195 |
my $hold_id = C4::Reserves::AddReserve( |
195 |
{ |
196 |
{ |
196 |
branchcode => $pickup_library_id, |
197 |
branchcode => $pickup_library_id, |
197 |
borrowernumber => $patron_id, |
198 |
borrowernumber => $patron_id, |
198 |
biblionumber => $biblio->id, |
199 |
biblionumber => $biblio->id, |
199 |
priority => $priority, |
200 |
priority => $priority, |
200 |
reservation_date => $hold_date, |
201 |
reservation_date => $hold_date, |
201 |
expiration_date => $expiration_date, |
202 |
expiration_date => $expiration_date, |
202 |
notes => $notes, |
203 |
patron_expiration_date => $patron_expiration_date, |
203 |
title => $biblio->title, |
204 |
notes => $notes, |
204 |
itemnumber => $item_id, |
205 |
title => $biblio->title, |
205 |
found => undef, # TODO: Why not? |
206 |
itemnumber => $item_id, |
206 |
itemtype => $item_type, |
207 |
found => undef, # TODO: Why not? |
207 |
non_priority => $non_priority, |
208 |
itemtype => $item_type, |
208 |
item_group_id => $item_group_id, |
209 |
non_priority => $non_priority, |
|
|
210 |
item_group_id => $item_group_id, |
209 |
} |
211 |
} |
210 |
); |
212 |
); |
211 |
|
213 |
|
Lines 274-294
sub edit {
Link Here
|
274 |
} |
276 |
} |
275 |
|
277 |
|
276 |
$pickup_library_id //= $hold->branchcode; |
278 |
$pickup_library_id //= $hold->branchcode; |
277 |
my $priority = $body->{priority} // $hold->priority; |
279 |
my $priority = $body->{priority} // $hold->priority; |
278 |
my $hold_date = $body->{hold_date} // $hold->reservedate; |
280 |
my $hold_date = $body->{hold_date} // $hold->reservedate; |
279 |
my $expiration_date = $body->{expiration_date} // $hold->expirationdate; |
281 |
my $expiration_date = $body->{expiration_date} // $hold->expirationdate; |
|
|
282 |
my $patron_expiration_date = $body->{patron_expiration_date} // $hold->patron_expiration_date; |
280 |
|
283 |
|
281 |
# suspended_until can also be set to undef |
284 |
# suspended_until can also be set to undef |
282 |
my $suspended_until = $body->{suspended_until} || $hold->suspend_until; |
285 |
my $suspended_until = $body->{suspended_until} || $hold->suspend_until; |
283 |
|
286 |
|
284 |
my $params = { |
287 |
my $params = { |
285 |
reserve_id => $hold->id, |
288 |
reserve_id => $hold->id, |
286 |
branchcode => $pickup_library_id, |
289 |
branchcode => $pickup_library_id, |
287 |
rank => $priority, |
290 |
rank => $priority, |
288 |
suspend_until => $suspended_until, |
291 |
suspend_until => $suspended_until, |
289 |
itemnumber => $hold->itemnumber, |
292 |
itemnumber => $hold->itemnumber, |
290 |
reservedate => $hold_date, |
293 |
reservedate => $hold_date, |
291 |
expirationdate => $expiration_date, |
294 |
expirationdate => $expiration_date, |
|
|
295 |
patron_expiration_date => $patron_expiration_date, |
292 |
}; |
296 |
}; |
293 |
|
297 |
|
294 |
C4::Reserves::ModReserve($params); |
298 |
C4::Reserves::ModReserve($params); |