Bug 31028: (follow-up) Move html_helpers into notices
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 15 Feb 2023 16:38:17 +0000 (16:38 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 6 Mar 2023 14:23:17 +0000 (11:23 -0300)
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 <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
C4/Letters.pm
installer/data/mysql/atomicupdate/bug_31028.pl
installer/data/mysql/en/mandatory/sample_notices.yml

index 2062674..10bfe1e 100644 (file)
@@ -1621,7 +1621,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;
index efb46cf..138f060 100644 (file)
@@ -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 -%],<br><br>Thankyou for your report concerning [%- INCLUDE 'biblio-title.inc' biblio=ticket.biblio link = 0 -%].<br><br>You reported: <br>[%- ticket.body -%]<br><br>Thankyou", 'email' );
+                VALUES ( 'catalogue', 'TICKET_ACKNOWLEDGE', '', 'Concern acknowledgement', '1', 'Catalog concern acknowledgement', "[%- PROCESS 'html_helpers.inc' -%]Dear [%- INCLUDE 'patron-title.inc' patron => ticket.reporter -%],<br><br>Thankyou for your report concerning [%- INCLUDE 'biblio-title.inc' biblio=ticket.biblio link = 0 -%].<br><br>You reported: <br>[%- ticket.body -%]<br><br>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 -%],<br><br>The library has added an update to the concern you reported against [%- INCLUDE 'biblio-title.inc' biblio=ticket_update.ticket.biblio link = 0 -%].<br><br>The following comment was left: <br>[%- ticket_update.message -%]<br><br>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 -%],<br><br>The library has added an update to the concern you reported against [%- INCLUDE 'biblio-title.inc' biblio=ticket_update.ticket.biblio link = 0 -%].<br><br>The following comment was left: <br>[%- ticket_update.message -%]<br><br>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 -%],<br><br>The library has now marked your concern with [%- INCLUDE 'biblio-title.inc' biblio=ticket_update.ticket.biblio link = 0 -%]as resolved.<br><br>The following comment was left:   <br>[%- ticket_update.message -%]<br><br>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 -%],<br><br>The library has now marked your concern with [%- INCLUDE 'biblio-title.inc' biblio=ticket_update.ticket.biblio link = 0 -%]as resolved.<br><br>The following comment was left:   <br>[%- ticket_update.message -%]<br><br>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,<br><br>[%- INCLUDE 'patron-title.inc' patron => ticket.reporter -%]reported the following concern with [%- INCLUDE 'biblio-title.inc' biblio=ticket.biblio link = 1 -%]<br><br>[%- ticket.body -%]<br><br>You can mark this concern as resolved from the concern management <a href='[%- Koha.Preference('IntranetBaseURL') -%]/cgi-bin/koha/cataloguing/concerns.pl'>page</a>.", 'email' );
+                VALUES ( 'catalogue', 'TICKET_NOTIFY', '', 'Catalog concern notification', '1', 'Catalog concern reported', "[%- USE Koha -%][%- PROCESS 'html_helpers.inc' -%]\r\nDear cataloger,<br><br>[%- INCLUDE 'patron-title.inc' patron => ticket.reporter -%]reported the following concern with [%- INCLUDE 'biblio-title.inc' biblio=ticket.biblio link = 1 -%]<br><br>[%- ticket.body -%]<br><br>You can mark this concern as resolved from the concern management <a href='[%- Koha.Preference('IntranetBaseURL') -%]/cgi-bin/koha/cataloguing/concerns.pl'>page</a>.", 'email' );
             }
         );
         say $out "Added new notice 'TICKET_NOTIFY'";
index 7760c91..b18824a 100644 (file)
@@ -52,6 +52,7 @@ tables:
           message_transport_type: email
           lang: default
           content:
+            - "[%- PROCESS 'html_helpers.inc' -%]"
             - "Dear [%- INCLUDE 'patron-title.inc' patron => ticket.reporter -%],<br>"
             - "<br>"
             - "Thankyou for your report concerning [%- INCLUDE 'biblio-title.inc' biblio=ticket.biblio link = 0 -%].<br>"
@@ -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 -%],<br>"
             - "<br>"
             - "The library has now marked your concern with [%- INCLUDE 'biblio-title.inc' biblio=ticket_update.ticket.biblio link = 0 -%] as resolved.<br>"
@@ -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 -%],<br>"
             - "<br>"
             - "The library has added an update to the concern you reported against [%- INCLUDE 'biblio-title.inc' biblio=ticket_update.ticket.biblio link = 0 -%].<br>"
@@ -106,6 +109,7 @@ tables:
           message_transport_type: email
           lang: default
           content:
+            - "[%- PROCESS 'html_helpers.inc' -%]"
             - "[%- USE Koha -%]"
             - "Dear cataloger,<br>"
             - "[%- INCLUDE 'patron-title.inc' patron => ticket.reporter -%] reported the following concern with [%- INCLUDE 'biblio-title.inc' biblio=ticket.biblio link = 1 -%]<br>"