From 30b32d99381a8296e41e6843c440cd9e3594eb8a Mon Sep 17 00:00:00 2001 From: Sophie Meynieux Date: Wed, 14 Aug 2013 15:51:10 +0200 Subject: [PATCH] Bug 10727: Replace carriage return with
when printing hold notices This patch replaces carriage return with
in the content of hold notices for printing. This is necessary to convert html file into well formatted pdf file. Test plan : - check in an item reserved by a borrower that has not activated email notification - verify in message_queue table that you've got a new HOLD_PRINT notice with status 'pending' - run gather_print_notices.pl Without the patch, the script generates a html file without
tags. If you run printoverdues.sh , the text in the resulting PDF file is all on one line With the patch, the script generates a html file with
tags and the PDF file created by printoverdues.sh is well formatted. Signed-off-by: Srdjan Signed-off-by: Kyle M Hall Signed-off-by: Galen Charlton --- misc/cronjobs/gather_print_notices.pl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/misc/cronjobs/gather_print_notices.pl b/misc/cronjobs/gather_print_notices.pl index 286b035372..2d0555750e 100755 --- a/misc/cronjobs/gather_print_notices.pl +++ b/misc/cronjobs/gather_print_notices.pl @@ -69,6 +69,14 @@ my $today = C4::Dates->new(); my @all_messages = @{ GetPrintMessages() }; exit unless (@all_messages); +## carriage return replaced by
as output is html +foreach my $message (@all_messages) { + local $_ = $message->{'content'}; + s/\n/
/g; + s/\r//g; + $message->{'content'} = $_; +} + my $OUTPUT; if ($split) { -- 2.39.2