Bug 20525: Add --timezone switch to koha-create
[koha.git] / reports / cat_issues_top.pl
index 08b1852..e7a315f 100755 (executable)
@@ -18,8 +18,7 @@
 # You should have received a copy of the GNU General Public License
 # along with Koha; if not, see <http://www.gnu.org/licenses>.
 
-use strict;
-#use warnings; FIXME - Bug 2505
+use Modern::Perl;
 use C4::Auth;
 use CGI qw ( -utf8 );
 use C4::Context;
@@ -29,6 +28,7 @@ use C4::Circulation;
 use C4::Reports;
 use C4::Members;
 use Koha::DateUtils;
+use Koha::ItemTypes;
 
 =head1 NAME
 
@@ -118,14 +118,7 @@ if ($do_it) {
     my $CGIsepChoice=GetDelimiterChoices;
 
     #doctype
-    my $itemtypes = GetItemTypes;
-    my @itemtypeloop;
-    foreach my $thisitemtype ( sort {$itemtypes->{$a}->{translated_description} cmp $itemtypes->{$b}->{translated_description}} keys %$itemtypes) {
-            my %row =(value => $thisitemtype,
-                      description => $itemtypes->{$thisitemtype}->{translated_description},
-                            );
-            push @itemtypeloop, \%row;
-    }
+    my $itemtypes = Koha::ItemTypes->search_with_localization;
 
     #ccode
     my $ccodes = GetAuthorisedValues('CCODE');
@@ -156,7 +149,7 @@ if ($do_it) {
     $template->param(
                     CGIextChoice => $CGIextChoice,
                     CGIsepChoice => $CGIsepChoice,
-                    itemtypeloop =>\@itemtypeloop,
+                    itemtypes => $itemtypes,
                     ccodeloop =>\@ccodeloop,
                     shelvinglocloop =>\@shelvinglocloop,
                     patron_categories => $patron_categories,