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 336-342 sub calculate { Link Here
336
        $linefilter[0] =~ s/\*/%/g;
335
        $linefilter[0] =~ s/\*/%/g;
337
        $strsth .= " AND $line LIKE ? ";
336
        $strsth .= " AND $line LIKE ? ";
338
    }
337
    }
339
    $strsth .= " group by $linefield order by $lineorder ";
338
    $strsth .= " group by $linefield collate utf8_bin order by $lineorder ";
340
    $debug and warn $strsth;
339
    $debug and warn $strsth;
341
    push @loopfilter, { crit => 'SQL =', sql => 1, filter => $strsth };
340
    push @loopfilter, { crit => 'SQL =', sql => 1, filter => $strsth };
342
    my $sth = $dbh->prepare($strsth);
341
    my $sth = $dbh->prepare($strsth);
Lines 425-431 sub calculate { Link Here
425
        $strsth2 .= " AND $column LIKE ? " ;
424
        $strsth2 .= " AND $column LIKE ? " ;
426
    }
425
    }
427
426
428
    $strsth2 .= " group by $colfield order by $colorder ";
427
    $strsth2 .= " group by $colfield collate utf8_bin order by $colorder ";
429
    $debug and warn $strsth2;
428
    $debug and warn $strsth2;
430
    push @loopfilter, { crit => 'SQL =', sql => 1, filter => $strsth2 };
429
    push @loopfilter, { crit => 'SQL =', sql => 1, filter => $strsth2 };
431
    my $sth2 = $dbh->prepare($strsth2);
430
    my $sth2 = $dbh->prepare($strsth2);
Lines 554-559 sub calculate { Link Here
554
    } else {
553
    } else {
555
        $strcalc .= " $colfield ";
554
        $strcalc .= " $colfield ";
556
    }
555
    }
556
    $strcalc .= " collate utf8_bin ";
557
557
558
    $strcalc .= " ORDER BY ";
558
    $strcalc .= " ORDER BY ";
559
    if($line_attribute_type) {
559
    if($line_attribute_type) {
Lines 640-663 sub null_to_zzempty { Link Here
640
sub table_set {
640
sub table_set {
641
    my ($table, $row, $col, $val) = @_;
641
    my ($table, $row, $col, $val) = @_;
642
642
643
    $row = lc(unac_string('utf-8', $row // ''));
643
    $row = $row // '';
644
    $col = lc(unac_string('utf-8', $col // ''));
644
    $col = $col // '';
645
    $table->{ null_to_zzempty($row) }->{ null_to_zzempty($col) } = $val;
645
    $table->{ null_to_zzempty($row) }->{ null_to_zzempty($col) } = $val;
646
}
646
}
647
647
648
sub table_get {
648
sub table_get {
649
    my ($table, $row, $col) = @_;
649
    my ($table, $row, $col) = @_;
650
650
651
    $row = lc(unac_string('utf-8', $row // ''));
651
    $row = $row // '';
652
    $col = lc(unac_string('utf-8', $col // ''));
652
    $col = $col // '';
653
    return $table->{ null_to_zzempty($row) }->{ null_to_zzempty($col) };
653
    return $table->{ null_to_zzempty($row) }->{ null_to_zzempty($col) };
654
}
654
}
655
655
656
sub table_inc {
656
sub table_inc {
657
    my ($table, $row, $col, $inc) = @_;
657
    my ($table, $row, $col, $inc) = @_;
658
658
659
    $row = lc(unac_string('utf-8', $row // ''));
659
    $row = $row // '';
660
    $col = lc(unac_string('utf-8', $col // ''));
660
    $col = $col // '';
661
    $table->{ null_to_zzempty($row) }->{ null_to_zzempty($col) } += $inc;
661
    $table->{ null_to_zzempty($row) }->{ null_to_zzempty($col) } += $inc;
662
}
662
}
663
663
664
- 

Return to bug 7679