-my $itemtypes = GetItemTypes;
-my @itemtypeloop;
-foreach (sort {$itemtypes->{$a}->{description} cmp $itemtypes->{$b}->{description}} keys %$itemtypes) {
- my %row = (value => $_,
- description => $itemtypes->{$_}->{description},
- );
- push @itemtypeloop, \%row;
-}
-
-my ($codes,$labels) = GetborCatFromCatType(undef,undef);
-my @borcatloop;
-foreach (sort keys %$labels) {
- my %row =(value => $_,
- description => $labels->{$_},
- );
- push @borcatloop, \%row;
-}
-
+my $patron_categories = Koha::Patron::Categories->search_with_library_limits({}, {order_by => ['categorycode']});
+my $itemtypes = Koha::ItemTypes->search_with_localization;