From e5a690f9c51aab7ac96130cb11b9d4c740c84016 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 16 Nov 2012 17:38:25 +0100 Subject: [PATCH] =?utf8?q?paginating=20f=C3=BCr=20test=5Fimport?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/CsvImport.pm | 7 +++-- .../webpages/csv_import/_deferred_report.html | 26 +++++++++++++++++++ templates/webpages/csv_import/report.html | 4 +-- 3 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 templates/webpages/csv_import/_deferred_report.html diff --git a/SL/Controller/CsvImport.pm b/SL/Controller/CsvImport.pm index 24c76ab3d..9d068c394 100644 --- a/SL/Controller/CsvImport.pm +++ b/SL/Controller/CsvImport.pm @@ -96,7 +96,7 @@ sub action_result { } if ($data->{progress}{finished} || $data->{errors}) { - $self->action_report(report_id => $data->{report_id}, no_layout => 1); + $self->render('csv_import/_deferred_report', { no_layout => 1 }); } else { $self->render('csv_import/_deferred_results', { no_layout => 1 }); } @@ -165,10 +165,9 @@ sub action_report { $self->{report_rows} = $self->{report}->folded_rows(rows => $rows); $self->{report_status} = $self->{report}->folded_status(status => $status); $self->{pages} = $pages; + $self->{base_url} = $self->url_for(action => 'report', id => $report_id, no_layout => $params{no_layout} || $::form->{no_layout} ); - my $base_url = $self->url_for(action => 'report', id => $report_id); - - $self->render('csv_import/report', { no_layout => $params{no_layout} }, base_url => $base_url); + $self->render('csv_import/report', { no_layout => $params{no_layout} || $::form->{no_layout} }); } diff --git a/templates/webpages/csv_import/_deferred_report.html b/templates/webpages/csv_import/_deferred_report.html new file mode 100644 index 000000000..ae657475d --- /dev/null +++ b/templates/webpages/csv_import/_deferred_report.html @@ -0,0 +1,26 @@ +
+ + + diff --git a/templates/webpages/csv_import/report.html b/templates/webpages/csv_import/report.html index 96fb0a547..7154e75a2 100644 --- a/templates/webpages/csv_import/report.html +++ b/templates/webpages/csv_import/report.html @@ -1,9 +1,9 @@ [% USE HTML %] [% USE LxERP %] [% USE L %] -

[%- LxERP.t8('Import result') %]

+[%- PROCESS 'common/paginate.html' pages=SELF.pages, base_url = SELF.base_url %] [%- FOREACH rownum = SELF.display_rows %] [%- IF loop.first %] @@ -29,7 +29,7 @@
-[%- PROCESS 'common/paginate.html' pages=SELF.pages %] +[%- PROCESS 'common/paginate.html' pages=SELF.pages, base_url = SELF.base_url %]