As of Bug 10777 Galen added css to zebra stripe html emailed reports; unfortunately this was implemented in a way incompatible with both gmail and hotmail on-line email clients This is reasonably easily solved by in-lining the styles as opposed to adding them to the page head.
Created attachment 34342 [details] [review] Bug 13448: Make Striping gmail/hotmail compatible This patch inlines the css to stripe a html output report
This isn't an enhancement. It is fixing a behaviour broken in particular contexts. Changed to 'minor' bug fix.
Comment on attachment 34342 [details] [review] Bug 13448: Make Striping gmail/hotmail compatible Review of attachment 34342 [details] [review]: ----------------------------------------------------------------- ::: misc/cronjobs/runreport.pl @@ +249,3 @@ > while (my $line = $sth->fetchrow_arrayref) { > foreach (@$line) { defined($_) or $_ = ''; } # catch undef values, replace w/ '' > + if ($count++ % 2 == 0) { This is an ugly coding style!
Comment on attachment 34342 [details] [review] Bug 13448: Make Striping gmail/hotmail compatible Review of attachment 34342 [details] [review]: ----------------------------------------------------------------- ::: misc/cronjobs/runreport.pl @@ -270,4 @@ > my $email = Koha::Email->new(); > my %mail; > if ($format eq 'html') { > - $message = "<html><head><style>tr:nth-child(2n+1) { background-color: #ccc;}</style></head><body>$message</body></html>"; It makes sense to remove the <head>...</head>, but the <html><body>$message</body></html> should probably be left in tact. Otherwise, you get just <table>...</table> as your message.
Marking as failed qa because: 1) coding style which has multiple side effects in a single statement, but more importantly, 2) Only generating <table>...</table>, because of excessive cutting.
(In reply to M. Tompsett from comment #3) > Comment on attachment 34342 [details] [review] [review] > Bug 13448: Make Striping gmail/hotmail compatible > > Review of attachment 34342 [details] [review] [review]: > ----------------------------------------------------------------- > > ::: misc/cronjobs/runreport.pl > @@ +249,3 @@ > > while (my $line = $sth->fetchrow_arrayref) { > > foreach (@$line) { defined($_) or $_ = ''; } # catch undef values, replace w/ '' > > + if ($count++ % 2 == 0) { > > This is an ugly coding style! What's ugly? What do you suggest?
(In reply to Jonathan Druart from comment #6) > (In reply to M. Tompsett from comment #3) > > > + if ($count++ % 2 == 0) { > > > > This is an ugly coding style! > > What's ugly? What do you suggest? Incrementing should be external to the modulus comparison. $count++; if ($count%2==1) { This is more readable, and less likely to be misunderstood.