From ea54e11888d8c14399eeb515d840628bee4541d7 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 9 Jun 2010 16:00:09 +0200 Subject: [PATCH] Bug 4866 for 3.0.x (Enable Change event for item plugins) A few lines of code in additem.pl make it possible to add the Change event next to Blur and Focus for item plugins. This prevents running the plugin if the data has not changed. Patch sent for 3.0.x. --- cataloguing/additem.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index ad0d51aca8..fea92077b4 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -174,8 +174,10 @@ sub generate_subfield_form { if (do $plugin) { my $extended_param = plugin_parameters( $dbh, $temp, $tagslib, $subfield_data{id}, $loop_data ); my ( $function_name, $javascript ) = plugin_javascript( $dbh, $temp, $tagslib, $subfield_data{id}, $loop_data ); + my $change= index($javascript, 'function Change')>-1?"return Change$function_name($subfield_data{random}, '$subfield_data{id}');": 'return 1;'; #enhancement 4866 $subfield_data{marc_value} = qq[ ... $javascript]; @@ -453,6 +455,7 @@ foreach my $tag ( keys %{$tagslib}){ } } # what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit. +@loop_data= sort {$a->{subfield} cmp $b->{subfield}} @loop_data; $template->param( title => $record->title() ) if ($record ne "-1"); $template->param( biblionumber => $biblionumber, -- 2.39.5