Bugzilla – Attachment 70997 Details for
Bug 13990
ILS-DI LookupPatron Requries ID Type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13990 - ILS-DI LookupPatron Requries ID Type
Bug-13990---ILS-DI-LookupPatron-Requries-ID-Type.patch (text/plain), 4.03 KB, created by
Mark Tompsett
on 2018-01-28 06:45:40 UTC
(
hide
)
Description:
Bug 13990 - ILS-DI LookupPatron Requries ID Type
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2018-01-28 06:45:40 UTC
Size:
4.03 KB
patch
obsolete
>From 20d72d2236fd9daa2c5cad2e4d99a77ecf8ed194 Mon Sep 17 00:00:00 2001 >From: Jon Knight <J.P.Knight@lboro.ac.uk> >Date: Tue, 7 Nov 2017 17:27:56 +0000 >Subject: [PATCH] Bug 13990 - ILS-DI LookupPatron Requries ID Type > >Patch provides a constrained set of borrower attributes to try in turn if the >ID type is not specified. Also added "email" to the POD documented list of >id types seeing as its quite a useful one for integration developers. > >Test plan: > >1) without the patch applied, turn on ils-di interface in your admin sysprefs > and then try accessing the URL: > > https://your-server/cgi-bin/koha/ilsdi.pl?service=LookupPatron&id=Mabel > > replacing "your-server" your Koha dev test domain name (localhost:8080 if > you're using a kohadevbox VM) and "Mabel" with the first name of a patron > (Mabel is in the test database already if you're using that). > > You should get back an error message in the XML. > >2) Apply the patch and repeat. This time you should get an <id> element in > the XML with Mabel's patron ID in it. > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> >--- > C4/ILSDI/Services.pm | 21 ++++++++++++++++++--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt | 5 ++++- > opac/ilsdi.pl | 2 +- > 3 files changed, 23 insertions(+), 5 deletions(-) > >diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm >index e7b3bca..469e5d1 100644 >--- a/C4/ILSDI/Services.pm >+++ b/C4/ILSDI/Services.pm >@@ -84,7 +84,6 @@ Parameters: > =head3 id (Required) > > list of either biblionumbers or itemnumbers >- > =head3 id_type (Required) > > defines the type of record identifier being used in the request, >@@ -299,16 +298,32 @@ Parameters: > - id_type (Optional) > the type of the identifier, possible values: > - cardnumber >- - firstname > - userid >+ - email > - borrowernumber >+ - firstname >+ - surname > > =cut > > sub LookupPatron { > my ($cgi) = @_; > >- my $patrons = Koha::Patrons->search( { $cgi->param('id_type') => $cgi->param('id') } ); >+ my $patrons; >+ >+ if(!$cgi->param('id')) { >+ return { message => 'PatronNotFound' }; >+ } >+ >+ if($cgi->param('id_type')) { >+ $patrons = Koha::Patrons->search( { $cgi->param('id_type') => $cgi->param('id') } ); >+ } else { >+ foreach my $id_type ('cardnumber', 'userid', 'email', 'borrowernumber', >+ 'surname', 'firstname') { >+ $patrons = Koha::Patrons->search( { $id_type => $cgi->param('id') } ); >+ last if($patrons->count); >+ } >+ } > unless ( $patrons->count ) { > return { message => 'PatronNotFound' }; > } >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt >index 993af71..f62f310 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt >@@ -459,8 +459,11 @@ > <dd>the type of the identifier, possible values: > <ul> > <li>cardnumber</li> >- <li>surname</li> >+ <li>userid</li> >+ <li>email</li> > <li>borrowernumber</li> >+ <li>surname</li> >+ <li>firstname</li> > </ul> > </dd> > </dl> >diff --git a/opac/ilsdi.pl b/opac/ilsdi.pl >index 8320495..b43ca74 100755 >--- a/opac/ilsdi.pl >+++ b/opac/ilsdi.pl >@@ -47,7 +47,7 @@ my @services = ( > # Level 1: Basic Discovery Interfaces > # 'HarvestBibliographicRecords', # OAI-PMH > # 'HarvestExpandedRecords', # OAI-PMH >- 'GetAvailability', # FIXME Add bibbliographic level >+ 'GetAvailability', # FIXME Add bibliographic level > > # 'GoToBibliographicRequestPage' # I don't understant this one > # Level 2: Elementary OPAC supplement >-- >2.1.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 13990
:
69004
|
70965
|
70966
|
70997
|
70998
|
70999
|
71000
|
71001
|
71002
|
71003
|
71004