View | Details | Raw Unified | Return to bug 25429
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_25429.perl (+9 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do(q{
4
        INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
5
        ('CleanUpDatabaseReturnClaims', '', '', 'Sets the age of resolved return claims to delete from the database for cleanup_database.pl', 'Integer' );
6
    });
7
8
    NewVersion( $DBversion, 25429, "Cleanup Database - remove resolved claims returned from db after X days");
9
}
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 131-136 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
131
('ClaimReturnedChargeFee', 'ask', 'ask|charge|no_charge', 'Controls whether or not a lost item fee is charged for return claims', 'Choice'),
131
('ClaimReturnedChargeFee', 'ask', 'ask|charge|no_charge', 'Controls whether or not a lost item fee is charged for return claims', 'Choice'),
132
('ClaimReturnedLostValue', '', '', 'Sets the LOST AV value that represents "Claims returned" as a lost value', 'Free'),
132
('ClaimReturnedLostValue', '', '', 'Sets the LOST AV value that represents "Claims returned" as a lost value', 'Free'),
133
('ClaimReturnedWarningThreshold', '', '', 'Sets the number of return claims past which the librarian will be warned the patron has many return claims', 'Integer'),
133
('ClaimReturnedWarningThreshold', '', '', 'Sets the number of return claims past which the librarian will be warned the patron has many return claims', 'Integer'),
134
('CleanUpDatabaseReturnClaims', '', '', 'Sets the age of resolved return claims to delete from the database for cleanup_database.pl', 'Integer' ),
134
('CoceHost', '', NULL, 'Coce server URL', 'Free'),
135
('CoceHost', '', NULL, 'Coce server URL', 'Free'),
135
('CoceProviders', '', 'aws,gb,ol', 'Coce providers', 'multiple'),
136
('CoceProviders', '', 'aws,gb,ol', 'Coce providers', 'multiple'),
136
('COinSinOPACResults','1','','If ON, use COinS in OPAC search results page.  NOTE: this can slow down search response time significantly','YesNo'),
137
('COinSinOPACResults','1','','If ON, use COinS in OPAC search results page.  NOTE: this can slow down search response time significantly','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+6 lines)
Lines 1224-1226 Circulation: Link Here
1224
            - pref: ClaimReturnedWarningThreshold
1224
            - pref: ClaimReturnedWarningThreshold
1225
              class: integer
1225
              class: integer
1226
            - items.
1226
            - items.
1227
        -
1228
            - Remove resolved return claims older than
1229
            - pref: CleanUpDatabaseReturnClaims
1230
              class: integer
1231
            - days.
1232
            - <span class="hint">This system preference is used by the cleanup_database.pl cronjob.</span>
(-)a/misc/cronjobs/cleanup_database.pl (-2 / +14 lines)
Lines 88-94 Usage: $0 [-h|--help] [--confirm] [--sessions] [--sessdays DAYS] [-v|--verbose] Link Here
88
                         days.  Defaults to 14 days if no days specified.
88
                         days.  Defaults to 14 days if no days specified.
89
   --restrictions DAYS   purge patrons restrictions expired since more than DAYS days.
89
   --restrictions DAYS   purge patrons restrictions expired since more than DAYS days.
90
                         Defaults to 30 days if no days specified.
90
                         Defaults to 30 days if no days specified.
91
    --all-restrictions   purge all expired patrons restrictions.
91
   --all-restrictions   purge all expired patrons restrictions.
92
   --del-exp-selfreg  Delete expired self registration accounts
92
   --del-exp-selfreg  Delete expired self registration accounts
93
   --del-unv-selfreg  DAYS  Delete unverified self registrations older than DAYS
93
   --del-unv-selfreg  DAYS  Delete unverified self registrations older than DAYS
94
   --unique-holidays DAYS  Delete all unique holidays older than DAYS
94
   --unique-holidays DAYS  Delete all unique holidays older than DAYS
Lines 126-131 my $pZ3950; Link Here
126
my $pListShareInvites;
126
my $pListShareInvites;
127
my $pDebarments;
127
my $pDebarments;
128
my $allDebarments;
128
my $allDebarments;
129
my $return_claims = C4::Context->preference('CleanUpDatabaseReturnClaims');
129
my $pExpSelfReg;
130
my $pExpSelfReg;
130
my $pUnvSelfReg;
131
my $pUnvSelfReg;
131
my $fees_days;
132
my $fees_days;
Lines 505-510 if ($pStatistics) { Link Here
505
    }
506
    }
506
}
507
}
507
508
509
if ($return_claims) {
510
    print "Purging return claims older than $return_claims days.\n" if $verbose;
511
    $sth = $dbh->prepare(
512
        q{
513
            DELETE FROM return_claims
514
            WHERE resolved_on < DATE_SUB(CURDATE(), INTERVAL ? DAY)
515
        }
516
    );
517
    $sth->execute($return_claims);
518
    print "Done with purging return claims.\n" if $verbose;
519
}
520
508
if ($pDeletedCatalog) {
521
if ($pDeletedCatalog) {
509
    print "Purging deleted catalog older than $pDeletedCatalog days.\n"
522
    print "Purging deleted catalog older than $pDeletedCatalog days.\n"
510
      if $verbose;
523
      if $verbose;
511
- 

Return to bug 25429