|
Lines 276-281
See CanItemBeReserved() for possible return values.
Link Here
|
| 276 |
sub CanBookBeReserved{ |
276 |
sub CanBookBeReserved{ |
| 277 |
my ($borrowernumber, $biblionumber, $pickup_branchcode) = @_; |
277 |
my ($borrowernumber, $biblionumber, $pickup_branchcode) = @_; |
| 278 |
|
278 |
|
|
|
279 |
# Check that patron have not checked out this biblio (if AllowHoldsOnPatronsPossessions set) |
| 280 |
if ( !C4::Context->preference('AllowHoldsOnPatronsPossessions') |
| 281 |
&& C4::Circulation::CheckIfIssuedToPatron( $patron->borrowernumber, $biblio->biblionumber ) ) { |
| 282 |
return { status =>'itemAlreadyOnLoan' }; |
| 283 |
} |
| 284 |
|
| 279 |
my @itemnumbers = Koha::Items->search({ biblionumber => $biblionumber})->get_column("itemnumber"); |
285 |
my @itemnumbers = Koha::Items->search({ biblionumber => $biblionumber})->get_column("itemnumber"); |
| 280 |
#get items linked via host records |
286 |
#get items linked via host records |
| 281 |
my @hostitems = get_hostitemnumbers_of($biblionumber); |
287 |
my @hostitems = get_hostitemnumbers_of($biblionumber); |
|
Lines 338-343
sub CanItemBeReserved {
Link Here
|
| 338 |
return { status =>'itemAlreadyOnHold' } |
344 |
return { status =>'itemAlreadyOnHold' } |
| 339 |
if Koha::Holds->search( { borrowernumber => $borrowernumber, itemnumber => $itemnumber } )->count(); |
345 |
if Koha::Holds->search( { borrowernumber => $borrowernumber, itemnumber => $itemnumber } )->count(); |
| 340 |
|
346 |
|
|
|
347 |
# Check that patron have not checked out this biblio (if AllowHoldsOnPatronsPossessions set) |
| 348 |
if ( !C4::Context->preference('AllowHoldsOnPatronsPossessions') |
| 349 |
&& C4::Circulation::CheckIfIssuedToPatron( $patron->borrowernumber, $biblio->biblionumber ) ) { |
| 350 |
return { status =>'itemAlreadyOnLoan' }; |
| 351 |
} |
| 352 |
|
| 341 |
my $controlbranch = C4::Context->preference('ReservesControlBranch'); |
353 |
my $controlbranch = C4::Context->preference('ReservesControlBranch'); |
| 342 |
|
354 |
|
| 343 |
my $querycount = q{ |
355 |
my $querycount = q{ |
| 344 |
- |
|
|