# 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 CGI qw ( -utf8 );
use C4::Auth;
use C4::Output;
use C4::Debug;
use Koha::DateUtils;
+use Koha::ItemTypes;
use Koha::Patron::Categories;
=head1 NAME
=cut
-$debug = 1;
$debug and open DEBUG, ">/tmp/bor_issues_top.debug.log";
my $input = new CGI;
flagsrequired => {reports => '*'},
debug => 1,
});
-our $sep = $input->param("sep");
+our $sep = $input->param("sep") || C4::Context->preference('delimiter') || ',';
$sep = "\t" if ($sep eq 'tabulation');
$template->param(do_it => $do_it,
);
my @mime = ( map { {type =>$_} } (split /[;:]/, 'CSV') ); # FIXME translation
my $delims = GetDelimiterChoices;
-my $itemtypes = GetItemTypes;
-my @itemtypeloop;
-foreach (sort {$itemtypes->{$a}->{translated_description} cmp $itemtypes->{$b}->{translated_description}} keys %$itemtypes) {
- my %row = (value => $_,
- translated_description => $itemtypes->{$_}->{translated_description},
- );
- push @itemtypeloop, \%row;
-}
-
my $patron_categories = Koha::Patron::Categories->search_limited({}, {order_by => ['categorycode']});
-
+my $itemtypes = Koha::ItemTypes->search_with_localization;
$template->param(
mimeloop => \@mime,
CGIseplist => $delims,
- itemtypeloop => \@itemtypeloop,
+ itemtypes => $itemtypes,
patron_categories => $patron_categories,
);
output_html_with_http_headers $input, $cookie, $template->output;