Bug 9016: (follow-up) letter name is not displayed on editing a letter
authorJonathan Druart <jonathan.druart@biblibre.com>
Thu, 13 Mar 2014 08:30:22 +0000 (09:30 +0100)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 2 May 2014 20:29:18 +0000 (20:29 +0000)
On editing a letter, the letter name is not displayed. So if you save
it, the letter name is erased with an empty string.

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Tested by setting the "Name"-field in letter.pl, saving, re-editing and verifying
that the email is present in the letter's "Name"-field.
The letter "Name" is replicated for each template in the DB, but that doesn't
incur any performance penalty.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt
tools/letter.pl

index 144c2e6..aeea068 100644 (file)
@@ -286,7 +286,7 @@ $(document).ready(function() {
                                <span class="label">Code:</span>[% IF ( adding ) %]<input type="text" id="code" name="code" size="20" maxlength="20" />[% ELSE %]<input type="hidden" id="code" name="code" value="[% code %]" />[% code %][% END %]
                        </li>
                <li>
-                       <label for="name">Name:</label><input type="text" id="name" name="name" size="60" value="[% name %]" />
+            <label for="name">Name:</label><input type="text" id="name" name="name" size="60" value="[% letter_name %]" />
                </li>
 
         [% FOREACH letter IN letters %]
index 2371218..30ce3d2 100755 (executable)
@@ -166,14 +166,19 @@ sub add_form {
     my $message_transport_types = GetMessageTransportTypes();
     my @letter_loop;
     if ($letters) {
+        $template->param(
+            modify     => 1,
+            code       => $code,
+            branchcode => $branchcode,
+        );
         my $first_flag = 1;
+        # The letter name is contained into each mtt row.
+        # So we can only sent the first one to the template.
         for my $mtt ( @$message_transport_types ) {
+            # The letter_name
             if ( $first_flag ) {
                 $template->param(
-                    modify     => 1,
-                    code       => $code,
-                    branchcode => $branchcode,
-                    name       => $letters->{$mtt}{name},
+                    letter_name=> $letters->{$mtt}{name},
                 );
                 $first_flag = 0;
             }