From b717e3d2df4c68947b4273f6e1716b1f1f1e5b6b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 13 Mar 2014 09:30:22 +0100 Subject: [PATCH] Bug 9016: (follow-up) letter name is not displayed on editing a letter 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 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 Signed-off-by: Galen Charlton --- .../intranet-tmpl/prog/en/modules/tools/letter.tt | 2 +- tools/letter.pl | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt index 144c2e656a..aeea068966 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt @@ -286,7 +286,7 @@ $(document).ready(function() { Code:[% IF ( adding ) %][% ELSE %][% code %][% END %]
  • - +
  • [% FOREACH letter IN letters %] diff --git a/tools/letter.pl b/tools/letter.pl index 237121897f..30ce3d2872 100755 --- a/tools/letter.pl +++ b/tools/letter.pl @@ -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; } -- 2.39.5