use Modern::Perl;
use CGI qw ( -utf8 );
-use C4::Auth;
+use C4::Auth qw( get_template_and_user );
use C4::Context;
-use C4::Debug;
-use C4::Output;
+use C4::Output qw( output_html_with_http_headers );
# use Date::Manip; # TODO: add not borrowed since date X criteria
-use Data::Dumper;
=head1 catalogue_out
=cut
-my $input = new CGI;
+my $input = CGI->new;
my $do_it = $input->param('do_it');
my $limit = $input->param("Limit") || 10;
my $column = $input->param("Criteria");
template_name => "reports/catalogue_out.tt",
query => $input,
type => "intranet",
- authnotrequired => 0,
flagsrequired => { reports => 'execute_reports' },
- debug => 1,
}
);
}
$strsth2 .= " GROUP BY $column ORDER BY $column "; # needed for count
push @loopfilter, { crit => 'SQL', sql => 1, filter => $strsth2 };
- $debug and warn "catalogue_out SQL: " . $strsth2;
my $sth2 = $dbh->prepare($strsth2);
$sth2->execute;
}
$query .= " ORDER BY items.itemcallnumber DESC, barcode";
$query .= " LIMIT 0,$limit" if ($limit);
- $debug and warn "SQL : $query";
- # warn "SQL : $query";
push @loopfilter, { crit => 'SQL', sql => 1, filter => $query };
my $dbcalc = $dbh->prepare($query);
my (@temptable);
my $i = 0;
foreach my $cell ( @{ $tables{$tablename} } ) {
- if ( 0 == $i++ and $debug ) {
- my $dump = Dumper($cell);
- $dump =~ s/\n/ /gs;
- $dump =~ s/\s+/ /gs;
- print STDERR "first cell for $tablename: $dump";
- }
push @temptable, $cell;
}
my $count = scalar(@temptable);