Bugzilla – Attachment 109439 Details for
Bug 21284
ILS-DI: Allow GetPatronInfo to tell if a checked out item is on hold for someone else
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21284: ILS-DI: Allow GetPatronInfo to tell if a loaned item is on hold by someone else.
Bug-21284-ILS-DI-Allow-GetPatronInfo-to-tell-if-a-.patch (text/plain), 1.88 KB, created by
Fridolin Somers
on 2020-09-01 14:18:16 UTC
(
hide
)
Description:
Bug 21284: ILS-DI: Allow GetPatronInfo to tell if a loaned item is on hold by someone else.
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2020-09-01 14:18:16 UTC
Size:
1.88 KB
patch
obsolete
>From 2685aede35f50e29a0919f320e489100f979a806 Mon Sep 17 00:00:00 2001 >From: Matthias Meusburger <matthias.meusburger@biblibre.com> >Date: Fri, 27 Apr 2018 16:22:28 +0200 >Subject: [PATCH] Bug 21284: ILS-DI: Allow GetPatronInfo to tell if a loaned > item is on hold by someone else. > >This patch adds two entries in the loans section of GetPatronInfo's response: > > - itemonhold: number of holds on this specific item. > - recordonhold: number of holds on the record. > >Test plan: > > - Call GetPatronInfo on a user with a loan that has no holds > - Check that itemonhold and recordonhold entries are equal to zero > > - Add holds on biblio and/or item level > - Check that itemonhold and recordonhold are incremented accordingly > >Please note that a hold on item level counts as a hold on record level, but not vice-versa. >--- > C4/ILSDI/Services.pm | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > >diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm >index 5ebba3435d..5156cd7356 100644 >--- a/C4/ILSDI/Services.pm >+++ b/C4/ILSDI/Services.pm >@@ -497,6 +497,22 @@ sub GetPatronInfo { > # FIXME We should only retrieve what is needed in the template > my $issue = $c->unblessed_all_relateds; > delete $issue->{'more_subfields_xml'}; >+ >+ # Is the item already on hold by another user? >+ my $rs = Koha::Database->new()->schema()->resultset('Reserve'); >+ $issue->{'itemonhold'} = $rs->count( >+ { >+ itemnumber => $issue->{'itemnumber'} >+ } >+ ); >+ >+ # Is the record (next available item) on hold by another user? >+ $issue->{'recordonhold'} = $rs->count( >+ { >+ biblionumber => $issue->{'biblionumber'} >+ } >+ ); >+ > push @checkouts, $issue > } > $borrower->{'loans'}->{'loan'} = \@checkouts; >-- >2.27.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 21284
:
78268
|
78269
|
90326
|
109438
|
109439
|
157648
|
157727
|
157728
|
158351
|
158352
|
158353
|
158899