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

(-)a/Koha/Biblio.pm (-1 / +25 lines)
Lines 20-25 package Koha::Biblio; Link Here
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Carp;
22
use Carp;
23
use List::MoreUtils qw(any);
23
24
24
use C4::Biblio qw();
25
use C4::Biblio qw();
25
26
Lines 186-191 sub can_be_transferred { Link Here
186
    return 0;
187
    return 0;
187
}
188
}
188
189
190
=head3 hidden_in_opac
191
192
my $bool = $biblio->hidden_in_opac({ [ rules => $rules ] })
193
194
Returns true if the biblio matches the hidding criteria defined in $rules.
195
Returns false otherwise.
196
197
Takes HASHref that can have the following parameters:
198
    OPTIONAL PARAMETERS:
199
    $rules : { <field> => [ value_1, ... ], ... }
200
201
Note: $rules inherits its structure from the parsed YAML from reading
202
the I<OpacHiddenItems> system preference.
203
204
=cut
205
206
sub hidden_in_opac {
207
    my ( $self, $params ) = @_;
208
209
    my $rules = $params->{rules} // {};
210
211
    return !(any { !$_->hidden_in_opac({ rules => $rules }) } $self->items);
212
}
213
189
=head3 article_request_type
214
=head3 article_request_type
190
215
191
my $type = $biblio->article_request_type( $borrower );
216
my $type = $biblio->article_request_type( $borrower );
192
- 

Return to bug 22455