Bug 13437: Trivial edits on marc21 plugins before conversion
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Wed, 13 May 2015 11:47:38 +0000 (13:47 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Wed, 10 Jun 2015 15:51:27 +0000 (12:51 -0300)
marc21_field_003.pl: copy-pasta comment about date removed
marc21_field_005.pl: commented use removed
marc21_field_006.pl: old/irrelevant pod lines
marc21_field_007.pl: old/irrelevant pod lines
marc21_field_008.pl: old/irrelevant pod lines, move sub par line twice
marc21_field_008_authorities.pl: whitespace, old/irrelevant pod lines
marc21_field_040c.pl: two commented lines removed
marc21_field_040d.pl: whitespace, commented lines, old/irrelevant pod
marc21_field_245h.pl: whitespace

marc21_linking_section.pl: relocated some comment lines, and replaced a new
CGI object by the one passed in via the plugin launcher (agreed, this may
not be so trivial as the other changes)

Test plan:
These (trivial) changes are hard to test.
Pick a few plugins and verify that behavior is not changed in the marc
editor.
For the brave: Try marc21_linking_section.pl.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Tried marc21_linking_section.pl :)
(ling plugin to 773$9, create new record, search for parent and check values inserted)
No errors

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
cataloguing/value_builder/marc21_field_003.pl
cataloguing/value_builder/marc21_field_005.pl
cataloguing/value_builder/marc21_field_006.pl
cataloguing/value_builder/marc21_field_007.pl
cataloguing/value_builder/marc21_field_008.pl
cataloguing/value_builder/marc21_field_008_authorities.pl
cataloguing/value_builder/marc21_field_040c.pl
cataloguing/value_builder/marc21_field_040d.pl
cataloguing/value_builder/marc21_field_245h.pl
cataloguing/value_builder/marc21_linking_section.pl

index ef0eca5..4a3b516 100755 (executable)
@@ -26,7 +26,6 @@ sub plugin_javascript {
     my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
     my $function_name= $field_number;
 
-    # find today's date
     my $org = C4::Context->preference('MARCOrgCode');
     my $res  = "
 <script type=\"text/javascript\">
index ff5f74f..ad8d64d 100755 (executable)
@@ -19,7 +19,6 @@
 
 use strict;
 #use warnings; FIXME - Bug 2505
-#use C4::Context;
 
 sub plugin_javascript {
     my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
index bbaf366..0268a33 100755 (executable)
@@ -28,12 +28,6 @@ use C4::Output;
 
 use XML::LibXML;
 
-=head1 DESCRIPTION
-
-plugin_parameters : other parameters added when the plugin is called by the dopop function
-
-=cut
-
 sub plugin_javascript {
     my ($dbh, $record, $tagslib, $field_number, $tabloop) = @_;
     my $function_name = $field_number;
index d65c33e..65f7d09 100755 (executable)
@@ -27,12 +27,6 @@ use C4::Context;
 use C4::Search;
 use C4::Output;
 
-=head1 DESCRIPTION
-
-plugin_parameters : other parameters added when the plugin is called by the dopop function
-
-=cut
-
 sub plugin_javascript {
     my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_;
     my $function_name = $field_number;
index 01d63d7..9503fe0 100755 (executable)
@@ -29,18 +29,13 @@ use C4::Output;
 use XML::LibXML;
 use Koha::Util::FrameworkPlugin qw|date_entered|;
 
-=head1 DESCRIPTION
-
-plugin_parameters : other parameters added when the plugin is called by the dopop function
-
-=cut
-
 sub plugin_javascript {
+    my ($dbh, $record, $tagslib, $field_number, $tabloop) = @_;
+
     my $lang = C4::Context->preference('DefaultLanguageField008' );
     $lang = "eng" unless $lang;
     $lang = pack("A3", $lang);
 
-    my ($dbh, $record, $tagslib, $field_number, $tabloop) = @_;
     my $function_name = $field_number;
     my $dateentered = date_entered();
     my $res           = "
@@ -76,11 +71,11 @@ function Clic$function_name(i) {
 }
 
 sub plugin {
+    my ($input) = @_;
     my $lang = C4::Context->preference('DefaultLanguageField008' );
     $lang = "eng" unless $lang;
     $lang = pack("A3", $lang);
 
-    my ($input) = @_;
     my $index   = $input->param('index');
     my $result  = $input->param('result');
     my $leader  = $input->param('leader');
index e6ddbd7..699ab65 100755 (executable)
@@ -30,12 +30,6 @@ use Koha::Util::FrameworkPlugin qw|date_entered|;
 use constant FIXLEN_DATA_ELTS => '|| aca||aabn           | a|a     d';
 use constant PREF_008 => 'MARCAuthorityControlField008';
 
-=head1 DESCRIPTION
-
-plugin_parameters : other parameters added when the plugin is called by the dopop function
-
-=cut
-
 sub plugin_javascript {
     my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
     my $function_name= $field_number;
@@ -69,6 +63,7 @@ function Clic$function_name(i) {
 
     return ($function_name,$res);
 }
+
 sub plugin {
     my ($input) = @_;
     my $index= $input->param('index');
index a00f1fc..35cc7b3 100755 (executable)
 use strict;
 #use warnings; FIXME - Bug 2505
 use C4::Context;
-# use MARC::Record;
 
 sub plugin_javascript {
     my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
     my $function_name= $field_number;
 
-    # find today's date
     my $org = C4::Context->preference('MARCOrgCode');
     my $res  = "
 <script type=\"text/javascript\">
index f636d36..aad04b1 100755 (executable)
@@ -1,6 +1,5 @@
 #!/usr/bin/perl
 
-
 # Copyright 2000-2002 Katipo Communications
 #
 # This file is part of Koha.
 use strict;
 #use warnings; FIXME - Bug 2505
 use C4::Context;
-# use MARC::Record;
-
-=head1 DESCRIPTION
-
-plugin_parameters : other parameters added when the plugin is called by the dopop function
-
-=cut
 
 sub plugin_javascript {
     my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
     my $function_name = $field_number;
 
-    # find today's date
     my $org = C4::Context->preference('MARCOrgCode');
     my $res  = "
 <script type=\"text/javascript\">
@@ -47,5 +38,5 @@ function Focus$function_name(subfield_managed) {
 //]]>
 </script>
 ";
-return ($function_name,$res);
+    return ($function_name,$res);
 }
index 8d4b356..1912c4c 100755 (executable)
@@ -1,6 +1,5 @@
 #!/usr/bin/perl
 
-
 # Copyright 2009 Kyle Hall <kyle.m.hall@gmail.com>
 #
 # This file is part of Koha.
@@ -44,5 +43,5 @@ function Blur$function_name(index) {
 //]]>
 </script>
 ";
-return ($function_name,$res);
+    return ($function_name,$res);
 }
index 723840f..f53ed2a 100644 (file)
@@ -49,19 +49,14 @@ sub plugin_javascript {
     return ( $function_name, $res );
 }
 
-# sub plugin
-#
-# input arg :
-# -- op could be equals to
-# * fillinput :
-# * do_search :
-#
-
 sub plugin {
-    my ($input)   = @_;
+    my ($query)   = @_;
     my $dbh       = C4::Context->dbh;
-    my $query     = new CGI;
     my $op        = $query->param('op');
+    # -- op could be equal to
+    # * fillinput
+    # * do_search
+
     my $type      = $query->param('type');
     my $startfrom = $query->param('startfrom');
     $startfrom = 0 if ( !defined $startfrom );