Bug 12446: Ability to allow guarantor relationship for all patron category types
[koha-ffzg.git] / admin / itemtypes.pl
index 48e80f7..44e9ad5 100755 (executable)
 use Modern::Perl;
 use CGI qw ( -utf8 );
 
-use File::Spec;
 
-use C4::Koha;
+use C4::Koha qw( getImageSets GetAuthorisedValues );
 use C4::Context;
-use C4::Auth;
-use C4::Output;
+use C4::Auth qw( get_template_and_user );
+use C4::Output qw( output_html_with_http_headers );
 use Koha::ItemTypes;
 use Koha::ItemType;
 use Koha::Localizations;
@@ -46,7 +45,6 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
         query           => $input,
         type            => "intranet",
         flagsrequired   => { parameters => 'manage_itemtypes' },
-        debug           => 1,
     }
 );
 
@@ -62,7 +60,7 @@ if ( $op eq 'add_form' ) {
     my $parent_types = Koha::ItemTypes->search({parent_type=>undef,itemtype => {'!='=>$itemtype_code}});
     my $imagesets = C4::Koha::getImageSets( checked => ( $itemtype ? $itemtype->imageurl : undef ) );
     my $searchcategory = GetAuthorisedValues("ITEMTYPECAT");
-    my $translated_languages = C4::Languages::getTranslatedLanguages( undef , C4::Context->preference('template') );
+    my $translated_languages = C4::Languages::getTranslatedLanguages( "both", C4::Context->preference('template') );
     $template->param(
         itemtype  => $itemtype,
         parent_type => $parent_type,
@@ -200,7 +198,7 @@ if ( $op eq 'add_form' ) {
 
 if ( $op eq 'list' ) {
     $template->param(
-        itemtypes => scalar Koha::ItemTypes->search,
+        itemtypes => Koha::ItemTypes->search,
         messages  => \@messages,
     );
 }