Revision 95f9f85a
Von Sven Schöling vor etwa 11 Jahren hinzugefügt
SL/Controller/DeliveryPlan.pm | ||
---|---|---|
138 | 138 |
|
139 | 139 |
$column_defs{$_}->{text} = $sort_columns{$_} for keys %column_defs; |
140 | 140 |
|
141 |
$self->models->disable_plugin('paginated') if $report->{options}{output_format} =~ /^(pdf|csv)$/i; |
|
142 |
$self->models->finalize; # for filter laundering |
|
143 | 141 |
$report->set_options( |
144 | 142 |
std_column_visibility => 1, |
145 | 143 |
controller_class => 'DeliveryPlan', |
146 | 144 |
output_format => 'HTML', |
147 | 145 |
top_info_text => $::locale->text('Delivery Plan for currently outstanding sales orders'), |
148 |
raw_top_info_text => $self->render('delivery_plan/report_top', { output => 0 }), |
|
149 |
raw_bottom_info_text => $self->render('delivery_plan/report_bottom', { output => 0 }, models => $self->models), |
|
150 | 146 |
title => $::locale->text('Delivery Plan'), |
151 | 147 |
allow_pdf_export => 1, |
152 | 148 |
allow_csv_export => 1, |
... | ... | |
155 | 151 |
$report->set_column_order(@columns); |
156 | 152 |
$report->set_export_options(qw(list filter)); |
157 | 153 |
$report->set_options_from_form; |
154 |
$self->models->disable_plugin('paginated') if $report->{options}{output_format} =~ /^(pdf|csv)$/i; |
|
155 |
$self->models->finalize; # for filter laundering |
|
158 | 156 |
$self->models->set_report_generator_sort_options(report => $report, sortable_columns => \@sortable); |
157 |
$report->set_options( |
|
158 |
raw_top_info_text => $self->render('delivery_plan/report_top', { output => 0 }), |
|
159 |
raw_bottom_info_text => $self->render('delivery_plan/report_bottom', { output => 0 }, models => $self->models), |
|
160 |
); |
|
159 | 161 |
} |
160 | 162 |
|
161 | 163 |
sub make_filter_summary { |
SL/Controller/Helper/GetModels.pm | ||
---|---|---|
31 | 31 |
my ($self, $plugin) = @_; |
32 | 32 |
die 'cannot change internal state after finalize was called' if $self->finalized; |
33 | 33 |
die 'unsupported plugin' unless $self->can($plugin) && $self->$plugin && $self->$plugin->isa('SL::Controller::Helper::GetModels::Base'); |
34 |
|
|
34 | 35 |
$self->$plugin->disabled(1); |
35 | 36 |
} |
36 | 37 |
|
SL/Controller/Helper/GetModels/Paginated.pm | ||
---|---|---|
50 | 50 |
|
51 | 51 |
sub finalize { |
52 | 52 |
my ($self, %args) = @_; |
53 |
# return () unless $self->is_enabled; |
|
54 |
my %paginate_params = $self->read_params; |
|
55 | 53 |
|
56 |
# try to use Filtered if available and nothing else is configured, but don't |
|
57 |
# blow up if the controller does not use Filtered |
|
58 |
my %paginate_args = ref($self->paginate_args) eq 'CODE' ? %{ $self->paginate_args->($self) } |
|
59 |
: $self->paginate_args eq '__FILTER__' |
|
60 |
&& $self->get_models->filtered ? $self->get_models->filtered->read_params |
|
61 |
: $self->paginate_args ne '__FILTER__' ? do { my $sub = $self->paginate_args; %{ $self->get_models->controller->$sub() } } |
|
62 |
: (); |
|
54 |
if ($self->is_enabled) { |
|
55 |
my %paginate_params = $self->read_params; |
|
63 | 56 |
|
64 |
%args = $self->merge_args(\%args, \%paginate_args); |
|
57 |
# try to use Filtered if available and nothing else is configured, but don't |
|
58 |
# blow up if the controller does not use Filtered |
|
59 |
my %paginate_args = ref($self->paginate_args) eq 'CODE' ? %{ $self->paginate_args->($self) } |
|
60 |
: $self->paginate_args eq '__FILTER__' |
|
61 |
&& $self->get_models->filtered ? $self->get_models->filtered->read_params |
|
62 |
: $self->paginate_args ne '__FILTER__' ? do { my $sub = $self->paginate_args; %{ $self->get_models->controller->$sub() } } |
|
63 |
: (); |
|
65 | 64 |
|
66 |
my $calculated_params = $self->get_models->manager->paginate(%paginate_params, args => \%args); |
|
65 |
%args = $self->merge_args(\%args, \%paginate_args); |
|
66 |
|
|
67 |
my $calculated_params = $self->get_models->manager->paginate(%paginate_params, args => \%args); |
|
68 |
|
|
69 |
$self->calculated_params($calculated_params); |
|
70 |
} |
|
67 | 71 |
|
68 | 72 |
$self->paginated_args(\%args); |
69 |
$self->calculated_params($calculated_params); |
|
70 | 73 |
|
71 | 74 |
return %args; |
72 | 75 |
} |
SL/Controller/Helper/GetModels/Sorted.pm | ||
---|---|---|
123 | 123 |
return %params; |
124 | 124 |
} |
125 | 125 |
|
126 |
#sub _get_models_handler_for_sorted { |
|
127 |
# my ($self, %params) = @_; |
|
128 |
# |
|
129 |
# |
|
130 |
# |
|
131 |
# # $::lxdebug->dump(0, "GM handler for sorted; params nach modif:", \%params); |
|
132 |
# |
|
133 |
# return %params; |
|
134 |
#} |
|
135 |
|
|
136 |
|
|
137 | 126 |
sub init_form_params { |
138 | 127 |
[ qw(sort_by sort_dir) ] |
139 | 128 |
} |
Auch abrufbar als: Unified diff
paginating im druck gefixt. debugmeldungen aufgeräumt