View | Details | Raw Unified | Return to bug 33497
Collapse All | Expand All

(-)a/catalogue/detail.pl (-13 / +6 lines)
Lines 193-212 my $itemtypes = { map { $_->itemtype => $_ } @{ Koha::ItemTypes->search_with_loc Link Here
193
my $params;
193
my $params;
194
my $patron = Koha::Patrons->find( $borrowernumber );
194
my $patron = Koha::Patrons->find( $borrowernumber );
195
$params->{ itemlost } = 0 if $patron->category->hidelostitems && !$showallitems;
195
$params->{ itemlost } = 0 if $patron->category->hidelostitems && !$showallitems;
196
my @items = $biblio->items->search_ordered( $params )->as_list;
196
my $items = $biblio->items({ host_items => 1 })->search_ordered( $params, { prefetch => ['issue','branchtransfers'] } );
197
197
198
# flag indicating existence of at least one item linked via a host record
198
# flag indicating existence of at least one item linked via a host record
199
my $hostrecords;
199
my $hostrecords = $biblio->host_items->count;
200
# adding items linked via host biblios
201
my $hostitems = $biblio->host_items;
202
if ( $hostitems->count ) {
203
    $hostrecords = 1;
204
    push @items, $hostitems->as_list;
205
}
206
200
207
my $dat = &GetBiblioData($biblionumber);
201
my $dat = &GetBiblioData($biblionumber);
208
$dat->{'count'} = $biblio->items->count + $hostitems->count;
202
$dat->{'count'} = $biblio->items({ host_items => 1 })->count;
209
$dat->{'showncount'} = scalar @items + $hostitems->count;
203
$dat->{'showncount'} = $items->count;
210
$dat->{'hiddencount'} = $dat->{'count'} - $dat->{'showncount'};
204
$dat->{'hiddencount'} = $dat->{'count'} - $dat->{'showncount'};
211
205
212
206
Lines 355-361 if ($currentbranch and C4::Context->preference('SeparateHoldings')) { Link Here
355
my $separatebranch = C4::Context->preference('SeparateHoldingsBranch') || 'homebranch';
349
my $separatebranch = C4::Context->preference('SeparateHoldingsBranch') || 'homebranch';
356
my ( $itemloop_has_images, $otheritemloop_has_images );
350
my ( $itemloop_has_images, $otheritemloop_has_images );
357
351
358
foreach my $item (@items) {
352
while ( my $item = $items->next ) {
359
    my $itembranchcode = $item->$separatebranch;
353
    my $itembranchcode = $item->$separatebranch;
360
354
361
    my $item_info = $item->unblessed;
355
    my $item_info = $item->unblessed;
Lines 490-496 $template->param( Link Here
490
    materials => $materials_flag,
484
    materials => $materials_flag,
491
);
485
);
492
486
493
if (C4::Context->preference("AlternateHoldingsField") && scalar @items == 0) {
487
if (C4::Context->preference("AlternateHoldingsField") && scalar $items->count == 0) {
494
    my $fieldspec = C4::Context->preference("AlternateHoldingsField");
488
    my $fieldspec = C4::Context->preference("AlternateHoldingsField");
495
    my $subfields = substr $fieldspec, 3;
489
    my $subfields = substr $fieldspec, 3;
496
    my $holdingsep = C4::Context->preference("AlternateHoldingsSeparator") || ' ';
490
    my $holdingsep = C4::Context->preference("AlternateHoldingsSeparator") || ' ';
497
- 

Return to bug 33497