@@ -, +, @@ style --- cataloguing/value_builder/marc21_field_003.pl | 19 ++++++----- cataloguing/value_builder/marc21_field_005.pl | 19 ++++++----- cataloguing/value_builder/marc21_field_006.pl | 30 +++++++++-------- cataloguing/value_builder/marc21_field_007.pl | 30 +++++++++-------- cataloguing/value_builder/marc21_field_008.pl | 34 +++++++++++--------- .../value_builder/marc21_field_008_authorities.pl | 34 +++++++++++--------- cataloguing/value_builder/marc21_field_040c.pl | 19 ++++++----- cataloguing/value_builder/marc21_field_040d.pl | 19 ++++++----- cataloguing/value_builder/marc21_field_245h.pl | 21 ++++++------ cataloguing/value_builder/marc21_leader.pl | 34 +++++++++++--------- .../value_builder/marc21_leader_authorities.pl | 34 +++++++++++--------- cataloguing/value_builder/marc21_leader_book.pl | 30 +++++++++-------- .../value_builder/marc21_leader_computerfile.pl | 30 +++++++++-------- cataloguing/value_builder/marc21_leader_video.pl | 28 +++++++++------- .../value_builder/marc21_linking_section.pl | 28 +++++++++------- 15 files changed, 232 insertions(+), 177 deletions(-) --- a/cataloguing/value_builder/marc21_field_003.pl +++ a/cataloguing/value_builder/marc21_field_003.pl @@ -1,5 +1,7 @@ #!/usr/bin/perl +# Converted to new plugin style (Bug 13437) + # Copyright 2000-2002 Katipo Communications # @@ -18,13 +20,12 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -#use warnings; FIXME - Bug 2505 +use Modern::Perl; use C4::Context; -sub plugin_javascript { - my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; - my $function_name= $field_number; +my $builder = sub { + my ( $params ) = @_; + my $function_name = $params->{id}; my $org = C4::Context->preference('MARCOrgCode'); my $res = " @@ -32,12 +33,14 @@ sub plugin_javascript { //{id}\").value='$org'; return 0; } //]]> "; - return ($function_name,$res); -} + return $res; +}; + +return { builder => $builder }; --- a/cataloguing/value_builder/marc21_field_005.pl +++ a/cataloguing/value_builder/marc21_field_005.pl @@ -1,5 +1,7 @@ #!/usr/bin/perl +# Converted to new plugin style (Bug 13437) + # Copyright 2000-2002 Katipo Communications # # This file is part of Koha. @@ -17,12 +19,11 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -#use warnings; FIXME - Bug 2505 +use Modern::Perl; -sub plugin_javascript { - my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; - my $function_name= $field_number; +my $builder = sub { + my ( $params ) = @_; + my $function_name = $params->{id}; # find today's date my @a= (localtime) [5,4,3,2,1,0]; $a[0]+=1900; $a[1]++; @@ -33,12 +34,14 @@ sub plugin_javascript { //{id}\").value='$date'; return 0; } //]]> "; - return ($function_name,$res); -} + return $res; +}; + +return { builder => $builder }; --- a/cataloguing/value_builder/marc21_field_006.pl +++ a/cataloguing/value_builder/marc21_field_006.pl @@ -1,5 +1,7 @@ #!/usr/bin/perl +# Converted to new plugin style (Bug 13437) + # Copyright 2000-2002 Katipo Communications # # This file is part of Koha. @@ -17,8 +19,7 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -#use warnings; FIXME - Bug 2505 +use Modern::Perl; use C4::Auth; use CGI qw ( -utf8 ); use C4::Context; @@ -28,27 +29,28 @@ use C4::Output; use XML::LibXML; -sub plugin_javascript { - my ($dbh, $record, $tagslib, $field_number, $tabloop) = @_; - my $function_name = $field_number; +my $builder = sub { + my ( $params ) = @_; + my $function_name = $params->{id}; my $res = " "; - return ($function_name, $res); -} + return $res; +}; -sub plugin { - my ($input) = @_; +my $launcher = sub { + my ( $params ) = @_; + my $input = $params->{cgi}; my $index = $input->param('index'); my $result = $input->param('result'); @@ -86,4 +88,6 @@ sub plugin { errorXml => $errorXml, ); output_html_with_http_headers $input, $cookie, $template->output; -} +}; + +return { builder => $builder, launcher => $launcher }; --- a/cataloguing/value_builder/marc21_field_007.pl +++ a/cataloguing/value_builder/marc21_field_007.pl @@ -1,5 +1,7 @@ #!/usr/bin/perl +# Converted to new plugin style (Bug 13437) + # Copyright 2000-2002 Katipo Communications # # This file is part of Koha. @@ -17,9 +19,8 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; +use Modern::Perl; -#use warnings; FIXME - Bug 2505 use C4::Auth; use CGI qw ( -utf8 ); use C4::Context; @@ -27,27 +28,28 @@ use C4::Context; use C4::Search; use C4::Output; -sub plugin_javascript { - my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; - my $function_name = $field_number; +my $builder = sub { + my ( $params ) = @_; + my $function_name = $params->{id}; my $res = " "; - return ( $function_name, $res ); -} + return $res; +}; -sub plugin { - my ($input) = @_; +my $launcher = sub { + my ( $params ) = @_; + my $input = $params->{cgi}; my $index = $input->param('index'); my $result = $input->param('result'); @@ -144,4 +146,6 @@ sub plugin { "f22$f22" => $f22, ); output_html_with_http_headers $input, $cookie, $template->output; -} +}; + +return { builder => $builder, launcher => $launcher }; --- a/cataloguing/value_builder/marc21_field_008.pl +++ a/cataloguing/value_builder/marc21_field_008.pl @@ -1,5 +1,7 @@ #!/usr/bin/perl +# Converted to new plugin style (Bug 13437) + # Copyright 2000-2002 Katipo Communications # # This file is part of Koha. @@ -17,8 +19,7 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -#use warnings; FIXME - Bug 2505 +use Modern::Perl; use C4::Auth; use CGI qw ( -utf8 ); use C4::Context; @@ -36,30 +37,30 @@ sub date_entered { return substr($year, 2, 2) . sprintf("%0.2d", $mon) . sprintf("%0.2d", $mday); } -sub plugin_javascript { - my ($dbh, $record, $tagslib, $field_number, $tabloop) = @_; +my $builder = sub { + my ( $params ) = @_; my $lang = C4::Context->preference('DefaultLanguageField008' ); $lang = "eng" unless $lang; $lang = pack("A3", $lang); - my $function_name = $field_number; + my $function_name = $params->{id}; my $dateentered = date_entered(); my $res = " "; - return ($function_name, $res); -} + return $res; +}; -sub plugin { - my ($input) = @_; +my $launcher = sub { + my ( $params ) = @_; + my $input = $params->{cgi}; my $lang = C4::Context->preference('DefaultLanguageField008' ); $lang = "eng" unless $lang; $lang = pack("A3", $lang); @@ -170,4 +172,6 @@ sub plugin { material_configuration => $material_configuration, ); output_html_with_http_headers $input, $cookie, $template->output; -} +}; + +return { builder => $builder, launcher => $launcher }; --- a/cataloguing/value_builder/marc21_field_008_authorities.pl +++ a/cataloguing/value_builder/marc21_field_008_authorities.pl @@ -1,5 +1,7 @@ #!/usr/bin/perl +# Converted to new plugin style (Bug 13437) + # Copyright 2000-2002 Katipo Communications # # This file is part of Koha. @@ -17,8 +19,7 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -#use warnings; FIXME - Bug 2505 +use Modern::Perl; use C4::Auth; use CGI qw ( -utf8 ); use C4::Context; @@ -37,9 +38,9 @@ sub date_entered { return substr($year,2,2).sprintf ("%0.2d", $mon).sprintf ("%0.2d",$mday); } -sub plugin_javascript { - my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; - my $function_name= $field_number; +my $builder = sub { + my ( $params ) = @_; + my $function_name = $params->{id}; my $dateentered = date_entered(); my $defaultval = Field008(); my $res=" @@ -47,32 +48,33 @@ sub plugin_javascript { //{id}\").value) { var authtype=document.forms['f'].elements['authtypecode'].value; var fieldval='$dateentered$defaultval'; if(authtype && (authtype == 'TOPIC_TERM' || authtype == 'GENRE/FORM' || authtype == 'CHRON_TERM')) { fieldval= fieldval.substr(0,14)+'b'+fieldval.substr(15); } - document.getElementById(\"$field_number\").value=fieldval; + document.getElementById(\"$params->{id}\").value=fieldval; } return 1; } -function Clic$function_name(i) { +function Click$function_name(i) { var authtype=document.forms['f'].elements['authtypecode'].value; - defaultvalue=document.getElementById(\"$field_number\").value; - newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_field_008_authorities.pl&index=$field_number&result=\"+defaultvalue+\"&authtypecode=\"+authtype,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes'); + defaultvalue=document.getElementById(\"$params->{id}\").value; + newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_field_008_authorities.pl&index=$params->{id}&result=\"+defaultvalue+\"&authtypecode=\"+authtype,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes'); } //]]> "; - return ($function_name,$res); -} + return $res; +}; -sub plugin { - my ($input) = @_; +my $launcher = sub { + my ( $params ) = @_; + my $input = $params->{cgi}; my $index= $input->param('index'); my $result= $input->param('result'); my $authtype= $input->param('authtypecode')||''; @@ -108,7 +110,7 @@ sub plugin { ); } output_html_with_http_headers $input, $cookie, $template->output; -} +}; sub Field008 { my $pref= C4::Context->preference(PREF_008); @@ -121,3 +123,5 @@ sub Field008 { } return substr($pref,0,34); #ignore remainder } + +return { builder => $builder, launcher => $launcher }; --- a/cataloguing/value_builder/marc21_field_040c.pl +++ a/cataloguing/value_builder/marc21_field_040c.pl @@ -1,5 +1,7 @@ #!/usr/bin/perl +# Converted to new plugin style (Bug 13437) + # Copyright 2000-2002 Katipo Communications # # This file is part of Koha. @@ -17,13 +19,12 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -#use warnings; FIXME - Bug 2505 +use Modern::Perl; use C4::Context; -sub plugin_javascript { - my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; - my $function_name= $field_number; +my $builder = sub { + my ( $params ) = @_; + my $function_name = $params->{id}; my $org = C4::Context->preference('MARCOrgCode'); my $res = " @@ -31,12 +32,14 @@ sub plugin_javascript { //{id}\").value='$org'; return 0; } //]]> "; - return ($function_name,$res); -} + return $res; +}; + +return { builder => $builder }; --- a/cataloguing/value_builder/marc21_field_040d.pl +++ a/cataloguing/value_builder/marc21_field_040d.pl @@ -1,5 +1,7 @@ #!/usr/bin/perl +# Converted to new plugin style (Bug 13437) + # Copyright 2000-2002 Katipo Communications # # This file is part of Koha. @@ -17,13 +19,12 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -#use warnings; FIXME - Bug 2505 +use Modern::Perl; use C4::Context; -sub plugin_javascript { - my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; - my $function_name = $field_number; +my $builder = sub { + my ( $params ) = @_; + my $function_name = $params->{id}; my $org = C4::Context->preference('MARCOrgCode'); my $res = " @@ -31,12 +32,14 @@ sub plugin_javascript { //{id}\").value='$org'; return 0; } //]]> "; - return ($function_name,$res); -} + return $res; +}; + +return { builder => $builder }; --- a/cataloguing/value_builder/marc21_field_245h.pl +++ a/cataloguing/value_builder/marc21_field_245h.pl @@ -1,5 +1,7 @@ #!/usr/bin/perl +# Converted to new plugin style (Bug 13437) + # Copyright 2009 Kyle Hall # # This file is part of Koha. @@ -17,25 +19,24 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -#use warnings; FIXME - Bug 2505 +use Modern::Perl; use C4::Context; -sub plugin_javascript { - my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; - my $function_name = $field_number; +my $builder = sub { + my ( $params ) = @_; + my $function_name = $params->{id}; my $res = " "; - return ($function_name,$res); -} + return $res; +}; + +return { builder => $builder }; --- a/cataloguing/value_builder/marc21_leader.pl +++ a/cataloguing/value_builder/marc21_leader.pl @@ -1,5 +1,7 @@ #!/usr/bin/perl +# Converted to new plugin style (Bug 13437) + # Copyright 2000-2002 Katipo Communications # # This file is part of Koha. @@ -17,9 +19,8 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; +use Modern::Perl; -#use warnings; FIXME - Bug 2505 use C4::Auth; use CGI qw ( -utf8 ); use C4::Context; @@ -27,34 +28,35 @@ use C4::Context; use C4::Search; use C4::Output; -sub plugin_javascript { - my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; - my $function_name = $field_number; +my $builder = sub { + my ( $params ) = @_; + my $function_name = $params->{id}; my $res = " "; - return ( $function_name, $res ); -} + return $res; +}; -sub plugin { - my ($input) = @_; +my $launcher = sub { + my ( $params ) = @_; + my $input = $params->{cgi}; my $index = $input->param('index'); my $result = $input->param('result'); @@ -90,4 +92,6 @@ sub plugin { "f2023" => $f2023, ); output_html_with_http_headers $input, $cookie, $template->output; -} +}; + +return { builder => $builder, launcher => $launcher }; --- a/cataloguing/value_builder/marc21_leader_authorities.pl +++ a/cataloguing/value_builder/marc21_leader_authorities.pl @@ -1,5 +1,7 @@ #!/usr/bin/perl +# Converted to new plugin style (Bug 13437) + # Copyright 2000-2002 Katipo Communications # # This file is part of Koha. @@ -17,9 +19,8 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; +use Modern::Perl; -#use warnings; FIXME - Bug 2505 use C4::Auth; use CGI qw ( -utf8 ); use C4::Context; @@ -27,34 +28,35 @@ use C4::Context; use C4::Search; use C4::Output; -sub plugin_javascript { - my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; - my $function_name = $field_number; +my $builder = sub { + my ( $params ) = @_; + my $function_name = $params->{id}; my $res = " "; - return ( $function_name, $res ); -} + return $res; +}; -sub plugin { - my ($input) = @_; +my $launcher = sub { + my ( $params ) = @_; + my $input = $params->{cgi}; my $index = $input->param('index'); my $result = $input->param('result'); @@ -88,4 +90,6 @@ sub plugin { "f2023" => $f2023, ); output_html_with_http_headers $input, $cookie, $template->output; -} +}; + +return { builder => $builder, launcher => $launcher }; --- a/cataloguing/value_builder/marc21_leader_book.pl +++ a/cataloguing/value_builder/marc21_leader_book.pl @@ -1,5 +1,7 @@ #!/usr/bin/perl +# Converted to new plugin style (Bug 13437) + # Copyright 2000-2002 Katipo Communications # # This file is part of Koha. @@ -17,9 +19,8 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; +use Modern::Perl; -#use warnings; FIXME - Bug 2505 use C4::Auth; use CGI qw ( -utf8 ); use C4::Context; @@ -27,27 +28,28 @@ use C4::Context; use C4::Search; use C4::Output; -sub plugin_javascript { - my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; - my $function_name = $field_number; +my $builder = sub { + my ( $params ) = @_; + my $function_name = $params->{id}; my $res = " "; - return ( $function_name, $res ); -} + return $res; +}; -sub plugin { - my ($input) = @_; +my $launcher = sub { + my ( $params ) = @_; + my $input = $params->{cgi}; my $index = $input->param('index'); my $result = $input->param('result'); @@ -84,4 +86,6 @@ sub plugin { "f19$f19" => 1, ); output_html_with_http_headers $input, $cookie, $template->output; -} +}; + +return { builder => $builder, launcher => $launcher }; --- a/cataloguing/value_builder/marc21_leader_computerfile.pl +++ a/cataloguing/value_builder/marc21_leader_computerfile.pl @@ -1,5 +1,7 @@ #!/usr/bin/perl +# Converted to new plugin style (Bug 13437) + # Copyright 2000-2002 Katipo Communications # # This file is part of Koha. @@ -17,9 +19,8 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; +use Modern::Perl; -#use warnings; FIXME - Bug 2505 use C4::Auth; use CGI qw ( -utf8 ); use C4::Context; @@ -27,27 +28,28 @@ use C4::Context; use C4::Search; use C4::Output; -sub plugin_javascript { - my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; - my $function_name = $field_number; +my $builder = sub { + my ( $params ) = @_; + my $function_name = $params->{id}; my $res = " "; - return ( $function_name, $res ); -} + return $res; +}; -sub plugin { - my ($input) = @_; +my $launcher = sub { + my ( $params ) = @_; + my $input = $params->{cgi}; my $index = $input->param('index'); my $result = $input->param('result'); @@ -84,4 +86,6 @@ sub plugin { "f19$f19" => 1, ); output_html_with_http_headers $input, $cookie, $template->output; -} +}; + +return { builder => $builder, launcher => $launcher }; --- a/cataloguing/value_builder/marc21_leader_video.pl +++ a/cataloguing/value_builder/marc21_leader_video.pl @@ -1,5 +1,7 @@ #!/usr/bin/perl +# Converted to new plugin style (Bug 13437) + # Copyright 2000-2002 Katipo Communications # # This file is part of Koha. @@ -17,9 +19,8 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; +use Modern::Perl; -#use warnings; FIXME - Bug 2505 use C4::Auth; use CGI qw ( -utf8 ); use C4::Context; @@ -27,15 +28,15 @@ use C4::Context; use C4::Search; use C4::Output; -sub plugin_javascript { - my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; - my $function_name = $field_number; +my $builder = sub { + my ( $params ) = @_; + my $function_name = $params->{id}; my $res = " "; - return ( $function_name, $res ); -} + return $res; +}; -sub plugin { - my ($input) = @_; +my $launcher = sub { + my ( $params ) = @_; + my $input = $params->{cgi}; my $index = $input->param('index'); my $result = $input->param('result'); @@ -84,4 +86,6 @@ sub plugin { "f19$f19" => 1, ); output_html_with_http_headers $input, $cookie, $template->output; -} +}; + +return { builder => $builder, launcher => $launcher }; --- a/cataloguing/value_builder/marc21_linking_section.pl +++ a/cataloguing/value_builder/marc21_linking_section.pl @@ -1,5 +1,7 @@ #!/usr/bin/perl +# Converted to new plugin style (Bug 13437) + # Copyright Biblibre 2007 - CILEA 2011 # # This file is part of Koha. @@ -17,8 +19,7 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -use warnings; +use Modern::Perl; use CGI qw ( -utf8 ); use C4::Output; @@ -33,24 +34,25 @@ use MARC::Record; use C4::Branch; use C4::ItemType; -sub plugin_javascript { - my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_; - my $function_name = $field_number; +my $builder = sub { + my ( $params ) = @_; + my $function_name = $params->{id}; my $res = " "; - return ( $function_name, $res ); -} + return $res; +}; -sub plugin { - my ($query) = @_; +my $launcher = sub { + my ( $params ) = @_; + my $query = $params->{cgi}; my $dbh = C4::Context->dbh; my $op = $query->param('op'); # -- op could be equal to @@ -311,4 +313,6 @@ sub plugin { ); } output_html_with_http_headers $query, $cookie, $template->output; -} +}; + +return { builder => $builder, launcher => $launcher }; --