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

(-)a/C4/Auth.pm (-1 / +3 lines)
Lines 457-462 sub get_template_and_user { Link Here
457
457
458
    my $minPasswordLength = C4::Context->preference('minPasswordLength');
458
    my $minPasswordLength = C4::Context->preference('minPasswordLength');
459
    $minPasswordLength = 3 if not $minPasswordLength or $minPasswordLength < 3;
459
    $minPasswordLength = 3 if not $minPasswordLength or $minPasswordLength < 3;
460
    my $singleLibraryMode = Koha::Libraries->single_library_mode;
460
    $template->param(
461
    $template->param(
461
        EnhancedMessagingPreferences                                       => C4::Context->preference('EnhancedMessagingPreferences'),
462
        EnhancedMessagingPreferences                                       => C4::Context->preference('EnhancedMessagingPreferences'),
462
        GoogleJackets                                                      => C4::Context->preference("GoogleJackets"),
463
        GoogleJackets                                                      => C4::Context->preference("GoogleJackets"),
Lines 469-475 sub get_template_and_user { Link Here
469
        hide_marc       => C4::Context->preference("hide_marc"),
470
        hide_marc       => C4::Context->preference("hide_marc"),
470
        item_level_itypes  => C4::Context->preference('item-level_itypes'),
471
        item_level_itypes  => C4::Context->preference('item-level_itypes'),
471
        patronimages       => C4::Context->preference("patronimages"),
472
        patronimages       => C4::Context->preference("patronimages"),
472
        singleBranchMode   => ( Koha::Libraries->search->count == 1 ),
473
        singleBranchMode   => $singleLibraryMode, #TODO one day our templates will only contain Library, and this can be removed
474
        singleLibraryMode  => $singleLibraryMode,
473
        noItemTypeImages   => C4::Context->preference("noItemTypeImages"),
475
        noItemTypeImages   => C4::Context->preference("noItemTypeImages"),
474
        marcflavour        => C4::Context->preference("marcflavour"),
476
        marcflavour        => C4::Context->preference("marcflavour"),
475
        OPACBaseURL        => C4::Context->preference('OPACBaseURL'),
477
        OPACBaseURL        => C4::Context->preference('OPACBaseURL'),
(-)a/C4/XSLT.pm (-1 / +1 lines)
Lines 107-113 sub get_xslt_sysprefs { Link Here
107
107
108
    # singleBranchMode was a system preference, but no longer is
108
    # singleBranchMode was a system preference, but no longer is
109
    # we can retain it here for compatibility
109
    # we can retain it here for compatibility
110
    my $singleBranchMode = Koha::Libraries->search->count == 1 ? 1 : 0;
110
    my $singleBranchMode = Koha::Libraries->single_library_mode;
111
    $sysxml .= "<syspref name=\"singleBranchMode\">$singleBranchMode</syspref>\n";
111
    $sysxml .= "<syspref name=\"singleBranchMode\">$singleBranchMode</syspref>\n";
112
112
113
    $sysxml .= "</sysprefs>\n";
113
    $sysxml .= "</sysprefs>\n";
(-)a/opac/opac-reserve.pl (-1 / +1 lines)
Lines 226-232 if ( $query->param('place_reserve') ) { Link Here
226
226
227
        my $canreserve = 0;
227
        my $canreserve = 0;
228
228
229
        my $singleBranchMode = Koha::Libraries->search->count == 1;
229
        my $singleBranchMode = Koha::Libraries->single_library_mode;
230
        if ( $singleBranchMode || ! C4::Context->preference("OPACAllowUserToChooseBranch") )
230
        if ( $singleBranchMode || ! C4::Context->preference("OPACAllowUserToChooseBranch") )
231
        {    # single branch mode or disabled user choosing
231
        {    # single branch mode or disabled user choosing
232
            $branch = $patron->branchcode;
232
            $branch = $patron->branchcode;
(-)a/t/Koha.t (-5 / +4 lines)
Lines 113-124 is( C4::Koha::GetNormalizedOCLCNumber(), undef, 'GetNormalizedOCLCNumber should Link Here
113
subtest 'getFacets() tests' => sub {
113
subtest 'getFacets() tests' => sub {
114
    plan tests => 5;
114
    plan tests => 5;
115
115
116
    is ( Koha::Libraries->search->count, 1, 'There should be only 1 library (singleBranchMode on)' );
116
    is ( Koha::Libraries->search->count, 1, 'There should be only 1 library' );
117
    my $facets = C4::Koha::getFacets();
117
    my $facets = C4::Koha::getFacets();
118
    is(
118
    is(
119
        scalar( grep { defined $_->{idx} && $_->{idx} eq 'location' } @$facets ),
119
        scalar( grep { defined $_->{idx} && $_->{idx} eq 'location' } @$facets ),
120
        1,
120
        1,
121
        'location facet present with singleBranchMode on (bug 10078)'
121
        'location facet present with one library (bug 10078)'
122
    );
122
    );
123
123
124
    $libraries = [
124
    $libraries = [
Lines 126-138 subtest 'getFacets() tests' => sub { Link Here
126
        ['ZZZ_test', 'my branchname XXX'],
126
        ['ZZZ_test', 'my branchname XXX'],
127
    ];
127
    ];
128
    fixtures($libraries);
128
    fixtures($libraries);
129
    is ( Koha::Libraries->search->count, 3, 'There should be only more than 1 library (singleBranchMode off)' );
129
    is ( Koha::Libraries->search->count, 3, 'There should be only more than 1 library' );
130
130
131
    $facets = C4::Koha::getFacets();
131
    $facets = C4::Koha::getFacets();
132
    is(
132
    is(
133
        scalar( grep { defined $_->{idx} && $_->{idx} eq 'location' } @$facets ),
133
        scalar( grep { defined $_->{idx} && $_->{idx} eq 'location' } @$facets ),
134
        1,
134
        1,
135
        'location facet present with singleBranchMode off (bug 10078)'
135
        'location facet present with >1 library (bug 10078)'
136
    );
136
    );
137
};
137
};
138
138
139
- 

Return to bug 31784