Revision f687160f
Von Bernd Bleßmann vor 12 Monaten hinzugefügt
SL/Controller/Order.pm | ||
---|---|---|
3 | 3 |
use strict; |
4 | 4 |
use parent qw(SL::Controller::Base); |
5 | 5 |
|
6 |
use SL::Helper::Flash qw(flash_later); |
|
6 |
use SL::Helper::Flash qw(flash flash_later);
|
|
7 | 7 |
use SL::HTML::Util; |
8 | 8 |
use SL::Presenter::Tag qw(select_tag hidden_tag div_tag); |
9 | 9 |
use SL::Locale::String qw(t8); |
... | ... | |
121 | 121 |
my $order = SL::Model::Record->new_from_workflow($record, $self->type, %flags); |
122 | 122 |
$self->order($order); |
123 | 123 |
|
124 |
# Warn on order locked items if they are not wanted for this record type |
|
125 |
if ($self->type_data->no_order_locked_parts) { |
|
126 |
my @order_locked_positions = map { $_->position } grep { $_->part->order_locked } @{ $self->order->items_sorted }; |
|
127 |
flash('warning', t8('This record containts not orderable items at position #1', join ', ', @order_locked_positions)) if @order_locked_positions; |
|
128 |
} |
|
129 |
|
|
124 | 130 |
$self->recalc(); |
125 | 131 |
$self->pre_render(); |
126 | 132 |
|
... | ... | |
884 | 890 |
|
885 | 891 |
# workflows to all types of this controller |
886 | 892 |
sub action_save_and_order_workflow { |
887 |
$_[0]->save_and_redirect_to( |
|
893 |
my ($self) = @_; |
|
894 |
|
|
895 |
$self->save_and_redirect_to( |
|
888 | 896 |
action => 'order_workflow', |
889 |
type => $_[0]->type,
|
|
897 |
type => $self->type,
|
|
890 | 898 |
to_type => $::form->{to_type}, |
891 | 899 |
use_shipto => $::form->{use_shipto}, |
892 | 900 |
email_journal_id => $::form->{workflow_email_journal_id}, |
... | ... | |
959 | 967 |
$self->cv ($self->init_cv); |
960 | 968 |
$self->check_auth; |
961 | 969 |
|
970 |
# Warn on order locked items if they are not wanted for this record type |
|
971 |
if ($self->type_data->no_order_locked_parts) { |
|
972 |
my @order_locked_positions = map { $_->position } grep { $_->part->order_locked } @{ $self->order->items_sorted }; |
|
973 |
flash('warning', t8('This record containts not orderable items at position #1', join ', ', @order_locked_positions)) if @order_locked_positions; |
|
974 |
} |
|
975 |
|
|
962 | 976 |
$self->recalc(); |
963 | 977 |
$self->get_unalterable_data(); |
964 | 978 |
$self->pre_render(); |
Auch abrufbar als: Unified diff
Auslaufende Artikel: Warnung bei Workflows bei entsprechenden Belegen