Bugzilla – Attachment 138816 Details for
Bug 31308
Remove GetItemsInfo from basket/basket
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31308: Remove GetItemsInfo from basket/basket
Bug-31308-Remove-GetItemsInfo-from-basketbasket.patch (text/plain), 5.59 KB, created by
Jonathan Druart
on 2022-08-08 14:45:17 UTC
(
hide
)
Description:
Bug 31308: Remove GetItemsInfo from basket/basket
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-08-08 14:45:17 UTC
Size:
5.59 KB
patch
obsolete
>From a36737e299bfb5144e6a6ceca25ca3169f953487 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 2 Jun 2022 11:31:38 +0200 >Subject: [PATCH] Bug 31308: Remove GetItemsInfo from basket/basket > >Bug 27272 is going to remove C4::Items::GetItemsInfo in favour of Koha::Items->search_ordered. > >Here we are going to deal with basket/basket.pl > >Test plan: >List items on the modified view and confirm that all the info is >displayed correctly >--- > basket/basket.pl | 24 ++++++------------- > .../prog/en/modules/basket/basket.tt | 16 +++++++++---- > 2 files changed, 18 insertions(+), 22 deletions(-) > >diff --git a/basket/basket.pl b/basket/basket.pl >index 6f93e5a82b8..88a5bd5dae5 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,26 +71,17 @@ 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; >@@ -99,7 +89,7 @@ foreach my $biblionumber ( @bibs ) { > > $num++; > $dat->{biblionumber} = $biblionumber; >- $dat->{ITEM_RESULTS} = \@items; >+ $dat->{ITEM_RESULTS} = $biblio->items->search_ordered; > $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..86cce455c20 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 %] > <p class="cart-controls"> >@@ -220,11 +222,13 @@ > <tr> > <th scope="row">Location(s)</th> > <td> >- [% IF ( BIBLIO_RESULT.ITEM_RESULTS ) %] >+ [% IF BIBLIO_RESULT.ITEM_RESULTS %] > [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %] > <p> >- [% ITEM_RESULT.branchname | html %] >- <span class="shelvingloc">[% ITEM_RESULT.location_description | html %]</span> >+ [% Branches.GetName(ITEM_RESULT.holdingbranch) | html %] >+ <span class="shelvingloc"> >+ [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_RESULT.location ) | html %] >+ </span> > [% IF ( ITEM_RESULT.itemcallnumber ) %] > ([% ITEM_RESULT.itemcallnumber | html %]) > [% END %] >@@ -293,8 +297,10 @@ > <strong> > <span class="callnumber">[% ITEM_RESULT.itemcallnumber | html %]</span> > </strong> >- [% ITEM_RESULT.branchname | html %] >- <span class="shelvingloc">[% ITEM_RESULT.location_description | html %]</span> >+ [% Branches.GetName(ITEM_RESULT.holdingbranch) | html %] >+ <span class="shelvingloc"> >+ [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_RESULT.location ) | html %] >+ </span> > </span> > </div> > [% END %] >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 31308
:
138816
|
138841
|
138977
|
138978