Bugzilla – Attachment 120958 Details for
Bug 28273
Multi-holds allow invalid pickup locations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28273: Add Koha::Biblios->pickup_locations
Bug-28273-Add-KohaBiblios-pickuplocations.patch (text/plain), 1.63 KB, created by
Kyle M Hall (khall)
on 2021-05-14 12:15:22 UTC
(
hide
)
Description:
Bug 28273: Add Koha::Biblios->pickup_locations
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2021-05-14 12:15:22 UTC
Size:
1.63 KB
patch
obsolete
>From 7ec7ea8ef23c75ba9dd971acccf2de488b0f2e41 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 3 May 2021 09:45:41 -0300 >Subject: [PATCH] Bug 28273: Add Koha::Biblios->pickup_locations > >https://bugs.koha-community.org/show_bug.cgi?id=26273 > >Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > Koha/Biblios.pm | 32 +++++++++++++++++++++++++++++++- > 1 file changed, 31 insertions(+), 1 deletion(-) > >diff --git a/Koha/Biblios.pm b/Koha/Biblios.pm >index 845298897b..9491fb3112 100644 >--- a/Koha/Biblios.pm >+++ b/Koha/Biblios.pm >@@ -24,6 +24,7 @@ use Carp; > use Koha::Database; > > use Koha::Biblio; >+use Koha::Libraries; > > use base qw(Koha::Objects); > >@@ -33,10 +34,39 @@ Koha::Biblios - Koha Biblio object set class > > =head1 API > >-=head2 Class Methods >+=head2 Class methods >+ >+=head3 pickup_locations >+ >+ my $biblios = Koha::Biblios->search(...); >+ my $pickup_locations = $biblios->pickup_locations({ patron => $patron }); >+ >+For a given resultset, it returns all the pickup locations > > =cut > >+sub pickup_locations { >+ my ( $self, $params ) = @_; >+ >+ my $patron = $params->{patron}; >+ >+ my @pickup_locations; >+ foreach my $biblio ( $self->as_list ) { >+ push @pickup_locations, >+ $biblio->pickup_locations( { patron => $patron } ) >+ ->_resultset->get_column('branchcode')->all; >+ } >+ >+ return Koha::Libraries->search( >+ { >+ branchcode => \@pickup_locations >+ }, >+ { order_by => ['branchname'] } >+ ); >+} >+ >+=head2 Internal methods >+ > =head3 type > > =cut >-- >2.24.3 (Apple Git-128)
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 28273
:
120407
|
120408
|
120923
|
120924
|
120925
|
120926
|
120933
|
120934
|
120935
|
120936
|
120957
| 120958 |
120959
|
120960
|
120961