2 use HTML::Template::Pro;
13 my $op=$query->param("op");
14 my $format=$query->param("format");
15 if ($op eq "export") {
16 my $biblionumber = $query->param("bib");
17 my $dbh=C4::Context->dbh;
20 $sth=$dbh->prepare("SELECT marc FROM biblioitems WHERE biblionumber =?");
21 $sth->execute($biblionumber);
23 while (my ($marc) = $sth->fetchrow) {
26 if ($format =~ /endnote/) {
27 $marc = marc2endnote($marc);
30 elsif ($format =~ /marcxml/) {
31 $marc = marc2marcxml($marc);
33 elsif ($format=~ /mods/) {
34 $marc = marc2modsxml($marc);
36 elsif ($format =~ /dc/) {
38 ($error,$marc) = marc2dcxml($marc,1);
39 $format = "dublin-core.xml";
41 elsif ($format =~ /marc8/) {
42 $marc = changeEncoding($marc,"MARC","MARC21","MARC-8");
43 $marc = $marc->as_usmarc();
45 elsif ($format =~ /utf8/) {
49 -type => 'application/octet-stream',
50 -attachment=>"bib-$biblionumber.$format");