Bugzilla – Attachment 56476 Details for
Bug 16245
RIS export file type incorrect
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16245: RIS export file type incorrect
Bug-16245-RIS-export-file-type-incorrect.patch (text/plain), 4.84 KB, created by
Marcel de Rooy
on 2016-10-14 08:25:59 UTC
(
hide
)
Description:
Bug 16245: RIS export file type incorrect
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2016-10-14 08:25:59 UTC
Size:
4.84 KB
patch
obsolete
>From 5936357d0343ba401f2b451a06c3bb3780e0b055 Mon Sep 17 00:00:00 2001 >From: Hector Castro <hector.hecaxmmx@gmail.com> >Date: Wed, 28 Sep 2016 15:29:37 -0600 >Subject: [PATCH] Bug 16245: RIS export file type incorrect >Content-Type: text/plain; charset=utf-8 > >When exporting lists to a RIS file, the TY field of the RIS file is always >'book' even if the item being exported is a journal or serial. >Since unimarc and marc21 is coded in Koha, just a few references types are >included. This needs a much better code. > >This bug changes only TY BOOK result. Other resources needs a case by case >basis. > >To test: >-In advanced search limit by itemtype (books, music, continue resources, etc). >-Search and save result in Cart >-Export to RIS Format and notice about the new TY change with all materials >-Export record in bib record details page in OPAC and Intranet. >-Confirm that works as expected. >-Bonus test: >-Try to import the RIS file in http://www.myendnoteweb.com if you >have account or create one. >NOTE: According with previous comment, some values has changed. > >Sponsored-by: Universidad de El Salvador >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Ris.pm | 86 +++++++++++++++++++++++++++++++++++-------------------------- > 1 file changed, 50 insertions(+), 36 deletions(-) > >diff --git a/C4/Ris.pm b/C4/Ris.pm >index 0932cbf..4b2a1a1 100644 >--- a/C4/Ris.pm >+++ b/C4/Ris.pm >@@ -41,6 +41,7 @@ package C4::Ris; > # Modified 2008 by BibLibre for Koha > # Modified 2011 by Catalyst > # Modified 2011 by Equinox Software, Inc. >+# Modified 2016 by Universidad de El Salvador > # > # This file is part of Koha. > # >@@ -349,41 +350,43 @@ sub print_typetag { > ## of the leader of a MARC record, the values are the RIS types > ## that might appropriately represent these types. > my %ustypehash = ( >- "a" => "BOOK", >- "c" => "MUSIC", >- "d" => "MUSIC", >- "e" => "MAP", >- "f" => "MAP", >- "g" => "ADVS", >- "i" => "SOUND", >- "j" => "SOUND", >- "k" => "ART", >- "m" => "DATA", >- "o" => "GEN", >- "p" => "GEN", >- "r" => "ART", >- "t" => "GEN", >- ); >- >+ "a" => "BOOK", >+ "c" => "MUSIC", >+ "d" => "MUSIC", >+ "e" => "MAP", >+ "f" => "MAP", >+ "g" => "ADVS", >+ "i" => "SOUND", >+ "j" => "SOUND", >+ "k" => "ART", >+ "m" => "DATA", >+ "o" => "GEN", >+ "p" => "GEN", >+ "r" => "ART", >+ "t" => "MANSCPT", >+ ); >+ > my %unitypehash = ( >- "a" => "BOOK", >- "b" => "BOOK", >- "c" => "MUSIC", >- "d" => "MUSIC", >- "e" => "MAP", >- "f" => "MAP", >- "g" => "ADVS", >- "i" => "SOUND", >- "j" => "SOUND", >- "k" => "ART", >- "l" => "ELEC", >- "m" => "ADVS", >- "r" => "ART", >- ); >- >+ "a" => "BOOK", >+ "b" => "MANSCPT", >+ "c" => "MUSIC", >+ "d" => "MUSIC", >+ "e" => "MAP", >+ "f" => "MAP", >+ "g" => "ADVS", >+ "i" => "SOUND", >+ "j" => "SOUND", >+ "k" => "ART", >+ "l" => "ELEC", >+ "m" => "GEN", >+ "r" => "ART", >+ ); >+ > ## The type of a MARC record is found at position 06 of the leader > my $typeofrecord = defined($leader) && length $leader >=6 ? > substr($leader, 6, 1): undef; >+ my $typeofrecord2 = defined($leader) && length $leader >=6 ? >+ substr($leader, 7, 1): undef; > > ## ToDo: for books, field 008 positions 24-27 might have a few more > ## hints >@@ -399,11 +402,22 @@ sub print_typetag { > } > > if (!defined $typeofrecord || !exists $typehash{$typeofrecord}) { >- print "TY - BOOK\r\n"; ## most reasonable default >- warn ("no type found - assume BOOK") if $marcprint; >- } >- else { >- print "TY - $typehash{$typeofrecord}\r\n"; >+ print "TY - GEN\r\n"; ## most reasonable default >+ warn ("no type found - assume GEN") if $marcprint; >+ } elsif ( $typeofrecord =~ "a" ) { >+ if ( $typeofrecord2 =~ "a" ) { >+ print "TY - GEN\r\n"; ## monographic component part >+ } elsif ( $typeofrecord2 =~ "b" || $typeofrecord2 =~ "s" ) { >+ print "TY - SER\r\n"; ## serial or serial component part >+ } elsif ( $typeofrecord2 =~ "m" ) { >+ print "TY - $typehash{$typeofrecord}\r\n"; ## book >+ } elsif ( $typeofrecord2 =~ "c" || $typeofrecord2 =~ "d" ) { >+ print "TY - GEN\r\n"; ## collections, part of collections or made-up collections >+ } elsif ( $typeofrecord2 =~ "i" ) { >+ print "TY - DATA\r\n"; ## updating loose-leafe as Dataset >+ } >+ } else { >+ print "TY - $typehash{$typeofrecord}\r\n"; > } > > ## use $typeofrecord as the return value, just in case >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16245
:
55896
|
55897
|
55941
|
56043
| 56476 |
56477