From be63cd626789ec46a6e5fbcd754b97bd15a9768b 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 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. --- 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 26260468033..bc5357a97bd 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 11f3faa917a..019b1430fff 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.41.0