2 use HTML::Template::Pro;
4 #use warnings; FIXME - Bug 2505
15 my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
16 template_name => "tools/export.tt",
20 flagsrequired => { tools => 'export_catalog' },
24 my $op=$query->param("op");
25 my $format=$query->param("format");
26 if ($op eq "export") {
27 my $biblionumber = $query->param("bib");
30 my $marc = GetMarcBiblio($biblionumber, 1);
32 if ($format =~ /endnote/) {
33 $marc = marc2endnote($marc);
36 elsif ($format =~ /marcxml/) {
37 $marc = marc2marcxml($marc);
39 elsif ($format=~ /mods/) {
40 $marc = marc2modsxml($marc);
42 elsif ($format =~ /dc/) {
44 ($error,$marc) = marc2dcxml($marc,1);
45 $format = "dublin-core.xml";
47 elsif ($format =~ /marc8/) {
48 $marc = changeEncoding($marc,"MARC","MARC21","MARC-8");
49 $marc = $marc->as_usmarc();
51 elsif ($format =~ /utf8/) {
52 C4::Charset::SetUTF8Flag($marc, 1);
53 $marc = $marc->as_usmarc();
56 -type => 'application/octet-stream',
57 -attachment=>"bib-$biblionumber.$format");