Bugzilla – Attachment 39142 Details for
Bug 13437
Convert marc21 framework plugins to new style
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13437: Trivial edits on marc21 plugins before conversion
Bug-13437-Trivial-edits-on-marc21-plugins-before-c.patch (text/plain), 8.99 KB, created by
Marcel de Rooy
on 2015-05-13 15:04:04 UTC
(
hide
)
Description:
Bug 13437: Trivial edits on marc21 plugins before conversion
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2015-05-13 15:04:04 UTC
Size:
8.99 KB
patch
obsolete
>From a37d5a814a7a413d514b2a6e77958feac9a63e7c Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 13 May 2015 13:47:38 +0200 >Subject: [PATCH] Bug 13437: Trivial edits on marc21 plugins before conversion >Content-Type: text/plain; charset=utf-8 > >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. >--- > cataloguing/value_builder/marc21_field_003.pl | 1 - > cataloguing/value_builder/marc21_field_005.pl | 1 - > cataloguing/value_builder/marc21_field_006.pl | 6 ------ > cataloguing/value_builder/marc21_field_007.pl | 6 ------ > cataloguing/value_builder/marc21_field_008.pl | 11 +++-------- > .../value_builder/marc21_field_008_authorities.pl | 7 +------ > cataloguing/value_builder/marc21_field_040c.pl | 2 -- > cataloguing/value_builder/marc21_field_040d.pl | 11 +---------- > cataloguing/value_builder/marc21_field_245h.pl | 3 +-- > cataloguing/value_builder/marc21_linking_section.pl | 15 +++++---------- > 10 files changed, 11 insertions(+), 52 deletions(-) > >diff --git a/cataloguing/value_builder/marc21_field_003.pl b/cataloguing/value_builder/marc21_field_003.pl >index ef0eca5..4a3b516 100755 >--- a/cataloguing/value_builder/marc21_field_003.pl >+++ b/cataloguing/value_builder/marc21_field_003.pl >@@ -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\"> >diff --git a/cataloguing/value_builder/marc21_field_005.pl b/cataloguing/value_builder/marc21_field_005.pl >index ff5f74f..ad8d64d 100755 >--- a/cataloguing/value_builder/marc21_field_005.pl >+++ b/cataloguing/value_builder/marc21_field_005.pl >@@ -19,7 +19,6 @@ > > use strict; > #use warnings; FIXME - Bug 2505 >-#use C4::Context; > > sub plugin_javascript { > my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; >diff --git a/cataloguing/value_builder/marc21_field_006.pl b/cataloguing/value_builder/marc21_field_006.pl >index bbaf366..0268a33 100755 >--- a/cataloguing/value_builder/marc21_field_006.pl >+++ b/cataloguing/value_builder/marc21_field_006.pl >@@ -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; >diff --git a/cataloguing/value_builder/marc21_field_007.pl b/cataloguing/value_builder/marc21_field_007.pl >index d65c33e..65f7d09 100755 >--- a/cataloguing/value_builder/marc21_field_007.pl >+++ b/cataloguing/value_builder/marc21_field_007.pl >@@ -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; >diff --git a/cataloguing/value_builder/marc21_field_008.pl b/cataloguing/value_builder/marc21_field_008.pl >index e3de19c..2c330fc 100755 >--- a/cataloguing/value_builder/marc21_field_008.pl >+++ b/cataloguing/value_builder/marc21_field_008.pl >@@ -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 date_entered { > # find today's date > my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time); >@@ -43,11 +37,12 @@ sub date_entered { > } > > 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 = " >@@ -83,11 +78,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'); >diff --git a/cataloguing/value_builder/marc21_field_008_authorities.pl b/cataloguing/value_builder/marc21_field_008_authorities.pl >index 319972d..940b0ed 100755 >--- a/cataloguing/value_builder/marc21_field_008_authorities.pl >+++ b/cataloguing/value_builder/marc21_field_008_authorities.pl >@@ -29,12 +29,6 @@ use C4::Output; > 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 date_entered { > # find today's date > my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); >@@ -76,6 +70,7 @@ function Clic$function_name(i) { > > return ($function_name,$res); > } >+ > sub plugin { > my ($input) = @_; > my $index= $input->param('index'); >diff --git a/cataloguing/value_builder/marc21_field_040c.pl b/cataloguing/value_builder/marc21_field_040c.pl >index a00f1fc..35cc7b3 100755 >--- a/cataloguing/value_builder/marc21_field_040c.pl >+++ b/cataloguing/value_builder/marc21_field_040c.pl >@@ -20,13 +20,11 @@ > 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\"> >diff --git a/cataloguing/value_builder/marc21_field_040d.pl b/cataloguing/value_builder/marc21_field_040d.pl >index f636d36..aad04b1 100755 >--- a/cataloguing/value_builder/marc21_field_040d.pl >+++ b/cataloguing/value_builder/marc21_field_040d.pl >@@ -1,6 +1,5 @@ > #!/usr/bin/perl > >- > # Copyright 2000-2002 Katipo Communications > # > # This file is part of Koha. >@@ -21,19 +20,11 @@ > 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); > } >diff --git a/cataloguing/value_builder/marc21_field_245h.pl b/cataloguing/value_builder/marc21_field_245h.pl >index 8d4b356..1912c4c 100755 >--- a/cataloguing/value_builder/marc21_field_245h.pl >+++ b/cataloguing/value_builder/marc21_field_245h.pl >@@ -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); > } >diff --git a/cataloguing/value_builder/marc21_linking_section.pl b/cataloguing/value_builder/marc21_linking_section.pl >index 723840f..f53ed2a 100644 >--- a/cataloguing/value_builder/marc21_linking_section.pl >+++ b/cataloguing/value_builder/marc21_linking_section.pl >@@ -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 ); >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 13437
:
39093
|
39095
|
39140
|
39141
|
39142
|
39177
|
39184
|
39193
|
39194
|
39195
|
39196
|
39371
|
39372
|
39373
|
39374
|
39375
|
39949
|
39950
|
39951
|
39952
|
39953