if ($op eq "additem") {
my $add_submit = $input->param('add_submit');
+ my $add_duplicate_submit = $input->param('add_duplicate_submit');
my $add_multiple_copies_submit = $input->param('add_multiple_copies_submit');
my $number_of_copies = $input->param('number_of_copies');
}
# If we have to add & duplicate
- if ($prefillitem) {
+ if ($prefillitem || $add_duplicate_submit) {
$current_item = $item->unblessed;
# we have to clear the barcode field in the duplicate item record to make way for the new one generated by the javascript plugin
$current_item->{barcode} = undef; # FIXME or delete?
}
+
+ # Don't use the "prefill" feature if we want to generate the form with all the info from this item
+ # It will remove subfields that are not in SubfieldsToUseWhenPrefill.
+ $prefillitem = 0 if $add_duplicate_submit;
}
# If we have to add multiple copies