From 6c36b83ad7c2727367d75cfbfcc47c5ce9ea8c5b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 16 Aug 2016 13:56:19 +0100 Subject: [PATCH] Bug 9569: AutoLocation should not depend on IndependentBranches Those 2 prefs can be independent and it does not make sense to consider AutoLocation only if IndependentBranches is set. Signed-off-by: Chris Cormack Signed-off-by: Nick Clemens Signed-off-by: Mason James --- C4/Auth.pm | 5 +++-- .../intranet-tmpl/prog/en/modules/auth.tt | 22 +++++++++---------- .../prog/en/modules/circ/circulation-home.tt | 2 +- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index b99b70b9a9..55722bda78 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -1078,8 +1078,9 @@ sub checkauth { $branchcode = $query->param('branch'); $branchname = GetBranchName($branchcode); } - my $branches = GetBranches(); - if ( C4::Context->boolean_preference('IndependentBranches') && C4::Context->boolean_preference('Autolocation') ) { + + my $branches = { map { $_->branchcode => $_->unblessed } Koha::Libraries->search }; + if ( C4::Context->boolean_preference('AutoLocation') ) { # we have to check they are coming from the right ip range my $domain = $branches->{$branchcode}->{'branchip'}; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt index 411c563a1d..070a0f1843 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt @@ -52,17 +52,17 @@

-[% IF ( AutoLocation ) %][% ELSE %] -[% IF ( IndependentBranches ) %][% ELSE %] -

- -

[% END %] - [% END %] +[% UNLESS IndependentBranches %] +

+ + +

+[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt index fdd361fbb1..dd99860a69 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt @@ -24,7 +24,7 @@ [% IF ( display_transfer ) %]
  • Transfer
  • [% END %] - [% IF ( AutoLocation ) %][% ELSE %][% IF ( IndependentBranches ) %][% ELSE %]
  • Set library
  • [% END %][% END %] + [% UNLESS IndependentBranches %]
  • Set library
  • [% END %] [% IF ( fast_cataloging ) %] [% IF ( CAN_user_editcatalogue_fast_cataloging ) %]
  • Fast cataloging
  • -- 2.39.5