@@ -, +, @@ --- C4/Auth.pm | 2 +- C4/XSLT.pm | 2 +- Koha/Libraries.pm | 6 +++--- opac/opac-reserve.pl | 2 +- t/db_dependent/Koha/Libraries.t | 8 ++++---- 5 files changed, 10 insertions(+), 10 deletions(-) --- a/C4/Auth.pm +++ a/C4/Auth.pm @@ -457,7 +457,7 @@ sub get_template_and_user { my $minPasswordLength = C4::Context->preference('minPasswordLength'); $minPasswordLength = 3 if not $minPasswordLength or $minPasswordLength < 3; - my $singleLibraryMode = Koha::Libraries->singleLibraryMode; + my $singleLibraryMode = Koha::Libraries->single_library_mode; $template->param( EnhancedMessagingPreferences => C4::Context->preference('EnhancedMessagingPreferences'), GoogleJackets => C4::Context->preference("GoogleJackets"), --- a/C4/XSLT.pm +++ a/C4/XSLT.pm @@ -107,7 +107,7 @@ sub get_xslt_sysprefs { # singleBranchMode was a system preference, but no longer is # we can retain it here for compatibility - my $singleBranchMode = Koha::Libraries->singleLibraryMode; + my $singleBranchMode = Koha::Libraries->single_library_mode; $sysxml .= "$singleBranchMode\n"; $sysxml .= "\n"; --- a/Koha/Libraries.pm +++ a/Koha/Libraries.pm @@ -64,17 +64,17 @@ sub search_filtered { return $self->SUPER::search( $params, $attributes ); } -=head3 singleLibraryMode +=head3 single_library_mode Aka singleBranchMode. - my $boolean = Koha::Libraries->singleLibaryMode; + my $boolean = Koha::Libraries->single_library_mode; Returns 1 if there is only one library marked public. =cut -sub singleLibraryMode { # formerly called singleBranchMode +sub single_library_mode { # formerly called singleBranchMode my $self = shift; if( $self->search({ public => 1 })->count == 1 ) { # Historically we test number==1 instead of number<2 return 1; --- a/opac/opac-reserve.pl +++ a/opac/opac-reserve.pl @@ -226,7 +226,7 @@ if ( $query->param('place_reserve') ) { my $canreserve = 0; - my $singleBranchMode = Koha::Libraries->singleLibraryMode; + my $singleBranchMode = Koha::Libraries->single_library_mode; if ( $singleBranchMode || ! C4::Context->preference("OPACAllowUserToChooseBranch") ) { # single branch mode or disabled user choosing $branch = $patron->branchcode; --- a/t/db_dependent/Koha/Libraries.t +++ a/t/db_dependent/Koha/Libraries.t @@ -366,16 +366,16 @@ subtest 'outgoing_transfers' => sub { $schema->storage->txn_rollback; }; -subtest 'singleLibrarymode aka singleBranchMode' => sub { +subtest 'single_library_mode aka singleBranchMode' => sub { plan tests => 3; $schema->storage->txn_begin; Koha::Libraries->new->update({ public => 0 }); - is( Koha::Libraries->singleLibraryMode, 0, 'No public libraries' ); + is( Koha::Libraries->single_library_mode, 0, 'No public libraries' ); my $library1 = $builder->build_object({ class => 'Koha::Libraries', value => { public => 1 } }); - is( Koha::Libraries->singleLibraryMode, 1, 'One public library' ); + is( Koha::Libraries->single_library_mode, 1, 'One public library' ); my $library2 = $builder->build_object({ class => 'Koha::Libraries', value => { public => 1 } }); - is( Koha::Libraries->singleLibraryMode, 0, 'Two public libraries' ); + is( Koha::Libraries->single_library_mode, 0, 'Two public libraries' ); $schema->storage->txn_rollback; }; --