From b5d4d0979f1e797faf9bca640eb8d99ef232924f Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 1 Oct 2020 13:40:41 +0100 Subject: [PATCH] Bug 21883: Pass the item to the template This patch update the controller to pass a full item object to the template instead of a subset of item fields and updates the template to utilise the object. Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart (cherry picked from commit 00dfcfcbe8c2f974dd3fe0939fcf8a8087c18dbd) Signed-off-by: Fridolin Somers --- circ/returns.pl | 6 +----- .../prog/en/modules/circ/returns.tt | 16 ++++++++-------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/circ/returns.pl b/circ/returns.pl index 4219672ecd..db0a52a322 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -268,17 +268,13 @@ if ($barcode) { my $biblio = $item->biblio; $template->param( title => $biblio->title, - homebranch => $item->homebranch, - holdingbranch => $item->holdingbranch, returnbranch => $returnbranch, author => $biblio->author, - itembarcode => $item->barcode, - itemtype => $item->effective_itemtype, - ccode => $item->ccode, itembiblionumber => $biblio->biblionumber, biblionumber => $biblio->biblionumber, additional_materials => $materials, issue => $checkout, + item => $item, ); } # FIXME else we should not call AddReturn but set BadBarcode directly instead diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt index b5ed06a319..a45776e9c5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -127,7 +127,7 @@ [% IF ( collectionItemNeedsTransferred ) %]

Please transfer item to: [% Branches.GetName( collectionBranch ) | html %]

-

[% itembarcode | html %]: [% title | html %]

+

[% item.barcode | html %]: [% title | html %]

This item is part of a rotating collection.

@@ -188,7 +188,7 @@

Check in message

[% IF itembiblionumber %] -

[% itembarcode | html %]: [% title | html %]

+

[% item.barcode | html %]: [% title | html %]

[% END %] [% FOREACH errmsgloo IN errmsgloop %] [% IF ( errmsgloo.NotForLoanStatusUpdated ) %] @@ -327,7 +327,7 @@