Revision 107d4c98
Von Bernd Bleßmann vor mehr als 1 Jahr 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; |
... | ... | |
2135 | 2134 |
delete_custom_shipto => $self->is_custom_shipto_to_delete || $self->order->custom_shipto->is_empty, |
2136 | 2135 |
items_to_delete => $items_to_delete, |
2137 | 2136 |
history => { snumbers => $self->get_history_snumbers() }, |
2137 |
link_requirement_specs_linking_to_created_from_objects => \@converted_from_oe_ids, |
|
2138 |
set_project_in_linked_requirement_specs => 1, |
|
2138 | 2139 |
); |
2139 | 2140 |
|
2140 | 2141 |
delete $::form->{form_validity_token}; |
... | ... | |
2811 | 2812 |
return @errors; |
2812 | 2813 |
} |
2813 | 2814 |
|
2814 |
sub link_requirement_specs_linking_to_created_from_objects { |
|
2815 |
my ($self, @converted_from_oe_ids) = @_; |
|
2816 |
|
|
2817 |
return unless @converted_from_oe_ids; |
|
2818 |
|
|
2819 |
my $rs_orders = SL::DB::Manager::RequirementSpecOrder->get_all(where => [ order_id => \@converted_from_oe_ids ]); |
|
2820 |
foreach my $rs_order (@{ $rs_orders }) { |
|
2821 |
SL::DB::RequirementSpecOrder->new( |
|
2822 |
order_id => $self->order->id, |
|
2823 |
requirement_spec_id => $rs_order->requirement_spec_id, |
|
2824 |
version_id => $rs_order->version_id, |
|
2825 |
)->save; |
|
2826 |
} |
|
2827 |
} |
|
2828 |
|
|
2829 |
sub set_project_in_linked_requirement_specs { |
|
2830 |
my ($self) = @_; |
|
2831 |
|
|
2832 |
my $rs_orders = SL::DB::Manager::RequirementSpecOrder->get_all(where => [ order_id => $self->order->id ]); |
|
2833 |
foreach my $rs_order (@{ $rs_orders }) { |
|
2834 |
next if $rs_order->requirement_spec->project_id == $self->order->globalproject_id; |
|
2835 |
|
|
2836 |
$rs_order->requirement_spec->update_attributes(project_id => $self->order->globalproject_id); |
|
2837 |
} |
|
2838 |
} |
|
2839 |
|
|
2840 | 2815 |
1; |
2841 | 2816 |
|
2842 | 2817 |
__END__ |
Auch abrufbar als: Unified diff
Order-Controller: Pflichtenheft: Verknüpfungen und Projekt setzen
über Model::Record