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

(-)a/reports/issues_stats.pl (-10 / +9 lines)
Lines 22-28 use warnings; Link Here
22
22
23
use CGI qw ( -utf8 );
23
use CGI qw ( -utf8 );
24
use Date::Manip;
24
use Date::Manip;
25
use Text::Unaccent;
26
25
27
use C4::Auth;
26
use C4::Auth;
28
use C4::Debug;
27
use C4::Debug;
Lines 337-343 sub calculate { Link Here
337
        $linefilter[0] =~ s/\*/%/g;
336
        $linefilter[0] =~ s/\*/%/g;
338
        $strsth .= " AND $line LIKE ? ";
337
        $strsth .= " AND $line LIKE ? ";
339
    }
338
    }
340
    $strsth .= " group by $linefield order by $lineorder ";
339
    $strsth .= " group by $linefield collate utf8_bin order by $lineorder ";
341
    $debug and warn $strsth;
340
    $debug and warn $strsth;
342
    push @loopfilter, { crit => 'SQL =', sql => 1, filter => $strsth };
341
    push @loopfilter, { crit => 'SQL =', sql => 1, filter => $strsth };
343
    my $sth = $dbh->prepare($strsth);
342
    my $sth = $dbh->prepare($strsth);
Lines 426-432 sub calculate { Link Here
426
        $strsth2 .= " AND $column LIKE ? " ;
425
        $strsth2 .= " AND $column LIKE ? " ;
427
    }
426
    }
428
427
429
    $strsth2 .= " group by $colfield order by $colorder ";
428
    $strsth2 .= " group by $colfield collate utf8_bin order by $colorder ";
430
    $debug and warn $strsth2;
429
    $debug and warn $strsth2;
431
    push @loopfilter, { crit => 'SQL =', sql => 1, filter => $strsth2 };
430
    push @loopfilter, { crit => 'SQL =', sql => 1, filter => $strsth2 };
432
    my $sth2 = $dbh->prepare($strsth2);
431
    my $sth2 = $dbh->prepare($strsth2);
Lines 555-560 sub calculate { Link Here
555
    } else {
554
    } else {
556
        $strcalc .= " $colfield ";
555
        $strcalc .= " $colfield ";
557
    }
556
    }
557
    $strcalc .= " collate utf8_bin ";
558
558
559
    $strcalc .= " ORDER BY ";
559
    $strcalc .= " ORDER BY ";
560
    if($line_attribute_type) {
560
    if($line_attribute_type) {
Lines 641-664 sub null_to_zzempty { Link Here
641
sub table_set {
641
sub table_set {
642
    my ($table, $row, $col, $val) = @_;
642
    my ($table, $row, $col, $val) = @_;
643
643
644
    $row = lc(unac_string('utf-8', $row // ''));
644
    $row = $row // '';
645
    $col = lc(unac_string('utf-8', $col // ''));
645
    $col = $col // '';
646
    $table->{ null_to_zzempty($row) }->{ null_to_zzempty($col) } = $val;
646
    $table->{ null_to_zzempty($row) }->{ null_to_zzempty($col) } = $val;
647
}
647
}
648
648
649
sub table_get {
649
sub table_get {
650
    my ($table, $row, $col) = @_;
650
    my ($table, $row, $col) = @_;
651
651
652
    $row = lc(unac_string('utf-8', $row // ''));
652
    $row = $row // '';
653
    $col = lc(unac_string('utf-8', $col // ''));
653
    $col = $col // '';
654
    return $table->{ null_to_zzempty($row) }->{ null_to_zzempty($col) };
654
    return $table->{ null_to_zzempty($row) }->{ null_to_zzempty($col) };
655
}
655
}
656
656
657
sub table_inc {
657
sub table_inc {
658
    my ($table, $row, $col, $inc) = @_;
658
    my ($table, $row, $col, $inc) = @_;
659
659
660
    $row = lc(unac_string('utf-8', $row // ''));
660
    $row = $row // '';
661
    $col = lc(unac_string('utf-8', $col // ''));
661
    $col = $col // '';
662
    $table->{ null_to_zzempty($row) }->{ null_to_zzempty($col) } += $inc;
662
    $table->{ null_to_zzempty($row) }->{ null_to_zzempty($col) } += $inc;
663
}
663
}
664
664
665
- 

Return to bug 7679