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

(-)a/installer/data/mysql/atomicupdate/bug_26831-add_PurgeUnacceptedListShareInvitesOlderThan-syspref.perl (+6 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do(q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('PurgeUnacceptedListShareInvitesOlderThan', '14', NULL, 'If not empty, number of days used when deleting unaccepted list share invites', 'Integer') });
4
5
    NewVersion( $DBversion, 26831, "Replace 'list-invites' parameter with system preference in cleanup_database.pl cronjob");
6
}
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 528-533 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
528
('PseudonymizationPatronFields','','title,city,state,zipcode,country,branchcode,categorycode,dateenrolled,sex,sort1,sort2','Patron fields to copy to the pseudonymized_transactions table','multiple'),
528
('PseudonymizationPatronFields','','title,city,state,zipcode,country,branchcode,categorycode,dateenrolled,sex,sort1,sort2','Patron fields to copy to the pseudonymized_transactions table','multiple'),
529
('PseudonymizationTransactionFields','','datetime,branchcode,transaction_type,itemnumber,itemtype,holdingbranch,location,itemcallnumber,ccode','Transaction fields to copy to the pseudonymized_transactions table','multiple'),
529
('PseudonymizationTransactionFields','','datetime,branchcode,transaction_type,itemnumber,itemtype,holdingbranch,location,itemcallnumber,ccode','Transaction fields to copy to the pseudonymized_transactions table','multiple'),
530
('PurgeSuggestionsOlderThan', '', NULL, 'If this script is called without the days parameter', 'Integer'),
530
('PurgeSuggestionsOlderThan', '', NULL, 'If this script is called without the days parameter', 'Integer'),
531
('PurgeUnacceptedListShareInvitesOlderThan', '14', NULL, 'If not empty, number of days used when deleting unaccepted list share invites', 'Integer'),
531
('QueryAutoTruncate','1',NULL,'If ON, query truncation is enabled by default','YesNo'),
532
('QueryAutoTruncate','1',NULL,'If ON, query truncation is enabled by default','YesNo'),
532
('QueryFuzzy','1',NULL,'If ON, enables fuzzy option for searches','YesNo'),
533
('QueryFuzzy','1',NULL,'If ON, enables fuzzy option for searches','YesNo'),
533
('QueryRegexEscapeOptions', 'escape', 'dont_escape|escape|unescape_escaped', 'Escape option for regexps delimiters in Elasicsearch queries.', 'Choice'),
534
('QueryRegexEscapeOptions', 'escape', 'dont_escape|escape|unescape_escaped', 'Escape option for regexps delimiters in Elasicsearch queries.', 'Choice'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+6 lines)
Lines 672-677 OPAC: Link Here
672
                no: "Don't block"
672
                no: "Don't block"
673
            - expired patrons from OPAC actions such as placing a hold or renewing. Note that the setting for a patron category takes priority over this system preference.
673
            - expired patrons from OPAC actions such as placing a hold or renewing. Note that the setting for a patron category takes priority over this system preference.
674
        -
674
        -
675
            - The cleanup_database.pl cronjob will automatically delete unaccepted private list share invites after a period of
676
            - pref: PurgeUnacceptedListShareInvitesOlderThan
677
              class: integer
678
            - "days. Example: [14] Sets purgation of unaccepted private list share invites for those older than 14 days."
679
            - "<br><strong>Note:</strong> If you leave this field empty then, the cronjob will not delete any unaccepted private list share invites."
680
        -
675
            - Limit patrons to
681
            - Limit patrons to
676
            - pref: MaxOpenSuggestions
682
            - pref: MaxOpenSuggestions
677
              class: integer
683
              class: integer
