From 3d5fa815be0a6853703bc3c65e5d786f745ec78a Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 16 Jun 2021 14:44:10 +0200 Subject: [PATCH] Revert "Bug 20985: Add OnShelfHoldsAllowed checks to CanItemBeReserved" This reverts commit a151d7ba0f233745d716d439881818e8ed8f7c57. --- C4/Reserves.pm | 16 +++------------- .../prog/en/modules/reserve/request.tt | 1 - t/db_dependent/Reserves.t | 16 ++++++++-------- 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 571ee4086a..0bf8bf6b77 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -355,7 +355,6 @@ sub CanBookBeReserved{ should not check if there are too many holds as we only csre about reservability @RETURNS { status => OK }, if the Item can be reserved. - { status => onShelfHoldsNotAllowed }, if onShelfHoldsAllowed parameter and item availability combination doesn't allow holds. { status => ageRestricted }, if the Item is age restricted for this borrower. { status => damaged }, if the Item is damaged. { status => cannotReserveFromOtherBranches }, if syspref 'canreservefromotherbranches' is OK. @@ -375,10 +374,6 @@ sub CanItemBeReserved { my $dbh = C4::Context->dbh; my $ruleitemtype; # itemtype of the matching issuing rule my $allowedreserves = 0; # Total number of holds allowed across all records, default to none - my $holds_per_record = 1; # Total number of holds allowed for this one given record - my $holds_per_day; # Default to unlimited - my $on_shelf_holds = 0; # Default to "if any unavailable" - my $context = $params->{context} // ''; # we retrieve borrowers and items informations # # item->{itype} will come for biblioitems if necessery @@ -450,11 +445,10 @@ sub CanItemBeReserved { categorycode => $borrower->{'categorycode'}, itemtype => $item->effective_itemtype, branchcode => $branchcode, - rules => ['holds_per_record','holds_per_day','onshelfholds'] + rules => ['holds_per_record','holds_per_day'] }); - $holds_per_record = $rights->{holds_per_record} // 1; - $holds_per_day = $rights->{holds_per_day}; - $on_shelf_holds = $rights->{onshelfholds}; + my $holds_per_record = $rights->{holds_per_record} // 1; + my $holds_per_day = $rights->{holds_per_day}; my $search_params = { borrowernumber => $borrowernumber, @@ -462,10 +456,6 @@ sub CanItemBeReserved { }; $search_params->{found} = undef if $params->{ignore_found_holds}; - # Check for item on shelves and OnShelfHoldsAllowed - return { status => 'onShelfHoldsNotAllowed' } - unless IsAvailableForItemLevelRequest($item, $patron, $pickup_branchcode,1); - my $holds = Koha::Holds->search($search_params); if ( defined $holds_per_record && $holds_per_record ne '' ){ if ( $holds_per_record == 0 ) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt index bcb1b8690a..bddbe802d5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -1076,7 +1076,6 @@ tooManyReserves: _("Too many holds"), notReservable: _("Not holdable"), noReservesAllowed: _("No reserves allowed"), - onShelfHoldsNotAllowed: _("Not holdable"), cannotReserveFromOtherBranches: _("Patron is from different library"), itemAlreadyOnHold: _("Patron already has hold for this item"), cannotBeTransferred: _("Cannot be transferred to pickup library"), diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t index 56c0b35e57..55e273d45c 100755 --- a/t/db_dependent/Reserves.t +++ b/t/db_dependent/Reserves.t @@ -1298,14 +1298,14 @@ subtest 'AllowHoldOnPatronPossession test' => sub { value => { branchcode => $item->homebranch }}); Koha::CirculationRules->set_rules( - { - branchcode => undef, - categorycode => undef, - itemtype => undef, - rules => { - onshelfholds => 1, - } - } + { + branchcode => undef, + categorycode => undef, + itemtype => undef, + rules => { + onshelfholds => 1, + } + } ); C4::Circulation::AddIssue($patron->unblessed, -- 2.39.5