koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] CVS: koha/reports catalogue_stats.pl,1.3,1.4


From: Henri-Damien LAURENT
Subject: [Koha-cvs] CVS: koha/reports catalogue_stats.pl,1.3,1.4
Date: Thu, 24 Feb 2005 15:43:34 -0800

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

Modified Files:
        catalogue_stats.pl 
Log Message:
Beautifying Selection

Index: catalogue_stats.pl
===================================================================
RCS file: /cvsroot/koha/koha/reports/catalogue_stats.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** catalogue_stats.pl  24 Feb 2005 14:10:44 -0000      1.3
--- catalogue_stats.pl  24 Feb 2005 23:43:28 -0000      1.4
***************
*** 103,114 ****
        my @values;
        my %labels;
        my $req;
        $req = $dbh->prepare("select distinctrow left(dewey,3) from biblioitems 
order by dewey");
        $req->execute;
!       my $hasdewey=1;
        my @select;
        push @select,"";
        while (my ($value) =$req->fetchrow) {
                $hasdewey =1 if (($value) and (! $hasdewey));
                push @select, $value;
        }
--- 103,116 ----
        my @values;
        my %labels;
+       my $count=0;
        my $req;
        $req = $dbh->prepare("select distinctrow left(dewey,3) from biblioitems 
order by dewey");
        $req->execute;
!       my $hasdewey;
        my @select;
        push @select,"";
        while (my ($value) =$req->fetchrow) {
                $hasdewey =1 if (($value) and (! $hasdewey));
+               $count++ if (($value) and (! $hasdewey));
                push @select, $value;
        }
***************
*** 123,131 ****
        undef @select;
        push @select,"";
!       my $haslccn=1;
        my $hlghtlccn;
        while (my ($value) =$req->fetchrow) {
                $hlghtlccn = !($hasdewey);
                $haslccn =1 if (($value) and (! $haslccn));
                push @select, $value;
        }
--- 125,134 ----
        undef @select;
        push @select,"";
!       my $haslccn;
        my $hlghtlccn;
        while (my ($value) =$req->fetchrow) {
                $hlghtlccn = !($hasdewey);
                $haslccn =1 if (($value) and (! $haslccn));
+               $count++ if (($value) and (! $haslccn));
                push @select, $value;
        }
***************
*** 140,147 ****
        undef @select;
        push @select,"";
!       my $hascote=1;
        my $hlghtcote;
        while (my ($value) =$req->fetchrow) {
                $hascote =1 if (($value) and (! $hascote));
                $hlghtcote = (($hasdewey) and ($haslccn)) or (!($hasdewey) and 
!($haslccn));
                push @select, $value;
--- 143,151 ----
        undef @select;
        push @select,"";
!       my $hascote;
        my $hlghtcote;
        while (my ($value) =$req->fetchrow) {
                $hascote =1 if (($value) and (! $hascote));
+               $count++ if (($value) and (! $hascote));
                $hlghtcote = (($hasdewey) and ($haslccn)) or (!($hasdewey) and 
!($haslccn));
                push @select, $value;
***************
*** 152,166 ****
                                -size     => 1,
                                -multiple => 0 );
!       
!       undef @select;
!       push @select,"";
!       for (my $i=1950;$i<=2050;$i++) {
!               push @select, $i;
!       }
!       my $CGIpublicationyear=CGI::scrolling_list( -name     => 'Filter',
!                               -id => 'Filter',
!                               -values   => address@hidden,
!                               -size     => 1,
!                               -multiple => 0 );
        
        $req = $dbh->prepare("select distinctrow itemtype from biblioitems 
order by itemtype");
--- 156,185 ----
                                -size     => 1,
                                -multiple => 0 );
!       $count++;
!       my $hglghtDT =$count % 2;
! #     warn "highlightDT ".$hglghtDT;
!       $count++;
!       my $hglghtPub =$count % 2;
! #     warn "highlightPub ".$hglghtPub;
!       $count++;
!       my $hglghtPY =$count % 2;
! #     warn "highlightPY ".$hglghtPY;
!       $count++;
!       my $hglghtHB =$count % 2;
! #     warn "highlightHB ".$hglghtHB;
!       $count++;
!       my $hglghtLOC =$count % 2;
! #     warn "highlightLOC ".$hglghtLOC;
!       
! #     undef @select;
! #     push @select,"";
! #     for (my $i=1950;$i<=2050;$i++) {
! #             push @select, $i;
! #     }
! #     my $CGIpublicationyear=CGI::scrolling_list( -name     => 'Filter',
! #                             -id => 'Filter',
! #                             -values   => address@hidden,
! #                             -size     => 1,
! #                             -multiple => 0 );
        
        $req = $dbh->prepare("select distinctrow itemtype from biblioitems 
order by itemtype");
***************
*** 218,222 ****
        my @mime = ( C4::Context->preference("MIME") );
        foreach my $mime (@mime){
!               warn "".$mime;
        }
        
--- 237,241 ----
        my @mime = ( C4::Context->preference("MIME") );
        foreach my $mime (@mime){
! #             warn "".$mime;
        }
        
***************
*** 245,253 ****
                                        hascote=> $hascote,
                                        hlghtcote => $hlghtcote,
                                        CGIFromCoteClass => $CGIcote,
                                        CGIToCoteClass => $CGIcote,
                                        CGIItemType => $CGIitemtype,
!                                       CGIFromPublicationYear => 
$CGIpublicationyear,
!                                       CGIToPublicationYear => 
$CGIpublicationyear,
                                        CGIPublisher => $CGIpublisher,
                                        CGIBranch => $CGIbranch,
--- 264,277 ----
                                        hascote=> $hascote,
                                        hlghtcote => $hlghtcote,
+                                       hglghtDT => $hglghtDT,
+                                       hglghtPub => $hglghtPub,
+                                       hglghtPY => $hglghtPY,
+                                       hglghtHB => $hglghtHB,
+                                       hglghtLOC => $hglghtLOC,
                                        CGIFromCoteClass => $CGIcote,
                                        CGIToCoteClass => $CGIcote,
                                        CGIItemType => $CGIitemtype,
! #                                     CGIFromPublicationYear => 
$CGIpublicationyear,
! #                                     CGIToPublicationYear => 
$CGIpublicationyear,
                                        CGIPublisher => $CGIpublisher,
                                        CGIBranch => $CGIbranch,
***************
*** 359,363 ****
        }
        $strsth .=" order by $linefield";
!       warn "". $strsth;
        
        my $sth = $dbh->prepare( $strsth );
--- 383,387 ----
        }
        $strsth .=" order by $linefield";
! #     warn "". $strsth;
        
        my $sth = $dbh->prepare( $strsth );
***************
*** 401,405 ****
        } 
        $strsth2 .= " order by $colfield";
!       warn "". $strsth2;
        my $sth2 = $dbh->prepare( $strsth2 );
        if ((@colfilter) and ($colfilter[1])) {
--- 425,429 ----
        } 
        $strsth2 .= " order by $colfield";
! #     warn "". $strsth2;
        my $sth2 = $dbh->prepare( $strsth2 );
        if ((@colfilter) and ($colfilter[1])) {
***************
*** 461,470 ****
        $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;
!       warn "filling table";
        while (my ($row, $col, $value) = $dbcalc->fetchrow) {
!               warn "filling table $row / $col / $value ";
                $table{$row}->{$col}=$value;
                $table{$row}->{totalrow}+=$value;
--- 485,494 ----
        $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;
! #     warn "filling table";
        while (my ($row, $col, $value) = $dbcalc->fetchrow) {
! #             warn "filling table $row / $col / $value ";
                $table{$row}->{$col}=$value;
                $table{$row}->{totalrow}+=$value;
***************
*** 486,497 ****
        }
        
!       warn "footer processing";
        foreach my $col ( @loopcol ) {
                my $total=0;
                foreach my $row ( @looprow ) {
                        $total += $table{$row->{rowtitle}}->{$col->{coltitle}};
!                       warn "value added 
".$table{$row->{rowtitle}}->{$col->{coltitle}}. "for line ".$row->{rowtitle};
                }
!               warn "summ for column ".$col->{coltitle}."  = ".$total;
                push @loopfooter, {'totalcol' => $total};
        }
--- 510,521 ----
        }
        
! #     warn "footer processing";
        foreach my $col ( @loopcol ) {
                my $total=0;
                foreach my $row ( @looprow ) {
                        $total += $table{$row->{rowtitle}}->{$col->{coltitle}};
! #                     warn "value added 
".$table{$row->{rowtitle}}->{$col->{coltitle}}. "for line ".$row->{rowtitle};
                }
! #             warn "summ for column ".$col->{coltitle}."  = ".$total;
                push @loopfooter, {'totalcol' => $total};
        }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]