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

(-)a/koha-tmpl/intranet-tmpl/prog/js/datatables.js (+1 lines)
Lines 545-550 jQuery.fn.dataTable.ext.errMode = function(settings, note, message) { Link Here
545
                            'beforeSend': function(xhr, settings) {
545
                            'beforeSend': function(xhr, settings) {
546
                                this._xhr = xhr;
546
                                this._xhr = xhr;
547
                                if(options.embed) {
547
                                if(options.embed) {
548
                                    console.log(Array.isArray(options.embed));
548
                                    xhr.setRequestHeader('x-koha-embed', Array.isArray(options.embed)?options.embed.join(','):options.embed);
549
                                    xhr.setRequestHeader('x-koha-embed', Array.isArray(options.embed)?options.embed.join(','):options.embed);
549
                                }
550
                                }
550
                                if(options.header_filter && options.query_parameters) {
551
                                if(options.header_filter && options.query_parameters) {
(-)a/misc/cronjobs/automatic_checkin.pl (-2 / +6 lines)
Lines 22-27 use Koha::Checkouts; Link Here
22
use Koha::Script -cron;
22
use Koha::Script -cron;
23
use C4::Log qw( cronlogaction );
23
use C4::Log qw( cronlogaction );
24
24
25
cronlogaction();
25
my $command_line_options = join(" ",@ARGV);
26
cronlogaction({ info => $command_line_options });
27
28
Koha::Checkouts->automatic_checkin;
29
30
cronlogaction({ action => 'End', info => "COMPLETED" });
26
31
27
Koha::Checkouts->automatic_checkin;
(-)a/misc/cronjobs/automatic_item_modification_by_age.pl (-1 / +5 lines)
Lines 11-16 use C4::Context; Link Here
11
use C4::Items;
11
use C4::Items;
12
use C4::Log qw( cronlogaction );
12
use C4::Log qw( cronlogaction );
13
13
14
my $command_line_options = join(" ",@ARGV);
15
14
# Getting options
16
# Getting options
15
my ( $verbose, $help, $confirm );
17
my ( $verbose, $help, $confirm );
16
my $result = GetOptions(
18
my $result = GetOptions(
Lines 28-34 my $rules = eval { JSON::from_json( $syspref_content ) }; Link Here
28
pod2usage({ -message => "Unable to load the configuration : $@", -exitval => 1 })
30
pod2usage({ -message => "Unable to load the configuration : $@", -exitval => 1 })
29
    if $@;
31
    if $@;
30
32
31
cronlogaction();
33
cronlogaction({ info => $command_line_options });
32
34
33
my $report = C4::Items::ToggleNewStatus( { rules => $rules, report_only => not $confirm } );
35
my $report = C4::Items::ToggleNewStatus( { rules => $rules, report_only => not $confirm } );
34
36
Lines 49-54 if ( $verbose ) { Link Here
49
    }
51
    }
50
}
52
}
51
53
54
cronlogaction({ action => 'End', info => "COMPLETED" });
55
52
exit(0);
56
exit(0);
53
57
54
__END__
58
__END__
(-)a/misc/cronjobs/automatic_renewals.pl (-1 / +5 lines)
Lines 87-92 use Koha::Checkouts; Link Here
87
use Koha::Libraries;
87
use Koha::Libraries;
88
use Koha::Patrons;
88
use Koha::Patrons;
89
89
90
my $command_line_options = join(" ",@ARGV);
91
90
my ( $help, $send_notices, $verbose, $confirm, $digest_per_branch );
92
my ( $help, $send_notices, $verbose, $confirm, $digest_per_branch );
91
GetOptions(
93
GetOptions(
92
    'h|help' => \$help,
94
    'h|help' => \$help,
Lines 127-133 To change this, edit the "EnhancedMessagingPreferences" syspref. Link Here
127
END_WARN
129
END_WARN
128
}
130
}
129
131
130
cronlogaction();
132
cronlogaction({ info => $command_line_options });
131
133
132
$verbose = 1 unless $verbose or $confirm;
134
$verbose = 1 unless $verbose or $confirm;
133
print "Test run only\n" unless $confirm;
135
print "Test run only\n" unless $confirm;
Lines 285-290 if ( $send_notices && $confirm ) { Link Here
285
    }
287
    }
286
}
288
}
287
289
290
cronlogaction({ action => 'End', info => "COMPLETED" });
291
288
=head1 METHODS
292
=head1 METHODS
289
293
290
=head2 send_digests
294
=head2 send_digests
(-)a/misc/cronjobs/batch_anonymise.pl (-1 / +5 lines)
Lines 43-48 USAGE Link Here
43
    exit $_[0];
43
    exit $_[0];
44
}
44
}
45
45
46
my $command_line_options = join(" ",@ARGV);
47
46
my ( $help, $days, $verbose );
48
my ( $help, $days, $verbose );
47
49
48
GetOptions(
50
GetOptions(
Lines 60-66 if ( !$days ) { Link Here
60
    usage(1);
62
    usage(1);
61
}
63
}
62
64
63
cronlogaction();
65
cronlogaction({ info => $command_line_options });
64
66
65
my $date = dt_from_string->subtract( days => $days );
67
my $date = dt_from_string->subtract( days => $days );
66
68
Lines 81-84 $rows = Koha::Old::Holds Link Here
81
83
82
$verbose and print int($rows) . " holds anonymised.\n";
84
$verbose and print int($rows) . " holds anonymised.\n";
83
85
86
cronlogaction({ action => 'End', info => "COMPLETED" });
87
84
exit(0);
88
exit(0);
(-)a/misc/cronjobs/build_browser_and_cloud.pl (-1 / +4 lines)
Lines 15-20 use Getopt::Long; Link Here
15
use C4::Log;
15
use C4::Log;
16
use Koha::Biblios;
16
use Koha::Biblios;
17
17
18
my $command_line_options = join(" ",@ARGV);
19
18
my ( $input_marc_file, $number) = ('',0);
20
my ( $input_marc_file, $number) = ('',0);
19
my ($version, $confirm,$field,$batch,$max_digits,$cloud_tag);
21
my ($version, $confirm,$field,$batch,$max_digits,$cloud_tag);
20
GetOptions(
22
GetOptions(
Lines 57-63 my $browser_subfield = $2; Link Here
57
warn "browser : $browser_tag / $browser_subfield" unless $batch;
59
warn "browser : $browser_tag / $browser_subfield" unless $batch;
58
die "no cloud or browser field/subfield defined : nothing to do !" unless $browser_tag or $cloud_tag;
60
die "no cloud or browser field/subfield defined : nothing to do !" unless $browser_tag or $cloud_tag;
59
61
60
cronlogaction();
62
cronlogaction({ info => $command_line_options });
61
63
62
my $dbh = C4::Context->dbh;
64
my $dbh = C4::Context->dbh;
63
65
Lines 165-170 if ($cloud_tag) { Link Here
165
my $timeneeded = time() - $starttime;
167
my $timeneeded = time() - $starttime;
166
print "$i records done in $timeneeded seconds\n" unless $batch;
168
print "$i records done in $timeneeded seconds\n" unless $batch;
167
169
170
cronlogaction({ action => 'End', info => "COMPLETED" });
168
171
169
sub dewey_french {
172
sub dewey_french {
170
return {
173
return {
(-)a/misc/cronjobs/cart_to_shelf.pl (-1 / +5 lines)
Lines 37-42 use Getopt::Long qw( GetOptions ); Link Here
37
37
38
my $hours = 0;
38
my $hours = 0;
39
39
40
my $command_line_options = join(" ",@ARGV);
41
40
GetOptions( 'h|hours=s' => \$hours, );
42
GetOptions( 'h|hours=s' => \$hours, );
41
43
42
my $usage = << 'ENDUSAGE';
44
my $usage = << 'ENDUSAGE';
Lines 58-64 unless ($hours) { Link Here
58
    die "ERROR: No --hours (-h) option defined";
60
    die "ERROR: No --hours (-h) option defined";
59
}
61
}
60
62
61
cronlogaction();
63
cronlogaction({ info => $command_line_options });
62
64
63
my $query = "SELECT itemnumber FROM items WHERE location = 'CART' AND TIMESTAMPDIFF(HOUR, items.timestamp, NOW() ) > ?";
65
my $query = "SELECT itemnumber FROM items WHERE location = 'CART' AND TIMESTAMPDIFF(HOUR, items.timestamp, NOW() ) > ?";
64
my $sth = C4::Context->dbh->prepare($query);
66
my $sth = C4::Context->dbh->prepare($query);
Lines 66-68 $sth->execute($hours); Link Here
66
while (my ($itemnumber) = $sth->fetchrow_array) {
68
while (my ($itemnumber) = $sth->fetchrow_array) {
67
    CartToShelf($itemnumber);
69
    CartToShelf($itemnumber);
68
}
70
}
71
72
cronlogaction({ action => 'End', info => "COMPLETED" });
(-)a/misc/cronjobs/cleanup_database.pl (-1 / +5 lines)
Lines 149-154 my $cards; Link Here
149
my @log_modules;
149
my @log_modules;
150
my @preserve_logs;
150
my @preserve_logs;
151
151
152
my $command_line_options = join(" ",@ARGV);
153
152
GetOptions(
154
GetOptions(
153
    'h|help'            => \$help,
155
    'h|help'            => \$help,
154
    'confirm'           => \$confirm,
156
    'confirm'           => \$confirm,
Lines 249-255 if ($pDebarments && $allDebarments) { Link Here
249
251
250
say "Confirm flag not passed, running in dry-run mode..." unless $confirm;
252
say "Confirm flag not passed, running in dry-run mode..." unless $confirm;
251
253
252
cronlogaction() unless $confirm;
254
cronlogaction({ info => $command_line_options });
253
255
254
my $dbh = C4::Context->dbh();
256
my $dbh = C4::Context->dbh();
255
my $sth;
257
my $sth;
Lines 673-678 if ($cards) { Link Here
673
    }
675
    }
674
}
676
}
675
677
678
cronlogaction({ action => 'End', info => "COMPLETED" });
679
676
exit(0);
680
exit(0);
677
681
678
sub RemoveOldSessions {
682
sub RemoveOldSessions {
(-)a/misc/cronjobs/cloud-kw.pl (-1 / +5 lines)
Lines 33-38 use C4::Log qw( cronlogaction ); Link Here
33
my $verbose     = 0;
33
my $verbose     = 0;
34
my $help        = 0;
34
my $help        = 0;
35
my $conf        = '';
35
my $conf        = '';
36
37
my $command_line_options = join(" ",@ARGV);
38
36
GetOptions( 
39
GetOptions( 
37
    'verbose'   => \$verbose,
40
    'verbose'   => \$verbose,
38
    'help'      => \$help,
41
    'help'      => \$help,
Lines 46-52 sub usage { Link Here
46
49
47
usage() if $help || !$conf;
50
usage() if $help || !$conf;
48
51
49
cronlogaction();
52
cronlogaction({ info => $command_line_options });
50
53
51
my @clouds;
54
my @clouds;
52
print "Reading configuration file: $conf\n" if $verbose;
55
print "Reading configuration file: $conf\n" if $verbose;
Lines 90-95 for my $cloud ( @clouds ) { Link Here
90
    $set_new_context && restore_context C4::Context;
93
    $set_new_context && restore_context C4::Context;
91
}
94
}
92
95
96
cronlogaction({ action => 'End', info => "COMPLETED" });
93
97
94
98
95
package ZebraIndex;
99
package ZebraIndex;
(-)a/misc/cronjobs/delete_patrons.pl (-1 / +5 lines)
Lines 14-19 use C4::Log qw( cronlogaction ); Link Here
14
my ( $help, $verbose, $not_borrowed_since, $expired_before, $last_seen,
14
my ( $help, $verbose, $not_borrowed_since, $expired_before, $last_seen,
15
    @category_code, $branchcode, $file, $confirm );
15
    @category_code, $branchcode, $file, $confirm );
16
16
17
my $command_line_options = join(" ",@ARGV);
18
17
GetOptions(
19
GetOptions(
18
    'h|help'                 => \$help,
20
    'h|help'                 => \$help,
19
    'v|verbose'              => \$verbose,
21
    'v|verbose'              => \$verbose,
Lines 44-50 unless ( $not_borrowed_since or $expired_before or $last_seen or @category_code Link Here
44
    pod2usage(q{At least one filter is mandatory});
46
    pod2usage(q{At least one filter is mandatory});
45
}
47
}
46
48
47
cronlogaction();
49
cronlogaction({ info => $command_line_options });
48
50
49
my @file_members;
51
my @file_members;
50
if ($file) {
52
if ($file) {
Lines 139-144 for my $member (@$members) { Link Here
139
141
140
say $confirm ? "$deleted patrons deleted" : "$deleted patrons would have been deleted" if $verbose;
142
say $confirm ? "$deleted patrons deleted" : "$deleted patrons would have been deleted" if $verbose;
141
143
144
cronlogaction({ action => 'End', info => "COMPLETED" });
145
142
=head1 NAME
146
=head1 NAME
143
147
144
delete_patrons - This script deletes patrons
148
delete_patrons - This script deletes patrons
(-)a/misc/cronjobs/fines.pl (-1 / +5 lines)
Lines 49-54 my $output_dir; Link Here
49
my $log;
49
my $log;
50
my $maxdays;
50
my $maxdays;
51
51
52
my $command_line_options = join(" ",@ARGV);
53
52
GetOptions(
54
GetOptions(
53
    'h|help'    => \$help,
55
    'h|help'    => \$help,
54
    'v|verbose' => \$verbose,
56
    'v|verbose' => \$verbose,
Lines 90-96 catch { Link Here
90
    exit;
92
    exit;
91
};
93
};
92
94
93
cronlogaction();
95
cronlogaction({ info => $command_line_options });
94
96
95
my @borrower_fields =
97
my @borrower_fields =
96
  qw(cardnumber categorycode surname firstname email phone address citystate);
98
  qw(cardnumber categorycode surname firstname email phone address citystate);
Lines 200-205 Number of Overdue Items: Link Here
200
EOM
202
EOM
201
}
203
}
202
204
205
cronlogaction({ action => 'End', info => "COMPLETED" });
206
203
sub set_holiday {
207
sub set_holiday {
204
    my ( $branch, $dt ) = @_;
208
    my ( $branch, $dt ) = @_;
205
209
(-)a/misc/cronjobs/gather_print_notices.pl (-1 / +5 lines)
Lines 29-34 my ( Link Here
29
    @emails,
29
    @emails,
30
);
30
);
31
31
32
my $command_line_options = join(" ",@ARGV);
33
32
$send = 1;
34
$send = 1;
33
GetOptions(
35
GetOptions(
34
    'h|help'  => \$help,
36
    'h|help'  => \$help,
Lines 72-78 if ( $ods and @letter_codes != 1 ) { Link Here
72
74
73
$delimiter ||= q|,|;
75
$delimiter ||= q|,|;
74
76
75
cronlogaction();
77
cronlogaction({ info => $command_line_options });
76
78
77
my $today_iso     = output_pref( { dt => dt_from_string, dateonly => 1, dateformat => 'iso' } ) ;
79
my $today_iso     = output_pref( { dt => dt_from_string, dateonly => 1, dateformat => 'iso' } ) ;
78
my $today_syspref = output_pref( { dt => dt_from_string, dateonly => 1 } );
80
my $today_syspref = output_pref( { dt => dt_from_string, dateonly => 1 } );
Lines 142-147 if ( @emails ) { Link Here
142
    }
144
    }
143
}
145
}
144
146
147
cronlogaction({ action => 'End', info => "COMPLETED" });
148
145
sub print_notices {
149
sub print_notices {
146
    my ( $params ) = @_;
150
    my ( $params ) = @_;
147
151
(-)a/misc/cronjobs/holds/auto_unsuspend_holds.pl (-1 / +4 lines)
Lines 26-31 use Koha::Script -cron; Link Here
26
use C4::Reserves qw(AutoUnsuspendReserves);
26
use C4::Reserves qw(AutoUnsuspendReserves);
27
use C4::Log qw( cronlogaction );
27
use C4::Log qw( cronlogaction );
28
28
29
cronlogaction();
29
my $command_line_options = join(" ",@ARGV);
30
cronlogaction({ info => $command_line_options });
30
31
31
AutoUnsuspendReserves();
32
AutoUnsuspendReserves();
33
34
cronlogaction({ action => 'End', info => "COMPLETED" });
(-)a/misc/cronjobs/holds/build_holds_queue.pl (-1 / +3 lines)
Lines 13-19 use Koha::Script -cron; Link Here
13
use C4::HoldsQueue qw(CreateQueue);
13
use C4::HoldsQueue qw(CreateQueue);
14
use C4::Log qw( cronlogaction );
14
use C4::Log qw( cronlogaction );
15
15
16
cronlogaction();
16
my $command_line_options = join(" ",@ARGV);
17
cronlogaction({ info => $command_line_options });
17
18
18
CreateQueue();
19
CreateQueue();
19
20
21
cronlogaction({ action => 'End', info => "COMPLETED" });
(-)a/misc/cronjobs/holds/cancel_expired_holds.pl (-1 / +5 lines)
Lines 65-76 Optionally adds a reason for cancellation (which will trigger a notice to be sen Link Here
65
my $help = 0;
65
my $help = 0;
66
my $reason;
66
my $reason;
67
67
68
my $command_line_options = join(" ",@ARGV);
69
68
GetOptions(
70
GetOptions(
69
    'help|?'   => \$help,
71
    'help|?'   => \$help,
70
    'reason=s' => \$reason
72
    'reason=s' => \$reason
71
) or pod2usage(1);
73
) or pod2usage(1);
72
pod2usage(1) if $help;
74
pod2usage(1) if $help;
73
75
74
cronlogaction();
76
cronlogaction({ info => $command_line_options });
75
77
76
C4::Reserves::CancelExpiredReserves($reason);
78
C4::Reserves::CancelExpiredReserves($reason);
79
80
cronlogaction({ action => 'End', info => "COMPLETED" });
(-)a/misc/cronjobs/holds/cancel_unfilled_holds.pl (+7 lines)
Lines 80-85 my $use_calendar = 0; Link Here
80
my $verbose      = 0;
80
my $verbose      = 0;
81
my $confirm      = 0;
81
my $confirm      = 0;
82
82
83
my $command_line_options = join(" ",@ARGV);
84
83
GetOptions(
85
GetOptions(
84
    'h|help|?'   => \$help,
86
    'h|help|?'   => \$help,
85
    'days=s'     => \$days,
87
    'days=s'     => \$days,
Lines 99-104 qq{\nError: You must specify a value for days waiting to cancel holds.\n}, Link Here
99
        }
101
        }
100
    );
102
    );
101
}
103
}
104
105
cronlogaction({ info => $command_line_options });
106
102
warn "Running in test mode, no actions will be taken" unless ($confirm);
107
warn "Running in test mode, no actions will be taken" unless ($confirm);
103
108
104
$verbose and warn "Looking for unfilled holds placed $days or more days ago\n";
109
$verbose and warn "Looking for unfilled holds placed $days or more days ago\n";
Lines 136-138 foreach my $branch (@branchcodes) { Link Here
136
    }
141
    }
137
142
138
}
143
}
144
145
cronlogaction({ action => 'End', info => "COMPLETED" });
(-)a/misc/cronjobs/holds/holds_reminder.pl (-1 / +5 lines)
Lines 176-181 my $date_input; Link Here
176
my $opt_out = 0;
176
my $opt_out = 0;
177
my @mtts;
177
my @mtts;
178
178
179
my $command_line_options = join(" ",@ARGV);
180
179
GetOptions(
181
GetOptions(
180
    'help|?'         => \$help,
182
    'help|?'         => \$help,
181
    'man'            => \$man,
183
    'man'            => \$man,
Lines 194-200 pod2usage( -verbose => 2 ) if $man; Link Here
194
196
195
$lettercode ||= 'HOLD_REMINDER';
197
$lettercode ||= 'HOLD_REMINDER';
196
198
197
cronlogaction();
199
cronlogaction({ info => $command_line_options });
198
200
199
# Unless a delay is specified by the user we target all waiting holds
201
# Unless a delay is specified by the user we target all waiting holds
200
unless (defined $days) {
202
unless (defined $days) {
Lines 312-314 foreach my $branchcode (@branchcodes) { #BEGIN BRANCH LOOP Link Here
312
314
313
315
314
} #END BRANCH LOOP
316
} #END BRANCH LOOP
317
318
cronlogaction({ action => 'End', info => "COMPLETED" });
(-)a/misc/cronjobs/longoverdue.pl (-1 / +5 lines)
Lines 53-58 my $list_categories = 0; Link Here
53
my $list_itemtypes = 0;
53
my $list_itemtypes = 0;
54
my @skip_lost_values;
54
my @skip_lost_values;
55
55
56
my $command_line_options = join(" ",@ARGV);
57
56
GetOptions(
58
GetOptions(
57
    'l|lost=s%'         => \$lost,
59
    'l|lost=s%'         => \$lost,
58
    'c|charge=s'        => \$charge,
60
    'c|charge=s'        => \$charge,
Lines 278-284 unless ($confirm) { Link Here
278
    print "### TEST MODE -- NO ACTIONS TAKEN ###\n";
280
    print "### TEST MODE -- NO ACTIONS TAKEN ###\n";
279
}
281
}
280
282
281
cronlogaction();
283
cronlogaction({ info => $command_line_options });
282
284
283
# In my opinion, this line is safe SQL to have outside the API. --atz
285
# In my opinion, this line is safe SQL to have outside the API. --atz
284
our $bounds_sth = C4::Context->dbh->prepare("SELECT DATE_SUB(CURDATE(), INTERVAL ? DAY)");
286
our $bounds_sth = C4::Context->dbh->prepare("SELECT DATE_SUB(CURDATE(), INTERVAL ? DAY)");
Lines 443-445 if (!$quiet){ Link Here
443
    summarize (\@report, 1);
445
    summarize (\@report, 1);
444
    print "\nTOTAL: $total items\n";
446
    print "\nTOTAL: $total items\n";
445
}
447
}
448
449
cronlogaction({ action => 'End', info => "COMPLETED" });
(-)a/misc/cronjobs/membership_expiry.pl (-1 / +5 lines)
Lines 158-163 my $after = 0; Link Here
158
my ( $branch, $letter_type );
158
my ( $branch, $letter_type );
159
my @where;
159
my @where;
160
160
161
my $command_line_options = join(" ",@ARGV);
162
161
GetOptions(
163
GetOptions(
162
    'help|?'         => \$help,
164
    'help|?'         => \$help,
163
    'man'            => \$man,
165
    'man'            => \$man,
Lines 174-180 GetOptions( Link Here
174
pod2usage( -verbose => 2 ) if $man;
176
pod2usage( -verbose => 2 ) if $man;
175
pod2usage(1) if $help || !$confirm;
177
pod2usage(1) if $help || !$confirm;
176
178
177
cronlogaction();
179
cronlogaction({ info => $command_line_options });
178
180
179
my $expdays = C4::Context->preference('MembershipExpiryDaysNotice');
181
my $expdays = C4::Context->preference('MembershipExpiryDaysNotice');
180
if( !$expdays ) {
182
if( !$expdays ) {
Lines 225-227 while ( my $recent = $upcoming_mem_expires->next ) { Link Here
225
        });
227
        });
226
    }
228
    }
227
}
229
}
230
231
cronlogaction({ action => 'End', info => "COMPLETED" });
(-)a/misc/cronjobs/overdue_notices.pl (-1 / +4 lines)
Lines 309-314 my @myborcat; Link Here
309
my @myborcatout;
309
my @myborcatout;
310
my ( $date_input, $today );
310
my ( $date_input, $today );
311
311
312
my $command_line_options = join(" ",@ARGV);
313
312
GetOptions(
314
GetOptions(
313
    'help|?'         => \$help,
315
    'help|?'         => \$help,
314
    'man'            => \$man,
316
    'man'            => \$man,
Lines 331-337 GetOptions( Link Here
331
) or pod2usage(2);
333
) or pod2usage(2);
332
pod2usage(1) if $help;
334
pod2usage(1) if $help;
333
pod2usage( -verbose => 2 ) if $man;
335
pod2usage( -verbose => 2 ) if $man;
334
cronlogaction() unless $test_mode;
336
cronlogaction({ info => $command_line_options });
335
337
336
if ( defined $csvfilename && $csvfilename =~ /^-/ ) {
338
if ( defined $csvfilename && $csvfilename =~ /^-/ ) {
337
    warn qq(using "$csvfilename" as filename, that seems odd);
339
    warn qq(using "$csvfilename" as filename, that seems odd);
Lines 936-938 sub prepare_letter_for_printing { Link Here
936
    return $return;
938
    return $return;
937
}
939
}
938
940
941
cronlogaction({ action => 'End', info => "COMPLETED" });
(-)a/misc/cronjobs/patron_emailer.pl (-2 / +6 lines)
Lines 25-32 use Pod::Usage qw( pod2usage ); Link Here
25
use C4::Log qw( cronlogaction );
25
use C4::Log qw( cronlogaction );
26
use C4::Reports::Guided qw( EmailReport );
26
use C4::Reports::Guided qw( EmailReport );
27
27
28
cronlogaction();
29
30
=head1 NAME
28
=head1 NAME
31
29
32
patron_emailer.pl
30
patron_emailer.pl
Lines 119-124 my $error_msgs = { Link Here
119
    NO_BOR         => "There is no borrower with borrowernumber "
117
    NO_BOR         => "There is no borrower with borrowernumber "
120
};
118
};
121
119
120
my $command_line_options = join(" ",@ARGV);
121
122
GetOptions(
122
GetOptions(
123
    'help|?'      => \$help,
123
    'help|?'      => \$help,
124
    'report=i'    => \$report_id,
124
    'report=i'    => \$report_id,
Lines 133-138 GetOptions( Link Here
133
pod2usage(1) if $help;
133
pod2usage(1) if $help;
134
pod2usage(1) unless $report_id && $notice && $module;
134
pod2usage(1) unless $report_id && $notice && $module;
135
135
136
cronlogaction({ info => $command_line_options });
137
136
my ( $emails, $errors ) = C4::Reports::Guided::EmailReport({
138
my ( $emails, $errors ) = C4::Reports::Guided::EmailReport({
137
    email      => $email,
139
    email      => $email,
138
    from       => $from,
140
    from       => $from,
Lines 169-171 if( $verbose || !$commit ){ Link Here
169
        }
171
        }
170
    }
172
    }
171
}
173
}
174
175
cronlogaction({ action => 'End', info => "COMPLETED" });
(-)a/misc/cronjobs/plugins_nightly.pl (-1 / +4 lines)
Lines 10-16 use Koha::Logger; Link Here
10
use Koha::Plugins;
10
use Koha::Plugins;
11
use Koha::Script -cron;
11
use Koha::Script -cron;
12
12
13
cronlogaction();
13
my $command_line_options = join(" ",@ARGV);
14
cronlogaction({ info => $command_line_options });
14
15
15
my $logger = Koha::Logger->get();
16
my $logger = Koha::Logger->get();
16
if ( C4::Context->config("enable_plugins") ) {
17
if ( C4::Context->config("enable_plugins") ) {
Lines 31-36 if ( C4::Context->config("enable_plugins") ) { Link Here
31
    }
32
    }
32
}
33
}
33
34
35
cronlogaction({ action => 'End', info => "COMPLETED" });
36
34
=head1 NAME
37
=head1 NAME
35
38
36
plugins_nightly.pl - Run nightly tasks specified by plugins
39
plugins_nightly.pl - Run nightly tasks specified by plugins
(-)a/misc/cronjobs/process_message_queue.pl (-1 / +4 lines)
Lines 35-40 my $verbose = 0; Link Here
35
my $type = q{};
35
my $type = q{};
36
my $letter_code;
36
my $letter_code;
37
37
38
my $command_line_options = join(" ",@ARGV);
39
38
GetOptions(
40
GetOptions(
39
    'u|username:s'      => \$username,
41
    'u|username:s'      => \$username,
40
    'p|password:s'      => \$password,
42
    'p|password:s'      => \$password,
Lines 79-85 catch { Link Here
79
    exit;
81
    exit;
80
};
82
};
81
83
82
cronlogaction();
84
cronlogaction({ info => $command_line_options });
83
85
84
if ( C4::Context->config("enable_plugins") ) {
86
if ( C4::Context->config("enable_plugins") ) {
85
    my @plugins = Koha::Plugins->new->GetPlugins({
87
    my @plugins = Koha::Plugins->new->GetPlugins({
Lines 117-119 C4::Letters::SendQueuedMessages( Link Here
117
    }
119
    }
118
);
120
);
119
121
122
cronlogaction({ action => 'End', info => "COMPLETED" });
(-)a/misc/cronjobs/purge_suggestions.pl (-1 / +6 lines)
Lines 28-33 use C4::Context; Link Here
28
28
29
my ( $help, $days, $confirm );
29
my ( $help, $days, $confirm );
30
30
31
my $command_line_options = join(" ",@ARGV);
32
31
GetOptions(
33
GetOptions(
32
    'help|?' => \$help,
34
    'help|?' => \$help,
33
    'days:i' => \$days,
35
    'days:i' => \$days,
Lines 57-64 if( !$confirm || $help || !defined($days) ) { Link Here
57
    print "No confirm parameter passed!\n\n" if !$confirm && !$help;
59
    print "No confirm parameter passed!\n\n" if !$confirm && !$help;
58
    print $usage;
60
    print $usage;
59
} elsif( $days and $days > 0 ) {
61
} elsif( $days and $days > 0 ) {
60
    cronlogaction( " ( days: $days )");
62
    $command_line_options .= " ( effective days = $days )";
63
    cronlogaction({ info => $command_line_options });
61
    DelSuggestionsOlderThan($days);
64
    DelSuggestionsOlderThan($days);
62
} else {
65
} else {
63
    warn "This script requires a positive number of days. Aborted.\n";
66
    warn "This script requires a positive number of days. Aborted.\n";
64
}
67
}
68
69
cronlogaction({ action => 'End', info => "COMPLETED" });
(-)a/misc/cronjobs/recalls/expire_recalls.pl (-1 / +5 lines)
Lines 35-41 use Koha::DateUtils qw( dt_from_string ); Link Here
35
use Koha::Recalls;
35
use Koha::Recalls;
36
use C4::Log;
36
use C4::Log;
37
37
38
cronlogaction();
38
my $command_line_options = join(" ",@ARGV);
39
40
cronlogaction({ info => $command_line_options });
39
41
40
my $recalls = Koha::Recalls->search({ completed => 0 });
42
my $recalls = Koha::Recalls->search({ completed => 0 });
41
while( my $recall = $recalls->next ) {
43
while( my $recall = $recalls->next ) {
Lines 66-68 while( my $recall = $recalls->next ) { Link Here
66
        }
68
        }
67
    }
69
    }
68
}
70
}
71
72
cronlogaction({ action => 'End', info => "COMPLETED" });
(-)a/misc/cronjobs/recalls/overdue_recalls.pl (-1 / +5 lines)
Lines 34-40 use Koha::Checkouts; Link Here
34
use Koha::Recalls;
34
use Koha::Recalls;
35
use C4::Log;
35
use C4::Log;
36
36
37
cronlogaction();
37
my $command_line_options = join(" ",@ARGV);
38
39
cronlogaction({ info => $command_line_options });
38
40
39
my $recalls = Koha::Recalls->search({ status => 'R' });
41
my $recalls = Koha::Recalls->search({ status => 'R' });
40
while( my $recall = $recalls->next ) {
42
while( my $recall = $recalls->next ) {
Lines 42-44 while( my $recall = $recalls->next ) { Link Here
42
        $recall->set_overdue({ interface => 'COMMANDLINE' });
44
        $recall->set_overdue({ interface => 'COMMANDLINE' });
43
    }
45
    }
44
}
46
}
47
48
cronlogaction({ action => 'End', info => "COMPLETED" });
(-)a/misc/cronjobs/reconcile_balances.pl (-1 / +5 lines)
Lines 64-76 use Koha::Patrons; Link Here
64
my $help    = 0;
64
my $help    = 0;
65
my $verbose = 0;
65
my $verbose = 0;
66
66
67
my $command_line_options = join(" ",@ARGV);
68
67
GetOptions(
69
GetOptions(
68
    'help'    => \$help,
70
    'help'    => \$help,
69
    'verbose' => \$verbose
71
    'verbose' => \$verbose
70
) or pod2usage(2);
72
) or pod2usage(2);
71
73
72
pod2usage(1) if $help;
74
pod2usage(1) if $help;
73
cronlogaction();
75
cronlogaction({ info => $command_line_options });
74
76
75
my @patron_ids = Koha::Account::Lines->search(
77
my @patron_ids = Koha::Account::Lines->search(
76
        {
78
        {
Lines 111-116 while (my $patron = $patrons->next) { Link Here
111
    }
113
    }
112
}
114
}
113
115
116
cronlogaction({ action => 'End', info => "COMPLETED" });
117
114
1;
118
1;
115
119
116
__END__
120
__END__
(-)a/misc/cronjobs/runreport.pl (-1 / +5 lines)
Lines 186-191 my $username = undef; Link Here
186
my $password = undef;
186
my $password = undef;
187
my $method = 'LOGIN';
187
my $method = 'LOGIN';
188
188
189
my $command_line_options = join(" ",@ARGV);
190
189
GetOptions(
191
GetOptions(
190
    'help|?'            => \$help,
192
    'help|?'            => \$help,
191
    'man'               => \$man,
193
    'man'               => \$man,
Lines 208-214 pod2usage( -verbose => 2 ) if ($man); Link Here
208
pod2usage( -verbose => 2 ) if ($help and $verbose);
210
pod2usage( -verbose => 2 ) if ($help and $verbose);
209
pod2usage(1) if $help;
211
pod2usage(1) if $help;
210
212
211
cronlogaction();
213
cronlogaction({ info => $command_line_options });
212
214
213
unless ($format) {
215
unless ($format) {
214
    $verbose and print STDERR "No format specified, assuming 'text'\n";
216
    $verbose and print STDERR "No format specified, assuming 'text'\n";
Lines 359-361 foreach my $report_id (@ARGV) { Link Here
359
        print $message;
361
        print $message;
360
    }
362
    }
361
}
363
}
364
365
cronlogaction({ action => 'End', info => "COMPLETED" });
(-)a/misc/cronjobs/serialsUpdate.pl (-1 / +5 lines)
Lines 59-64 my $verbose = 0; Link Here
59
my $note    = '';
59
my $note    = '';
60
my $nonote  = 0;
60
my $nonote  = 0;
61
61
62
my $command_line_options = join(" ",@ARGV);
63
62
GetOptions(
64
GetOptions(
63
    'help|h|?'  => \$help,
65
    'help|h|?'  => \$help,
64
    'man'       => \$man,
66
    'man'       => \$man,
Lines 71-77 GetOptions( Link Here
71
pod2usage(1) if $help;
73
pod2usage(1) if $help;
72
pod2usage( -verbose => 2 ) if $man;
74
pod2usage( -verbose => 2 ) if $man;
73
75
74
cronlogaction();
76
cronlogaction({ info => $command_line_options });
75
77
76
$verbose and !$confirm and print "### Database will not be modified ###\n";
78
$verbose and !$confirm and print "### Database will not be modified ###\n";
77
79
Lines 141-143 while ( my $issue = $sth->fetchrow_hashref ) { Link Here
141
        }
143
        }
142
    }
144
    }
143
}
145
}
146
147
cronlogaction({ action => 'End', info => "COMPLETED" });
(-)a/misc/cronjobs/share_usage_with_koha_community.pl (-1 / +5 lines)
Lines 11-16 use C4::UsageStats; Link Here
11
use C4::Log qw( cronlogaction );
11
use C4::Log qw( cronlogaction );
12
use POSIX qw( strftime );
12
use POSIX qw( strftime );
13
13
14
my $command_line_options = join(" ",@ARGV);
15
14
my ( $help, $verbose, $force, $quiet );
16
my ( $help, $verbose, $force, $quiet );
15
GetOptions(
17
GetOptions(
16
    'h|help'    => \$help,
18
    'h|help'    => \$help,
Lines 36-42 Setting the quiet flag will silence this message. Link Here
36
    exit 1;
38
    exit 1;
37
}
39
}
38
40
39
cronlogaction();
41
cronlogaction({ info => $command_line_options });
40
42
41
my $need_update = ($force ? 1 : C4::UsageStats::NeedUpdate() );
43
my $need_update = ($force ? 1 : C4::UsageStats::NeedUpdate() );
42
44
Lines 51-56 elsif ($verbose) { Link Here
51
    say "Data don't need to be updated";
53
    say "Data don't need to be updated";
52
}
54
}
53
55
56
cronlogaction({ action => 'End', info => "COMPLETED" });
57
54
=head1 NAME
58
=head1 NAME
55
59
56
share_usage_with_koha_community.pl - Share your library's usage with the Koha community
60
share_usage_with_koha_community.pl - Share your library's usage with the Koha community
(-)a/misc/cronjobs/staticfines.pl (-1 / +4 lines)
Lines 52-57 my $borrowersalreadyapplied; # hashref of borrowers for whom we already applied Link Here
52
my $debug = 0;
52
my $debug = 0;
53
my $bigdebug = 0;
53
my $bigdebug = 0;
54
54
55
my $command_line_options = join(" ",@ARGV);
56
55
GetOptions(
57
GetOptions(
56
    'h|help'      => \$help,
58
    'h|help'      => \$help,
57
    'v|verbose'   => \$verbose,
59
    'v|verbose'   => \$verbose,
Lines 81-87 This script has the following parameters : Link Here
81
ENDUSAGE
83
ENDUSAGE
82
die $usage if $help;
84
die $usage if $help;
83
85
84
cronlogaction();
86
cronlogaction({ info => $command_line_options });
85
87
86
my $dbh = C4::Context->dbh;
88
my $dbh = C4::Context->dbh;
87
89
Lines 238-240 Number of Overdue Items: Link Here
238
EOM
240
EOM
239
}
241
}
240
242
243
cronlogaction({ action => 'End', info => "COMPLETED" });
(-)a/misc/cronjobs/update_totalissues.pl (-2 / +5 lines)
Lines 52-57 my $incremental = 0; Link Here
52
my $commit      = 100;
52
my $commit      = 100;
53
my $unit;
53
my $unit;
54
54
55
my $command_line_options = join(" ",@ARGV);
56
55
my $result = GetOptions(
57
my $result = GetOptions(
56
    'v|verbose'    => \$verbose,
58
    'v|verbose'    => \$verbose,
57
    't|test'       => \$test_only,
59
    't|test'       => \$test_only,
Lines 90-96 if ( not $result or $want_help ) { Link Here
90
    usage();
92
    usage();
91
}
93
}
92
94
93
cronlogaction();
95
cronlogaction({ info => $command_line_options });
94
96
95
my $dbh = C4::Context->dbh;
97
my $dbh = C4::Context->dbh;
96
$dbh->{AutoCommit} = 0;
98
$dbh->{AutoCommit} = 0;
Lines 105-110 process_stats() if $usestats; Link Here
105
107
106
report();
108
report();
107
109
110
cronlogaction({ action => 'End', info => "COMPLETED" });
111
108
exit 0;
112
exit 0;
109
113
110
sub process_items {
114
sub process_items {
111
- 

Return to bug 31203