Bugzilla – Attachment 164129 Details for
Bug 23260
Anonymize (remove) patron data from items_last_borrower
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23260: Database updates and new system preferences AnonymizeLastBorrower / AnonymizeLastBorrowerDays
Bug-23260-Database-updates-and-new-system-preferen.patch (text/plain), 5.20 KB, created by
Kyle M Hall (khall)
on 2024-03-29 13:46:07 UTC
(
hide
)
Description:
Bug 23260: Database updates and new system preferences AnonymizeLastBorrower / AnonymizeLastBorrowerDays
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2024-03-29 13:46:07 UTC
Size:
5.20 KB
patch
obsolete
>From 3f85d82d3c559577f06669e2bc1e03438a22b525 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 28 Nov 2023 13:27:27 +0000 >Subject: [PATCH] Bug 23260: Database updates and new system preferences > AnonymizeLastBorrower / AnonymizeLastBorrowerDays > >This patch alters the items_last_borrowers table to allow for NULL borrowers > >It also adds two new system preferences to allow controlling the anonymization of items_last_borrower data > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > .../data/mysql/atomicupdate/bug_23260.perl | 22 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 2 +- > installer/data/mysql/mandatory/sysprefs.sql | 2 ++ > .../en/modules/admin/preferences/patrons.pref | 8 +++++++ > 4 files changed, 33 insertions(+), 1 deletion(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_23260.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_23260.perl b/installer/data/mysql/atomicupdate/bug_23260.perl >new file mode 100644 >index 00000000000..57199bf281b >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_23260.perl >@@ -0,0 +1,22 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "23260", >+ description => "Make borrowernumber from items_last_borrower nullable, and add AnonymizeLastBorrower and AnonymizeLastBorrowerDays preferences", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ # Do you stuffs here >+ $dbh->do(q{}); >+ $dbh->do( "ALTER TABLE items_last_borrower MODIFY COLUMN `borrowernumber` int(11) default NULL" ); >+ say $out "items_last_borrower updated to allow NULL borrowernumbers"; >+ >+ $dbh->do(q{ >+ INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES >+ ('AnonymizeLastBorrower','0',NULL,'If enabled, anonymize item\'s last borrower','YesNo'), >+ ('AnonymizeLastBorrowerDays','0',NULL,'Item\'s last borrower older than this preference will be anonymized','Integer') >+ }); >+ say $out "Added new system preferences 'AnonymizeLastBorrower' and 'AnonymizeLastBorrowerDays'"; >+ }, >+}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index ea540c0819d..293b9ffd3c3 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -4067,7 +4067,7 @@ DROP TABLE IF EXISTS `items_last_borrower`; > CREATE TABLE `items_last_borrower` ( > `id` int(11) NOT NULL AUTO_INCREMENT, > `itemnumber` int(11) NOT NULL, >- `borrowernumber` int(11) NOT NULL, >+ `borrowernumber` int(11) NULL, > `created_on` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), > PRIMARY KEY (`id`), > UNIQUE KEY `itemnumber` (`itemnumber`), >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index b1aba01bcbd..072e749b17a 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -57,6 +57,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('AmazonCoverImages','0','','Display Cover Images in staff interface from Amazon Web Services','YesNo'), > ('AmazonLocale','US','US|CA|DE|FR|IN|JP|UK','Use to set the Locale of your Amazon.com Web Services','Choice'), > ('AnonSuggestions','0',NULL,'Set to enable Anonymous suggestions to AnonymousPatron borrowernumber','YesNo'), >+('AnonymizeLastBorrower','0',NULL,'If enabled, anonymise item\'s last borrower','YesNo'), >+('AnonymizeLastBorrowerDays','0',NULL,'Item\'s last borrower older than this preference will be anonymised','Integer'), > ('AnonymousPatron','0',NULL,'Set the identifier (borrowernumber) of the anonymous patron. Used for suggestion and checkout history privacy',''), > ('ApplyFrameworkDefaults', 'new', 'new|duplicate|changed|imported', 'Configure when to apply framework default values - when cataloguing a new record, or when editing a record as new (duplicating), or when changing framework, or when importing a record', 'multiple'), > ('ArticleRequests', '0', NULL, 'Enables the article request feature', 'YesNo'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >index f48ba4c13cd..8044f6a0256 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >@@ -428,6 +428,14 @@ Patrons: > initiator: populateCookieConsentedJS > processor: prepareCookieConsentedJS > - '<br><strong>NOTE:</strong> The cookie consent modal can be customised using the <a href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations" target="_blank">CookieConsentPopup</a> html customisation.' >+ - >+ - pref: AnonymizeLastBorrower >+ choices: >+ yes: Anonymize >+ no: "Don't anonymize" >+ - " item's last borrower after " >+ - pref: AnonymizeLastBorrowerDays >+ - days. > Security: > - > - Login passwords for staff and patrons must be at least >-- >2.30.2
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 23260
:
92863
|
92864
|
93052
|
94858
|
94859
|
95033
|
95457
|
95458
|
95459
|
95460
|
95651
|
95698
|
95699
|
95700
|
95701
|
95769
|
95770
|
95771
|
95772
|
96791
|
97841
|
97842
|
98044
|
98053
|
98054
|
98064
|
98282
|
98349
|
98352
|
112734
|
112735
|
112736
|
112737
|
112738
|
112739
|
112740
|
112741
|
112742
|
112743
|
117974
|
117975
|
117976
|
117977
|
117978
|
117979
|
117980
|
117981
|
117982
|
117983
|
120522
|
120523
|
120524
|
120525
|
120526
|
120527
|
120528
|
120529
|
120530
|
120531
|
122963
|
122964
|
122965
|
122966
|
122967
|
122968
|
122969
|
122970
|
122971
|
122972
|
145175
|
145176
|
145177
|
145178
|
145179
|
145180
|
145181
|
145182
|
145183
|
145184
|
157106
|
157107
|
157108
|
157109
|
157110
|
157111
|
157112
|
157113
|
157114
|
157115
|
157116
|
159291
|
159292
|
159293
|
159294
|
159298
|
159299
|
159300
|
159301
| 164129 |
164130
|
164131
|
164132
|
164133