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

(-)a/misc/cronjobs/runreport.pl (-3 / +6 lines)
Lines 245-253 foreach my $report_id (@ARGV) { Link Here
245
    if ($format eq 'html') {
245
    if ($format eq 'html') {
246
        my $cgi = CGI->new();
246
        my $cgi = CGI->new();
247
        my @rows = ();
247
        my @rows = ();
248
        my $count = 0;
248
        while (my $line = $sth->fetchrow_arrayref) {
249
        while (my $line = $sth->fetchrow_arrayref) {
249
            foreach (@$line) { defined($_) or $_ = ''; }    # catch undef values, replace w/ ''
250
            foreach (@$line) { defined($_) or $_ = ''; }    # catch undef values, replace w/ ''
250
            push @rows, $cgi->TR( join('', $cgi->td($line)) ) . "\n";
251
            if ($count++ % 2 == 0) {
252
                push @rows, $cgi->TR({-style=>'background-color: #ccc;'}, join('', $cgi->td($line)) ) . "\n";
253
            } else {
254
                push @rows, $cgi->TR( join('', $cgi->td($line)) ) . "\n";
255
            }
251
        }
256
        }
252
        $message = $cgi->table(join "", @rows);
257
        $message = $cgi->table(join "", @rows);
253
    } elsif ($format eq 'csv') {
258
    } elsif ($format eq 'csv') {
Lines 270-276 foreach my $report_id (@ARGV) { Link Here
270
        my $email = Koha::Email->new();
275
        my $email = Koha::Email->new();
271
        my %mail;
276
        my %mail;
272
        if ($format eq 'html') {
277
        if ($format eq 'html') {
273
                $message = "<html><head><style>tr:nth-child(2n+1) { background-color: #ccc;}</style></head><body>$message</body></html>";
274
           %mail = $email->create_message_headers({
278
           %mail = $email->create_message_headers({
275
              to      => $to,
279
              to      => $to,
276
              from    => $from,
280
              from    => $from,
277
- 

Return to bug 13448