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

(-)a/admin/auth_tag_structure.pl (-14 / +7 lines)
Lines 100-119 if ($op eq 'add_form') { Link Here
100
        $sth->execute($searchfield,$authtypecode);
100
        $sth->execute($searchfield,$authtypecode);
101
        $data=$sth->fetchrow_hashref;
101
        $data=$sth->fetchrow_hashref;
102
    }
102
    }
103
    my $sth = $dbh->prepare("select distinct category from authorised_values");
103
104
    $sth->execute;
104
    my @authorised_values = @{C4::Koha::GetAuthorisedValueCategories()};    # function returns array ref, dereferencing
105
    my @authorised_values;
105
    unshift @authorised_values, "";                                         # put empty value first
106
    push @authorised_values,"";
106
    my $authorised_value = {
107
    while ((my $category) = $sth->fetchrow_array) {
107
        values  => \@authorised_values,
108
        push @authorised_values, $category;
108
        default => $data->{'authorised_value'},
109
    }
109
    };
110
    my $authorised_value  = CGI::scrolling_list(-name=>'authorised_value',
111
            -id=>'authorised_value',
112
            -values=> \@authorised_values,
113
            -size=>1,
114
            -multiple=>0,
115
            -default => $data->{'authorised_value'},
116
            );
117
110
118
    if ($searchfield) {
111
    if ($searchfield) {
119
        $template->param('searchfield' => $searchfield);
112
        $template->param('searchfield' => $searchfield);
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_tag_structure.tt (-4 / +15 lines)
Lines 108-116 Link Here
108
            [% ELSE %]
108
            [% ELSE %]
109
                <input type="checkbox" name="mandatory" id="mandatory" value="1" />
109
                <input type="checkbox" name="mandatory" id="mandatory" value="1" />
110
            [% END %]
110
            [% END %]
111
            </li>
111
        </li>
112
        <li><label for="authorised_value">Authorized value: </label>[% authorised_value %] (if you select a value here, the indicators will be limited to the authorized value list)</li>
112
        <li><label for="authorised_value">Authorized value: </label>
113
</ol></fieldset>
113
            <select name="authorised_value" id="authorised_value" size="1">
114
            [% FOREACH value IN authorised_value.values %]
115
                [% IF ( value == authorised_value.default ) %]
116
                    <option value="[% value %]" selected>[% value %]</option>
117
                [% ELSE %]
118
                    <option value="[% value %]">[% value %]</option>
119
                [% END %]
120
            [% END %]
121
            </select>
122
            (if you select a value here, the indicators will be limited to the authorized value list)
123
        </li>
124
        </ol>
125
        </fieldset>
114
        <fieldset class="action">
126
        <fieldset class="action">
115
            <input type="submit" value="Submit" />
127
            <input type="submit" value="Submit" />
116
            <a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]" class="cancel">Cancel</a>
128
            <a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]" class="cancel">Cancel</a>
117
- 

Return to bug 12612