From 71982314d3661842b900ba45b124d9928fe7d72a Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Mon, 12 May 2008 16:59:35 -0500 Subject: [PATCH] kohabug 2017: ensure MARC21 $9 are in correct bib editor tab 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 --- installer/data/mysql/updatedatabase.pl | 14 ++++++++++++++ kohaversion.pl | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 7cee7c7f5a..956cc7d2a1 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -1563,6 +1563,20 @@ $DBversion = "3.00.00.084"; 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 diff --git a/kohaversion.pl b/kohaversion.pl index f1e6135ca6..b3f03f2107 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -10,7 +10,7 @@ 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 -- 2.39.5