Revision 8118132d
Von Tamino Steinert vor etwa 1 Jahr hinzugefügt
SL/Controller/Reclamation.pm | ||
---|---|---|
120 | 120 |
die "No 'from_type' was given." unless ($from_type); |
121 | 121 |
die "No 'from_id' was given." unless ($from_id); |
122 | 122 |
|
123 |
my %flags = (); |
|
124 |
if (defined($::form->{from_item_ids})) { |
|
125 |
my %use_item = map { $_ => 1 } @{$::form->{from_item_ids}}; |
|
126 |
$flags{item_filter} = sub { |
|
127 |
my ($item) = @_; |
|
128 |
return %use_item{$item->id}; |
|
129 |
} |
|
130 |
} |
|
131 |
|
|
123 | 132 |
my $record = SL::Model::Record->get_record($from_type, $from_id); |
124 |
my $reclamation = SL::Model::Record->new_from_workflow($record, $self->type); |
|
133 |
my $reclamation = SL::Model::Record->new_from_workflow($record, $self->type, %flags);
|
|
125 | 134 |
$self->reclamation($reclamation); |
126 | 135 |
|
127 | 136 |
if ($record->type eq SALES_RECLAMATION_TYPE()) { # check for direct delivery |
... | ... | |
504 | 513 |
my $to_type = $::form->{to_type}; |
505 | 514 |
my $to_controller = get_object_name_from_type($to_type); |
506 | 515 |
|
516 |
my %additional_params = (); |
|
517 |
if ($::form->{only_selected_items}) { |
|
518 |
my $from_item_ids = $::form->{selected_items} || []; |
|
519 |
$additional_params{from_item_ids} = $from_item_ids; |
|
520 |
} |
|
521 |
|
|
507 | 522 |
$self->save(); |
508 | 523 |
flash_later('info', t8('The reclamation has been saved')); |
509 | 524 |
|
... | ... | |
513 | 528 |
type => $to_type, |
514 | 529 |
from_id => $self->reclamation->id, |
515 | 530 |
from_type => $self->reclamation->type, |
531 |
%additional_params, |
|
516 | 532 |
); |
517 | 533 |
} |
518 | 534 |
|
Auch abrufbar als: Unified diff
Model::Record: Workflow mit ausgewählten Positionen ermöglichen