|
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 199-217
sub add {
Link Here
|
| 199 |
|
200 |
|
| 200 |
my $hold_id = C4::Reserves::AddReserve( |
201 |
my $hold_id = C4::Reserves::AddReserve( |
| 201 |
{ |
202 |
{ |
| 202 |
branchcode => $pickup_library_id, |
203 |
branchcode => $pickup_library_id, |
| 203 |
borrowernumber => $patron_id, |
204 |
borrowernumber => $patron_id, |
| 204 |
biblionumber => $biblio->id, |
205 |
biblionumber => $biblio->id, |
| 205 |
priority => $priority, |
206 |
priority => $priority, |
| 206 |
reservation_date => $hold_date, |
207 |
reservation_date => $hold_date, |
| 207 |
expiration_date => $expiration_date, |
208 |
expiration_date => $expiration_date, |
| 208 |
notes => $notes, |
209 |
patron_expiration_date => $patron_expiration_date, |
| 209 |
title => $biblio->title, |
210 |
notes => $notes, |
| 210 |
itemnumber => $item_id, |
211 |
title => $biblio->title, |
| 211 |
found => undef, # TODO: Why not? |
212 |
itemnumber => $item_id, |
| 212 |
itemtype => $item_type, |
213 |
found => undef, # TODO: Why not? |
| 213 |
non_priority => $non_priority, |
214 |
itemtype => $item_type, |
| 214 |
item_group_id => $item_group_id, |
215 |
non_priority => $non_priority, |
|
|
216 |
item_group_id => $item_group_id, |
| 215 |
confirmations => $confirmations, |
217 |
confirmations => $confirmations, |
| 216 |
} |
218 |
} |
| 217 |
); |
219 |
); |
|
Lines 281-301
sub edit {
Link Here
|
| 281 |
} |
283 |
} |
| 282 |
|
284 |
|
| 283 |
$pickup_library_id //= $hold->branchcode; |
285 |
$pickup_library_id //= $hold->branchcode; |
| 284 |
my $priority = $body->{priority} // $hold->priority; |
286 |
my $priority = $body->{priority} // $hold->priority; |
| 285 |
my $hold_date = $body->{hold_date} // $hold->reservedate; |
287 |
my $hold_date = $body->{hold_date} // $hold->reservedate; |
| 286 |
my $expiration_date = $body->{expiration_date} // $hold->expirationdate; |
288 |
my $expiration_date = $body->{expiration_date} // $hold->expirationdate; |
|
|
289 |
my $patron_expiration_date = $body->{patron_expiration_date} // $hold->patron_expiration_date; |
| 287 |
|
290 |
|
| 288 |
# suspended_until can also be set to undef |
291 |
# suspended_until can also be set to undef |
| 289 |
my $suspended_until = $body->{suspended_until} || $hold->suspend_until; |
292 |
my $suspended_until = $body->{suspended_until} || $hold->suspend_until; |
| 290 |
|
293 |
|
| 291 |
my $params = { |
294 |
my $params = { |
| 292 |
reserve_id => $hold->id, |
295 |
reserve_id => $hold->id, |
| 293 |
branchcode => $pickup_library_id, |
296 |
branchcode => $pickup_library_id, |
| 294 |
rank => $priority, |
297 |
rank => $priority, |
| 295 |
suspend_until => $suspended_until, |
298 |
suspend_until => $suspended_until, |
| 296 |
itemnumber => $hold->itemnumber, |
299 |
itemnumber => $hold->itemnumber, |
| 297 |
reservedate => $hold_date, |
300 |
reservedate => $hold_date, |
| 298 |
expirationdate => $expiration_date, |
301 |
expirationdate => $expiration_date, |
|
|
302 |
patron_expiration_date => $patron_expiration_date, |
| 299 |
}; |
303 |
}; |
| 300 |
|
304 |
|
| 301 |
C4::Reserves::ModReserve($params); |
305 |
C4::Reserves::ModReserve($params); |