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 139-144 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
139
('ClaimReturnedChargeFee', 'ask', 'ask|charge|no_charge', 'Controls whether or not a lost item fee is charged for return claims', 'Choice'),
139
('ClaimReturnedChargeFee', 'ask', 'ask|charge|no_charge', 'Controls whether or not a lost item fee is charged for return claims', 'Choice'),
140
('ClaimReturnedLostValue', '', '', 'Sets the LOST AV value that represents "Claims returned" as a lost value', 'Free'),
140
('ClaimReturnedLostValue', '', '', 'Sets the LOST AV value that represents "Claims returned" as a lost value', 'Free'),
141
('ClaimReturnedWarningThreshold', '', '', 'Sets the number of return claims past which the librarian will be warned the patron has many return claims', 'Integer'),
141
('ClaimReturnedWarningThreshold', '', '', 'Sets the number of return claims past which the librarian will be warned the patron has many return claims', 'Integer'),
142
('CleanUpDatabaseReturnClaims', '', '', 'Sets the age of resolved return claims to delete from the database for cleanup_database.pl', 'Integer' ),
142
('CoceHost', '', NULL, 'Coce server URL', 'Free'),
143
('CoceHost', '', NULL, 'Coce server URL', 'Free'),
143
('CoceProviders', '', 'aws,gb,ol', 'Coce providers', 'multiple'),
144
('CoceProviders', '', 'aws,gb,ol', 'Coce providers', 'multiple'),
144
('COinSinOPACResults','1','','If ON, use COinS in OPAC search results page.  NOTE: this can slow down search response time significantly','YesNo'),
145
('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 1265-1267 Circulation: Link Here
1265
            - pref: ClaimReturnedWarningThreshold
1265
            - pref: ClaimReturnedWarningThreshold
1266
              class: integer
1266
              class: integer
1267
            - items.
1267
            - items.
1268
        -
1269
            - Remove resolved return claims older than
1270
            - pref: CleanUpDatabaseReturnClaims
1271
              class: integer
1272
            - days.
1273
            - <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 129-134 my $pZ3950; Link Here
129
my $pListShareInvites;
129
my $pListShareInvites;
130
my $pDebarments;
130
my $pDebarments;
131
my $allDebarments;
131
my $allDebarments;
132
my $return_claims = C4::Context->preference('CleanUpDatabaseReturnClaims');
132
my $pExpSelfReg;
133
my $pExpSelfReg;
133
my $pUnvSelfReg;
134
my $pUnvSelfReg;
134
my $fees_days;
135
my $fees_days;
Lines 526-531 if ($pStatistics) { Link Here
526
    }
527
    }
527
}
528
}
528
529
530
if ($return_claims) {
531
    print "Purging return claims older than $return_claims days.\n" if $verbose;
532
    $sth = $dbh->prepare(
533
        q{
534
            DELETE FROM return_claims
535
            WHERE resolved_on < DATE_SUB(CURDATE(), INTERVAL ? DAY)
536
        }
537
    );
538
    $sth->execute($return_claims);
539
    print "Done with purging return claims.\n" if $verbose;
540
}
541
529
if ($pDeletedCatalog) {
542
if ($pDeletedCatalog) {
530
    print "Purging deleted catalog older than $pDeletedCatalog days.\n"
543
    print "Purging deleted catalog older than $pDeletedCatalog days.\n"
531
      if $verbose;
544
      if $verbose;
532
- 

Return to bug 25429