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

(-)a/catalogue/detail.pl (-3 / +7 lines)
Lines 60-66 use Koha::Reviews; Link Here
60
use Koha::SearchEngine::Search;
60
use Koha::SearchEngine::Search;
61
use Koha::SearchEngine::QueryBuilder;
61
use Koha::SearchEngine::QueryBuilder;
62
use Koha::Serial::Items;
62
use Koha::Serial::Items;
63
use Koha::Library::Group;
64
use Koha::Library::Groups;
63
use Koha::Library::Groups;
65
64
66
my $query = CGI->new();
65
my $query = CGI->new();
Lines 348-358 $template->param( Link Here
348
    items_to_display_count => $items_to_display->count,
347
    items_to_display_count => $items_to_display->count,
349
    branch_holdings_count  => $branch_holdings_count,
348
    branch_holdings_count  => $branch_holdings_count,
350
);
349
);
350
351
my %branchcode_hash;
352
351
if ( C4::Context->preference('SeparateHoldingsByGroup') ) {
353
if ( C4::Context->preference('SeparateHoldingsByGroup') ) {
352
    my $branchcode        = C4::Context->userenv->{branch};
354
    my $branchcode        = C4::Context->userenv->{branch};
353
    my @all_search_groups = Koha::Library::Groups->get_search_groups( { interface => 'staff' } );
355
    my @all_search_groups = Koha::Library::Groups->get_search_groups( { interface => 'staff' } );
354
    my @lib_groups;
356
    my @lib_groups;
355
    my %branchcode_hash;
356
    my %holdings_count;
357
    my %holdings_count;
357
358
358
    foreach my $search_group (@all_search_groups) {
359
    foreach my $search_group (@all_search_groups) {
Lines 389-401 if ( C4::Context->preference('SeparateHoldingsByGroup') ) { Link Here
389
390
390
    $template->param(
391
    $template->param(
391
        lib_groups                 => \@lib_groups,
392
        lib_groups                 => \@lib_groups,
392
        branchcodes                => \%branchcode_hash,
393
        holdings_count_hash        => \%holdings_count,
393
        holdings_count_hash        => \%holdings_count,
394
        total_group_holdings_count => $total_group_holdings_count,
394
        total_group_holdings_count => $total_group_holdings_count,
395
        other_holdings_count       => $other_holdings_count,
395
        other_holdings_count       => $other_holdings_count,
396
    );
396
    );
397
}
397
}
398
398
399
$template->param(
400
    branchcode_hash => \%branchcode_hash,
401
);
402
399
my $some_private_shelves = Koha::Virtualshelves->get_some_shelves(
403
my $some_private_shelves = Koha::Virtualshelves->get_some_shelves(
400
    {
404
    {
401
        borrowernumber => $borrowernumber,
405
        borrowernumber => $borrowernumber,
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc (-10 / +5 lines)
Lines 297-311 Link Here
297
            otherholdings: "[% PROCESS 'build_table' tab="otherholdings" | collapse | $tojson %]",
297
            otherholdings: "[% PROCESS 'build_table' tab="otherholdings" | collapse | $tojson %]",
298
        };
298
        };
299
299
300
        const branchcodes = {
300
        [% IF branchcode_hash %]
301
          [% FOREACH key IN branchcodes.keys %]
301
            const branchcodes = [% To.json(branchcode_hash) | $raw %];
302
            "[% key | html %]": [
302
        [% ELSE %]
303
              [% FOREACH code IN branchcodes.$key %]
303
            const branchcodes = {};
304
                "[% code | html %]"[% UNLESS loop.last %], [% END %]
304
        [% END %]
305
              [% END %]
306
            ][% UNLESS loop.last %], [% END %]
307
          [% END %]
308
        };
309
305
310
        function build_items_table (tab_id, add_filters, dt_options, drawcallback) {
306
        function build_items_table (tab_id, add_filters, dt_options, drawcallback) {
311
307
312
- 

Return to bug 41624