From 6880d93e7bccfe26479012aa9ab39305627225be Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Wed, 24 Jun 2020 17:05:30 +0200 Subject: [PATCH] Bug 25868 : Fix tansfers page to show effective itemtype In transfers page /cgi-bin/koha/circ/branchtransfers.pl : Itemtype is always from biblioitems.itemtype, regardless of system preference item-level_itypes. Patch also changes template to use the object Koha::Item. Patch also fixes a small typo : closed
tag. Test plan : 1) Test with both values of system preference 'item-level_itypes' 2) Go to Circulation > Transfert 3) Enter a barcode 4) Enter another barcode 5) Check you see in table all datas and that 'Item type' is correct --- circ/branchtransfers.pl | 44 +++++-------------- .../prog/en/modules/circ/branchtransfers.tt | 28 +++++++----- 2 files changed, 28 insertions(+), 44 deletions(-) diff --git a/circ/branchtransfers.pl b/circ/branchtransfers.pl index 4ed1fb3c34..8cd01d58bd 100755 --- a/circ/branchtransfers.pl +++ b/circ/branchtransfers.pl @@ -131,50 +131,30 @@ if ($barcode) { my $item = Koha::Items->find({ barcode => $barcode }); $found = $messages->{'ResFound'}; if ($transferred) { - my %item; - my $biblio = $item->biblio; + my %trsfitem; my $frbranchcd = C4::Context->userenv->{'branch'}; - $item{'biblionumber'} = $item->biblionumber; - $item{'itemnumber'} = $item->itemnumber; - $item{'title'} = $biblio->title; - $item{'author'} = $biblio->author; - $item{'itemtype'} = $biblio->biblioitem->itemtype; - $item{'ccode'} = $item->ccode; - $item{'itemcallnumber'} = $item->itemcallnumber; - my $av = Koha::AuthorisedValues->search({ category => 'LOC', authorised_value => $item->location }); - $item{'location'} = $av->count ? $av->next->lib : ''; - $item{counter} = 0; - $item{barcode} = $barcode; - $item{frombrcd} = $frbranchcd; - $item{tobrcd} = $tobranchcd; - push( @trsfitemloop, \%item ); + $trsfitem{item} = $item; + $trsfitem{counter} = 0; + $trsfitem{frombrcd} = $frbranchcd; + $trsfitem{tobrcd} = $tobranchcd; + push( @trsfitemloop, \%trsfitem ); } } foreach ( $query->param ) { (next) unless (/bc-(\d*)/); my $counter = $1; - my %item; + my %trsfitem; my $bc = $query->param("bc-$counter"); my $frbcd = $query->param("fb-$counter"); my $tobcd = $query->param("tb-$counter"); $counter++; - $item{counter} = $counter; - $item{barcode} = $bc; - $item{frombrcd} = $frbcd; - $item{tobrcd} = $tobcd; + $trsfitem{counter} = $counter; + $trsfitem{frombrcd} = $frbcd; + $trsfitem{tobrcd} = $tobcd; my $item = Koha::Items->find({ barcode => $bc }); - my $biblio = $item->biblio; - $item{'biblionumber'} = $item->biblionumber; - $item{'itemnumber'} = $item->itemnumber; - $item{'title'} = $biblio->title; - $item{'author'} = $biblio->author; - $item{'itemtype'} = $biblio->biblioitem->itemtype; - $item{'ccode'} = $item->ccode; - $item{'itemcallnumber'} = $item->itemcallnumber; - my $av = Koha::AuthorisedValues->search({ category => 'LOC', authorised_value => $item->location }); - $item{'location'} = $av->count ? $av->next->lib : ''; - push( @trsfitemloop, \%item ); + $trsfitem{item} = $item; + push( @trsfitemloop, \%trsfitem ); } my $itemnumber; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt index 9b3f6a2793..5eb69ed385 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt @@ -40,7 +40,7 @@ [% FOREACH trsfitemloo IN trsfitemloop %] - + [% END %] @@ -65,7 +65,7 @@ [% FOREACH trsfitemloo IN trsfitemloop %] - + [% END %] @@ -82,11 +82,11 @@ Ignore and return to transfers: - + [% FOREACH trsfitemloo IN trsfitemloop %] - + [% END %] @@ -164,7 +164,7 @@ [% FOREACH trsfitemloo IN trsfitemloop %] - + [% END %] @@ -186,13 +186,17 @@ [% FOREACH trsfitemloo IN trsfitemloop %] - [% trsfitemloo.title | html %] - [% trsfitemloo.author | html %] - [% trsfitemloo.barcode | html %] - [% trsfitemloo.location | html %] - [% trsfitemloo.itemcallnumber | html %] - [% ItemTypes.GetDescription( trsfitemloo.itemtype ) | html %] - [% AuthorisedValues.GetByCode( 'CCODE', trsfitemloo.ccode ) | html %] + + [% INCLUDE 'biblio-default-view.inc' biblionumber = trsfitemloo.item.biblionumber %] + [% INCLUDE 'biblio-title.inc' biblio=trsfitemloo.item.biblio %] + + + [% trsfitemloo.item.biblio.author | html %] + [% trsfitemloo.item.barcode | html %] + [% AuthorisedValues.GetByCode( 'LOC', trsfitemloo.item.location ) | html %] + [% trsfitemloo.item.itemcallnumber | html %] + [% ItemTypes.GetDescription( trsfitemloo.item.effective_itemtype ) | html %] + [% AuthorisedValues.GetByCode( 'CCODE', trsfitemloo.item.ccode ) | html %] [% Branches.GetName( trsfitemloo.tobrcd ) | html %] [% END %] -- 2.27.0