Bugzilla – Attachment 113658 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), 2.04 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-11-16 11:23:04 UTC
(
hide
)
Description:
Bug 27002: Update Koha::Biblio->pickup_locations to return a resultset
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-11-16 11:23:04 UTC
Size:
2.04 KB
patch
obsolete
>From 590be6504266340d1507618c70f736aa30cb73b5 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 > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/Biblio.pm | 19 +++++++++---------- > 1 file changed, 9 insertions(+), 10 deletions(-) > >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index 4368eef386f..4d335e2c231 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.29.2
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