From 2c99a131ec15f91103b6ae36a0f44401d15e8c05 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 3 Jun 2022 08:33:00 +0200 Subject: [PATCH] Bug 27272: virtualshelves/sendshelf.pl shelves.pl --- .../en/modules/virtualshelves/sendshelf.tt | 8 +++++--- .../prog/en/modules/virtualshelves/shelves.tt | 18 ++++++++++++------ virtualshelves/sendshelf.pl | 5 ++--- virtualshelves/shelves.pl | 5 ++--- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt index 0310e41c5bc..c1f199cf181 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt @@ -1,4 +1,6 @@ [% USE raw %] +[% USE AuthorisedValues %] +[% USE Branches %] Your list: [% shelfname | $raw %] @@ -144,12 +146,12 @@ Your list: [% shelfname | $raw %] In online catalog: [% OPACBaseURL | $raw %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber | html %]

[% END %] - [% IF ( BIBLIO_RESULT.ITEM_RESULTS.size ) %] + [% IF ( BIBLIO_RESULT.ITEM_RESULTS.count ) %]

Items:

    [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
  • - [% 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 %]
  • [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt index b83781c0510..295a41be207 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt @@ -2,6 +2,8 @@ [% USE Asset %] [% USE Koha %] [% USE KohaDates %] +[% USE AuthorisedValues %] +[% USE Branches %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] @@ -274,7 +276,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 %]&findborrower=[% holdfor_cardnumber | uri %]">Place hold for [% holdfor_firstname | html %] [% holdfor_surname | html %] ([% holdfor_cardnumber | html %])</a></span>[% END %] [% ELSE %] @@ -293,12 +295,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&q=%22[% result.itemcallnumber |uri %]%22">[% result.itemcallnumber | html %]</a>] + [% Branches.GetName(item.holdingbranch) | html %] + [% IF ( item.location ) %] + <span class="shelvingloc"> + [% SET 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&q=%22[% item.itemcallnumber | uri %]%22">[% item.itemcallnumber | html %]</a>] [% END %] </li> [% END %] diff --git a/virtualshelves/sendshelf.pl b/virtualshelves/sendshelf.pl index 0bcb43cea1e..4000192b3be 100755 --- a/virtualshelves/sendshelf.pl +++ b/virtualshelves/sendshelf.pl @@ -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_authors; my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); - my @items = GetItemsInfo($biblionumber); + my $items = $biblio->items; $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(); diff --git a/virtualshelves/shelves.pl b/virtualshelves/shelves.pl index 8b70dc2bb51..870f0a788f0 100755 --- a/virtualshelves/shelves.pl +++ b/virtualshelves/shelves.pl @@ -26,7 +26,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 ); @@ -302,8 +301,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; } -- 2.25.1