use C4::Context;
use Koha::Authority::Types;
+use Koha::AuthorisedValueCategories;
use List::MoreUtils qw( uniq );
$sth2->finish;
$sth2 = $dbh->prepare("select distinct category from authorised_values");
$sth2->execute;
- my @authorised_values;
- push @authorised_values, "";
- while ( ( my $category ) = $sth2->fetchrow_array ) {
- push @authorised_values, $category;
- }
- push( @authorised_values, "branches" );
- push( @authorised_values, "itemtypes" );
- push( @authorised_values, "cn_source" );
+ my @av_cat = Koha::AuthorisedValueCategories->search;
+ my @authorised_values = map { $_->category_name } @av_cat;
# build thesaurus categories list
my @authtypes = uniq( "", map { $_->authtypecode } Koha::Authority::Types->search );
<li>
<label for="authorised_value[% loo.row %]">Authorized value:</label>
<select name="authorised_value" id="authorised_value[% loo.row %]" size="1">
+ <option value=""></option>
[% FOREACH value IN loo.authorised_values %]
[% IF ( value == loo.authorised_value ) %]
<option value="[% value %]" selected="selected">[% value %]</option>