Revision ec90d597
Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt
| SL/Controller/Reclamation.pm | ||
|---|---|---|
|   die "No 'from_type' was given." unless ($from_type);
 | ||
|   die "No 'from_id' was given."   unless ($from_id);
 | ||
|  | ||
|   my %flags = ();
 | ||
|   if (defined($::form->{from_item_ids})) {
 | ||
|     my %use_item = map { $_ => 1 } @{$::form->{from_item_ids}};
 | ||
|     $flags{item_filter} = sub {
 | ||
|       my ($item) = @_;
 | ||
|       return %use_item{$item->id};
 | ||
|     }
 | ||
|   }
 | ||
|  | ||
|   my $record = SL::Model::Record->get_record($from_type, $from_id);
 | ||
|   my $reclamation = SL::Model::Record->new_from_workflow($record, $self->type);
 | ||
|   my $reclamation = SL::Model::Record->new_from_workflow($record, $self->type, %flags);
 | ||
|   $self->reclamation($reclamation);
 | ||
|  | ||
|   if ($record->type eq SALES_RECLAMATION_TYPE()) { # check for direct delivery
 | ||
| ... | ... | |
|   my $to_type = $::form->{to_type};
 | ||
|   my $to_controller = get_object_name_from_type($to_type);
 | ||
|  | ||
|   my %additional_params = ();
 | ||
|   if ($::form->{only_selected_items}) {
 | ||
|     my $from_item_ids = $::form->{selected_items} || [];
 | ||
|     $additional_params{from_item_ids} = $from_item_ids;
 | ||
|   }
 | ||
|  | ||
|   $self->save();
 | ||
|   flash_later('info', t8('The reclamation has been saved'));
 | ||
|  | ||
| ... | ... | |
|     type       => $to_type,
 | ||
|     from_id    => $self->reclamation->id,
 | ||
|     from_type  => $self->reclamation->type,
 | ||
|     %additional_params,
 | ||
|   );
 | ||
| }
 | ||
|  | ||
Auch abrufbar als: Unified diff
Model::Record: Workflow mit ausgewählten Positionen ermöglichen