Bug 23590: Create a separate template notice NOTIFY_MANAGER
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 16 Mar 2020 17:46:22 +0000 (18:46 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 25 Mar 2020 09:35:46 +0000 (09:35 +0000)
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 <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

installer/data/mysql/atomicupdate/bug_23590.perl
installer/data/mysql/en/mandatory/sample_notices.yml
koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt
suggestion/suggestion.pl

index cc80154..9ca1220 100644 (file)
@@ -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";
index a2b7dec..a378e4d 100644 (file)
@@ -1145,3 +1145,20 @@ tables:
             - "Thank you,"
             - ""
             - "<<branches.branchname>>"
+
+        - 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 %]"
index 0a6e342..78ed07f 100644 (file)
 
                     <br/>
                     <label for="notify">Notify manager:</label>
-                    <input type="checkbox" id="notify" name="notify" value="notify" disabled="disabled" title="A TO_PROCESS notice will be generated and send to the manager if a valid email address is defined. This can be checked if a new manager has been selected." />
+                    <input type="checkbox" id="notify" name="notify" value="notify" disabled="disabled" title="A NOTIFY_MANAGER notice will be generated and send to the manager if a valid email address is defined. This can be checked if a new manager has been selected." />
                 </div>
             </li>
         </ol>
index 64d7610..6a80310 100755 (executable)
@@ -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      => {