|
Lines 789-794
if ( $op eq 'run' ) {
Link Here
|
| 789 |
my $template_id = $input->param('template'); |
789 |
my $template_id = $input->param('template'); |
| 790 |
my $want_full_chart = $input->param('want_full_chart') || 0; |
790 |
my $want_full_chart = $input->param('want_full_chart') || 0; |
| 791 |
|
791 |
|
|
|
792 |
my @duplicate_running_report_ids; |
| 793 |
if ( C4::Context->userenv ) { |
| 794 |
my $user_id = C4::Context->userenv ? C4::Context->userenv->{number} : undef; |
| 795 |
@duplicate_running_report_ids = Koha::Reports->running( { report_id => $report_id, user_id => $user_id } ); |
| 796 |
} |
| 797 |
|
| 792 |
# offset algorithm |
798 |
# offset algorithm |
| 793 |
if ( $input->param('page') ) { |
799 |
if ( $input->param('page') ) { |
| 794 |
$offset = ( $input->param('page') - 1 ) * $limit; |
800 |
$offset = ( $input->param('page') - 1 ) * $limit; |
|
Lines 973-978
if ( $op eq 'run' ) {
Link Here
|
| 973 |
'id' => $report_id, |
979 |
'id' => $report_id, |
| 974 |
'template_id' => $template_id, |
980 |
'template_id' => $template_id, |
| 975 |
); |
981 |
); |
|
|
982 |
} elsif (@duplicate_running_report_ids) { |
| 983 |
$template->param( |
| 984 |
'sql' => $sql, |
| 985 |
'original_sql' => $original_sql, |
| 986 |
'id' => $report_id, |
| 987 |
'execute' => 1, |
| 988 |
'name' => $name, |
| 989 |
'notes' => $notes, |
| 990 |
'errors' => [ { duplicate_running_report_ids => \@duplicate_running_report_ids } ], |
| 991 |
'sql_params' => \@sql_params, |
| 992 |
'param_names' => \@param_names, |
| 993 |
); |
| 976 |
} else { |
994 |
} else { |
| 977 |
my ( $sql, $header_types ) = $report->prep_report( \@param_names, \@sql_params ); |
995 |
my ( $sql, $header_types ) = $report->prep_report( \@param_names, \@sql_params ); |
| 978 |
$template->param( header_types => $header_types ); |
996 |
$template->param( header_types => $header_types ); |
| 979 |
- |
|
|