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

(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 345-350 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
345
('previousIssuesDefaultSortOrder','asc','asc|desc','Specify the sort order of Previous Issues on the circulation page','Choice'),
345
('previousIssuesDefaultSortOrder','asc','asc|desc','Specify the sort order of Previous Issues on the circulation page','Choice'),
346
('printcirculationslips','1','','If ON, enable printing circulation receipts','YesNo'),
346
('printcirculationslips','1','','If ON, enable printing circulation receipts','YesNo'),
347
('PrintNoticesMaxLines','0','','If greater than 0, sets the maximum number of lines an overdue notice will print. If the number of items is greater than this number, the notice will end with a warning asking the borrower to check their online account for a full list of overdue items.','Integer'),
347
('PrintNoticesMaxLines','0','','If greater than 0, sets the maximum number of lines an overdue notice will print. If the number of items is greater than this number, the notice will end with a warning asking the borrower to check their online account for a full list of overdue items.','Integer'),
348
('PurgeSuggestionsOlderThan', '', NULL, 'If this script is called without the days parameter', 'Integer'),
348
('QueryAutoTruncate','1',NULL,'If ON, query truncation is enabled by default','YesNo'),
349
('QueryAutoTruncate','1',NULL,'If ON, query truncation is enabled by default','YesNo'),
349
('QueryFuzzy','1',NULL,'If ON, enables fuzzy option for searches','YesNo'),
350
('QueryFuzzy','1',NULL,'If ON, enables fuzzy option for searches','YesNo'),
350
('QueryStemming','1',NULL,'If ON, enables query stemming','YesNo'),
351
('QueryStemming','1',NULL,'If ON, enables query stemming','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+9 lines)
Lines 561-566 OPAC: Link Here
561
                no: "Don't block"
561
                no: "Don't block"
562
            - 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.
562
            - 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.
563
563
564
        -
565
            - Keep accepted or rejected purchase suggestions for a period of [   ] days.
566
            - pref: PurgeSuggestionsOlderThan
567
              class: integer
568
            - days.
569
            - <br>WARNING - Leave this field empty if you don't want to activate this automatic feature.
570
            - "<br>Example: [30] Sets purgation of suggestions for those older than 30 days."
571
            - <br>(Used when the cronjob purge_suggestions.pl is active and called without a specific number of days)
572
564
    Privacy:
573
    Privacy:
565
        -
574
        -
566
            - pref: AnonSuggestions
575
            - pref: AnonSuggestions
(-)a/misc/cronjobs/purge_suggestions.pl (-13 / +32 lines)
Lines 33-38 use Getopt::Long; Link Here
33
use Pod::Usage;
33
use Pod::Usage;
34
use C4::Suggestions;
34
use C4::Suggestions;
35
use C4::Log;
35
use C4::Log;
36
use C4::Context;
36
37
37
my ($help, $days);
38
my ($help, $days);
38
39
Lines 41-62 GetOptions( Link Here
41
    'days=s'         => \$days,
42
    'days=s'         => \$days,
42
);
43
);
43
44
44
if($help or not $days){
45
my $usage = << 'ENDUSAGE';
45
    print <<EOF
46
This script delete old suggestions
46
    This script delete olds suggestions
47
Parameters:
47
    Parameters :
48
-help|? This message
48
    -help|? This message
49
-days TTT to define the age of suggestions to delete
49
    -days TTT to define the age of suggestions to delete
50
50
51
Example:
51
     example :
52
$PERL5LIB/misc/cronjobs/purge_suggestions.pl -days 30
52
     export PERL5LIB=/path/to/koha;export KOHA_CONF=/etc/koha/koha-conf.xml;./purge_suggestions.pl -days 30
53
ENDUSAGE
53
EOF
54
54
;
55
# If this script is called without the 'days' parameter, we use the system preferences value instead.
56
if ( ! defined($days) and not $help) {
57
    my $purge_sugg_days = C4::Context->preference('PurgeSuggestionsOlderThan') || '';
58
    if($purge_sugg_days ne '' and $purge_sugg_days >= 0) {
59
        $days = $purge_sugg_days;
60
    }
61
}
62
# If this script is called with the 'help' parameter, we show up the help message and we leave the script without doing anything.
63
if ($help) {
64
    print $usage;
55
    exit;
65
    exit;
56
}
66
}
57
67
58
if($days){
68
if(defined($days) && $days > 0 && $days ne ''){
59
    cronlogaction();
69
    cronlogaction();
60
    DelSuggestionsOlderThan($days);
70
    DelSuggestionsOlderThan($days);
61
}
71
}
62
72
63
- 
73
elsif(defined($days) && $days == 0) {
74
    print << 'ERROR';
75
    This script is not executed with 0 days. Aborted.
76
ERROR
77
}
78
else {
79
    print << 'ERROR';
80
    This script requires a positive number of days. Aborted.
81
ERROR
82
}

Return to bug 13287