From 0173e88b27b5f185b1b227c0e8070078e4193530 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 6 Nov 2023 12:50:05 +0000 Subject: [PATCH] Bug 30287: Conditionally render notice preview Content-Type: text/plain; charset=utf-8 This patch adds conditional formatting based on whether the notice was generated from an HTML template or a plaintext one. We simply drop the 'html_line_break' filter for the case where the notice should already be html formatted. I was tempted to replace the html_line_break for plaintext formatted notices too as I believe this closer resembles how we actually output such generated notices.. but I decided that should be for another bug. Signed-off-by: David Nind Signed-off-by: Marcel de Rooy --- koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt | 5 +++++ members/notices.pl | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt index 2626046803..bc5357a97b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt @@ -1,5 +1,6 @@ [% USE raw %] [% USE Asset %] +[% USE String %] [% USE Koha %] [% USE AuthorisedValues %] [% USE Branches %] @@ -65,7 +66,11 @@ [% QUEUED_MESSAGE.subject | html %] + [% IF QUEUED_MESSAGE.content_type.search('html') %] + + [% ELSE %] + [% END %] [% IF ( QUEUED_MESSAGE.message_transport_type == 'email' ) %]email diff --git a/members/notices.pl b/members/notices.pl index 11f3faa917..019b1430ff 100755 --- a/members/notices.pl +++ b/members/notices.pl @@ -110,7 +110,7 @@ if ( $op eq 'send_password_reset' ) { } # Getting the messages -my $queued_messages = C4::Letters::GetQueuedMessages({borrowernumber => $borrowernumber}); +my $queued_messages = Koha::Notice::Messages->search({borrowernumber => $borrowernumber}); $template->param( patron => $patron, -- 2.30.2