From 00352921b26382d14ea23f1e8438b0402dc4ebf5 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 13 Mar 2014 09:30:22 +0100 Subject: [PATCH] Bug 9016: FIX letter name is not displayed on editing a letter Content-Type: text/plain; charset=utf-8 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 --- .../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 92c3421..6d5fc4e 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 2371218..30ce3d2 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; } -- 1.7.7.6