Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 78969dec

Von Moritz Bunkus vor mehr als 7 Jahren hinzugefügt

  • ID 78969decd4c306cd524c94ef4844b20d57129867
  • Vorgänger ade508b5
  • Nachfolger bd12dbd6

Pflichtenhefte: bei Kundenänderung auch Kunden in Versionen ändern

Unterschiede anzeigen:

SL/Controller/RequirementSpec.pm
385 385
sub create_or_update {
386 386
  my $self   = shift;
387 387
  my $is_new = !$self->requirement_spec->id;
388
  my $previous_customer_id = $self->requirement_spec->customer_id;
388 389
  my $params = delete($::form->{requirement_spec}) || { };
389 390
  my $cvars  = delete($::form->{cvars})            || { };
390 391

  
......
425 426
      $self->requirement_spec($self->copy_source->create_copy(%{ $params }));
426 427
    } else {
427 428
      $self->requirement_spec->save(cascade => 1);
429

  
430
      # If the current requirement spec has versions and the
431
      # customer's been changed, then the customer of all the versions
432
      # has to be changed, too.
433
      if (   !$is_new
434
          && !$self->requirement_spec->is_template
435
          && ($previous_customer_id != $self->requirement_spec->customer_id)) {
436
        SL::DB::Manager::RequirementSpec->update_all(
437
          set   => { customer_id     => $self->requirement_spec->customer_id },
438
          where => [ working_copy_id => $self->requirement_spec->id          ],
439
        );
440
      }
428 441
    }
429 442
    1;
430 443
  })) {

Auch abrufbar als: Unified diff