|
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 |