Lines 692-697
elsif ($phase eq 'Run this report'){
Link Here
|
692 |
my $report_id = $input->param('reports'); |
692 |
my $report_id = $input->param('reports'); |
693 |
my @sql_params = $input->multi_param('sql_params'); |
693 |
my @sql_params = $input->multi_param('sql_params'); |
694 |
my @param_names = $input->multi_param('param_name'); |
694 |
my @param_names = $input->multi_param('param_name'); |
|
|
695 |
my $want_full_chart = $input->param('want_full_chart') || 0; |
695 |
|
696 |
|
696 |
# offset algorithm |
697 |
# offset algorithm |
697 |
if ($input->param('page')) { |
698 |
if ($input->param('page')) { |
Lines 828-834
elsif ($phase eq 'Run this report'){
Link Here
|
828 |
my ($sql,$header_types) = get_prepped_report( $sql, \@param_names, \@sql_params); |
829 |
my ($sql,$header_types) = get_prepped_report( $sql, \@param_names, \@sql_params); |
829 |
$template->param(header_types => $header_types); |
830 |
$template->param(header_types => $header_types); |
830 |
my ( $sth, $errors ) = execute_query( $sql, $offset, $limit, undef, $report_id ); |
831 |
my ( $sth, $errors ) = execute_query( $sql, $offset, $limit, undef, $report_id ); |
831 |
my ($sth2, $errors2) = execute_query($sql); |
|
|
832 |
my $total = nb_rows($sql) || 0; |
832 |
my $total = nb_rows($sql) || 0; |
833 |
unless ($sth) { |
833 |
unless ($sth) { |
834 |
die "execute_query failed to return sth for report $report_id: $sql"; |
834 |
die "execute_query failed to return sth for report $report_id: $sql"; |
Lines 839-852
elsif ($phase eq 'Run this report'){
Link Here
|
839 |
my @cells = map { +{ cell => $_ } } @$row; |
839 |
my @cells = map { +{ cell => $_ } } @$row; |
840 |
push @rows, { cells => \@cells }; |
840 |
push @rows, { cells => \@cells }; |
841 |
} |
841 |
} |
842 |
while (my $row = $sth2->fetchrow_arrayref()) { |
842 |
if( $want_full_chart ){ |
843 |
my @cells = map { +{ cell => $_ } } @$row; |
843 |
my ($sth2, $errors2) = execute_query($sql); |
844 |
push @allrows, { cells => \@cells }; |
844 |
while (my $row = $sth2->fetchrow_arrayref()) { |
|
|
845 |
my @cells = map { +{ cell => $_ } } @$row; |
846 |
push @allrows, { cells => \@cells }; |
847 |
} |
845 |
} |
848 |
} |
846 |
} |
849 |
} |
847 |
|
850 |
|
848 |
my $totpages = int($total/$limit) + (($total % $limit) > 0 ? 1 : 0); |
851 |
my $totpages = int($total/$limit) + (($total % $limit) > 0 ? 1 : 0); |
849 |
my $url = "/cgi-bin/koha/reports/guided_reports.pl?reports=$report_id&phase=Run%20this%20report&limit=$limit"; |
852 |
my $url = "/cgi-bin/koha/reports/guided_reports.pl?reports=$report_id&phase=Run%20this%20report&limit=$limit&want_full_chart=$want_full_chart"; |
850 |
if (@param_names) { |
853 |
if (@param_names) { |
851 |
$url = join('&param_name=', $url, map { URI::Escape::uri_escape_utf8($_) } @param_names); |
854 |
$url = join('&param_name=', $url, map { URI::Escape::uri_escape_utf8($_) } @param_names); |
852 |
} |
855 |
} |
853 |
- |
|
|