@@ -, +, @@ insert into systempreferences (variable, value) values('singleBranchMode', 1); --- C4/Auth.pm | 3 ++- C4/Koha.pm | 6 ++---- C4/Search.pm | 3 ++- C4/UsageStats.pm | 1 - C4/XSLT.pm | 2 +- installer/data/mysql/sysprefs.sql | 1 - .../intranet-tmpl/prog/en/modules/admin/preferences/opac.pref | 7 ------- opac/opac-reserve.pl | 4 ++-- 8 files changed, 9 insertions(+), 18 deletions(-) --- a/C4/Auth.pm +++ a/C4/Auth.pm @@ -34,6 +34,7 @@ use C4::Search::History; use Koha; use Koha::AuthUtils qw(hash_password); use Koha::LibraryCategories; +use Koha::Libraries; use POSIX qw/strftime/; use List::MoreUtils qw/ any /; use Encode qw( encode is_utf8); @@ -422,7 +423,7 @@ sub get_template_and_user { hide_marc => C4::Context->preference("hide_marc"), item_level_itypes => C4::Context->preference('item-level_itypes'), patronimages => C4::Context->preference("patronimages"), - singleBranchMode => C4::Context->preference("singleBranchMode"), + singleBranchMode => ( Koha::Libraries->search->count == 1 ), XSLTDetailsDisplay => C4::Context->preference("XSLTDetailsDisplay"), XSLTResultsDisplay => C4::Context->preference("XSLTResultsDisplay"), using_https => $using_https, --- a/C4/Koha.pm +++ a/C4/Koha.pm @@ -756,8 +756,7 @@ sub getFacets { } ]; - unless ( C4::Context->preference("singleBranchMode") - || Koha::Libraries->search->count == 1 ) + unless ( Koha::Libraries->search->count == 1 ) { my $DisplayLibraryFacets = C4::Context->preference('DisplayLibraryFacets'); if ( $DisplayLibraryFacets eq 'both' @@ -838,8 +837,7 @@ sub getFacets { }, ]; - unless ( C4::Context->preference("singleBranchMode") - || Koha::Libraries->search->count == 1 ) + unless ( Koha::Libraries->search->count == 1 ) { my $DisplayLibraryFacets = C4::Context->preference('DisplayLibraryFacets'); if ( $DisplayLibraryFacets eq 'both' --- a/C4/Search.pm +++ a/C4/Search.pm @@ -31,6 +31,7 @@ use C4::Branch; use C4::Reserves; # GetReserveStatus use C4::Debug; use C4::Charset; +use Koha::Libraries; use YAML; use URI::Escape; use Business::ISBN; @@ -618,7 +619,7 @@ sub getRecords { $facets_info->{$link_value}->{'label_value'} =~ /Libraries/ ) - and ( C4::Context->preference('singleBranchMode') ) + and ( Koha::Libraries->search->count == 1 ) ); } } --- a/C4/UsageStats.pm +++ a/C4/UsageStats.pm @@ -268,7 +268,6 @@ sub BuildReport { OpacRenewalBranch OPACViewOthersSuggestions SearchMyLibraryFirst - singleBranchMode AnonSuggestions EnableOpacSearchHistory OPACPrivacy --- a/C4/XSLT.pm +++ a/C4/XSLT.pm @@ -204,7 +204,7 @@ sub XSLTParse4Display { UseAuthoritiesForTracings TraceSubjectSubdivisions Display856uAsImage OPACDisplay856uAsImage UseControlNumber IntranetBiblioDefaultView BiblioDefaultView - singleBranchMode OPACItemLocation DisplayIconsXSLT + OPACItemLocation DisplayIconsXSLT AlternateHoldingsField AlternateHoldingsSeparator TrackClicks opacthemes IdRef / ) { --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -423,7 +423,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('ShowPatronImageInWebBasedSelfCheck','0','','If ON, displays patron image when a patron uses web-based self-checkout','YesNo'), ('ShowReviewer','full','none|full|first|surname|firstandinitial|username','Choose how a commenter\'s identity is presented alongside comments in the OPAC','Choice'), ('ShowReviewerPhoto','1','','If ON, photo of reviewer will be shown beside comments in OPAC','YesNo'), -('singleBranchMode','0',NULL,'Operate in Single-branch mode, hide branch selection in the OPAC','YesNo'), ('SlipCSS','',NULL,'Slips CSS url.','free'), ('SMSSendDriver','','','Sets which SMS::Send driver is used to send SMS messages.','free'), ('SMSSendPassword', '', '', 'Password used to send SMS messages', 'free'), --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -485,13 +485,6 @@ OPAC: - the acquisition details on OPAC detail pages. Policy: - - - pref: singleBranchMode - default: 0 - choices: - yes: "Don't allow" - no: Allow - - patrons to select their branch on the OPAC or show branch names with callnumbers. - - - pref: SearchMyLibraryFirst choices: yes: Limit --- a/opac/opac-reserve.pl +++ a/opac/opac-reserve.pl @@ -35,8 +35,8 @@ use C4::Overdues; use C4::Debug; use Koha::DateUtils; use Koha::Borrower::Debarments qw(IsDebarred); +use Koha::Libraries; use Date::Calc qw/Today Date_to_Days/; -# use Data::Dumper; my $maxreserves = C4::Context->preference("maxreserves"); @@ -228,7 +228,7 @@ if ( $query->param('place_reserve') ) { my $canreserve = 0; - my $singleBranchMode = C4::Context->preference("singleBranchMode"); + my $singleBranchMode = Koha::Libraries->search->count == 1; if ( $singleBranchMode || !$OPACChooseBranch ) { # single branch mode or disabled user choosing $branch = $borr->{'branchcode'}; --