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

(-)a/misc/cronjobs/batch_anonymise.pl (-6 / +5 lines)
Lines 25-34 use C4::Context; Link Here
25
use C4::Log qw( cronlogaction );
25
use C4::Log qw( cronlogaction );
26
26
27
use Koha::Database;
27
use Koha::Database;
28
use Koha::DateUtils qw(dt_from_string output_pref);
28
use Koha::Old::Checkouts;
29
use Koha::Old::Checkouts;
29
use Koha::Old::Holds;
30
use Koha::Old::Holds;
30
31
31
use Date::Calc qw( Add_Delta_Days Today );
32
use Getopt::Long qw( GetOptions );
32
use Getopt::Long qw( GetOptions );
33
33
34
sub usage {
34
sub usage {
Lines 62-71 if ( !$days ) { Link Here
62
62
63
cronlogaction();
63
cronlogaction();
64
64
65
my ($year,$month,$day) = Today();
65
my $date = dt_from_string->subtract( days => $days );
66
my ($newyear,$newmonth,$newday) = Add_Delta_Days ($year,$month,$day,(-1)*$days);
66
67
my $formatdate = sprintf "%4d-%02d-%02d",$newyear,$newmonth,$newday;
67
print "Checkouts and holds before " . output_pref( { dt => $date, dateformat => 'iso', dateonly => 1 } ) . " will be anonymised.\n"
68
$verbose and print "Checkouts and holds before $formatdate will be anonymised.\n";
68
  if $verbose;
69
69
70
my $rows = Koha::Old::Checkouts
70
my $rows = Koha::Old::Checkouts
71
          ->filter_by_anonymizable
71
          ->filter_by_anonymizable
72
- 

Return to bug 30042