From ac4c8e1582cf5dd54e8ec4bf5ec0fe55abb9598d Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 11 Apr 2022 15:13:49 +0100 Subject: [PATCH] Bug 30237: (follow-up) Make LibraryName conditional It's easy to forget to set the LibraryName preference.. as such we can make this a conditional and fall back to a default of 'the library'. --- installer/data/mysql/atomicupdate/bug_30237.pl | 2 +- installer/data/mysql/en/mandatory/sample_notices.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_30237.pl b/installer/data/mysql/atomicupdate/bug_30237.pl index 4c92eb164b..d05aed7386 100755 --- a/installer/data/mysql/atomicupdate/bug_30237.pl +++ b/installer/data/mysql/atomicupdate/bug_30237.pl @@ -8,7 +8,7 @@ return { my ($dbh, $out) = @$args{qw(dbh out)}; # Add WELCOME notice $dbh->do( q{ - INSERT IGNORE INTO letter (module, code, name, is_html, title, content, message_transport_type) VALUES ('members', 'WELCOME', 'Welcome notice', 1, "[% USE Koha %]Welcome to [% Koha.Preference('LibraryName') %]", "[% USE Koha %]\r\nHello [% borrower.title %] [% borrower.firstname %] [% borrower.surname %].\r\n\r\nThank you for joining [% Koha.Preference('LibraryName') %]\r\n\r\nYou can search for all our materials in our catalog.\r\n\r\nYour library card number is [% borrower.cardnumber %]\r\n\r\nIf you have any problems or questions regarding your account, please contact the library.", 'email');}); + INSERT IGNORE INTO letter (module, code, name, is_html, title, content, message_transport_type) VALUES ('members', 'WELCOME', 'Welcome notice', 1, "[% USE Koha %]Welcome to [% IF Koha.Preference('LibraryName') %][% Koha.Preference('LibraryName') %][% ELSE %]the library[% END %]", "[% USE Koha %]\r\nHello [% borrower.title %] [% borrower.firstname %] [% borrower.surname %].\r\n\r\nThank you for joining [% IF Koha.Preference('LibraryName') %][% Koha.Preference('LibraryName') %][% ELSE %]the library[% END %]\r\n\r\nYou can search for all our materials in our catalog.\r\n\r\nYour library card number is [% borrower.cardnumber %]\r\n\r\nIf you have any problems or questions regarding your account, please contact the library.", 'email');}); # Update system preference $dbh->do( q{ diff --git a/installer/data/mysql/en/mandatory/sample_notices.yml b/installer/data/mysql/en/mandatory/sample_notices.yml index 99fe795dd3..b4fe775cc5 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.yml +++ b/installer/data/mysql/en/mandatory/sample_notices.yml @@ -1068,14 +1068,14 @@ tables: branchcode: "" name: "Welcome notice " is_html: 1 - title: "[% USE Koha %]Welcome to [% Koha.Preference('LibraryName') %]" + title: "[% USE Koha %][% IF Koha.Preference('LibraryName') %]Welcome to [% Koha.Preference('LibraryName') %][% ELSE %]Welcome to the library[% END %]" message_transport_type: email lang: default content: - "[% USE Koha %]" - "Hello [% borrower.title %] [% borrower.firstname %] [% borrower.surname %]." - "" - - "Thankyou for joining [% Koha.Preference('LibraryName') %]" + - "Thankyou for joining [% IF Koha.Preference('LibraryName') %][% Koha.Preference('LibraryName') %][% ELSE %]the library[% END %]" - "" - "You can search for all our materials in our catalog." - "" -- 2.20.1