Bugzilla – Attachment 113610 Details for
Bug 27002
Make Koha::Biblio->pickup_locations return a Koha::Libraries resultset
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27002: Update Koha::Biblio->pickup_locations to return a resultset
Bug-27002-Update-KohaBiblio-pickuplocations-to-ret.patch (text/plain), 1.93 KB, created by
Martin Renvoize (ashimema)
on 2020-11-13 16:11:04 UTC
(
hide
)
Description:
Bug 27002: Update Koha::Biblio->pickup_locations to return a resultset
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-11-13 16:11:04 UTC
Size:
1.93 KB
patch
obsolete
>From 10159e29288eca92182837f8e4c04197f09878c8 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 12 Nov 2020 08:09:56 +0000 >Subject: [PATCH] Bug 27002: Update Koha::Biblio->pickup_locations to return a > resultset > >--- > Koha/Biblio.pm | 19 +++++++++---------- > 1 file changed, 9 insertions(+), 10 deletions(-) > >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index 4368eef386..4d335e2c23 100644 >--- a/Koha/Biblio.pm >+++ b/Koha/Biblio.pm >@@ -207,32 +207,31 @@ sub can_be_transferred { > > my $pickup_locations = $biblio->pickup_locations( {patron => $patron } ); > >-Returns an I<arrayref> of possible pickup locations for this biblio's items, >+Returns a Koha::Libraries set of possible pickup locations for this biblio's items, > according to patron's home library (if patron is defined and holds are allowed > only from hold groups) and if item can be transferred to each pickup location. > > =cut > > sub pickup_locations { >- my ($self, $params) = @_; >+ my ( $self, $params ) = @_; > > my $patron = $params->{patron}; > > my @pickup_locations; >- foreach my $item_of_bib ($self->items->as_list) { >- push @pickup_locations, @{ $item_of_bib->pickup_locations( {patron => $patron} )->as_list() }; >+ foreach my $item_of_bib ( $self->items->as_list ) { >+ push @pickup_locations, >+ $item_of_bib->pickup_locations( { patron => $patron } ) >+ ->_resultset->get_column('branchcode')->all; > } > >- my %seen; >- @pickup_locations = >- grep { !$seen{ $_->branchcode }++ } @pickup_locations; >- >- return \@pickup_locations; >+ return Koha::Libraries->search( >+ { branchcode => { '-in' => \@pickup_locations } } ); > } > > =head3 hidden_in_opac > >-my $bool = $biblio->hidden_in_opac({ [ rules => $rules ] }) >+ my $bool = $biblio->hidden_in_opac({ [ rules => $rules ] }) > > Returns true if the biblio matches the hidding criteria defined in $rules. > Returns false otherwise. >-- >2.20.1
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 27002
:
113548
|
113610
|
113611
|
113612
|
113628
|
113629
|
113642
|
113643
|
113658
|
113659