From e2055b33b64b7eae1f4090fdc94602ce5082f6ab Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 9 Nov 2022 11:18:08 +0000 Subject: [PATCH] Bug 31028: (follow-up) Fix notices whitespace We we're using [% %] rather than [%- -%] in our the notice template introduced with this patchset. This leads to some interesting rendering results in some email clients. Using the proper whitespace ignoring template markup fixes the situation. Signed-off-by: David Nind Signed-off-by: Helen Oliver --- .../data/mysql/atomicupdate/bug_31028.pl | 8 +++--- .../mysql/en/mandatory/sample_notices.yml | 25 ++++++++++--------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_31028.pl b/installer/data/mysql/atomicupdate/bug_31028.pl index 612ac39e08c..efb46cfc188 100644 --- a/installer/data/mysql/atomicupdate/bug_31028.pl +++ b/installer/data/mysql/atomicupdate/bug_31028.pl @@ -89,7 +89,7 @@ return { $dbh->do( q{ INSERT IGNORE INTO letter(module,code,branchcode,name,is_html,title,content,message_transport_type) - VALUES ( 'catalogue', 'TICKET_ACKNOWLEDGE', '', 'Concern acknowledgement', '1', 'Catalog concern acknowledgement', "Dear [% INCLUDE 'patron-title.inc' patron => ticket.reporter %],

Thankyou for your report concerning [% INCLUDE 'biblio-title.inc' biblio=ticket.biblio link = 0 %].

You reported:
[% ticket.body %]

Thankyou", 'email' ); + VALUES ( 'catalogue', 'TICKET_ACKNOWLEDGE', '', 'Concern acknowledgement', '1', 'Catalog concern acknowledgement', "Dear [%- INCLUDE 'patron-title.inc' patron => ticket.reporter -%],

Thankyou for your report concerning [%- INCLUDE 'biblio-title.inc' biblio=ticket.biblio link = 0 -%].

You reported:
[%- ticket.body -%]

Thankyou", 'email' ); } ); say $out "Added new notice 'TICKET_ACKNOWLEDGE'"; @@ -97,7 +97,7 @@ return { $dbh->do( q{ INSERT IGNORE INTO letter(module,code,branchcode,name,is_html,title,content,message_transport_type) - VALUES ( 'catalogue', 'TICKET_UPDATE', '', 'Concern updated', '1', 'Catalog concern updated', "Dear [% INCLUDE 'patron-title.inc' patron => ticket_update.ticket.reporter %],

The library has added an update to the concern you reported against [% INCLUDE 'biblio-title.inc' biblio=ticket_update.ticket.biblio link = 0 %].

The following comment was left:
[% ticket_update.message %]

Thankyou", 'email' ); + VALUES ( 'catalogue', 'TICKET_UPDATE', '', 'Concern updated', '1', 'Catalog concern updated', "Dear [%- INCLUDE 'patron-title.inc' patron => ticket_update.ticket.reporter -%],

The library has added an update to the concern you reported against [%- INCLUDE 'biblio-title.inc' biblio=ticket_update.ticket.biblio link = 0 -%].

The following comment was left:
[%- ticket_update.message -%]

Thankyou", 'email' ); } ); say $out "Added new notice 'TICKET_UPDATE'"; @@ -105,7 +105,7 @@ return { $dbh->do( q{ INSERT IGNORE INTO letter(module,code,branchcode,name,is_html,title,content,message_transport_type) - VALUES ( 'catalogue', 'TICKET_RESOLVE', '', 'Concern resolved', '1', 'Catalog concern resolved', "Dear [% INCLUDE 'patron-title.inc' patron => ticket_update.ticket.reporter %],

The library has now marked your concern with [% INCLUDE 'biblio-title.inc' biblio=ticket_update.ticket.biblio link = 0 %] as resolved.

The following comment was left:
[% ticket_update.message %]

Thankyou", 'email' ); + VALUES ( 'catalogue', 'TICKET_RESOLVE', '', 'Concern resolved', '1', 'Catalog concern resolved', "Dear [%- INCLUDE 'patron-title.inc' patron => ticket_update.ticket.reporter -%],

The library has now marked your concern with [%- INCLUDE 'biblio-title.inc' biblio=ticket_update.ticket.biblio link = 0 -%]as resolved.

The following comment was left:
[%- ticket_update.message -%]

