From 4b9a6d803f7ad11a4e077140820bfeda0d4d196a Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 31 May 2013 11:03:56 -0400 Subject: [PATCH] Bug 9665: add RIS and BIBTEXT bibliographic record export to staff interface The OPAC offers RIS and BIBTEX as choices for bibliographic downloads, but the staff client was missing these options. This patch adds them. To test, view a record in the staff client (detail.pl, MARCdetail.pl, etc.) and click the "Save..." toolbar button. BIBTEX and RIS should be available and functional. Signed-off-by: David Cook Signed-off-by: Chris Cormack Signed-off-by: Galen Charlton --- catalogue/export.pl | 14 ++++++++++++++ .../intranet-tmpl/prog/en/includes/cat-toolbar.inc | 9 +++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/catalogue/export.pl b/catalogue/export.pl index 26e189b2bb..935dd6bd73 100755 --- a/catalogue/export.pl +++ b/catalogue/export.pl @@ -7,6 +7,7 @@ use C4::Auth; use C4::Output; use C4::Biblio; use CGI; +use C4::Ris; @@ -35,10 +36,20 @@ if ($op eq "export") { } elsif ($format =~ /marcxml/) { $marc = marc2marcxml($marc); + $format = "marcxml"; } elsif ($format=~ /mods/) { $marc = marc2modsxml($marc); + $format = "mods"; } + elsif ($format =~ /ris/) { + $marc = marc2ris($marc); + $format = "ris"; + } + elsif ($format =~ /bibtex/) { + $marc = marc2bibtex($marc); + $format = "bibtex"; + } elsif ($format =~ /dc/) { ($error,$marc) = marc2dcxml($marc,1); $format = "dublin-core.xml"; @@ -46,14 +57,17 @@ if ($op eq "export") { elsif ($format =~ /marc8/) { $marc = changeEncoding($marc,"MARC","MARC21","MARC-8"); $marc = $marc->as_usmarc(); + $format = "marc8"; } elsif ($format =~ /utf8/) { C4::Charset::SetUTF8Flag($marc, 1); $marc = $marc->as_usmarc(); + $format = "utf8"; } elsif ($format =~ /marcstd/) { C4::Charset::SetUTF8Flag($marc,1); ($error, $marc) = marc2marc($marc, 'marcstd', C4::Context->preference('marcflavour')); + $format = "marcstd"; } print $query->header( -type => 'application/octet-stream', diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc index f669d2ce8f..3683ac938b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc @@ -173,13 +173,14 @@ CAN_user_serials_create_subscription ) %] -- 2.39.5