Revert "Bug 20985: Add OnShelfHoldsAllowed checks to CanItemBeReserved"
This reverts commit a151d7ba0f.
This commit is contained in:
parent
602331127e
commit
3d5fa815be
|
|
@ -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 ) {
|
||||
|
|
|
|||
|
|
@ -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"),
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue