View | Details | Raw Unified | Return to bug 18936
Collapse All | Expand All

(-)a/Koha/CirculationRules.pm (-1 / +30 lines)
Lines 344-349 sub delete { Link Here
344
    }
344
    }
345
}
345
}
346
346
347
=head3 get_opacitemholds_policy
348
349
my $can_place_a_hold_at_item_level = Koha::CirculationRules->get_opacitemholds_policy( { patron => $patron, item => $item } );
350
351
Return 'Y' or 'F' if the patron can place a hold on this item according to the issuing rules
352
and the "Item level holds" (opacitemholds).
353
Can be 'N' - Don't allow, 'Y' - Allow, and 'F' - Force
354
355
=cut
356
357
sub get_opacitemholds_policy {
358
    my ( $class, $params ) = @_;
359
360
    my $item   = $params->{item};
361
    my $patron = $params->{patron};
362
363
    return unless $item or $patron;
364
365
    my $rule = Koha::CirculationRules->get_effective_issuing_rule(
366
        {
367
            categorycode => $patron->categorycode,
368
            itemtype     => $item->effective_itemtype,
369
            branchcode   => $item->homebranch,
370
            rule_name    => 'opacitemholds',
371
        }
372
    );
373
374
    return $rule ? $rule->rule_value : undef;
375
}
376
347
=head3 get_onshelfholds_policy
377
=head3 get_onshelfholds_policy
348
378
349
    my $on_shelf_holds = Koha::CirculationRules->get_onshelfholds_policy({ item => $item, patron => $patron });
379
    my $on_shelf_holds = Koha::CirculationRules->get_onshelfholds_policy({ item => $item, patron => $patron });
350
- 

Return to bug 18936