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

(-)a/Koha/Items.pm (-1 / +11 lines)
Lines 23-28 use Modern::Perl; Link Here
23
use Koha::Database;
23
use Koha::Database;
24
24
25
use Koha::Item;
25
use Koha::Item;
26
use Koha::CirculationRules;
26
27
27
use base qw(Koha::Objects);
28
use base qw(Koha::Objects);
28
29
Lines 49-54 Return the items of the set that are holdable Link Here
49
sub filter_by_for_hold {
50
sub filter_by_for_hold {
50
    my ($self) = @_;
51
    my ($self) = @_;
51
52
53
    my @hold_not_allowed_itypes = Koha::CirculationRules->search(
54
        {
55
            rule_name    => 'holdallowed',
56
            branchcode   => undef,
57
            categorycode => undef,
58
            rule_value   => 'not_allowed',
59
        }
60
    )->get_column('itemtype');
61
52
    return $self->search(
62
    return $self->search(
53
        {
63
        {
54
            itemlost   => 0,
64
            itemlost   => 0,
Lines 56-61 sub filter_by_for_hold { Link Here
56
            notforloan => { '<=' => 0 }
66
            notforloan => { '<=' => 0 }
57
            ,    # items with negative or zero notforloan value are holdable
67
            ,    # items with negative or zero notforloan value are holdable
58
            ( C4::Context->preference('AllowHoldsOnDamagedItems') ? ( damaged => 0 ) : () ),
68
            ( C4::Context->preference('AllowHoldsOnDamagedItems') ? ( damaged => 0 ) : () ),
69
            itype        => { -not_in => \@hold_not_allowed_itypes },
59
        }
70
        }
60
    );
71
    );
61
}
72
}
62
- 

Return to bug 3142