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 136-141 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
136
('ClaimReturnedChargeFee', 'ask', 'ask|charge|no_charge', 'Controls whether or not a lost item fee is charged for return claims', 'Choice'),
136
('ClaimReturnedChargeFee', 'ask', 'ask|charge|no_charge', 'Controls whether or not a lost item fee is charged for return claims', 'Choice'),
137
('ClaimReturnedLostValue', '', '', 'Sets the LOST AV value that represents "Claims returned" as a lost value', 'Free'),
137
('ClaimReturnedLostValue', '', '', 'Sets the LOST AV value that represents "Claims returned" as a lost value', 'Free'),
138
('ClaimReturnedWarningThreshold', '', '', 'Sets the number of return claims past which the librarian will be warned the patron has many return claims', 'Integer'),
138
('ClaimReturnedWarningThreshold', '', '', 'Sets the number of return claims past which the librarian will be warned the patron has many return claims', 'Integer'),
139
('CleanUpDatabaseReturnClaims', '', '', 'Sets the age of resolved return claims to delete from the database for cleanup_database.pl', 'Integer' ),
139
('CoceHost', '', NULL, 'Coce server URL', 'Free'),
140
('CoceHost', '', NULL, 'Coce server URL', 'Free'),
140
('CoceProviders', '', 'aws,gb,ol', 'Coce providers', 'multiple'),
141
('CoceProviders', '', 'aws,gb,ol', 'Coce providers', 'multiple'),
141
('COinSinOPACResults','1','','If ON, use COinS in OPAC search results page.  NOTE: this can slow down search response time significantly','YesNo'),
142
('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 1253-1255 Circulation: Link Here
1253
            - pref: ClaimReturnedWarningThreshold
1253
            - pref: ClaimReturnedWarningThreshold
1254
              class: integer
1254
              class: integer
1255
            - items.
1255
            - items.
1256
        -
1257
            - Remove resolved return claims older than
1258
            - pref: CleanUpDatabaseReturnClaims
1259
              class: integer
1260
            - days.
1261
            - <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 528-533 if ($pStatistics) { Link Here
528
    }
529
    }
529
}
530
}
530
531
532
if ($return_claims) {
533
    print "Purging return claims older than $return_claims days.\n" if $verbose;
534
    $sth = $dbh->prepare(
535
        q{
536
            DELETE FROM return_claims
537
            WHERE resolved_on < DATE_SUB(CURDATE(), INTERVAL ? DAY)
538
        }
539
    );
540
    $sth->execute($return_claims);
541
    print "Done with purging return claims.\n" if $verbose;
542
}
543
531
if ($pDeletedCatalog) {
544
if ($pDeletedCatalog) {
532
    print "Purging deleted catalog older than $pDeletedCatalog days.\n"
545
    print "Purging deleted catalog older than $pDeletedCatalog days.\n"
533
      if $verbose;
546
      if $verbose;
534
- 

Return to bug 25429