From 25672873bdeafc1d91c5fd7fde67fc59f4aecee3 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 Signed-off-by: Chris Cormack --- misc/cronjobs/overdue_notices.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index 0f263c4..80a2217 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -763,7 +763,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.8.4.rc2