View | Details | Raw Unified | Return to bug 25728
Collapse All | Expand All

(-)a/authorities/authorities.pl (-2 / +4 lines)
Lines 73-79 sub build_authorized_values_list { Link Here
73
73
74
74
75
    #---- branch
75
    #---- branch
76
    if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) {
76
    my $category = $tagslib->{$tag}->{$subfield}->{'authorised_value'};
77
    if ( $category eq "branches" ) {
77
        my $sth =
78
        my $sth =
78
        $dbh->prepare(
79
        $dbh->prepare(
79
            "select branchcode,branchname from branches order by branchname");
80
            "select branchcode,branchname from branches order by branchname");
Lines 86-92 sub build_authorized_values_list { Link Here
86
            $authorised_lib{$branchcode} = $branchname;
87
            $authorised_lib{$branchcode} = $branchname;
87
        }
88
        }
88
    }
89
    }
89
    elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "itemtypes" ) {
90
    elsif ( $category eq "itemtypes" ) {
90
        push @authorised_values, ""
91
        push @authorised_values, ""
91
          unless ( $tagslib->{$tag}->{$subfield}->{mandatory}
92
          unless ( $tagslib->{$tag}->{$subfield}->{mandatory}
92
            && ( $value || $tagslib->{$tag}->{$subfield}->{defaultvalue} ) );
93
            && ( $value || $tagslib->{$tag}->{$subfield}->{defaultvalue} ) );
Lines 121-126 sub build_authorized_values_list { Link Here
121
        values   => \@authorised_values,
122
        values   => \@authorised_values,
122
        labels   => \%authorised_lib,
123
        labels   => \%authorised_lib,
123
        default  => $value,
124
        default  => $value,
125
        ( ( grep { $_ eq $category } ( qw(branches itemtypes cn_source) ) ) ? () : ( category => $category ) ),
124
    };
126
    };
125
}
127
}
126
128
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt (-2 / +11 lines)
Lines 5-10 Link Here
5
<title>Koha &rsaquo; Authorities &rsaquo; [% IF ( authid ) %]Modify authority #[% authid | html %] ([% authtypetext | html %])[% ELSE %]Adding authority ([% authtypetext | html %])[% END %]</title>
5
<title>Koha &rsaquo; Authorities &rsaquo; [% IF ( authid ) %]Modify authority #[% authid | html %] ([% authtypetext | html %])[% ELSE %]Adding authority ([% authtypetext | html %])[% END %]</title>
6
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
7
[% Asset.js("lib/hc-sticky.js") | $raw %]
7
[% Asset.js("lib/hc-sticky.js") | $raw %]
8
<script>
9
    var CAN_user_parameters_manage_auth_values = "[% CAN_user_parameters_manage_auth_values | html %]";
10
</script>
8
[% INCLUDE 'select2.inc' %]
11
[% INCLUDE 'select2.inc' %]
9
[% Asset.js("js/cataloging.js") | $raw %]
12
[% Asset.js("js/cataloging.js") | $raw %]
10
13
Lines 369-375 function confirmnotdup(redirect){ Link Here
369
                
372
                
370
                [% SET mv = subfield_loo.marc_value %]
373
                [% SET mv = subfield_loo.marc_value %]
371
                [% IF ( mv.type == 'select' ) %]
374
                [% IF ( mv.type == 'select' ) %]
372
                     <select name="[%- mv.name | html -%]" tabindex="1" size="1" class="input_marceditor select2" id="[%- mv.id | html -%]">
375
                    [% IF mv.category AND CAN_user_parameters_manage_auth_values %]
376
                        <select name="[%- mv.name | html -%]" tabindex="1" size="1" class="input_marceditor" id="[%- mv.id | html -%]" data-category="[% mv.category | html %]">
377
                    [% ELSE %]
378
                        <select name="[%- mv.name | html -%]" tabindex="1" size="1" class="input_marceditor select2" id="[%- mv.id | html -%]">
379
                    [% END %]
380
373
                     [% FOREACH aval IN mv.values %]
381
                     [% FOREACH aval IN mv.values %]
374
                         [% IF aval == mv.default %]
382
                         [% IF aval == mv.default %]
375
                         <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option>
383
                         <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option>
Lines 444-449 function confirmnotdup(redirect){ Link Here
444
452
445
</form>
453
</form>
446
454
455
[% INCLUDE 'modals/cataloguing_create_av.inc' %]
456
447
</div>
457
</div>
448
</div>
458
</div>
449
</div>
459
</div>
450
- 

Return to bug 25728