Revision 63f2cbc1
Von Sven Schöling vor fast 12 Jahren hinzugefügt
SL/Controller/CsvImport.pm | ||
---|---|---|
130 | 130 |
my $report_id = $params{report_id} || $::form->{id}; |
131 | 131 |
|
132 | 132 |
$self->{report} = SL::DB::Manager::CsvImportReport->find_by(id => $report_id); |
133 |
my $num_rows = SL::DB::Manager::CsvImportReportRow->get_all_count(query => [ csv_import_report_id => $report_id ]);
|
|
133 |
my $num_rows = $self->{report}->numrows;
|
|
134 | 134 |
my $num_cols = SL::DB::Manager::CsvImportReportRow->get_all_count(query => [ csv_import_report_id => $report_id, row => 0 ]); |
135 | 135 |
|
136 | 136 |
# manual paginating, yuck |
... | ... | |
141 | 141 |
$pages->{cur} = $page < 1 ? 1 |
142 | 142 |
: $page > $pages->{max} ? $pages->{max} |
143 | 143 |
: $page; |
144 |
$pages->{common} = SL::DB::Helper::Paginated::make_common_pages($pages->{cur}, $pages->{max});
|
|
144 |
$pages->{common} = [ grep { $_->{visible} } @{ SL::DB::Helper::Paginated::make_common_pages($pages->{cur}, $pages->{max}) } ];
|
|
145 | 145 |
|
146 | 146 |
$self->{display_rows} = [ |
147 | 147 |
0, |
... | ... | |
380 | 380 |
profile => $clone_profile, |
381 | 381 |
type => $self->type, |
382 | 382 |
file => '', |
383 |
numrows => scalar @{ $self->data }, |
|
383 | 384 |
)->save(cascade => 1); |
384 | 385 |
|
385 | 386 |
my $dbh = $::form->get_standard_dbh; |
Auch abrufbar als: Unified diff
Anzahl der Zeilen für den Report cachen un indizieren
Da das auch mal gerne 4mio+ werden dauert das sonst elend lange.