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

(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 388-393 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
388
('previousIssuesDefaultSortOrder','asc','asc|desc','Specify the sort order of Previous Issues on the circulation page','Choice'),
388
('previousIssuesDefaultSortOrder','asc','asc|desc','Specify the sort order of Previous Issues on the circulation page','Choice'),
389
('printcirculationslips','1','','If ON, enable printing circulation receipts','YesNo'),
389
('printcirculationslips','1','','If ON, enable printing circulation receipts','YesNo'),
390
('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'),
390
('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'),
391
('PurgeSuggestionsOlderThan', '', NULL, 'If this script is called without the days parameter', 'Integer'),
391
('QueryAutoTruncate','1',NULL,'If ON, query truncation is enabled by default','YesNo'),
392
('QueryAutoTruncate','1',NULL,'If ON, query truncation is enabled by default','YesNo'),
392
('QueryFuzzy','1',NULL,'If ON, enables fuzzy option for searches','YesNo'),
393
('QueryFuzzy','1',NULL,'If ON, enables fuzzy option for searches','YesNo'),
393
('QueryStemming','1',NULL,'If ON, enables query stemming','YesNo'),
394
('QueryStemming','1',NULL,'If ON, enables query stemming','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+9 lines)
Lines 568-573 OPAC: Link Here
568
                no: "Don't block"
568
                no: "Don't block"
569
            - 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.
569
            - 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.
570
570
571
        -
572
            - Keep accepted or rejected purchase suggestions for a period of [   ] days.
573
            - pref: PurgeSuggestionsOlderThan
574
              class: integer
575
            - days.
576
            - <br>WARNING - Leave this field empty if you don't want to activate this automatic feature.
577
            - "<br>Example: [30] Sets purgation of suggestions for those older than 30 days."
578
            - <br>(Used when the cronjob purge_suggestions.pl is active and called without a specific number of days)
579
571
    Privacy:
580
    Privacy:
572
        -
581
        -
573
            - pref: StoreLastBorrower
582
            - 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