[Koha-cvs] Changes to koha/reports/bor_issues_top.pl [rel_2_2]
Henri-Damien LAURENT
laurenthdl at alinto.com
Mon Nov 28 11:40:33 CET 2005
Index: koha/reports/bor_issues_top.pl
diff -u koha/reports/bor_issues_top.pl:1.3.2.1 koha/reports/bor_issues_top.pl:1.3.2.2
--- koha/reports/bor_issues_top.pl:1.3.2.1 Thu Apr 7 12:06:05 2005
+++ koha/reports/bor_issues_top.pl Mon Nov 28 10:40:32 2005
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Id: bor_issues_top.pl,v 1.3.2.1 2005/04/07 12:06:05 tipaul Exp $
+# $Id: bor_issues_top.pl,v 1.3.2.2 2005/11/28 10:40:32 hdl Exp $
# Copyright 2000-2002 Katipo Communications
#
@@ -243,7 +243,7 @@
while (my ($celvalue) = $sth2->fetchrow) {
my %cell;
- $cell{coltitle} = $celvalue;
+ $cell{'coltitle'} = ($celvalue?$celvalue:"NULL");
push @loopcol, \%cell;
}
# warn "fin des titres colonnes";
@@ -296,31 +296,29 @@
$strcalc .= " group by borrowers.borrowernumber";
$strcalc .= ", $colfield" if ($column);
- $strcalc .= " order by ";
- $strcalc .= "$colfield, " if ($colfield);
- $strcalc .= "RANK DESC ";
- my $max;
- if (@loopcol) {
- $max = $line*@loopcol;
- } else { $max=$line;}
- $strcalc .= " LIMIT 0,$max";
+ $strcalc .= " order by RANK DESC";
+ $strcalc .= ",$colfield " if ($colfield);
+# my $max;
+# if (@loopcol) {
+# $max = $line*@loopcol;
+# } else { $max=$line;}
+# $strcalc .= " LIMIT 0,$max";
warn "SQL :". $strcalc;
my $dbcalc = $dbh->prepare($strcalc);
$dbcalc->execute;
# warn "filling table";
my $previous_col;
- my $i=1;
+ my %indice;
while (my @data = $dbcalc->fetchrow) {
my ($row, $rank, $id, $col )=@data;
$col = "zzEMPTY" if ($col eq undef);
- $i=1 if (($previous_col) and not($col eq $previous_col));
- $table[$i]->{$col}->{'name'}=$row;
- $table[$i]->{$col}->{'count'}=$rank;
- $table[$i]->{$col}->{'link'}=$id;
- warn " ".$i." ".$col. " ".$row;
- $i++;
- $previous_col=$col;
+ $indice{$col}=1 if (not($indice{$col}));
+ $table[$indice{$col}]->{$col}->{'name'}=$row;
+ $table[$indice{$col}]->{$col}->{'count'}=$rank;
+ $table[$indice{$col}]->{$col}->{'link'}=$id;
+# warn " ".$i." ".$col. " ".$row;
+ $indice{$col}++;
}
push @loopcol,{coltitle => "Global"} if not($column);
@@ -328,7 +326,7 @@
for ($i=1; $i<=$line;$i++) {
my @loopcell;
warn " $i";
- #@loopcol ensures the order for columns is common with column titles
+ #@loborrowersopcol ensures the order for columns is common with column titles
# and the number matches the number of columns
my $colcount=0;
foreach my $col ( @loopcol ) {
More information about the Koha-cvs
mailing list