Lines 163-178
elsif ( $phase eq 'Delete Multiple') {
Link Here
|
163 |
} |
163 |
} |
164 |
|
164 |
|
165 |
elsif ( $phase eq 'Delete Saved') { |
165 |
elsif ( $phase eq 'Delete Saved') { |
166 |
|
166 |
|
167 |
# delete a report from the saved reports list |
167 |
# delete a report from the saved reports list |
168 |
my $ids = $input->param('reports'); |
168 |
my $ids = $input->param('reports'); |
169 |
delete_report($ids); |
169 |
delete_report($ids); |
170 |
print $input->redirect("/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved"); |
170 |
print $input->redirect("/cgi-bin/koha/reports/guided_reports.pl?phase=Use%20saved"); |
171 |
exit; |
171 |
exit; |
172 |
} |
172 |
} |
173 |
|
173 |
|
174 |
elsif ( $phase eq 'Show SQL'){ |
174 |
elsif ( $phase eq 'Show SQL'){ |
175 |
|
175 |
|
176 |
my $id = $input->param('reports'); |
176 |
my $id = $input->param('reports'); |
177 |
my $report = Koha::Reports->find($id); |
177 |
my $report = Koha::Reports->find($id); |
178 |
$template->param( |
178 |
$template->param( |
Lines 998-1003
elsif ( $phase eq 'Create report from SQL' || $phase eq 'Create report from exis
Link Here
|
998 |
$notes = $report->notes // ''; |
998 |
$notes = $report->notes // ''; |
999 |
} |
999 |
} |
1000 |
|
1000 |
|
|
|
1001 |
my $tables = get_tables(); |
1002 |
|
1001 |
$template->param( |
1003 |
$template->param( |
1002 |
sql => $sql, |
1004 |
sql => $sql, |
1003 |
reportname => $reportname, |
1005 |
reportname => $reportname, |
Lines 1007-1012
elsif ( $phase eq 'Create report from SQL' || $phase eq 'Create report from exis
Link Here
|
1007 |
'public' => '0', |
1009 |
'public' => '0', |
1008 |
'cache_expiry' => 300, |
1010 |
'cache_expiry' => 300, |
1009 |
'usecache' => $usecache, |
1011 |
'usecache' => $usecache, |
|
|
1012 |
'tables' => $tables, |
1010 |
|
1013 |
|
1011 |
); |
1014 |
); |
1012 |
} |
1015 |
} |
Lines 1024-1029
sub header_cell_loop {
Link Here
|
1024 |
return \@headers; |
1027 |
return \@headers; |
1025 |
} |
1028 |
} |
1026 |
|
1029 |
|
|
|
1030 |
#get a list of available tables for auto-complete |
1031 |
sub get_tables { |
1032 |
my $result = {}; |
1033 |
my $tables = C4::Reports::Guided->get_all_tables(); |
1034 |
for my $table (@{$tables}) { |
1035 |
my $sql = "SHOW COLUMNS FROM $table"; |
1036 |
my $rows = C4::Context->dbh->selectall_arrayref($sql, { Slice => {} }); |
1037 |
for my $row (@{$rows}) { |
1038 |
push @{$result->{$table}}, $row->{Field}; |
1039 |
} |
1040 |
} |
1041 |
return $result; |
1042 |
} |
1043 |
|
1027 |
foreach (1..6) { |
1044 |
foreach (1..6) { |
1028 |
$template->{VARS}->{'build' . $_} and last; |
1045 |
$template->{VARS}->{'build' . $_} and last; |
1029 |
} |
1046 |
} |
1030 |
- |
|
|