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

(-)a/misc/cronjobs/debar_patrons_with_fines.pl (-3 / +3 lines)
Lines 76-83 use Koha::Patron::Debarments; Link Here
76
76
77
use C4::Log qw( cronlogaction );
77
use C4::Log qw( cronlogaction );
78
78
79
my $command_line_options = join(" ",@ARGV);
79
my $command_line_options = join( " ", @ARGV );
80
cronlogaction({ info => $command_line_options });
80
cronlogaction( { info => $command_line_options } );
81
81
82
my ( $amount, $help, $confirm, $message, $expiration, $file, $verbose );
82
my ( $amount, $help, $confirm, $message, $expiration, $file, $verbose );
83
GetOptions(
83
GetOptions(
Lines 128-134 my $verb = $confirm ? 'Debarred' : 'Found'; Link Here
128
print "debar_patrons_with_fines: $verb $count_patrons patrons";
128
print "debar_patrons_with_fines: $verb $count_patrons patrons";
129
print( $errors ? ", had $errors failures\n" : "\n" );
129
print( $errors ? ", had $errors failures\n" : "\n" );
130
130
131
cronlogaction({ action => 'End', info => "COMPLETED" });
131
cronlogaction( { action => 'End', info => "COMPLETED" } );
132
132
133
sub getMessageContent {
133
sub getMessageContent {
134
    return $message if ($message);
134
    return $message if ($message);
(-)a/misc/cronjobs/restrict_patrons_with_failed_notices.pl (-2 / +2 lines)
Lines 28-35 use Koha::Patrons; Link Here
28
use C4::Letters;
28
use C4::Letters;
29
use Koha::Notice::Message;
29
use Koha::Notice::Message;
30
30
31
my $command_line_options = join(" ",@ARGV);
31
my $command_line_options = join( " ", @ARGV );
32
cronlogaction({ info => $command_line_options });
32
cronlogaction( { info => $command_line_options } );
33
33
34
# Getting options
34
# Getting options
35
my ( $help, $verbose, $confirm );
35
my ( $help, $verbose, $confirm );
(-)a/misc/cronjobs/update_patrons_category.pl (-16 / +15 lines)
Lines 18-26 Link Here
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use C4::Context;
20
use C4::Context;
21
use C4::Log qw(cronlogaction);
21
use C4::Log      qw(cronlogaction);
22
use Getopt::Long qw( GetOptions );
22
use Getopt::Long qw( GetOptions );
23
use Pod::Usage qw( pod2usage );
23
use Pod::Usage   qw( pod2usage );
24
use Koha::Logger;
24
use Koha::Logger;
25
use Koha::Patrons;
25
use Koha::Patrons;
26
use Koha::Patron::Categories;
26
use Koha::Patron::Categories;
Lines 170-177 my $branch_lim; Link Here
170
my %fields;
170
my %fields;
171
my @where;
171
my @where;
172
172
173
my $command_line_options = join(" ",@ARGV);
173
my $command_line_options = join( " ", @ARGV );
174
cronlogaction({ info => $command_line_options });
174
cronlogaction( { info => $command_line_options } );
175
175
176
GetOptions(
176
GetOptions(
177
    'help|?'          => \$help,
177
    'help|?'          => \$help,
Lines 229-242 my $cat_to = Koha::Patron::Categories->find($tocat); Link Here
229
die "Categories not found" unless $cat_from && $cat_to;
229
die "Categories not found" unless $cat_from && $cat_to;
230
230
231
$params{"me.categorycode"} = $fromcat;
231
$params{"me.categorycode"} = $fromcat;
232
$params{"me.branchcode"} = $branch_lim if $branch_lim;
232
$params{"me.branchcode"}   = $branch_lim if $branch_lim;
233
233
234
if ($verbose) {
234
if ($verbose) {
235
    print "Conditions:\n";
235
    print "Conditions:\n";
236
    print "    Registered before $reg_bef\n"      if $reg_bef;
236
    print "    Registered before $reg_bef\n"                           if $reg_bef;
237
    print "    Registered after  $reg_aft\n"      if $reg_aft;
237
    print "    Registered after  $reg_aft\n"                           if $reg_aft;
238
    print "    Total fines more than $fine_min\n" if $fine_min;
238
    print "    Total fines more than $fine_min\n"                      if $fine_min;
239
    print "    Total fines less than $fine_max\n" if $fine_max;
239
    print "    Total fines less than $fine_max\n"                      if $fine_max;
240
    print "    Age below minimum for " . $cat_from->description . "\n" if $ageunder;
240
    print "    Age below minimum for " . $cat_from->description . "\n" if $ageunder;
241
    print "    Age above maximum for " . $cat_from->description . "\n" if $ageover;
241
    print "    Age above maximum for " . $cat_from->description . "\n" if $ageover;
242
    if ( defined $branch_lim ) {
242
    if ( defined $branch_lim ) {
Lines 250-256 while ( my ( $key, $value ) = each %fields ) { Link Here
250
    $params{ "me." . $key } = $value;
250
    $params{ "me." . $key } = $value;
251
}
251
}
252
252
253
my $where_literal = join ' AND ', @where;
253
my $where_literal  = join ' AND ', @where;
254
my $target_patrons = Koha::Patrons->search( \%params );
254
my $target_patrons = Koha::Patrons->search( \%params );
255
$target_patrons = $target_patrons->search( \$where_literal ) if @where;
255
$target_patrons = $target_patrons->search( \$where_literal ) if @where;
256
$target_patrons = $target_patrons->search_patrons_to_update_category(
256
$target_patrons = $target_patrons->search_patrons_to_update_category(
Lines 271-281 if ($verbose) { Link Here
271
    while ( my $target_patron = $target_patrons->next() ) {
271
    while ( my $target_patron = $target_patrons->next() ) {
272
        $target_patron->discard_changes();
272
        $target_patron->discard_changes();
273
        $verbose
273
        $verbose
274
          and print $testdisplay
274
            and print $testdisplay
275
          . "Updated "
275
            . "Updated "
276
          . $target_patron->firstname() . " "
276
            . $target_patron->firstname() . " "
277
          . $target_patron->surname()
277
            . $target_patron->surname()
278
          . " from $fromcat to $tocat\n";
278
            . " from $fromcat to $tocat\n";
279
    }
279
    }
280
    $target_patrons->reset;
280
    $target_patrons->reset;
281
}
281
}
282
- 

Return to bug 38857