my $restricted_edition = $params->{restricted_editition};
my $prefill_with_default_values = $params->{prefill_with_default_values};
my $branch_limit = $params->{branch_limit};
+ my $default_branches_empty = $params->{default_branches_empty};
my $item = $self->{item};
my $subfield = $tagslib->{$tag}{$subfieldtag};
}
}
elsif ( $subfield->{authorised_value} eq "branches" ) {
+ push @authorised_values, "" if $default_branches_empty;
foreach my $thisbranch (@$libraries) {
push @authorised_values, $thisbranch->{branchcode};
$authorised_lib{ $thisbranch->{branchcode} } =
my $subfields_to_ignore= $params->{subfields_to_ignore} || [];
my $prefill_with_default_values = $params->{prefill_with_default_values};
my $branch_limit = $params->{branch_limit};
+ my $default_branches_empty = $params->{default_branches_empty};
my $libraries =
Koha::Libraries->search( {}, { order_by => ['branchname'] } )->unblessed;
restricted_edition => $restricted_edition,
prefill_with_default_values => $prefill_with_default_values,
branch_limit => $branch_limit,
+ default_branches_empty => $default_branches_empty,
}
);
push @subfields, $subfield_data;
# Even if we do not display the items, we need the itemnumbers
$template->param(itemnumbers_array => \@itemnumbers);
}
+
# now, build the item form for entering a new item
my @loop_data =();
my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
- my $libraries = Koha::Libraries->search({}, { order_by => ['branchname'] })->unblessed;# build once ahead of time, instead of multiple times later.
-
- # Adding a default choice, in case the user does not want to modify the branch
- my $nochange_branch = { branchname => '', value => '', selected => 1 };
- unshift (@$libraries, $nochange_branch);
-
my $pref_itemcallnumber = C4::Context->preference('itemcallnumber');
# Getting list of subfields to keep when restricted batchmod edit is enabled
),
subfields_to_ignore => ['items.barcode'],
prefill_with_default_values => $use_default_values,
+ default_branches_empty => 1,
}
);
-
-
# what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit.
$template->param(
subfields => $subfields,