(-)a/misc/cronjobs/cleanup_database.pl (-5 / +9 lines)
Lines 24-30 use constant DEFAULT_MAIL_PURGEDAYS => 30; Link Here
24
use constant DEFAULT_IMPORT_PURGEDAYS             => 60;
24
use constant DEFAULT_IMPORT_PURGEDAYS             => 60;
25
use constant DEFAULT_LOGS_PURGEDAYS               => 180;
25
use constant DEFAULT_LOGS_PURGEDAYS               => 180;
26
use constant DEFAULT_SEARCHHISTORY_PURGEDAYS      => 30;
26
use constant DEFAULT_SEARCHHISTORY_PURGEDAYS      => 30;
27
use constant DEFAULT_SHARE_INVITATION_EXPIRY_DAYS => 14;
28
use constant DEFAULT_DEBARMENTS_PURGEDAYS         => 30;
27
use constant DEFAULT_DEBARMENTS_PURGEDAYS         => 30;
29
28
30
BEGIN {
29
BEGIN {
Lines 81-87 Usage: $0 [-h|--help] [--confirm] [--sessions] [--sessdays DAYS] [-v|--verbose] Link Here
81
   --searchhistory DAYS  purge entries from search_history older than DAYS days.
80
   --searchhistory DAYS  purge entries from search_history older than DAYS days.
82
                         Defaults to 30 days if no days specified
81
                         Defaults to 30 days if no days specified
83
   --list-invites  DAYS  purge (unaccepted) list share invites older than DAYS
82
   --list-invites  DAYS  purge (unaccepted) list share invites older than DAYS
84
                         days.  Defaults to 14 days if no days specified.
83
                         days.
84
                         If this parameter is not defined, then the cron job falls back to the
85
                         value of system preference PurgeUnacceptedListShareInvitesOlderThan.
86
                         If neither the parameter, nor the system preference are defined then no
87
                         unaccepted list share invite will be purged.
85
   --restrictions DAYS   purge patrons restrictions expired since more than DAYS days.
88
   --restrictions DAYS   purge patrons restrictions expired since more than DAYS days.
86
                         Defaults to 30 days if no days specified.
89
                         Defaults to 30 days if no days specified.
87
    --all-restrictions   purge all expired patrons restrictions.
90
    --all-restrictions   purge all expired patrons restrictions.
Lines 180-186 $pLogs = DEFAULT_LOGS_PURGEDAYS if defined($pLogs) Link Here
180
$zebraqueue_days   = DEFAULT_ZEBRAQ_PURGEDAYS             if defined($zebraqueue_days)   && $zebraqueue_days == 0;
183
$zebraqueue_days   = DEFAULT_ZEBRAQ_PURGEDAYS             if defined($zebraqueue_days)   && $zebraqueue_days == 0;
181
$mail              = DEFAULT_MAIL_PURGEDAYS               if defined($mail)              && $mail == 0;
184
$mail              = DEFAULT_MAIL_PURGEDAYS               if defined($mail)              && $mail == 0;
182
$pSearchhistory    = DEFAULT_SEARCHHISTORY_PURGEDAYS      if defined($pSearchhistory)    && $pSearchhistory == 0;
185
$pSearchhistory    = DEFAULT_SEARCHHISTORY_PURGEDAYS      if defined($pSearchhistory)    && $pSearchhistory == 0;
183
$pListShareInvites = DEFAULT_SHARE_INVITATION_EXPIRY_DAYS if defined($pListShareInvites) && $pListShareInvites == 0;
186
$pListShareInvites = C4::Context->preference('PurgeUnacceptedListShareInvitesOlderThan') if !defined($pListShareInvites); #If no --list-invites parameter has been used when calling this script fall back to using the PurgeUnacceptedListShareInvitesOlderThan system preference value.
184
$pDebarments       = DEFAULT_DEBARMENTS_PURGEDAYS         if defined($pDebarments)       && $pDebarments == 0;
187
$pDebarments       = DEFAULT_DEBARMENTS_PURGEDAYS         if defined($pDebarments)       && $pDebarments == 0;
185
188
186
if ($help) {
189
if ($help) {
Lines 346-352 if ($pSearchhistory) { Link Here
346
    print "Done with purging search_history.\n" if $verbose;
349
    print "Done with purging search_history.\n" if $verbose;
347
}
350
}
348
351
349
if ($pListShareInvites) {
352
if ($pListShareInvites && $pListShareInvites > 0) {
350
    print "Purging unaccepted list share invites older than $pListShareInvites days.\n" if $verbose;
353
    print "Purging unaccepted list share invites older than $pListShareInvites days.\n" if $verbose;
351
    $sth = $dbh->prepare(
354
    $sth = $dbh->prepare(
352
        q{
355
        q{
Lines 359-364 if ($pListShareInvites) { Link Here
359
        $sth->execute($pListShareInvites);
362
        $sth->execute($pListShareInvites);
360
    }
363
    }
361
    print "Done with purging unaccepted list share invites.\n" if $verbose;
364
    print "Done with purging unaccepted list share invites.\n" if $verbose;
365
} elsif ($pListShareInvites <= 0) {
366
    print "This script requires a positive number of days at which to purge unaccepted list share invites. Aborted.\n";
362
}
367
}
363
368
364
if ($pDebarments) {
369
if ($pDebarments) {
365
- 

Return to bug 26831