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

(-)a/catalogue/detail.pl (-14 / +17 lines)
Lines 333-338 if ( defined $dat->{'itemtype'} ) { Link Here
333
}
333
}
334
334
335
my $total_group_holdings_count = 0;
335
my $total_group_holdings_count = 0;
336
my $other_holdings_count       = 0;
337
my $branch_holdings_count      = 0;
338
if ( C4::Context->preference('SeparateHoldings') ) {
339
    my $SeparateHoldingsBranch = C4::Context->preference('SeparateHoldingsBranch') || 'homebranch';
340
    $branch_holdings_count =
341
        $items_to_display->search( { $SeparateHoldingsBranch => { '=' => C4::Context->userenv->{branch} } } )->count;
342
    $other_holdings_count = $items_to_display->count - $branch_holdings_count;
343
}
344
$template->param(
345
    count                  => $all_items->count,         # FIXME 'count' is used in catalog-strings.inc
346
    other_holdings_count   => $other_holdings_count,     # But it's not a meaningful variable, we should rename it there
347
    all_items_count        => $all_items->count,
348
    items_to_display_count => $items_to_display->count,
349
    branch_holdings_count  => $branch_holdings_count,
350
);
336
if ( C4::Context->preference('SeparateHoldingsByGroup') ) {
351
if ( C4::Context->preference('SeparateHoldingsByGroup') ) {
337
    my $branchcode        = C4::Context->userenv->{branch};
352
    my $branchcode        = C4::Context->userenv->{branch};
338
    my @all_search_groups = Koha::Library::Groups->get_search_groups( { interface => 'staff' } );
353
    my @all_search_groups = Koha::Library::Groups->get_search_groups( { interface => 'staff' } );
Lines 367-372 if ( C4::Context->preference('SeparateHoldingsByGroup') ) { Link Here
367
                $total_group_holdings_count += $group_holdings_count;
382
                $total_group_holdings_count += $group_holdings_count;
368
383
369
                push @lib_groups, $group;
384
                push @lib_groups, $group;
385
                $other_holdings_count = ( $items_to_display->count ) - $total_group_holdings_count;
370
            }
386
            }
371
        }
387
        }
372
    }
388
    }
Lines 376-398 if ( C4::Context->preference('SeparateHoldingsByGroup') ) { Link Here
376
        branchcodes                => \%branchcode_hash,
392
        branchcodes                => \%branchcode_hash,
377
        holdings_count_hash        => \%holdings_count,
393
        holdings_count_hash        => \%holdings_count,
378
        total_group_holdings_count => $total_group_holdings_count,
394
        total_group_holdings_count => $total_group_holdings_count,
395
        other_holdings_count       => $other_holdings_count,
379
    );
396
    );
380
}
397
}
381
398
382
if ( C4::Context->preference('SeparateHoldings') ) {
383
    my $SeparateHoldingsBranch = C4::Context->preference('SeparateHoldingsBranch') || 'homebranch';
384
    my $other_holdings_count =
385
        $items_to_display->search( { $SeparateHoldingsBranch => { '!=' => C4::Context->userenv->{branch} } } )->count;
386
    $other_holdings_count -= $total_group_holdings_count;
387
    $template->param( other_holdings_count => $other_holdings_count );
388
}
389
$template->param(
390
    count                  => $all_items->count,         # FIXME 'count' is used in catalog-strings.inc
391
                                                         # But it's not a meaningful variable, we should rename it there
392
    all_items_count        => $all_items->count,
393
    items_to_display_count => $items_to_display->count,
394
);
395
396
my $some_private_shelves = Koha::Virtualshelves->get_some_shelves(
399
my $some_private_shelves = Koha::Virtualshelves->get_some_shelves(
397
    {
400
    {
398
        borrowernumber => $borrowernumber,
401
        borrowernumber => $borrowernumber,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-3 / +2 lines)
Lines 322-330 Link Here
322
    [% WRAPPER tabs id= "bibliodetails" %]
322
    [% WRAPPER tabs id= "bibliodetails" %]
323
        [% WRAPPER tabs_nav %]
323
        [% WRAPPER tabs_nav %]
324
            [% IF Koha.Preference('SeparateHoldings') %]
324
            [% IF Koha.Preference('SeparateHoldings') %]
325
                [% IF items_to_display_count - ( other_holdings_count || 0 ) - ( total_group_holdings_count || 0 ) %]
325
                [% IF branch_holdings_count %]
326
                    [% WRAPPER tab_item tabname= "holdings" %]
326
                    [% WRAPPER tab_item tabname= "holdings" %]
327
                        <span>[% Branches.GetLoggedInBranchname | html %] holdings ([% items_to_display_count - ( other_holdings_count || 0 ) - ( total_group_holdings_count || 0 ) - ( hidden_count || 0 ) || 0 | html %])</span>
327
                        <span>[% Branches.GetLoggedInBranchname | html %] holdings ([% branch_holdings_count | html %])</span>
328
                    [% END %]
328
                    [% END %]
329
                [% END %]
329
                [% END %]
330
            [% ELSE %]
330
            [% ELSE %]
331
- 

Return to bug 35211