Lines 63-77
sub filter_by_for_hold {
Link Here
|
63 |
)->get_column('itemtype'); |
63 |
)->get_column('itemtype'); |
64 |
push @hold_not_allowed_itypes, Koha::ItemTypes->search({ notforloan => 1 })->get_column('itemtype'); |
64 |
push @hold_not_allowed_itypes, Koha::ItemTypes->search({ notforloan => 1 })->get_column('itemtype'); |
65 |
|
65 |
|
66 |
return $self->search( |
66 |
my $params = { |
67 |
{ |
67 |
itemlost => 0, |
68 |
itemlost => 0, |
68 |
withdrawn => 0, |
69 |
withdrawn => 0, |
69 |
notforloan => { '<=' => 0 }, # items with negative or zero notforloan value are holdable |
70 |
notforloan => { '<=' => 0 }, # items with negative or zero notforloan value are holdable |
70 |
( C4::Context->preference('AllowHoldsOnDamagedItems')? (): ( damaged => 0 ) ), |
71 |
( C4::Context->preference('AllowHoldsOnDamagedItems' ) ? () : ( damaged => 0 ) ), |
71 |
}; |
72 |
itype => { -not_in => \@hold_not_allowed_itypes }, |
72 |
|
73 |
} |
73 |
if ( C4::Context->preference("item-level_itypes") ) { |
74 |
); |
74 |
return $self->search( |
|
|
75 |
{ |
76 |
%$params, |
77 |
itype => { -not_in => \@hold_not_allowed_itypes }, |
78 |
} |
79 |
); |
80 |
} else { |
81 |
return $self->search( |
82 |
{ |
83 |
%$params, |
84 |
'biblioitem.itemtype' => { -not_in => \@hold_not_allowed_itypes }, |
85 |
}, |
86 |
{ |
87 |
join => 'biblioitem', |
88 |
} |
89 |
); |
90 |
} |
75 |
} |
91 |
} |
76 |
|
92 |
|
77 |
=head3 filter_by_visible_in_opac |
93 |
=head3 filter_by_visible_in_opac |
78 |
- |
|
|