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

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

Return to bug 19671