Bugzilla – Attachment 25099 Details for
Bug 7683
statistic wizard: cataloging
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.82 KB, created by
Biblibre Sandboxes
on 2014-02-06 16:11:56 UTC
(
hide
)
Description:
Bug 7679: Group different case values in the same row/column
Filename:
MIME Type:
Creator:
Biblibre Sandboxes
Created:
2014-02-06 16:11:56 UTC
Size:
3.82 KB
patch
obsolete
>From 8eab33ba2f5bb7b9ca07b19362aff0c96a843dd6 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 > >Signed-off-by: Koha team AMU <koha.aixmarseille@gmail.com> > >http://bugs.koha-community.org/show_bug.cgi?id=7683 >--- > reports/issues_stats.pl | 36 ++++++++++++++++++++++++++---------- > 1 files changed, 26 insertions(+), 10 deletions(-) > >diff --git a/reports/issues_stats.pl b/reports/issues_stats.pl >index b48499c..37349fc 100755 >--- a/reports/issues_stats.pl >+++ b/reports/issues_stats.pl >@@ -472,9 +472,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 >@@ -578,14 +578,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); >@@ -597,7 +595,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}; >@@ -605,14 +603,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 }; > } >@@ -639,4 +637,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; >-- >1.7.2.5
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 7683
:
12762
|
12785
|
12940
|
14399
|
14466
|
16327
|
16328
|
16329
|
16367
|
16775
|
20241
|
20242
|
20243
|
20244
|
20245
|
21357
|
21358
|
23683
|
23684
|
23685
|
23686
|
23687
|
23688
|
23689
|
23690
|
23691
|
25072
|
25073
|
25091
|
25092
|
25093
|
25094
|
25095
|
25096
|
25097
|
25098
|
25099
|
25100
|
26678
|
26679
|
26680
|
26681
|
26682
|
28466
|
28467
|
28468
|
28469
|
28470
|
36489
|
36490
|
36491
|
36492
|
36493
|
39129
|
39130
|
39131
|
39132
|
39133
|
41821
|
41829
|
44651
|
44652
|
44653
|
44654
|
44655
|
45238
|
45239
|
45240
|
45241
|
45242