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

(-)a/catalogue/detail.pl (+23 lines)
Lines 60-65 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
65
64
my $query = CGI->new();
66
my $query = CGI->new();
65
67
Lines 335-341 if ( C4::Context->preference('SeparateHoldings') ) { Link Here
335
    my $other_holdings_count =
337
    my $other_holdings_count =
336
        $items_to_display->search( { $SeparateHoldingsBranch => { '!=' => C4::Context->userenv->{branch} } } )->count;
338
        $items_to_display->search( { $SeparateHoldingsBranch => { '!=' => C4::Context->userenv->{branch} } } )->count;
337
    $template->param( other_holdings_count => $other_holdings_count );
339
    $template->param( other_holdings_count => $other_holdings_count );
340
341
    my $branchcode        = C4::Context->userenv->{branch};
342
    my @all_search_groups = Koha::Library::Groups->get_search_groups( { interface => 'staff' } );
343
344
    my @libs_in_group;
345
    foreach my $search_group (@all_search_groups) {
346
        while ( my $group = $search_group->next ) {
347
            my @all_libs = $group->all_libraries;
348
            if ( grep { $_->branchcode eq $branchcode } @all_libs ) {
349
                foreach my $lib (@all_libs) {
350
                    if ( $lib->branchcode ne $branchcode ) {
351
                        push @libs_in_group, $lib->branchcode;
352
                    }
353
                }
354
            }
355
        }
356
    }
357
358
    $template->param( libs_in_group => \@libs_in_group );
359
338
}
360
}
361
339
$template->param(
362
$template->param(
340
    count                  => $all_items->count,         # FIXME 'count' is used in catalog-strings.inc
363
    count                  => $all_items->count,         # FIXME 'count' is used in catalog-strings.inc
341
                                                         # But it's not a meaningful variable, we should rename it there
364
                                                         # 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 (-1 / +5 lines)
Lines 285-294 Link Here
285
            otherholdings: [% TablesSettings.GetTableSettings('catalogue', 'detail','otherholdings_table','json')  | $raw %],
285
            otherholdings: [% TablesSettings.GetTableSettings('catalogue', 'detail','otherholdings_table','json')  | $raw %],
286
        };
286
        };
287
287
288
        let user_colvis = {holdings: {}, otherholdings: {}};
288
        let user_colvis = {holdings: {}, otherholdings: {}, group_holdings: {}};
289
        let table_nodes = {
289
        let table_nodes = {
290
            holdings: "[% PROCESS 'build_table' tab="holdings" | collapse | $tojson %]",
290
            holdings: "[% PROCESS 'build_table' tab="holdings" | collapse | $tojson %]",
291
            otherholdings: "[% PROCESS 'build_table' tab="otherholdings" | collapse | $tojson %]",
291
            otherholdings: "[% PROCESS 'build_table' tab="otherholdings" | collapse | $tojson %]",
292
            group_holdings: "[% PROCESS 'build_table' tab="group_holdings" | collapse | $tojson %]",
293
292
        };
294
        };
293
        function build_items_table (tab_id, add_filters, dt_options, drawcallback) {
295
        function build_items_table (tab_id, add_filters, dt_options, drawcallback) {
294
296
Lines 310-315 Link Here
310
                let branch = '[% IF SeparateHoldingsBranch == 'homebranch' %]me.home_library_id[% ELSE %]me.holding_library_id[% END %]';
312
                let branch = '[% IF SeparateHoldingsBranch == 'homebranch' %]me.home_library_id[% ELSE %]me.holding_library_id[% END %]';
311
                if ( tab_id == 'holdings' ) {
313
                if ( tab_id == 'holdings' ) {
312
                    default_filters[branch] = '[% Branches.GetLoggedInBranchcode() | html %]';
314
                    default_filters[branch] = '[% Branches.GetLoggedInBranchcode() | html %]';
315
                } else if ( tab_id == 'group_holdings') {
316
                    default_filters[branch] = [ [% FOREACH branchcode IN libs_in_group %]"[% branchcode | html %]"[% UNLESS loop.last %], [% END%][% END %] ];
313
                } else {
317
                } else {
314
                    default_filters[branch] = { '!=': '[% Branches.GetLoggedInBranchcode() | html  %]' };
318
                    default_filters[branch] = { '!=': '[% Branches.GetLoggedInBranchcode() | html  %]' };
315
                }
319
                }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-2 / +7 lines)
Lines 331-336 Link Here
331
                    [% WRAPPER tab_item tabname= "otherholdings" %]
331
                    [% WRAPPER tab_item tabname= "otherholdings" %]
332
                        <span>Other holdings ([% other_holdings_count || 0 | html %])</span>
332
                        <span>Other holdings ([% other_holdings_count || 0 | html %])</span>
333
                    [% END %]
333
                    [% END %]
334
                    [% WRAPPER tab_item tabname= "group_holdings" %]
335
                        <span>Group holdings</span>
336
                    [% END %]
334
                [% END %]
337
                [% END %]
335
            [% ELSE %]
338
            [% ELSE %]
336
                [% WRAPPER tab_item tabname= "holdings" %]
339
                [% WRAPPER tab_item tabname= "holdings" %]
Lines 472-477 Link Here
472
            [% END # /tab_panel %]
475
            [% END # /tab_panel %]
473
476
474
            [% IF Koha.Preference('SeparateHoldings') %]
477
            [% IF Koha.Preference('SeparateHoldings') %]
478
                [% WRAPPER tab_panel tabname="group_holdings" %]
479
                    [% PROCESS items_table tab="group_holdings" %]
480
                [% END #/tab_panel %]
475
                [% WRAPPER tab_panel tabname="otherholdings" %]
481
                [% WRAPPER tab_panel tabname="otherholdings" %]
476
                    [% PROCESS items_table tab="otherholdings" %]
482
                    [% PROCESS items_table tab="otherholdings" %]
477
                [% END # /tab_panel %]
483
                [% END # /tab_panel %]
Lines 2034-2040 Link Here
2034
                // End bundle handling
2040
                // End bundle handling
2035
            [% END # /IF bundlesEnabled %]
2041
            [% END # /IF bundlesEnabled %]
2036
2042
2037
            let items_tab_ids = [ 'holdings', 'otherholdings' ];
2043
            let items_tab_ids = [ 'holdings', 'otherholdings', 'group_holdings' ];
2038
            items_tab_ids.forEach( function( tab_id, index ) {
2044
            items_tab_ids.forEach( function( tab_id, index ) {
2039
2045
2040
                // Early return if the tab is not shown (ie. no table)
2046
                // Early return if the tab is not shown (ie. no table)
2041
- 

Return to bug 35211