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

(-)a/Koha/Biblio.pm (-1 / +24 lines)
Lines 41-46 use Koha::Item::Transfer::Limits; Link Here
41
use Koha::Items;
41
use Koha::Items;
42
use Koha::Libraries;
42
use Koha::Libraries;
43
use Koha::Subscriptions;
43
use Koha::Subscriptions;
44
use Koha::Util::SystemPreferences;
44
45
45
=head1 NAME
46
=head1 NAME
46
47
Lines 351-356 sub items { Link Here
351
    return Koha::Items->_new_from_dbic( $items_rs );
352
    return Koha::Items->_new_from_dbic( $items_rs );
352
}
353
}
353
354
355
=head3 get_visible_items
356
357
my $items = $biblio->get_visible_items();
358
359
Returns the related Koha::Items object for this biblio
360
excluding hidden items
361
362
=cut
363
364
sub get_visible_items {
365
    my ($self) = @_;
366
367
    my $rules = get_yaml_pref_hash('OpacHiddenItems');
368
    my $search_params;
369
    foreach my $field (keys %$rules){
370
        $search_params->{$field}->{'not in'} = $rules->{$field};
371
    }
372
    my $items_rs = $self->_result->items;
373
    $items_rs = $items_rs->search( $search_params ) if $items_rs;
374
375
    return Koha::Items->_new_from_dbic( $items_rs );
376
}
377
354
=head3 itemtype
378
=head3 itemtype
355
379
356
my $itemtype = $biblio->itemtype();
380
my $itemtype = $biblio->itemtype();
357
- 

Return to bug 24254