@@ -, +, @@
The PrepareItemrecordDisplay sub builds an item framework for later use in ACQ
Some cases were missing : item subfield connected to a plugin, hidden subfield, long size subfield.
---
C4/Biblio.pm | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
--- a/C4/Biblio.pm
+++ a/C4/Biblio.pm
@@ -2465,6 +2465,40 @@ sub PrepareItemrecordDisplay {
-tabindex => '',
-multiple => 0,
);
+ } elsif ( $tagslib->{$tag}->{$subfield}->{value_builder} ) {
+ # opening plugin
+ my $plugin = C4::Context->intranetdir . "/cataloguing/value_builder/" . $tagslib->{$tag}->{$subfield}->{'value_builder'};
+ if (do $plugin) {
+ my $temp;
+ my $extended_param = plugin_parameters( $dbh, $temp, $tagslib, $subfield_data{id}, undef );
+ my ( $function_name, $javascript ) = plugin_javascript( $dbh, $temp, $tagslib, $subfield_data{id}, undef );
+ $subfield_data{random} = int(rand(1000000)); # why do we need 2 different randoms?
+ my $index_subfield = int(rand(1000000));
+ $subfield_data{id} = "tag_".$tag."_subfield_".$subfield."_".$index_subfield;
+ $subfield_data{marc_value} = qq[
+ ...
+ $javascript];
+ } else {
+ warn "Plugin Failed: $plugin";
+ $subfield_data{marc_value} = qq(); # supply default input form
+ }
+ }
+ elsif ( $tag eq '' ) { # it's an hidden field
+ $subfield_data{marc_value} = qq();
+ }
+ elsif ( $tagslib->{$tag}->{$subfield}->{'hidden'} ) { # FIXME: shouldn't input type be "hidden" ?
+ $subfield_data{marc_value} = qq();
+ }
+ elsif ( length($defaultvalue) > 100
+ or (C4::Context->preference("marcflavour") eq "UNIMARC" and
+ 300 <= $tag && $tag < 400 && $subfield eq 'a' )
+ or (C4::Context->preference("marcflavour") eq "MARC21" and
+ 500 <= $tag && $tag < 600 )
+ ) {
+ # oversize field (textarea)
+ $subfield_data{marc_value} = qq(\n");
} else {
$subfield_data{marc_value} = "";
}
--