Lines 72-88
Generate subfield's info for given tag, subfieldtag, etc.
Link Here
|
72 |
sub generate_subfield_form { |
72 |
sub generate_subfield_form { |
73 |
|
73 |
|
74 |
my ($self, $params) = @_; |
74 |
my ($self, $params) = @_; |
75 |
my $tag = $params->{tag}; |
75 |
my $tag = $params->{tag}; |
76 |
my $subfieldtag = $params->{subfieldtag}; |
76 |
my $subfieldtag = $params->{subfieldtag}; |
77 |
my $value = $params->{value}; |
77 |
my $value = $params->{value}; |
78 |
my $tagslib = $params->{tagslib}; |
78 |
my $tagslib = $params->{tagslib}; |
79 |
my $libraries = $params->{libraries}; |
79 |
my $libraries = $params->{libraries}; |
80 |
my $marc_record = $params->{marc_record}; |
80 |
my $marc_record = $params->{marc_record}; |
81 |
my $restricted_edition = $params->{restricted_editition}; |
81 |
my $restricted_edition = $params->{restricted_editition}; |
82 |
my $prefill_with_default_values = $params->{prefill_with_default_values}; |
82 |
my $prefill_with_default_values = $params->{prefill_with_default_values}; |
83 |
my $branch_limit = $params->{branch_limit}; |
83 |
my $branch_limit = $params->{branch_limit}; |
84 |
my $default_branches_empty = $params->{default_branches_empty}; |
84 |
my $default_branches_empty = $params->{default_branches_empty}; |
85 |
my $readonly = $params->{readonly}; |
85 |
my $readonly = $params->{readonly}; |
|
|
86 |
my $do_not_respect_visibility = $params->{do_not_respect_visibility}; |
86 |
|
87 |
|
87 |
my $item = $self->{item}; |
88 |
my $item = $self->{item}; |
88 |
my $subfield = $tagslib->{$tag}{$subfieldtag}; |
89 |
my $subfield = $tagslib->{$tag}{$subfieldtag}; |
Lines 143-149
sub generate_subfield_form {
Link Here
|
143 |
} |
144 |
} |
144 |
|
145 |
|
145 |
$subfield_data{visibility} = "display:none;" |
146 |
$subfield_data{visibility} = "display:none;" |
146 |
if ( ( $subfield->{hidden} > 4 ) || ( $subfield->{hidden} <= -4 ) ); |
147 |
if ! $do_not_respect_visibility |
|
|
148 |
&& ( ( $subfield->{hidden} > 4 ) || ( $subfield->{hidden} <= -4 ) ); |
147 |
|
149 |
|
148 |
my $pref_itemcallnumber = C4::Context->preference('itemcallnumber'); |
150 |
my $pref_itemcallnumber = C4::Context->preference('itemcallnumber'); |
149 |
if ( $prefill_with_default_values |
151 |
if ( $prefill_with_default_values |
Lines 255-261
sub generate_subfield_form {
Link Here
|
255 |
} |
257 |
} |
256 |
} |
258 |
} |
257 |
|
259 |
|
258 |
if ( $subfield->{hidden} > 4 or $subfield->{hidden} <= -4 ) { |
260 |
if ( !$do_not_respect_visibility |
|
|
261 |
&& ( $subfield->{hidden} > 4 or $subfield->{hidden} <= -4 ) ) |
262 |
{ |
259 |
$subfield_data{marc_value} = { |
263 |
$subfield_data{marc_value} = { |
260 |
type => 'hidden', |
264 |
type => 'hidden', |
261 |
id => $subfield_data{id}, |
265 |
id => $subfield_data{id}, |
Lines 452-457
Limit info depending on the library (so far only item types).
Link Here
|
452 |
|
456 |
|
453 |
Flag to add an empty option to the library list. |
457 |
Flag to add an empty option to the library list. |
454 |
|
458 |
|
|
|
459 |
=item do_not_respect_visibility |
460 |
|
461 |
If set the visibility defined in the framework will not be used to hide the input. |
462 |
Used by the batch item modification (for LOST for instance). |
463 |
|
455 |
=back |
464 |
=back |
456 |
|
465 |
|
457 |
=cut |
466 |
=cut |
Lines 459-473
Flag to add an empty option to the library list.
Link Here
|
459 |
sub edit_form { |
468 |
sub edit_form { |
460 |
my ( $self, $params ) = @_; |
469 |
my ( $self, $params ) = @_; |
461 |
|
470 |
|
462 |
my $branchcode = $params->{branchcode}; |
471 |
my $branchcode = $params->{branchcode}; |
463 |
my $restricted_edition = $params->{restricted_editition}; |
472 |
my $restricted_edition = $params->{restricted_editition}; |
464 |
my $subfields_to_prefill = $params->{subfields_to_prefill} || []; |
473 |
my $subfields_to_prefill = $params->{subfields_to_prefill} || []; |
465 |
my $subfields_to_allow = $params->{subfields_to_allow} || []; |
474 |
my $subfields_to_allow = $params->{subfields_to_allow} || []; |
466 |
my $ignore_not_allowed_subfields = $params->{ignore_not_allowed_subfields}; |
475 |
my $ignore_not_allowed_subfields = $params->{ignore_not_allowed_subfields}; |
467 |
my $kohafields_to_ignore = $params->{kohafields_to_ignore} || []; |
476 |
my $kohafields_to_ignore = $params->{kohafields_to_ignore} || []; |
468 |
my $prefill_with_default_values = $params->{prefill_with_default_values}; |
477 |
my $prefill_with_default_values = $params->{prefill_with_default_values}; |
469 |
my $branch_limit = $params->{branch_limit}; |
478 |
my $branch_limit = $params->{branch_limit}; |
470 |
my $default_branches_empty = $params->{default_branches_empty}; |
479 |
my $default_branches_empty = $params->{default_branches_empty}; |
|
|
480 |
my $do_not_respect_visibility = $params->{do_not_respect_visibility} || 0; |
471 |
|
481 |
|
472 |
my $libraries = |
482 |
my $libraries = |
473 |
Koha::Libraries->search( {}, { order_by => ['branchname'] } )->unblessed; |
483 |
Koha::Libraries->search( {}, { order_by => ['branchname'] } )->unblessed; |
Lines 551-557
sub edit_form {
Link Here
|
551 |
prefill_with_default_values => $prefill_with_default_values, |
561 |
prefill_with_default_values => $prefill_with_default_values, |
552 |
branch_limit => $branch_limit, |
562 |
branch_limit => $branch_limit, |
553 |
default_branches_empty => $default_branches_empty, |
563 |
default_branches_empty => $default_branches_empty, |
554 |
readonly => $readonly |
564 |
readonly => $readonly, |
|
|
565 |
do_not_respect_visibility => $do_not_respect_visibility, |
555 |
} |
566 |
} |
556 |
); |
567 |
); |
557 |
push @subfields, $subfield_data; |
568 |
push @subfields, $subfield_data; |