Bug 17835: Replace GetItemTypes with Koha::ItemTypes
[koha-ffzg.git] / reports / catalogue_out.pl
index 4ce9b3f..0c53a79 100755 (executable)
@@ -24,9 +24,7 @@ use CGI qw ( -utf8 );
 use C4::Auth;
 use C4::Context;
 use C4::Debug;
-use C4::Branch;    # GetBranchesLoop
 use C4::Output;
-use C4::Koha;      # GetItemTypes
 # use Date::Manip;  # TODO: add not borrowed since date X criteria
 use Data::Dumper;
 
@@ -61,24 +59,9 @@ if ($do_it) {
     exit;    # in either case, exit after do_it
 }
 
-# Displaying choices (i.e., not do_it)
-my $itemtypes = GetItemTypes();
-my @itemtypeloop;
-foreach (
-    sort { $itemtypes->{$a}->{translated_description} cmp $itemtypes->{$b}->{translated_description} }
-    keys %$itemtypes
-  )
-{
-    push @itemtypeloop,
-      {
-        value       => $_,
-        description => $itemtypes->{$_}->{translated_description},
-      };
-}
-
+my $itemtypes = Koha::ItemTypes->search_with_localization;
 $template->param(
-    itemtypeloop => \@itemtypeloop,
-    branchloop   => GetBranchesLoop(),
+    itemtypes => $itemtypes,
 );
 output_html_with_http_headers $input, $cookie, $template->output;