kohabug 2017: ensure MARC21 $9 are in correct bib editor tab
authorGalen Charlton <galen.charlton@liblime.com>
Mon, 12 May 2008 21:59:35 +0000 (16:59 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Tue, 13 May 2008 22:36:27 +0000 (17:36 -0500)
Update MARC21 bib framework to ensure that subfield $9 in  110,
110, 111, 130, 240, 243, 440, 410, 411, and 440 remain
in same bib editing tab as rest of subfields in those fields.

This helps ensure that authority-controlled fields are not
mangled when editing a bib record.

Change also fixes editing tab for subfields in the 037, 584, and
760.

This is DB rev 085.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
installer/data/mysql/updatedatabase.pl
kohaversion.pl

index 7cee7c7..956cc7d 100755 (executable)
@@ -1563,6 +1563,20 @@ $DBversion = "3.00.00.084";
     SetVersion ($DBversion);
 }                                             
 
     SetVersion ($DBversion);
 }                                             
 
+$DBversion = "3.00.00.085";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    if (C4::Context->preference("marcflavour") eq 'MARC21') {
+        $dbh->do("UPDATE marc_subfield_structure SET tab = 0 WHERE tab =  9 AND tagfield = '037'");
+        $dbh->do("UPDATE marc_subfield_structure SET tab = 1 WHERE tab =  6 AND tagfield in ('100', '110', '111', '130')");
+        $dbh->do("UPDATE marc_subfield_structure SET tab = 2 WHERE tab =  6 AND tagfield in ('240', '243')");
+        $dbh->do("UPDATE marc_subfield_structure SET tab = 4 WHERE tab =  6 AND tagfield in ('400', '410', '411', '440')");
+        $dbh->do("UPDATE marc_subfield_structure SET tab = 5 WHERE tab =  9 AND tagfield = '584'");
+        $dbh->do("UPDATE marc_subfield_structure SET tab = 7 WHERE tab = -6 AND tagfield = '760'");
+    }
+    print "Upgrade to $DBversion done (move editing tab of various MARC21 subfields)\n";
+    SetVersion ($DBversion);
+}
+
 =item DropAllForeignKeys($table)
 
   Drop all foreign keys of the table $table
 =item DropAllForeignKeys($table)
 
   Drop all foreign keys of the table $table
index f1e6135..b3f03f2 100644 (file)
@@ -10,7 +10,7 @@
 use strict;
 
 sub kohaversion {
 use strict;
 
 sub kohaversion {
-    our $VERSION = "3.00.00.084";
+    our $VERSION = "3.00.00.085";
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install