Bug 31051: (QA follow-up) Simplify savings wording for reading history
[srvgit] / authorities / export.pl
index c6b8349..0703da8 100755 (executable)
@@ -1,22 +1,19 @@
 #!/usr/bin/perl
-use strict;
-use warnings;
+use Modern::Perl;
 
 use C4::Record;
-use C4::Auth;
+use C4::Auth qw( get_template_and_user );
 use C4::Output;
-use C4::AuthoritiesMarc;
-use CGI;
+use C4::AuthoritiesMarc qw( GetAuthority );
+use CGI qw ( -utf8 );
 
-my $query = new CGI;
+my $query = CGI->new;
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     {
         template_name   => "tools/export.tt",
         query           => $query,
         type            => "intranet",
-        authnotrequired => 0,
-        flagsrequired   => { editauthorities => 1 },
-        debug           => 1,
+        flagsrequired   => { catalogue => 1 },
     }
 );
 
@@ -30,7 +27,7 @@ if ( $op eq "export" ) {
         my $marc = GetAuthority($authid);
 
         if ( $format =~ /marcxml/ ) {
-            $marc = marc2marcxml($marc);
+            $marc = marc2marcxml($marc, 'UTF-8', C4::Context->preference("marcflavour") eq 'UNIMARC' ? 'UNIMARCAUTH' : 'MARC21' );
         }
         elsif ($format=~ /mads/) {
             $marc = marc2madsxml($marc);