Bug 32827: Fix cataloguing/value_builder/unimarc_field_110.pl
authorJulian Maurice <julian.maurice@biblibre.com>
Fri, 3 Feb 2023 10:58:52 +0000 (11:58 +0100)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 24 Feb 2023 20:01:08 +0000 (17:01 -0300)
Use event parameter

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
cataloguing/value_builder/unimarc_field_110.pl

index b3e88e2..8b0743f 100755 (executable)
@@ -33,9 +33,10 @@ sub plugin_javascript {
     my ($dbh,$record,$tagslib,$field_number) = @_;
     my $res="
     <script>
-    function Clic$field_number() {
-            defaultvalue=document.getElementById(\"$field_number\").value;
-            window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_110.pl&index=$field_number&result=\"+defaultvalue,\"unimarc_field_110\",'width=700,height=600,toolbar=false,scrollbars=yes');
+    function Clic$field_number(ev) {
+            ev.preventDefault();
+            defaultvalue=document.getElementById(ev.data.id).value;
+            window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_110.pl&index=\" + ev.data.id + \"&result=\"+defaultvalue,\"unimarc_field_110\",'width=700,height=600,toolbar=false,scrollbars=yes');
 
     }
     </script>