Bugzilla – Attachment 163220 Details for
Bug 36120
Add pickup locations to bookings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36120: Add pickup_items to the pickup_locations response
Bug-36120-Add-pickupitems-to-the-pickuplocations-r.patch (text/plain), 3.15 KB, created by
Martin Renvoize (ashimema)
on 2024-03-15 12:01:47 UTC
(
hide
)
Description:
Bug 36120: Add pickup_items to the pickup_locations response
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-03-15 12:01:47 UTC
Size:
3.15 KB
patch
obsolete
>From dfef0422398e03d85feef5bbde908d4077c32ef0 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 7 Mar 2024 15:30:26 +0000 >Subject: [PATCH] Bug 36120: Add pickup_items to the pickup_locations response > >This patch adds pickup_items as a list of itemnumbers that can be picked >from the library should it be selected as a pickup location. > >Signed-off-by: Lisette Scheer <lisette.scheer@bywatersolutions.com> >--- > Koha/Biblio.pm | 12 ++++++++++-- > Koha/REST/V1/Biblios.pm | 1 + > api/v1/swagger/definitions/library.yaml | 7 +++++++ > 3 files changed, 18 insertions(+), 2 deletions(-) > >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index 31213eedae4..4e9a81cf232 100644 >--- a/Koha/Biblio.pm >+++ b/Koha/Biblio.pm >@@ -365,6 +365,7 @@ sub pickup_locations { > > my $memory_cache = Koha::Cache::Memory::Lite->get_instance(); > my @pickup_locations; >+ my $location_items; > foreach my $item ( $self->items->as_list ) { > my $cache_key = sprintf "Pickup_locations:%s:%s:%s:%s:%s", > $item->itype,$item->homebranch,$item->holdingbranch,$item->ccode || "",$patron->branchcode||"" ; >@@ -373,11 +374,18 @@ sub pickup_locations { > @{ $item_pickup_locations } = $item->pickup_locations( { patron => $patron } )->_resultset->get_column('branchcode')->all; > $memory_cache->set_in_cache( $cache_key, $item_pickup_locations ); > } >- push @pickup_locations, @{ $item_pickup_locations } >+ push @pickup_locations, @{ $item_pickup_locations }; >+ for my $location (@pickup_locations) { >+ push @{$location_items->{$location}}, $item->itemnumber; >+ } > } > >- return Koha::Libraries->search( >+ my $resultSet = Koha::Libraries->search( > { branchcode => { '-in' => \@pickup_locations } }, { order_by => ['branchname'] } ); >+ >+ $resultSet->{_pickup_location_items} = $location_items; >+ >+ return $resultSet; > } > > =head3 hidden_in_opac >diff --git a/Koha/REST/V1/Biblios.pm b/Koha/REST/V1/Biblios.pm >index 846a0fb94de..b4a283c01b5 100644 >--- a/Koha/REST/V1/Biblios.pm >+++ b/Koha/REST/V1/Biblios.pm >@@ -572,6 +572,7 @@ sub pickup_locations { > my $pickup_locations = $c->objects->search($pl_set); > @response = map { $_->{needs_override} = Mojo::JSON->false; $_; } @{$pickup_locations}; > } >+ @response = map { $_->{pickup_items} = $pl_set->{_pickup_location_items}->{ $_->{library_id} }; $_; } @response; > > return $c->render( > status => 200, >diff --git a/api/v1/swagger/definitions/library.yaml b/api/v1/swagger/definitions/library.yaml >index de010c50d30..6d9a23878f6 100644 >--- a/api/v1/swagger/definitions/library.yaml >+++ b/api/v1/swagger/definitions/library.yaml >@@ -104,6 +104,13 @@ properties: > pickup_location: > type: boolean > description: If the library can act as a pickup location >+ pickup_items: >+ type: >+ - array >+ - "null" >+ description: Array of items available for pickup at this library is the library is marked as a pickup location >+ items: >+ type: integer > public: > type: boolean > description: If the library is visible to the public >-- >2.44.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 36120
:
162911
|
162912
|
162914
|
162915
|
162916
|
162917
|
162918
|
162919
|
162920
|
162921
|
162922
|
162923
|
162924
|
162925
|
162926
|
162927
|
162928
|
162976
|
163218
|
163219
|
163220
|
163221
|
163222
|
163223
|
163224
|
163435
|
163436
|
163437
|
163438
|
163439
|
163440
|
163441
|
163442
|
163443
|
163444
|
163445
|
163446
|
163447
|
163448
|
163565
|
163566
|
163567
|
163568
|
163569
|
163570
|
163571
|
163603
|
163604
|
163605
|
163606
|
163607
|
163608
|
163609
|
163610
|
163611
|
163612
|
163613
|
163635
|
163636
|
165140
|
165175
|
165176
|
165177
|
165178
|
165179
|
165180
|
165181
|
165182
|
165183
|
165184
|
165185
|
165186
|
165187
|
165188
|
165214
|
165215
|
165216
|
165419
|
165420
|
165421
|
165422
|
165423
|
165424
|
165425
|
165426
|
165427
|
165428
|
165429
|
165430
|
165431
|
165432
|
165433
|
165434
|
165435
|
165984
|
165985
|
165986
|
165987
|
165988
|
165989
|
165990
|
165991
|
165992
|
165993
|
165994
|
165995
|
165996
|
165997
|
165998
|
165999
|
166000
|
166001
|
166002