Lines 25-32
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::Old::Checkouts; |
28 |
use Koha::Old::Holds; |
29 |
use Koha::Old::Holds; |
29 |
use Koha::Patrons; |
|
|
30 |
|
30 |
|
31 |
use Date::Calc qw( Add_Delta_Days Today ); |
31 |
use Date::Calc qw( Add_Delta_Days Today ); |
32 |
use Getopt::Long qw( GetOptions ); |
32 |
use Getopt::Long qw( GetOptions ); |
Lines 67-73
my ($newyear,$newmonth,$newday) = Add_Delta_Days ($year,$month,$day,(-1)*$days);
Link Here
|
67 |
my $formatdate = sprintf "%4d-%02d-%02d",$newyear,$newmonth,$newday; |
67 |
my $formatdate = sprintf "%4d-%02d-%02d",$newyear,$newmonth,$newday; |
68 |
$verbose and print "Checkouts and holds before $formatdate will be anonymised.\n"; |
68 |
$verbose and print "Checkouts and holds before $formatdate will be anonymised.\n"; |
69 |
|
69 |
|
70 |
my $rows = Koha::Patrons->search_patrons_to_anonymise( { before => $formatdate } )->anonymise_issue_history( { before => $formatdate } ); |
70 |
my $rows = Koha::Old::Checkouts |
|
|
71 |
->filter_by_anonymizable |
72 |
->filter_by_last_update( { days => $days } ) |
73 |
->anonymize; |
74 |
|
71 |
$verbose and print int($rows) . " checkouts anonymised.\n"; |
75 |
$verbose and print int($rows) . " checkouts anonymised.\n"; |
72 |
|
76 |
|
73 |
$rows = Koha::Old::Holds |
77 |
$rows = Koha::Old::Holds |
74 |
- |
|
|