diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt
index 4e6219c0bd..23d8c10f7c 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt
@@ -1,5 +1,7 @@
[% USE raw %]
[% USE Koha %]
+[% USE AuthorisedValues %]
+[% USE Branches %]
[% USE KohaDates %]
[% USE Asset %]
[% SET is_popup = 1 %]
@@ -241,12 +243,12 @@
[% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
-
- [% ITEM_RESULT.branchname | html %]
- [% IF ( ITEM_RESULT.location_opac ) %][% ITEM_RESULT.location_opac | html %][% END %]
+ [% Branches.GetName(ITEM_RESULT.holdingbranch) | html %]
+ [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_RESULT.location, opac => 1 ) | html %]
[% IF ( ITEM_RESULT.itemcallnumber ) %]
([% ITEM_RESULT.itemcallnumber | html %])
[% END %]
- ([% INCLUDE 'item-status.inc' item = ITEM_RESULT %])
+ ([% INCLUDE 'item-status.inc' item = ITEM_RESULT.item_object %])
[% END %]
@@ -303,8 +305,8 @@
[% IF ( BIBLIO_RESULT.ITEM_RESULTS ) %][% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
-
- [% ITEM_RESULT.branchname | html %]
- [% IF ( ITEM_RESULT.location_opac ) %][% ITEM_RESULT.location_opac | html %][% END %]
+ [% Branches.GetName(ITEM_RESULT.holdingbranch) | html %]
+ [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_RESULT.location, opac => 1 ) | html %]
[% IF ( ITEM_RESULT.itemcallnumber ) %]
([% ITEM_RESULT.itemcallnumber | html %])
[% END %]
diff --git a/opac/opac-basket.pl b/opac/opac-basket.pl
index 411ae6444c..d6b11acf4c 100755
--- a/opac/opac-basket.pl
+++ b/opac/opac-basket.pl
@@ -93,22 +93,10 @@ foreach my $biblionumber ( @bibs ) {
next
if $biblio->hidden_in_opac({ rules => $rules });
- # grab all the items...
- my $items = $biblio->items->filter_by_visible_in_opac({ patron => $logged_in_user })->unblessed;
- foreach my $item (@$items) {
- my $reserve_status = C4::Reserves::GetReserveStatus($item->{itemnumber});
- if( $reserve_status eq "Waiting"){ $item->{'waiting'} = 1; }
- if( $reserve_status eq "Processing"){ $item->{'processing'} = 1; }
- }
-
my $hasauthors = 0;
if($dat->{'author'} || @$marcauthorsarray) {
$hasauthors = 1;
}
- my $collections =
- { map { $_->{authorised_value} => $_->{opac_description} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => $dat->{frameworkcode}, kohafield => 'items.ccode' } ) };
- my $shelflocations =
- { map { $_->{authorised_value} => $_->{opac_description} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => $dat->{frameworkcode}, kohafield => 'items.location' } ) };
# COinS format FIXME: for books Only
my $fmt = substr $record->leader(), 6,2;
@@ -120,21 +108,9 @@ foreach my $biblionumber ( @bibs ) {
$dat->{'even'} = 1;
}
- for my $itm (@$items) {
- if ($itm->{'location'}){
- $itm->{'location_opac'} = $shelflocations->{$itm->{'location'} };
- }
- my $item_object = Koha::Items->find($itm->{itemnumber});
- my $transfer = $item_object->get_transfer;
- if ( $transfer && $transfer->in_transit ) {
- $itm->{transfertwhen} = $transfer->datesent;
- $itm->{transfertfrom} = $transfer->frombranch;
- $itm->{transfertto} = $transfer->tobranch;
- }
- }
$num++;
$dat->{biblionumber} = $biblionumber;
- $dat->{ITEM_RESULTS} = $items;
+ $dat->{ITEM_RESULTS} = $biblio->items->filter_by_visible_in_opac({ patron => $logged_in_user });
$dat->{MARCNOTES} = $marcnotesarray;
$dat->{MARCSUBJCTS} = $marcsubjctsarray;
$dat->{MARCAUTHORS} = $marcauthorsarray;
|