View | Details | Raw Unified | Return to bug 32613
Collapse All | Expand All

(-)a/reports/guided_reports.pl (-2 / +8 lines)
Lines 1036-1042 sub header_cell_loop { Link Here
1036
#get a list of available tables for auto-complete
1036
#get a list of available tables for auto-complete
1037
sub get_tables {
1037
sub get_tables {
1038
    my $result = {};
1038
    my $result = {};
1039
    my $tables = C4::Reports::Guided->get_all_tables();
1039
    my $cache  = Koha::Caches->get_instance();
1040
    my $tables = $cache->get_from_cache("Reports-SQL_tables-for-autocomplete");
1041
1042
    return $tables
1043
      if $tables;
1044
1045
    $tables = C4::Reports::Guided->get_all_tables();
1040
    for my $table (@{$tables}) {
1046
    for my $table (@{$tables}) {
1041
        my $sql = "SHOW COLUMNS FROM $table";
1047
        my $sql = "SHOW COLUMNS FROM $table";
1042
        my $rows = C4::Context->dbh->selectall_arrayref($sql, { Slice => {} });
1048
        my $rows = C4::Context->dbh->selectall_arrayref($sql, { Slice => {} });
Lines 1044-1049 sub get_tables { Link Here
1044
            push @{$result->{$table}}, $row->{Field};
1050
            push @{$result->{$table}}, $row->{Field};
1045
        }
1051
        }
1046
    }
1052
    }
1053
    $cache->set_in_cache("Reports-SQL_tables-for-autocomplete",$result);
1047
    return $result;
1054
    return $result;
1048
}
1055
}
1049
1056
1050
- 

Return to bug 32613