Koha::UI::Form::Builder::Item
Helper to build a form to add or edit a new item.
my $form = Koha::UI::Form::Builder::Item->new( { biblionumber => $biblionumber, item => $current_item, } );
Constructor. biblionumber should be passed if we are creating a new item. For edition, an hashref representing the item to edit item must be passed.
Generate subfield's info for given tag, subfieldtag, etc.
my $subfields = Koha::UI::Form::Builder::Item->new( { biblionumber => $biblionumber, item => $current_item } )->edit_form( { branchcode => $branchcode, restricted_editition => $restrictededition, ( @subfields_to_prefill ? ( subfields_to_prefill => \@subfields_to_prefill ) : () ), prefill_with_default_values => 1, branch_limit => C4::Context->userenv->{"branch"}, } );
Returns the list of subfields to display on the add/edit item form.
Use it in the view with: [% PROCESS subfields_for_item subfields => subfields %]
Parameters:
Pre-select a library (for logged in user)
Flag to restrict the edition if the user does not have necessary permissions.
List of subfields to prefill (value of syspref SubfieldsToUseWhenPrefill)
If empty all subfields will be prefilled. For none, you can pass an array with a single false value.
List of subfields to allow (value of syspref SubfieldsToAllowForRestrictedBatchmod or SubfieldsToAllowForRestrictedEditing)
If set, the subfields in subfields_to_allow will be ignored (ie. they will not be part of the subfield list. If not set, the subfields in subfields_to_allow will be marked as readonly.
List of subfields to ignore/skip
Flag to prefill with the default values defined in the framework.
Limit info depending on the library (so far only item types).
Flag to add an empty option to the library list.
Skip the subfields that are not visible on the editor.
When duplicating an item we do not want to retrieve the subfields that are hidden.