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

(-)a/catalogue/detail.pl (-10 / +9 lines)
Lines 332-344 if ( defined $dat->{'itemtype'} ) { Link Here
332
    $dat->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtypes->{ $dat->{itemtype} }->imageurl );
332
    $dat->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtypes->{ $dat->{itemtype} }->imageurl );
333
}
333
}
334
334
335
if ( C4::Context->preference('SeparateHoldings') ) {
335
my $total_group_holdings_count = 0;
336
    my $SeparateHoldingsBranch = C4::Context->preference('SeparateHoldingsBranch') || 'homebranch';
337
    my $other_holdings_count =
338
        $items_to_display->search( { $SeparateHoldingsBranch => { '!=' => C4::Context->userenv->{branch} } } )->count;
339
    $template->param( other_holdings_count => $other_holdings_count );
340
}
341
342
if ( C4::Context->preference('SeparateHoldingsByGroup') ) {
336
if ( C4::Context->preference('SeparateHoldingsByGroup') ) {
343
    my $branchcode        = C4::Context->userenv->{branch};
337
    my $branchcode        = C4::Context->userenv->{branch};
344
    my @all_search_groups = Koha::Library::Groups->get_search_groups( { interface => 'staff' } );
338
    my @all_search_groups = Koha::Library::Groups->get_search_groups( { interface => 'staff' } );
Lines 361-375 if ( C4::Context->preference('SeparateHoldingsByGroup') ) { Link Here
361
                    push @libs_branchcodes, $lib->branchcode;
355
                    push @libs_branchcodes, $lib->branchcode;
362
                }
356
                }
363
357
364
                # Push logged in branchcode
365
                push @libs_branchcodes, $branchcode;
366
367
                # Build group branchcode hash
358
                # Build group branchcode hash
368
                $branchcode_hash{ $group->id } = \@libs_branchcodes;
359
                $branchcode_hash{ $group->id } = \@libs_branchcodes;
369
360
370
                my $group_holdings_count =
361
                my $group_holdings_count =
371
                    $items_to_display->search( { homebranch => { '-in' => \@libs_branchcodes } } )->count;
362
                    $items_to_display->search( { homebranch => { '-in' => \@libs_branchcodes } } )->count;
372
                $holdings_count{ $group->id } = $group_holdings_count;
363
                $holdings_count{ $group->id } = $group_holdings_count;
364
                $total_group_holdings_count += $group_holdings_count;
373
365
374
                push @lib_groups, $group;
366
                push @lib_groups, $group;
375
            }
367
            }
Lines 383-388 if ( C4::Context->preference('SeparateHoldingsByGroup') ) { Link Here
383
    );
375
    );
384
}
376
}
385
377
378
if ( C4::Context->preference('SeparateHoldings') ) {
379
    my $SeparateHoldingsBranch = C4::Context->preference('SeparateHoldingsBranch') || 'homebranch';
380
    my $other_holdings_count =
381
        $items_to_display->search( { $SeparateHoldingsBranch => { '!=' => C4::Context->userenv->{branch} } } )->count;
382
    $other_holdings_count -= $total_group_holdings_count;
383
    $template->param( other_holdings_count => $other_holdings_count );
384
}
386
$template->param(
385
$template->param(
387
    count                  => $all_items->count,         # FIXME 'count' is used in catalog-strings.inc
386
    count                  => $all_items->count,         # FIXME 'count' is used in catalog-strings.inc
388
                                                         # But it's not a meaningful variable, we should rename it there
387
                                                         # But it's not a meaningful variable, we should rename it there
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc (-2 / +3 lines)
Lines 322-328 Link Here
322
                if ( tab_id == 'holdings' ) {
322
                if ( tab_id == 'holdings' ) {
323
                    default_filters[branch] = '[% Branches.GetLoggedInBranchcode() | html %]';
323
                    default_filters[branch] = '[% Branches.GetLoggedInBranchcode() | html %]';
324
                } else {
324
                } else {
325
                    default_filters[branch] = { '!=': '[% Branches.GetLoggedInBranchcode() | html  %]' };
325
                    let all_branchcodes = Object.values(branchcodes).flat();
326
                    all_branchcodes.push('[% Branches.GetLoggedInBranchcode() | html %]');
327
                    default_filters[branch] = { '-not_in' : all_branchcodes };
326
                }
328
                }
327
            [% END %]
329
            [% END %]
328
330
329
- 

Return to bug 35211