Lines 19-24
use Modern::Perl;
Link Here
|
19 |
use List::MoreUtils qw( uniq ); |
19 |
use List::MoreUtils qw( uniq ); |
20 |
use C4::Biblio qw( GetMarcStructure GetMarcFromKohaField IsMarcStructureInternal ); |
20 |
use C4::Biblio qw( GetMarcStructure GetMarcFromKohaField IsMarcStructureInternal ); |
21 |
use Koha::Items; |
21 |
use Koha::Items; |
|
|
22 |
use List::MoreUtils qw(first_index); |
22 |
|
23 |
|
23 |
=head1 NAME |
24 |
=head1 NAME |
24 |
|
25 |
|
Lines 71-84
Use it with:
Link Here
|
71 |
|
72 |
|
72 |
sub build_table { |
73 |
sub build_table { |
73 |
my ( $self, $params ) = @_; |
74 |
my ( $self, $params ) = @_; |
74 |
|
75 |
my @itemnumbers = @{ $self->{itemnumbers} }; |
75 |
my $items = Koha::Items->search( { itemnumber => $self->{itemnumbers} } ); |
76 |
my $items = Koha::Items->search( { itemnumber => $self->{itemnumbers} } ); |
76 |
|
77 |
|
77 |
my @items; |
78 |
my @items; |
78 |
while ( my $item = $items->next ) { |
79 |
while ( my $item = $items->next ) { |
79 |
my $item_info = $item->columns_to_str; |
80 |
my $item_info = $item->columns_to_str; |
|
|
81 |
my $index = first_index { $_ eq $item->itemnumber } @itemnumbers; |
80 |
$item_info = { |
82 |
$item_info = { |
81 |
%$item_info, |
83 |
%$item_info, |
|
|
84 |
index => $index, |
82 |
biblio => $item->biblio, |
85 |
biblio => $item->biblio, |
83 |
safe_to_delete => $item->safe_to_delete, |
86 |
safe_to_delete => $item->safe_to_delete, |
84 |
holds => $item->biblio->holds->count, |
87 |
holds => $item->biblio->holds->count, |