From 8463099c762ff03786d26c60d63b5bb48b423322 Mon Sep 17 00:00:00 2001 From: tipaul Date: Thu, 7 Apr 2005 12:18:43 +0000 Subject: [PATCH] The stat module (last version before official 2.2.2) --- reports/catalogue_stats.pl | 98 +++++++++++++++++++------------------- reports/issues_stats.pl | 2 +- 2 files changed, 50 insertions(+), 50 deletions(-) diff --git a/reports/catalogue_stats.pl b/reports/catalogue_stats.pl index 73c0c91928..432e50bd6f 100755 --- a/reports/catalogue_stats.pl +++ b/reports/catalogue_stats.pl @@ -106,57 +106,57 @@ if ($do_it) { my %labels; my $count=0; my $req; - $req = $dbh->prepare("select distinctrow left(dewey,3) from biblioitems order by dewey"); + $req = $dbh->prepare("select count(dewey) from biblioitems "); $req->execute; my $hasdewey; my @select; - push @select,""; +# push @select,""; while (my ($value) =$req->fetchrow) { - $hasdewey =1 if (($value) and (! $hasdewey)); - $count++ if (($value) and (! $hasdewey)); - push @select, $value; + $hasdewey =1 if (($value>2) and (! $hasdewey)); + $count++ if (($value>2) and (! $hasdewey)); +# push @select, $value; } - my $CGIdewey=CGI::scrolling_list( -name => 'Filter', - -id => 'dewey', - -values => \@select, - -size => 1, - -multiple => 0 ); +# my $CGIdewey=CGI::scrolling_list( -name => 'Filter', +# -id => 'Filter', +# -values => \@select, +# -size => 1, +# -multiple => 0 ); - $req = $dbh->prepare( "select distinctrow left(lccn,3) from biblioitems order by lccn"); + $req = $dbh->prepare( "select count(lccn) from biblioitems "); $req->execute; - undef @select; - push @select,""; +# undef @select; +# push @select,""; my $haslccn; my $hlghtlccn; while (my ($value) =$req->fetchrow) { $hlghtlccn = !($hasdewey); - $haslccn =1 if (($value) and (! $haslccn)); + $haslccn =1 if (($value>2) and (! $haslccn)); $count++ if (($value) and (! $haslccn)); - push @select, $value; +# push @select, $value; } - my $CGIlccn=CGI::scrolling_list( -name => 'Filter', - -id => 'lccn', - -values => \@select, - -size => 1, - -multiple => 0 ); +# my $CGIlccn=CGI::scrolling_list( -name => 'Filter', +# -id => 'Filter', +# -values => \@select, +# -size => 1, +# -multiple => 0 ); - $req = $dbh->prepare("select distinctrow left(itemcallnumber,5) from items order by itemcallnumber"); + $req = $dbh->prepare("select count(itemcallnumber) from items"); $req->execute; - undef @select; - push @select,""; +# undef @select; +# push @select,""; my $hascote; my $hlghtcote; while (my ($value) =$req->fetchrow) { - $hascote =1 if (($value) and (! $hascote)); + $hascote =1 if (($value>2) and (! $hascote)); $count++ if (($value) and (! $hascote)); $hlghtcote = (($hasdewey) and ($haslccn)) or (!($hasdewey) and !($haslccn)); - push @select, $value; +# push @select, $value; } - my $CGIcote=CGI::scrolling_list( -name => 'Filter', - -id => 'cote', - -values => \@select, - -size => 1, - -multiple => 0 ); +# my $CGIcote=CGI::scrolling_list( -name => 'Filter', +# -id => 'Filter', +# -values => \@select, +# -size => 1, +# -multiple => 0 ); $count++; my $hglghtDT =$count % 2; # warn "highlightDT ".$hglghtDT; @@ -187,18 +187,18 @@ if ($do_it) { -size => 1, -multiple => 0 ); - $req = $dbh->prepare("select distinctrow left(publishercode,75) from biblioitems order by publishercode"); - $req->execute; - undef @select; - push @select,""; - while (my ($value) =$req->fetchrow) { - push @select, $value; - } - my $CGIpublisher=CGI::scrolling_list( -name => 'Filter', - -id => 'publisher', - -values => \@select, - -size => 1, - -multiple => 0 ); +# $req = $dbh->prepare("select distinctrow left(publishercode,75) from biblioitems order by publishercode"); +# $req->execute; +# undef @select; +# push @select,""; +# while (my ($value) =$req->fetchrow) { +# push @select, $value; +# } +# my $CGIpublisher=CGI::scrolling_list( -name => 'Filter', +# -id => 'Filter', +# -values => \@select, +# -size => 1, +# -multiple => 0 ); undef @select; push @select,""; @@ -247,12 +247,12 @@ if ($do_it) { -multiple => 0 ); $template->param(hasdewey=>$hasdewey, - CGIFromDeweyClass => $CGIdewey, - CGIToDeweyClass => $CGIdewey, +# CGIFromDeweyClass => $CGIdewey, +# CGIToDeweyClass => $CGIdewey, haslccn=> $haslccn, hlghtlccn => $hlghtlccn, - CGIFromLoCClass => $CGIlccn, - CGIToLoCClass => $CGIlccn, +# CGIFromLoCClass => $CGIlccn, +# CGIToLoCClass => $CGIlccn, hascote=> $hascote, hlghtcote => $hlghtcote, hglghtDT => $hglghtDT, @@ -260,12 +260,12 @@ if ($do_it) { hglghtPY => $hglghtPY, hglghtHB => $hglghtHB, hglghtLOC => $hglghtLOC, - CGIFromCoteClass => $CGIcote, - CGIToCoteClass => $CGIcote, +# CGIFromCoteClass => $CGIcote, +# CGIToCoteClass => $CGIcote, CGIItemType => $CGIitemtype, # CGIFromPublicationYear => $CGIpublicationyear, # CGIToPublicationYear => $CGIpublicationyear, - CGIPublisher => $CGIpublisher, +# CGIPublisher => $CGIpublisher, CGIBranch => $CGIbranch, CGILocation => $CGIlocation, CGIextChoice => $CGIextChoice, diff --git a/reports/issues_stats.pl b/reports/issues_stats.pl index 9be9fd1348..56156e4ae9 100755 --- a/reports/issues_stats.pl +++ b/reports/issues_stats.pl @@ -274,7 +274,7 @@ sub calculate { push @loopfilter,{crit=>"Issue|Return ",filter=>$type}; push @loopfilter,{crit=>"Display by ",filter=>$dsp} if ($dsp); push @loopfilter,{crit=>"Select Day ",filter=>$daysel} if ($daysel); - push @loopfilter,{crit=>"Select Month ",filter=>$daysel} if ($monthsel); + push @loopfilter,{crit=>"Select Month ",filter=>$monthsel} if ($monthsel); my @linefilter; -- 2.39.5