From a49ba33e541cf728aa8b26c04cd5fe3946b6c0c7 Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Mon, 12 Sep 2022 11:17:01 +1200 Subject: [PATCH] Bug 26831: Add new system preference PurgeListShareInvitesOlderThan Sponsored-by: Catalyst IT, New Zealand --- ...831-add_PurgeListShareInvitesOlderThan_syspref.pl | 12 ++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 1 + .../prog/en/modules/admin/preferences/opac.pref | 8 ++++++++ 3 files changed, 21 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_26831-add_PurgeListShareInvitesOlderThan_syspref.pl diff --git a/installer/data/mysql/atomicupdate/bug_26831-add_PurgeListShareInvitesOlderThan_syspref.pl b/installer/data/mysql/atomicupdate/bug_26831-add_PurgeListShareInvitesOlderThan_syspref.pl new file mode 100755 index 00000000000..5c3fb364017 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_26831-add_PurgeListShareInvitesOlderThan_syspref.pl @@ -0,0 +1,12 @@ +use Modern::Perl; + +return { + bug_number => "26831", + description => "Add new system preference PurgeListShareInvitesOlderThan", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + + $dbh->do(q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('PurgeListShareInvitesOlderThan', '14', NULL, 'If not empty, number of days used when deleting unaccepted list share invites', 'Integer') }); + }, +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 3ee50c6d93c..b5f1c115624 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -564,6 +564,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('Pseudonymization','0',NULL,'If enabled patrons and transactions will be copied in a separate table for statistics purpose','YesNo'), ('PseudonymizationPatronFields','','title,city,state,zipcode,country,branchcode,categorycode,dateenrolled,sex,sort1,sort2','Patron fields to copy to the pseudonymized_transactions table','multiple'), ('PseudonymizationTransactionFields','','datetime,branchcode,transaction_type,itemnumber,itemtype,holdingbranch,location,itemcallnumber,ccode','Transaction fields to copy to the pseudonymized_transactions table','multiple'), +('PurgeListShareInvitesOlderThan', '14', NULL, 'If not empty, number of days used when deleting unaccepted list share invites', 'Integer'), ('PurgeSuggestionsOlderThan', '', NULL, 'If this script is called without the days parameter', 'Integer'), ('QueryAutoTruncate','1',NULL,'If ON, query truncation is enabled by default','YesNo'), ('QueryFuzzy','1',NULL,'If ON, enables fuzzy option for searches','YesNo'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index c74d5c9d497..83c2e874351 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -660,6 +660,14 @@ OPAC: 1: "Block" 0: "Don't block" - expired patrons from OPAC actions such as placing a hold or renewing. Note that the setting for a patron category takes priority over this system preference. + - + - The cleanup_database.pl cronjob will automatically delete unaccepted private list share invites after a period of + - pref: PurgeListShareInvitesOlderThan + class: integer + - "days. Example: [14] Sets purgation of unaccepted private list share invites for those older than 14 days." + - "
WARNING: This system preference will be overridden when the cleanup_database.pl cronjob is run with the --list-invites parameter." + - "
If neither the --list-invites parameter or this system preference are set then the cronjob will not delete any unaccepted private list share invites." + - "
Note: This system preference requires the misc/cronjobs/cleanup_database.pl cronjob. Ask your system administrator to schedule it." - - Limit patrons to - pref: MaxOpenSuggestions -- 2.20.1