Lines 61-75
placing a hold on one of those items.
Link Here
|
61 |
sub filter_by_for_hold { |
61 |
sub filter_by_for_hold { |
62 |
my ($self) = @_; |
62 |
my ($self) = @_; |
63 |
|
63 |
|
64 |
my @hold_not_allowed_itypes = Koha::CirculationRules->search( |
64 |
my $default_rule = Koha::CirculationRules->get_effective_rule( |
65 |
{ |
65 |
{ |
66 |
rule_name => 'holdallowed', |
66 |
rule_name => 'holdallowed', |
67 |
branchcode => undef, |
|
|
68 |
categorycode => undef, |
69 |
rule_value => 'not_allowed', |
67 |
rule_value => 'not_allowed', |
70 |
} |
68 |
} |
71 |
)->get_column('itemtype'); |
69 |
); |
|
|
70 |
my @hold_not_allowed_itypes; |
71 |
if ( $default_rule ) { |
72 |
@hold_not_allowed_itypes = Koha::ItemTypes->search->get_column('itemtype'); |
73 |
my @hold_allowed_itypes = Koha::CirculationRules->search( |
74 |
{ |
75 |
rule_name => 'holdallowed', |
76 |
rule_value => { '!=' => 'not_allowed' }, |
77 |
branchcode => undef, |
78 |
categorycode => undef, |
79 |
} |
80 |
)->get_column('itemtype'); |
81 |
@hold_not_allowed_itypes = array_minus( @hold_not_allowed_itypes, @hold_allowed_itypes ) |
82 |
} else { |
83 |
@hold_not_allowed_itypes = Koha::CirculationRules->search( |
84 |
{ |
85 |
rule_name => 'holdallowed', |
86 |
branchcode => undef, |
87 |
categorycode => undef, |
88 |
rule_value => 'not_allowed', |
89 |
} |
90 |
)->get_column('itemtype'); |
91 |
} |
92 |
|
72 |
push @hold_not_allowed_itypes, Koha::ItemTypes->search({ notforloan => 1 })->get_column('itemtype'); |
93 |
push @hold_not_allowed_itypes, Koha::ItemTypes->search({ notforloan => 1 })->get_column('itemtype'); |
|
|
94 |
@hold_not_allowed_itypes = uniq @hold_not_allowed_itypes; |
73 |
|
95 |
|
74 |
my $params = { |
96 |
my $params = { |
75 |
itemlost => 0, |
97 |
itemlost => 0, |