The OPAC offers RIS and BIBTEX as choices for bibliographic downloads,
but the staff client is missing these options. This patch adds them.

This patch depends on Bug 9663.

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.
---
 catalogue/export.pl                                |   14 ++++++++++++++
 .../intranet-tmpl/prog/en/includes/cat-toolbar.inc |    4 +++-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/catalogue/export.pl b/catalogue/export.pl
index 26e189b..935dd6b 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 6936532..3d20dff 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc
@@ -144,12 +144,14 @@
                         });
                }
                var savemenu = [
+            { text: _("BIBTEX"), url: 
"/cgi-bin/koha/catalogue/export.pl?format=bibtex&op=export&bib=[% biblionumber 
%]" },
                        { text: _("MODS (XML)"), url: 
"/cgi-bin/koha/catalogue/export.pl?format=mods&op=export&bib=[% biblionumber 
%]" },
                        { text: _("Dublin Core (XML)"), url: 
"/cgi-bin/koha/catalogue/export.pl?format=dc&op=export&bib=[% biblionumber %]" 
},
                        { text: _("MARCXML"), url: 
"/cgi-bin/koha/catalogue/export.pl?format=marcxml&op=export&bib=[% biblionumber 
%]" },
                        { text: _("MARC (non-Unicode/MARC-8)"), url: 
"/cgi-bin/koha/catalogue/export.pl?format=marc8&op=export&bib=[% biblionumber 
%]" },
             { text: _("MARC (Unicode/UTF-8)"), url: 
"/cgi-bin/koha/catalogue/export.pl?format=utf8&op=export&bib=[% biblionumber 
%]" },
-            { text: _("MARC (Unicode/UTF-8, Standard)"), url: 
"/cgi-bin/koha/catalogue/export.pl?format=marcstd&op=export&bib=[% biblionumber 
%]" }
+            { text: _("MARC (Unicode/UTF-8, Standard)"), url: 
"/cgi-bin/koha/catalogue/export.pl?format=marcstd&op=export&bib=[% biblionumber 
%]" },
+            { text: _("RIS"), url: 
"/cgi-bin/koha/catalogue/export.pl?format=ris&op=export&bib=[% biblionumber %]" 
},
                ];
 
            new YAHOO.widget.Button({
-- 
1.7.9.5
_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to