From 369dac97fe6e9d545a8c3a09ddb68fabd08ce4d7 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 2 Jun 2022 11:31:38 +0200 Subject: [PATCH] Bug 27272: basket/basket --- basket/basket.pl | 25 ++++++------------- .../prog/en/modules/basket/basket.tt | 22 ++++++++-------- 2 files changed, 20 insertions(+), 27 deletions(-) diff --git a/basket/basket.pl b/basket/basket.pl index 975455511a6..ad34369d44a 100755 --- a/basket/basket.pl +++ b/basket/basket.pl @@ -24,7 +24,6 @@ use C4::Biblio qw( GetMarcSubjects GetMarcUrls ); -use C4::Items qw( GetItemsInfo ); use C4::Auth qw( get_template_and_user ); use C4::Output qw( output_html_with_http_headers ); @@ -72,34 +71,26 @@ foreach my $biblionumber ( @bibs ) { my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); my $marcseriesarray = GetMarcSeries ($record,$marcflavour); my $marcurlsarray = GetMarcUrls ($record,$marcflavour); - my @items = GetItemsInfo( $biblionumber ); my $hasauthors = 0; if($dat->{'author'} || @$marcauthorsarray) { $hasauthors = 1; } - - my $shelflocations = - { map { $_->{authorised_value} => $_->{lib} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => $dat->{frameworkcode}, kohafield => 'items.location' } ) }; - - for my $itm (@items) { - if ($itm->{'location'}){ - $itm->{'location_description'} = $shelflocations->{$itm->{'location'} }; - } - } - # COinS format FIXME: for books Only - my $fmt = substr $record->leader(), 6,2; - my $fmts; - $fmts->{'am'} = 'book'; - $dat->{ocoins_format} = $fmts->{$fmt}; + + # COinS format FIXME: for books Only + my $fmt = substr $record->leader(), 6,2; + my $fmts; + $fmts->{'am'} = 'book'; + $dat->{ocoins_format} = $fmts->{$fmt}; if ( $num % 2 == 1 ) { $dat->{'even'} = 1; } + my $biblio = Koha::Biblios->find($biblionumber); $num++; $dat->{biblionumber} = $biblionumber; - $dat->{ITEM_RESULTS} = \@items; + $dat->{ITEM_RESULTS} = $biblio->items; $dat->{MARCNOTES} = $marcnotesarray; $dat->{MARCSUBJCTS} = $marcsubjctsarray; $dat->{MARCAUTHORS} = $marcauthorsarray; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt index 5c62dad4f19..8aec47adb32 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt @@ -1,5 +1,7 @@ [% USE raw %] [% USE Asset %] +[% USE AuthorisedValues %] +[% USE Branches %] [% SET footerjs = 1 %] [% BLOCK controls %]

@@ -220,16 +222,16 @@ Location(s) - [% IF ( BIBLIO_RESULT.ITEM_RESULTS ) %] - [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %] -

- [% ITEM_RESULT.branchname | html %] - [% ITEM_RESULT.location_description | html %] - [% IF ( ITEM_RESULT.itemcallnumber ) %] - ([% ITEM_RESULT.itemcallnumber | html %]) - [% END %] -

- [% END %] + [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %] +

+ [% Branches.GetName(ITEM_RESULT.holdingbranch) | html %] + + [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %] + + [% IF ( ITEM_RESULT.itemcallnumber ) %] + ([% ITEM_RESULT.itemcallnumber | html %]) + [% END %] +

[% ELSE %] This record has no items. [% END %] -- 2.25.1