From dec9c363ae4f3738235b322e7b14cade41826f80 Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Thu, 26 Mar 2015 08:46:45 +0100 Subject: [PATCH] Bug 13912 - System preference for default place of publication (country code) for field 008, range 15-17 --- cataloguing/value_builder/marc21_field_008.pl | 10 ++++++++-- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 +++++++ .../prog/en/modules/admin/preferences/cataloguing.pref | 4 ++++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/cataloguing/value_builder/marc21_field_008.pl b/cataloguing/value_builder/marc21_field_008.pl index 8a16bae..0e5bd66 100755 --- a/cataloguing/value_builder/marc21_field_008.pl +++ b/cataloguing/value_builder/marc21_field_008.pl @@ -50,6 +50,9 @@ sub plugin_javascript { my $lang = C4::Context->preference('DefaultLanguageField008' ); $lang = "eng" unless $lang; $lang = pack("A3", $lang); + my $country = C4::Context->preference('DefaultCountryField008'); + $country = "xxu" unless $country; + $country = pack("A3", $country); my ($dbh, $record, $tagslib, $field_number, $tabloop) = @_; my $function_name = $field_number; @@ -61,7 +64,7 @@ function Focus$function_name(subfield_managed) { if ( document.getElementById(\"$field_number\").value ) { } else { - document.getElementById(\"$field_number\").value='$dateentered' + 'b xxu||||| |||| 00| 0 $lang d'; + document.getElementById(\"$field_number\").value='$dateentered' + 'b $country||||| |||| 00| 0 $lang d'; } return 1; } @@ -93,6 +96,9 @@ sub plugin { my $lang = C4::Context->preference('DefaultLanguageField008' ); $lang = "eng" unless $lang; $lang = pack("A3", $lang); + my $country = C4::Context->preference('DefaultCountryField008'); + $country = "xxu" unless $country; + $country = pack("A3", $country); my ($input) = @_; my $index = $input->param('index'); @@ -158,7 +164,7 @@ sub plugin { } ); - $result = "$dateentered" . "b xxu||||| |||| 00| 0 $lang d" unless $result; + $result = "$dateentered" . "b $country||||| |||| 00| 0 $lang d" unless $result; my $errorXml = ''; # Check if the xml, xsd exists and is validated my $dir = C4::Context->config('intrahtdocs') . '/prog/' . $template->{lang} . '/data/'; diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 60dec6a..7db7132 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -95,6 +95,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('decreaseLoanHighHoldsDuration',NULL,'','Specifies a number of days that a loan is reduced to when used in conjunction with decreaseLoanHighHolds','Integer'), ('decreaseLoanHighHoldsValue',NULL,'','Specifies a threshold for the minimum number of holds needed to trigger a reduction in loan duration (used with decreaseLoanHighHolds)','Integer'), ('DefaultClassificationSource','ddc',NULL,'Default classification scheme used by the collection. E.g., Dewey, LCC, etc.','ClassSources'), +('DefaultCountryField008','','','Fill in the default country code for field 008 Range 15-17 - Place of publication, production, or execution. See MARC Code List for Countries','Free'), ('DefaultLanguageField008','','','Fill in the default language for field 008 Range 35-37 of MARC21 records (e.g. eng, nor, ger, see MARC Code List for Languages)','Free'), ('DefaultLongOverdueChargeValue', NULL, NULL, "Charge a lost item to the borrower's account when the LOST value of the item changes to n.", 'integer'), ('DefaultLongOverdueDays', NULL, NULL, "Set the LOST value of an item when the item has been overdue for more than n days.", 'integer'), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 951060f..433930b 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -9902,6 +9902,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = "3.19.00.XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do("INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('DefaultCountryField008','','','Fill in the default country code for field 008 Range 15-17 - Place of publication, production, or execution. See MARC Code List for Countries','Free')"); + print "Upgrade to $DBversion done (Bug 13912: System preference for default place of publication (country code) for field 008, range 15-17)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref index bc35aad..f46350c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref @@ -44,6 +44,10 @@ Cataloging: - pref: DefaultLanguageField008 - " Empty defaults to eng." - + - Fill in the default country code for field 008 Range 15-17 - Place of publication, production, or execution. See MARC Code List for Countries + - pref: DefaultCountryField008 + - " Empty defaults to xxu for United States." + - - Interpret and store MARC records in the - pref: marcflavour choices: -- 1.7.10.4