Revision 3d1ae2d9
Von Moritz Bunkus vor fast 12 Jahren hinzugefügt
SL/Controller/DeliveryPlan.pm | ||
---|---|---|
51 | 51 |
|
52 | 52 |
$self->prepare_report; |
53 | 53 |
|
54 |
$self->{orderitems} = $self->get_models(%{ $self->db_args });
|
|
54 |
my $orderitems = $self->get_models(%{ $self->db_args });
|
|
55 | 55 |
|
56 |
$self->list_objects;
|
|
56 |
$self->report_generator_list_objects(report => $self->{report}, objects => $orderitems);
|
|
57 | 57 |
} |
58 | 58 |
|
59 | 59 |
# private functions |
... | ... | |
190 | 190 |
$self->set_report_generator_sort_options(report => $report, sortable_columns => \@sortable); |
191 | 191 |
|
192 | 192 |
$self->disable_pagination if $report->{options}{output_format} =~ /^(pdf|csv)$/i; |
193 |
|
|
194 |
$self->{report_data} = { |
|
195 |
column_defs => \%column_defs, |
|
196 |
columns => \@columns, |
|
197 |
}; |
|
198 |
} |
|
199 |
|
|
200 |
sub list_objects { |
|
201 |
my ($self) = @_; |
|
202 |
my $column_defs = $self->{report_data}{column_defs}; |
|
203 |
for my $obj (@{ $self->{orderitems} || [] }) { |
|
204 |
$self->{report}->add_data({ |
|
205 |
map { |
|
206 |
$_ => { |
|
207 |
data => $column_defs->{$_}{sub} ? $column_defs->{$_}{sub}->($obj) |
|
208 |
: $obj->can($_) ? $obj->$_ |
|
209 |
: $obj->{$_}, |
|
210 |
link => $column_defs->{$_}{obj_link} ? $column_defs->{$_}{obj_link}->($obj) : '', |
|
211 |
}, |
|
212 |
} @{ $self->{report_data}{columns} || {} } |
|
213 |
}); |
|
214 |
} |
|
215 |
|
|
216 |
return $self->{report}->generate_with_headers; |
|
217 | 193 |
} |
218 | 194 |
|
219 | 195 |
sub make_filter_summary { |
Auch abrufbar als: Unified diff
Refactoring: list_objects() aus Controllern in ReportGenerator-Helfer verschieben