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

(-)a/C4/Auth.pm (-1 / +1 lines)
Lines 352-358 sub get_template_and_user { Link Here
352
            hide_marc                    => C4::Context->preference("hide_marc"),
352
            hide_marc                    => C4::Context->preference("hide_marc"),
353
            item_level_itypes            => C4::Context->preference('item-level_itypes'),
353
            item_level_itypes            => C4::Context->preference('item-level_itypes'),
354
            patronimages                 => C4::Context->preference("patronimages"),
354
            patronimages                 => C4::Context->preference("patronimages"),
355
            singleBranchMode             => C4::Context->preference("singleBranchMode"),
355
            singleBranchMode             => ( C4::Branch::GetBranchesCount() == 1 ),
356
            XSLTDetailsDisplay           => C4::Context->preference("XSLTDetailsDisplay"),
356
            XSLTDetailsDisplay           => C4::Context->preference("XSLTDetailsDisplay"),
357
            XSLTResultsDisplay           => C4::Context->preference("XSLTResultsDisplay"),
357
            XSLTResultsDisplay           => C4::Context->preference("XSLTResultsDisplay"),
358
            using_https                  => $in->{'query'}->https() ? 1 : 0,
358
            using_https                  => $in->{'query'}->https() ? 1 : 0,
(-)a/C4/Branch.pm (+14 lines)
Lines 33-38 BEGIN { Link Here
33
		&GetBranch
33
		&GetBranch
34
		&GetBranches
34
		&GetBranches
35
		&GetBranchesLoop
35
		&GetBranchesLoop
36
		&GetBranchesCount
36
		&GetBranchDetail
37
		&GetBranchDetail
37
		&get_branchinfos_of
38
		&get_branchinfos_of
38
		&ModBranch
39
		&ModBranch
Lines 169-174 sub GetBranchesLoop (;$$) { # since this is what most pages want anyway Link Here
169
    return \@loop;
170
    return \@loop;
170
}
171
}
171
172
173
=head2 GetBranchesCount
174
175
=cut 
176
177
sub GetBranchesCount() {
178
    my $dbh = C4::Context->dbh;
179
    my $sth;
180
    $sth = $dbh->prepare("SELECT COUNT(*) as count FROM branches");
181
    my $count = $sth->fetchrow_array;
182
    $sth->finish;
183
    return ( $count );
184
}
185
172
=head2 GetBranchName
186
=head2 GetBranchName
173
187
174
=cut
188
=cut
(-)a/C4/Koha.pm (-2 / +3 lines)
Lines 675-680 sub getallthemes { Link Here
675
675
676
sub getFacets {
676
sub getFacets {
677
    my $facets;
677
    my $facets;
678
    my $singleBranchMode = ( C4::Branch::GetBranchesCount() == 1 );
678
    if ( C4::Context->preference("marcflavour") eq "UNIMARC" ) {
679
    if ( C4::Context->preference("marcflavour") eq "UNIMARC" ) {
679
        $facets = [
680
        $facets = [
680
            {
681
            {
Lines 711-717 sub getFacets { Link Here
711
            ];
712
            ];
712
713
713
            my $library_facet;
714
            my $library_facet;
714
            unless ( C4::Context->preference("singleBranchMode") ) {
715
            unless ( $singleBranchMode ) {
715
                $library_facet = {
716
                $library_facet = {
716
                    link_value  => 'branch',
717
                    link_value  => 'branch',
717
                    label_value => 'Libraries',
718
                    label_value => 'Libraries',
Lines 772-778 sub getFacets { Link Here
772
            ];
773
            ];
773
            
774
            
774
            my $library_facet;
775
            my $library_facet;
775
            unless ( C4::Context->preference("singleBranchMode") ) {
776
            unless ( $singleBranchMode ) {
776
                $library_facet = {
777
                $library_facet = {
777
                    link_value  => 'branch',
778
                    link_value  => 'branch',
778
                    label_value => 'Libraries',
779
                    label_value => 'Libraries',
(-)a/C4/Search.pm (-1 / +1 lines)
Lines 593-599 sub getRecords { Link Here
593
                        facets     => \@this_facets_array,
593
                        facets     => \@this_facets_array,
594
                        expandable => $expandable,
594
                        expandable => $expandable,
595
                        expand     => $link_value,
595
                        expand     => $link_value,
596
                    } unless ( ($facets_info->{$link_value}->{'label_value'} =~ /Libraries/) and (C4::Context->preference('singleBranchMode')) );
596
                    } unless ( ($facets_info->{$link_value}->{'label_value'} =~ /Libraries/) and ( C4::Branch::GetBranchesCount() == 1 ) );
597
                }
597
                }
598
            }
598
            }
599
        }
599
        }
(-)a/installer/data/mysql/sysprefs.sql (-2 lines)
Lines 164-170 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
164
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numReturnedItemsToShow','20','Number of returned items to show on the check-in page',NULL,'Integer');
164
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numReturnedItemsToShow','20','Number of returned items to show on the check-in page',NULL,'Integer');
165
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('finesMode','test','Choose the fines mode, \'off\', \'test\' (emails admin report) or \'production\' (accrue overdue fines).  Requires accruefines cronjob.','off|test|production','Choice');
165
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('finesMode','test','Choose the fines mode, \'off\', \'test\' (emails admin report) or \'production\' (accrue overdue fines).  Requires accruefines cronjob.','off|test|production','Choice');
166
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('itemBarcodeInputFilter','','If set, allows specification of a item barcode input filter','whitespace|T-prefix|cuecat|libsuite8','Choice');
166
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('itemBarcodeInputFilter','','If set, allows specification of a item barcode input filter','whitespace|T-prefix|cuecat|libsuite8','Choice');
167
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('singleBranchMode',0,'Operate in Single-branch mode, hide branch selection in the OPAC',NULL,'YesNo');
168
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('URLLinkText','','Text to display as the link anchor in the OPAC',NULL,'free');
167
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('URLLinkText','','Text to display as the link anchor in the OPAC',NULL,'free');
169
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACViewOthersSuggestions',0,'If ON, allows all suggestions to be displayed in the OPAC',NULL,'YesNo');
168
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACViewOthersSuggestions',0,'If ON, allows all suggestions to be displayed in the OPAC',NULL,'YesNo');
170
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACURLOpenInNewWindow',0,'If ON, URLs in the OPAC open in a new window',NULL,'YesNo');
169
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACURLOpenInNewWindow',0,'If ON, URLs in the OPAC open in a new window',NULL,'YesNo');
171
- 

Return to bug 7401