Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision ee932f3f

Von Moritz Bunkus vor etwa 12 Jahren hinzugefügt

  • ID ee932f3f74983a16977a6d89314a3ab09df20faa
  • Vorgänger 28cda5b6
  • Nachfolger e3d22623

DeliveryPlan: Weitere Umstellung auf Sorted-Helper

Unterschiede anzeigen:

SL/Controller/DeliveryPlan.pm
60 60
      raw_bottom_info_text => $bottom,
61 61
      controller_class     => 'DeliveryPlan',
62 62
    },
63
    report_generator_export_options => [ qw(list filter sort_by sort_dir) ],
63
    report_generator_export_options => [ qw(list filter) ],
64 64
  );
65 65

  
66 66
  $self->{orderitems} = $self->get_models(%{ $self->db_args });
......
166 166

  
167 167
  map { $column_defs{$_}->{text} = $::locale->text( $self->get_sort_spec->{$_}->{title} ) } keys %column_defs;
168 168

  
169
  my %current_sort_params = $self->get_current_sort_params;
170

  
171
  for my $col (@sortable) {
172
    $column_defs{$col}{link} = $self->get_callback(
173
      # TODO: column header links from helper
174
      sort_by  => $col,
175
      sort_dir => ($current_sort_params{by} eq $col ? 1 - $current_sort_params{dir} : $current_sort_params{dir}),
176
    );
177
  }
178

  
179 169
  map { $column_defs{$_}->{visible} = 1 } @visible;
180 170

  
181 171
  $report->set_columns(%column_defs);
182 172
  $report->set_column_order(@columns);
183 173
  $report->set_options(allow_pdf_export => 1, allow_csv_export => 1);
184
  $report->set_sort_indicator($current_sort_params{by}, $current_sort_params{dir});
185 174
  $report->set_export_options(@{ $params{report_generator_export_options} || [] });
186 175
  $report->set_options(
187 176
    %{ $params{report_generator_options} || {} },
......
190 179
    title                => $::locale->text('Delivery Plan'),
191 180
  );
192 181
  $report->set_options_from_form;
182
  $self->set_report_generator_sort_options(report => $report, sortable_columns => \@sortable);
193 183

  
194 184
  $self->disable_pagination if $report->{options}{output_format} =~ /^(pdf|csv)$/i;
195 185

  

Auch abrufbar als: Unified diff