|
Lines 1248-1285
sub CanBookBeIssued {
Link Here
|
| 1248 |
my $resbor = $res->{'borrowernumber'}; |
1248 |
my $resbor = $res->{'borrowernumber'}; |
| 1249 |
if ( $resbor ne $patron->borrowernumber ) { |
1249 |
if ( $resbor ne $patron->borrowernumber ) { |
| 1250 |
my $hold_patron = Koha::Patrons->find($resbor); |
1250 |
my $hold_patron = Koha::Patrons->find($resbor); |
| 1251 |
if ( $restype eq "Waiting" ) { |
|
|
| 1252 |
|
1251 |
|
| 1253 |
# Check if hold is for a linked account |
1252 |
# Check if hold is for a linked account |
| 1254 |
my $is_linked_account = 0; |
1253 |
my $is_linked_account = 0; |
| 1255 |
if ( C4::Context->preference('EnablePatronAccountLinking') |
1254 |
if ( C4::Context->preference('EnablePatronAccountLinking') |
| 1256 |
&& C4::Context->preference('AllowLinkedAccountHoldPickup') ) |
1255 |
&& C4::Context->preference('AllowLinkedAccountHoldPickup') ) |
| 1257 |
{ |
1256 |
{ |
| 1258 |
my $linked_ids = $patron->all_linked_borrowernumbers; |
1257 |
my $linked_ids = $patron->all_linked_borrowernumbers; |
| 1259 |
$is_linked_account = grep { $_ == $resbor } @$linked_ids; |
1258 |
$is_linked_account = grep { $_ == $resbor } @$linked_ids; |
| 1260 |
} |
1259 |
} |
| 1261 |
|
1260 |
|
| 1262 |
if ($is_linked_account) { |
1261 |
if ($is_linked_account) { |
| 1263 |
|
1262 |
|
| 1264 |
# Hold is for a linked account - allow pickup with redirect |
1263 |
# Hold is for a linked account - allow checkout with redirect |
| 1265 |
$alerts{LINKED_ACCOUNT_HOLD_PICKUP} = { |
1264 |
$alerts{LINKED_ACCOUNT_HOLD_PICKUP} = { |
| 1266 |
reserve_id => $res->{reserve_id}, |
1265 |
reserve_id => $res->{reserve_id}, |
| 1267 |
hold_patron_id => $resbor, |
1266 |
hold_patron_id => $resbor, |
| 1268 |
hold_patron => $hold_patron, |
1267 |
hold_patron => $hold_patron, |
| 1269 |
}; |
1268 |
}; |
| 1270 |
} else { |
1269 |
} elsif ( $restype eq "Waiting" ) { |
| 1271 |
|
1270 |
|
| 1272 |
# The item is on reserve and waiting, but has been |
1271 |
# The item is on reserve and waiting, but has been |
| 1273 |
# reserved by some other patron. |
1272 |
# reserved by some other patron. |
| 1274 |
$needsconfirmation{RESERVE_WAITING} = 1; |
1273 |
$needsconfirmation{RESERVE_WAITING} = 1; |
| 1275 |
$needsconfirmation{'resfirstname'} = $hold_patron->firstname; |
1274 |
$needsconfirmation{'resfirstname'} = $hold_patron->firstname; |
| 1276 |
$needsconfirmation{'ressurname'} = $hold_patron->surname; |
1275 |
$needsconfirmation{'ressurname'} = $hold_patron->surname; |
| 1277 |
$needsconfirmation{'rescardnumber'} = $hold_patron->cardnumber; |
1276 |
$needsconfirmation{'rescardnumber'} = $hold_patron->cardnumber; |
| 1278 |
$needsconfirmation{'resborrowernumber'} = $hold_patron->borrowernumber; |
1277 |
$needsconfirmation{'resborrowernumber'} = $hold_patron->borrowernumber; |
| 1279 |
$needsconfirmation{'resbranchcode'} = $res->{branchcode}; |
1278 |
$needsconfirmation{'resbranchcode'} = $res->{branchcode}; |
| 1280 |
$needsconfirmation{'reswaitingdate'} = $res->{'waitingdate'}; |
1279 |
$needsconfirmation{'reswaitingdate'} = $res->{'waitingdate'}; |
| 1281 |
$needsconfirmation{'reserve_id'} = $res->{reserve_id}; |
1280 |
$needsconfirmation{'reserve_id'} = $res->{reserve_id}; |
| 1282 |
} |
|
|
| 1283 |
} elsif ( $restype eq "Reserved" ) { |
1281 |
} elsif ( $restype eq "Reserved" ) { |
| 1284 |
|
1282 |
|
| 1285 |
# The item is on reserve for someone else. |
1283 |
# The item is on reserve for someone else. |
|
Lines 3381-3387
sub CanBookBeRenewed {
Link Here
|
| 3381 |
unless CanItemBeReserved( |
3379 |
unless CanItemBeReserved( |
| 3382 |
$patron_with_reserve, $other_item, undef, |
3380 |
$patron_with_reserve, $other_item, undef, |
| 3383 |
{ ignore_hold_counts => 1 } |
3381 |
{ ignore_hold_counts => 1 } |
| 3384 |
)->{status} eq 'OK'; |
3382 |
)->{status} eq 'OK'; |
| 3385 |
|
3383 |
|
| 3386 |
# NOTE: At checkin we call 'CheckReserves' which checks hold 'policy' |
3384 |
# NOTE: At checkin we call 'CheckReserves' which checks hold 'policy' |
| 3387 |
# CanItemBeReserved checks 'rules' and 'policies' which means |
3385 |
# CanItemBeReserved checks 'rules' and 'policies' which means |
| 3388 |
- |
|
|