2 use HTML::Template::Pro;
4 #use warnings; FIXME - Bug 2505
14 my $op=$query->param("op");
15 my $format=$query->param("format");
16 if ($op eq "export") {
17 my $biblionumber = $query->param("bib");
18 my $dbh=C4::Context->dbh;
21 $sth=$dbh->prepare("SELECT marc FROM biblioitems WHERE biblionumber =?");
22 $sth->execute($biblionumber);
24 while (my ($marc) = $sth->fetchrow) {
27 if ($format =~ /endnote/) {
28 $marc = marc2endnote($marc);
31 elsif ($format =~ /marcxml/) {
32 $marc = marc2marcxml($marc);
34 elsif ($format=~ /mods/) {
35 $marc = marc2modsxml($marc);
37 elsif ($format =~ /dc/) {
39 ($error,$marc) = marc2dcxml($marc,1);
40 $format = "dublin-core.xml";
42 elsif ($format =~ /marc8/) {
43 $marc = changeEncoding($marc,"MARC","MARC21","MARC-8");
44 $marc = $marc->as_usmarc();
46 elsif ($format =~ /utf8/) {
50 -type => 'application/octet-stream',
51 -attachment=>"bib-$biblionumber.$format");