Revision d5cb7ccd
Von Bernd Bleßmann vor fast 2 Jahren hinzugefügt
SL/Controller/Order.pm | ||
---|---|---|
29 | 29 |
use SL::DB::Language; |
30 | 30 |
use SL::DB::Reclamation; |
31 | 31 |
use SL::DB::RecordLink; |
32 |
use SL::DB::RequirementSpec; |
|
33 | 32 |
use SL::DB::Shipto; |
34 | 33 |
use SL::DB::Translation; |
35 | 34 |
use SL::DB::ValidityToken; |
... | ... | |
2095 | 2094 |
delete_custom_shipto => $self->is_custom_shipto_to_delete || $self->order->custom_shipto->is_empty, |
2096 | 2095 |
items_to_delete => $items_to_delete, |
2097 | 2096 |
history => { snumbers => $self->get_history_snumbers() }, |
2097 |
link_requirement_specs_linking_to_created_from_objects => \@converted_from_oe_ids, |
|
2098 |
set_project_in_linked_requirement_specs => 1, |
|
2098 | 2099 |
); |
2099 | 2100 |
|
2100 | 2101 |
delete $::form->{form_validity_token}; |
... | ... | |
2760 | 2761 |
return @errors; |
2761 | 2762 |
} |
2762 | 2763 |
|
2763 |
sub link_requirement_specs_linking_to_created_from_objects { |
|
2764 |
my ($self, @converted_from_oe_ids) = @_; |
|
2765 |
|
|
2766 |
return unless @converted_from_oe_ids; |
|
2767 |
|
|
2768 |
my $rs_orders = SL::DB::Manager::RequirementSpecOrder->get_all(where => [ order_id => \@converted_from_oe_ids ]); |
|
2769 |
foreach my $rs_order (@{ $rs_orders }) { |
|
2770 |
SL::DB::RequirementSpecOrder->new( |
|
2771 |
order_id => $self->order->id, |
|
2772 |
requirement_spec_id => $rs_order->requirement_spec_id, |
|
2773 |
version_id => $rs_order->version_id, |
|
2774 |
)->save; |
|
2775 |
} |
|
2776 |
} |
|
2777 |
|
|
2778 |
sub set_project_in_linked_requirement_specs { |
|
2779 |
my ($self) = @_; |
|
2780 |
|
|
2781 |
my $rs_orders = SL::DB::Manager::RequirementSpecOrder->get_all(where => [ order_id => $self->order->id ]); |
|
2782 |
foreach my $rs_order (@{ $rs_orders }) { |
|
2783 |
next if $rs_order->requirement_spec->project_id == $self->order->globalproject_id; |
|
2784 |
|
|
2785 |
$rs_order->requirement_spec->update_attributes(project_id => $self->order->globalproject_id); |
|
2786 |
} |
|
2787 |
} |
|
2788 |
|
|
2789 | 2764 |
1; |
2790 | 2765 |
|
2791 | 2766 |
__END__ |
Auch abrufbar als: Unified diff
Order-Controller: Pflichtenheft: Verknüpfungen und Projekt setzen
über Model::Record