From 1a1b2c0ce019815068bdc873c721049b07a3fdfc Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Sun, 3 May 2020 01:04:41 +0000 Subject: [PATCH] Bug 25354: Clean up JavaScript markup in cataloging plugin scripts This patch makes some minor changes to the JavaScript generated by the cataloging plugins: |; }; diff --git a/cataloguing/value_builder/barcode.pl b/cataloguing/value_builder/barcode.pl index 4c7072631c..bf5b0739dd 100755 --- a/cataloguing/value_builder/barcode.pl +++ b/cataloguing/value_builder/barcode.pl @@ -47,7 +47,7 @@ my $builder = sub { warn "Barcode type = $autoBarcodeType" if $DEBUG; if ((not $autoBarcodeType) or $autoBarcodeType eq 'OFF') { # don't return a value unless we have the appropriate syspref set - return q||; + return q||; } if ($autoBarcodeType eq 'annual') { ($nextnum, $scr) = C4::Barcodes::ValueBuilder::annual::get_barcode(\%args); @@ -89,8 +89,7 @@ if (\$('#' + id).val() == '' || force) { END_OF_JS my $js = < -// function Focus$function_name(id, force) { $scr @@ -100,7 +99,6 @@ function Click$function_name(id) { Focus$function_name(id, 1); return false; } -//]]> END_OF_JS return $js; diff --git a/cataloguing/value_builder/barcode_manual.pl b/cataloguing/value_builder/barcode_manual.pl index 1167c7fbc8..91c5f186a8 100755 --- a/cataloguing/value_builder/barcode_manual.pl +++ b/cataloguing/value_builder/barcode_manual.pl @@ -48,7 +48,7 @@ my $builder = sub { warn "Barcode type = $autoBarcodeType" if $DEBUG; if ((not $autoBarcodeType) or $autoBarcodeType eq 'OFF') { # don't return a value unless we have the appropriate syspref set - return q||; + return q||; } if ($autoBarcodeType eq 'annual') { ($nextnum, $scr) = C4::Barcodes::ValueBuilder::annual::get_barcode(\%args); @@ -68,14 +68,12 @@ my $builder = sub { END_OF_JS my $js = < - // function Click$function_name(id) { $scr return false; } - //]]> END_OF_JS return $js; diff --git a/cataloguing/value_builder/callnumber-KU.pl b/cataloguing/value_builder/callnumber-KU.pl index 7316afc617..d7a9278203 100755 --- a/cataloguing/value_builder/callnumber-KU.pl +++ b/cataloguing/value_builder/callnumber-KU.pl @@ -45,7 +45,7 @@ CCC QW - returns first unused number CCC QWxx starting with CCC QW01 my $builder = sub { my ( $params ) = @_; my $res=" - "; return $res; diff --git a/cataloguing/value_builder/dateaccessioned.pl b/cataloguing/value_builder/dateaccessioned.pl index ab18ee9ec5..9479fb3f9c 100755 --- a/cataloguing/value_builder/dateaccessioned.pl +++ b/cataloguing/value_builder/dateaccessioned.pl @@ -31,7 +31,7 @@ my $builder = sub { my $res = < -// from: cataloguing/value_builder/dateaccessioned.pl +/* from: cataloguing/value_builder/dateaccessioned.pl */ \$(document).ready(function(){ \$("#$function_name").datepicker({ @@ -51,7 +51,7 @@ function Click$function_name(event) { } function set_to_today( id, force ) { - // The force parameter is used in Click but not in Focus ! + /* The force parameter is used in Click but not in Focus ! */ if (! id) { alert(_("Bad id ") + id + _(" sent to set_to_today()")); return 0; } if (\$("#" + id).val() == '' || \$("#" + id).val() == '0000-00-00' || force ) { \$("#" + id).val("$date"); diff --git a/cataloguing/value_builder/macles.pl b/cataloguing/value_builder/macles.pl index d50edfb2d4..071a29e805 100755 --- a/cataloguing/value_builder/macles.pl +++ b/cataloguing/value_builder/macles.pl @@ -30,12 +30,10 @@ my $builder = sub { my ( $params ) = @_; my $function_name = $params->{id}; my $res=" - "; return $res; diff --git a/cataloguing/value_builder/marc21_field_005.pl b/cataloguing/value_builder/marc21_field_005.pl index 4bf4c21755..6b5263163a 100755 --- a/cataloguing/value_builder/marc21_field_005.pl +++ b/cataloguing/value_builder/marc21_field_005.pl @@ -30,18 +30,16 @@ my $builder = sub { my $date = sprintf("%4d%02d%02d%02d%02d%04.1f",@a); my $res = " - "; return $res; }; -return { builder => $builder }; \ No newline at end of file +return { builder => $builder }; diff --git a/cataloguing/value_builder/marc21_field_006.pl b/cataloguing/value_builder/marc21_field_006.pl index b8740b13c9..65c8c8032f 100755 --- a/cataloguing/value_builder/marc21_field_006.pl +++ b/cataloguing/value_builder/marc21_field_006.pl @@ -33,15 +33,13 @@ my $builder = sub { my ( $params ) = @_; my $function_name = $params->{id}; my $res = " - "; diff --git a/cataloguing/value_builder/marc21_field_007.pl b/cataloguing/value_builder/marc21_field_007.pl index 4aab5a8b15..f06dd8b260 100755 --- a/cataloguing/value_builder/marc21_field_007.pl +++ b/cataloguing/value_builder/marc21_field_007.pl @@ -32,15 +32,13 @@ my $builder = sub { my ( $params ) = @_; my $function_name = $params->{id}; my $res = " - "; diff --git a/cataloguing/value_builder/marc21_field_008.pl b/cataloguing/value_builder/marc21_field_008.pl index b046042b38..b3c5d0c47f 100755 --- a/cataloguing/value_builder/marc21_field_008.pl +++ b/cataloguing/value_builder/marc21_field_008.pl @@ -42,8 +42,7 @@ my $builder = sub { my $function_name = $params->{id}; my $dateentered = date_entered(); my $res = " - "; diff --git a/cataloguing/value_builder/marc21_field_008_authorities.pl b/cataloguing/value_builder/marc21_field_008_authorities.pl index 1eb45d0070..1047faca47 100755 --- a/cataloguing/value_builder/marc21_field_008_authorities.pl +++ b/cataloguing/value_builder/marc21_field_008_authorities.pl @@ -37,8 +37,7 @@ my $builder = sub { my $dateentered = date_entered(); my $defaultval = substr( C4::Context->preference(PREF_008) || FIXLEN_DATA_ELTS, 0, 34 ); my $res=" - "; diff --git a/cataloguing/value_builder/marc21_field_008_classifications.pl b/cataloguing/value_builder/marc21_field_008_classifications.pl index 8d6ccd05c6..d864f87459 100755 --- a/cataloguing/value_builder/marc21_field_008_classifications.pl +++ b/cataloguing/value_builder/marc21_field_008_classifications.pl @@ -32,8 +32,7 @@ my $builder = sub { my $dateentered = date_entered(); my $defaultval = FIXLEN_DATA_ELTS; my $res=" - "; diff --git a/cataloguing/value_builder/marc21_field_245h.pl b/cataloguing/value_builder/marc21_field_245h.pl index 0680410d88..667ae2249a 100755 --- a/cataloguing/value_builder/marc21_field_245h.pl +++ b/cataloguing/value_builder/marc21_field_245h.pl @@ -27,8 +27,7 @@ my $builder = sub { my $function_name = $params->{id}; my $res = " - "; return $res; }; -return { builder => $builder }; \ No newline at end of file +return { builder => $builder }; diff --git a/cataloguing/value_builder/marc21_leader.pl b/cataloguing/value_builder/marc21_leader.pl index 452f45176a..4a176e0d11 100755 --- a/cataloguing/value_builder/marc21_leader.pl +++ b/cataloguing/value_builder/marc21_leader.pl @@ -30,8 +30,7 @@ my $builder = sub { my ( $params ) = @_; my $function_name = $params->{id}; my $res = " - "; diff --git a/cataloguing/value_builder/marc21_leader_authorities.pl b/cataloguing/value_builder/marc21_leader_authorities.pl index 86e6b8e195..03d76eed21 100755 --- a/cataloguing/value_builder/marc21_leader_authorities.pl +++ b/cataloguing/value_builder/marc21_leader_authorities.pl @@ -32,8 +32,7 @@ my $builder = sub { my ( $params ) = @_; my $function_name = $params->{id}; my $res = " - "; @@ -91,4 +89,4 @@ my $launcher = sub { output_html_with_http_headers $input, $cookie, $template->output; }; -return { builder => $builder, launcher => $launcher }; \ No newline at end of file +return { builder => $builder, launcher => $launcher }; diff --git a/cataloguing/value_builder/marc21_linking_section.pl b/cataloguing/value_builder/marc21_linking_section.pl index 18a24e3e95..905dd102ab 100755 --- a/cataloguing/value_builder/marc21_linking_section.pl +++ b/cataloguing/value_builder/marc21_linking_section.pl @@ -41,7 +41,7 @@ my $builder = sub { my ( $params ) = @_; my $function_name = $params->{id}; my $res = " - HERE }; diff --git a/cataloguing/value_builder/normarc_field_007.pl b/cataloguing/value_builder/normarc_field_007.pl index 87f2329aef..89051a2356 100755 --- a/cataloguing/value_builder/normarc_field_007.pl +++ b/cataloguing/value_builder/normarc_field_007.pl @@ -29,15 +29,13 @@ sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; my $function_name= $field_number; my $res=" - "; diff --git a/cataloguing/value_builder/normarc_field_008.pl b/cataloguing/value_builder/normarc_field_008.pl index 1a5893f35d..0f0bfb9a1a 100755 --- a/cataloguing/value_builder/normarc_field_008.pl +++ b/cataloguing/value_builder/normarc_field_008.pl @@ -39,8 +39,7 @@ sub plugin_javascript { my ($dbh, $record, $tagslib, $field_number, $tabloop) = @_; my $function_name = $field_number; my $res = " - "; diff --git a/cataloguing/value_builder/normarc_leader.pl b/cataloguing/value_builder/normarc_leader.pl index debc3aa0bf..7a07aac284 100755 --- a/cataloguing/value_builder/normarc_leader.pl +++ b/cataloguing/value_builder/normarc_leader.pl @@ -31,8 +31,7 @@ sub plugin_javascript { my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; my $function_name= $field_number; my $res=" - "; diff --git a/cataloguing/value_builder/stocknumber.pl b/cataloguing/value_builder/stocknumber.pl index 11e237c921..03dc79de06 100755 --- a/cataloguing/value_builder/stocknumber.pl +++ b/cataloguing/value_builder/stocknumber.pl @@ -37,8 +37,7 @@ my $builder = sub { $nextnum = $branchcode.'_'.$nextnum; my $js = < -// function Focus$function_name(id, force) { if (\$('#' + id).val() == '' || force) { @@ -50,7 +49,6 @@ function Click$function_name(event) { Focus$function_name(event.data.id, 1); return false; } -//]]> END_OF_JS return $js; diff --git a/cataloguing/value_builder/stocknumberam123.pl b/cataloguing/value_builder/stocknumberam123.pl index 13872ba5f4..a69506eaf1 100755 --- a/cataloguing/value_builder/stocknumberam123.pl +++ b/cataloguing/value_builder/stocknumberam123.pl @@ -43,7 +43,7 @@ In this case, a stocknumber has this form : "PREFIX 0009678570". my $builder = sub { my ( $params ) = @_; my $res=" -