Bug 3638 Self Check Should Capture Hold Items
[koha.git] / tools / export.pl
index 4b3e3f5..d3d8646 100755 (executable)
@@ -47,16 +47,17 @@ my ($template, $loggedinuser, $cookie)
 
        my $limit_ind_branch=(C4::Context->preference('IndependantBranches') &&
               C4::Context->userenv &&
-              C4::Context->userenv->{flags} % 2 !=1  &&
+              !(C4::Context->userenv->{flags} & 1) &&
               C4::Context->userenv->{branch}?1:0);
        my $branches = GetBranches($limit_ind_branch);    
     my $branch                = $query->param("branch") || '';
-       if ( C4::Context->preference("IndependantBranches") ) {
+       if ( C4::Context->preference("IndependantBranches") &&
+         !(C4::Context->userenv->{flags} & 1) ) {
        $branch = C4::Context->userenv->{'branch'};
        }
 
 if ($op eq "export") {
-    binmode(STDOUT,":utf8");
+    binmode STDOUT, ':encoding(UTF-8)';
        print $query->header(   -type => 'application/octet-stream', 
                             -charset => 'utf-8',
                             -attachment=>$filename);