Lines 18-26
package C4::Reports::Guided;
Link Here
|
18 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
18 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
19 |
|
19 |
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
|
|
21 |
|
21 |
use CGI qw ( -utf8 ); |
22 |
use CGI qw ( -utf8 ); |
22 |
use Carp qw( carp croak ); |
23 |
use Carp qw( carp croak ); |
23 |
use JSON qw( from_json ); |
24 |
use JSON qw( from_json ); |
|
|
25 |
use Time::HiRes qw(gettimeofday tv_interval); |
24 |
|
26 |
|
25 |
use C4::Context; |
27 |
use C4::Context; |
26 |
use C4::Koha qw( GetAuthorisedValues ); |
28 |
use C4::Koha qw( GetAuthorisedValues ); |
Lines 609-620
sub execute_query {
Link Here
|
609 |
|
611 |
|
610 |
$dbh->do( 'UPDATE saved_sql SET last_run = NOW() WHERE id = ?', undef, $report_id ) if $report_id; |
612 |
$dbh->do( 'UPDATE saved_sql SET last_run = NOW() WHERE id = ?', undef, $report_id ) if $report_id; |
611 |
|
613 |
|
|
|
614 |
Koha::Logger->get({ prefix => 0, interface => 'reports', category => 'execute.query'})->info("Report $report_id : $sql, $offset, $limit"); |
615 |
Koha::Logger->get({ prefix => 0, interface => 'reports', category => 'execute.time.start'})->info("Report starting: $report_id"); |
616 |
|
612 |
my $sth = $dbh->prepare($sql); |
617 |
my $sth = $dbh->prepare($sql); |
613 |
eval { |
618 |
eval { |
614 |
$sth->execute(@$sql_params, $offset, $limit); |
619 |
$sth->execute(@$sql_params, $offset, $limit); |
615 |
}; |
620 |
}; |
616 |
warn $@ if $@; |
621 |
warn $@ if $@; |
617 |
|
622 |
|
|
|
623 |
Koha::Logger->get({ prefix => 0, interface => 'reports', category => 'execute.time.end'})->info("Report finished: $report_id"); |
624 |
|
618 |
return ( $sth, { queryerr => $sth->errstr } ) if ($sth->err); |
625 |
return ( $sth, { queryerr => $sth->errstr } ) if ($sth->err); |
619 |
return ( $sth ); |
626 |
return ( $sth ); |
620 |
} |
627 |
} |