Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 08fe8308

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

  • ID 08fe8308b7d6cc26a9e3b1e671c3787246daf4fd
  • Vorgänger 7ddaf9c4
  • Nachfolger 98121947

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

Unterschiede anzeigen:

SL/Controller/Order.pm
2172 2172
    $self->order->add_phone_notes($phone_note) if $is_new;
2173 2173
  }
2174 2174

  
2175
  my @converted_from_oe_ids;
2176
  if ($::form->{converted_from_oe_id}) {
2177
    @converted_from_oe_ids = split ' ', $::form->{converted_from_oe_id};
2178
    set_record_link_conversions(
2179
      $self->order,
2180
      'SL::DB::Order'     => \@converted_from_oe_ids,
2181
      'SL::DB::OrderItem' => $::form->{converted_from_orderitems_ids},
2182
    );
2183
  }
2184
  if ($::form->{converted_from_reclamation_id}) {
2185
    my @converted_from_reclamation_ids = split ' ', $::form->{converted_from_reclamation_id};
2186
    set_record_links_conversions(
2187
      $self->order,
2188
      'SL::DB::Reclamation'     => \@converted_from_reclamation_ids,
2189
      'SL::DB::ReclamationItem' => $::form->{converted_from_reclamation_items_ids},
2190
    );
2191
  }
2192

  
2175 2193
  $db->with_transaction(sub {
2176 2194
    my $validity_token;
2177 2195
    if (!$self->order->id) {
......
2195 2213
    SL::DB::OrderVersion->new(oe_id => $self->order->id, version => 1)->save unless scalar @{ $self->order->order_version };
2196 2214

  
2197 2215
    # link records
2198
    if ($::form->{converted_from_oe_id}) {
2199
      my @converted_from_oe_ids = split ' ', $::form->{converted_from_oe_id};
2200
      set_record_link_conversions(
2201
        $self->order,
2202
        'SL::DB::Order'     => \@converted_from_oe_ids,
2203
        'SL::DB::OrderItem' => $::form->{converted_from_orderitems_ids},
2204
      );
2205

  
2216
    if (@converted_from_oe_ids) {
2206 2217
      $self->link_requirement_specs_linking_to_created_from_objects(@converted_from_oe_ids);
2207 2218
    }
2208
    if ($::form->{converted_from_reclamation_id}) {
2209
      my @converted_from_reclamation_ids = split ' ', $::form->{converted_from_reclamation_id};
2210
      set_record_links_conversions(
2211
        $self->order,
2212
        'SL::DB::Reclamation'     => \@converted_from_reclamation_ids,
2213
        'SL::DB::ReclamationItem' => $::form->{converted_from_reclamation_items_ids},
2214
      );
2215
    }
2216 2219

  
2217 2220
    $self->set_project_in_linked_requirement_specs if $self->order->globalproject_id;
2218 2221

  

Auch abrufbar als: Unified diff