Revision 8118132d
Von Tamino Steinert vor etwa 1 Jahr hinzugefügt
SL/Controller/Order.pm | ||
---|---|---|
106 | 106 |
die "No 'from_type' was given." unless ($from_type); |
107 | 107 |
die "No 'from_id' was given." unless ($from_id); |
108 | 108 |
|
109 |
my %flags = (); |
|
110 |
if (defined($::form->{from_item_ids})) { |
|
111 |
my %use_item = map { $_ => 1 } @{$::form->{from_item_ids}}; |
|
112 |
$flags{item_filter} = sub { |
|
113 |
my ($item) = @_; |
|
114 |
return %use_item{$item->id}; |
|
115 |
} |
|
116 |
} |
|
117 |
|
|
109 | 118 |
my $record = SL::Model::Record->get_record($from_type, $from_id); |
110 |
my $order = SL::Model::Record->new_from_workflow($record, $self->type); |
|
119 |
my $order = SL::Model::Record->new_from_workflow($record, $self->type, %flags);
|
|
111 | 120 |
$self->order($order); |
112 | 121 |
|
113 | 122 |
if (ref($record) eq 'SL::DB::Reclamation') { |
... | ... | |
772 | 781 |
$self->save(); |
773 | 782 |
flash_later('info', $self->type_data->text('saved')); |
774 | 783 |
|
784 |
my %additional_params = (); |
|
785 |
if ($::form->{only_selected_items}) { |
|
786 |
my $from_item_ids = $::form->{selected_items} || []; |
|
787 |
$additional_params{from_item_ids} = $from_item_ids; |
|
788 |
} |
|
789 |
|
|
775 | 790 |
$self->redirect_to( |
776 | 791 |
controller => $to_controller, |
777 | 792 |
action => 'add_from_record', |
778 | 793 |
type => $to_type, |
779 | 794 |
from_id => $self->order->id, |
780 | 795 |
from_type => $self->order->type, |
796 |
%additional_params, |
|
781 | 797 |
); |
782 | 798 |
} |
783 | 799 |
|
Auch abrufbar als: Unified diff
Model::Record: Workflow mit ausgewählten Positionen ermöglichen