#---- branch
- if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) {
+ my $category = $tagslib->{$tag}->{$subfield}->{'authorised_value'};
+ if ( $category eq "branches" ) {
my $sth =
$dbh->prepare(
"select branchcode,branchname from branches order by branchname");
$authorised_lib{$branchcode} = $branchname;
}
}
- elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "itemtypes" ) {
+ elsif ( $category eq "itemtypes" ) {
push @authorised_values, ""
unless ( $tagslib->{$tag}->{$subfield}->{mandatory}
&& ( $value || $tagslib->{$tag}->{$subfield}->{defaultvalue} ) );
values => \@authorised_values,
labels => \%authorised_lib,
default => $value,
+ ( ( grep { $_ eq $category } ( qw(branches itemtypes cn_source) ) ) ? () : ( category => $category ) ),
};
}
<title>Koha › Authorities › [% IF ( authid ) %]Modify authority #[% authid | html %] ([% authtypetext | html %])[% ELSE %]Adding authority ([% authtypetext | html %])[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
[% Asset.js("lib/hc-sticky.js") | $raw %]
+<script>
+ var CAN_user_parameters_manage_auth_values = "[% CAN_user_parameters_manage_auth_values | html %]";
+</script>
[% INCLUDE 'select2.inc' %]
[% Asset.js("js/cataloging.js") | $raw %]
[% SET mv = subfield_loo.marc_value %]
[% IF ( mv.type == 'select' ) %]
- <select name="[%- mv.name | html -%]" tabindex="1" size="1" class="input_marceditor select2" id="[%- mv.id | html -%]">
+ [% IF mv.category AND CAN_user_parameters_manage_auth_values %]
+ <select name="[%- mv.name | html -%]" tabindex="1" size="1" class="input_marceditor" id="[%- mv.id | html -%]" data-category="[% mv.category | html %]">
+ [% ELSE %]
+ <select name="[%- mv.name | html -%]" tabindex="1" size="1" class="input_marceditor select2" id="[%- mv.id | html -%]">
+ [% END %]
+
[% FOREACH aval IN mv.values %]
[% IF aval == mv.default %]
<option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option>
</form>
+[% INCLUDE 'modals/cataloguing_create_av.inc' %]
+
</div>
</div>
</div>