7 use C4
::AuthoritiesMarc
;
11 my ( $template, $loggedinuser, $cookie ) = get_template_and_user
(
13 template_name
=> "tools/export.tt",
16 flagsrequired
=> { catalogue
=> 1 },
21 my $op = $query->param("op");
22 my $format = $query->param("format");
24 if ( $op eq "export" ) {
25 my $authid = $query->param("authid");
28 my $marc = GetAuthority
($authid);
30 if ( $format =~ /marcxml/ ) {
31 $marc = marc2marcxml
($marc, 'UTF-8', C4
::Context
->preference("marcflavour") eq 'UNIMARC' ?
'UNIMARCAUTH' : 'MARC21' );
33 elsif ($format=~ /mads/) {
34 $marc = marc2madsxml
($marc);
36 elsif ( $format =~ /marc8/ ) {
37 $marc = changeEncoding
( $marc, "MARC", "MARC21", "MARC-8" );
38 $marc = $marc->as_usmarc();
40 elsif ( $format =~ /utf8/ ) {
41 C4
::Charset
::SetUTF8Flag
( $marc, 1 );
42 $marc = $marc->as_usmarc();
45 -type
=> 'application/octet-stream',
46 -attachment
=> "auth-$authid.$format"