Bug 7055 - NORMARC: Fix 008 position 15-17 and 35-37
authorMagnus Enger <magnus@enger.priv.no>
Mon, 15 Apr 2013 17:50:19 +0000 (19:50 +0200)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Wed, 1 May 2013 11:45:21 +0000 (07:45 -0400)
This patch does several things:
- Set the default for 008/15-17 to "no " (yes, there is space at the end)
- Link from 008/15-17 in the value builder to NORMARC country codes
- Set the default for 008/35-37 to "nor" (by setting the
  DefaultLanguageField008 syspref)
- Link from 008/35-37 in the value builder to NORMARC language codes
- Fix a missing <tr> around field 35-37

To reproduce:
- Run through the Web-installer in Norwegian and choose NORMARC as
  the MARC flavour
- Go to Home > Cataloging > Add MARC record and add a new record
- Click in the field for 008. The default should look like:
  130415t        xxu||||| |||| 00| 0 eng d
                 ^^^                 ^^^
- Reload the page and open the value builder for 008. Problems:
  - The text for 15-17 links to MARC21 country codes
  - The default for 15-17 is xxu
  - The text for 35-37 links to MARC21 language codes
  - The default for 35-37 is eng
  - If you choose e.g. "Monografier" in the top dropdown then click
    on "OK" the window does not close

To test:
- Apply the patch and run through the Web-installer again, selecting
  Norwegian and NORMARC
- Go to Home > Cataloging > Add MARC record and add a new record
- Click in the field for 008. The default should look like:
  130415t        no ||||| |||| 00| 0 nor d
                 ^^^                 ^^^
- Reload the page and open the value builder for 008.
- Check that...
  - The default for 15-17 is "no " (with a space at the end)
  - The link goes to NORMARC country codes
  - The default for 35-37 is "nor"
  - The link goes to NORMARC language codes
- Select something from the top dropdown and click "OK". Check that the
  window closes and that the values that are entered into the 008 field
  matches what you chose in the popup window.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Trusing Magnus is right, so testing for any regressions mainly, all good

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Only changes NORMARC specific plugin and system preferences
files. Changes all seem logical to me.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

cataloguing/value_builder/normarc_field_008.pl
installer/data/mysql/nb-NO/1-Obligatorisk/system_preferences.sql
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/normarc_field_008.tt

index 5efe9a8..98ca163 100755 (executable)
@@ -58,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 $lang d';
+        document.getElementById(\"$field_number\").value='$dateentered' + 't        no ||||| |||| 00| 0 $lang d';
        }
     return 1;
 }
@@ -101,7 +101,7 @@ sub plugin {
     );
 
     #  $result = "      t        xxu           00  0 eng d" unless $result;
-    $result = "$dateentered" . "t        xxu||||| |||| 00| 0 $lang d" unless $result;
+    $result = "$dateentered" . "t        no ||||| |||| 00| 0 $lang d" unless $result;
     my $f1    = substr($result, 0,  6);
     my $f6    = substr($result, 6,  1);
     my $f710  = substr($result, 7,  4);
index c605944..eeedc86 100644 (file)
@@ -28,3 +28,4 @@ UPDATE systempreferences SET value = '<p>Viktige lenker kan plasseres her</p>' W
 UPDATE systempreferences SET value = '<li><a href="http://worldcat.org/search?q={TITLE}" target="_blank">Andre bibliotek (WorldCat)</a></li><li><a href="http://www.scholar.google.com/scholar?q={TITLE}" target="_blank">Andre databaser (Google Scholar)</a></li><li><a href="http://www.bookfinder.com/search/?author={AUTHOR}&amp;title={TITLE}&amp;st=xl&amp;ac=qr" target="_blank">Nettbutikker (Bookfinder.com)</a></li>' WHERE variable = 'OPACSearchForTitleIn';
 UPDATE systempreferences SET value = 'Monday' WHERE variable = 'CalendarFirstDayOfWeek';
 UPDATE systempreferences SET value = 'A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Æ Ø Å' WHERE variable = 'alphabet';
+UPDATE systempreferences SET value = 'nor' WHERE variable = 'DefaultLanguageField008';
index cfdba9c..14101b1 100644 (file)
   </tr>
 
        <tr>
-      <td><label for="f1517">15-17 Utgivelsesland</label> See <a href="http://www.loc.gov/marc/countries/countries_code.html">MARC Code List for Countries</a> </td>
+      <td><label for="f1517">15-17 Utgivelsesland</label> (Se <a href="http://www.nb.no/baser/landekoder/">NORMARC-koder for land</a>)</td>
       <td>
-              <input type="text" name="f1517" id="f1517" size="3"  maxlength="3" value="[% f1517 %]"/>
+              <input type="text" name="f1517" id="f1517" size="3"  maxlength="3" value="[% f1517 %]"/> <!-- Default is set by the DefaultLanguageField008 syspref -->
       </td>
         </tr>
                                
 <tr><td id="choices" colspan="2"></td></tr>
 
 <!-- Start second batch of common fields for all formats -->
-                <td><label for="f3537">35-37 Språk</label> See <a href="http://www.loc.gov/marc/languages/language_code.html">MARC Code List for Languages</a></td>
+       <tr>
+                <td><label for="f3537">35-37 Språk</label> (Se <a href="http://www.nb.no/baser/sprakkoder/">NORMARC-koder for språk</a>)</td>
                 <td>
                         <input type="text" name="f3537" id="f3537" size="4"  maxlength="4" value="[% f3537 %]"/>
                 </td>