Bugzilla – Attachment 20546 Details for
Bug 10777
runreport.pl allows for sending html reports via email, but mimetype is wrong
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Send html reports with the proper Content-Type
Send-html-reports-with-the-proper-Content-Type.patch (text/plain), 1.69 KB, created by
Nicholas van Oudtshoorn
on 2013-08-22 08:57:38 UTC
(
hide
)
Description:
Send html reports with the proper Content-Type
Filename:
MIME Type:
Creator:
Nicholas van Oudtshoorn
Created:
2013-08-22 08:57:38 UTC
Size:
1.69 KB
patch
obsolete
>From 8b81f0b93cceac74efc3add288cb7565b68fbd6d Mon Sep 17 00:00:00 2001 >From: Nicholas van Oudtshoorn <vanoudt@gmail.com> >Date: Thu, 22 Aug 2013 16:56:25 +0800 >Subject: [PATCH] Send html reports with the proper Content-Type >Content-Type: text/plain; charset="utf-8" > >http://bugs.koha-community.org/show_bug.cgi?id=10777 >--- > misc/cronjobs/runreport.pl | 25 ++++++++++++++++++------- > 1 file changed, 18 insertions(+), 7 deletions(-) > >diff --git a/misc/cronjobs/runreport.pl b/misc/cronjobs/runreport.pl >index 2357ed8..18e175d 100755 >--- a/misc/cronjobs/runreport.pl >+++ b/misc/cronjobs/runreport.pl >@@ -241,14 +241,25 @@ foreach my $report_id (@ARGV) { > $message .= $csv->string() . "\n"; > } > } >- > if ($email){ >- my %mail = ( >- To => $to, >- From => $from, >- Subject => encode('utf8', $subject ), >- Message => encode('utf8', $message ) >- ); >+ my %mail; >+ if ($format eq 'html') { >+ $message = "<html><head><style>tr:nth-child(n+1) { background-color: #ccc;}</style></head><body>$message</body></html>"; >+ %mail = ( >+ To => $to, >+ From => $from, >+ 'Content-Type' => 'text/html', >+ Subject => encode('utf8', $subject ), >+ Message => encode('utf8', $message ) >+ ); >+ } else { >+ %mail = ( >+ To => $to, >+ From => $from, >+ Subject => encode('utf8', $subject ), >+ Message => encode('utf8', $message ) >+ ); >+ } > sendmail(%mail) or carp 'mail not sent:' . $Mail::Sendmail::error; > } else { > print $message; >-- >1.8.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10777
:
20546
|
25603
|
26063