Bug 9569: AutoLocation should not depend on IndependentBranches
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 16 Aug 2016 12:56:19 +0000 (13:56 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Mon, 30 Jan 2017 11:25:05 +0000 (11:25 +0000)
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 <chrisc@catalyst.net.nz>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

C4/Auth.pm
koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt

index f82a062..9b3e893 100644 (file)
@@ -1051,7 +1051,7 @@ sub checkauth {
                         $branchname = $library? $library->branchname: '';
                     }
                     my $branches = { map { $_->branchcode => $_->unblessed } Koha::Libraries->search };
-                    if ( C4::Context->boolean_preference('IndependentBranches') && C4::Context->boolean_preference('Autolocation') ) {
+                    if ( C4::Context->boolean_preference('AutoLocation') ) {
 
                         # we have to check they are coming from the right ip range
                         my $domain = $branches->{$branchcode}->{'branchip'};
index 82743dd..79b5d15 100644 (file)
 <input type="password" name="password" id="password" class="input" value="" size="20" tabindex="2" />
 </p>
 
-[% IF ( AutoLocation ) %][% ELSE %]
-[% IF ( IndependentBranches ) %][% ELSE %]
-<p><label for="branch">Library:</label>
-    <select name="branch" id="branch" class="input" tabindex="3">
-    <option value="">My library</option>
-    [% FOREACH l IN Branches.all( unfiltered => 1 ) %]
-        <option value="[% l.branchcode %]">[% l.branchname %]</option>
-    [% END %]
-    </select>
-    </p>[% END %]
-       [% END %]
+[% UNLESS IndependentBranches %]
+    <p>
+        <label for="branch">Library:</label>
+        <select name="branch" id="branch" class="input" tabindex="3">
+            <option value="">My library</option>
+            [% FOREACH l IN Branches.all( unfiltered => 1 ) %]
+                <option value="[% l.branchcode %]">[% l.branchname %]</option>
+            [% END %]
+        </select>
+    </p>
+[% END %]
 
 <!-- <p><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="3" />Remember me</label></p> -->
 
index 48f4f8d..e2a129c 100644 (file)
@@ -24,7 +24,7 @@
     [% IF ( display_transfer ) %]
                <li><a href="/cgi-bin/koha/circ/branchtransfers.pl">Transfer</a></li>
     [% END %]
-    [% IF ( AutoLocation ) %][% ELSE %][% IF ( IndependentBranches ) %][% ELSE %]<li><a href="/cgi-bin/koha/circ/selectbranchprinter.pl">Set library</a></li>[% END %][% END %]
+    [% UNLESS IndependentBranches %]<li><a href="/cgi-bin/koha/circ/selectbranchprinter.pl">Set library</a></li>[% END %]
        [% IF ( fast_cataloging ) %]
            [% IF ( CAN_user_editcatalogue_fast_cataloging ) %]
                <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=FA">Fast cataloging</a></li>