Bugzilla – Attachment 39257 Details for
Bug 7679
Add new filters to circulation statistics wizard
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7679: Display all table headers (case and accent sensitive)
Bug-7679-Display-all-table-headers-case-and-accent.patch (text/plain), 2.95 KB, created by
Mark Tompsett
on 2015-05-17 14:09:21 UTC
(
hide
)
Description:
Bug 7679: Display all table headers (case and accent sensitive)
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2015-05-17 14:09:21 UTC
Size:
2.95 KB
patch
obsolete
>From d4b0db4a3e8644302788a360aae164940c94e14e Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Mon, 1 Sep 2014 17:22:00 +0200 >Subject: [PATCH] Bug 7679: Display all table headers (case and accent > sensitive) >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >It appears that we can't assume that a lowercase word is equivalent to >the same word in uppercase (or a mix of lowercase and uppercase >letters). And this is also true about accented words. >So display all values even if they differ only by case or by their >accents. >This means that: >- "foobar" and "Foobar" will be in two separate rows/columns >- "Etudiant" and "Ãtudiant" (french) will be in two separate > rows/columns too >--- > reports/issues_stats.pl | 18 +++++++++--------- > 1 file changed, 9 insertions(+), 9 deletions(-) > >diff --git a/reports/issues_stats.pl b/reports/issues_stats.pl >index 6614aee..1cbcad5 100755 >--- a/reports/issues_stats.pl >+++ b/reports/issues_stats.pl >@@ -22,7 +22,6 @@ use warnings; > > use CGI qw ( -utf8 ); > use Date::Manip; >-use Text::Unaccent; > > use C4::Auth; > use C4::Debug; >@@ -336,7 +335,7 @@ sub calculate { > $linefilter[0] =~ s/\*/%/g; > $strsth .= " AND $line LIKE ? "; > } >- $strsth .= " group by $linefield order by $lineorder "; >+ $strsth .= " group by $linefield collate utf8_bin order by $lineorder "; > $debug and warn $strsth; > push @loopfilter, { crit => 'SQL =', sql => 1, filter => $strsth }; > my $sth = $dbh->prepare($strsth); >@@ -425,7 +424,7 @@ sub calculate { > $strsth2 .= " AND $column LIKE ? " ; > } > >- $strsth2 .= " group by $colfield order by $colorder "; >+ $strsth2 .= " group by $colfield collate utf8_bin order by $colorder "; > $debug and warn $strsth2; > push @loopfilter, { crit => 'SQL =', sql => 1, filter => $strsth2 }; > my $sth2 = $dbh->prepare($strsth2); >@@ -554,6 +553,7 @@ sub calculate { > } else { > $strcalc .= " $colfield "; > } >+ $strcalc .= " collate utf8_bin "; > > $strcalc .= " ORDER BY "; > if($line_attribute_type) { >@@ -640,24 +640,24 @@ sub null_to_zzempty { > sub table_set { > my ($table, $row, $col, $val) = @_; > >- $row = lc(unac_string('utf-8', $row // '')); >- $col = lc(unac_string('utf-8', $col // '')); >+ $row = $row // ''; >+ $col = $col // ''; > $table->{ null_to_zzempty($row) }->{ null_to_zzempty($col) } = $val; > } > > sub table_get { > my ($table, $row, $col) = @_; > >- $row = lc(unac_string('utf-8', $row // '')); >- $col = lc(unac_string('utf-8', $col // '')); >+ $row = $row // ''; >+ $col = $col // ''; > return $table->{ null_to_zzempty($row) }->{ null_to_zzempty($col) }; > } > > sub table_inc { > my ($table, $row, $col, $inc) = @_; > >- $row = lc(unac_string('utf-8', $row // '')); >- $col = lc(unac_string('utf-8', $col // '')); >+ $row = $row // ''; >+ $col = $col // ''; > $table->{ null_to_zzempty($row) }->{ null_to_zzempty($col) } += $inc; > } > >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7679
:
11479
|
13099
|
16242
|
16243
|
17798
|
22745
|
25053
|
25443
|
26531
|
31311
|
39250
|
39251
|
39252
|
39253
|
39254
|
39255
|
39256
|
39257
|
46184
|
46185
|
46186
|
46187
|
46188
|
46189
|
46190
|
46191
|
46192
|
46193
|
46194
|
46195
|
46196
|
46197
|
46198
|
46199
|
54598
|
54599
|
54600
|
54601
|
54602
|
54603
|
54604
|
54605
|
55481
|
55482
|
55483
|
55484
|
55485
|
55486
|
55487
|
55488
|
56877
|
56878
|
56879
|
56880
|
56881
|
56882
|
56883
|
56884
|
56885
|
56886
|
56887
|
56888