@@ -, +, @@ - GenerateAuthorityField667 - GenerateAuthorityField670 1. Make sure AutoCreateAuthorities and BiblioAddsAuthorities are enabled in the system preferences 2. Go to Home › Cataloging › Add MARC record and add a new record 3. Fill in the required fields and add a name in the 100$a field. Note the name, and add the new record. 4. run rebuild_zebra.pl -a 5. Go to Home › Authorities and search for the name you entered in 100$a 6. Select details and look at the 667 and 670 fields. They should default to the hard-coded values. 7. Apply patch, run update database 8. Edit the new GenerateAuthorityField667 and GenerateAuthorityField670 system preferences 9. Do 2-6 . Now the 667 and 670 fields should be what you entered in the system preferences. --- C4/Biblio.pm | 4 ++-- .../bug_13412-add_GenerateAuthorityField_syspref.sql | 3 +++ installer/data/mysql/sysprefs.sql | 4 +++- .../en/modules/admin/preferences/authorities.pref | 12 ++++++++++++ 4 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_13412-add_GenerateAuthorityField_syspref.sql --- a/C4/Biblio.pm +++ a/C4/Biblio.pm @@ -576,7 +576,7 @@ sub LinkBibHeadingsToAuthorities { $marcrecordauth->insert_fields_ordered( MARC::Field->new( '667', '', '', - 'a' => "Machine generated authority record." + 'a' => C4::Context->preference('GenerateAuthorityField667') ) ); my $cite = @@ -586,7 +586,7 @@ sub LinkBibHeadingsToAuthorities { $cite =~ s/^[\s\,]*//; $cite =~ s/[\s\,]*$//; $cite = - "Work cat.: (" + C4::Context->preference('GenerateAuthorityField670') . ": (" . ( $library ? $library->get_effective_marcorgcode : C4::Context->preference('MARCOrgCode') ) . ")" . $bib->subfield( '999', 'c' ) . ": " . $cite; --- a/installer/data/mysql/atomicupdate/bug_13412-add_GenerateAuthorityField_syspref.sql +++ a/installer/data/mysql/atomicupdate/bug_13412-add_GenerateAuthorityField_syspref.sql @@ -0,0 +1,3 @@ +INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES +( 'GenerateAuthorityField667', 'Machine generated authority record', NULL, 'When AutoCreateAuthorities is enabled, use this as a default value', 'free' ), +( 'GenerateAuthorityField670', 'Work cat.', NULL, 'When BiblioAddsAuthorities and AutoCreateAuthorities are enabled, use this as a default value for the 670$a field', 'free' ) --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -688,5 +688,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('XSLTListsDisplay','default','','Enable XSLT stylesheet control over lists pages display on intranet','Free'), ('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'), ('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'), -('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo') +('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'), +( 'GenerateAuthorityField667', 'Machine generated authority record', NULL, 'When BiblioAddsAuthorities and AutoCreateAuthorities are enabled, use this as a default value for the 670$a field', 'free' ), +( 'GenerateAuthorityField670', 'Work cat.', NULL, 'When BiblioAddsAuthorities and AutoCreateAuthorities are enabled, use this as a default value for the 670$a field', 'free' ) ; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/authorities.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/authorities.pref @@ -63,6 +63,18 @@ Authorities: "loose": loose "strict": strict - mode. In strict mode subfields that are not found in the authority record, are deleted. Loose mode will keep them. Loose mode is the historical behavior and still the default. + - + - When BiblioAddsAuthorities and AutoCreateAuthorities are enabled, use this as a default value for the 667$a field + - pref: GenerateAuthorityField667 + default: "Machine generated authority record" + type: textarea + class: code + - + - When BiblioAddsAuthorities and AutoCreateAuthorities are enabled, use this as a default value for the 670$a field + - pref: GenerateAuthorityField670 + default: "Work cat." + type: textarea + class: code Linker: - --