Bugzilla – Attachment 93495 Details for
Bug 21301
Restriction of the informations given by GetRecords ILS-DI service
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21301: Remove patron informations in issues for GetRecords ILS-DI service
Bug-21301-Remove-patron-informations-in-issues-for.patch (text/plain), 4.99 KB, created by
Fridolin Somers
on 2019-10-02 15:03:06 UTC
(
hide
)
Description:
Bug 21301: Remove patron informations in issues for GetRecords ILS-DI service
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2019-10-02 15:03:06 UTC
Size:
4.99 KB
patch
obsolete
>From d5a22258e9912ea786910fbc5200821e7d4f8392 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Wed, 2 Oct 2019 16:28:21 +0200 >Subject: [PATCH] Bug 21301: Remove patron informations in issues for > GetRecords ILS-DI service > >Actually, the GetRecords service gives many information : >bibliographic data (marcxml field) >item data (items field) >issue data (issues field) > >The issue data should not be sent by these service, its a privacy problem. >Biblio title and author are redundant. >This patch changes to use Koha::Checkouts to get issues informations with only the addition of item barcode. > >Test plan : >1) Enable ILS-DI webservice >2) Checkout an item >3) Go to {opac}/cgi-bin/koha/ilsdi.pl?service=GetRecords&id={biblionumber} >4) Check the issues tag content >--- > C4/Circulation.pm | 45 ------------------------------ > C4/ILSDI/Services.pm | 11 ++++++-- > t/db_dependent/Circulation/issue.t | 4 --- > 3 files changed, 9 insertions(+), 51 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 014c018628..e26585e1e0 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -98,7 +98,6 @@ BEGIN { > &GetIssuingCharges > &GetBranchBorrowerCircRule > &GetBranchItemRule >- &GetBiblioIssues > &GetOpenIssue > &CheckIfIssuedToPatron > &IsItemIssued >@@ -2533,50 +2532,6 @@ sub GetOpenIssue { > > } > >-=head2 GetBiblioIssues >- >- $issues = GetBiblioIssues($biblionumber); >- >-this function get all issues from a biblionumber. >- >-Return: >-C<$issues> is a reference to array which each value is ref-to-hash. This ref-to-hash contains all column from >-tables issues and the firstname,surname & cardnumber from borrowers. >- >-=cut >- >-sub GetBiblioIssues { >- my $biblionumber = shift; >- return unless $biblionumber; >- my $dbh = C4::Context->dbh; >- my $query = " >- SELECT issues.*,items.barcode,biblio.biblionumber,biblio.title, biblio.author,borrowers.cardnumber,borrowers.surname,borrowers.firstname >- FROM issues >- LEFT JOIN borrowers ON borrowers.borrowernumber = issues.borrowernumber >- LEFT JOIN items ON issues.itemnumber = items.itemnumber >- LEFT JOIN biblioitems ON items.itemnumber = biblioitems.biblioitemnumber >- LEFT JOIN biblio ON biblio.biblionumber = items.biblionumber >- WHERE biblio.biblionumber = ? >- UNION ALL >- SELECT old_issues.*,items.barcode,biblio.biblionumber,biblio.title, biblio.author,borrowers.cardnumber,borrowers.surname,borrowers.firstname >- FROM old_issues >- LEFT JOIN borrowers ON borrowers.borrowernumber = old_issues.borrowernumber >- LEFT JOIN items ON old_issues.itemnumber = items.itemnumber >- LEFT JOIN biblioitems ON items.itemnumber = biblioitems.biblioitemnumber >- LEFT JOIN biblio ON biblio.biblionumber = items.biblionumber >- WHERE biblio.biblionumber = ? >- ORDER BY timestamp >- "; >- my $sth = $dbh->prepare($query); >- $sth->execute($biblionumber, $biblionumber); >- >- my @issues; >- while ( my $data = $sth->fetchrow_hashref ) { >- push @issues, $data; >- } >- return \@issues; >-} >- > =head2 GetUpcomingDueIssues > > my $upcoming_dues = GetUpcomingDueIssues( { days_in_advance => 4 } ); >diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm >index 049ddcf600..24d50b2d3b 100644 >--- a/C4/ILSDI/Services.pm >+++ b/C4/ILSDI/Services.pm >@@ -229,7 +229,14 @@ sub GetRecords { > # Get most of the needed data > my $biblioitemnumber = $biblioitem->{'biblioitemnumber'}; > my $holds = $biblio->current_holds->unblessed; >- my $issues = GetBiblioIssues($biblionumber); >+ my $checkouts = Koha::Checkouts->search( >+ { biblionumber => $biblionumber }, >+ { >+ join => 'item', >+ '+select' => ['item.barcode'], >+ '+as' => ['barcode'], >+ } >+ )->unblessed; > my @items = $biblio->items->as_list; > > $biblioitem->{items}->{item} = []; >@@ -261,7 +268,7 @@ sub GetRecords { > > # Hashref building... > $biblioitem->{'reserves'}->{'reserve'} = $holds; >- $biblioitem->{'issues'}->{'issue'} = $issues; >+ $biblioitem->{'issues'}->{'issue'} = $checkouts; > > push @records, $biblioitem; > } >diff --git a/t/db_dependent/Circulation/issue.t b/t/db_dependent/Circulation/issue.t >index 9abae4ac40..9bca59199c 100644 >--- a/t/db_dependent/Circulation/issue.t >+++ b/t/db_dependent/Circulation/issue.t >@@ -46,7 +46,6 @@ can_ok( > AddIssuingCharge > AddRenewal > AddReturn >- GetBiblioIssues > GetIssuingCharges > GetOpenIssue > GetRenewCount >@@ -263,9 +262,6 @@ ok( $stat, "Bug 18572 - 'Bug 18572 - OpacRenewalBranch is now respected" ); > > > >-#Test GetBiblioIssues >-is( GetBiblioIssues(), undef, "GetBiblio Issues without parameters" ); >- > #Test GetOpenIssue > is( GetOpenIssue(), undef, "Without parameter GetOpenIssue returns undef" ); > is( GetOpenIssue(-1), undef, >-- >2.17.1
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 21301
:
93495
|
93603
|
95158
|
95159
|
95178
|
101818
|
109646
|
113061
|
113062
|
113063
|
113064
|
113065
|
113068
|
113069
|
113070
|
113071
|
113072
|
115022
|
115023
|
115024
|
115025
|
115026