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 134-139 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
134
('ClaimReturnedChargeFee', 'ask', 'ask|charge|no_charge', 'Controls whether or not a lost item fee is charged for return claims', 'Choice'),
134
('ClaimReturnedChargeFee', 'ask', 'ask|charge|no_charge', 'Controls whether or not a lost item fee is charged for return claims', 'Choice'),
135
('ClaimReturnedLostValue', '', '', 'Sets the LOST AV value that represents "Claims returned" as a lost value', 'Free'),
135
('ClaimReturnedLostValue', '', '', 'Sets the LOST AV value that represents "Claims returned" as a lost value', 'Free'),
136
('ClaimReturnedWarningThreshold', '', '', 'Sets the number of return claims past which the librarian will be warned the patron has many return claims', 'Integer'),
136
('ClaimReturnedWarningThreshold', '', '', 'Sets the number of return claims past which the librarian will be warned the patron has many return claims', 'Integer'),
137
('CleanUpDatabaseReturnClaims', '', '', 'Sets the age of resolved return claims to delete from the database for cleanup_database.pl', 'Integer' ),
137
('CoceHost', '', NULL, 'Coce server URL', 'Free'),
138
('CoceHost', '', NULL, 'Coce server URL', 'Free'),
138
('CoceProviders', '', 'aws,gb,ol', 'Coce providers', 'multiple'),
139
('CoceProviders', '', 'aws,gb,ol', 'Coce providers', 'multiple'),
139
('COinSinOPACResults','1','','If ON, use COinS in OPAC search results page.  NOTE: this can slow down search response time significantly','YesNo'),
140
('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 1233-1235 Circulation: Link Here
1233
            - pref: ClaimReturnedWarningThreshold
1233
            - pref: ClaimReturnedWarningThreshold
1234
              class: integer
1234
              class: integer
1235
            - items.
1235
            - items.
1236
        -
1237
            - Remove resolved return claims older than
1238
            - pref: CleanUpDatabaseReturnClaims
1239
              class: integer
1240
            - days.
1241
            - <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