View | Details | Raw Unified | Return to bug 19671
Collapse All | Expand All

(-)a/reports/issues_stats.pl (-6 / +5 lines)
Lines 87-92 $sep = "\t" if ($sep eq 'tabulation'); Link Here
87
$template->param(do_it => $do_it,
87
$template->param(do_it => $do_it,
88
);
88
);
89
89
90
our $itemtypes = Koha::ItemTypes->search_with_localization->unblessed;
91
90
our @patron_categories = Koha::Patron::Categories->search_limited({}, {order_by => ['description']});
92
our @patron_categories = Koha::Patron::Categories->search_limited({}, {order_by => ['description']});
91
93
92
our $locations = { map { ( $_->{authorised_value} => $_->{lib} ) } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.location' }, { order_by => ['description'] } ) };
94
our $locations = { map { ( $_->{authorised_value} => $_->{lib} ) } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.location' }, { order_by => ['description'] } ) };
Lines 150-158 my @values; Link Here
150
my %labels;
152
my %labels;
151
my %select;
153
my %select;
152
154
153
# create itemtype arrayref for <select>.
154
our $itemtypes = Koha::ItemTypes->search_with_localization;
155
156
    # location list
155
    # location list
157
my @locations;
156
my @locations;
158
foreach (sort keys %$locations) {
157
foreach (sort keys %$locations) {
Lines 354-365 sub calculate { Link Here
354
        $sth->execute;
353
        $sth->execute;
355
    }
354
    }
356
355
356
    my $itemtypes_map = { map { $_->{itemtype} => $_ } @{ $itemtypes } };
357
    while ( my ($celvalue) = $sth->fetchrow ) {
357
    while ( my ($celvalue) = $sth->fetchrow ) {
358
        my %cell = ( rowtitle => $celvalue, totalrow => 0 );    # we leave 'rowtitle' as hash key (used when filling the table), and add coltitle_display
358
        my %cell = ( rowtitle => $celvalue, totalrow => 0 );    # we leave 'rowtitle' as hash key (used when filling the table), and add coltitle_display
359
        $cell{rowtitle_display} =
359
        $cell{rowtitle_display} =
360
            ( $line =~ /ccode/ )    ? $ccodes->{$celvalue}
360
            ( $line =~ /ccode/ )    ? $ccodes->{$celvalue}
361
          : ( $line =~ /location/ ) ? $locations->{$celvalue}
361
          : ( $line =~ /location/ ) ? $locations->{$celvalue}
362
          : ( $line =~ /itemtype/ ) ? $itemtypes->{$celvalue}->{description}
362
          : ( $line =~ /itemtype/ ) ? $itemtypes_map->{$celvalue}->{translated_description}
363
          :                           $celvalue;                               # default fallback
363
          :                           $celvalue;                               # default fallback
364
        if ( $line =~ /sort1/ ) {
364
        if ( $line =~ /sort1/ ) {
365
            foreach (@$Bsort1) {
365
            foreach (@$Bsort1) {
Lines 448-454 sub calculate { Link Here
448
        $cell{coltitle_display} =
448
        $cell{coltitle_display} =
449
            ( $column =~ /ccode/ )    ? $ccodes->{$celvalue}
449
            ( $column =~ /ccode/ )    ? $ccodes->{$celvalue}
450
          : ( $column =~ /location/ ) ? $locations->{$celvalue}
450
          : ( $column =~ /location/ ) ? $locations->{$celvalue}
451
          : ( $column =~ /itemtype/ ) ? $itemtypes->{$celvalue}->{description}
451
          : ( $column =~ /itemtype/ ) ? $itemtypes_map->{$celvalue}->{translated_description}
452
          :                             $celvalue;                               # default fallback
452
          :                             $celvalue;                               # default fallback
453
        if ( $column =~ /sort1/ ) {
453
        if ( $column =~ /sort1/ ) {
454
            foreach (@$Bsort1) {
454
            foreach (@$Bsort1) {
455
- 

Return to bug 19671