From 0d177c9546ca697b49c73ea60fb7171ab220b279 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 11 Dec 2014 11:35:57 +0100 Subject: [PATCH] Bug 10480: Remove useless routines and irrelevant pod lines This patch makes the following cleanup actions for all plugins: 1- Remove sub plugin_parameters. This function is not used. 2- Remove empty plugin or empty plugin_javascript subs. 3- Remove empty Blur, Clic or Focus routines from javascript. 4- Remove pod lines (copy-pasta) only referring to the 3 plugin subs. 5- Remove the last 1; line. It is no longer needed. Test plan: Run the unit test t/db_dependent/FrameworkPlugins.t Test some cataloguing plugins in addbiblio. Test some item plugins in additem and neworderempty. Signed-off-by: Marcel de Rooy I also checked the syntax of all plugins with perl -c. And checked the pod (if any) with podchecker: Two files still produce a warning; the follow-up deals with them: unimarc_field_686a/_700-4.pl. Signed-off-by: Brendan Gallagher Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- cataloguing/value_builder/barcode.pl | 43 ----------------- cataloguing/value_builder/barcode_manual.pl | 47 ------------------- cataloguing/value_builder/callnumber-KU.pl | 13 ----- cataloguing/value_builder/callnumber.pl | 12 ----- cataloguing/value_builder/dateaccessioned.pl | 43 ----------------- cataloguing/value_builder/macles.pl | 22 --------- cataloguing/value_builder/marc21_field_003.pl | 44 ----------------- cataloguing/value_builder/marc21_field_005.pl | 44 ----------------- cataloguing/value_builder/marc21_field_006.pl | 15 ------ cataloguing/value_builder/marc21_field_007.pl | 15 ------ cataloguing/value_builder/marc21_field_008.pl | 11 ----- .../marc21_field_008_authorities.pl | 11 ----- .../value_builder/marc21_field_040c.pl | 44 ----------------- .../value_builder/marc21_field_040d.pl | 40 ---------------- .../value_builder/marc21_field_245h.pl | 46 ------------------ cataloguing/value_builder/marc21_leader.pl | 17 ------- .../marc21_leader_authorities.pl | 17 ------- .../value_builder/marc21_leader_book.pl | 21 --------- .../marc21_leader_computerfile.pl | 23 --------- .../value_builder/marc21_leader_video.pl | 21 --------- .../value_builder/marc21_linking_section.pl | 15 ------ .../value_builder/normarc_field_007.pl | 21 --------- .../value_builder/normarc_field_008.pl | 19 -------- cataloguing/value_builder/normarc_leader.pl | 16 ------- cataloguing/value_builder/stocknumber.pl | 43 ----------------- cataloguing/value_builder/stocknumberAV.pl | 13 ----- cataloguing/value_builder/stocknumberam123.pl | 12 ----- .../value_builder/unimarc_field_010.pl | 21 --------- .../value_builder/unimarc_field_100.pl | 23 --------- .../unimarc_field_100_authorities.pl | 23 --------- .../value_builder/unimarc_field_105.pl | 23 --------- .../value_builder/unimarc_field_106.pl | 23 --------- .../value_builder/unimarc_field_110.pl | 23 --------- .../value_builder/unimarc_field_115a.pl | 23 --------- .../value_builder/unimarc_field_115b.pl | 23 --------- .../value_builder/unimarc_field_116.pl | 23 --------- .../value_builder/unimarc_field_117.pl | 23 --------- .../value_builder/unimarc_field_120.pl | 23 --------- .../value_builder/unimarc_field_121a.pl | 23 --------- .../value_builder/unimarc_field_121b.pl | 23 --------- .../value_builder/unimarc_field_122.pl | 23 --------- .../value_builder/unimarc_field_123a.pl | 23 --------- .../value_builder/unimarc_field_123d.pl | 23 --------- .../value_builder/unimarc_field_123e.pl | 23 --------- .../value_builder/unimarc_field_123f.pl | 23 --------- .../value_builder/unimarc_field_123g.pl | 23 --------- .../value_builder/unimarc_field_123i.pl | 23 --------- .../value_builder/unimarc_field_123j.pl | 23 --------- .../value_builder/unimarc_field_124.pl | 23 --------- .../value_builder/unimarc_field_124a.pl | 23 --------- .../value_builder/unimarc_field_124b.pl | 20 -------- .../value_builder/unimarc_field_124c.pl | 21 --------- .../value_builder/unimarc_field_124d.pl | 20 -------- .../value_builder/unimarc_field_124e.pl | 20 -------- .../value_builder/unimarc_field_124f.pl | 20 -------- .../value_builder/unimarc_field_124g.pl | 23 --------- .../value_builder/unimarc_field_125.pl | 15 ------ .../value_builder/unimarc_field_125a.pl | 20 -------- .../value_builder/unimarc_field_125b.pl | 20 -------- .../value_builder/unimarc_field_126.pl | 23 --------- .../value_builder/unimarc_field_126a.pl | 20 -------- .../value_builder/unimarc_field_126b.pl | 21 --------- .../value_builder/unimarc_field_127.pl | 23 --------- .../value_builder/unimarc_field_128a.pl | 23 --------- .../value_builder/unimarc_field_128b.pl | 20 -------- .../value_builder/unimarc_field_128c.pl | 23 --------- .../value_builder/unimarc_field_130.pl | 21 --------- .../value_builder/unimarc_field_135a.pl | 23 --------- .../value_builder/unimarc_field_140.pl | 23 --------- .../value_builder/unimarc_field_141.pl | 20 -------- .../value_builder/unimarc_field_210c.pl | 44 ----------------- .../value_builder/unimarc_field_210c_bis.pl | 21 --------- .../value_builder/unimarc_field_225a.pl | 13 ----- .../value_builder/unimarc_field_4XX.pl | 15 ------ .../value_builder/unimarc_field_686a.pl | 10 ---- .../value_builder/unimarc_field_700-4.pl | 15 ------ cataloguing/value_builder/unimarc_leader.pl | 19 -------- 77 files changed, 1771 deletions(-) diff --git a/cataloguing/value_builder/barcode.pl b/cataloguing/value_builder/barcode.pl index 5aeae9f61e..61c53d31a1 100755 --- a/cataloguing/value_builder/barcode.pl +++ b/cataloguing/value_builder/barcode.pl @@ -29,32 +29,6 @@ use Algorithm::CheckDigits; my $DEBUG = 0; -=head1 - -plugin_parameters : other parameters added when the plugin is called by the dopop function - -=cut - -sub plugin_parameters { -# my ($dbh,$record,$tagslib,$i,$tabloop) = @_; - return ""; -} - -=head1 - -plugin_javascript : the javascript function called when the user enters the subfield. -contain 3 javascript functions : -* one called when the field is entered (OnFocus). Named FocusXXX -* one called when the field is leaved (onBlur). Named BlurXXX -* one called when the ... link is clicked () named ClicXXX - -returns : -* XXX -* a variable containing the 3 scripts. -the 3 scripts are inserted after the in the html code - -=cut - sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; my $function_name= "barcode".(int(rand(100000))+1); @@ -121,10 +95,6 @@ END_OF_JS "; @@ -114,5 +104,3 @@ sub plugin { } output_html_with_http_headers $input, $cookie, $template->output; } - -1; diff --git a/cataloguing/value_builder/dateaccessioned.pl b/cataloguing/value_builder/dateaccessioned.pl index 2ae821a776..4c3937c4ab 100755 --- a/cataloguing/value_builder/dateaccessioned.pl +++ b/cataloguing/value_builder/dateaccessioned.pl @@ -21,32 +21,6 @@ use Modern::Perl; no warnings 'redefine'; -=head1 - -plugin_parameters : useless here - -=cut - -sub plugin_parameters { - # my ($dbh,$record,$tagslib,$i,$tabloop) = @_; - return ""; -} - -=head1 - -plugin_javascript : the javascript function called when the user enters the subfield. -contain 3 javascript functions : -* one called when the field is entered (OnFocus) named FocusXXX -* one called when the field is left (onBlur ) named BlurXXX -* one called when the ... link is clicked (onClick) named ClicXXX - -returns : -* XXX -* a variable containing the 3 scripts. -the 3 scripts are inserted after the in the html code - -=cut - sub plugin_javascript { # my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; my $function_name = "dateaccessioned".(int(rand(100000))+1); @@ -62,10 +36,6 @@ sub plugin_javascript { // // from: cataloguing/value_builder/dateaccessioned.pl -function Blur$function_name(index) { - //date validation could go here -} - function Focus$function_name(subfield_managed, id, force) { //var summary = ""; //for (i=0 ; i //param("index"=>$index); output_html_with_http_headers $input, $cookie, $template->output; } -1; - - diff --git a/cataloguing/value_builder/marc21_field_003.pl b/cataloguing/value_builder/marc21_field_003.pl index e08ee6c48a..0a5367ec4f 100755 --- a/cataloguing/value_builder/marc21_field_003.pl +++ b/cataloguing/value_builder/marc21_field_003.pl @@ -22,32 +22,6 @@ use strict; #use warnings; FIXME - Bug 2505 use C4::Context; -=head1 - -plugin_parameters : other parameters added when the plugin is called by the dopop function - -=cut - -sub plugin_parameters { - # my ($dbh,$record,$tagslib,$i,$tabloop) = @_; - return ""; -} - -=head1 - -plugin_javascript : the javascript function called when the user enters the subfield. -contain 3 javascript functions : -* one called when the field is entered (OnFocus). Named FocusXXX -* one called when the field is leaved (onBlur). Named BlurXXX -* one called when the ... link is clicked () named ClicXXX - -returns : -* XXX -* a variable containing the 3 scripts. -the 3 scripts are inserted after the in the html code - -=cut - sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; my $function_name= $field_number; @@ -58,31 +32,13 @@ sub plugin_javascript { "; return ($function_name,$res); } - -=head1 - -plugin : the true value_builded. The screen that is open in the popup window. - -=cut - -sub plugin { - return ""; -} - -1; diff --git a/cataloguing/value_builder/marc21_field_005.pl b/cataloguing/value_builder/marc21_field_005.pl index 2be76b5591..2ab14f1d6d 100755 --- a/cataloguing/value_builder/marc21_field_005.pl +++ b/cataloguing/value_builder/marc21_field_005.pl @@ -21,32 +21,6 @@ use strict; #use warnings; FIXME - Bug 2505 #use C4::Context; -=head1 - -plugin_parameters : other parameters added when the plugin is called by the dopop function - -=cut - -sub plugin_parameters { - # my ($dbh,$record,$tagslib,$i,$tabloop) = @_; - return ""; -} - -=head1 - -plugin_javascript : the javascript function called when the user enters the subfield. -contain 3 javascript functions : -* one called when the field is entered (OnFocus). Named FocusXXX -* one called when the field is leaved (onBlur). Named BlurXXX -* one called when the ... link is clicked () named ClicXXX - -returns : -* XXX -* a variable containing the 3 scripts. -the 3 scripts are inserted after the in the html code - -=cut - sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; my $function_name= $field_number; @@ -59,31 +33,13 @@ sub plugin_javascript { "; return ($function_name,$res); } - -=head1 - -plugin : the true value_builded. The screen that is open in the popup window. - -=cut - -sub plugin { - return ""; -} - -1; diff --git a/cataloguing/value_builder/marc21_field_006.pl b/cataloguing/value_builder/marc21_field_006.pl index f2144bc820..f9b57221c2 100755 --- a/cataloguing/value_builder/marc21_field_006.pl +++ b/cataloguing/value_builder/marc21_field_006.pl @@ -34,11 +34,6 @@ plugin_parameters : other parameters added when the plugin is called by the dopo =cut -sub plugin_parameters { - my ($dbh, $record, $tagslib, $i, $tabloop) = @_; - return ""; -} - sub plugin_javascript { my ($dbh, $record, $tagslib, $field_number, $tabloop) = @_; my $function_name = $field_number; @@ -46,14 +41,6 @@ sub plugin_javascript { "; return ($function_name,$res); } - -=head1 plugin - -plugin : the true value_builded. The screen that is open in the popup window. - -=cut - -sub plugin { - return ""; -} - -1; diff --git a/cataloguing/value_builder/marc21_field_040d.pl b/cataloguing/value_builder/marc21_field_040d.pl index 64e5bd3c7b..881916fc86 100755 --- a/cataloguing/value_builder/marc21_field_040d.pl +++ b/cataloguing/value_builder/marc21_field_040d.pl @@ -29,28 +29,6 @@ plugin_parameters : other parameters added when the plugin is called by the dopo =cut -sub plugin_parameters { - # my ($dbh,$record,$tagslib,$i,$tabloop) = @_; - return ""; -} - -=head1 FUNCTIONS - -=head2 plugin_javascript - -The javascript function called when the user enters the subfield. -contain 3 javascript functions : - * one called when the field is entered (OnFocus). Named FocusXXX - * one called when the field is leaved (onBlur). Named BlurXXX - * one called when the ... link is clicked () named ClicXXX - -returns : - * XXX - * a variable containing the 3 scripts. -the 3 scripts are inserted after the in the html code - -=cut - sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; my $function_name = $field_number; @@ -61,31 +39,13 @@ sub plugin_javascript { "; return ($function_name,$res); } - -=head2 plugin - -the true value_builded. The screen that is open in the popup window. - -=cut - -sub plugin { - return ""; -} - -1; diff --git a/cataloguing/value_builder/marc21_field_245h.pl b/cataloguing/value_builder/marc21_field_245h.pl index 9ab2ca1bcd..20c622808f 100755 --- a/cataloguing/value_builder/marc21_field_245h.pl +++ b/cataloguing/value_builder/marc21_field_245h.pl @@ -22,33 +22,6 @@ use strict; #use warnings; FIXME - Bug 2505 use C4::Context; -=head1 FUNCTIONS - -=head2 plugin_parameters - -other parameters added when the plugin is called by the dopop function - -=cut - -sub plugin_parameters { - return ""; -} - -=head2 plugin_javascript - -Thee javascript function called when the user enters the subfield. -contain 3 javascript functions : - * one called when the field is entered (OnFocus). Named FocusXXX - * one called when the field is leaved (onBlur). Named BlurXXX - * one called when the ... link is clicked () named ClicXXX - -returns : - * XXX - * a variable containing the 3 scripts. -the 3 scripts are inserted after the in the html code - -=cut - sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; my $function_name = $field_number; @@ -68,27 +41,8 @@ function Blur$function_name(index) { return 0; } -function Focus$function_name(subfield_managed) { - // Do Nothing -} - -function Clic$function_name(subfield_managed) { - // Do Nothing -} //]]> "; return ($function_name,$res); } - -=head2 plugin - -The true value_builded. The screen that is open in the popup window. - -=cut - -sub plugin { - return ""; -} - -1; diff --git a/cataloguing/value_builder/marc21_leader.pl b/cataloguing/value_builder/marc21_leader.pl index 03ad6ae351..55d6f90068 100755 --- a/cataloguing/value_builder/marc21_leader.pl +++ b/cataloguing/value_builder/marc21_leader.pl @@ -27,17 +27,6 @@ use C4::Context; use C4::Search; use C4::Output; -=head1 - -plugin_parameters : other parameters added when the plugin is called by the dopop function - -=cut - -sub plugin_parameters { -my ($dbh,$record,$tagslib,$i,$tabloop) = @_; -return ""; -} - sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; my $function_name= $field_number; @@ -52,10 +41,6 @@ function Focus$function_name(subfield_managed) { return 1; } -function Blur$function_name(subfield_managed) { - return 1; -} - function Clic$function_name(i) { defaultvalue=document.getElementById(\"$field_number\").value; newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_leader.pl&index=$field_number&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes'); @@ -104,5 +89,3 @@ my ($template, $loggedinuser, $cookie) ); output_html_with_http_headers $input, $cookie, $template->output; } - -1; diff --git a/cataloguing/value_builder/marc21_leader_authorities.pl b/cataloguing/value_builder/marc21_leader_authorities.pl index b3557b351e..239e1dd157 100755 --- a/cataloguing/value_builder/marc21_leader_authorities.pl +++ b/cataloguing/value_builder/marc21_leader_authorities.pl @@ -27,17 +27,6 @@ use C4::Context; use C4::Search; use C4::Output; -=head1 - -plugin_parameters : other parameters added when the plugin is called by the dopop function - -=cut - -sub plugin_parameters { -my ($dbh,$record,$tagslib,$i,$tabloop) = @_; -return ""; -} - sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; my $function_name= $field_number; @@ -52,10 +41,6 @@ function Focus$function_name(subfield_managed) { return 1; } -function Blur$function_name(subfield_managed) { - return 1; -} - function Clic$function_name(i) { defaultvalue=document.getElementById(\"$field_number\").value; newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_leader_authorities.pl&index=$field_number&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes'); @@ -102,5 +87,3 @@ my ($template, $loggedinuser, $cookie) ); output_html_with_http_headers $input, $cookie, $template->output; } - -1; diff --git a/cataloguing/value_builder/marc21_leader_book.pl b/cataloguing/value_builder/marc21_leader_book.pl index a41b94142b..9111612c99 100755 --- a/cataloguing/value_builder/marc21_leader_book.pl +++ b/cataloguing/value_builder/marc21_leader_book.pl @@ -27,17 +27,6 @@ use C4::Context; use C4::Search; use C4::Output; -=head1 - -plugin_parameters : other parameters added when the plugin is called by the dopop function - -=cut - -sub plugin_parameters { -my ($dbh,$record,$tagslib,$i,$tabloop) = @_; -return ""; -} - sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; my $function_name= $field_number; @@ -45,14 +34,6 @@ my $res=" "; @@ -110,5 +100,3 @@ sub plugin { } output_html_with_http_headers $input, $cookie, $template->output; } - -1; diff --git a/cataloguing/value_builder/unimarc_field_010.pl b/cataloguing/value_builder/unimarc_field_010.pl index 4e061f8894..b9045956d5 100755 --- a/cataloguing/value_builder/unimarc_field_010.pl +++ b/cataloguing/value_builder/unimarc_field_010.pl @@ -25,27 +25,10 @@ use CGI qw ( -utf8 ); use C4::Context; -=head1 FUNCTIONS - -=head2 plugin_parameters - -other parameters added when the plugin is called by the dopop function - -=cut - -sub plugin_parameters { - my ($dbh,$record,$tagslib,$i,$tabloop) = @_; - return ""; -} - sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; my $res=" "; @@ -149,4 +129,3 @@ sub plugin { } output_html_with_http_headers $input, $cookie, $template->output; } -1; diff --git a/cataloguing/value_builder/unimarc_field_100.pl b/cataloguing/value_builder/unimarc_field_100.pl index d0eedbf05e..ed77cf058a 100755 --- a/cataloguing/value_builder/unimarc_field_100.pl +++ b/cataloguing/value_builder/unimarc_field_100.pl @@ -28,31 +28,10 @@ use C4::Context; use C4::Output; -=head1 FUNCTIONS - -=head2 plugin_parameters - -Other parameters added when the plugin is called by the dopop function - -=cut - -sub plugin_parameters { - my ( $dbh, $record, $tagslib, $i, $tabloop ) = @_; - return ""; -} - sub plugin_javascript { my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; my $res = "