|
Lines 18-23
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 ); |
|
Lines 609-620
sub execute_query {
Link Here
|
| 609 |
|
610 |
|
| 610 |
$dbh->do( 'UPDATE saved_sql SET last_run = NOW() WHERE id = ?', undef, $report_id ) if $report_id; |
611 |
$dbh->do( 'UPDATE saved_sql SET last_run = NOW() WHERE id = ?', undef, $report_id ) if $report_id; |
| 611 |
|
612 |
|
|
|
613 |
Koha::Logger->get( { prefix => 0, interface => 'reports', category => 'execute.query' } ) |
| 614 |
->info("Report $report_id : $sql, $offset, $limit") if $report_id; |
| 615 |
Koha::Logger->get( { prefix => 0, interface => 'reports', category => 'execute.time.start' } ) |
| 616 |
->info("Report starting: $report_id") if $report_id; |
| 617 |
|
| 612 |
my $sth = $dbh->prepare($sql); |
618 |
my $sth = $dbh->prepare($sql); |
| 613 |
eval { |
619 |
eval { |
| 614 |
$sth->execute(@$sql_params, $offset, $limit); |
620 |
$sth->execute(@$sql_params, $offset, $limit); |
| 615 |
}; |
621 |
}; |
| 616 |
warn $@ if $@; |
622 |
warn $@ if $@; |
| 617 |
|
623 |
|
|
|
624 |
Koha::Logger->get( { prefix => 0, interface => 'reports', category => 'execute.time.end' } ) |
| 625 |
->info("Report finished: $report_id") if $report_id; |
| 626 |
|
| 618 |
return ( $sth, { queryerr => $sth->errstr } ) if ($sth->err); |
627 |
return ( $sth, { queryerr => $sth->errstr } ) if ($sth->err); |
| 619 |
return ( $sth ); |
628 |
return ( $sth ); |
| 620 |
} |
629 |
} |