}
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 });
}
$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} });
}
--- /dev/null
+<div id='csv_import_report'></div>
+
+<script type='text/javascript'>
+ function get_report(target, source, data){
+ $.ajax({
+ url: source,
+ success: function (rsp) {
+ $(target).html(rsp);
+ $(target).find('.paginate').find('a').click(function(event){ redirect_event(event, target) });
+ },
+ data: data,
+ });
+ };
+
+ function redirect_event(event, target){
+ event.preventDefault();
+ get_report(target, event.target + '', {});
+ }
+
+ $(document).ready(function(){
+ get_report('#csv_import_report', 'controller.pl', { action: 'CsvImport/report', 'no_layout': 1, 'id': [% SELF.background_job.data_as_hash.report_id %] });
+ });
+
+
+</script>
+
[% USE HTML %]
[% USE LxERP %]
[% USE L %]
-
<h3>[%- LxERP.t8('Import result') %]</h3>
+[%- PROCESS 'common/paginate.html' pages=SELF.pages, base_url = SELF.base_url %]
<table>
[%- FOREACH rownum = SELF.display_rows %]
[%- IF loop.first %]
</table>
-[%- PROCESS 'common/paginate.html' pages=SELF.pages %]
+[%- PROCESS 'common/paginate.html' pages=SELF.pages, base_url = SELF.base_url %]
<script type='text/javascript'>
$(function(){ $('#action_import').show() });