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 Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
89f2f369a6
commit
62667dbb91
2 changed files with 17 additions and 21 deletions
|
@ -24,7 +24,6 @@ use C4::Biblio qw(
|
||||||
GetMarcSubjects
|
GetMarcSubjects
|
||||||
GetMarcUrls
|
GetMarcUrls
|
||||||
);
|
);
|
||||||
use C4::Items qw( GetItemsInfo );
|
|
||||||
use C4::Auth qw( get_template_and_user );
|
use C4::Auth qw( get_template_and_user );
|
||||||
use C4::Output qw( output_html_with_http_headers );
|
use C4::Output qw( output_html_with_http_headers );
|
||||||
|
|
||||||
|
@ -72,26 +71,17 @@ foreach my $biblionumber ( @bibs ) {
|
||||||
my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
|
my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
|
||||||
my $marcseriesarray = GetMarcSeries ($record,$marcflavour);
|
my $marcseriesarray = GetMarcSeries ($record,$marcflavour);
|
||||||
my $marcurlsarray = GetMarcUrls ($record,$marcflavour);
|
my $marcurlsarray = GetMarcUrls ($record,$marcflavour);
|
||||||
my @items = GetItemsInfo( $biblionumber );
|
|
||||||
|
|
||||||
my $hasauthors = 0;
|
my $hasauthors = 0;
|
||||||
if($dat->{'author'} || @$marcauthorsarray) {
|
if($dat->{'author'} || @$marcauthorsarray) {
|
||||||
$hasauthors = 1;
|
$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) {
|
# COinS format FIXME: for books Only
|
||||||
if ($itm->{'location'}){
|
my $fmt = substr $record->leader(), 6,2;
|
||||||
$itm->{'location_description'} = $shelflocations->{$itm->{'location'} };
|
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 ) {
|
if ( $num % 2 == 1 ) {
|
||||||
$dat->{'even'} = 1;
|
$dat->{'even'} = 1;
|
||||||
|
@ -99,7 +89,7 @@ foreach my $biblionumber ( @bibs ) {
|
||||||
|
|
||||||
$num++;
|
$num++;
|
||||||
$dat->{biblionumber} = $biblionumber;
|
$dat->{biblionumber} = $biblionumber;
|
||||||
$dat->{ITEM_RESULTS} = \@items;
|
$dat->{ITEM_RESULTS} = $biblio->items->search_ordered;
|
||||||
$dat->{MARCNOTES} = $marcnotesarray;
|
$dat->{MARCNOTES} = $marcnotesarray;
|
||||||
$dat->{MARCSUBJCTS} = $marcsubjctsarray;
|
$dat->{MARCSUBJCTS} = $marcsubjctsarray;
|
||||||
$dat->{MARCAUTHORS} = $marcauthorsarray;
|
$dat->{MARCAUTHORS} = $marcauthorsarray;
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
[% USE raw %]
|
[% USE raw %]
|
||||||
[% USE Asset %]
|
[% USE Asset %]
|
||||||
|
[% USE AuthorisedValues %]
|
||||||
|
[% USE Branches %]
|
||||||
[% SET footerjs = 1 %]
|
[% SET footerjs = 1 %]
|
||||||
[% BLOCK controls %]
|
[% BLOCK controls %]
|
||||||
<p class="cart-controls">
|
<p class="cart-controls">
|
||||||
|
@ -220,11 +222,13 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">Location(s)</th>
|
<th scope="row">Location(s)</th>
|
||||||
<td>
|
<td>
|
||||||
[% IF ( BIBLIO_RESULT.ITEM_RESULTS ) %]
|
[% IF BIBLIO_RESULT.ITEM_RESULTS %]
|
||||||
[% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
|
[% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
|
||||||
<p>
|
<p>
|
||||||
[% ITEM_RESULT.branchname | html %]
|
[% Branches.GetName(ITEM_RESULT.holdingbranch) | html %]
|
||||||
<span class="shelvingloc">[% ITEM_RESULT.location_description | html %]</span>
|
<span class="shelvingloc">
|
||||||
|
[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_RESULT.location ) | html %]
|
||||||
|
</span>
|
||||||
[% IF ( ITEM_RESULT.itemcallnumber ) %]
|
[% IF ( ITEM_RESULT.itemcallnumber ) %]
|
||||||
([% ITEM_RESULT.itemcallnumber | html %])
|
([% ITEM_RESULT.itemcallnumber | html %])
|
||||||
[% END %]
|
[% END %]
|
||||||
|
@ -293,8 +297,10 @@
|
||||||
<strong>
|
<strong>
|
||||||
<span class="callnumber">[% ITEM_RESULT.itemcallnumber | html %]</span>
|
<span class="callnumber">[% ITEM_RESULT.itemcallnumber | html %]</span>
|
||||||
</strong>
|
</strong>
|
||||||
[% ITEM_RESULT.branchname | html %]
|
[% Branches.GetName(ITEM_RESULT.holdingbranch) | html %]
|
||||||
<span class="shelvingloc">[% ITEM_RESULT.location_description | html %]</span>
|
<span class="shelvingloc">
|
||||||
|
[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_RESULT.location ) | html %]
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
Loading…
Reference in a new issue