Bugzilla – Attachment 9987 Details for
Bug 7601
Preference for default language for field 008 Range 35-37 (instead of hard coded "eng")
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7601 - Preference for default language for field 008 Range 35-37 (instead of hard coded "eng")
Bug-7601---Preference-for-default-language-for-fie.patch (text/plain), 7.26 KB, created by
Marc Véron
on 2012-06-08 15:47:00 UTC
(
hide
)
Description:
Bug 7601 - Preference for default language for field 008 Range 35-37 (instead of hard coded "eng")
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2012-06-08 15:47:00 UTC
Size:
7.26 KB
patch
obsolete
>From b3435256cea582a3dd4272ddc3cdece3637e2ffd Mon Sep 17 00:00:00 2001 >From: Marc Veron <veron@veron.ch> >Date: Fri, 8 Jun 2012 17:39:39 +0200 >Subject: [PATCH] Bug 7601 - Preference for default language for field 008 Range 35-37 (instead of hard coded "eng") >Content-Type: text/plain; charset="utf-8" > >When a new marc record is added, the language code in field 008 Range 35-37 defaults to Englih ("eng"). This makes cataloguing inefficient and error-prone for librarians if most of the bibliographic data is e.g. in German or in French. > >Test: >- Apply patch >- Edit preference DefaultLanguageField008, fill in e.g. 'ger' >- Go to Cataloguing, Add marc Record >- Click in field 008. Language code should read 'ger' (instead of 'eng') >--- > cataloguing/value_builder/marc21_field_008.pl | 13 ++++++++++--- > cataloguing/value_builder/normarc_field_008.pl | 10 ++++++++-- > installer/data/mysql/sysprefs.sql | 1 + > installer/data/mysql/updatedatabase.pl | 5 +++++ > .../en/modules/admin/preferences/cataloguing.pref | 4 ++++ > 5 files changed, 28 insertions(+), 5 deletions(-) > >diff --git a/cataloguing/value_builder/marc21_field_008.pl b/cataloguing/value_builder/marc21_field_008.pl >index bb7e7ee..ab0731c 100755 >--- a/cataloguing/value_builder/marc21_field_008.pl >+++ b/cataloguing/value_builder/marc21_field_008.pl >@@ -47,6 +47,10 @@ sub plugin_parameters { > } > > sub plugin_javascript { >+ my $lang = C4::Context->preference('DefaultLanguageField008' ); >+ $lang = "eng" unless $lang; >+ $lang = pack("A3", $lang); >+ > my ($dbh, $record, $tagslib, $field_number, $tabloop) = @_; > my $function_name = $field_number; > my $res = " >@@ -54,11 +58,10 @@ sub plugin_javascript { > //<![CDATA[ > > function Focus$function_name(subfield_managed) { >- > if ( document.getElementById(\"$field_number\").value ) { > } > else { >- document.getElementById(\"$field_number\").value='$dateentered' + 'b xxu||||| |||| 00| 0 eng d'; >+ document.getElementById(\"$field_number\").value='$dateentered' + 'b xxu||||| |||| 00| 0 $lang d'; > } > return 1; > } >@@ -80,6 +83,10 @@ function Clic$function_name(i) { > } > > sub plugin { >+ my $lang = C4::Context->preference('DefaultLanguageField008' ); >+ $lang = "eng" unless $lang; >+ $lang = pack("A3", $lang); >+ > my ($input) = @_; > my $index = $input->param('index'); > my $result = $input->param('result'); >@@ -96,7 +103,7 @@ sub plugin { > } > ); > >- $result = "$dateentered" . "b xxu||||| |||| 00| 0 eng d" unless $result; >+ $result = "$dateentered" . "b xxu||||| |||| 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} . '/modules/cataloguing/value_builder/'; >diff --git a/cataloguing/value_builder/normarc_field_008.pl b/cataloguing/value_builder/normarc_field_008.pl >index 4fc8919..878614d 100755 >--- a/cataloguing/value_builder/normarc_field_008.pl >+++ b/cataloguing/value_builder/normarc_field_008.pl >@@ -44,6 +44,9 @@ sub plugin_parameters { > } > > sub plugin_javascript { >+ my $lang = C4::Context->preference('DefaultLanguageField008' ); >+ $lang = "eng" unless $lang; >+ $lang = pack("A3", $lang); > my ($dbh, $record, $tagslib, $field_number, $tabloop) = @_; > my $function_name = $field_number; > my $res = " >@@ -55,7 +58,7 @@ function Focus$function_name(subfield_managed) { > if ( document.getElementById(\"$field_number\").value ) { > } > else { >- document.getElementById(\"$field_number\").value='$dateentered' + 't xxu||||| |||| 00| 0 eng d'; >+ document.getElementById(\"$field_number\").value='$dateentered' + 't xxu||||| |||| 00| 0 $lang d'; > } > return 1; > } >@@ -78,6 +81,9 @@ function Clic$function_name(i) { > } > > sub plugin { >+ my $lang = C4::Context->preference('DefaultLanguageField008' ); >+ $lang = "eng" unless $lang; >+ $lang = pack("A3", $lang); > my ($input) = @_; > my $index = $input->param('index'); > my $result = $input->param('result'); >@@ -95,7 +101,7 @@ sub plugin { > ); > > # $result = " t xxu 00 0 eng d" unless $result; >- $result = "$dateentered" . "t xxu||||| |||| 00| 0 eng d" unless $result; >+ $result = "$dateentered" . "t xxu||||| |||| 00| 0 $lang d" unless $result; > my $f1 = substr($result, 0, 6); > my $f6 = substr($result, 6, 1); > my $f710 = substr($result, 7, 4); >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 2ffe2df..285f8e5 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -365,3 +365,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacBrowseResults','1','Disable/enable browsing and paging search results from the OPAC detail page.',NULL,'YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SvcMaxReportRows','10','Maximum number of rows to return via the report web service.',NULL,'Integer'); > INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice'); >+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('DefaultLanguageField008','','Fill in the default language for field 008 Range 35-37 (e.g. eng, nor, ger, see <a href="http://www.loc.gov/marc/languages/language_code.html">MARC Code List for Languages</a>)','','Free'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index dbbdee3..4bbde48 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -5308,6 +5308,11 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { > SetVersion ($DBversion); > } > >+$DBversion ="XXX"; >+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { >+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('DefaultLanguageField008','','Fill in the default language for field 008 Range 35-37 (e.g. eng, nor, ger, see www.loc.gov/marc/languages/language_code.html)','','Free');"); >+ print "Upgrade to $DBversion done (Add system preference DefaultLanguageField008))\n"; >+ > =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 10e1d13..fe5fd05 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 >@@ -40,6 +40,10 @@ Cataloging: > - > Record Structure: > - >+ - Fill in the default language for field 008 Range 35-37 (e.g. eng, nor, ger, see <a href="http://www.loc.gov/marc/languages/language_code.html">MARC Code List for Languages</a>) >+ - pref: DefaultLanguageField008 >+ - " Empty defaults to eng." >+ - > - Interpret and store MARC records in the > - pref: marcflavour > choices: >-- >1.7.2.5
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 7601
:
7881
|
7882
|
9987
|
9988