Bug 31320: Remove GetItemsInfo from virtualshelves/sendshelf.pl

And GetItemsLocationInfo from shelves.pl

Bug 27272 is going to remove C4::Items::GetItemsInfo in favour of Koha::Items->search_ordered.

Here we are going to deal with virtualshelves/sendshelf.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: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2022-06-03 08:33:00 +02:00 committed by Tomas Cohen Arazi
parent 7a56800131
commit 992078f494
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
4 changed files with 21 additions and 15 deletions

View file

@ -1,4 +1,6 @@
[% USE raw %]
[% USE AuthorisedValues %]
[% USE Branches %]
<SUBJECT>
Your list: [% shelfname | $raw %]
<END_SUBJECT>
@ -144,12 +146,12 @@ Your list: [% shelfname | $raw %]
In online catalog: [% OPACBaseURL | $raw %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber | html %]
</p>
[% END %]
[% IF ( BIBLIO_RESULT.ITEM_RESULTS.size ) %]
[% IF ( BIBLIO_RESULT.ITEM_RESULTS.count ) %]
<p>Items:
<ul>
[% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]<li>
[% ITEM_RESULT.branchname | $raw %]
[% ITEM_RESULT.location | $raw %]
[% Branches.GetName(ITEM_RESULT.holdingbranch) | $raw %]
[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_RESULT.location ) | html %]
[% IF ITEM_RESULT.itemcallnumber %]([% ITEM_RESULT.itemcallnumber | $raw %])[% END %]
[% ITEM_RESULT.barcode | $raw %]
</li>[% END %]

View file

@ -2,6 +2,8 @@
[% USE Asset %]
[% USE Koha %]
[% USE KohaDates %]
[% USE AuthorisedValues %]
[% USE Branches %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>
@ -315,7 +317,7 @@
[% IF ( itemsloo.notforloan ) %]
<span class="noholdstext">No holds allowed</span>
[% ELSE %]
[% IF ( itemsloo.ITEM_RESULTS.size ) %]
[% IF ( itemsloo.ITEM_RESULTS.count ) %]
<a id="reserve_[% itemsloo.biblionumber | html %]" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% itemsloo.biblionumber | html %]">Holds</a>
[% IF ( holdfor ) %] <span class="holdforlink">| <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% itemsloo.biblionumber | uri %]&amp;findborrower=[% holdfor_patron.cardnumber | uri %]">Place hold for [% INCLUDE 'patron-title.inc' patron => holdfor_patron no_title => 1 %]</a></span>[% END %]
[% ELSE %]
@ -334,12 +336,16 @@
<td>[% itemsloo.dateadded | $KohaDates%]</td>
<td>
<ul>
[% FOREACH result IN itemsloo.ITEM_RESULTS %]
[% FOREACH item IN itemsloo.ITEM_RESULTS %]
<li>
[% result.holdingbranch | html %]
[% IF ( result.location_intranet ) %]<span class="shelvingloc">[% result.location_intranet | html %]</span>[% END %]
[% IF ( result.itemcallnumber ) %]
[<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&amp;q=%22[% result.itemcallnumber |uri %]%22">[% result.itemcallnumber | html %]</a>]
[% Branches.GetName(item.holdingbranch) | html %]
[% IF ( item.location ) %]
<span class="shelvingloc">
[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %]
</span>
[% END %]
[% IF ( item.itemcallnumber ) %]
[<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&amp;q=%22[% item.itemcallnumber | uri %]%22">[% item.itemcallnumber | html %]</a>]
[% END %]
</li>
[% END %]

View file

@ -29,7 +29,6 @@ use C4::Biblio qw(
GetMarcISBN
GetMarcSubjects
);
use C4::Items qw( GetItemsInfo );
use C4::Output qw(
output_html_with_http_headers
output_and_exit
@ -83,13 +82,13 @@ if ($to_address) {
my $marcauthorsarray = $biblio->get_marc_contributors;
my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
my @items = GetItemsInfo($biblionumber);
my $items = $biblio->items->search_ordered;
$dat->{ISBN} = GetMarcISBN($record, $marcflavour);
$dat->{MARCSUBJCTS} = $marcsubjctsarray;
$dat->{MARCAUTHORS} = $marcauthorsarray;
$dat->{'biblionumber'} = $biblionumber;
$dat->{ITEM_RESULTS} = \@items;
$dat->{ITEM_RESULTS} = $items;
$dat->{HASAUTHORS} = $dat->{'author'} || @$marcauthorsarray;
$iso2709 .= $record->as_usmarc();

View file

@ -28,7 +28,6 @@ use C4::Koha qw(
GetNormalizedOCLCNumber
GetNormalizedUPC
);
use C4::Items qw( GetItemsLocationInfo );
use C4::Members;
use C4::Output qw( pagination_bar output_html_with_http_headers );
use C4::XSLT qw( XSLTParse4Display );
@ -323,8 +322,8 @@ if ( $op eq 'view' ) {
}
# Getting items infos for location display
my @items_infos = &GetItemsLocationInfo( $biblionumber );
$this_item->{'ITEM_RESULTS'} = \@items_infos;
my $items = $biblio->items;
$this_item->{'ITEM_RESULTS'} = $items;
$this_item->{biblionumber} = $biblionumber;
push @items, $this_item;
}