Bug 10777 - runreport.pl allows for sending html reports via email, but mimetype is wrong
Summary: runreport.pl allows for sending html reports via email, but mimetype is wrong
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Nicholas van Oudtshoorn
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-22 08:31 UTC by Nicholas van Oudtshoorn
Modified: 2016-06-21 21:37 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Send html reports with the proper Content-Type (1.69 KB, patch)
2013-08-22 08:57 UTC, Nicholas van Oudtshoorn
Details | Diff | Splinter Review
[SIGNED OFF] Bug 10777 - Send html reports with the proper Content-Type (2.35 KB, patch)
2014-02-25 06:47 UTC, Mark Tompsett
Details | Diff | Splinter Review
[PASSED QA] Bug 10777 - Send html reports with the proper Content-Type (2.41 KB, patch)
2014-03-11 10:06 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nicholas van Oudtshoorn 2013-08-22 08:31:27 UTC
runreport.pl allows for sending html reports via email. The problem is that the Content-Type isn't set to text/html, which means that the generated html email isn't displayed properly. 

The patch for this sets the content type, and also adds a tiny bit of css to alternate row colours (just to make long reports a bit easier on the eye!)
Comment 1 Marcel de Rooy 2013-08-22 08:39:29 UTC
Nicholas: If you send a patch, you can overwrite the default assignee.
Comment 2 Nicholas van Oudtshoorn 2013-08-22 08:57:38 UTC Comment hidden (obsolete)
Comment 3 Liz Rea 2013-08-22 09:21:46 UTC
Sorry to be a bother, may we have a test plan please?

Cheers,
Liz
Comment 4 Nicholas van Oudtshoorn 2013-08-23 00:52:18 UTC
Will provide one next week, when I'm back in that office!
Comment 5 Nicholas van Oudtshoorn 2013-10-10 09:38:13 UTC
Test plan:

1. Run a report as follows:
./runreport.pl --format=html --to=YOUREMAIL --subject="Bad formatting" REPORTNUMBER
2. Look at the email - the html code should show in modern email readers.
3. Apply the pathc
4. Run the report again:
./runreport.pl --format=html --to=vanoudt@gmail.com --subject="Lost items report" 45
5. Look at the email - it should appear nicely formatted with no html codes visible
Comment 6 Mark Tompsett 2014-02-25 06:47:20 UTC Comment hidden (obsolete)
Comment 7 Martin Renvoize 2014-03-11 10:06:12 UTC
Created attachment 26063 [details] [review]
[PASSED QA] Bug 10777 - Send html reports with the proper Content-Type

The misc/cronjobs/runreport.pl allows for sending html reports
via email. The problem is that the Content-Type isn't set to
text/html, which means that the generated html email isn't
displayed properly.

This patch set the Content-Type, and also adds a tiny bit of
CSS to potentially alternate row colours (just to make long
reports a bit easier on the eye!)

TEST PLAN
----------
1. Run the script similar to this:
    ./misc/cronjobs/runreport.pl --format=html --to=YOUREMAIL --subject="Bad Formatting!" REPORTNUMBER
2. Look at the email - the html code should by visible and ugly.
3. apply the patch
4. Run the script again.
5. Look at the email - the data should look nicer now.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize 2014-03-11 10:08:06 UTC
Code looks good, functions still work as expected with no regressions, qa scripts all pass as expected.  Nice tirvial patch.
Comment 9 Galen Charlton 2014-03-11 15:01:42 UTC
Pushed to master, along with a follow-up to tweak the CSS to improve the changes that recipients will see the zebra-striping.

This appears to be your first patch accepted into Koha master.  Congratulations, Nicholas!
Comment 10 Nicholas van Oudtshoorn 2014-03-11 23:14:05 UTC
Thank you very much! Nice to be able to give something back!
Comment 11 Fridolin Somers 2014-05-27 14:58:53 UTC
Pushed to 3.14.x, will be in 3.14.07
Comment 12 Kyle M Hall 2014-06-06 13:57:10 UTC
Pushed to 3.12.x will be in 3.12.13