@@ -, +, @@ --- C4/Reserves.pm | 21 +++++++------------ .../prog/en/modules/reserve/request.tt | 6 +++--- reserve/request.pl | 4 ---- 3 files changed, 11 insertions(+), 20 deletions(-) --- a/C4/Reserves.pm +++ a/C4/Reserves.pm @@ -25,7 +25,7 @@ use Modern::Perl; use C4::Accounts; use C4::Biblio qw( GetMarcFromKohaField ); -use C4::Circulation qw( CheckIfIssuedToPatron GetAgeRestriction GetBranchItemRule ); +use C4::Circulation qw( GetAgeRestriction GetBranchItemRule ); use C4::Context; use C4::Items qw( CartToShelf get_hostitemnumbers_of ); use C4::Letters; @@ -335,12 +335,6 @@ See CanItemBeReserved() for possible return values. sub CanBookBeReserved{ my ($borrowernumber, $biblionumber, $pickup_branchcode, $params) = @_; - # Check that patron have not checked out this biblio (if AllowHoldsOnPatronsPossessions set) - if ( !C4::Context->preference('AllowHoldsOnPatronsPossessions') - && C4::Circulation::CheckIfIssuedToPatron( $borrowernumber, $biblionumber ) ) { - return { status =>'alreadypossession' }; - } - if ( $params->{itemtype} ) { # biblio-level, item type-contrained @@ -472,12 +466,6 @@ sub CanItemBeReserved { return _cache { status =>'itemAlreadyOnHold' } if ( !$params->{ignore_hold_counts} && Koha::Holds->search( { borrowernumber => $patron->borrowernumber, itemnumber => $item->itemnumber } )->count() ); - # Check that patron have not checked out this biblio (if AllowHoldsOnPatronsPossessions set) - if ( !C4::Context->preference('AllowHoldsOnPatronsPossessions') - && C4::Circulation::CheckIfIssuedToPatron( $patron->borrowernumber, $item->biblionumber ) ) { - return _cache { status =>'alreadypossession' }; - } - # check if a recall exists on this item from this borrower return _cache { status => 'recall' } if $patron->recalls->filter_by_current->search({ item_id => $item->itemnumber })->count; @@ -532,6 +520,13 @@ sub CanItemBeReserved { }; my $holds = Koha::Holds->search($search_params); return _cache { status => "tooManyHoldsForThisRecord", limit => $holds_per_record } if $holds->count() >= $holds_per_record; + + # Check that patron have not checked out this biblio (if AllowHoldsOnPatronsPossessions set) + if ( !C4::Context->preference('AllowHoldsOnPatronsPossessions') + && $patron->checkouts->find( { itemnumber => $item->itemnumber } ) ) + { + return _cache { status => 'alreadypossession' }; + } } } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -421,7 +421,7 @@ [% END %] - [% IF ( no_reserves_allowed || exceeded_maxreserves || exceeded_holds_per_record || alreadyreserved || none_available || alreadypossession || ageRestricted || recall ) %] + [% IF ( no_reserves_allowed || exceeded_maxreserves || exceeded_holds_per_record || alreadyreserved || none_available || ageRestricted || recall ) %]