Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision dbf2d709

Von Sven Schöling vor mehr als 1 Jahr hinzugefügt

  • ID dbf2d709b206dd1c0f43f0224524fe04e503476e
  • Vorgänger c1f1f681
  • Nachfolger 9452d6b8

RecordLink: in controller vor dem Speichern und ausserhalb der TX behandeln

Unterschiede anzeigen:

SL/Controller/Order.pm
2132 2132
    $self->order->add_phone_notes($phone_note) if $is_new;
2133 2133
  }
2134 2134

  
2135
  my @converted_from_oe_ids;
2136
  if ($::form->{converted_from_oe_id}) {
2137
    @converted_from_oe_ids = split ' ', $::form->{converted_from_oe_id};
2138
    set_record_link_conversions(
2139
      $self->order,
2140
      'SL::DB::Order'     => \@converted_from_oe_ids,
2141
      'SL::DB::OrderItem' => $::form->{converted_from_orderitems_ids},
2142
    );
2143
  }
2144
  if ($::form->{converted_from_reclamation_id}) {
2145
    my @converted_from_reclamation_ids = split ' ', $::form->{converted_from_reclamation_id};
2146
    set_record_links_conversions(
2147
      $self->order,
2148
      'SL::DB::Reclamation'     => \@converted_from_reclamation_ids,
2149
      'SL::DB::ReclamationItem' => $::form->{converted_from_reclamation_items_ids},
2150
    );
2151
  }
2152

  
2135 2153
  $db->with_transaction(sub {
2136 2154
    my $validity_token;
2137 2155
    if (!$self->order->id) {
......
2155 2173
    SL::DB::OrderVersion->new(oe_id => $self->order->id, version => 1)->save unless scalar @{ $self->order->order_version };
2156 2174

  
2157 2175
    # link records
2158
    if ($::form->{converted_from_oe_id}) {
2159
      my @converted_from_oe_ids = split ' ', $::form->{converted_from_oe_id};
2160
      set_record_link_conversions(
2161
        $self->order,
2162
        'SL::DB::Order'     => \@converted_from_oe_ids,
2163
        'SL::DB::OrderItem' => $::form->{converted_from_orderitems_ids},
2164
      );
2165

  
2176
    if (@converted_from_oe_ids) {
2166 2177
      $self->link_requirement_specs_linking_to_created_from_objects(@converted_from_oe_ids);
2167 2178
    }
2168
    if ($::form->{converted_from_reclamation_id}) {
2169
      my @converted_from_reclamation_ids = split ' ', $::form->{converted_from_reclamation_id};
2170
      set_record_links_conversions(
2171
        $self->order,
2172
        'SL::DB::Reclamation'     => \@converted_from_reclamation_ids,
2173
        'SL::DB::ReclamationItem' => $::form->{converted_from_reclamation_items_ids},
2174
      );
2175
    }
2176 2179

  
2177 2180
    $self->set_project_in_linked_requirement_specs if $self->order->globalproject_id;
2178 2181

  

Auch abrufbar als: Unified diff