Bugzilla – Attachment 78268 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), 2.13 KB, created by
Matthias Meusburger
on 2018-08-29 14:09:54 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:
Matthias Meusburger
Created:
2018-08-29 14:09:54 UTC
Size:
2.13 KB
patch
obsolete
>From 7530666995e85d59f310a4f41a63191a96a49c6f 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 | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > >diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm >index 158ff8e..191fee5 100644 >--- a/C4/ILSDI/Services.pm >+++ b/C4/ILSDI/Services.pm >@@ -28,6 +28,7 @@ use C4::Biblio; > use C4::Reserves qw(AddReserve CanBookBeReserved CanItemBeReserved IsAvailableForItemLevelRequest); > use C4::Context; > use C4::AuthoritiesMarc; >+use C4::Reserves; > use XML::Simple; > use HTML::Entities; > use CGI qw ( -utf8 ); >@@ -470,6 +471,22 @@ sub GetPatronInfo { > while ( my $c = $pending_checkouts->next ) { > # FIXME We should only retrieve what is needed in the template > my $issue = $c->unblessed_all_relateds; >+ >+ # 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.7.4
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