X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=tools%2Fexport.pl;h=d3d8646c4dafc46290f3d7c1344e27f807dfe210;hb=eefc774e274ce8167f1063be5f9204a0d5cf5650;hp=4a09868e59acde8ef44b95ad58f8990adfc2ae80;hpb=d8a36ca1f80460029ec5442fb1bf5de8b00a2138;p=koha_gimpoz diff --git a/tools/export.pl b/tools/export.pl index 4a09868e59..d3d8646c4d 100755 --- a/tools/export.pl +++ b/tools/export.pl @@ -20,7 +20,7 @@ use strict; use warnings; use C4::Auth; -use C4::Output; # contains gettemplate +use C4::Output; use C4::Biblio; # GetMarcBiblio GetXmlBiblio use CGI; use C4::Koha; # GetItemTypes @@ -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);