From 65bf24916500a4aca0daed79a492405695b61801 Mon Sep 17 00:00:00 2001 From: Sophie Meynieux Date: Fri, 2 Aug 2013 15:48:27 +0200 Subject: [PATCH] Bug 9372 : Replaces carriage return with
in printed html files for overdues. For pdf generation, html files need explicit
html tags. With this patch, carriage return are replaced by
when letters are written into html files. Test plan : - Ensure you've got at least one reader with overdue triggering notice - Ensure that your notice template got html checked - Run misc/cronjobs/overdue_notices.pl -v -n -html and misc/cronjobs/printoverdues.sh Without patch, the content of the letter is all on one line in pdf file With the patch, pdf file is correctly formated - remove your reader email - Run misc/cronjobs/overdue_notices.pl -v -html and misc/cronjobs/printoverdues.sh Without patch, the content of pdf file is all on one line with the patch, pdf file is correctly formated. - restore reader email - run misc/cronjobs/overdue_notice.pl -v -html Verify that the a message has been generated in message_queue table With or without patch, the message is the same Signed-off-by: Kyle M Hall --- misc/cronjobs/overdue_notices.pl | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index 5f285c0..44658f4 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -761,7 +761,10 @@ sub prepare_letter_for_printing { } } elsif ( exists $params->{'outputformat'} && $params->{'outputformat'} eq 'html' ) { $return = "
\n";
-      $return .= "$params->{'letter'}->{'content'}\n";
+      my $content = $params->{'letter'}->{'content'};
+      $content=~s/\n/
/g; + $content=~s/\r//g; + $return .= "$content\n"; $return .= "\n
\n"; } else { $return .= "$params->{'letter'}->{'content'}\n"; -- 1.7.2.5