Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 94cb09ab

Von Bernd Bleßmann vor mehr als 1 Jahr hinzugefügt

  • ID 94cb09ab235c7c25aacec46623c710e9dd26ef80
  • Vorgänger 192c2ae9
  • Nachfolger 54f8895e

kundentyp-spezifische Artikelnummern: Position/Reihenfolge

Unterschiede anzeigen:

SL/Controller/Part.pm
540 540
    $self->js->flash('info', t8("This business has already been added."));
541 541
  };
542 542

  
543
  my $position = scalar @{ $self->businessmodels } + 1;
544

  
543 545
  my $bm = SL::DB::BusinessModel->new(#parts_id             => $::form->{part}->{id},
544 546
                                      business             => $business,
545 547
                                      model                => '',
546 548
                                      part_description     => '',
547 549
                                      part_longdescription => '',
550
                                      position             => $position,
548 551
  ) or die "Can't create BusinessModel object";
549 552

  
550 553
  my $row_as_html = $self->p->render('part/_businessmodel_row',
......
1023 1026

  
1024 1027
  $self->part->businessmodels([]);
1025 1028

  
1029
  my $position = 0;
1026 1030
  my $businessmodels = delete($::form->{businessmodels}) || [];
1027 1031
  foreach my $businessmodel ( @{$businessmodels} ) {
1028 1032
    next unless $businessmodel->{business_id};
1029 1033

  
1034
    $position++;
1030 1035
    my $bm = SL::DB::BusinessModel->new( #parts_id            => $self->part->id,            # will be assigned by row add_businessmodels
1031 1036
                                         business_id          => $businessmodel->{business_id},
1032 1037
                                         model                => $businessmodel->{model} || '',
1033 1038
                                         part_description     => $businessmodel->{part_description} || '',
1034 1039
                                         part_longdescription => $businessmodel->{part_longdescription} || '',
1040
                                         position             => $position,
1035 1041
    );
1036 1042

  
1037 1043
    $self->part->add_businessmodels($bm);

Auch abrufbar als: Unified diff