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

(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 440-445 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
440
('printcirculationslips','1','','If ON, enable printing circulation receipts','YesNo'),
440
('printcirculationslips','1','','If ON, enable printing circulation receipts','YesNo'),
441
('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'),
441
('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'),
442
('ProcessingFeeNote', '', NULL, 'Set the text to be recorded in the column note, table accountlines when the processing fee (defined in item type) is applied', 'textarea'),
442
('ProcessingFeeNote', '', NULL, 'Set the text to be recorded in the column note, table accountlines when the processing fee (defined in item type) is applied', 'textarea'),
443
('PurgeSuggestionsOlderThan', '', NULL, 'If this script is called without the days parameter', 'Integer'),
443
('QueryAutoTruncate','1',NULL,'If ON, query truncation is enabled by default','YesNo'),
444
('QueryAutoTruncate','1',NULL,'If ON, query truncation is enabled by default','YesNo'),
444
('QueryFuzzy','1',NULL,'If ON, enables fuzzy option for searches','YesNo'),
445
('QueryFuzzy','1',NULL,'If ON, enables fuzzy option for searches','YesNo'),
445
('QueryStemming','1',NULL,'If ON, enables query stemming','YesNo'),
446
('QueryStemming','1',NULL,'If ON, enables query stemming','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+8 lines)
Lines 614-619 OPAC: Link Here
614
            - pref: MaxOpenSuggestions
614
            - pref: MaxOpenSuggestions
615
              class: integer
615
              class: integer
616
            - "open suggestions. Leave empty for no limit. **Note: this setting does not affect anonymous suggestions"
616
            - "open suggestions. Leave empty for no limit. **Note: this setting does not affect anonymous suggestions"
617
        -
618
            - Keep accepted or rejected purchase suggestions for a period of [   ] days.
619
            - pref: PurgeSuggestionsOlderThan
620
              class: integer
621
            - days.
622
            - <br>WARNING - Leave this field empty if you don't want to activate this automatic feature.
623
            - "<br>Example: [30] Sets purgation of suggestions for those older than 30 days."
624
            - <br>(Used when the cronjob purge_suggestions.pl is active and called without a specific number of days)
617
    Privacy:
625
    Privacy:
618
        -
626
        -
619
            - pref: StoreLastBorrower
627
            - pref: StoreLastBorrower
(-)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