Bug 17216: Use Koha::AVC from mss.pl
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 29 Aug 2016 13:07:45 +0000 (14:07 +0100)
committerBrendan Gallagher <brendan@bywatersolutions.com>
Tue, 11 Oct 2016 07:30:31 +0000 (07:30 +0000)
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
admin/marc_subfields_structure.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt

index 38e6f24..24c8005 100755 (executable)
@@ -24,6 +24,7 @@ use CGI qw ( -utf8 );
 use C4::Context;
 
 use Koha::Authority::Types;
+use Koha::AuthorisedValueCategories;
 
 use List::MoreUtils qw( uniq );
 
@@ -128,14 +129,8 @@ if ( $op eq 'add_form' ) {
     $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 );
index 481df61..4e70bfc 100644 (file)
                             <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>