Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 2a8b6a74

Von Tamino Steinert vor etwa 1 Jahr hinzugefügt

  • ID 2a8b6a74f3e8cbeeef1acc3f7292696db8096582
  • Vorgänger 22d2337c
  • Nachfolger 64b180ac

S:C:Record: Hole Typen aus Datenbankobjekt wenn ID gegeben

Unterschiede anzeigen:

SL/Controller/Reclamation.pm
1110 1110
sub init_type {
1111 1111
  my ($self) = @_;
1112 1112

  
1113
  if (none { $::form->{type} eq $_ } @{$self->valid_types}) {
1113
  my $type = $self->reclamation->record_type : $::form->{type};
1114
  if (none { $type eq $_ } @{$self->valid_types}) {
1114 1115
    die "Not a valid type for reclamation";
1115 1116
  }
1116 1117

  
1117
  $self->type($::form->{type});
1118
  $self->type($type);
1118 1119
}
1119 1120

  
1120 1121
sub init_cv {
......
1362 1363
    $reclamation = SL::DB::Reclamation->new(id => $::form->{id})->load();
1363 1364
  } else {
1364 1365
    $reclamation = SL::DB::Reclamation->new(
1365
                     record_type        => $self->type,
1366
                     record_type        => $::form->{type},
1366 1367
                     reclamation_items  => [],
1367 1368
                     currency_id => $::instance_conf->get_currency_id(),
1368 1369
                   );
1369 1370
  }
1370 1371

  
1371
  my $cv_id_method = $self->cv . '_id';
1372
  my $cv_id_method = $reclamation->type_data->properties('customervendor'). '_id';
1372 1373
  if (!$::form->{id} && $::form->{$cv_id_method}) {
1373 1374
    $reclamation->$cv_id_method($::form->{$cv_id_method});
1374 1375
    $reclamation = SL::Model::Record->update_after_customer_vendor_change($reclamation);
......
2365 2366
}
2366 2367

  
2367 2368
sub init_type_data {
2368
  SL::DB::Helper::TypeDataProxy->new('SL::DB::Reclamation', $::form->{type});
2369
  my ($self) = @_;
2370
  SL::DB::Helper::TypeDataProxy->new('SL::DB::Reclamation', $self->reclamation->record_type);
2369 2371
}
2370 2372

  
2371 2373
1;

Auch abrufbar als: Unified diff