X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=reports%2Fissues_stats.pl;h=4b6aa42541710709638143f4cd99b239424f567c;hb=9bc08e4e4c89718839b0d1039704cae4d0fe8cde;hp=d1c0a042134b3ad109ca98ff8790a71f7e683af3;hpb=c9ba8c899d854d4190df783f3f1aec2989d2cb10;p=koha_fer diff --git a/reports/issues_stats.pl b/reports/issues_stats.pl index d1c0a04213..4b6aa42541 100755 --- a/reports/issues_stats.pl +++ b/reports/issues_stats.pl @@ -61,7 +61,6 @@ my $monthsel = $input->param("PeriodMonthSel"); my $calc = $input->param("Cellvalue"); my $output = $input->param("output"); my $basename = $input->param("basename"); -my $mime = $input->param("MIME"); my ($template, $borrowernumber, $cookie) = get_template_and_user({ template_name => $fullreportname, query => $input, @@ -124,7 +123,7 @@ if ($do_it) { print map {$sep.$_->{totalcol}} @$cols; print $sep.@$results[0]->{total}; } - exit(1); # exit either way after $do_it + exit; # exit either way after $do_it } my $dbh = C4::Context->dbh; @@ -149,13 +148,10 @@ foreach (sort {$ccodes->{$a} cmp $ccodes->{$b}} keys %$ccodes) { push @ccodes, { code => $_, description => $ccodes->{$_} }; } -# various -my @mime = (C4::Context->preference("MIME")); - my $CGIextChoice=CGI::scrolling_list( -name => 'MIME', -id => 'MIME', - -values => \@mime, + -values => ['CSV'], # FIXME translation -size => 1, -multiple => 0 ); @@ -191,7 +187,7 @@ sub calculate { # Checking filters # my @loopfilter; - for (my $i=0;$i<=10;$i++) { + for (my $i=0;$i<=12;$i++) { my %cell; (@$filters[$i]) or next; if (($i==1) and (@$filters[$i-1])) { @@ -204,17 +200,21 @@ sub calculate { $cell{filter} = format_date(@$filters[$i]); } $cell{crit} = - ($i==0) ? "Period From" : - ($i==1) ? "Period To" : - ($i==2) ? "Patron Category =" : - ($i==3) ? "Item Type =" : - ($i==4) ? "Library =" : - ($i==5) ? "Collection =" : - ($i==6) ? "Location =" : - ($i==7) ? "Item callnumber >=" : - ($i==8) ? "Item callnumber <" : - ($i==9) ? "sort1 =" : - ($i==10)? "sort2 =" : "UNKNOWN FILTER ($i)"; + ( $i == 0 ) ? "Period From" + : ( $i == 1 ) ? "Period To" + : ( $i == 2 ) ? "Patron Category =" + : ( $i == 3 ) ? "Item Type =" + : ( $i == 4 ) ? "Library =" + : ( $i == 5 ) ? "Collection =" + : ( $i == 6 ) ? "Location =" + : ( $i == 7 ) ? "Item callnumber >=" + : ( $i == 8 ) ? "Item callnumber <" + : ( $i == 9 ) ? "sort1 =" + : ( $i == 10 ) ? "sort2 =" + : ( $i == 11 ) ? "Home library =" + : ( $i == 12 )? "Holding library =" + : "UNKNOWN FILTER ($i)"; + # FIXME - no translation mechanism ! push @loopfilter, \%cell; } @@ -227,29 +227,39 @@ sub calculate { $debug and warn "filtres ". join "|", @filters; my ($colsource, $linesource); $linefilter[1] = @$filters[1] if ($line =~ /datetime/); - $linefilter[0] = ($line =~ /datetime/) ? @$filters[0] : - ($line =~ /category/) ? @$filters[2] : - ($line =~ /itemtype/) ? @$filters[3] : - ($line =~ /branch/ ) ? @$filters[4] : - ($line =~ /ccode/ ) ? @$filters[5] : - ($line =~ /location/) ? @$filters[6] : - ($line =~ /sort1/ ) ? @$filters[9] : - ($line =~ /sort2/ ) ? @$filters[10] : undef ; - if ($line =~ /ccode/ or $line =~ /location/) { + $linefilter[0] = + ( $line =~ /datetime/ ) ? @$filters[0] + : ( $line =~ /category/ ) ? @$filters[2] + : ( $line =~ /itemtype/ ) ? @$filters[3] + : ( $line =~ /^branch/ ) ? @$filters[4] + : ( $line =~ /ccode/ ) ? @$filters[5] + : ( $line =~ /location/ ) ? @$filters[6] + : ( $line =~ /sort1/ ) ? @$filters[9] + : ( $line =~ /sort2/ ) ? @$filters[10] + : ( $line =~ /homebranch/) ? @$filters[11] + : ( $line =~ /holdingbranch/) ? @$filters[12] + : undef; + + if ( $line =~ /ccode/ or $line =~ /location/ or $line =~ /homebranch/ or $line =~ /holdingbranch/ ) { $linesource = 'items'; } my @colfilter; $colfilter[1] = @$filters[1] if ($column =~ /datetime/); - $colfilter[0] = ($column =~ /datetime/) ? @$filters[0] : - ($column =~ /category/) ? @$filters[2] : - ($column =~ /itemtype/) ? @$filters[3] : - ($column =~ /branch/ ) ? @$filters[4] : - ($column =~ /ccode/ ) ? @$filters[5] : - ($column =~ /location/) ? @$filters[6] : - ($column =~ /sort1/ ) ? @$filters[9] : - ($column =~ /sort1/ ) ? @$filters[10] : undef ; - if ($column =~ /ccode/ or $column =~ /location/) { + $colfilter[0] = + ( $column =~ /datetime/ ) ? @$filters[0] + : ( $column =~ /category/ ) ? @$filters[2] + : ( $column =~ /itemtype/ ) ? @$filters[3] + : ( $column =~ /^branch/ ) ? @$filters[4] + : ( $column =~ /ccode/ ) ? @$filters[5] + : ( $column =~ /location/ ) ? @$filters[6] + : ( $column =~ /sort1/ ) ? @$filters[9] + : ( $column =~ /sort1/ ) ? @$filters[10] + : ( $column =~ /homebranch/) ? @$filters[11] + : ( $column =~ /holdingbranch/) ? @$filters[12] + : undef; + + if ( $column =~ /ccode/ or $column =~ /location/ or $column =~ /homebranch/ or $column =~ /holdingbranch/ ) { $colsource = 'items'; } # 1st, loop rows.