From 6dbfe1512dc39e82084f9aa8b8ecce38fa24c5c5 Mon Sep 17 00:00:00 2001 From: Sophie Meynieux Date: Fri, 2 Aug 2013 15:48:27 +0200 Subject: [PATCH] Bug 9372: replace 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 Signed-off-by: Galen Charlton --- 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 598f9224a9..5da424ebe2 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -765,7 +765,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"; -- 2.39.5