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. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
8bb8282d68
commit
f83b9ab1ff
2 changed files with 6 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
[% USE raw %]
|
||||
[% USE Asset %]
|
||||
[% USE String %]
|
||||
[% USE Koha %]
|
||||
[% USE AuthorisedValues %]
|
||||
[% USE Branches %]
|
||||
|
@ -65,7 +66,11 @@
|
|||
<tr>
|
||||
<td>
|
||||
<a class="notice-title" data-noticeid="[% QUEUED_MESSAGE.message_id | html %]" href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrowernumber | uri %]&noticeid=[% QUEUED_MESSAGE.message_id | uri %]">[% QUEUED_MESSAGE.subject | html %]</a>
|
||||
[% IF QUEUED_MESSAGE.content_type.search('html') %]
|
||||
<iframe class="notice" id="notice[% QUEUED_MESSAGE.message_id | html %]" srcdoc="[% QUEUED_MESSAGE.content | html %]"></iframe>
|
||||
[% ELSE %]
|
||||
<iframe class="notice" id="notice[% QUEUED_MESSAGE.message_id | html %]" srcdoc="[% QUEUED_MESSAGE.content | html | html_line_break %]"></iframe>
|
||||
[% END %]
|
||||
</td>
|
||||
<td>
|
||||
[% IF ( QUEUED_MESSAGE.message_transport_type == 'email' ) %]<span>email</span>
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue