Revision acf2e152
Von Bernd Bleßmann vor mehr als 3 Jahren hinzugefügt
SL/Controller/Part.pm | ||
---|---|---|
125 | 125 |
# $self->part has been loaded, parsed and validated without errors and is ready to be saved |
126 | 126 |
$self->part->db->with_transaction(sub { |
127 | 127 |
|
128 |
if ( $params{save_as_new} ) { |
|
129 |
$self->part( $self->part->clone_and_reset_deep ); |
|
130 |
$self->part->partnumber(undef); # will be assigned by _before_save_set_partnumber |
|
131 |
}; |
|
132 |
|
|
133 | 128 |
$self->part->save(cascade => 1); |
134 | 129 |
|
135 | 130 |
SL::DB::History->new( |
... | ... | |
162 | 157 |
} |
163 | 158 |
} |
164 | 159 |
|
165 |
sub action_save_as_new { |
|
166 |
my ($self) = @_; |
|
167 |
$self->action_save(save_as_new=>1); |
|
168 |
} |
|
169 |
|
|
170 | 160 |
sub action_delete { |
171 | 161 |
my ($self) = @_; |
172 | 162 |
|
Auch abrufbar als: Unified diff
Part Controller: Aktion save_as_new wird nicht verwendet, sondern use_as_new