Bugzilla – Attachment 96373 Details for
Bug 24254
Add Koha::Items->filter_by_visible_in_opac
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24254: Add get_visible_items method
Bug-24254-Add-getvisibleitems-method.patch (text/plain), 1.29 KB, created by
Nick Clemens (kidclamp)
on 2019-12-17 13:28:36 UTC
(
hide
)
Description:
Bug 24254: Add get_visible_items method
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2019-12-17 13:28:36 UTC
Size:
1.29 KB
patch
obsolete
>From 8765acc0a5675cd20842256e213a14b90ef3f094 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 17 Dec 2019 08:25:28 -0500 >Subject: [PATCH] Bug 24254: Add get_visible_items method > >--- > Koha/Biblio.pm | 24 ++++++++++++++++++++++++ > 1 file changed, 24 insertions(+) > >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index b5ffe81642..4d1ac3f460 100644 >--- a/Koha/Biblio.pm >+++ b/Koha/Biblio.pm >@@ -41,6 +41,7 @@ use Koha::Item::Transfer::Limits; > use Koha::Items; > use Koha::Libraries; > use Koha::Subscriptions; >+use Koha::Util::SystemPreferences; > > =head1 NAME > >@@ -351,6 +352,29 @@ sub items { > return Koha::Items->_new_from_dbic( $items_rs ); > } > >+=head3 get_visible_items >+ >+my $items = $biblio->get_visible_items(); >+ >+Returns the related Koha::Items object for this biblio >+excluding hidden items >+ >+=cut >+ >+sub get_visible_items { >+ my ($self) = @_; >+ >+ my $rules = get_yaml_pref_hash('OpacHiddenItems'); >+ my $search_params; >+ foreach my $field (keys %$rules){ >+ $search_params->{$field}->{'not in'} = $rules->{$field}; >+ } >+ my $items_rs = $self->_result->items; >+ $items_rs = $items_rs->search( $search_params ) if $items_rs; >+ >+ return Koha::Items->_new_from_dbic( $items_rs ); >+} >+ > =head3 itemtype > > my $itemtype = $biblio->itemtype(); >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24254
:
96373
|
114159
|
114160
|
114206
|
114207
|
114278
|
114279
|
114539
|
114540
|
114548
|
114549
|
114550
|
114551
|
114574
|
114594
|
114595
|
114596
|
114597
|
114598
|
114599
|
114664
|
114665
|
114666
|
114667
|
114668
|
115131
|
115132
|
115147
|
115148
|
115149
|
115150
|
115151
|
115152
|
115153
|
116070
|
116071
|
116072
|
116073
|
116074
|
116075