3 #use warnings; FIXME - Bug 2505
14 my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
15 template_name => "tools/export.tt",
19 flagsrequired => { tools => 'export_catalog' },
23 my $op=$query->param("op");
24 my $format=$query->param("format");
25 if ($op eq "export") {
26 my $biblionumber = $query->param("bib");
29 my $marc = GetMarcBiblio($biblionumber, 1);
31 if ($format =~ /endnote/) {
32 $marc = marc2endnote($marc);
35 elsif ($format =~ /marcxml/) {
36 $marc = marc2marcxml($marc);
38 elsif ($format=~ /mods/) {
39 $marc = marc2modsxml($marc);
41 elsif ($format =~ /dc/) {
43 ($error,$marc) = marc2dcxml($marc,1);
44 $format = "dublin-core.xml";
46 elsif ($format =~ /marc8/) {
47 $marc = changeEncoding($marc,"MARC","MARC21","MARC-8");
48 $marc = $marc->as_usmarc();
50 elsif ($format =~ /utf8/) {
51 C4::Charset::SetUTF8Flag($marc, 1);
52 $marc = $marc->as_usmarc();
55 -type => 'application/octet-stream',
56 -attachment=>"bib-$biblionumber.$format");