|
Lines 334-354
if ( defined $dat->{'itemtype'} ) {
Link Here
|
| 334 |
} |
334 |
} |
| 335 |
|
335 |
|
| 336 |
my $total_group_holdings_count = 0; |
336 |
my $total_group_holdings_count = 0; |
| 337 |
my $other_holdings_count = 0; |
|
|
| 338 |
my $branch_holdings_count = 0; |
| 339 |
if ( C4::Context->preference('SeparateHoldings') ) { |
| 340 |
my $SeparateHoldingsBranch = C4::Context->preference('SeparateHoldingsBranch') || 'homebranch'; |
| 341 |
$branch_holdings_count = |
| 342 |
$items_to_display->search( { $SeparateHoldingsBranch => { '=' => C4::Context->userenv->{branch} } } )->count; |
| 343 |
$other_holdings_count = $items_to_display->count - $branch_holdings_count; |
| 344 |
} |
| 345 |
$template->param( |
| 346 |
count => $all_items->count, # FIXME 'count' is used in catalog-strings.inc |
| 347 |
other_holdings_count => $other_holdings_count, # But it's not a meaningful variable, we should rename it there |
| 348 |
all_items_count => $all_items->count, |
| 349 |
items_to_display_count => $items_to_display->count, |
| 350 |
branch_holdings_count => $branch_holdings_count, |
| 351 |
); |
| 352 |
if ( C4::Context->preference('SeparateHoldingsByGroup') ) { |
337 |
if ( C4::Context->preference('SeparateHoldingsByGroup') ) { |
| 353 |
my $branchcode = C4::Context->userenv->{branch}; |
338 |
my $branchcode = C4::Context->userenv->{branch}; |
| 354 |
my @all_search_groups = Koha::Library::Groups->get_search_groups( { interface => 'staff' } ); |
339 |
my @all_search_groups = Koha::Library::Groups->get_search_groups( { interface => 'staff' } ); |
|
Lines 383-389
if ( C4::Context->preference('SeparateHoldingsByGroup') ) {
Link Here
|
| 383 |
$total_group_holdings_count += $group_holdings_count; |
368 |
$total_group_holdings_count += $group_holdings_count; |
| 384 |
|
369 |
|
| 385 |
push @lib_groups, $group; |
370 |
push @lib_groups, $group; |
| 386 |
$other_holdings_count = ( $items_to_display->count ) - $total_group_holdings_count; |
|
|
| 387 |
} |
371 |
} |
| 388 |
} |
372 |
} |
| 389 |
} |
373 |
} |
|
Lines 393-402
if ( C4::Context->preference('SeparateHoldingsByGroup') ) {
Link Here
|
| 393 |
branchcodes => \%branchcode_hash, |
377 |
branchcodes => \%branchcode_hash, |
| 394 |
holdings_count_hash => \%holdings_count, |
378 |
holdings_count_hash => \%holdings_count, |
| 395 |
total_group_holdings_count => $total_group_holdings_count, |
379 |
total_group_holdings_count => $total_group_holdings_count, |
| 396 |
other_holdings_count => $other_holdings_count, |
|
|
| 397 |
); |
380 |
); |
| 398 |
} |
381 |
} |
| 399 |
|
382 |
|
|
|
383 |
if ( C4::Context->preference('SeparateHoldings') ) { |
| 384 |
my $SeparateHoldingsBranch = C4::Context->preference('SeparateHoldingsBranch') || 'homebranch'; |
| 385 |
my $other_holdings_count = |
| 386 |
$items_to_display->search( { $SeparateHoldingsBranch => { '!=' => C4::Context->userenv->{branch} } } )->count; |
| 387 |
$other_holdings_count -= $total_group_holdings_count; |
| 388 |
$template->param( other_holdings_count => $other_holdings_count ); |
| 389 |
} |
| 390 |
$template->param( |
| 391 |
count => $all_items->count, # FIXME 'count' is used in catalog-strings.inc |
| 392 |
# But it's not a meaningful variable, we should rename it there |
| 393 |
all_items_count => $all_items->count, |
| 394 |
items_to_display_count => $items_to_display->count, |
| 395 |
); |
| 396 |
|
| 400 |
my $some_private_shelves = Koha::Virtualshelves->get_some_shelves( |
397 |
my $some_private_shelves = Koha::Virtualshelves->get_some_shelves( |
| 401 |
{ |
398 |
{ |
| 402 |
borrowernumber => $borrowernumber, |
399 |
borrowernumber => $borrowernumber, |