Thankyou", 'email' ); } ); say $out "Added new notice 'TICKET_RESOLVE'"; @@ -121,7 +121,7 @@ return { $dbh->do( q{ INSERT IGNORE INTO letter(module,code,branchcode,name,is_html,title,content,message_transport_type) - VALUES ( 'catalogue', 'TICKET_NOTIFY', '', 'Catalog concern notification', '1', 'Catalog concern reported', "Dear cataloger,

[% INCLUDE 'patron-title.inc' patron => ticket.reporter %] reported the following concern with [% INCLUDE 'biblio-title.inc' biblio=ticket.biblio link = 1 %]

[% ticket.body %]

You can mark this concern as resolved from the concern management page.", 'email' ); + VALUES ( 'catalogue', 'TICKET_NOTIFY', '', 'Catalog concern notification', '1', 'Catalog concern reported', "[%- USE Koha -%]\r\nDear cataloger,

[%- INCLUDE 'patron-title.inc' patron => ticket.reporter -%]reported the following concern with [%- INCLUDE 'biblio-title.inc' biblio=ticket.biblio link = 1 -%]

[%- ticket.body -%]

You can mark this concern as resolved from the concern management page.", 'email' ); } ); say $out "Added new notice 'TICKET_NOTIFY'"; diff --git a/installer/data/mysql/en/mandatory/sample_notices.yml b/installer/data/mysql/en/mandatory/sample_notices.yml index 71344949ef4..0ca3a78e73d 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.yml +++ b/installer/data/mysql/en/mandatory/sample_notices.yml @@ -52,12 +52,12 @@ tables: message_transport_type: email lang: default content: - - "Dear [% INCLUDE 'patron-title.inc' patron => ticket.reporter %],
" + - "Dear [%- INCLUDE 'patron-title.inc' patron => ticket.reporter -%],
" - "
" - - "Thankyou for your report concerning [% INCLUDE 'biblio-title.inc' biblio=ticket.biblio link = 0 %].
" + - "Thankyou for your report concerning [%- INCLUDE 'biblio-title.inc' biblio=ticket.biblio link = 0 -%].
" - "
" - "You reported:
" - - "[% ticket.body %]
" + - "[%- ticket.body -%]
" - "
" - "Thankyou" @@ -70,12 +70,12 @@ tables: message_transport_type: email lang: default content: - - "Dear [% INCLUDE 'patron-title.inc' patron => ticket_update.ticket.reporter %],
" + - "Dear [%- INCLUDE 'patron-title.inc' patron => ticket_update.ticket.reporter -%],
" - "
" - - "The library has now marked your concern with [% INCLUDE 'biblio-title.inc' biblio=ticket_update.ticket.biblio link = 0 %] as resolved.
" + - "The library has now marked your concern with [%- INCLUDE 'biblio-title.inc' biblio=ticket_update.ticket.biblio link = 0 -%] as resolved.
" - "
" - "The following comment was left:
" - - "[% ticket_update.message %]
" + - "[%- ticket_update.message -%]
" - "
" - "Thankyou" @@ -88,12 +88,12 @@ tables: message_transport_type: email lang: default content: - - "Dear [% INCLUDE 'patron-title.inc' patron => ticket_update.ticket.reporter %],
" + - "Dear [%- INCLUDE 'patron-title.inc' patron => ticket_update.ticket.reporter -%],
" - "
" - - "The library has added an update to the concern you reported against [% INCLUDE 'biblio-title.inc' biblio=ticket_update.ticket.biblio link = 0 %].
" + - "The library has added an update to the concern you reported against [%- INCLUDE 'biblio-title.inc' biblio=ticket_update.ticket.biblio link = 0 -%].
" - "
" - "The following comment was left:
" - - "[% ticket_update.message %]
" + - "[%- ticket_update.message -%]
" - "
" - "Thankyou" @@ -106,12 +106,13 @@ tables: message_transport_type: email lang: default content: + - "[%- USE Koha -%]" - "Dear cataloger,
" - - "[% INCLUDE 'patron-title.inc' patron => ticket.reporter %] reported the following concern with [% INCLUDE 'biblio-title.inc' biblio=ticket.biblio link = 1 %]
" + - "[%- INCLUDE 'patron-title.inc' patron => ticket.reporter -%] reported the following concern with [%- INCLUDE 'biblio-title.inc' biblio=ticket.biblio link = 1 -%]
" - "
" - - "[% ticket.body %]
" + - "[%- ticket.body -%]
" - "
" - - "You can mark this concern as resolved from the concern management page." + - "You can mark this concern as resolved from the concern management page." - module: circulation code: ACCOUNT_CREDIT -- 2.39.1