From 8987839040fc09ba34f30b1e9e88c44bff6241bb 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 --- .../intranet-tmpl/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 7c68f22..cfda11c 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 66d78be..4fcd8a8 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.1.0