Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 8ad661b7

Von Bernd Bleßmann vor fast 4 Jahren hinzugefügt

  • ID 8ad661b7c9af26d9b0b5b565121bbdd735db6217
  • Vorgänger 4af0680d
  • Nachfolger 594ec6f3

Auftrags-Controller: Artikel-Mehrfachauswahl auf die des PartPickers umgestellt

Unterschiede anzeigen:

SL/Controller/Order.pm
43 43
use Rose::Object::MakeMethods::Generic
44 44
(
45 45
 scalar => [ qw(item_ids_to_delete is_custom_shipto_to_delete) ],
46
 'scalar --get_set_init' => [ qw(order valid_types type cv p multi_items_models all_price_factors search_cvpartnumber show_update_button) ],
46
 'scalar --get_set_init' => [ qw(order valid_types type cv p all_price_factors search_cvpartnumber show_update_button) ],
47 47
);
48 48

  
49 49

  
......
791 791
  $self->js->render();
792 792
}
793 793

  
794
# open the dialog for entering multiple items at once
795
sub action_show_multi_items_dialog {
796
  $_[0]->render('order/tabs/_multi_items_dialog', { layout => 0 },
797
                all_partsgroups => SL::DB::Manager::PartsGroup->get_all);
798
}
799

  
800
# update the filter results in the multi item dialog
801
sub action_multi_items_update_result {
802
  my $max_count = 100;
803

  
804
  $::form->{multi_items}->{filter}->{obsolete} = 0;
805

  
806
  my $count = $_[0]->multi_items_models->count;
807

  
808
  if ($count == 0) {
809
    my $text = SL::Presenter::EscapedText->new(text => $::locale->text('No results.'));
810
    $_[0]->render($text, { layout => 0 });
811
  } elsif ($count > $max_count) {
812
    my $text = SL::Presenter::EscapedText->new(text => $::locale->text('Too many results (#1 from #2).', $count, $max_count));
813
    $_[0]->render($text, { layout => 0 });
814
  } else {
815
    my $multi_items = $_[0]->multi_items_models->get;
816
    $_[0]->render('order/tabs/_multi_items_result', { layout => 0 },
817
                  multi_items => $multi_items);
818
  }
819
}
820

  
821 794
# add item rows for multiple items at once
822 795
sub action_add_multi_items {
823 796
  my ($self) = @_;
824 797

  
825
  my @form_attr = grep { $_->{qty_as_number} } @{ $::form->{add_multi_items} };
798
  my @form_attr = grep { $_->{qty_as_number} } @{ $::form->{add_items} };
826 799
  return $self->js->render() unless scalar @form_attr;
827 800

  
828 801
  my @items;
......
867 840
  }
868 841

  
869 842
  $self->js
870
    ->run('kivi.Order.close_multi_items_dialog')
843
    ->run('kivi.Part.close_picker_dialogs')
871 844
    ->run('kivi.Order.init_row_handlers')
872 845
    ->run('kivi.Order.renumber_positions')
873 846
    ->focus('#add_item_parts_id_name');
......
1183 1156
  $_[0]->make_order;
1184 1157
}
1185 1158

  
1186
# model used to filter/display the parts in the multi-items dialog
1187
sub init_multi_items_models {
1188
  SL::Controller::Helper::GetModels->new(
1189
    controller     => $_[0],
1190
    model          => 'Part',
1191
    with_objects   => [ qw(unit_obj) ],
1192
    disable_plugin => 'paginated',
1193
    source         => $::form->{multi_items},
1194
    sorted         => {
1195
      _default    => {
1196
        by  => 'partnumber',
1197
        dir => 1,
1198
      },
1199
      partnumber  => t8('Partnumber'),
1200
      description => t8('Description')}
1201
  );
1202
}
1203

  
1204 1159
sub init_all_price_factors {
1205 1160
  SL::DB::Manager::PriceFactor->get_all;
1206 1161
}
......
2175 2130

  
2176 2131
Displaying tax information
2177 2132

  
2178
=item * C<template/webpages/order/tabs/_multi_items_dialog.html>
2179

  
2180
Dialog for entering more than one item at once
2181

  
2182
=item * C<template/webpages/order/tabs/_multi_items_result.html>
2183

  
2184
Results for the filter in the multi items dialog
2185

  
2186 2133
=item * C<template/webpages/order/tabs/_price_sources_dialog.html>
2187 2134

  
2188 2135
Dialog for selecting price and discount sources
......
2256 2203
This behavior was implemented intentionally. But we can discuss, which behavior
2257 2204
should be implemented.
2258 2205

  
2259
=item *
2260

  
2261
C<show_multi_items_dialog> does not use the currently inserted string for
2262
filtering.
2263

  
2264 2206
=back
2265 2207

  
2266 2208
=head1 To discuss / Nice to have

Auch abrufbar als: Unified diff