Koha::Report - Koha Report Object class
my ( $is_sql_valid, $errors ) = $report->is_sql_valid;
$errors is a arrayref of hashrefs, keys can be sqlerr or queryerr.
Validate SQL query string so it only contains a select, not any of the harmful queries.
$self->check_columns('SELECT password from borrowers');
$self->check_columns( undef, [qw(password token)] );
Check if passed sql statement or column_names arrayref contains
forbidden column names (credentials etc.).
Returns all bad column names or empty list.
Return search info
Return properties that can be shared.
Clear a Mana report to be imported in Koha?
Prep the report and return executable sql with parameters embedded and a list of header types for building batch action links in the template.
The returned SQL is suffixed with a tracking comment of the form
/* { saved_sql.id: <id> } { user_id: <borrowernumber> } */
"running" in Koha::Reports parses this comment out of information_schema.processlist to detect concurrent runs of the same report. External log/audit tooling that consumes Koha SQL should treat this format as part of the public contract.
If duplicate_running_reports_per_user_limit is set in koha-conf.xml to a non-zero value and the current userenv already has at least that many runs of the same report in flight, this method throws Koha::Exceptions::Report::DuplicateRunning instead of returning. If total_running_reports_per_user_limit is set and the userenv already has at least that many reports of any kind in flight, it throws Koha::Exceptions::Report::TotalRunning. All report-execution entry points (the staff guided-reports UI, svc/report and opac/svc/report) go through here so the limits are enforced uniformly.
$sql = $self->_might_add_limit($sql);
Depending on pref ReportsExportLimit. If there is a limit defined and the report does not contain a limit already, this routine adds a LIMIT to $sql.
$sql = Koha::Report->apply_execution_time_limit($sql);
Apply SQL execution time limits based on report_sql_max_statement_time_seconds.
Returns name of corresponding DBIC resultset