From 0d1ca63aada1c471baabb7d55d3963895e819921 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 16 Mar 2020 18:46:22 +0100 Subject: [PATCH] Bug 23590: Create a separate template notice NOTIFY_MANAGER To separate the two feature we want to create a distinct template notice. A new NOTIFY_MANAGER notice is added. A follow-up patch will be added for other languages, when this one will be approved by QA. Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- .../data/mysql/atomicupdate/bug_23590.perl | 5 +++++ .../data/mysql/en/mandatory/sample_notices.yml | 17 +++++++++++++++++ .../prog/en/modules/suggestion/suggestion.tt | 2 +- suggestion/suggestion.pl | 2 +- 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_23590.perl b/installer/data/mysql/atomicupdate/bug_23590.perl index cc80154a4a..9ca122086e 100644 --- a/installer/data/mysql/atomicupdate/bug_23590.perl +++ b/installer/data/mysql/atomicupdate/bug_23590.perl @@ -35,8 +35,13 @@ if( CheckVersion( $DBversion ) ) { WHERE suggestionid = ? |, undef, $max_date, $last_modif_by, $suggestion->{suggestionid}); } + } + $dbh->do( q| + INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('suggestions', 'NOTIFY_MANAGER', '', 'Notify manager of a suggestion', 0, "A suggestion has been assigned to you", "Dear [% borrower.firstname %] [% borrower.surname %],\nA suggestion has been assigned to you: [% suggestion.title %].\nThank you,\n[% branch.branchname %]", 'email', 'default'); + | ); + # Always end with this (adjust the bug info) SetVersion( $DBversion ); print "Upgrade to $DBversion done (Bug 23590 - Add lastmodificationby and lastmodificationdate to the suggestions table)\n"; diff --git a/installer/data/mysql/en/mandatory/sample_notices.yml b/installer/data/mysql/en/mandatory/sample_notices.yml index a2b7dec89b..a378e4d370 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.yml +++ b/installer/data/mysql/en/mandatory/sample_notices.yml @@ -1145,3 +1145,20 @@ tables: - "Thank you," - "" - "<>" + + - module: suggestions + code: NOTIFY_MANAGER + branchcode: "" + name: "Notify manager of a suggestion" + is_html: 0 + title: "A suggestion has been assigned to you" + message_transport_type: email + lang: default + content: + - "Dear [% borrower.firstname %] [% borrowers.surname %]," + - "" + - "A new suggestion has been assigned to you: [% suggestion.title %]." + - "" + - "Thank you," + - "" + - "[% branch.branchname %]" diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt index 0a6e34245b..78ed07ff66 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt @@ -418,7 +418,7 @@
- + diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl index 64d7610ea0..6a80310a92 100755 --- a/suggestion/suggestion.pl +++ b/suggestion/suggestion.pl @@ -180,7 +180,7 @@ if ( $op =~ /save/i ) { my $letter = C4::Letters::GetPreparedLetter( module => 'suggestions', - letter_code => 'TO_PROCESS', + letter_code => 'NOTIFY_MANAGER', branchcode => $patron->branchcode, lang => $patron->lang, tables => { -- 2.39.5