Bugzilla – Attachment 178988 Details for
Bug 37901
Add ILL pseudonymization
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37901: Consider illrequest_id when creating
Bug-37901-Consider-illrequestid-when-creating.patch (text/plain), 2.76 KB, created by
Pedro Amorim
on 2025-03-05 15:54:59 UTC
(
hide
)
Description:
Bug 37901: Consider illrequest_id when creating
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2025-03-05 15:54:59 UTC
Size:
2.76 KB
patch
obsolete
>From ee7184ff83a248adfc8707404e1ede7b89b1a4af Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Mon, 3 Mar 2025 15:30:11 -0100 >Subject: [PATCH] Bug 37901: Consider illrequest_id when creating > >When a new PseudonymizedTransaction is created, consider the presence of illrequest_id and act on it accordingly. >--- > Koha/ILL/Request.pm | 41 ++++++++++++++++++++++++++++++++ > Koha/PseudonymizedTransaction.pm | 8 +++++++ > 2 files changed, 49 insertions(+) > >diff --git a/Koha/ILL/Request.pm b/Koha/ILL/Request.pm >index 90035032e42..48bfd6ba2d8 100644 >--- a/Koha/ILL/Request.pm >+++ b/Koha/ILL/Request.pm >@@ -2218,6 +2218,47 @@ sub can_patron_place_ill_in_opac { > return 1; > } > >+=head3 pseudonymize_illrequestattributes >+ >+ $illrequest->pseudonymize_illrequestattributes($transaction); >+ >+This method creates a Koha::PseudonymizedTransaction object, adding pseudonymized ILL request attributes and backend info as metadata values. >+ >+=cut >+ >+sub pseudonymize_illrequestattributes { >+ my ( $self, $transaction ) = @_; >+ >+ my @attributes_to_pseudonymize = qw( >+ type >+ ); >+ >+ my $extended_attributes = $self->extended_attributes; >+ while ( my $attribute = $extended_attributes->next ) { >+ if ( grep { $_ eq $attribute->type } @attributes_to_pseudonymize ) { >+ $transaction->_result->create_related( >+ 'pseudonymized_metadata_values', >+ { >+ key => $attribute->type, >+ value => $attribute->value, >+ tablename => 'illrequestattributes', >+ } >+ ) if $attribute->value ne ''; >+ } >+ } >+ >+ if ( $self->backend ) { >+ $transaction->_result->create_related( >+ 'pseudonymized_metadata_values', >+ { >+ key => 'backend', >+ value => $self->backend, >+ tablename => 'illrequestattributes', >+ } >+ ); >+ } >+} >+ > =head3 get_op_param_deprecation > > my $op = $req->check_url_param_deprecation($params); >diff --git a/Koha/PseudonymizedTransaction.pm b/Koha/PseudonymizedTransaction.pm >index 845505143ca..17079f4ce9e 100644 >--- a/Koha/PseudonymizedTransaction.pm >+++ b/Koha/PseudonymizedTransaction.pm >@@ -22,6 +22,7 @@ use List::MoreUtils qw(any); > use Koha::Database; > use Koha::Exceptions::Config; > use Koha::Patrons; >+use Koha::ILL::Requests; > > use base qw(Koha::Object); > >@@ -111,6 +112,13 @@ sub new_from_statistic { > } > } > >+ if ( $statistic->illrequest_id ) { >+ my $illrequest = Koha::ILL::Requests->find( $statistic->illrequest_id ); >+ if ($illrequest) { >+ $illrequest->pseudonymize_illrequestattributes($self); >+ } >+ } >+ > return $self; > } > >-- >2.39.5
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 37901
:
178356
|
178956
|
178957
|
178958
|
178959
|
178960
|
178961
|
178962
|
178963
|
178964
|
178965
|
178966
|
178967
|
178968
|
178980
|
178981
|
178982
|
178983
|
178984
|
178985
|
178986
|
178987
|
178988
|
178989
|
178990
|
178991
|
178992
|
181008
|
181009
|
181010
|
181011
|
181012
|
181013
|
181014
|
181015
|
181016
|
181017
|
181018
|
181019
|
181020