From 6ef2a5393c356e9253d5fd824d70be03e36e966d Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 15 Feb 2023 16:38:17 +0000 Subject: [PATCH] Bug 31028: (follow-up) Move html_helpers into notices This patch removes the addition of html_helpers out of C4::Letters and into the relevant notice templates where it belongs. Signed-off-by: Martin Renvoize Signed-off-by: Kyle M Hall --- C4/Letters.pm | 2 +- installer/data/mysql/atomicupdate/bug_31028.pl | 8 ++++---- installer/data/mysql/en/mandatory/sample_notices.yml | 4 ++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index 4233890dfa..218bb01b45 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -1617,7 +1617,7 @@ sub _process_tt { my $tt_params = { %{ _get_tt_params( $tables ) }, %{ _get_tt_params( $loops, 'is_a_loop' ) }, %$substitute, %$objects }; $content = add_tt_filters( $content ); - $content = qq|[% USE KohaDates %][% USE Remove_MARC_punctuation %][% PROCESS 'html_helpers.inc' %]$content|; + $content = qq|[% USE KohaDates %][% USE Remove_MARC_punctuation %]$content|; my $output; my $schema = Koha::Database->new->schema; diff --git a/installer/data/mysql/atomicupdate/bug_31028.pl b/installer/data/mysql/atomicupdate/bug_31028.pl index efb46cfc18..138f06089c 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', "[%- PROCESS 'html_helpers.inc' -%]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', "[%- PROCESS 'html_helpers.inc' -%]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', "[%- PROCESS 'html_helpers.inc' -%]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', "[%- 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' ); + VALUES ( 'catalogue', 'TICKET_NOTIFY', '', 'Catalog concern notification', '1', 'Catalog concern reported', "[%- USE Koha -%][%- PROCESS 'html_helpers.inc' -%]\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 0ca3a78e73..f4021d91d2 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.yml +++ b/installer/data/mysql/en/mandatory/sample_notices.yml @@ -52,6 +52,7 @@ tables: message_transport_type: email lang: default content: + - "[%- PROCESS 'html_helpers.inc' -%]" - "Dear [%- INCLUDE 'patron-title.inc' patron => ticket.reporter -%],
" - "
" - "Thankyou for your report concerning [%- INCLUDE 'biblio-title.inc' biblio=ticket.biblio link = 0 -%].
" @@ -70,6 +71,7 @@ tables: message_transport_type: email lang: default content: + - "[%- PROCESS 'html_helpers.inc' -%]" - "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.
" @@ -88,6 +90,7 @@ tables: message_transport_type: email lang: default content: + - "[%- PROCESS 'html_helpers.inc' -%]" - "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 -%].
" @@ -106,6 +109,7 @@ tables: message_transport_type: email lang: default content: + - "[%- PROCESS 'html_helpers.inc' -%]" - "[%- 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 -%]
" -- 2.30.2