Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision e5a690f9

Von Sven Schöling vor fast 12 Jahren hinzugefügt

  • ID e5a690f9c51aab7ac96130cb11b9d4c740c84016
  • Vorgänger 638e0b03
  • Nachfolger e5b33700

paginating für test_import

Unterschiede anzeigen:

SL/Controller/CsvImport.pm
96 96
  }
97 97

  
98 98
  if ($data->{progress}{finished} || $data->{errors}) {
99
    $self->action_report(report_id => $data->{report_id}, no_layout => 1);
99
    $self->render('csv_import/_deferred_report', { no_layout => 1 });
100 100
  } else {
101 101
    $self->render('csv_import/_deferred_results', { no_layout => 1 });
102 102
  }
......
165 165
  $self->{report_rows}   = $self->{report}->folded_rows(rows => $rows);
166 166
  $self->{report_status} = $self->{report}->folded_status(status => $status);
167 167
  $self->{pages} = $pages;
168
  $self->{base_url} = $self->url_for(action => 'report', id => $report_id, no_layout => $params{no_layout} || $::form->{no_layout} );
168 169

  
169
  my $base_url = $self->url_for(action => 'report', id => $report_id);
170

  
171
  $self->render('csv_import/report', { no_layout => $params{no_layout} }, base_url => $base_url);
170
  $self->render('csv_import/report', { no_layout => $params{no_layout} || $::form->{no_layout} });
172 171
}
173 172

  
174 173

  
templates/webpages/csv_import/_deferred_report.html
1
<div id='csv_import_report'></div>
2

  
3
<script type='text/javascript'>
4
  function get_report(target, source, data){
5
    $.ajax({
6
      url:        source,
7
      success:    function (rsp) {
8
        $(target).html(rsp);
9
        $(target).find('.paginate').find('a').click(function(event){ redirect_event(event, target) });
10
      },
11
      data:       data,
12
    });
13
  };
14

  
15
  function redirect_event(event, target){
16
    event.preventDefault();
17
    get_report(target, event.target + '', {});
18
  }
19

  
20
  $(document).ready(function(){
21
    get_report('#csv_import_report', 'controller.pl', { action: 'CsvImport/report', 'no_layout': 1, 'id': [% SELF.background_job.data_as_hash.report_id %] });
22
  });
23

  
24

  
25
</script>
26

  
templates/webpages/csv_import/report.html
1 1
[% USE HTML %]
2 2
[% USE LxERP %]
3 3
[% USE L %]
4

  
5 4
 <h3>[%- LxERP.t8('Import result') %]</h3>
6 5

  
6
[%- PROCESS 'common/paginate.html' pages=SELF.pages, base_url = SELF.base_url %]
7 7
 <table>
8 8
[%- FOREACH rownum = SELF.display_rows %]
9 9
 [%- IF loop.first %]
......
29 29

  
30 30
 </table>
31 31

  
32
[%- PROCESS 'common/paginate.html' pages=SELF.pages %]
32
[%- PROCESS 'common/paginate.html' pages=SELF.pages, base_url = SELF.base_url %]
33 33

  
34 34
<script type='text/javascript'>
35 35
  $(function(){ $('#action_import').show() });

Auch abrufbar als: Unified diff