Bug 10277 - Add C4::Context->IsSuperLibrarian()
[koha_fer] / cataloguing / addbiblio.pl
index 5069af9..4b1cd95 100755 (executable)
@@ -172,10 +172,11 @@ sub build_authorized_values_list {
     #---- branch
     if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) {
         #Use GetBranches($onlymine)
-        my $onlymine=C4::Context->preference('IndependentBranches') &&
-                C4::Context->userenv && 
-                C4::Context->userenv->{flags} % 2 == 0 && 
-                C4::Context->userenv->{branch};
+        my $onlymine =
+             C4::Context->preference('IndependentBranches')
+          && C4::Context->userenv
+          && !C4::Context->IsSuperLibrarian()
+          && C4::Context->userenv->{branch};
         my $branches = GetBranches($onlymine);
         my @branchloop;
         foreach my $thisbranch ( sort keys %$branches ) {