Bugzilla – Attachment 181016 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 or completing
Bug-37901-Consider-illrequestid-when-creating-or-c.patch (text/plain), 2.18 KB, created by
Pedro Amorim
on 2025-04-16 15:43:59 UTC
(
hide
)
Description:
Bug 37901: Consider illrequest_id when creating or completing
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2025-04-16 15:43:59 UTC
Size:
2.18 KB
patch
obsolete
>From 998a47993cbc520a04cd80a124749cd38fc7d1aa 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 or completing > >When a new PseudonymizedTransaction is created, consider the presence of illrequest_id and act on it accordingly. >--- > Koha/PseudonymizedTransaction.pm | 35 ++++++++++++++++++++++++++++++++ > 1 file changed, 35 insertions(+) > >diff --git a/Koha/PseudonymizedTransaction.pm b/Koha/PseudonymizedTransaction.pm >index c85bd4dce13..545017f5a79 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); > >@@ -113,6 +114,40 @@ sub new_from_statistic { > } > } > >+ if ( $statistic->illrequest_id ) { >+ my $illrequest = Koha::ILL::Requests->find( $statistic->illrequest_id ); >+ if ($illrequest) { >+ my @illattributes_to_pseudonymize = qw( >+ type >+ ); >+ >+ my $extended_attributes_to_pseudonymize = >+ $illrequest->extended_attributes->search( { type => { -in => \@illattributes_to_pseudonymize } } ); >+ >+ while ( my $attribute = $extended_attributes_to_pseudonymize->next ) { >+ $self->_result->create_related( >+ 'pseudonymized_metadata_values', >+ { >+ key => $attribute->type, >+ value => $attribute->value, >+ tablename => 'illrequestattributes', >+ } >+ ); >+ } >+ >+ if ( $illrequest->backend ) { >+ $self->_result->create_related( >+ 'pseudonymized_metadata_values', >+ { >+ key => 'backend', >+ value => $illrequest->backend, >+ tablename => 'illrequestattributes', >+ } >+ ); >+ } >+ } >+ } >+ > 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