# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
-use strict;
-#use warnings; FIXME - Bug 2505
-use C4::Auth;
+use Modern::Perl;
+use C4::Auth qw( get_template_and_user );
use CGI qw ( -utf8 );
use C4::Context;
-use C4::Output;
-use C4::Koha;
-use C4::Circulation;
-use C4::Reports;
-use Koha::DateUtils;
+use C4::Output qw( output_html_with_http_headers );
+use C4::Reports qw( GetDelimiterChoices );
+use Koha::DateUtils qw( dt_from_string output_pref );
use Koha::ItemTypes;
use Koha::Patron::Categories;
-use Date::Calc qw(Delta_Days);
+use Date::Calc qw( Delta_Days );
=head1 NAME
=cut
-my $input = new CGI;
+my $input = CGI->new;
my $do_it=$input->param('do_it');
my $fullreportname = "reports/issues_avg_stats.tt";
my $line = $input->param("Line");
my $calc = $input->param("Cellvalue");
my $output = $input->param("output");
my $basename = $input->param("basename");
-my $itype = C4::Context->preference('item-level_itypes') ? "items.itype" : "biblioitems.itemtype";
#warn "calcul : ".$calc;
my ($template, $borrowernumber, $cookie)
= get_template_and_user({template_name => $fullreportname,
query => $input,
type => "intranet",
- authnotrequired => 0,
flagsrequired => {reports => '*'},
- debug => 1,
});
our $sep = $input->param("sep");
$sep = "\t" if ($sep eq 'tabulation');
my @looprow;
my %globalline;
my $grantotal =0;
+ my $itype = C4::Context->preference('item-level_itypes') ? "items.itype" : "biblioitems.itemtype";
# extract parameters
my $dbh = C4::Context->dbh;
# warn "fin des titres colonnes";
my $i=0;
- my @totalcol;
my $hilighted=-1;
#Initialization of cell values.....
$dbcalc->execute;
# warn "filling table";
my $issues_count=0;
- my $previous_row;
- my $previous_col;
my $loanlength;
- my $err;
my $emptycol;
- my $weightrow;
while (my @data = $dbcalc->fetchrow) {
my ($row, $col, $issuedate, $returndate, $weight)=@data;
$emptycol=1 if (!defined($col));
$col = "zzEMPTY" if (!defined($col));
$row = "zzEMPTY" if (!defined($row));
- # fill returndate to avoid an error with date calc (needed for all non returned issues)
- $returndate= join '-',Date::Calc::Today if $returndate eq '0000-00-00';
# DateCalc returns => 0:0:WK:DD:HH:MM:SS the weeks, days, hours, minutes,
# and seconds between the two
$loanlength = Delta_Days(split(/-/,$issuedate),split (/-/,$returndate)) ;