From fb19f09b045742b6a2d205fbca80b13d83a80d75 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 Signed-off-by: David Nind --- ...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 0000000000..5c3fb36401 --- /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 91989ef7bc..8495abcda3 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -596,6 +596,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 39815ecf72..6eaa7dad73 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 @@ -652,6 +652,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." - - pref: OpacTrustedCheckout default: 0 -- 2.30.2