Bugzilla – Attachment 104798 Details for
Bug 25429
`cleanup_database.pl` should remove resolved claims returned after X days
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25429: Implement system preference, remove command line switch
Bug-25429-Implement-system-preference-remove-comma.patch (text/plain), 4.56 KB, created by
Kyle M Hall (khall)
on 2020-05-12 18:59:46 UTC
(
hide
)
Description:
Bug 25429: Implement system preference, remove command line switch
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2020-05-12 18:59:46 UTC
Size:
4.56 KB
patch
obsolete
>From 34d317aa5db48bf192904ece9936aae01eb799ee Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 12 May 2020 14:59:32 -0400 >Subject: [PATCH] Bug 25429: Implement system preference, remove command line > switch > >--- > installer/data/mysql/atomicupdate/bug_25429.perl | 9 +++++++++ > installer/data/mysql/sysprefs.sql | 1 + > .../prog/en/modules/admin/preferences/circulation.pref | 6 ++++++ > misc/cronjobs/cleanup_database.pl | 4 +--- > 4 files changed, 17 insertions(+), 3 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_25429.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_25429.perl b/installer/data/mysql/atomicupdate/bug_25429.perl >new file mode 100644 >index 0000000000..c9d4222f9c >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_25429.perl >@@ -0,0 +1,9 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do(q{ >+ INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES >+ ('CleanUpDatabaseReturnClaims', '', '', 'Sets the age of resolved return claims to delete from the database for cleanup_database.pl', 'Integer' ); >+ }); >+ >+ NewVersion( $DBversion, 25429, "Cleanup Database - remove resolved claims returned from db after X days"); >+} >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 58bd459e94..6b5ca97f67 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -128,6 +128,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('ClaimReturnedChargeFee', 'ask', 'ask|charge|no_charge', 'Controls whether or not a lost item fee is charged for return claims', 'Choice'), > ('ClaimReturnedLostValue', '', '', 'Sets the LOST AV value that represents "Claims returned" as a lost value', 'Free'), > ('ClaimReturnedWarningThreshold', '', '', 'Sets the number of return claims past which the librarian will be warned the patron has many return claims', 'Integer'), >+('CleanUpDatabaseReturnClaims', '', '', 'Sets the age of resolved return claims to delete from the database for cleanup_database.pl', 'Integer' ), > ('CoceHost', '', NULL, 'Coce server URL', 'Free'), > ('CoceProviders', '', 'aws,gb,ol', 'Coce providers', 'multiple'), > ('COinSinOPACResults','1','','If ON, use COinS in OPAC search results page. NOTE: this can slow down search response time significantly','YesNo'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >index 9ea394b716..4356302ea4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >@@ -1153,3 +1153,9 @@ Circulation: > - pref: ClaimReturnedWarningThreshold > class: integer > - items. >+ - >+ - Remove resolved return claims older than >+ - pref: CleanUpDatabaseReturnClaims >+ class: integer >+ - days. >+ - <span class="hint">This system preference is used by the cleanup_database.pl cronjob.</span> >diff --git a/misc/cronjobs/cleanup_database.pl b/misc/cronjobs/cleanup_database.pl >index 537c4a93b7..693ec64a25 100755 >--- a/misc/cronjobs/cleanup_database.pl >+++ b/misc/cronjobs/cleanup_database.pl >@@ -87,7 +87,6 @@ Usage: $0 [-h|--help] [--sessions] [--sessdays DAYS] [-v|--verbose] [--zebraqueu > Defaults to 30 days if no days specified. > > --all-restrictions Purge all expired patrons restrictions. >- --return-claims DAYS Purge all resolved return claims older than DAYS. > --del-exp-selfreg Delete expired self registration accounts. > --del-unv-selfreg DAYS Delete unverified self registrations older than DAYS. > --unique-holidays DAYS Delete all unique holidays older than DAYS. >@@ -120,7 +119,7 @@ my $pZ3950; > my $pListShareInvites; > my $pDebarments; > my $allDebarments; >-my $return_claims; >+my $return_claims = C4::Context->preference('CleanUpDatabaseReturnClaims'); > my $pExpSelfReg; > my $pUnvSelfReg; > my $fees_days; >@@ -152,7 +151,6 @@ GetOptions( > 'list-invites:i' => \$pListShareInvites, > 'restrictions:i' => \$pDebarments, > 'all-restrictions' => \$allDebarments, >- 'return-claims:i' => \$return_claims, > 'del-exp-selfreg' => \$pExpSelfReg, > 'del-unv-selfreg' => \$pUnvSelfReg, > 'unique-holidays:i' => \$special_holidays_days, >-- >2.24.2 (Apple Git-127)
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 25429
:
104611
|
104612
|
104798
|
114601
|
114602
|
115042
|
115086
|
115087
|
115088
|
115089
|
115090
|
115907
|
115908
|
118880
|
118881
|
119219
|
120927
|
120928
|
120929
|
120930
|
125584
|
125585
|
125586
|
125587
|
125588