Lines 30-40
use C4::Output qw(output_html_with_http_headers);
Link Here
|
30 |
use C4::Context; |
30 |
use C4::Context; |
31 |
use C4::Search qw(SimpleSearch); |
31 |
use C4::Search qw(SimpleSearch); |
32 |
use C4::Biblio qw(TransformMarcToKoha); |
32 |
use C4::Biblio qw(TransformMarcToKoha); |
33 |
use C4::Items qw(GetItemInfosOf get_itemnumbers_of); |
33 |
use C4::Items qw(GetItemInfosOf); |
34 |
use C4::Creators::Lib qw(html_table); |
34 |
use C4::Creators::Lib qw(html_table); |
35 |
use C4::Debug; |
35 |
use C4::Debug; |
36 |
use Koha::DateUtils; |
|
|
37 |
|
36 |
|
|
|
37 |
use Koha::DateUtils; |
38 |
use Koha::Items; |
38 |
use Koha::ItemTypes; |
39 |
use Koha::ItemTypes; |
39 |
use Koha::SearchEngine::Search; |
40 |
use Koha::SearchEngine::Search; |
40 |
|
41 |
|
Lines 139-166
if ($show_results) {
Link Here
|
139 |
push (@results_set, $biblio); |
140 |
push (@results_set, $biblio); |
140 |
my $biblionumber = $biblio->{'biblionumber'}; |
141 |
my $biblionumber = $biblio->{'biblionumber'}; |
141 |
#DEBUG Notes: Grab the item numbers associated with this MARC record... |
142 |
#DEBUG Notes: Grab the item numbers associated with this MARC record... |
142 |
my $itemnums = get_itemnumbers_of($biblionumber); |
143 |
my $items = Koha::Items->search({ biblionumber => $biblionumber }, { order_by => { -desc => 'itemnumber' }}); |
143 |
#DEBUG Notes: Retrieve the item data for each number... |
144 |
#DEBUG Notes: Retrieve the item data for each number... |
144 |
if (my $iii = $itemnums->{$biblionumber}) { |
145 |
while ( my $item = $items->next ) { |
145 |
my $item_results = GetItemInfosOf(@$iii); |
146 |
#DEBUG Notes: Build an array element 'item' of the correct bib (results) hash which contains item-specific data... |
146 |
foreach my $item ( keys %$item_results ) { |
147 |
if ( $item->biblionumber eq $results_set[$i]->{'biblionumber'} ) { |
147 |
#DEBUG Notes: Build an array element 'item' of the correct bib (results) hash which contains item-specific data... |
148 |
my $item_data; |
148 |
if ($item_results->{$item}->{'biblionumber'} eq $results_set[$i]->{'biblionumber'}) { |
149 |
$item_data->{'_item_number'} = $item->itemnumber; |
149 |
my $item_data; |
150 |
$item_data->{'_item_call_number'} = ( $item->itemcallnumber || 'NA' ); |
150 |
$item_data->{'_item_number'} = $item_results->{$item}->{'itemnumber'}; |
151 |
$item_data->{'_date_accessioned'} = $item->dateaccessioned; |
151 |
$item_data->{'_item_call_number'} = ($item_results->{$item}->{'itemcallnumber'} ? $item_results->{$item}->{'itemcallnumber'} : 'NA'); |
152 |
$item_data->{'_barcode'} = ( $item->barcode || 'NA' ); |
152 |
$item_data->{'_date_accessioned'} = $item_results->{$item}->{'dateaccessioned'}; |
153 |
$item_data->{'_add'} = $item->itemnumber; |
153 |
$item_data->{'_barcode'} = ( $item_results->{$item}->{'barcode'} ? $item_results->{$item}->{'barcode'} : 'NA'); |
154 |
push @row_data, $item_data; |
154 |
$item_data->{'_add'} = $item_results->{$item}->{'itemnumber'}; |
|
|
155 |
unshift (@row_data, $item_data); # item numbers are given to us in descending order by get_itemnumbers_of()... |
156 |
} |
157 |
} |
155 |
} |
158 |
$results_set[$i]->{'item_table'} = html_table($display_columns, \@row_data); |
156 |
$results_set[$i]->{'item_table'} = html_table($display_columns, \@row_data); |
159 |
} |
157 |
} |
160 |
else { |
|
|
161 |
# FIXME: Some error trapping code needed |
162 |
warn sprintf('No item numbers retrieved for biblio number: %s', $biblionumber); |
163 |
} |
164 |
} |
158 |
} |
165 |
|
159 |
|
166 |
( $template, $loggedinuser, $cookie ) = get_template_and_user( |
160 |
( $template, $loggedinuser, $cookie ) = get_template_and_user( |