|
Lines 802-816
if ( $op eq 'run' ) {
Link Here
|
| 802 |
: 0; |
802 |
: 0; |
| 803 |
|
803 |
|
| 804 |
# Determine if the user is running too many reports in total |
804 |
# Determine if the user is running too many reports in total |
| 805 |
my @total_running_report_ids; |
805 |
my @total_running_for_user_report_ids; |
| 806 |
my $total_running_reports_per_user_limit = C4::Context->config('total_running_reports_per_user_limit'); |
806 |
my $total_running_reports_per_user_limit = C4::Context->config('total_running_reports_per_user_limit'); |
| 807 |
if ( $total_running_reports_per_user_limit && C4::Context->userenv ) { |
807 |
if ( $total_running_reports_per_user_limit && C4::Context->userenv ) { |
| 808 |
my $user_id = C4::Context->userenv ? C4::Context->userenv->{number} : undef; |
808 |
my $user_id = C4::Context->userenv ? C4::Context->userenv->{number} : undef; |
| 809 |
@total_running_report_ids = Koha::Reports->running( { user_id => $user_id } ); |
809 |
@total_running_for_user_report_ids = Koha::Reports->running( { user_id => $user_id } ); |
| 810 |
} |
810 |
} |
| 811 |
my $total_running_reports_per_user_limit_exceeded = |
811 |
my $total_running_reports_per_user_limit_exceeded = |
| 812 |
$total_running_reports_per_user_limit |
812 |
$total_running_reports_per_user_limit |
| 813 |
? scalar(@total_running_report_ids) >= $total_running_reports_per_user_limit |
813 |
? scalar(@total_running_for_user_report_ids) >= $total_running_reports_per_user_limit |
|
|
814 |
: 0; |
| 815 |
|
| 816 |
# Determine if the Koha instance is running too many reports in total |
| 817 |
my @total_running_for_instance_report_ids; |
| 818 |
my $total_running_reports_per_instance_limit = C4::Context->config('total_running_reports_per_instance_limit'); |
| 819 |
if ( $total_running_reports_per_instance_limit && C4::Context->instanceenv ) { |
| 820 |
my $instance_id = C4::Context->instanceenv ? C4::Context->instanceenv->{number} : undef; |
| 821 |
@total_running_for_instance_report_ids = Koha::Reports->running(); |
| 822 |
} |
| 823 |
my $total_running_reports_per_instance_limit_exceeded = |
| 824 |
$total_running_reports_per_instance_limit |
| 825 |
? scalar(@total_running_for_instance_report_ids) >= $total_running_reports_per_instance_limit |
| 814 |
: 0; |
826 |
: 0; |
| 815 |
|
827 |
|
| 816 |
# offset algorithm |
828 |
# offset algorithm |
|
Lines 1011-1018
if ( $op eq 'run' ) {
Link Here
|
| 1011 |
? { duplicate_running_report_ids => \@duplicate_running_report_ids } |
1023 |
? { duplicate_running_report_ids => \@duplicate_running_report_ids } |
| 1012 |
: (), |
1024 |
: (), |
| 1013 |
$total_running_reports_per_user_limit_exceeded |
1025 |
$total_running_reports_per_user_limit_exceeded |
| 1014 |
? { total_running_reports_per_user_limit_exceeded => \@total_running_report_ids } |
1026 |
? { total_running_reports_per_user_limit_exceeded => \@total_running_for_user_report_ids } |
| 1015 |
: () |
1027 |
: (), |
|
|
1028 |
$total_running_reports_per_instance_limit_exceeded |
| 1029 |
? { |
| 1030 |
total_running_reports_per_instance_limit_exceeded => \@total_running_for_instance_report_ids |
| 1031 |
} |
| 1032 |
: (), |
| 1016 |
], |
1033 |
], |
| 1017 |
'sql_params' => \@sql_params, |
1034 |
'sql_params' => \@sql_params, |
| 1018 |
'param_names' => \@param_names, |
1035 |
'param_names' => \@param_names, |
| 1019 |
- |
|
|