Bugzilla – Attachment 194298 Details for
Bug 14962
Temp Shelving Location / On Display Module
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14962: On Display svc API changes
518c9a5.patch (text/plain), 4.28 KB, created by
Martin Renvoize (ashimema)
on 2026-03-02 10:23:35 UTC
(
hide
)
Description:
Bug 14962: On Display svc API changes
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2026-03-02 10:23:35 UTC
Size:
4.28 KB
patch
obsolete
>From 518c9a5b5bc4310236420408b247e87837f25f6b Mon Sep 17 00:00:00 2001 >From: Jake Deery <jake.deery@openfifth.co.uk> >Date: Mon, 1 Dec 2025 14:54:18 +0000 >Subject: [PATCH] Bug 14962: On Display svc API changes > >This patch updates svc/checkouts to factor in updates to the checkout >process, caused by addition of the effective locations, collection >codes, and branches. >Please see the test files commit for instructions on how to test this >bundle of patches. > >Sponsored-by: ByWater Solutions >Signed-of-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> >--- > svc/checkouts | 52 +++++++++++++++++++++++++++++++++++++++++++++------ > 1 file changed, 46 insertions(+), 6 deletions(-) > >diff --git a/svc/checkouts b/svc/checkouts >index 3d568e357d8..344e39e222f 100755 >--- a/svc/checkouts >+++ b/svc/checkouts >@@ -66,6 +66,8 @@ binmode STDOUT, ":encoding(UTF-8)"; > print $input->header( -type => 'application/json', -charset => 'UTF-8' ); > > my @parameters; >+my $use_display_module = C4::Context->preference('UseDisplayModule'); >+ > my $sql = ' > SELECT > issues.issue_id, >@@ -120,8 +122,21 @@ my $sql = ' > return_claims.id AS return_claim_id, > return_claims.notes AS return_claim_notes, > return_claims.created_on AS return_claim_created_on, >- return_claims.updated_on AS return_claim_updated_on >+ return_claims.updated_on AS return_claim_updated_on'; > >+if ($use_display_module) { >+ $sql .= ', >+ COALESCE(active_display.display_location, items.location) AS effective_location, >+ active_display.display_name, >+ active_display.display_location AS raw_display_location'; >+} else { >+ $sql .= ', >+ items.location AS effective_location, >+ NULL AS display_name, >+ NULL AS raw_display_location'; >+} >+ >+$sql .= ' > FROM issues > LEFT JOIN items USING ( itemnumber ) > LEFT JOIN biblio USING ( biblionumber ) >@@ -129,7 +144,26 @@ my $sql = ' > LEFT JOIN borrowers USING ( borrowernumber ) > LEFT JOIN branches ON ( issues.branchcode = branches.branchcode ) > LEFT JOIN branches branches2 ON ( items.homebranch = branches2.branchcode ) >- LEFT JOIN return_claims USING ( issue_id ) >+ LEFT JOIN return_claims USING ( issue_id )'; >+ >+if ($use_display_module) { >+ $sql .= ' >+ LEFT JOIN ( >+ SELECT >+ di.itemnumber, >+ d.display_location, >+ d.display_name, >+ ROW_NUMBER() OVER (PARTITION BY di.itemnumber ORDER BY di.date_added DESC) as rn >+ FROM display_items di >+ JOIN displays d ON di.display_id = d.display_id >+ WHERE d.enabled = 1 >+ AND (d.start_date IS NULL OR d.start_date <= CURDATE()) >+ AND (d.end_date IS NULL OR d.end_date >= CURDATE()) >+ AND (di.date_remove IS NULL OR di.date_remove >= CURDATE()) >+ ) active_display ON items.itemnumber = active_display.itemnumber AND active_display.rn = 1'; >+} >+ >+$sql .= ' > WHERE issues.borrowernumber > '; > >@@ -185,10 +219,16 @@ while ( my $c = $sth->fetchrow_hashref() ) { > $type_for_stat = $item_level_itypes ? $itemtype : $recordtype; > > my $location; >- if ( $c->{location} ) { >+ if ( $c->{display_name} && !$c->{raw_display_location} ) { >+ >+ # Item is on display with no specific display location >+ $location = "DISPLAY: " . $c->{display_name}; >+ } else { >+ >+ # Use AuthorisedValues to get effective location description > my $av = Koha::AuthorisedValues->get_description_by_koha_field( >- { kohafield => 'items.location', authorised_value => $c->{location} } ); >- $location = $av->{lib} ? $av->{lib} : ''; >+ { kohafield => 'items.location', authorised_value => $c->{effective_location} } ); >+ $location = $av->{lib} || ''; > } > my $collection; > if ( $c->{collection} ) { >@@ -222,7 +262,7 @@ while ( my $c = $sth->fetchrow_hashref() ) { > if ( C4::Context->preference('UseRecalls') ) { > my $item = Koha::Items->find( $c->{itemnumber} ); > my $recall = undef; >- $recall = $item->check_recalls if $item->can_be_waiting_recall; >+ $recall = $item->check_recalls if $item && $item->can_be_waiting_recall; > if ( defined $recall ) { > if ( $recall->item_level ) { > if ( $recall->item_id == $c->{itemnumber} ) { >-- >2.53.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 14962
:
190216
|
190217
|
190218
|
190219
|
190220
|
190221
|
190222
|
190223
|
190224
|
190225
|
190226
|
190227
|
190228
|
190229
|
190230
|
190231
|
190232
|
190571
|
190572
|
193719
|
193720
|
193721
|
193722
|
193723
|
193724
|
193725
|
193726
|
193727
|
193728
|
193729
|
193730
|
193731
|
193732
|
193733
|
193734
|
193735
|
193736
|
193737
|
193738
|
193739
|
193740
|
193741
|
193742
|
193743
|
193744
|
193745
|
193746
|
193747
|
193748
|
193749
|
193750
|
193751
|
193752
|
193753
|
193754
|
193755
|
194285
|
194286
|
194287
|
194288
|
194289
|
194290
|
194291
|
194292
|
194293
|
194294
|
194295
|
194296
|
194297
| 194298 |
194299
|
194300
|
194301
|
194302
|
194303
|
194304
|
194305
|
194306
|
194307
|
194308
|
194309
|
194310
|
194311
|
194312
|
194313
|
194314
|
194315
|
194316
|
194317
|
194318
|
194320
|
194321
|
194322