Bug 14199: Database revision for marc21_orgcode.pl
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Sat, 11 Jul 2015 15:36:18 +0000 (17:36 +0200)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 26 Feb 2016 14:04:29 +0000 (14:04 +0000)
This patch adds the dbrev in atomicupdate, updating the marc structure
for existing installations. (New installation in previous patch.)
And it removes the obsolete plugin files.

Test plan:
Run upgrade. Verify that new plugin is linked (for bib and auth).
Check plugin in editor.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Plugin tested, added to 040a/c/d
Test pass
No koha-qa errors

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
cataloguing/value_builder/marc21_field_003.pl [deleted file]
cataloguing/value_builder/marc21_field_040c.pl [deleted file]
cataloguing/value_builder/marc21_field_040d.pl [deleted file]
installer/data/mysql/atomicupdate/14199_MarcOrgCode.sql [new file with mode: 0644]

diff --git a/cataloguing/value_builder/marc21_field_003.pl b/cataloguing/value_builder/marc21_field_003.pl
deleted file mode 100755 (executable)
index 189a00a..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/perl
-
-# Converted to new plugin style (Bug 13437)
-
-
-# Copyright 2000-2002 Katipo Communications
-#
-# This file is part of Koha.
-#
-# Koha is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# Koha is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Koha; if not, see <http://www.gnu.org/licenses>.
-
-use Modern::Perl;
-use C4::Context;
-
-my $builder = sub {
-    my ( $params ) = @_;
-    my $function_name = $params->{id};
-
-    my $org = C4::Context->preference('MARCOrgCode');
-    my $res  = "
-<script type=\"text/javascript\">
-//<![CDATA[
-
-function Focus$function_name(event) {
-    document.getElementById(event.data.id).value='$org';
-    return 0;
-}
-
-//]]>
-</script>
-";
-    return $res;
-};
-
-return { builder => $builder };
\ No newline at end of file
diff --git a/cataloguing/value_builder/marc21_field_040c.pl b/cataloguing/value_builder/marc21_field_040c.pl
deleted file mode 100755 (executable)
index 4409b1b..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/perl
-
-# Converted to new plugin style (Bug 13437)
-
-# Copyright 2000-2002 Katipo Communications
-#
-# This file is part of Koha.
-#
-# Koha is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# Koha is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Koha; if not, see <http://www.gnu.org/licenses>.
-
-use Modern::Perl;
-use C4::Context;
-
-my $builder = sub {
-    my ( $params ) = @_;
-    my $function_name = $params->{id};
-
-    my $org = C4::Context->preference('MARCOrgCode');
-    my $res  = "
-<script type=\"text/javascript\">
-//<![CDATA[
-
-function Focus$function_name(event) {
-    document.getElementById(event.data.id).value='$org';
-    return 0;
-}
-
-//]]>
-</script>
-";
-    return $res;
-};
-
-return { builder => $builder };
\ No newline at end of file
diff --git a/cataloguing/value_builder/marc21_field_040d.pl b/cataloguing/value_builder/marc21_field_040d.pl
deleted file mode 100755 (executable)
index 4409b1b..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/perl
-
-# Converted to new plugin style (Bug 13437)
-
-# Copyright 2000-2002 Katipo Communications
-#
-# This file is part of Koha.
-#
-# Koha is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# Koha is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Koha; if not, see <http://www.gnu.org/licenses>.
-
-use Modern::Perl;
-use C4::Context;
-
-my $builder = sub {
-    my ( $params ) = @_;
-    my $function_name = $params->{id};
-
-    my $org = C4::Context->preference('MARCOrgCode');
-    my $res  = "
-<script type=\"text/javascript\">
-//<![CDATA[
-
-function Focus$function_name(event) {
-    document.getElementById(event.data.id).value='$org';
-    return 0;
-}
-
-//]]>
-</script>
-";
-    return $res;
-};
-
-return { builder => $builder };
\ No newline at end of file
diff --git a/installer/data/mysql/atomicupdate/14199_MarcOrgCode.sql b/installer/data/mysql/atomicupdate/14199_MarcOrgCode.sql
new file mode 100644 (file)
index 0000000..16b4d36
--- /dev/null
@@ -0,0 +1,3 @@
+-- move marc21_field_003.pl 040c and 040d to marc21_orgcode.pl
+update marc_subfield_structure set value_builder='marc21_orgcode.pl' where value_builder IN ( 'marc21_field_003.pl', 'marc21_field_040c.pl', 'marc21_field_040d.pl' );
+update auth_subfield_structure set value_builder='marc21_orgcode.pl' where value_builder IN ( 'marc21_field_003.pl', 'marc21_field_040c.pl', 'marc21_field_040d.pl' );