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