Revision c2b69643
Von Sven Schöling vor etwa 11 Jahren hinzugefügt
SL/Controller/Helper/ReportGenerator.pm | ||
---|---|---|
89 | 89 |
croak "Parameter 'objects' must exist and be an array reference" if ref($params{objects}) ne 'ARRAY'; |
90 | 90 |
croak "Parameter 'report' must exist and be an instance of SL::ReportGenerator" if ref($params{report}) ne 'SL::ReportGenerator'; |
91 | 91 |
croak "Parameter 'options', if exists, must be a hash reference" if $params{options} && (ref($params{options}) ne 'HASH'); |
92 |
$params{layout} //= 1; |
|
92 | 93 |
|
93 | 94 |
my $column_defs = $params{report}->{columns}; |
94 | 95 |
my @columns = $params{report}->get_visible_columns; |
... | ... | |
110 | 111 |
$params{report}->add_data(\%data); |
111 | 112 |
} |
112 | 113 |
|
113 |
return $params{report}->generate_with_headers(%{ $params{options} || {}}); |
|
114 |
if ($params{layout}) { |
|
115 |
return $params{report}->generate_with_headers(%{ $params{options} || {}}); |
|
116 |
} else { |
|
117 |
my $html = $params{report}->generate_html_content(%{ $params{options} || {}}); |
|
118 |
$self->render(\$html , { layout => 0, process => 0 }); |
|
119 |
} |
|
114 | 120 |
} |
115 | 121 |
|
116 | 122 |
1; |
SL/Controller/SellPriceInformation.pm | ||
---|---|---|
20 | 20 |
); |
21 | 21 |
|
22 | 22 |
my $db_args = $self->setup_for_list(%list_params); |
23 |
$self->{pages} = SL::DB::Manager::OrderItem->paginate(%list_params, args => $db_args, per_page => 10);
|
|
23 |
$self->{pages} = SL::DB::Manager::OrderItem->paginate(%list_params, args => $db_args, per_page => 5);
|
|
24 | 24 |
|
25 | 25 |
my $bottom = $::form->parse_html_template('price_information/report_bottom', { SELF => $self }); |
26 | 26 |
|
... | ... | |
34 | 34 |
|
35 | 35 |
my $orderitems = SL::DB::Manager::OrderItem->get_all(%$db_args); |
36 | 36 |
|
37 |
$self->report_generator_list_objects(report => $self->{report}, objects => $orderitems, options => { no_layout => 1 });
|
|
37 |
$self->report_generator_list_objects(report => $self->{report}, objects => $orderitems, layout => 0, header => 0);
|
|
38 | 38 |
} |
39 | 39 |
|
40 | 40 |
# private functions |
Auch abrufbar als: Unified diff
SellPriceInformation: Layout nicht mit generieren.
Spart 10 Requests und umgeht einen interessanten Browserbug - Javascripte die aus ajax Request html eingelesen werden, werden vom Broweser mit einer zufälligen Nummer versehen um ein 304 zu vermeiden. Das hat gerade bei schwachen Leitungen zu massiv unnötigen Requests geführt.