Bugzilla – Attachment 178356 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: Add ILL pseudonymization
Bug-37901-Add-ILL-pseudonymization.patch (text/plain), 3.27 KB, created by
Pedro Amorim
on 2025-02-19 15:15:34 UTC
(
hide
)
Description:
Bug 37901: Add ILL pseudonymization
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2025-02-19 15:15:34 UTC
Size:
3.27 KB
patch
obsolete
>From 4ba56dc75f230c1c637353f00b2d2e7b431b1a71 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Wed, 19 Feb 2025 14:44:34 +0000 >Subject: [PATCH] Bug 37901: Add ILL pseudonymization > >1) Apply patches >2) Add a <bcrypt_settings> under <config> in /etc/koha/sites/kohadev/koha.conf.xml: > $ <bcrypt_settings>$2a$08$9lmorEKnwQloheaCLFIfje</bcrypt_settings> <!-- taken from Pseudonymization.t --> >3) Restart plack & worker: > $ koha-plack --restart kohadev && sudo koha-worker --restart kohadev >4) Enable ILLModule and Pseudonymization system preferences >5) Create an ILL request >6) Confirm the pseudonymized_transaction has been added: > $ koha-mysql kohadev > $ select * from pseudonymized_transactions; >7) Further testing with more data: Check all options from PseudonymizationPatronFields and PseudonymizationTransactionFields and repeat steps 5) and 6). >--- > Koha/ILL/Request.pm | 16 ++++++++++++++++ > Koha/Statistic.pm | 9 ++++++--- > 2 files changed, 22 insertions(+), 3 deletions(-) > >diff --git a/Koha/ILL/Request.pm b/Koha/ILL/Request.pm >index 90035032e42..783ecb45e11 100644 >--- a/Koha/ILL/Request.pm >+++ b/Koha/ILL/Request.pm >@@ -2009,6 +2009,7 @@ possibly records the fact that something happened > sub store { > my ( $self, $attrs ) = @_; > >+ my $is_new_request = !$self->in_storage; > my %updated_columns = $self->_result->get_dirty_columns; > > my @holds; >@@ -2049,6 +2050,21 @@ sub store { > ); > } > >+ return $ret unless $is_new_request; >+ >+ C4::Stats::UpdateStats( >+ { >+ borrowernumber => $self->borrowernumber // undef, >+ branch => $self->branchcode, >+ categorycode => $self->patron ? $self->patron->categorycode : undef, >+ ccode => undef, >+ itemnumber => undef, >+ itemtype => undef, >+ location => undef, >+ type => 'ill_request', >+ } >+ ); >+ > return $ret; > } > >diff --git a/Koha/Statistic.pm b/Koha/Statistic.pm >index c28a1e0d2b0..37b695cc160 100644 >--- a/Koha/Statistic.pm >+++ b/Koha/Statistic.pm >@@ -27,8 +27,9 @@ use Koha::BackgroundJob::PseudonymizeStatistic; > > use base qw(Koha::Object); > >-our @allowed_accounts_types = qw( writeoff payment ); >-our @allowed_circulation_types = qw( renew issue localuse return onsite_checkout recall item_found item_lost ); >+our @allowed_accounts_types = qw( writeoff payment ); >+our @allowed_circulation_types = >+ qw( renew issue localuse return onsite_checkout recall item_found item_lost ill_request ); > our @mandatory_accounts_keys = qw( type branch borrowernumber value ); # note that amount is mapped to value > our @mandatory_circulation_keys = qw( type branch borrowernumber itemnumber ccode itemtype ); > >@@ -149,7 +150,9 @@ Generate a pesudonymized version of the statistic. > sub pseudonymize { > my ($self) = @_; > >- return unless ( $self->borrowernumber && grep { $_ eq $self->type } qw(renew issue return onsite_checkout) ); >+ return >+ unless ( $self->borrowernumber && grep { $_ eq $self->type } >+ qw(renew issue return onsite_checkout ill_request) ); > > # FIXME When getting the object from svc/renewal we get a DateTime object > # normally we just fetch from DB to clear this, but statistics has no primary key >-- >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