From a5998603f346543480220bb1f2b4bcdc9044a883 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 21 Nov 2014 10:28:02 +0100 Subject: [PATCH] Bug 13215: Fix notice deletion This patch could have only been - name => $values[0]->{name}, + name => $letter->{name}, Other changes are just indentation and variable names (send an hashref $letter to the template and use the Branches TT plugin to display the branch name) Signed-off-by: Chris Cormack Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- .../prog/en/modules/tools/letter.tt | 63 ++++++++++--------- tools/letter.pl | 6 +- 2 files changed, 33 insertions(+), 36 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 7c68f223a5..cfda11c552 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt @@ -1,4 +1,5 @@ [% USE Koha %] +[% USE Branches %] [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Notices[% IF ( add_form or copy_form ) %][% IF ( modify ) %] › Modify notice[% ELSE %] › Add notice[% END %][% END %][% IF ( add_validate or copy_validate) %] › Notice added[% END %][% IF ( delete_confirm ) %] › Confirm deletion[% END %] [% INCLUDE 'doc-head-close.inc' %] @@ -424,40 +425,40 @@ $(document).ready(function() { [% END %] - -[% IF ( delete_confirm ) %] -

Delete notice?

- - - - - - - - - - - - - - - -
LibraryModuleCodeName
[% branchname %][% module %][% code %][% name %]
-
- - - - - -
-
- -
-
+[% IF ( delete_confirm ) %] +
+

Delete notice?

+ + + + + + + + + + + + + + + +
LibraryModuleCodeName
[% Branches.GetName( letter.branchcode ) %][% letter.module %][% letter.code %][% letter.name %]
+
+ + + + + +
+
+ +
+
[% END %] - + [% IF ( delete_confirmed ) %] Data deleted
diff --git a/tools/letter.pl b/tools/letter.pl index 66d78be00a..4fcd8a8df2 100755 --- a/tools/letter.pl +++ b/tools/letter.pl @@ -289,11 +289,7 @@ sub delete_confirm { my $letter = C4::Letters::getletter($module, $code, $branchcode); my @values = values %$letter; $template->param( - branchcode => $branchcode, - branchname => GetBranchName($branchcode), - code => $code, - module => $module, - name => $values[0]->{name}, + letter => $letter, ); return; } -- 2.39.5