$column_defs{$_}->{text} = $sort_columns{$_} for keys %column_defs;
- $self->models->disable_plugin('paginated') if $report->{options}{output_format} =~ /^(pdf|csv)$/i;
- $self->models->finalize; # for filter laundering
$report->set_options(
std_column_visibility => 1,
controller_class => 'DeliveryPlan',
output_format => 'HTML',
top_info_text => $::locale->text('Delivery Plan for currently outstanding sales orders'),
- raw_top_info_text => $self->render('delivery_plan/report_top', { output => 0 }),
- raw_bottom_info_text => $self->render('delivery_plan/report_bottom', { output => 0 }, models => $self->models),
title => $::locale->text('Delivery Plan'),
allow_pdf_export => 1,
allow_csv_export => 1,
$report->set_column_order(@columns);
$report->set_export_options(qw(list filter));
$report->set_options_from_form;
+ $self->models->disable_plugin('paginated') if $report->{options}{output_format} =~ /^(pdf|csv)$/i;
+ $self->models->finalize; # for filter laundering
$self->models->set_report_generator_sort_options(report => $report, sortable_columns => \@sortable);
+ $report->set_options(
+ raw_top_info_text => $self->render('delivery_plan/report_top', { output => 0 }),
+ raw_bottom_info_text => $self->render('delivery_plan/report_bottom', { output => 0 }, models => $self->models),
+ );
}
sub make_filter_summary {
my ($self, $plugin) = @_;
die 'cannot change internal state after finalize was called' if $self->finalized;
die 'unsupported plugin' unless $self->can($plugin) && $self->$plugin && $self->$plugin->isa('SL::Controller::Helper::GetModels::Base');
+
$self->$plugin->disabled(1);
}
sub finalize {
my ($self, %args) = @_;
-# return () unless $self->is_enabled;
- my %paginate_params = $self->read_params;
- # try to use Filtered if available and nothing else is configured, but don't
- # blow up if the controller does not use Filtered
- my %paginate_args = ref($self->paginate_args) eq 'CODE' ? %{ $self->paginate_args->($self) }
- : $self->paginate_args eq '__FILTER__'
- && $self->get_models->filtered ? $self->get_models->filtered->read_params
- : $self->paginate_args ne '__FILTER__' ? do { my $sub = $self->paginate_args; %{ $self->get_models->controller->$sub() } }
- : ();
+ if ($self->is_enabled) {
+ my %paginate_params = $self->read_params;
- %args = $self->merge_args(\%args, \%paginate_args);
+ # try to use Filtered if available and nothing else is configured, but don't
+ # blow up if the controller does not use Filtered
+ my %paginate_args = ref($self->paginate_args) eq 'CODE' ? %{ $self->paginate_args->($self) }
+ : $self->paginate_args eq '__FILTER__'
+ && $self->get_models->filtered ? $self->get_models->filtered->read_params
+ : $self->paginate_args ne '__FILTER__' ? do { my $sub = $self->paginate_args; %{ $self->get_models->controller->$sub() } }
+ : ();
- my $calculated_params = $self->get_models->manager->paginate(%paginate_params, args => \%args);
+ %args = $self->merge_args(\%args, \%paginate_args);
+
+ my $calculated_params = $self->get_models->manager->paginate(%paginate_params, args => \%args);
+
+ $self->calculated_params($calculated_params);
+ }
$self->paginated_args(\%args);
- $self->calculated_params($calculated_params);
return %args;
}
return %params;
}
-#sub _get_models_handler_for_sorted {
-# my ($self, %params) = @_;
-#
-#
-#
-# # $::lxdebug->dump(0, "GM handler for sorted; params nach modif:", \%params);
-#
-# return %params;
-#}
-
-
sub init_form_params {
[ qw(sort_by sort_dir) ]
}