2 use HTML
::Template
::Pro
;
15 my $op=$query->param("op");
16 my $format=$query->param("format");
17 if ($op eq "export") {
18 my $biblionumber = $query->param("bib");
19 my $dbh=C4
::Context
->dbh;
22 $sth=$dbh->prepare("SELECT marc FROM biblioitems WHERE biblionumber =?");
23 $sth->execute($biblionumber);
25 while (my ($marc) = $sth->fetchrow) {
28 if ($format =~ /endnote/) {
29 $marc = marc2endnote
($marc);
32 elsif ($format =~ /marcxml/) {
33 $marc = marc2marcxml
($marc);
35 elsif ($format=~ /mods/) {
36 $marc = marc2modsxml
($marc);
38 elsif ($format =~ /ris/) {
39 $marc = marc2ris
(MARC
::Record
->new_from_usmarc($marc));
41 elsif ($format =~ /bibtex/) {
43 ($error,$marc) = marc2bibtex
(C4
::Biblio
::GetMarcBiblio
($biblionumber),$biblionumber);
44 }elsif ($format =~ /dc/) {
46 ($error,$marc) = marc2dcxml
($marc,1);
47 $format = "dublin-core.xml";
49 elsif ($format =~ /marc8/) {
50 $marc = changeEncoding
($marc,"MARC","MARC21","MARC-8");
51 $marc = $marc->as_usmarc();
53 elsif ($format =~ /utf8/) {
57 -type
=> 'application/octet-stream',
58 -attachment
=>"bib-$biblionumber.$format");