Lines 55-61
my $usecache = Koha::Caches->get_instance->memcached_cache;
Link Here
|
55 |
|
55 |
|
56 |
my $phase = $input->param('phase') // ''; |
56 |
my $phase = $input->param('phase') // ''; |
57 |
my $flagsrequired; |
57 |
my $flagsrequired; |
58 |
if ( ( $phase eq 'Build new' ) || ( $phase eq 'Create report from SQL' ) || ( $phase eq 'Edit SQL' ) ){ |
58 |
if ( ( $phase eq 'Build new' ) || ( $phase eq 'Create report from SQL' ) || ( $phase eq 'Edit SQL' ) |
|
|
59 |
|| ( $phase eq 'Build new from existing' ) ) { |
59 |
$flagsrequired = 'create_reports'; |
60 |
$flagsrequired = 'create_reports'; |
60 |
} |
61 |
} |
61 |
elsif ( $phase eq 'Use saved' ) { |
62 |
elsif ( $phase eq 'Use saved' ) { |
Lines 973-997
elsif ($phase eq 'Export'){
Link Here
|
973 |
); |
974 |
); |
974 |
} |
975 |
} |
975 |
|
976 |
|
976 |
elsif ( $phase eq 'Create report from SQL' ) { |
977 |
elsif ( $phase eq 'Create report from SQL' || $phase eq 'Create report from existing' ) { |
977 |
|
978 |
|
978 |
my ($group, $subgroup); |
979 |
my ($group, $subgroup, $sql, $reportname, $notes); |
979 |
# allow the user to paste in sql |
|
|
980 |
if ( $input->param('sql') ) { |
980 |
if ( $input->param('sql') ) { |
981 |
$group = $input->param('report_group'); |
981 |
$group = $input->param('report_group'); |
982 |
$subgroup = $input->param('report_subgroup'); |
982 |
$subgroup = $input->param('report_subgroup'); |
983 |
$template->param( |
983 |
$sql = $input->param('sql') // ''; |
984 |
'sql' => scalar $input->param('sql') // '', |
984 |
$reportname = $input->param('reportname') // ''; |
985 |
'reportname' => scalar $input->param('reportname') // '', |
985 |
$notes = $input->param('notes') // ''; |
986 |
'notes' => scalar $input->param('notes') // '', |
986 |
} |
987 |
); |
987 |
elsif ( my $report_id = $input->param('report_id') ) { |
|
|
988 |
my $report = Koha::Reports->find($report_id); |
989 |
$group = $report->report_group; |
990 |
$subgroup = $report->report_subgroup; |
991 |
$sql = $report->savedsql // ''; |
992 |
$reportname = $report->report_name // ''; |
993 |
$notes = $report->notes // ''; |
988 |
} |
994 |
} |
|
|
995 |
|
989 |
$template->param( |
996 |
$template->param( |
|
|
997 |
sql => $sql, |
998 |
reportname => $reportname, |
999 |
notes => $notes, |
990 |
'create' => 1, |
1000 |
'create' => 1, |
991 |
'groups_with_subgroups' => groups_with_subgroups($group, $subgroup), |
1001 |
'groups_with_subgroups' => groups_with_subgroups($group, $subgroup), |
992 |
'public' => '0', |
1002 |
'public' => '0', |
993 |
'cache_expiry' => 300, |
1003 |
'cache_expiry' => 300, |
994 |
'usecache' => $usecache, |
1004 |
'usecache' => $usecache, |
|
|
1005 |
|
995 |
); |
1006 |
); |
996 |
} |
1007 |
} |
997 |
|
1008 |
|
998 |
- |
|
|