|
Lines 333-339
if ( defined $dat->{'itemtype'} ) {
Link Here
|
| 333 |
$dat->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtypes->{ $dat->{itemtype} }->imageurl ); |
333 |
$dat->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtypes->{ $dat->{itemtype} }->imageurl ); |
| 334 |
} |
334 |
} |
| 335 |
|
335 |
|
| 336 |
my $total_group_holdings_count = 0; |
336 |
if ( C4::Context->preference('SeparateHoldings') ) { |
|
|
337 |
my $SeparateHoldingsBranch = C4::Context->preference('SeparateHoldingsBranch') || 'homebranch'; |
| 338 |
my $other_holdings_count = |
| 339 |
$items_to_display->search( { $SeparateHoldingsBranch => { '!=' => C4::Context->userenv->{branch} } } )->count; |
| 340 |
$template->param( other_holdings_count => $other_holdings_count ); |
| 341 |
} |
| 342 |
|
| 337 |
if ( C4::Context->preference('SeparateHoldingsByGroup') ) { |
343 |
if ( C4::Context->preference('SeparateHoldingsByGroup') ) { |
| 338 |
my $branchcode = C4::Context->userenv->{branch}; |
344 |
my $branchcode = C4::Context->userenv->{branch}; |
| 339 |
my @all_search_groups = Koha::Library::Groups->get_search_groups( { interface => 'staff' } ); |
345 |
my @all_search_groups = Koha::Library::Groups->get_search_groups( { interface => 'staff' } ); |
|
Lines 358-363
if ( C4::Context->preference('SeparateHoldingsByGroup') ) {
Link Here
|
| 358 |
push @libs_branchcodes, $lib->branchcode; |
364 |
push @libs_branchcodes, $lib->branchcode; |
| 359 |
} |
365 |
} |
| 360 |
|
366 |
|
|
|
367 |
# Push logged in branchcode |
| 368 |
push @libs_branchcodes, $branchcode; |
| 369 |
|
| 361 |
# Build group branchcode hash |
370 |
# Build group branchcode hash |
| 362 |
$branchcode_hash{ $group->id } = \@libs_branchcodes; |
371 |
$branchcode_hash{ $group->id } = \@libs_branchcodes; |
| 363 |
|
372 |
|
|
Lines 365-371
if ( C4::Context->preference('SeparateHoldingsByGroup') ) {
Link Here
|
| 365 |
my $group_holdings_count = |
374 |
my $group_holdings_count = |
| 366 |
$items_to_display->search( { $SeparateHoldingsBranch => { '-in' => \@libs_branchcodes } } )->count; |
375 |
$items_to_display->search( { $SeparateHoldingsBranch => { '-in' => \@libs_branchcodes } } )->count; |
| 367 |
$holdings_count{ $group->id } = $group_holdings_count; |
376 |
$holdings_count{ $group->id } = $group_holdings_count; |
| 368 |
$total_group_holdings_count += $group_holdings_count; |
|
|
| 369 |
|
377 |
|
| 370 |
push @lib_groups, $group; |
378 |
push @lib_groups, $group; |
| 371 |
} |
379 |
} |
|
Lines 380-392
if ( C4::Context->preference('SeparateHoldingsByGroup') ) {
Link Here
|
| 380 |
); |
388 |
); |
| 381 |
} |
389 |
} |
| 382 |
|
390 |
|
| 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 |
$template->param( |
| 391 |
count => $all_items->count, # FIXME 'count' is used in catalog-strings.inc |
392 |
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 |
# But it's not a meaningful variable, we should rename it there |