@@ -, +, @@ RIS export type --- C4/Ris.pm | 18 ++++++++++++++++-- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 6 ++++++ .../prog/en/modules/admin/preferences/cataloguing.pref | 6 ++++++ 4 files changed, 29 insertions(+), 2 deletions(-) --- a/C4/Ris.pm +++ a/C4/Ris.pm @@ -64,6 +64,8 @@ package C4::Ris; use vars qw($VERSION @ISA @EXPORT); +use C4::Biblio qw(GetMarcSubfieldStructureFromKohaField); + # set the version for version checking $VERSION = 3.07.00.049; @@ -117,8 +119,20 @@ sub marc2ris { ## else: other MARC formats do not specify the character encoding ## we assume it's *not* UTF-8 - ## start RIS dataset - &print_typetag($leader); + ## start RIS dataset + if ( C4::Context->preference('RisUseItemtypeAsType') ) { + my $s = GetMarcSubfieldStructureFromKohaField('biblioitems.itemtype'); + my $type = $record->subfield( $s->{tagfield}, $s->{tagsubfield} ); + if ($type) { + print "TY - $type\r\n"; + } + else { + &print_typetag($leader); + } + } + else { + &print_typetag($leader); + } ## retrieve all author fields and collect them in a list my @author_fields; --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -344,6 +344,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('ReturnToShelvingCart','0','','If set, when any item is \'checked in\', it\'s location code will be changed to CART.','YesNo'), ('reviewson','1','','If ON, enables patron reviews of bibliographic records in the OPAC','YesNo'), ('RisExportAdditionalFields', '', NULL , 'Define additional RIS tags to export from MARC records in YAML format as an associative array with either a marc tag/subfield combination as the value, or a list of tag/subfield combinations.', 'textarea'), +('RisUseItemtypeAsType', '0', NULL , 'Use biblio.itemtype for RIS export type if set', 'YesNo'), ('RoutingListAddReserves','1','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'), ('RoutingListNote','To change this note edit RoutingListNote system preference.','70|10','Define a note to be shown on all routing lists','Textarea'), ('RoutingSerials','1',NULL,'If ON, serials routing is enabled','YesNo'), --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -8958,6 +8958,12 @@ if ( CheckVersion($DBversion) ) { INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('RisExportAdditionalFields', '', NULL , 'Define additional RIS tags to export from MARC records in YAML format as an associative array with either a marc tag/subfield combination as the value, or a list of tag/subfield combinations.', 'textarea') }); + + $dbh->do(q{ + INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES + ('RisUseItemtypeAsType', '0', NULL , 'Use biblio.itemtype for RIS export type if set', 'YesNo') + }); + print "Upgrade to $DBversion done (Bug XXX - Add ability to export arbitrary MARC fields for RIS and BibTex)\n"; SetVersion($DBversion); } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref @@ -209,3 +209,9 @@ Cataloging: - "To specificy multiple marc tags/subfields as targets for a repeating RIS tag, use the following format: RIS_TAG: [TAG2$SUBFIELD1, TAG2$SUBFIELD2] ( e.g. XY: [501$a, 505$g] )" - "
" - "All values of repeating tags and subfields will be printed with the given RIS tag." + - + - pref: RisUseItemtypeAsType + choices: + yes: "Do" + no: "Do not" + - use the record level itemtype code for the TY field if it is set. If it is not set, the default TY field handler will be used. --