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

(-)reports/issues_stats.pl (-10 / +9 lines)
Lines 23-29 use warnings; Link Here
23
23
24
use CGI;
24
use CGI;
25
use Date::Manip;
25
use Date::Manip;
26
use Text::Unaccent;
27
26
28
use C4::Auth;
27
use C4::Auth;
29
use C4::Debug;
28
use C4::Debug;
Lines 343-349 sub calculate { Link Here
343
        $linefilter[0] =~ s/\*/%/g;
342
        $linefilter[0] =~ s/\*/%/g;
344
        $strsth .= " AND $line LIKE ? ";
343
        $strsth .= " AND $line LIKE ? ";
345
    }
344
    }
346
    $strsth .= " group by $linefield order by $lineorder ";
345
    $strsth .= " group by $linefield collate utf8_bin order by $lineorder ";
347
    $debug and warn $strsth;
346
    $debug and warn $strsth;
348
    push @loopfilter, { crit => 'SQL =', sql => 1, filter => $strsth };
347
    push @loopfilter, { crit => 'SQL =', sql => 1, filter => $strsth };
349
    my $sth = $dbh->prepare($strsth);
348
    my $sth = $dbh->prepare($strsth);
Lines 432-438 sub calculate { Link Here
432
        $strsth2 .= " AND $column LIKE ? " ;
431
        $strsth2 .= " AND $column LIKE ? " ;
433
    }
432
    }
434
433
435
    $strsth2 .= " group by $colfield order by $colorder ";
434
    $strsth2 .= " group by $colfield collate utf8_bin order by $colorder ";
436
    $debug and warn $strsth2;
435
    $debug and warn $strsth2;
437
    push @loopfilter, { crit => 'SQL =', sql => 1, filter => $strsth2 };
436
    push @loopfilter, { crit => 'SQL =', sql => 1, filter => $strsth2 };
438
    my $sth2 = $dbh->prepare($strsth2);
437
    my $sth2 = $dbh->prepare($strsth2);
Lines 561-566 sub calculate { Link Here
561
    } else {
560
    } else {
562
        $strcalc .= " $colfield ";
561
        $strcalc .= " $colfield ";
563
    }
562
    }
563
    $strcalc .= " collate utf8_bin ";
564
564
565
    $strcalc .= " ORDER BY ";
565
    $strcalc .= " ORDER BY ";
566
    if($line_attribute_type) {
566
    if($line_attribute_type) {
Lines 647-670 sub null_to_zzempty { Link Here
647
sub table_set {
647
sub table_set {
648
    my ($table, $row, $col, $val) = @_;
648
    my ($table, $row, $col, $val) = @_;
649
649
650
    $row = lc(unac_string('utf-8', $row // ''));
650
    $row = $row // '';
651
    $col = lc(unac_string('utf-8', $col // ''));
651
    $col = $col // '';
652
    $table->{ null_to_zzempty($row) }->{ null_to_zzempty($col) } = $val;
652
    $table->{ null_to_zzempty($row) }->{ null_to_zzempty($col) } = $val;
653
}
653
}
654
654
655
sub table_get {
655
sub table_get {
656
    my ($table, $row, $col) = @_;
656
    my ($table, $row, $col) = @_;
657
657
658
    $row = lc(unac_string('utf-8', $row // ''));
658
    $row = $row // '';
659
    $col = lc(unac_string('utf-8', $col // ''));
659
    $col = $col // '';
660
    return $table->{ null_to_zzempty($row) }->{ null_to_zzempty($col) };
660
    return $table->{ null_to_zzempty($row) }->{ null_to_zzempty($col) };
661
}
661
}
662
662
663
sub table_inc {
663
sub table_inc {
664
    my ($table, $row, $col, $inc) = @_;
664
    my ($table, $row, $col, $inc) = @_;
665
665
666
    $row = lc(unac_string('utf-8', $row // ''));
666
    $row = $row // '';
667
    $col = lc(unac_string('utf-8', $col // ''));
667
    $col = $col // '';
668
    $table->{ null_to_zzempty($row) }->{ null_to_zzempty($col) } += $inc;
668
    $table->{ null_to_zzempty($row) }->{ null_to_zzempty($col) } += $inc;
669
}
669
}
670
670
671
- 

Return to bug 7679