Bug 7601 - Preference for default language for field 008 Range 35-37 (instead of hard coded "eng")
Summary: Preference for default language for field 008 Range 35-37 (instead of hard co...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: 3.10
Hardware: All All
: P3 enhancement (vote)
Assignee: Galen Charlton
QA Contact: Ian Walls
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-25 21:53 UTC by Marc Véron
Modified: 2015-03-20 15:55 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Changed marc21_field_008.pl (4.23 KB, application/octet-stream)
2012-02-25 21:54 UTC, Marc Véron
Details
cataloguing.pref with preference for 008 default language added (5.89 KB, application/octet-stream)
2012-02-25 21:57 UTC, Marc Véron
Details
Bug 7601 - Preference for default language for field 008 Range 35-37 (instead of hard coded "eng") (7.26 KB, patch)
2012-06-08 15:47 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 7601 - Preference for default language for field 008 Range 35-37 (instead of hard coded "eng") (7.31 KB, patch)
2012-06-08 19:50 UTC, Chris Cormack
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Véron 2012-02-25 21:53:16 UTC
Problem:
--------

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.

Background:
-----------
The language code for English (eng) is hard coded in the files
...koha\intranet\cgi-bin\cataloguing\value_builder\marc21_field_008.pl
(~Lines 61, 100)
and 
...koha\intranet\cgi-bin\cataloguing\value_builder\normarc_field_008.pl
(~Lines 58, 98)


Proposition:
------------

--Step 1 --------------------------
Add somewhere to cataloguing.pref, 
section "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."


--Step 2 --------------------------
Change  marc21_field_008.pl and 
normarc_field_008.pl as follows:
-----------------------------------
--2a---
Add 3 lines of code at the top of the functions
sub plugin_javascript and sub plugin:

my $lang = C4::Context->preference('DefaultLanguageField008' );
$lang = "eng" unless $lang;
$lang = pack("A3", $lang);

The code defaults an empty value to "eng" makes sure that the code has a lenght of 3 letters.

--2b---
In both functions, replace hard coded eng with $lang:

document.getElementById(\"$field_number\").value='$dateentered' + 't        xxu||||| |||| 00| 0 $lang d';

$result = "$dateentered" . "t        xxu||||| |||| 00| 0 $lang d" unless $result;	


--Step 3----------------------------------------------------------------------
Login to Koha, go to Home › Administration › System Preferences (Cataloging) 
and test with empty value and different language codes (ger, ita etc.)
------------------------------------------------------------------------------

I implemented and tested this locally with marc21_field_008.pl (Koha 3.06.02.003)
Comment 1 Marc Véron 2012-02-25 21:54:43 UTC Comment hidden (obsolete)
Comment 2 Marc Véron 2012-02-25 21:57:03 UTC Comment hidden (obsolete)
Comment 3 Marc Véron 2012-06-08 15:47:00 UTC Comment hidden (obsolete)
Comment 4 Chris Cormack 2012-06-08 19:50:01 UTC
Created attachment 9988 [details] [review]
Bug 7601 - Preference for default language for field 008 Range 35-37 (instead of hard coded "eng")

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')

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Comment 5 Paul Poulain 2012-06-10 08:57:46 UTC
QA comment:
  * small patch that replaces a hardcoded value by a syspref
  * Despite his size, the content of the patch is tiny, loading the syspref, filling it to 3 chars, and using it instead of the default

passed QA
Comment 6 Jared Camins-Esakov 2012-12-31 01:04:21 UTC
There have been no further reports of problems so I am marking this bug resolved.