Bugzilla – Attachment 54601 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: Group different case values in the same row/column
Bug-7679-Group-different-case-values-in-the-same-r.patch (text/plain), 3.71 KB, created by
Julian Maurice
on 2016-08-19 09:34:43 UTC
(
hide
)
Description:
Bug 7679: Group different case values in the same row/column
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2016-08-19 09:34:43 UTC
Size:
3.71 KB
patch
obsolete
>From e8fda347ea7f93e5faaae81c446eefeadacca56d Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Wed, 6 Nov 2013 08:47:13 +0100 >Subject: [PATCH] Bug 7679: Group different case values in the same row/column > >--- > reports/issues_stats.pl | 36 ++++++++++++++++++++++++++---------- > 1 file changed, 26 insertions(+), 10 deletions(-) > >diff --git a/reports/issues_stats.pl b/reports/issues_stats.pl >index 87a003f..155c6a3 100755 >--- a/reports/issues_stats.pl >+++ b/reports/issues_stats.pl >@@ -468,9 +468,9 @@ sub calculate { > foreach my $row (@loopline) { > foreach my $col (@loopcol) { > $debug and warn " init table : $row->{rowtitle} ( $row->{rowtitle_display} ) / $col->{coltitle} ( $col->{coltitle_display} ) "; >- $table{ $row->{rowtitle} }->{ $col->{coltitle} } = 0; >+ table_set(\%table, $row->{rowtitle}, $col->{coltitle}, 0); > } >- $table{ $row->{rowtitle} }->{totalrow} = 0; >+ table_set(\%table, $row->{rowtitle}, 'totalrow', 0); > } > > # preparing calculation >@@ -574,14 +574,12 @@ sub calculate { > ($debug) and warn "filling table $row / $col / $value "; > unless ( defined $col ) { > $emptycol = 1; >- $col = "zzEMPTY"; > } > unless ( defined $row ) { > $emptyrow = 1; >- $row = "zzEMPTY"; > } >- $table{$row}->{$col} += $value; >- $table{$row}->{totalrow} += $value; >+ table_inc(\%table, $row, $col, $value); >+ table_inc(\%table, $row, 'totalrow', $value); > $grantotal += $value; > } > push @loopcol, { coltitle => "NULL", coltitle_display => 'NULL' } if ($emptycol); >@@ -593,7 +591,7 @@ sub calculate { > #@loopcol ensures the order for columns is common with column titles > # and the number matches the number of columns > foreach my $col (@loopcol) { >- my $value = $table{ null_to_zzempty( $row->{rowtitle} ) }->{ null_to_zzempty( $col->{coltitle} ) }; >+ my $value = table_get(\%table, $row->{rowtitle}, $col->{coltitle}); > push @loopcell, { value => $value }; > } > my $rowtitle = ( $row->{rowtitle} eq "NULL" ) ? "zzEMPTY" : $row->{rowtitle}; >@@ -601,14 +599,14 @@ sub calculate { > { 'rowtitle_display' => $row->{rowtitle_display}, > 'rowtitle' => $rowtitle, > 'loopcell' => \@loopcell, >- 'totalrow' => $table{$rowtitle}->{totalrow} >+ 'totalrow' => table_get(\%table, $rowtitle, 'totalrow'), > }; > } > for my $col (@loopcol) { > my $total = 0; > foreach my $row (@looprow) { >- $total += $table{ null_to_zzempty( $row->{rowtitle} ) }->{ null_to_zzempty( $col->{coltitle} ) }; >- $debug and warn "value added " . $table{ $row->{rowtitle} }->{ $col->{coltitle} } . "for line " . $row->{rowtitle}; >+ $total += table_get(\%table, $row->{rowtitle}, $col->{coltitle}); >+ $debug and warn "value added " . table_get(\%table, $row->{rowtitle}, $col->{coltitle}) . "for line " . $row->{rowtitle}; > } > push @loopfooter, { 'totalcol' => $total }; > } >@@ -635,4 +633,22 @@ sub null_to_zzempty ($) { > return $string; # else return the valid value > } > >+sub table_set { >+ my ($table, $row, $col, $val) = @_; >+ >+ $table->{ null_to_zzempty(lc($row)) }->{ null_to_zzempty(lc($col)) } = $val; >+} >+ >+sub table_get { >+ my ($table, $row, $col) = @_; >+ >+ return $table->{ null_to_zzempty(lc($row)) }->{ null_to_zzempty(lc($col)) }; >+} >+ >+sub table_inc { >+ my ($table, $row, $col, $inc) = @_; >+ >+ $table->{ null_to_zzempty(lc($row)) }->{ null_to_zzempty(lc($col)) } += $inc; >+} >+ > 1; >-- >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