Some libraries would like to be able to add arbitrary fields to both the RIS and BibTeX citation formats that a record can be saved as from the staff intranet and public catalog. In addition, they would like to be able to override the default record type and use Koha's itemtype as the record type for those formats as well.
Created attachment 28646 [details] [review] Bug 12357 [1] - Add ability to export arbitrary fields for RIS format Some libraries would like to be able to add arbitrary fields to both the RIS and BibTeX citation formats that a record can be saved as from the staff intranet and public catalog. In addition, they would like to be able to override the default record type and use Koha's itemtype as the record type for those formats as well. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Add the following to the new syspref RisExportAdditionalFields: LC: 010$a NT: [501$a, 505$g] 4) Find or create a record with an 010$a (lccn) field, a 501$a field and multiple 505$g fields. 5) Locate the record in the catalog, choose "Save" and select RIS 6) Inspect the downloaded file, note the LC and multiple NT fields
Created attachment 28647 [details] [review] Bug 12357 [2] - Add ability to use record level itemtype for RIS export type Some libraries would like to be able to add arbitrary fields to both the RIS and BibTeX citation formats that a record can be saved as from the staff intranet and public catalog. In addition, they would like to be able to override the default record type and use Koha's itemtype as the record type for those formats as well. Test Plan: 1) Apply this patch 2) Run updatedatabase 3) Enable the new system preference RisUseItemtypeAsType 4) Choose a record that has a set biblio level itemtype 5) Save this record as RIS 6) View the record, note the TY field is your record's itemtype code
Created attachment 28648 [details] [review] Bug 12357 [3]- Add ability to export arbitrary fields for BibTex format Some libraries would like to be able to add arbitrary fields to both the RIS and BibTeX citation formats that a record can be saved as from the staff intranet and public catalog. In addition, they would like to be able to override the default record type and use Koha's itemtype as the record type for those formats as well. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Add the following to the new syspref BibtexExportAdditionalFields: lccn: 010$a notes: [501$a, 505$g] 4) Find or create a record with an 010$a (lccn) field, a 501$a field and multiple 505$g fields. 5) Locate the record in the catalog, choose "Save" and select BIBTEX 6) Inspect the downloaded file, note the lccn and multiple note fields
Created attachment 28649 [details] [review] Bug 12357 [4] - Add ability to use record level itemtype for BibTeX export type Some libraries would like to be able to add arbitrary fields to both the RIS and BibTeX citation formats that a record can be saved as from the staff intranet and public catalog. In addition, they would like to be able to override the default record type and use Koha's itemtype as the record type for those formats as well. Test Plan: 1) Apply this patch 2) Run updatedatabase 3) Enable the new system preference BibUseItemtypeAsType 4) Choose a record that has a set biblio level itemtype 5) Save this record as BIBTEX 6) View the record, note that instead of @BOOK, the type is your record's itemtype code
Created attachment 28650 [details] [review] Bug 12357 [4] - Add ability to use record level itemtype for BibTeX export type Some libraries would like to be able to add arbitrary fields to both the RIS and BibTeX citation formats that a record can be saved as from the staff intranet and public catalog. In addition, they would like to be able to override the default record type and use Koha's itemtype as the record type for those formats as well. Test Plan: 1) Apply this patch 2) Run updatedatabase 3) Enable the new system preference BibUseItemtypeAsType 4) Choose a record that has a set biblio level itemtype 5) Save this record as BIBTEX 6) View the record, note that instead of @BOOK, the type is your record's itemtype code
Just thought I'd ask how this might interact with Bug 11592.
Created attachment 29291 [details] [review] Bug 12357 [1] - Add ability to export arbitrary fields for RIS format Some libraries would like to be able to add arbitrary fields to both the RIS and BibTeX citation formats that a record can be saved as from the staff intranet and public catalog. In addition, they would like to be able to override the default record type and use Koha's itemtype as the record type for those formats as well. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Add the following to the new syspref RisExportAdditionalFields: LC: 010$a NT: [501$a, 505$g] 4) Find or create a record with an 010$a (lccn) field, a 501$a field and multiple 505$g fields. 5) Locate the record in the catalog, choose "Save" and select RIS 6) Inspect the downloaded file, note the LC and multiple NT fields
Created attachment 29292 [details] [review] Bug 12357 [2] - Add ability to use record level itemtype for RIS export type Some libraries would like to be able to add arbitrary fields to both the RIS and BibTeX citation formats that a record can be saved as from the staff intranet and public catalog. In addition, they would like to be able to override the default record type and use Koha's itemtype as the record type for those formats as well. Test Plan: 1) Apply this patch 2) Run updatedatabase 3) Enable the new system preference RisUseItemtypeAsType 4) Choose a record that has a set biblio level itemtype 5) Save this record as RIS 6) View the record, note the TY field is your record's itemtype code
Created attachment 29293 [details] [review] Bug 12357 [3]- Add ability to export arbitrary fields for BibTex format Some libraries would like to be able to add arbitrary fields to both the RIS and BibTeX citation formats that a record can be saved as from the staff intranet and public catalog. In addition, they would like to be able to override the default record type and use Koha's itemtype as the record type for those formats as well. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Add the following to the new syspref BibtexExportAdditionalFields: lccn: 010$a notes: [501$a, 505$g] 4) Find or create a record with an 010$a (lccn) field, a 501$a field and multiple 505$g fields. 5) Locate the record in the catalog, choose "Save" and select BIBTEX 6) Inspect the downloaded file, note the lccn and multiple note fields
Created attachment 29294 [details] [review] Bug 12357 [4] - Add ability to use record level itemtype for BibTeX export type Some libraries would like to be able to add arbitrary fields to both the RIS and BibTeX citation formats that a record can be saved as from the staff intranet and public catalog. In addition, they would like to be able to override the default record type and use Koha's itemtype as the record type for those formats as well. Test Plan: 1) Apply this patch 2) Run updatedatabase 3) Enable the new system preference BibUseItemtypeAsType 4) Choose a record that has a set biblio level itemtype 5) Save this record as BIBTEX 6) View the record, note that instead of @BOOK, the type is your record's itemtype code
Created attachment 29295 [details] [review] Bug 12357 [2] - Add ability to use record level itemtype for RIS export type Some libraries would like to be able to add arbitrary fields to both the RIS and BibTeX citation formats that a record can be saved as from the staff intranet and public catalog. In addition, they would like to be able to override the default record type and use Koha's itemtype as the record type for those formats as well. Test Plan: 1) Apply this patch 2) Run updatedatabase 3) Enable the new system preference RisUseItemtypeAsType 4) Choose a record that has a set biblio level itemtype 5) Save this record as RIS 6) View the record, note the TY field is your record's itemtype code
Created attachment 29296 [details] [review] Bug 12357 [3]- Add ability to export arbitrary fields for BibTex format Some libraries would like to be able to add arbitrary fields to both the RIS and BibTeX citation formats that a record can be saved as from the staff intranet and public catalog. In addition, they would like to be able to override the default record type and use Koha's itemtype as the record type for those formats as well. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Add the following to the new syspref BibtexExportAdditionalFields: lccn: 010$a notes: [501$a, 505$g] 4) Find or create a record with an 010$a (lccn) field, a 501$a field and multiple 505$g fields. 5) Locate the record in the catalog, choose "Save" and select BIBTEX 6) Inspect the downloaded file, note the lccn and multiple note fields
Created attachment 29297 [details] [review] Bug 12357 [4] - Add ability to use record level itemtype for BibTeX export type Some libraries would like to be able to add arbitrary fields to both the RIS and BibTeX citation formats that a record can be saved as from the staff intranet and public catalog. In addition, they would like to be able to override the default record type and use Koha's itemtype as the record type for those formats as well. Test Plan: 1) Apply this patch 2) Run updatedatabase 3) Enable the new system preference BibUseItemtypeAsType 4) Choose a record that has a set biblio level itemtype 5) Save this record as BIBTEX 6) View the record, note that instead of @BOOK, the type is your record's itemtype code
Created attachment 31677 [details] [review] Bug 12357 [1] - Add ability to export arbitrary fields for RIS format Some libraries would like to be able to add arbitrary fields to both the RIS and BibTeX citation formats that a record can be saved as from the staff intranet and public catalog. In addition, they would like to be able to override the default record type and use Koha's itemtype as the record type for those formats as well. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Add the following to the new syspref RisExportAdditionalFields: LC: 010$a NT: [501$a, 505$g] 4) Find or create a record with an 010$a (lccn) field, a 501$a field and multiple 505$g fields. 5) Locate the record in the catalog, choose "Save" and select RIS 6) Inspect the downloaded file, note the LC and multiple NT fields
Created attachment 31678 [details] [review] Bug 12357 [2] - Add ability to use record level itemtype for RIS export type Some libraries would like to be able to add arbitrary fields to both the RIS and BibTeX citation formats that a record can be saved as from the staff intranet and public catalog. In addition, they would like to be able to override the default record type and use Koha's itemtype as the record type for those formats as well. Test Plan: 1) Apply this patch 2) Run updatedatabase 3) Enable the new system preference RisUseItemtypeAsType 4) Choose a record that has a set biblio level itemtype 5) Save this record as RIS 6) View the record, note the TY field is your record's itemtype code
Created attachment 31679 [details] [review] Bug 12357 [3]- Add ability to export arbitrary fields for BibTex format Some libraries would like to be able to add arbitrary fields to both the RIS and BibTeX citation formats that a record can be saved as from the staff intranet and public catalog. In addition, they would like to be able to override the default record type and use Koha's itemtype as the record type for those formats as well. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Add the following to the new syspref BibtexExportAdditionalFields: lccn: 010$a notes: [501$a, 505$g] 4) Find or create a record with an 010$a (lccn) field, a 501$a field and multiple 505$g fields. 5) Locate the record in the catalog, choose "Save" and select BIBTEX 6) Inspect the downloaded file, note the lccn and multiple note fields
Created attachment 31680 [details] [review] Bug 12357 [4] - Add ability to use record level itemtype for BibTeX export type Some libraries would like to be able to add arbitrary fields to both the RIS and BibTeX citation formats that a record can be saved as from the staff intranet and public catalog. In addition, they would like to be able to override the default record type and use Koha's itemtype as the record type for those formats as well. Test Plan: 1) Apply this patch 2) Run updatedatabase 3) Enable the new system preference BibUseItemtypeAsType 4) Choose a record that has a set biblio level itemtype 5) Save this record as BIBTEX 6) View the record, note that instead of @BOOK, the type is your record's itemtype code
Created attachment 33123 [details] [review] Bug 12357 [1] - Add ability to export arbitrary fields for RIS format Some libraries would like to be able to add arbitrary fields to both the RIS and BibTeX citation formats that a record can be saved as from the staff intranet and public catalog. In addition, they would like to be able to override the default record type and use Koha's itemtype as the record type for those formats as well. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Add the following to the new syspref RisExportAdditionalFields: LC: 010$a NT: [501$a, 505$g] 4) Find or create a record with an 010$a (lccn) field, a 501$a field and multiple 505$g fields. 5) Locate the record in the catalog, choose "Save" and select RIS 6) Inspect the downloaded file, note the LC and multiple NT fields Signed-off-by: Frederic Demians <f.demians@tamil.fr> Tested with unimarc db. Populating RisExportAdditionalFields, RIS exported records can contain new RIS specific fields populated by field/subfield.
Created attachment 33124 [details] [review] Bug 12357 [2] - Add ability to use record level itemtype for RIS export type Some libraries would like to be able to add arbitrary fields to both the RIS and BibTeX citation formats that a record can be saved as from the staff intranet and public catalog. In addition, they would like to be able to override the default record type and use Koha's itemtype as the record type for those formats as well. Test Plan: 1) Apply this patch 2) Run updatedatabase 3) Enable the new system preference RisUseItemtypeAsType 4) Choose a record that has a set biblio level itemtype 5) Save this record as RIS 6) View the record, note the TY field is your record's itemtype code Signed-off-by: Frederic Demians <f.demians@tamil.fr> I confirm that with this patch TY RIS field can contain biblioitems.itemtype field.
Created attachment 33125 [details] [review] Bug 12357 [3]- Add ability to export arbitrary fields for BibTex format Some libraries would like to be able to add arbitrary fields to both the RIS and BibTeX citation formats that a record can be saved as from the staff intranet and public catalog. In addition, they would like to be able to override the default record type and use Koha's itemtype as the record type for those formats as well. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Add the following to the new syspref BibtexExportAdditionalFields: lccn: 010$a notes: [501$a, 505$g] 4) Find or create a record with an 010$a (lccn) field, a 501$a field and multiple 505$g fields. 5) Locate the record in the catalog, choose "Save" and select BIBTEX 6) Inspect the downloaded file, note the lccn and multiple note fields Signed-off-by: Frederic Demians <f.demians@tamil.fr> Similar to RIS patch [1]. Functionnal.
Created attachment 33126 [details] [review] Bug 12357 [4] - Add ability to use record level itemtype for BibTeX export type Some libraries would like to be able to add arbitrary fields to both the RIS and BibTeX citation formats that a record can be saved as from the staff intranet and public catalog. In addition, they would like to be able to override the default record type and use Koha's itemtype as the record type for those formats as well. Test Plan: 1) Apply this patch 2) Run updatedatabase 3) Enable the new system preference BibUseItemtypeAsType 4) Choose a record that has a set biblio level itemtype 5) Save this record as BIBTEX 6) View the record, note that instead of @BOOK, the type is your record's itemtype code Signed-off-by: Frederic Demians <f.demians@tamil.fr> Similar to RIS [2] patch. Functionnal.
I have a few concerns about this feature: I think we have several features here on one bug report, so it's a bit hard to work through. I really like the idea of the arbitrary fields, but I am concerned about using the record level itemtype. This seems to assume that different itemtypes are used for different type of media. I am not sure this is how all libraries use itemtypes in Koha, some differentiate by loan types. But this is just a note, my main concern is about the missing flexibility for existing installations. If you are a long term user of Koha you would probably have to change all your itemtype codes in order to be able to make good use of the new feature. This feels quite problematic to me. I am not sure what's the best way to resolve this, some thoughts I had while reading through it: Instead of using a separate system preference, maybe allowing overwriting existing fields would be an option? Then you could use *ExportAdditionalFields with 942$c for the itemtype feature or even use another arbitrary field the library thinks is best suited. Or a little easier: allow defining the MARC subfield to use for the record type instead of hardcoding it?
> Instead of using a separate system preference, maybe allowing overwriting > existing fields would be an option? Then you could use > *ExportAdditionalFields with 942$c for the itemtype feature or even use > another arbitrary field the library thinks is best suited. That is a capital idea! I will be implementing this shortly!
Created attachment 35485 [details] [review] Bug 12357 - Enhancements to RIS and BibTeX exporting Some libraries would like to be able to add arbitrary fields to both the RIS and BibTeX citation formats that a record can be saved as from the staff intranet and public catalog. In addition, they would like to be able to override the default record type and use Koha's itemtype as the record type for those formats as well. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Add the following to the new syspref RisExportAdditionalFields: TY: 942$c LC: 010$a NT: [501$a, 505$g] 4) Find or create a record with an 010$a (lccn) field, a 501$a field, a 942$c field, and multiple 505$g fields. 5) Locate the record in the catalog, choose "Save" and select RIS 6) Inspect the downloaded file, note the replaced TY field, the LC field, and multiple NT fields 7) Add the following to the new syspref BibtexExportAdditionalFields: '@': 942$c lccn: 010$a notes: [501$a, 505$g] 9) Using the previously selected record, choose "Save" and select BIBTEX 10) Inspect the downloaded file, note the lccn, the multiple note fields, and the new record type value Signed-off-by: Frederic Demians <f.demians@tamil.fr>
Created attachment 35487 [details] [review] Bug 12357 - Tidy Ris.pm
Created attachment 35489 [details] [review] Bug 12357 - Tidy Record.pm
Kyle, How did you tidy Ris.pm? It seems you did not used perltidy: $ perltidy C4/Ris.pm $ diff C4/Ris.pm C4/Ris.pm.tdy | wc 214 1064 10403
(In reply to Jonathan Druart from comment #27) > Kyle, How did you tidy Ris.pm? > It seems you did not used perltidy: > $ perltidy C4/Ris.pm > $ diff C4/Ris.pm C4/Ris.pm.tdy | wc > 214 1064 10403 Yes, I did indeed use perltidy. I think this is a really good opportunity to tidy both of these modules. Only bug 12404 modifies Record.pm in any serious way, and that will be pushed to master before this one ( and I'll have to submit a fresh followup ). Ris.pm has no other patches in process that touch it at all.
(In reply to Kyle M Hall from comment #28) > (In reply to Jonathan Druart from comment #27) > > Kyle, How did you tidy Ris.pm? > > It seems you did not used perltidy: > > $ perltidy C4/Ris.pm > > $ diff C4/Ris.pm C4/Ris.pm.tdy | wc > > 214 1064 10403 > > Yes, I did indeed use perltidy. Do you use a specific .perltidyrc file?
(In reply to Jonathan Druart from comment #29) > (In reply to Kyle M Hall from comment #28) > > (In reply to Jonathan Druart from comment #27) > > > Kyle, How did you tidy Ris.pm? > > > It seems you did not used perltidy: > > > $ perltidy C4/Ris.pm > > > $ diff C4/Ris.pm C4/Ris.pm.tdy | wc > > > 214 1064 10403 > > > > Yes, I did indeed use perltidy. > > Do you use a specific .perltidyrc file? Here is the entiretly of my tidy rc file. I know it's deviating from the standard default, but we live in an age where monitors are a bit bigger than they used to be: -l=120 I can re-tidy the file with pure default Tidy ( the currently accepted Koha standard iirc ) if you wish.
Created attachment 35826 [details] [review] Bug 12357 - Enhancements to RIS and BibTeX exporting Some libraries would like to be able to add arbitrary fields to both the RIS and BibTeX citation formats that a record can be saved as from the staff intranet and public catalog. In addition, they would like to be able to override the default record type and use Koha's itemtype as the record type for those formats as well. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Add the following to the new syspref RisExportAdditionalFields: TY: 942$c LC: 010$a NT: [501$a, 505$g] 4) Find or create a record with an 010$a (lccn) field, a 501$a field, a 942$c field, and multiple 505$g fields. 5) Locate the record in the catalog, choose "Save" and select RIS 6) Inspect the downloaded file, note the replaced TY field, the LC field, and multiple NT fields 7) Add the following to the new syspref BibtexExportAdditionalFields: '@': 942$c lccn: 010$a notes: [501$a, 505$g] 9) Using the previously selected record, choose "Save" and select BIBTEX 10) Inspect the downloaded file, note the lccn, the multiple note fields, and the new record type value Signed-off-by: Frederic Demians <f.demians@tamil.fr>
Created attachment 35827 [details] [review] Bug 12357 - Tidy Ris.pm
Created attachment 35828 [details] [review] Bug 12357 - Tidy Record.pm
Kyle, same with these patch. For instance: diff C4/Ris.pm C4/Ris.pm.tdy returns: < elsif ( $fieldname eq "534" ) { < @subfields = < ( 'a', 'b', 'c', 'e', 'f', 'k', 'l', 'm', 'n', 'p', 't', 'x', 'z' ); < } < elsif ( $fieldname eq "535" ) { --- > } elsif ( $fieldname eq "534" ) { > @subfields = ( 'a', 'b', 'c', 'e', 'f', 'k', 'l', 'm', 'n', 'p', 't', 'x', 'z' ); > } elsif ( $fieldname eq "535" ) { and 898,901c811 < my @subfields = ( < 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'o', < 'p', 'q', 'r', 's', 't', 'u', 'v', 'x', 'y', 'z', '2', '3', '4' < ); --- > my @subfields = ( 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'x', 'y', 'z', '2', '3', '4' ); It's weird because I have 40 --maximum-line-length=178 in my ~/.perltidyrc But it does not seem to be take into account. If I launch it with perltidy C4/Ris.pm --noprofile I get the same file as you. I think I have spot a problem in the file: 275 '607', '608', '610', '615', '620', '660' . '661', should be 275 '607', '608', '610', '615', '620', '660' , '661', It existed before this patch. I won't block this patch, but maybe it could be good to have a specific bug report for tidying these files and talk about a common perltidyrc file to use.
Kyle, could you please provide tests, at least of the marc2bibtex subroutine. And I would prefer to see the tidy job (the 2 last patches) moved to another bug report. Moreover, the indentation changes in C4::Record::marcrecord2csv will be in conflict with bug 12404. Marked as Failed QA.
Created attachment 38602 [details] [review] Bug 12357 - Enhancements to RIS and BibTeX exporting Some libraries would like to be able to add arbitrary fields to both the RIS and BibTeX citation formats that a record can be saved as from the staff intranet and public catalog. In addition, they would like to be able to override the default record type and use Koha's itemtype as the record type for those formats as well. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Add the following to the new syspref RisExportAdditionalFields: TY: 942$c LC: 010$a NT: [501$a, 505$g] 4) Find or create a record with an 010$a (lccn) field, a 501$a field, a 942$c field, and multiple 505$g fields. 5) Locate the record in the catalog, choose "Save" and select RIS 6) Inspect the downloaded file, note the replaced TY field, the LC field, and multiple NT fields 7) Add the following to the new syspref BibtexExportAdditionalFields: '@': 942$c lccn: 010$a notes: [501$a, 505$g] 9) Using the previously selected record, choose "Save" and select BIBTEX 10) Inspect the downloaded file, note the lccn, the multiple note fields, and the new record type value Signed-off-by: Frederic Demians <f.demians@tamil.fr>
Created attachment 38604 [details] [review] Bug 12357 [QA Followup] - Unit Test
Kyle, The test does not pass. # Failed test 'testing bibtex' # at /home/koha/src/t/db_dependent/Record.t line 123. # got: '@Scholastic{testID, # author = {Rowling, J.K.}, # title = {Harry potter}, # publisher = {Scholastic}, # year = {2001} # test = {Scholastic} # } # ' # expected: '@Scholastic{testID, # author = {Rowling, J.K.}, # title = {Harry potter}, # publisher = {Scholastic}, # year = {2001}, # test = {Scholastic} # } # '
Created attachment 39469 [details] [review] Bug 12357: Fix comma issues related to additional fields. TEST PLAN --------- 1) Apply patches, except this one. 2) prove t/db_dependent/Record.t -- fails like comment #38 3) Apply this patch 4) prove t/db_dependent/Record.t -- now it passes. 5) koha qa test tools.
Created attachment 39471 [details] [review] Bug 12357 - Following whitespace failures on koha qa test tools. TEST PLAN --------- 1) Apply all patches before this. 2) run koha qa test tools -- whitespace failures 3) Apply this patch 4) run koha qa test tools -- no whitespace failures. NOTE: More tabs were fixed than required, to also clean up a little indenting.
Created attachment 39773 [details] [review] [SIGNED_OFF] Bug 12357 - Enhancements to RIS and BibTeX exporting Some libraries would like to be able to add arbitrary fields to both the RIS and BibTeX citation formats that a record can be saved as from the staff intranet and public catalog. In addition, they would like to be able to override the default record type and use Koha's itemtype as the record type for those formats as well. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Add the following to the new syspref RisExportAdditionalFields: TY: 942$c LC: 010$a NT: [501$a, 505$g] 4) Find or create a record with an 010$a (lccn) field, a 501$a field, a 942$c field, and multiple 505$g fields. 5) Locate the record in the catalog, choose "Save" and select RIS 6) Inspect the downloaded file, note the replaced TY field, the LC field, and multiple NT fields 7) Add the following to the new syspref BibtexExportAdditionalFields: '@': 942$c lccn: 010$a notes: [501$a, 505$g] 9) Using the previously selected record, choose "Save" and select BIBTEX 10) Inspect the downloaded file, note the lccn, the multiple note fields, and the new record type value Signed-off-by: Frederic Demians <f.demians@tamil.fr> Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Created attachment 39774 [details] [review] [SIGNED_OFF] Bug 12357 [QA Followup] - Unit Test Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> This works with next patch
Created attachment 39775 [details] [review] [SIGNED_OFF] Bug 12357: Fix comma issues related to additional fields. TEST PLAN --------- 1) Apply patches, except this one. 2) prove t/db_dependent/Record.t -- fails like comment #38 3) Apply this patch 4) prove t/db_dependent/Record.t -- now it passes. 5) koha qa test tools. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Make test work, koha-qa problems fixed in next patch
Created attachment 39776 [details] [review] [SIGNED_OFF] Bug 12357 - Following whitespace failures on koha qa test tools. TEST PLAN --------- 1) Apply all patches before this. 2) run koha qa test tools -- whitespace failures 3) Apply this patch 4) run koha qa test tools -- no whitespace failures. NOTE: More tabs were fixed than required, to also clean up a little indenting. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Koha-qa tools now happy
Created attachment 39803 [details] [review] Bug 12357 - Enhancements to RIS and BibTeX exporting Some libraries would like to be able to add arbitrary fields to both the RIS and BibTeX citation formats that a record can be saved as from the staff intranet and public catalog. In addition, they would like to be able to override the default record type and use Koha's itemtype as the record type for those formats as well. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Add the following to the new syspref RisExportAdditionalFields: TY: 942$c LC: 010$a NT: [501$a, 505$g] 4) Find or create a record with an 010$a (lccn) field, a 501$a field, a 942$c field, and multiple 505$g fields. 5) Locate the record in the catalog, choose "Save" and select RIS 6) Inspect the downloaded file, note the replaced TY field, the LC field, and multiple NT fields 7) Add the following to the new syspref BibtexExportAdditionalFields: '@': 942$c lccn: 010$a notes: [501$a, 505$g] 9) Using the previously selected record, choose "Save" and select BIBTEX 10) Inspect the downloaded file, note the lccn, the multiple note fields, and the new record type value Signed-off-by: Frederic Demians <f.demians@tamil.fr> Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Created attachment 39804 [details] [review] Bug 12357 [QA Followup] - Unit Test Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> This works with next patch Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Created attachment 39805 [details] [review] Bug 12357: Fix comma issues related to additional fields. TEST PLAN --------- 1) Apply patches, except this one. 2) prove t/db_dependent/Record.t -- fails like comment #38 3) Apply this patch 4) prove t/db_dependent/Record.t -- now it passes. 5) koha qa test tools. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Make test work, koha-qa problems fixed in next patch Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Created attachment 39806 [details] [review] Bug 12357 - Following whitespace failures on koha qa test tools. TEST PLAN --------- 1) Apply all patches before this. 2) run koha qa test tools -- whitespace failures 3) Apply this patch 4) run koha qa test tools -- no whitespace failures. NOTE: More tabs were fixed than required, to also clean up a little indenting. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Koha-qa tools now happy Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Note that now strict and warnings are enabled, the log contains a lot of 'Use of uninitialized value". But it's not introduced by this patch set.
Patches pushed to master. Thanks Kyle!
Comment on attachment 39803 [details] [review] Bug 12357 - Enhancements to RIS and BibTeX exporting Review of attachment 39803 [details] [review]: ----------------------------------------------------------------- ::: C4/Ris.pm @@ +1016,4 @@ > ## return unaltered if already utf-8 > return @_; > } > + elsif (my $uniout eq "t") { This runs with warns, but where is uniout defined?!
(In reply to M. Tompsett from comment #51) > Comment on attachment 39803 [details] [review] [review] > Bug 12357 - Enhancements to RIS and BibTeX exporting > > Review of attachment 39803 [details] [review] [review]: > ----------------------------------------------------------------- > > ::: C4/Ris.pm > @@ +1016,4 @@ > > ## return unaltered if already utf-8 > > return @_; > > } > > + elsif (my $uniout eq "t") { > > This runs with warns, but where is uniout defined?! On the same line... Please open a new bug report.
Note that uniout is an argument of the original script http://sourceforge.net/p/refdb/code/HEAD/tree/refdb/trunk/scripts/marc2ris.in
Good morning We have found one potential bug on this patch. This patch is not recognizing propertly the type of the record, if leader position 6 is 'a' it publishs as book even the position 7 is b=article We have tried to add TY: [942$c] to force the patch to replace the TY value, but it keeps the default Book value Koha 3.22.5 (debian jessy 8 with plack enabled) Test: Catalogue a record with LDR 6 and 7 'ab' --> this is an article check the record type is article in koha leader Download as RIS and check that type is book Modify syspref RisExportAdditionalFields TY: [337$a] (or whatever you wish) Download as RIS the ty is still book, it doesn't matter the value of 337$a or whatever
Hi Hugo, please report as a separate bug and use the 'blocks' to link to this one. This bug is already pushed - it will make it easier to work on a fix.