[Koha-cvs] CVS: koha/reports catalogue_stats.pl,1.5,1.6

Paul POULAIN tipaul at users.sourceforge.net
Tue Mar 8 10:55:33 CET 2005


Update of /cvsroot/koha/koha/reports
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7358/reports

Modified Files:
	catalogue_stats.pl 
Log Message:
stats ignore null values, this is a preliminary bugfix for this problem

Index: catalogue_stats.pl
===================================================================
RCS file: /cvsroot/koha/koha/reports/catalogue_stats.pl,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** catalogue_stats.pl	4 Mar 2005 13:48:16 -0000	1.5
--- catalogue_stats.pl	8 Mar 2005 09:55:29 -0000	1.6
***************
*** 461,465 ****
  
  # preparing calculation
! 	my $strcalc .= "SELECT $linefield, $colfield, count( * ) FROM biblioitems, items WHERE (items.biblioitemnumber = biblioitems.biblioitemnumber) AND $line is not null AND $column is not null";
  	@$filters[0]=~ s/\*/%/g if (@$filters[0]);
  	$strcalc .= " AND dewey >" . @$filters[0] ."" if ( @$filters[0] );
--- 461,465 ----
  
  # preparing calculation
! 	my $strcalc .= "SELECT $linefield, $colfield, count( * ) FROM biblioitems, items WHERE (items.biblioitemnumber = biblioitems.biblioitemnumber) ";
  	@$filters[0]=~ s/\*/%/g if (@$filters[0]);
  	$strcalc .= " AND dewey >" . @$filters[0] ."" if ( @$filters[0] );
***************
*** 487,491 ****
  	$strcalc .= " AND items.location like '" . @$filters[11] ."'" if ( @$filters[11] );
  	$strcalc .= " group by $linefield, $colfield order by $linefield,$colfield";
! #	warn "". $strcalc;
  	my $dbcalc = $dbh->prepare($strcalc);
  	$dbcalc->execute;
--- 487,491 ----
  	$strcalc .= " AND items.location like '" . @$filters[11] ."'" if ( @$filters[11] );
  	$strcalc .= " group by $linefield, $colfield order by $linefield,$colfield";
! 	warn "". $strcalc;
  	my $dbcalc = $dbh->prepare($strcalc);
  	$dbcalc->execute;
***************
*** 493,496 ****
--- 493,498 ----
  	while (my ($row, $col, $value) = $dbcalc->fetchrow) {
  #		warn "filling table $row / $col / $value ";
+ 		$row="ZZEMPTY" unless $row;
+ 		$col="ZZEMPTY" unless $col;
  		$table{$row}->{$col}=$value;
  		$table{$row}->{totalrow}+=$value;
***************
*** 498,501 ****
--- 500,508 ----
  	}
  	
+ 	my %cell = {rowtitle => 'ZZEMPTY'};
+ 	push @loopline,\%cell;
+ 	my %cell = {coltitle => 'ZZEMPTY'};
+ 	push @loopcol,\%cell;
+ 	
  	foreach my $row ( sort keys %table ) {
  		my @loopcell;





More information about the Koha-cvs mailing list