Lines 202-208
sub anonymise_issue_history {
Link Here
|
202 |
|
202 |
|
203 |
=head3 delete |
203 |
=head3 delete |
204 |
|
204 |
|
205 |
Koha::Patrons->search({ some filters here })->delete({ move => 1, verbose => 1 }); |
205 |
Koha::Patrons->search({ some filters here })->delete({ move => 1 }); |
206 |
|
206 |
|
207 |
Delete passed set of patron objects. |
207 |
Delete passed set of patron objects. |
208 |
Wrapper for Koha::Patron->delete. (We do not want to bypass Koha::Patron |
208 |
Wrapper for Koha::Patron->delete. (We do not want to bypass Koha::Patron |
Lines 229-235
sub delete {
Link Here
|
229 |
|
229 |
|
230 |
$patrons_deleted++; |
230 |
$patrons_deleted++; |
231 |
} |
231 |
} |
232 |
warn "Deleted $count patrons\n" if $params->{verbose}; |
|
|
233 |
}, $self, $params ); |
232 |
}, $self, $params ); |
234 |
return $patrons_deleted; |
233 |
return $patrons_deleted; |
235 |
} |
234 |
} |
Lines 326-335
sub search_anonymized {
Link Here
|
326 |
|
325 |
|
327 |
=head3 lock |
326 |
=head3 lock |
328 |
|
327 |
|
329 |
Koha::Patrons->search({ some filters })->lock({ expire => 1, remove => 1, verbose => 1 }) |
328 |
Koha::Patrons->search({ some filters })->lock({ expire => 1, remove => 1 }) |
330 |
|
329 |
|
331 |
Lock the passed set of patron objects. Optionally expire and remove holds. |
330 |
Lock the passed set of patron objects. Optionally expire and remove holds. |
332 |
Optional verbose flag is used in cron job. |
|
|
333 |
Wrapper around Koha::Patron->lock. |
331 |
Wrapper around Koha::Patron->lock. |
334 |
|
332 |
|
335 |
=cut |
333 |
=cut |
Lines 340-369
sub lock {
Link Here
|
340 |
while( my $patron = $self->next ) { |
338 |
while( my $patron = $self->next ) { |
341 |
$patron->lock($params); |
339 |
$patron->lock($params); |
342 |
} |
340 |
} |
343 |
if( $params->{verbose} ) { |
|
|
344 |
warn "Locked $count patrons\n"; |
345 |
} |
346 |
} |
341 |
} |
347 |
|
342 |
|
348 |
=head3 anonymize |
343 |
=head3 anonymize |
349 |
|
344 |
|
350 |
Koha::Patrons->search({ some filters })->anonymize({ verbose => 1 }); |
345 |
Koha::Patrons->search({ some filters })->anonymize(); |
351 |
|
346 |
|
352 |
Anonymize passed set of patron objects. |
347 |
Anonymize passed set of patron objects. |
353 |
Optional verbose flag is used in cron job. |
|
|
354 |
Wrapper around Koha::Patron->anonymize. |
348 |
Wrapper around Koha::Patron->anonymize. |
355 |
|
349 |
|
356 |
=cut |
350 |
=cut |
357 |
|
351 |
|
358 |
sub anonymize { |
352 |
sub anonymize { |
359 |
my ( $self, $params ) = @_; |
353 |
my ( $self ) = @_; |
360 |
my $count = $self->count; |
354 |
my $count = $self->count; |
361 |
while( my $patron = $self->next ) { |
355 |
while( my $patron = $self->next ) { |
362 |
$patron->anonymize; |
356 |
$patron->anonymize; |
363 |
} |
357 |
} |
364 |
if( $params->{verbose} ) { |
|
|
365 |
warn "Anonymized $count patrons\n"; |
366 |
} |
367 |
} |
358 |
} |
368 |
|
359 |
|
369 |
=head3 search_patrons_to_update_category |
360 |
=head3 search_patrons_to_update_category |